@phillips/seldon 1.72.1 → 1.73.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.
@@ -1,19 +1,19 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import d from "../../node_modules/classnames/index.js";
3
3
  import { forwardRef as D, useId as P, useState as S, useCallback as f, useEffect as V } from "react";
4
- import { useCarousel as _ } from "./utils.js";
5
- import { getCommonProps as j } from "../../utils/index.js";
6
- const w = D(
7
- ({ className: $, maxDots: l = 7, position: h = "inline", numberOfSlides: N = 0, ...u }, b) => {
8
- const { className: s, ...C } = j(u, "Carousel"), M = P(), { api: e, onSlideChange: n } = _(), [g, v] = S(0), [i, k] = S(
4
+ import { useCarousel as j } from "./utils.js";
5
+ import { getCommonProps as w } from "../../utils/index.js";
6
+ const A = D(
7
+ ({ className: $, maxDots: i = 7, position: h = "inline", numberOfSlides: N = 0, ...u }, b) => {
8
+ const { className: s, ...C } = w(u, "Carousel"), M = P(), { api: e, onSlideChange: n } = j(), [g, v] = S(0), [l, x] = S(
9
9
  Array.from({ length: N }, (t, o) => o)
10
- ), x = f(
10
+ ), k = f(
11
11
  (t) => {
12
12
  e && (e.scrollTo(t, !0), n == null || n(t));
13
13
  },
14
14
  [e, n]
15
15
  ), p = f((t) => {
16
- k(t.scrollSnapList());
16
+ x(t.scrollSnapList());
17
17
  }, []), a = f((t) => {
18
18
  v(t.selectedScrollSnap());
19
19
  }, []), m = f(
@@ -29,11 +29,11 @@ const w = D(
29
29
  };
30
30
  }, [e, p, a, m]);
31
31
  const I = (() => {
32
- if (i.length <= l) return i;
33
- const t = Math.floor(l / 2);
32
+ if (l.length <= i) return l;
33
+ const t = Math.floor(i / 2);
34
34
  let o = Math.max(0, g - t);
35
- const r = Math.min(i.length, o + l);
36
- return r - o < l && (o = Math.max(0, r - l)), i.slice(o, r);
35
+ const r = Math.min(l.length, o + i);
36
+ return r - o < i && (o = Math.max(0, r - i)), l.slice(o, r);
37
37
  })();
38
38
  return /* @__PURE__ */ c(
39
39
  "div",
@@ -46,12 +46,12 @@ const w = D(
46
46
  ...u,
47
47
  ...C,
48
48
  children: /* @__PURE__ */ c("div", { className: `${s}-pagination-container`, children: /* @__PURE__ */ c("div", { className: `${s}-pagination-container-inner`, children: I.map((t, o) => {
49
- const r = i.indexOf(I[o]), y = g === r;
49
+ const r = l.indexOf(I[o]), y = g === r;
50
50
  return /* @__PURE__ */ c(
51
51
  "button",
52
52
  {
53
53
  role: "button",
54
- onClick: () => x(r),
54
+ onClick: () => k(r),
55
55
  className: d(`${s}-pagination-dot-container`),
56
56
  children: /* @__PURE__ */ c(
57
57
  "span",
@@ -62,14 +62,14 @@ const w = D(
62
62
  }
63
63
  )
64
64
  },
65
- `${M}-dot-${o}`
65
+ `${M}-dot-${t}`
66
66
  );
67
67
  }) }) })
68
68
  }
69
69
  );
70
70
  }
71
71
  );
72
- w.displayName = "CarouselDots";
72
+ A.displayName = "CarouselDots";
73
73
  export {
74
- w as default
74
+ A as default
75
75
  };
@@ -1,7 +1,7 @@
1
- import { ComponentProps } from 'react';
1
+ import React, { ComponentProps } from 'react';
2
2
  export interface DetailProps extends ComponentProps<'div'> {
3
- label: string;
4
- value: string;
3
+ label: React.ReactNode;
4
+ value: React.ReactNode;
5
5
  }
6
6
  /**
7
7
  * ## Overview
@@ -13,6 +13,6 @@ export interface DetailProps extends ComponentProps<'div'> {
13
13
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-detail--overview)
14
14
  *
15
15
  */
16
- declare const Detail: import("react").ForwardRefExoticComponent<Omit<DetailProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
16
+ declare const Detail: React.ForwardRefExoticComponent<Omit<DetailProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
17
  export type DetailComponent = ReturnType<typeof Detail>;
18
18
  export default Detail;
@@ -1,14 +1,15 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import { getCommonProps as i } from "../../utils/index.js";
4
- const c = t(({ className: s, ...a }, m) => {
5
- const { className: e, ...o } = i(a, "Detail");
6
- return /* @__PURE__ */ r("div", { ...o, className: `${e} ${s}`, ...a, ref: m, children: [
7
- /* @__PURE__ */ l("dt", { className: `${e}__label`, children: a.label }),
8
- /* @__PURE__ */ l("dd", { className: `${e}__value`, children: a.value })
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as c } from "react";
3
+ import { getCommonProps as d } from "../../utils/index.js";
4
+ import n from "../../node_modules/classnames/index.js";
5
+ const f = c(({ className: m = "", label: l, value: o, ...s }, r) => {
6
+ const { className: a, ...t } = d(s, "Detail");
7
+ return /* @__PURE__ */ i("div", { ...t, className: n(a, m), ...s, ref: r, children: [
8
+ /* @__PURE__ */ e("dt", { className: `${a}__label`, children: l }),
9
+ /* @__PURE__ */ e("dd", { className: `${a}__value`, children: o })
9
10
  ] });
10
11
  });
11
- c.displayName = "Detail";
12
+ f.displayName = "Detail";
12
13
  export {
13
- c as default
14
+ f as default
14
15
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { PaddingTokens as f, SpacingTokens as l, defaultYear as p, emailValidation as s, encodeURLSearchParams as m, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as i, getCommonProps as x, noOp as n, px as g, useNormalizedInputProps as c } from "./utils/index.js";
1
+ import { PaddingTokens as f, SpacingTokens as l, defaultYear as m, emailValidation as p, encodeURLSearchParams as s, findChildrenExcludingTypes as d, findChildrenOfType as i, generatePaddingClassName as u, getCommonProps as x, noOp as n, px as g, useNormalizedInputProps as c } from "./utils/index.js";
2
2
  import { default as C } from "./pages/Page.js";
3
3
  import { default as P } from "./components/Button/Button.js";
4
4
  import { ButtonVariants as T } from "./components/Button/types.js";
5
5
  import { default as b } from "./components/IconButton/IconButton.js";
6
- import { default as B } from "./components/ErrorBoundary/ErrorBoundary.js";
7
- import { default as A } from "./site-furniture/Footer/Footer.js";
8
- import { Grid as v } from "./components/Grid/Grid.js";
9
- import { default as y } from "./site-furniture/Header/Header.js";
6
+ import { default as A } from "./components/ErrorBoundary/ErrorBoundary.js";
7
+ import { default as h } from "./site-furniture/Footer/Footer.js";
8
+ import { Grid as N } from "./components/Grid/Grid.js";
9
+ import { default as w } from "./site-furniture/Header/Header.js";
10
10
  import { default as G } from "./components/Navigation/Navigation.js";
11
11
  import { default as H } from "./components/Navigation/NavigationItem/NavigationItem.js";
12
12
  import { default as O } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
@@ -18,22 +18,22 @@ import { LinkVariants as J } from "./components/Link/types.js";
18
18
  import { default as Q } from "./components/LinkBlock/LinkBlock.js";
19
19
  import { default as _ } from "./components/LinkList/LinkList.js";
20
20
  import { default as ee } from "./components/Row/Row.js";
21
- import { default as re } from "./components/GridItem/GridItem.js";
21
+ import { default as te } from "./components/GridItem/GridItem.js";
22
22
  import { GridItemAlign as ae } from "./components/GridItem/types.js";
23
23
  import { default as le } from "./components/Search/Search.js";
24
- import { default as se } from "./components/Select/Select.js";
24
+ import { default as pe } from "./components/Select/Select.js";
25
25
  import { default as de } from "./components/SplitPanel/SplitPanel.js";
26
- import { default as ie } from "./patterns/Subscribe/Subscribe.js";
26
+ import { default as ue } from "./patterns/Subscribe/Subscribe.js";
27
27
  import { SubscriptionState as ne } from "./patterns/Subscribe/types.js";
28
28
  import { default as ce } from "./patterns/Social/Social.js";
29
29
  import { default as Ce } from "./patterns/ViewingsList/ViewingsList.js";
30
30
  import { default as Pe } from "./components/Modal/Modal.js";
31
31
  import { default as Te } from "./components/Drawer/Drawer.js";
32
32
  import { default as be } from "./components/Pagination/Pagination.js";
33
- import { default as Be } from "./patterns/ViewingsList/StatefulViewingsList.js";
34
- import { TextVariants as Ae } from "./components/Text/types.js";
35
- import { default as ve } from "./components/Text/Text.js";
36
- import { TextSymbolVariants as ye } from "./components/TextSymbol/types.js";
33
+ import { default as Ae } from "./patterns/ViewingsList/StatefulViewingsList.js";
34
+ import { TextVariants as he } from "./components/Text/types.js";
35
+ import { default as Ne } from "./components/Text/Text.js";
36
+ import { TextSymbolVariants as we } from "./components/TextSymbol/types.js";
37
37
  import { default as Ge } from "./components/TextSymbol/TextSymbol.js";
38
38
  import { default as He } from "./components/Accordion/Accordion.js";
39
39
  import { default as Oe } from "./components/Accordion/AccordionItem.js";
@@ -48,19 +48,20 @@ import "react";
48
48
  import { default as Xe } from "./components/Dropdown/Dropdown.js";
49
49
  import { default as $e } from "./components/Video/Video.js";
50
50
  import { default as oo } from "./patterns/LanguageSelector/LanguageSelector.js";
51
- import { default as to } from "./components/ContentPeek/ContentPeek.js";
51
+ import { default as ro } from "./components/ContentPeek/ContentPeek.js";
52
52
  import { default as fo } from "./components/Collapsible/Collapsible.js";
53
- import { default as po } from "./components/Collapsible/CollapsibleContent.js";
54
- import { default as mo } from "./components/Collapsible/CollapsibleTrigger.js";
55
- import { SeldonProvider as io } from "./providers/SeldonProvider.js";
53
+ import { default as mo } from "./components/Collapsible/CollapsibleContent.js";
54
+ import { default as so } from "./components/Collapsible/CollapsibleTrigger.js";
55
+ import { SeldonProvider as uo } from "./providers/SeldonProvider.js";
56
56
  import { default as no } from "./components/PageContentWrapper/PageContentWrapper.js";
57
57
  import { default as co } from "./components/Carousel/Carousel.js";
58
58
  import { default as Co } from "./components/Carousel/CarouselContent.js";
59
59
  import { default as Po } from "./components/Carousel/CarouselItem.js";
60
60
  import { default as To } from "./components/Carousel/CarouselDots.js";
61
61
  import { default as bo } from "./components/Detail/Detail.js";
62
- import { default as Bo } from "./patterns/DetailList/DetailList.js";
63
- import { default as Ao } from "./components/PinchZoom/PinchZoom.js";
62
+ import { default as Ao } from "./patterns/DetailList/DetailList.js";
63
+ import { DetailListAlignment as ho } from "./patterns/DetailList/types.js";
64
+ import { default as No } from "./components/PinchZoom/PinchZoom.js";
64
65
  export {
65
66
  He as Accordion,
66
67
  Oe as AccordionItem,
@@ -75,19 +76,20 @@ export {
75
76
  To as CarouselDots,
76
77
  Po as CarouselItem,
77
78
  fo as Collapsible,
78
- po as CollapsibleContent,
79
- mo as CollapsibleTrigger,
80
- to as ContentPeek,
79
+ mo as CollapsibleContent,
80
+ so as CollapsibleTrigger,
81
+ ro as ContentPeek,
81
82
  bo as Detail,
82
- Bo as DetailList,
83
+ Ao as DetailList,
84
+ ho as DetailListAlignment,
83
85
  Te as Drawer,
84
86
  Xe as Dropdown,
85
- B as ErrorBoundary,
86
- A as Footer,
87
- v as Grid,
88
- re as GridItem,
87
+ A as ErrorBoundary,
88
+ h as Footer,
89
+ N as Grid,
90
+ te as GridItem,
89
91
  ae as GridItemAlign,
90
- y as Header,
92
+ w as Header,
91
93
  F as HeroBanner,
92
94
  b as IconButton,
93
95
  Y as Input,
@@ -105,31 +107,31 @@ export {
105
107
  C as Page,
106
108
  no as PageContentWrapper,
107
109
  be as Pagination,
108
- Ao as PinchZoom,
110
+ No as PinchZoom,
109
111
  ee as Row,
110
112
  le as Search,
111
- io as SeldonProvider,
112
- se as Select,
113
+ uo as SeldonProvider,
114
+ pe as Select,
113
115
  ce as Social,
114
116
  l as SpacingTokens,
115
117
  de as SplitPanel,
116
- Be as StatefulViewingsList,
117
- ie as Subscribe,
118
+ Ae as StatefulViewingsList,
119
+ ue as Subscribe,
118
120
  ne as SubscriptionState,
119
121
  qe as SupportedLanguages,
120
- ve as Text,
121
- ye as TextSymbolVariants,
122
+ Ne as Text,
123
+ we as TextSymbolVariants,
122
124
  Ge as TextSymbols,
123
- Ae as TextVariants,
125
+ he as TextVariants,
124
126
  We as UserManagement,
125
127
  $e as Video,
126
128
  Ce as ViewingsList,
127
- p as defaultYear,
128
- s as emailValidation,
129
- m as encodeURLSearchParams,
129
+ m as defaultYear,
130
+ p as emailValidation,
131
+ s as encodeURLSearchParams,
130
132
  d as findChildrenExcludingTypes,
131
- u as findChildrenOfType,
132
- i as generatePaddingClassName,
133
+ i as findChildrenOfType,
134
+ u as generatePaddingClassName,
133
135
  x as getCommonProps,
134
136
  n as noOp,
135
137
  g as px,
@@ -1,19 +1,19 @@
1
1
  import { ComponentProps } from 'react';
2
- import { DetailComponent } from '../../components/Detail';
3
2
  import { DetailListAlignment } from './types';
3
+ import { DetailComponent } from '../../components/Detail';
4
4
  export interface DetailListProps extends ComponentProps<'dl'> {
5
5
  /**
6
6
  * Determines whether each Details' label and value are aligned in columns or justified
7
7
  */
8
- alignment: DetailListAlignment;
8
+ alignment?: DetailListAlignment;
9
9
  /**
10
10
  * The Detail components to render
11
11
  */
12
- children: DetailComponent[];
12
+ children: DetailComponent[] | DetailComponent;
13
13
  /**
14
14
  * Whether to render separators between each Detail component
15
15
  */
16
- hasSeparators: boolean;
16
+ hasSeparators?: boolean;
17
17
  }
18
18
  /**
19
19
  * ## Overview
@@ -1,33 +1,33 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as f } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
- import f from "../../node_modules/classnames/index.js";
3
+ import l from "../../node_modules/classnames/index.js";
4
4
  import { getCommonProps as $, px as s } from "../../utils/index.js";
5
- import { DetailListAlignment as m } from "./types.js";
6
- import { getDetailKey as j } from "./utils.js";
5
+ import { DetailListAlignment as o } from "./types.js";
6
+ import { getDetailKey as n } from "./utils.js";
7
7
  const D = N(
8
- ({ alignment: o, className: p, children: t, hasSeparators: l, ...a }, u) => {
9
- const { className: e, ...c } = $(a, "DetailList");
10
- return /* @__PURE__ */ r(
8
+ ({ alignment: t = o.justified, className: p, children: a, hasSeparators: u = !1, ...e }, c) => {
9
+ const { className: i, ...d } = $(e, "DetailList"), m = Array.isArray(a) ? a : [a];
10
+ return /* @__PURE__ */ f(
11
11
  "dl",
12
12
  {
13
- ...c,
14
- className: f(e, p, {
15
- [`${s}-columns`]: o === m.columns,
16
- [`${s}-justified`]: o === m.justified
13
+ ...d,
14
+ className: l(i, p, {
15
+ [`${s}-columns`]: t === o.columns,
16
+ [`${s}-justified`]: t === o.justified
17
17
  }),
18
- ...a,
19
- ref: u,
20
- children: t == null ? void 0 : t.map((i, d) => /* @__PURE__ */ r(
18
+ ...e,
19
+ ref: c,
20
+ children: m == null ? void 0 : m.map((r, j) => /* @__PURE__ */ f(
21
21
  "div",
22
22
  {
23
- className: f(`${e}-wrapper`, {
24
- [`${s}-has-separators`]: l,
25
- [`${s}-columns`]: o === m.columns,
26
- [`${s}-justified`]: o === m.justified
23
+ className: l(`${i}-wrapper`, {
24
+ [`${s}-has-separators`]: u,
25
+ [`${s}-columns`]: t === o.columns,
26
+ [`${s}-justified`]: t === o.justified
27
27
  }),
28
- children: i
28
+ children: r
29
29
  },
30
- j(i, d)
30
+ n(r, j)
31
31
  ))
32
32
  }
33
33
  );
@@ -1 +1,2 @@
1
1
  export { default as DetailList, type DetailListProps } from './DetailList';
2
+ export { DetailListAlignment } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.72.1",
3
+ "version": "1.73.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"