diff --git a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx index 1405b0a0..d2375002 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/Blinker.tsx @@ -5,7 +5,6 @@ import { useState, MouseEventHandler, } from "react"; -import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; import { getClampedArrayIndex } from "@/lib/utils"; import useInterval from "@/hooks/useInterval"; import ImageStack from "../ImageStack"; @@ -13,7 +12,11 @@ import Controls from "./Controls/Controls"; import * as Styled from "./styles"; export interface BlinkerProps { - images: ImageShape[]; + images: { + url: string; + width?: number; + height?: number; + }[]; activeIndex: number; autoplay?: boolean; loop?: boolean; 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 2ebd86ea..d2ed44c1 100644 --- a/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx +++ b/packages/epo-widget-lib/src/atomic/Blinker/_mocks/index.tsx @@ -1,6 +1,10 @@ import { ImageShape } from "@rubin-epo/epo-react-lib/Image"; -export const mockImages: ImageShape[] = [ +export const mockImages: Array<{ + url: string; + width?: number; + height?: number; +}> = [ { url: "https://rubin.canto.com/direct/image/4j5ucvv3gd61r1ilkl5kno1111/VFWbyjyDSQt66VtSnyvU0UxruMw/original?content-type=image%2Fjpeg&name=1464149233715_sci.jpg", }, diff --git a/packages/epo-widget-lib/src/atomic/ImageStack/index.tsx b/packages/epo-widget-lib/src/atomic/ImageStack/index.tsx index 0ac0eb4b..15a1a417 100644 --- a/packages/epo-widget-lib/src/atomic/ImageStack/index.tsx +++ b/packages/epo-widget-lib/src/atomic/ImageStack/index.tsx @@ -11,7 +11,11 @@ import after from "lodash/after"; import * as Styled from "./styles"; export interface ImageStackProps { - images: Array; + images: Array<{ + url: string; + width?: number; + height?: number; + }>; visible?: number | Array; describedById?: string; loadCallback?: () => void; diff --git a/packages/epo-widget-lib/src/types/astro.d.ts b/packages/epo-widget-lib/src/types/astro.d.ts index 6f5ccd98..6caa0a75 100644 --- a/packages/epo-widget-lib/src/types/astro.d.ts +++ b/packages/epo-widget-lib/src/types/astro.d.ts @@ -20,7 +20,11 @@ export interface BaseAlert { } export interface Alert extends BaseAlert { - image: ImageShape; + image: { + url: string; + width?: number; + height?: number; + }; } export interface SourceDataset { diff --git a/packages/epo-widget-lib/src/widgets/SourceSelector/SelectionList/index.tsx b/packages/epo-widget-lib/src/widgets/SourceSelector/SelectionList/index.tsx index 001914a1..312f20cf 100644 --- a/packages/epo-widget-lib/src/widgets/SourceSelector/SelectionList/index.tsx +++ b/packages/epo-widget-lib/src/widgets/SourceSelector/SelectionList/index.tsx @@ -18,20 +18,22 @@ const SelectionList: FunctionComponent = ({ const { t } = useTranslation(); return ( - - {sources.map(({ type, id }) => { - return ( - -
- {t("source_selector.selected_source", { - type: t(`source_selector.sources.${type}`), - })} -
-
{id}
-
- ); - })} -
+ {sources.length > 0 && ( + + {sources.map(({ type, id }) => { + return ( + +
+ {t("source_selector.selected_source", { + type: t(`source_selector.sources.${type}`), + })} +
+
{id}
+
+ ); + })} +
+ )} { if (radius) { if (typeof radius === "number") return Math.abs(radius); - return parseFloat(radius); + return toDecimalPercent(radius); } const { [type]: r = 0.04 } = defaultRadii; diff --git a/yarn.lock b/yarn.lock index 2ec95822..e5ed8953 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3464,21 +3464,6 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@rubin-epo/epo-react-lib@^2.0.32": - version "2.0.32" - resolved "https://registry.yarnpkg.com/@rubin-epo/epo-react-lib/-/epo-react-lib-2.0.32.tgz#ef2146ccc150cc37853584e9f191a22ac1f045eb" - integrity sha512-ACT0GNVQiSIWK01/38xM4SNsKU40gs2MsDkbtr7kbmb8z+RsKla5sU2J4DcdUJFmd7muAhgxuYzSGse23Nc57g== - dependencies: - "@castiron/style-mixins" "^1.0.6" - "@headlessui/react" "^2.0.3" - flickity "^3.0.0" - focus-trap "^7.4.2" - lodash "^4.17.21" - react-player "^2.14.1" - react-share "^4.4.1" - react-slider "^2.0.6" - styled-components "^6.1.1" - "@rushstack/eslint-patch@^1.10.1": version "1.10.2" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz#053f1540703faa81dea2966b768ee5581c66aeda"