From 5724d6ae6c2e0f21f27d31fac5a1708bc4180104 Mon Sep 17 00:00:00 2001 From: Alexandra Goff Date: Wed, 2 Aug 2023 14:26:03 -0700 Subject: [PATCH] [C] get fixed types --- packages/epo-widget-lib/package.json | 2 +- .../src/atomic/Blinker/Blinker.test.tsx | 2 +- .../src/atomic/Blinker/Blinker.tsx | 2 +- .../src/atomic/Blinker/Image/Image.tsx | 2 +- .../src/atomic/Blinker/_mocks/index.tsx | 2 +- .../src/atomic/Blinker/styles.ts | 2 +- packages/epo-widget-lib/src/types/astro.d.ts | 2 +- .../widgets/ColorTool/ColorTool.stories.tsx | 2 +- .../src/widgets/ColorTool/ColorTool.test.tsx | 2 +- .../src/widgets/ColorTool/ColorTool.tsx | 3 ++- .../FilterControls/FilterControls.tsx | 5 +++-- .../src/widgets/ColorTool/styles.ts | 2 +- .../widgets/SourceSelector/SourceSelector.tsx | 2 +- yarn.lock | 21 +++++++++++++++++++ 14 files changed, 37 insertions(+), 14 deletions(-) diff --git a/packages/epo-widget-lib/package.json b/packages/epo-widget-lib/package.json index 1d65e463..0facd707 100644 --- a/packages/epo-widget-lib/package.json +++ b/packages/epo-widget-lib/package.json @@ -86,7 +86,7 @@ "react-i18next": "^12.2.0" }, "dependencies": { - "@rubin-epo/epo-react-lib": "^2.0.1", + "@rubin-epo/epo-react-lib": "^2.0.3", "lodash": "^4.17.21", "styled-components": "^6.0.4", "use-resize-observer": "^9.1.0" diff --git a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.test.tsx b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.test.tsx index 75af79c8..b8ed4bbb 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.test.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.test.tsx @@ -28,8 +28,8 @@ describe("Blinker", () => { fireEvent.click(nextButton); - expect(testProps.blinkCallback).toHaveBeenCalled(); waitFor(() => { + expect(testProps.blinkCallback).toHaveBeenCalled(); expect(testProps.blinkCallback).toHaveBeenCalledWith( testProps.activeIndex + 1 ); diff --git a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx index 55d9a0cd..4c837e80 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx @@ -1,5 +1,5 @@ import { FunctionComponent, PropsWithChildren, useState } from "react"; -import { ImageShape } from "@rubin-epo/epo-react-lib"; +import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; import useInterval from "@/hooks/useInterval"; import * as Styled from "./styles"; import { getClampedArrayIndex } from "@/lib/utils"; diff --git a/packages/epo-widget-lib/src/atomic/Blinker/Image/Image.tsx b/packages/epo-widget-lib/src/atomic/Blinker/Image/Image.tsx index c5669fc9..814b5893 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/Image/Image.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/Image/Image.tsx @@ -1,4 +1,4 @@ -import { ImageShape } from "@rubin-epo/epo-react-lib"; +import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; import { FunctionComponent } from "react"; import * as Styled from "./styles"; diff --git a/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx b/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx index 562ca0c3..2ebd86ea 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx @@ -1,4 +1,4 @@ -import { ImageShape } from "@rubin-epo/epo-react-lib"; +import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; export const mockImages: ImageShape[] = [ { diff --git a/packages/epo-widget-lib/src/atomic/Blinker/styles.ts b/packages/epo-widget-lib/src/atomic/Blinker/styles.ts index f7d84e27..af2a49ee 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/styles.ts +++ b/packages/epo-widget-lib/src/atomic/Blinker/styles.ts @@ -13,7 +13,7 @@ export const BlinkerContainer = styled.div` height: 100%; `; -const breakSize: string = token("BREAK_MOBILE") as string; +const breakSize = token("BREAK_MOBILE"); export const BlinkerControls = styled(Controls)` grid-row: 2; diff --git a/packages/epo-widget-lib/src/types/astro.d.ts b/packages/epo-widget-lib/src/types/astro.d.ts index 03b60d4c..1da40e72 100644 --- a/packages/epo-widget-lib/src/types/astro.d.ts +++ b/packages/epo-widget-lib/src/types/astro.d.ts @@ -1,4 +1,4 @@ -import { ImageShape } from "@rubin-epo/epo-react-lib"; +import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; export type Band = "u" | "g" | "r" | "i" | "z" | "y"; export type SourceType = "supernova" | "galaxy" | "galaxyFilter"; diff --git a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.stories.tsx b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.stories.tsx index c85a2418..d442fac8 100644 --- a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.stories.tsx +++ b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.stories.tsx @@ -9,7 +9,7 @@ import { import { prepareData } from "./utilities"; import ColorTool from "."; -import { Option } from "@rubin-epo/epo-react-lib"; +import { Option } from "@rubin-epo/epo-react-lib/Select"; import { useState } from "react"; const meta: Meta = { diff --git a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.test.tsx b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.test.tsx index 8b3647a0..b2e6b3cd 100644 --- a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.test.tsx +++ b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.test.tsx @@ -11,7 +11,7 @@ import { colorOptions, multiSpectralOptions, } from "./__mocks__"; -import { Option } from "@rubin-epo/epo-react-lib"; +import { Option } from "@rubin-epo/epo-react-lib/Select"; import ColorTool from "."; import { getCategoryName } from "./utilities"; diff --git a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.tsx b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.tsx index af953e3b..d7021d07 100644 --- a/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.tsx +++ b/packages/epo-widget-lib/src/widgets/ColorTool/ColorTool.tsx @@ -7,7 +7,8 @@ import { resetFilters, } from "./utilities"; import * as Styled from "./styles"; -import { Select, Option, ListboxOption } from "@rubin-epo/epo-react-lib"; +import Select, { Option } from "@rubin-epo/epo-react-lib/Select"; +import { ListboxOption } from "@rubin-epo/epo-react-lib/SelectListbox"; import FilterControls from "./FilterControls"; import ImageComposite from "./ImageComposite"; diff --git a/packages/epo-widget-lib/src/widgets/ColorTool/FilterControls/FilterControls.tsx b/packages/epo-widget-lib/src/widgets/ColorTool/FilterControls/FilterControls.tsx index 25bc9975..173b4638 100644 --- a/packages/epo-widget-lib/src/widgets/ColorTool/FilterControls/FilterControls.tsx +++ b/packages/epo-widget-lib/src/widgets/ColorTool/FilterControls/FilterControls.tsx @@ -1,5 +1,6 @@ -import SelectListbox from "@rubin-epo/epo-react-lib/SelectListbox"; -import { ListboxOption } from "@rubin-epo/epo-react-lib"; +import SelectListbox, { + ListboxOption, +} from "@rubin-epo/epo-react-lib/SelectListbox"; import { FunctionComponent } from "react"; import { ImageFilter } from "../ColorTool"; import { getBrightnessValue } from "../utilities"; diff --git a/packages/epo-widget-lib/src/widgets/ColorTool/styles.ts b/packages/epo-widget-lib/src/widgets/ColorTool/styles.ts index 4e78cef9..af15dc88 100644 --- a/packages/epo-widget-lib/src/widgets/ColorTool/styles.ts +++ b/packages/epo-widget-lib/src/widgets/ColorTool/styles.ts @@ -8,7 +8,7 @@ export const WidgetContainer = styled.section` container: colorTool / inline-size; `; -const breakSize = token("BREAK_LARGE_TABLET_MIN") as string; +const breakSize = token("BREAK_LARGE_TABLET_MIN"); export const WidgetLayout = styled.div` --widget-areas: "title" "subtitle" "image" "caption" "controls" "reset"; diff --git a/packages/epo-widget-lib/src/widgets/SourceSelector/SourceSelector.tsx b/packages/epo-widget-lib/src/widgets/SourceSelector/SourceSelector.tsx index f8590b19..50c074cd 100644 --- a/packages/epo-widget-lib/src/widgets/SourceSelector/SourceSelector.tsx +++ b/packages/epo-widget-lib/src/widgets/SourceSelector/SourceSelector.tsx @@ -1,7 +1,7 @@ import { FunctionComponent, MouseEvent, ReactNode, useState } from "react"; import { Alert, Source } from "@/types/astro"; import { useTranslation } from "react-i18next"; -import { ImageShape } from "@rubin-epo/epo-react-lib"; +import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; import IconComposer from "@rubin-epo/epo-react-lib/IconComposer"; import * as Styled from "./styles"; import Points from "./Points"; diff --git a/yarn.lock b/yarn.lock index 128e74c5..47c7b0a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2636,6 +2636,27 @@ estree-walker "^2.0.2" picomatch "^2.3.1" +"@rubin-epo/epo-react-lib@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@rubin-epo/epo-react-lib/-/epo-react-lib-2.0.3.tgz#6b9567e88bb4d0992d35cce8e432ae80a79e8395" + integrity sha512-gTwTzPyhAFoC4DyD0P79YpN1YdrrK4/oId4F5RXyMyj84bnlDgThF92b7Pk//uQTmjVlIPaEHylyE8SivNDGsg== + dependencies: + "@castiron/style-mixins" "^1.0.6" + "@headlessui/react" "^1.7.5" + flickity "^3.0.0" + focus-trap "^7.4.2" + i18next "^22.4.10" + react "^18.2.0" + react-dom "^18.2.0" + react-i18next "^12.0.0" + react-player "^2.12.0" + react-share "^4.4.1" + react-slider "^2.0.4" + react-uid "^2.3.2" + storybook "^7.1.0" + styled-components "^6.0.4" + upgrade "^1.1.0" + "@rushstack/node-core-library@3.59.5": version "3.59.5" resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.59.5.tgz#38034d4c38b5ddd7d1c7f04233ce1b2209b7ae1f"