@phillips/seldon 1.91.1 → 1.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/PhillipsLogo.svg.js +2 -2
- package/dist/assets/favorite.svg.js +5 -0
- package/dist/assets/icons.d.ts +1 -0
- package/dist/components/Countdown/Countdown.d.ts +4 -0
- package/dist/components/Countdown/Countdown.js +54 -42
- package/dist/components/Countdown/Duration.d.ts +2 -1
- package/dist/components/Countdown/Duration.js +7 -8
- package/dist/components/Detail/Detail.d.ts +2 -0
- package/dist/components/Detail/Detail.js +19 -13
- package/dist/components/Detail/Detail.stories.d.ts +1 -0
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +56 -42
- package/dist/components/Navigation/NavigationList/NavigationList.d.ts +4 -0
- package/dist/components/Navigation/NavigationList/NavigationList.js +40 -30
- package/dist/components/SeldonImage/SeldonImage.js +27 -26
- package/dist/index.d.ts +3 -0
- package/dist/index.js +199 -190
- package/dist/patterns/BidSnapshot/BidMessage.d.ts +27 -0
- package/dist/patterns/BidSnapshot/BidMessage.js +22 -0
- package/dist/patterns/BidSnapshot/BidMessage.test.d.ts +1 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.d.ts +67 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.js +61 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.stories.d.ts +27 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.test.d.ts +1 -0
- package/dist/patterns/BidSnapshot/index.d.ts +2 -0
- package/dist/patterns/BidSnapshot/types.d.ts +4 -0
- package/dist/patterns/BidSnapshot/types.js +4 -0
- package/dist/patterns/LanguageSelector/LanguageSelector.js +41 -41
- package/dist/patterns/LanguageSelector/utils.d.ts +7 -0
- package/dist/patterns/LanguageSelector/utils.js +7 -0
- package/dist/patterns/ObjectTile/ObjectTile.d.ts +69 -0
- package/dist/patterns/ObjectTile/ObjectTile.js +94 -0
- package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +41 -0
- package/dist/patterns/ObjectTile/ObjectTile.test.d.ts +1 -0
- package/dist/patterns/ObjectTile/index.d.ts +1 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.d.ts +2 -2
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +17 -17
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.stories.d.ts +3 -3
- package/dist/scss/_vars.scss +5 -1
- package/dist/scss/componentStyles.scss +2 -0
- package/dist/scss/components/Countdown/_countdown.scss +8 -0
- package/dist/scss/components/Countdown/_duration.scss +5 -4
- package/dist/scss/components/Detail/_detail.scss +20 -0
- package/dist/scss/components/SeldonImage/_seldonImage.scss +12 -4
- package/dist/scss/patterns/BidSnapshot/_bidSnapshot.scss +48 -0
- package/dist/scss/patterns/ObjectTile/_objectTile.scss +61 -0
- package/dist/site-furniture/Header/Header.d.ts +4 -0
- package/dist/site-furniture/Header/Header.js +39 -39
- package/dist/site-furniture/Header/hooks.d.ts +9 -0
- package/dist/site-furniture/Header/hooks.js +8 -0
- package/dist/site-furniture/Header/utils.js +2 -1
- package/dist/types/commonTypes.d.ts +5 -0
- package/dist/types/commonTypes.js +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
const
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { "data-testid": "header-logo-svg", viewBox: "0 0 131 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("g", { id: "Logo/ HP Button", clipPath: "url(#clip0_3288_4057)" }, /* @__PURE__ */ e.createElement("path", { className: "phillips-logo", id: "Phillips Logo", d: "M54.8166 0.274027H52.6224V13.726H63.7504V11.6083H54.8166V0.274027ZM41.3171 13.7273H43.5119V0.274027H41.3171V13.7273ZM21.276 0.274027H19.1214V13.726H21.2566V8.86215H30.0526V13.726H32.2079V0.274027H30.0526V6.80339H21.2566L21.276 0.274027ZM87.8477 13.7273H90.0425V0.274027H87.8477V13.7273ZM118.23 10.402L117.489 12.3843C119.214 13.3651 122.153 14 124.23 14C128.07 14 130.48 12.4912 130.48 9.84295C130.48 6.72565 127.521 6.17565 124.309 5.86211C122.252 5.66647 120.096 5.50969 120.096 4.01971C120.096 2.86206 121.135 2.11772 123.898 2.11772C125.543 2.11772 127.444 2.49021 129.031 3.15747L129.716 1.157C127.953 0.39193 125.817 0 123.936 0C120.058 0 117.863 1.52885 117.863 4.01971C117.863 7.1571 120.861 7.7058 124.034 7.99991C126.091 8.1962 128.227 8.37305 128.227 9.8436C128.227 11.0401 127.15 11.8829 124.25 11.8829C122.467 11.8823 120.004 11.3485 118.23 10.402ZM72.4298 0.274027H70.2357V13.726H81.3637V11.6083H72.4298V0.274027ZM106.676 0.274027H99.1724V13.726H101.367V9.27417H106.676C109.811 9.27417 111.614 7.39161 111.614 4.76406C111.614 2.15659 109.85 0.274027 106.676 0.274027ZM106.421 7.1571H101.367V2.39174H106.421C108.321 2.39174 109.379 3.27407 109.379 4.7647C109.38 6.25533 108.361 7.1571 106.421 7.1571ZM7.50343 0.274027H0V13.726H2.19414V9.27417H7.50343C10.638 9.27417 12.4399 7.39161 12.4399 4.76406C12.4406 2.15659 10.6775 0.274027 7.50343 0.274027ZM7.24907 7.1571H2.19414V2.39174H7.24907C9.14936 2.39174 10.2069 3.27407 10.2069 4.7647C10.2063 6.25533 9.18819 7.1571 7.24907 7.1571Z", fill: "black" })), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", { id: "clip0_3288_4057" }, /* @__PURE__ */ e.createElement("rect", { width: 130.667, height: 14, fill: "white" }))));
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
t as default
|
|
5
5
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const l = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", ...t }, /* @__PURE__ */ e.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ e.createElement("path", { fill: "#323232", stroke: "#323232", strokeWidth: 2, d: "m16.76 6.45.006-.007.037-.04a9.895 9.895 0 0 1 .784-.753c.548-.472 1.316-1.033 2.22-1.436.901-.401 1.903-.63 2.95-.49 1.032.138 2.2.647 3.429 1.876 2.459 2.46 2.55 4.748 2.116 6.41a7.466 7.466 0 0 1-1.481 2.848l-.003.003v.001h-.001L16 26.53 5.183 14.863v-.001h-.001l-.003-.004a2.984 2.984 0 0 1-.143-.173 7.466 7.466 0 0 1-1.338-2.676c-.434-1.66-.343-3.95 2.116-6.41 1.23-1.228 2.397-1.737 3.43-1.875 1.046-.14 2.048.089 2.949.49.904.403 1.672.964 2.22 1.436a9.867 9.867 0 0 1 .784.753l.037.04.006.008h.001l.759.89.759-.89Z" })), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", { id: "a" }, /* @__PURE__ */ e.createElement("path", { fill: "#fff", d: "M0 0h32v32H0z" }))));
|
|
3
|
+
export {
|
|
4
|
+
l as default
|
|
5
|
+
};
|
package/dist/assets/icons.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as ChevronDown } from './chevronDown.svg?react';
|
|
|
5
5
|
export { default as ChevronNext } from './chevronNext.svg?react';
|
|
6
6
|
export { default as ChevronRight } from './chevronRight.svg?react';
|
|
7
7
|
export { default as Close } from './close.svg?react';
|
|
8
|
+
export { default as Favorite } from './favorite.svg?react';
|
|
8
9
|
export { default as FavoriteOutline } from './favoriteOutline.svg?react';
|
|
9
10
|
export { default as Facebook } from './icon-footer-facebook.svg?react';
|
|
10
11
|
export { default as FooterInstagram } from './icon-footer-instagram.svg?react';
|
|
@@ -6,6 +6,10 @@ export interface CountdownProps extends ComponentProps<'div'> {
|
|
|
6
6
|
* The date the countdown should end
|
|
7
7
|
*/
|
|
8
8
|
endDateTime: Date;
|
|
9
|
+
/**
|
|
10
|
+
* Function to modify strings coming from date-fns (Minutes -> Mins etc)
|
|
11
|
+
*/
|
|
12
|
+
formatDurationStr?: (duration: string) => string;
|
|
9
13
|
/**
|
|
10
14
|
* Any descriptor to appear below the coundown
|
|
11
15
|
*/
|
|
@@ -1,50 +1,62 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import { SupportedLanguages as
|
|
6
|
-
import { CountdownVariants as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useState as L, useEffect as v } from "react";
|
|
3
|
+
import { getCommonProps as g } from "../../utils/index.js";
|
|
4
|
+
import x from "../../node_modules/classnames/index.js";
|
|
5
|
+
import { SupportedLanguages as j } from "../../types/commonTypes.js";
|
|
6
|
+
import { CountdownVariants as m } from "./types.js";
|
|
7
7
|
import { Duration as s } from "./Duration.js";
|
|
8
|
-
import { zhCN as
|
|
9
|
-
import { enUS as
|
|
10
|
-
import { differenceInDays as
|
|
11
|
-
import { differenceInHours as
|
|
12
|
-
import { differenceInMinutes as
|
|
13
|
-
import { differenceInSeconds as
|
|
14
|
-
const
|
|
8
|
+
import { zhCN as z } from "../../node_modules/date-fns/locale/zh-CN.js";
|
|
9
|
+
import { enUS as P } from "../../node_modules/date-fns/locale/en-US.js";
|
|
10
|
+
import { differenceInDays as S } from "../../node_modules/date-fns/differenceInDays.js";
|
|
11
|
+
import { differenceInHours as _ } from "../../node_modules/date-fns/differenceInHours.js";
|
|
12
|
+
import { differenceInMinutes as $ } from "../../node_modules/date-fns/differenceInMinutes.js";
|
|
13
|
+
import { differenceInSeconds as b } from "../../node_modules/date-fns/differenceInSeconds.js";
|
|
14
|
+
const E = N(
|
|
15
15
|
({
|
|
16
|
-
endDateTime:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
endDateTime: n,
|
|
17
|
+
formatDurationStr: a,
|
|
18
|
+
label: l = "Lots Close in",
|
|
19
|
+
intervalDescription: f = "Lots Close in 1-minute intervals",
|
|
20
|
+
className: p,
|
|
21
|
+
locale: h = "en",
|
|
22
|
+
variant: u = m.default,
|
|
23
|
+
...c
|
|
24
|
+
}, C) => {
|
|
25
|
+
const { className: i, ...w } = g(c, "Countdown"), [r, y] = L(/* @__PURE__ */ new Date()), t = h === j.zh ? z : P, o = {
|
|
26
|
+
days: S(n, r),
|
|
27
|
+
hours: _(n, r) % 24,
|
|
28
|
+
minutes: $(n, r) % 60,
|
|
29
|
+
seconds: b(n, r) % 60 % 60
|
|
29
30
|
};
|
|
30
|
-
return
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
return v(() => {
|
|
32
|
+
const I = setInterval(() => {
|
|
33
|
+
y(/* @__PURE__ */ new Date());
|
|
33
34
|
}, 1e3);
|
|
34
|
-
return () => clearInterval(
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
return () => clearInterval(I);
|
|
36
|
+
}, [n]), /* @__PURE__ */ d(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
...w,
|
|
40
|
+
className: x(i, p, {
|
|
41
|
+
[`${i}--compact`]: u === m.compact
|
|
42
|
+
}),
|
|
43
|
+
...c,
|
|
44
|
+
ref: C,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ d("div", { className: `${i}__countdown-container`, role: "timer", "aria-label": l, children: [
|
|
47
|
+
/* @__PURE__ */ e("span", { children: l }),
|
|
48
|
+
o.days > 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "days", locale: t, formatDurationStr: a }) : null,
|
|
49
|
+
o.days > 0 || o.hours > 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "hours", locale: t }) : null,
|
|
50
|
+
o.days === 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "minutes", locale: t, formatDurationStr: a }) : null,
|
|
51
|
+
o.days === 0 && o.hours === 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "seconds", locale: t, formatDurationStr: a }) : null
|
|
52
|
+
] }),
|
|
53
|
+
u === m.default ? /* @__PURE__ */ e("span", { children: f }) : null
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
45
57
|
}
|
|
46
58
|
);
|
|
47
|
-
|
|
59
|
+
E.displayName = "Countdown";
|
|
48
60
|
export {
|
|
49
|
-
|
|
61
|
+
E as default
|
|
50
62
|
};
|
|
@@ -3,5 +3,6 @@ export interface DurationProps {
|
|
|
3
3
|
duration: DurationValue;
|
|
4
4
|
unit: DurationUnit;
|
|
5
5
|
locale: Locale;
|
|
6
|
+
formatDurationStr?: (duration: string) => string;
|
|
6
7
|
}
|
|
7
|
-
export declare const Duration: ({ duration, unit, locale }: DurationProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Duration: ({ duration, unit, locale, formatDurationStr }: DurationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { px as m } from "../../utils/index.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */ o("span", {
|
|
9
|
-
/* @__PURE__ */ o("span", { children: a[1] })
|
|
3
|
+
import { formatDuration as p } from "../../node_modules/date-fns/formatDuration.js";
|
|
4
|
+
const u = ({ duration: a, unit: s, locale: n, formatDurationStr: i = (r) => r }) => {
|
|
5
|
+
const r = `${m}-duration`, t = p(a, { format: [s], zero: !0, locale: n }).split(" ");
|
|
6
|
+
return /* @__PURE__ */ e("div", { className: r, children: [
|
|
7
|
+
/* @__PURE__ */ o("span", { children: t[0].padStart(2, "0") }),
|
|
8
|
+
/* @__PURE__ */ o("span", { children: i(t[1]) })
|
|
10
9
|
] });
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { getCommonProps as f } from "../../utils/index.js";
|
|
4
|
+
import m from "../../node_modules/classnames/index.js";
|
|
5
|
+
const N = p(
|
|
6
|
+
({ className: o = "", hasWrap: t = !0, label: i, subLabel: e, value: n, ...s }, c) => {
|
|
7
|
+
const { className: a, ...d } = f(s, "Detail");
|
|
8
|
+
return /* @__PURE__ */ l("div", { ...d, className: m(a, o), ...s, ref: c, children: [
|
|
9
|
+
/* @__PURE__ */ l("dt", { className: m(`${a}__label`, { [`${a}__label--no-wrap`]: !t }), children: [
|
|
10
|
+
i,
|
|
11
|
+
" ",
|
|
12
|
+
e ? /* @__PURE__ */ r("span", { children: e }) : null
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ r("dd", { className: `${a}__value`, children: n })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
N.displayName = "Detail";
|
|
13
19
|
export {
|
|
14
|
-
|
|
20
|
+
N as default
|
|
15
21
|
};
|
|
@@ -1,54 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getCommonProps as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { SSRMediaQuery as
|
|
11
|
-
import { AccordionItemVariant as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { jsxs as u, Fragment as k, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { getCommonProps as y, findChildrenOfType as E, px as h } from "../../../utils/index.js";
|
|
3
|
+
import L from "../../../node_modules/classnames/index.js";
|
|
4
|
+
import c, { forwardRef as M, useState as b } from "react";
|
|
5
|
+
import { TextVariants as N } from "../../Text/types.js";
|
|
6
|
+
import C from "../../Text/Text.js";
|
|
7
|
+
import w from "../NavigationList/NavigationList.js";
|
|
8
|
+
import A from "../../Accordion/Accordion.js";
|
|
9
|
+
import H from "../../Accordion/AccordionItem.js";
|
|
10
|
+
import { SSRMediaQuery as v } from "../../../providers/SeldonProvider/utils.js";
|
|
11
|
+
import { AccordionItemVariant as I } from "../../Accordion/types.js";
|
|
12
|
+
import { HeaderContext as x } from "../../../site-furniture/Header/Header.js";
|
|
13
|
+
const O = ({ id: m, label: i, children: l }) => {
|
|
14
|
+
const { isMenuOpen: d } = c.useContext(x);
|
|
15
|
+
return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(
|
|
16
|
+
H,
|
|
17
|
+
{
|
|
18
|
+
hasTransition: !0,
|
|
19
|
+
id: `accordion-item-${m}`,
|
|
20
|
+
label: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }),
|
|
21
|
+
variant: I.lg,
|
|
22
|
+
children: l
|
|
23
|
+
},
|
|
24
|
+
`accordion-key-${i}`
|
|
25
|
+
) }, `accordion-key-${i}-${d}`);
|
|
26
|
+
}, R = M(
|
|
27
|
+
({ id: m, label: i, children: l, className: d, onClick: T, ..._ }, $) => {
|
|
28
|
+
const { className: s, ...f } = y({ id: m }, "NavigationItemTrigger"), [g, e] = b(!1), t = E(l, w), { closeMenu: n } = c.useContext(x);
|
|
29
|
+
return /* @__PURE__ */ u(k, { children: [
|
|
30
|
+
/* @__PURE__ */ o(v.Media, { lessThan: "md", children: /* @__PURE__ */ o(O, { id: m, label: i, ...f, children: t ? c.cloneElement(t[0], {
|
|
31
|
+
className: `${s}__submenu--mobile`,
|
|
32
|
+
onClick: (p) => {
|
|
33
|
+
var r, a;
|
|
34
|
+
(a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
|
|
35
|
+
}
|
|
36
|
+
}) : null }) }),
|
|
37
|
+
/* @__PURE__ */ o(v.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
|
|
30
38
|
"li",
|
|
31
39
|
{
|
|
32
|
-
...
|
|
33
|
-
ref:
|
|
34
|
-
"aria-expanded":
|
|
35
|
-
className:
|
|
36
|
-
[`${
|
|
40
|
+
...f,
|
|
41
|
+
ref: $,
|
|
42
|
+
"aria-expanded": g,
|
|
43
|
+
className: L(d, s, `${h}-nav__item`, {
|
|
44
|
+
[`${s}--hovered`]: g
|
|
37
45
|
}),
|
|
38
|
-
onClick:
|
|
39
|
-
onMouseOver: () =>
|
|
40
|
-
onMouseOut: () =>
|
|
41
|
-
...
|
|
46
|
+
onClick: T,
|
|
47
|
+
onMouseOver: () => e(!0),
|
|
48
|
+
onMouseOut: () => e(!1),
|
|
49
|
+
..._,
|
|
42
50
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
51
|
+
/* @__PURE__ */ o("button", { className: `${h}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }) }),
|
|
52
|
+
t ? c.cloneElement(t[0], {
|
|
53
|
+
className: `${s}__submenu`,
|
|
54
|
+
onClick: (p) => {
|
|
55
|
+
var r, a;
|
|
56
|
+
(a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
|
|
57
|
+
}
|
|
58
|
+
}) : null
|
|
45
59
|
]
|
|
46
60
|
}
|
|
47
61
|
) })
|
|
48
62
|
] });
|
|
49
63
|
}
|
|
50
64
|
);
|
|
51
|
-
|
|
65
|
+
R.displayName = "NavigationItemTrigger";
|
|
52
66
|
export {
|
|
53
|
-
|
|
67
|
+
R as default
|
|
54
68
|
};
|
|
@@ -16,6 +16,10 @@ export interface NavigationListProps extends React.ComponentProps<'ul'> {
|
|
|
16
16
|
* Optional right section heading
|
|
17
17
|
*/
|
|
18
18
|
rightSectionHeading?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Rewrite the onClick event
|
|
21
|
+
* */
|
|
22
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
19
23
|
}
|
|
20
24
|
declare const NavigationList: React.ForwardRefExoticComponent<Omit<NavigationListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
21
25
|
export default NavigationList;
|
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { px as
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
({ id:
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { px as e } from "../../../utils/index.js";
|
|
4
|
+
import p from "../../../node_modules/classnames/index.js";
|
|
5
|
+
import { TextVariants as N } from "../../Text/types.js";
|
|
6
|
+
import $ from "../../Text/Text.js";
|
|
7
|
+
const x = n.forwardRef(
|
|
8
|
+
({ id: v, children: i, className: g, isOffScreen: f, leftSectionHeading: d, rightSectionHeading: u, onClick: s }, h) => {
|
|
9
|
+
const o = n.Children.toArray(i).map((t) => {
|
|
10
|
+
if (n.isValidElement(t) && t.props.navGroup === "nav-link-start")
|
|
11
|
+
return n.cloneElement(t, {
|
|
12
|
+
onClick: (r) => {
|
|
13
|
+
var a, l;
|
|
14
|
+
s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}).filter(Boolean), _ = n.Children.toArray(i).map((t) => {
|
|
18
|
+
if (n.isValidElement(t) && t.props.navGroup === "nav-link-end")
|
|
19
|
+
return n.cloneElement(t, {
|
|
20
|
+
onClick: (r) => {
|
|
21
|
+
var a, l;
|
|
22
|
+
s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}).filter(Boolean);
|
|
26
|
+
return /* @__PURE__ */ m(
|
|
17
27
|
"ul",
|
|
18
28
|
{
|
|
19
|
-
"aria-hidden":
|
|
20
|
-
id:
|
|
21
|
-
"data-testid":
|
|
29
|
+
"aria-hidden": f,
|
|
30
|
+
id: v,
|
|
31
|
+
"data-testid": v,
|
|
22
32
|
role: "list",
|
|
23
|
-
className:
|
|
24
|
-
ref:
|
|
33
|
+
className: p(g, `${e}-nav__list`, { [`${e}-nav__list--offscreen`]: f }),
|
|
34
|
+
ref: h,
|
|
25
35
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
o.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--start`), children: [
|
|
37
|
+
d ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--start__title`, children: d }) : null,
|
|
38
|
+
o
|
|
29
39
|
] }) : null,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
_.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--end`), children: [
|
|
41
|
+
u ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--end__title`, children: u }) : null,
|
|
42
|
+
_
|
|
33
43
|
] }) : null,
|
|
34
|
-
!
|
|
44
|
+
!o.length && !_.length ? i : null
|
|
35
45
|
]
|
|
36
46
|
}
|
|
37
47
|
);
|
|
38
48
|
}
|
|
39
49
|
);
|
|
40
|
-
|
|
50
|
+
x.displayName = "NavigationList";
|
|
41
51
|
export {
|
|
42
|
-
|
|
52
|
+
x as default
|
|
43
53
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I, useRef as v, useState as y, useCallback as E, useEffect as P } from "react";
|
|
3
|
+
import d from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { getCommonProps as w } from "../../utils/index.js";
|
|
5
|
+
import x from "../../assets/PhillipsLogo.svg.js";
|
|
6
|
+
function C(s) {
|
|
6
7
|
return new Promise((a) => {
|
|
7
8
|
const r = document.createElement("img");
|
|
8
|
-
r.onerror = () => a(!1), r.onload = () => a(!0), r.src =
|
|
9
|
+
r.onerror = () => a(!1), r.onload = () => a(!0), r.src = s;
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const L = I(
|
|
12
13
|
({
|
|
13
|
-
className:
|
|
14
|
-
aspectRatio:
|
|
14
|
+
className: s,
|
|
15
|
+
aspectRatio: m = "none",
|
|
15
16
|
objectFit: a = "none",
|
|
16
17
|
hasBlurBackground: r = !1,
|
|
17
18
|
imageClassName: u,
|
|
@@ -20,20 +21,20 @@ const P = h(
|
|
|
20
21
|
alt: t,
|
|
21
22
|
errorText: p = "Error loading image",
|
|
22
23
|
...g
|
|
23
|
-
},
|
|
24
|
-
const { className: e, ...c } =
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
}, b) => {
|
|
25
|
+
const { className: e, ...c } = w(g, "SeldonImage"), N = v(null), [o, i] = y("loading"), f = E(async () => {
|
|
26
|
+
const S = await C(n);
|
|
27
|
+
i(S ? "loaded" : "error");
|
|
27
28
|
}, [n]);
|
|
28
|
-
return
|
|
29
|
+
return P(() => {
|
|
29
30
|
f();
|
|
30
|
-
}, [f]), /* @__PURE__ */
|
|
31
|
+
}, [f]), /* @__PURE__ */ h(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
|
-
ref:
|
|
34
|
-
className:
|
|
34
|
+
ref: b,
|
|
35
|
+
className: d(e, s, {
|
|
35
36
|
[`${e}--hidden`]: o === "loading" || o === "error",
|
|
36
|
-
[`${e}--aspect-ratio-${
|
|
37
|
+
[`${e}--aspect-ratio-${m.replace("/", "-")}`]: m !== "none"
|
|
37
38
|
}),
|
|
38
39
|
role: "img",
|
|
39
40
|
"aria-label": t,
|
|
@@ -43,17 +44,17 @@ const P = h(
|
|
|
43
44
|
r && /* @__PURE__ */ l(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
46
|
-
className:
|
|
47
|
+
className: d(`${e}-blur`, {
|
|
47
48
|
[`${e}-blur--hidden`]: o === "loading" || o === "error"
|
|
48
49
|
}),
|
|
49
50
|
style: { backgroundImage: `url(${n})` }
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
|
-
o === "error"
|
|
53
|
+
o === "error" ? /* @__PURE__ */ l("div", { className: `${e}--error`, children: /* @__PURE__ */ l(x, { "aria-label": p }) }) : null,
|
|
53
54
|
/* @__PURE__ */ l(
|
|
54
55
|
"img",
|
|
55
56
|
{
|
|
56
|
-
className:
|
|
57
|
+
className: d(`${e}-img`, u, {
|
|
57
58
|
[`${e}-img--hidden`]: o !== "loaded",
|
|
58
59
|
[`${e}-img--object-fit-${a}`]: a !== "none"
|
|
59
60
|
}),
|
|
@@ -61,12 +62,12 @@ const P = h(
|
|
|
61
62
|
src: n,
|
|
62
63
|
alt: t,
|
|
63
64
|
"data-testid": `${c["data-testid"]}-img`,
|
|
64
|
-
ref:
|
|
65
|
+
ref: N,
|
|
65
66
|
onLoad: () => {
|
|
66
|
-
|
|
67
|
+
i("loaded");
|
|
67
68
|
},
|
|
68
69
|
onError: () => {
|
|
69
|
-
|
|
70
|
+
i("error");
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
)
|
|
@@ -75,7 +76,7 @@ const P = h(
|
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
|
-
|
|
79
|
+
L.displayName = "SeldonImage";
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
L as default
|
|
81
82
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './assets/icons';
|
|
|
3
3
|
export { default as Page } from './pages/Page';
|
|
4
4
|
export * from './utils/hooks';
|
|
5
5
|
export * from './providers/SeldonProvider/utils';
|
|
6
|
+
export * from './types/commonTypes';
|
|
6
7
|
export { default as Button, type ButtonProps } from './components/Button/Button';
|
|
7
8
|
export { ButtonVariants } from './components/Button/types';
|
|
8
9
|
export { default as IconButton } from './components/IconButton/IconButton';
|
|
@@ -58,3 +59,5 @@ export * from './components/SeldonImage';
|
|
|
58
59
|
export * from './patterns/SaleHeaderBanner';
|
|
59
60
|
export * from './components/Countdown';
|
|
60
61
|
export * from './components/Countdown/types';
|
|
62
|
+
export * from './patterns/ObjectTile';
|
|
63
|
+
export * from './patterns/BidSnapshot';
|