@phillips/seldon 1.171.0 → 1.172.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.
Files changed (71) hide show
  1. package/dist/components/Carousel/CarouselDot.d.ts +2 -3
  2. package/dist/components/Carousel/CarouselDot.test.d.ts +0 -0
  3. package/dist/components/Carousel/CarouselDots.test.d.ts +0 -0
  4. package/dist/components/Carousel/CarouselKeyboardNavigation.test.d.ts +1 -0
  5. package/dist/components/ComposedModal/ComposedModal.js +21 -20
  6. package/dist/components/Drawer/Drawer.d.ts +22 -3
  7. package/dist/components/Drawer/Drawer.js +80 -73
  8. package/dist/components/Drawer/Drawer.stories.d.ts +97 -2
  9. package/dist/components/Drawer/DrawerHeader.d.ts +12 -0
  10. package/dist/components/Drawer/DrawerHeader.js +34 -0
  11. package/dist/components/Drawer/DrawerHeader.test.d.ts +1 -0
  12. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  13. package/dist/components/Dropdown/Dropdown.js +19 -19
  14. package/dist/components/Grid/Grid.d.ts +6 -3
  15. package/dist/components/Grid/Grid.js +20 -18
  16. package/dist/components/GridItem/GridItem.d.ts +1 -2
  17. package/dist/components/GridItem/GridItem.js +29 -26
  18. package/dist/components/GridItem/GridItem.stories.d.ts +1 -1
  19. package/dist/components/Link/Link.d.ts +1 -1
  20. package/dist/components/Link/Link.js +24 -26
  21. package/dist/components/Link/Link.stories.d.ts +1 -1
  22. package/dist/components/Link/types.js +1 -3
  23. package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
  24. package/dist/components/LinkBlock/LinkBlock.js +16 -12
  25. package/dist/components/LinkBlock/LinkBlock.stories.d.ts +1 -1
  26. package/dist/components/LinkList/LinkList.d.ts +1 -2
  27. package/dist/components/LinkList/LinkList.js +21 -8
  28. package/dist/components/LinkList/LinkList.stories.d.ts +2 -2
  29. package/dist/components/Pagination/Pagination.d.ts +2 -2
  30. package/dist/components/Pagination/Pagination.js +98 -94
  31. package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
  32. package/dist/components/PinchZoom/PinchZoom.d.ts +1 -2
  33. package/dist/components/PinchZoom/PinchZoom.js +54 -58
  34. package/dist/components/PinchZoom/PinchZoom.stories.d.ts +1 -1
  35. package/dist/components/Row/Row.d.ts +1 -2
  36. package/dist/components/Row/Row.js +31 -26
  37. package/dist/components/Row/Row.stories.d.ts +1 -1
  38. package/dist/components/Search/Search.d.ts +3 -2
  39. package/dist/components/Search/Search.js +160 -157
  40. package/dist/components/SplitPanel/SplitPanel.d.ts +1 -1
  41. package/dist/components/SplitPanel/SplitPanel.js +20 -21
  42. package/dist/components/SplitPanel/SplitPanel.stories.d.ts +1 -1
  43. package/dist/components/Text/Text.d.ts +1 -2
  44. package/dist/components/Text/Text.js +31 -34
  45. package/dist/components/Text/Text.stories.d.ts +1 -1
  46. package/dist/components/TextSymbol/TextSymbol.d.ts +1 -1
  47. package/dist/components/TextSymbol/TextSymbol.js +20 -7
  48. package/dist/components/TextSymbol/TextSymbol.stories.d.ts +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/patterns/FiltersInline/MainFilterDropdown.js +23 -22
  51. package/dist/patterns/FiltersInline/SubFilterDropdown.js +67 -66
  52. package/dist/patterns/HeroBanner/HeroBanner.d.ts +1 -1
  53. package/dist/patterns/HeroBanner/HeroBanner.js +30 -34
  54. package/dist/patterns/HeroBanner/HeroBanner.stories.d.ts +1 -1
  55. package/dist/patterns/LanguageSelector/LanguageSelector.js +66 -61
  56. package/dist/patterns/Social/Social.d.ts +1 -1
  57. package/dist/patterns/Social/Social.js +27 -23
  58. package/dist/patterns/Social/Social.stories.d.ts +1 -1
  59. package/dist/patterns/Subscribe/Subscribe.d.ts +2 -1
  60. package/dist/patterns/Subscribe/Subscribe.js +77 -62
  61. package/dist/patterns/Subscribe/Subscribe.stories.d.ts +1 -1
  62. package/dist/patterns/ViewingsList/StatefulViewingsList.d.ts +1 -1
  63. package/dist/patterns/ViewingsList/StatefulViewingsList.js +28 -31
  64. package/dist/patterns/ViewingsList/ViewingsList.d.ts +1 -1
  65. package/dist/patterns/ViewingsList/ViewingsList.js +40 -39
  66. package/dist/patterns/ViewingsList/ViewingsList.stories.d.ts +1 -1
  67. package/dist/scss/componentStyles.scss +1 -0
  68. package/dist/scss/components/Drawer/_drawer.scss +43 -16
  69. package/dist/scss/components/Drawer/_drawerHeader.scss +45 -0
  70. package/dist/utils/testUtils.d.ts +3 -0
  71. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from 'react';
2
- interface Props extends ComponentProps<'button'> {
2
+ export interface CarouselDotProps extends ComponentProps<'button'> {
3
3
  /** Whether the dot is selected */
4
4
  isSelected: boolean;
5
5
  /** Callback function when the dot is clicked */
@@ -11,5 +11,4 @@ interface Props extends ComponentProps<'button'> {
11
11
  /** Variant of the dot */
12
12
  variant?: 'sm' | 'md';
13
13
  }
14
- export declare const CarouselDot: ({ isSelected, onClick, scrollableContainerRef, onInViewChange, variant, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
15
- export {};
14
+ export declare const CarouselDot: ({ isSelected, onClick, scrollableContainerRef, onInViewChange, variant, ...props }: CarouselDotProps) => import("react/jsx-runtime").JSX.Element;
File without changes
@@ -1,20 +1,20 @@
1
- import { jsxs as s, jsx as i, Fragment as $ } from "react/jsx-runtime";
2
- import C from "../../node_modules/classnames/index.js";
3
- import { forwardRef as g } from "react";
4
- import { getCommonProps as x, noOp as k } from "../../utils/index.js";
1
+ import { jsxs as s, jsx as i, Fragment as C } from "react/jsx-runtime";
2
+ import g from "../../node_modules/classnames/index.js";
3
+ import { forwardRef as x } from "react";
4
+ import { getCommonProps as k, noOp as M } from "../../utils/index.js";
5
5
  import d from "../Button/Button.js";
6
6
  import { ButtonVariants as t } from "../Button/types.js";
7
- import M from "../Divider/Divider.js";
8
- import y from "../Modal/Modal.js";
7
+ import y from "../Divider/Divider.js";
8
+ import j from "../Modal/Modal.js";
9
9
  import { TextVariants as n } from "../Text/types.js";
10
10
  import c from "../Text/Text.js";
11
- const j = g(
11
+ const L = x(
12
12
  ({
13
13
  children: p,
14
14
  className: f,
15
- overlayClassName: L,
15
+ overlayClassName: P,
16
16
  isOpen: h = !1,
17
- onClose: v = k,
17
+ onClose: v = M,
18
18
  maxHeightValue: b = "60vh",
19
19
  title: N,
20
20
  footerContent: o,
@@ -22,21 +22,22 @@ const j = g(
22
22
  primaryButton: e,
23
23
  id: m,
24
24
  ...l
25
- }) => {
25
+ }, _) => {
26
26
  const {
27
27
  className: a,
28
- "data-testid": P,
29
- ..._
30
- } = x({ id: m, ...l }, "ComposedModal");
28
+ "data-testid": T,
29
+ ...$
30
+ } = k({ id: m, ...l }, "ComposedModal");
31
31
  return /* @__PURE__ */ s(
32
- y,
32
+ j,
33
33
  {
34
34
  isOpen: h,
35
35
  onClose: v,
36
36
  ...l,
37
- ..._,
38
- className: C(`${a}`, f),
37
+ ...$,
38
+ className: g(`${a}`, f),
39
39
  id: m,
40
+ ref: _,
40
41
  children: [
41
42
  /* @__PURE__ */ i(c, { variant: n.heading3, className: `${a}__title`, children: N }),
42
43
  /* @__PURE__ */ i(
@@ -47,8 +48,8 @@ const j = g(
47
48
  children: p
48
49
  }
49
50
  ),
50
- (r || e || o) && /* @__PURE__ */ s($, { children: [
51
- /* @__PURE__ */ i(M, { className: `${a}__divider`, id: `${m}-divider` }),
51
+ (r || e || o) && /* @__PURE__ */ s(C, { children: [
52
+ /* @__PURE__ */ i(y, { className: `${a}__divider`, id: `${m}-divider` }),
52
53
  /* @__PURE__ */ s("div", { className: `${a}__btns-group`, children: [
53
54
  r && /* @__PURE__ */ i(d, { id: `${m}-secondary-btn`, variant: t.secondary, onClick: r.onClick, children: r.buttonLabel }),
54
55
  e && /* @__PURE__ */ i(d, { id: `${m}-primary-btn`, variant: t.primary, onClick: e.onClick, children: e.buttonLabel })
@@ -60,7 +61,7 @@ const j = g(
60
61
  );
61
62
  }
62
63
  );
63
- j.displayName = "ComposedModal";
64
+ L.displayName = "ComposedModal";
64
65
  export {
65
- j as default
66
+ L as default
66
67
  };
@@ -12,14 +12,33 @@ export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
12
12
  * The content of the drawer
13
13
  */
14
14
  children?: React.ReactNode;
15
+ /**
16
+ * A string to be displayed center at the top of the drawer, up with the close button.
17
+ * Its presence also triggers the horizontal rule below the header to be rendered.
18
+ */
19
+ headerText?: string;
20
+ /**
21
+ * Used as the accessibility label for the drawer, used for screen readers.
22
+ * Defaults to the headerText if that's provided, otherwise an empty string.
23
+ */
24
+ title?: string;
25
+ /**
26
+ * Used as the accessibility description for the drawer, used for screen readers.
27
+ * Defaults to the title if that's provided, otherwise an empty string.
28
+ */
29
+ description?: string;
15
30
  /**
16
31
  * Which side the drawer opens from: left, right, or bottom
17
32
  */
18
33
  drawerOpenSide?: 'left' | 'right' | 'bottom';
19
34
  /**
20
- * Optional label for the bottom content area
35
+ * Older designs for left/right drawers have more padding around the content.
36
+ * This value is in rem, and must be an integer under 3.
37
+ *
38
+ * Default is 2 if null or undefined, or 1 if headingText is supplied. This is silly
39
+ * but aligns with design and allows this prop to be left out most of the time.
21
40
  */
22
- bottomContentLabel?: string;
41
+ paddingLevel?: 0 | 1 | 2;
23
42
  }
24
43
  /**
25
44
  * ## Overview
@@ -27,5 +46,5 @@ export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
27
46
  * A component for displaying a drawer.
28
47
  *
29
48
  */
30
- declare const Drawer: ({ className, isOpen, onClose, children, drawerOpenSide, bottomContentLabel, ...props }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
49
+ declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
31
50
  export default Drawer;
@@ -1,80 +1,87 @@
1
- import { jsx as o, jsxs as e } from "react/jsx-runtime";
2
- import { Root as u, Portal as N, Overlay as v, Content as $, Title as x, Description as y, Close as n } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
- import a from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as g, noOp as w } from "../../utils/index.js";
5
- import { ButtonVariants as c } from "../Button/types.js";
6
- import m from "../Icon/Icon.js";
7
- import d from "../IconButton/IconButton.js";
8
- import k from "../Text/Text.js";
9
- import { TextVariants as B } from "../Text/types.js";
10
- const q = ({
11
- className: h,
12
- isOpen: p = !1,
13
- onClose: r = w,
14
- children: C,
15
- drawerOpenSide: i = "right",
16
- bottomContentLabel: f,
17
- ...l
18
- }) => {
19
- const { className: t, ..._ } = g(l, "Drawer"), s = i === "bottom";
20
- return /* @__PURE__ */ o(
21
- u,
22
- {
23
- open: p,
24
- onOpenChange: (b) => {
25
- b || r();
26
- },
27
- children: /* @__PURE__ */ e(N, { children: [
28
- /* @__PURE__ */ o(
29
- v,
30
- {
31
- onClick: r,
32
- className: a(`${t}__overlay`),
33
- "data-testid": "drawer-overlay"
34
- }
35
- ),
36
- /* @__PURE__ */ e(
37
- $,
38
- {
39
- className: a(t, h, { [`${t}--bottom`]: s }),
40
- "data-side": i,
41
- id: l.id,
42
- ..._,
43
- children: [
44
- /* @__PURE__ */ o(x, {}),
45
- /* @__PURE__ */ o(y, {}),
46
- s ? /* @__PURE__ */ e("div", { className: `${t}__bottom-content`, children: [
47
- /* @__PURE__ */ o(n, { asChild: !0, children: /* @__PURE__ */ o(
48
- d,
1
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
+ import { forwardRef as y } from "react";
3
+ import s from "../../node_modules/classnames/index.js";
4
+ import { Root as $, Portal as w, Overlay as D, Content as b, Title as v, Description as B, Close as P } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
5
+ import { VisuallyHidden as n } from "../../node_modules/@radix-ui/react-visually-hidden/dist/index.js";
6
+ import { getCommonProps as j, noOp as k } from "../../utils/index.js";
7
+ import H from "./DrawerHeader.js";
8
+ import I from "../IconButton/IconButton.js";
9
+ import { ButtonVariants as R } from "../Button/types.js";
10
+ import V from "../Icon/Icon.js";
11
+ const g = y(
12
+ ({
13
+ isOpen: d,
14
+ onClose: t = k,
15
+ headerText: a,
16
+ title: m,
17
+ description: f = m,
18
+ drawerOpenSide: e = "right",
19
+ paddingLevel: i,
20
+ className: h,
21
+ children: p,
22
+ ...l
23
+ }, C) => {
24
+ const { className: o, ...u } = j(l, "Drawer"), N = e === "bottom";
25
+ return i ?? (i = a ? 1 : 2), /* @__PURE__ */ r(
26
+ $,
27
+ {
28
+ open: d,
29
+ onOpenChange: (_) => {
30
+ _ || t();
31
+ },
32
+ children: /* @__PURE__ */ c(w, { children: [
33
+ /* @__PURE__ */ r(D, { onClick: t, className: `${o}__overlay`, "data-testid": "drawer-overlay" }),
34
+ /* @__PURE__ */ c(
35
+ b,
36
+ {
37
+ className: s(o, h, {
38
+ [`${o}--bottom`]: N
39
+ }),
40
+ "data-side": e,
41
+ id: l.id,
42
+ ref: C,
43
+ ...u,
44
+ children: [
45
+ /* @__PURE__ */ r(n, { asChild: !0, children: /* @__PURE__ */ r(v, { children: m }) }),
46
+ /* @__PURE__ */ r(n, { asChild: !0, children: /* @__PURE__ */ r(B, { children: f }) }),
47
+ a ? /* @__PURE__ */ r(
48
+ H,
49
49
  {
50
- onClick: r,
51
- className: a(`${t}__close--bottom`),
50
+ baseClassName: o,
51
+ headerText: a,
52
+ onClose: t,
53
+ drawerOpenSide: e
54
+ }
55
+ ) : /* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(
56
+ I,
57
+ {
58
+ onClick: t,
59
+ className: s(`${o}__close`),
52
60
  "aria-label": "Close",
53
61
  "data-testid": "drawer-close",
54
- variant: c.tertiary,
55
- children: /* @__PURE__ */ o(m, { icon: "CloseX", color: "currentColor" })
62
+ variant: R.tertiary,
63
+ children: /* @__PURE__ */ r(V, { icon: "CloseX", color: "currentColor" })
56
64
  }
57
65
  ) }),
58
- /* @__PURE__ */ o(k, { variant: B.string1, className: `${t}__bottom-content--label`, children: f })
59
- ] }) : /* @__PURE__ */ o(n, { asChild: !0, children: /* @__PURE__ */ o(
60
- d,
61
- {
62
- onClick: r,
63
- className: a(`${t}__close`),
64
- "aria-label": "Close",
65
- "data-testid": "drawer-close",
66
- variant: c.tertiary,
67
- children: /* @__PURE__ */ o(m, { icon: "CloseX", color: "currentColor" })
68
- }
69
- ) }),
70
- C
71
- ]
72
- }
73
- )
74
- ] })
75
- }
76
- );
77
- };
66
+ /* @__PURE__ */ r(
67
+ "div",
68
+ {
69
+ className: s(
70
+ `${o}__content`,
71
+ i < 3 && `${o}__content--ep${i}`
72
+ ),
73
+ children: p
74
+ }
75
+ )
76
+ ]
77
+ }
78
+ )
79
+ ] })
80
+ }
81
+ );
82
+ }
83
+ );
84
+ g.displayName = "Drawer";
78
85
  export {
79
- q as default
86
+ g as default
80
87
  };
@@ -1,7 +1,7 @@
1
1
  import { DrawerProps } from './Drawer';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ className, isOpen, onClose, children, drawerOpenSide, bottomContentLabel, ...props }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: import('react').ForwardRefExoticComponent<DrawerProps & import('react').RefAttributes<HTMLDivElement>>;
5
5
  };
6
6
  export default meta;
7
7
  export declare const Playground: {
@@ -9,6 +9,101 @@ export declare const Playground: {
9
9
  args: {
10
10
  children: string;
11
11
  isOpen: boolean;
12
+ headerText: string;
13
+ title: undefined;
14
+ drawerOpenSide: string;
15
+ paddingLevel: number;
16
+ };
17
+ argTypes: {
18
+ isOpen: {
19
+ control: string;
20
+ description: string;
21
+ defaultValue: boolean;
22
+ table: {
23
+ type: {
24
+ summary: string;
25
+ };
26
+ };
27
+ };
28
+ onClose: {
29
+ action: string;
30
+ description: string;
31
+ table: {
32
+ type: {
33
+ summary: string;
34
+ };
35
+ };
36
+ };
37
+ children: {
38
+ control: string;
39
+ description: string;
40
+ table: {
41
+ type: {
42
+ summary: string;
43
+ };
44
+ };
45
+ };
46
+ headerText: {
47
+ control: string;
48
+ description: string;
49
+ table: {
50
+ type: {
51
+ summary: string;
52
+ };
53
+ };
54
+ };
55
+ title: {
56
+ control: string;
57
+ description: string;
58
+ table: {
59
+ type: {
60
+ summary: string;
61
+ };
62
+ };
63
+ };
64
+ drawerOpenSide: {
65
+ control: {
66
+ type: string;
67
+ };
68
+ options: string[];
69
+ description: string;
70
+ defaultValue: string;
71
+ table: {
72
+ type: {
73
+ summary: string;
74
+ };
75
+ };
76
+ };
77
+ paddingLevel: {
78
+ control: {
79
+ type: string;
80
+ };
81
+ options: (number | undefined)[];
82
+ description: string;
83
+ defaultValue: undefined;
84
+ table: {
85
+ type: {
86
+ summary: string;
87
+ };
88
+ };
89
+ };
90
+ className: {
91
+ control: string;
92
+ description: string;
93
+ table: {
94
+ type: {
95
+ summary: string;
96
+ };
97
+ };
98
+ };
99
+ id: {
100
+ control: string;
101
+ description: string;
102
+ table: {
103
+ type: {
104
+ summary: string;
105
+ };
106
+ };
107
+ };
12
108
  };
13
- argTypes: {};
14
109
  };
@@ -0,0 +1,12 @@
1
+ import { ComponentProps } from 'react';
2
+ import { DrawerProps } from './Drawer';
3
+ type CommonProps = ComponentProps<'div'> & {
4
+ baseClassName: string;
5
+ drawerOpenSide: DrawerProps['drawerOpenSide'];
6
+ onClose: () => void;
7
+ };
8
+ export type DrawerHeaderProps = CommonProps & {
9
+ headerText?: string;
10
+ };
11
+ declare const DrawerHeader: import('react').ForwardRefExoticComponent<Omit<DrawerHeaderProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
12
+ export default DrawerHeader;
@@ -0,0 +1,34 @@
1
+ import { jsxs as i, Fragment as c, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as m } from "react";
3
+ import { Close as d } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
4
+ import f from "../IconButton/IconButton.js";
5
+ import { ButtonVariants as h } from "../Button/types.js";
6
+ import b from "../Icon/Icon.js";
7
+ const n = ({ baseClassName: a, drawerOpenSide: t, onClose: l, bookendSide: e, ...s }) => {
8
+ const r = t === "bottom" && e === "left" || t !== "bottom" && e === "right";
9
+ return /* @__PURE__ */ o("div", { className: `${a}__bookend ${a}__bookend-${e}`, ...s, children: r && /* @__PURE__ */ o(d, { asChild: !0, children: /* @__PURE__ */ o(f, { onClick: l, "aria-label": "Close", "data-testid": "drawer-close", variant: h.tertiary, children: /* @__PURE__ */ o(b, { icon: "CloseX", color: "currentColor" }) }) }) });
10
+ }, _ = m(
11
+ ({ baseClassName: a, headerText: t, drawerOpenSide: l, onClose: e }, s) => {
12
+ const r = `${a}-header`;
13
+ return /* @__PURE__ */ i(c, { children: [
14
+ /* @__PURE__ */ i("div", { className: r, children: [
15
+ /* @__PURE__ */ o(n, { baseClassName: r, onClose: e, drawerOpenSide: l, bookendSide: "left" }),
16
+ /* @__PURE__ */ o("h3", { className: `${r}__title`, children: t }),
17
+ /* @__PURE__ */ o(
18
+ n,
19
+ {
20
+ baseClassName: r,
21
+ onClose: e,
22
+ drawerOpenSide: l,
23
+ bookendSide: "right"
24
+ }
25
+ )
26
+ ] }),
27
+ t && /* @__PURE__ */ o("div", { className: `${r}__hr` })
28
+ ] });
29
+ }
30
+ );
31
+ _.displayName = "DrawerHeader";
32
+ export {
33
+ _ as default
34
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { default as React, ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  import { DropdownItem } from './types';
3
3
  import * as DropdownSelect from '@radix-ui/react-select';
4
4
  export interface DropdownProps extends Omit<DropdownSelect.SelectProps, 'defaultValue' | 'dir'>, ComponentPropsWithoutRef<'div'> {
@@ -32,5 +32,5 @@ export interface DropdownProps extends Omit<DropdownSelect.SelectProps, 'default
32
32
  *
33
33
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-dropdown--overview)
34
34
  */
35
- declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLButtonElement>>;
35
+ declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps & import('react').RefAttributes<HTMLButtonElement>>;
36
36
  export default Dropdown;
@@ -1,16 +1,16 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import d, { useState as C } from "react";
2
+ import { forwardRef as p, useState as C } from "react";
3
3
  import { getCommonProps as D } from "../../utils/index.js";
4
4
  import i from "../../node_modules/classnames/index.js";
5
- import { Root as $, Trigger as v, Value as I, Icon as b, Portal as x, Content as R, ScrollUpButton as S, Viewport as O, ScrollDownButton as P, Item as V, ItemText as j } from "../../node_modules/@radix-ui/react-select/dist/index.js";
5
+ import { Root as $, Trigger as v, Value as I, Icon as b, Portal as x, Content as S, ScrollUpButton as O, Viewport as P, ScrollDownButton as R, Item as V, ItemText as j } from "../../node_modules/@radix-ui/react-select/dist/index.js";
6
6
  import c from "../Icon/Icon.js";
7
- const y = d.forwardRef(
8
- ({ options: n, value: a, onValueChange: l, label: s, className: h, id: m, disabled: _, ...f }, w) => {
9
- const { className: o, ...u } = D({ id: m }, "Dropdown"), [N, g] = C(!1);
10
- return /* @__PURE__ */ e("div", { className: i(o, h), id: m, ...u, ...f, children: /* @__PURE__ */ t(
7
+ const y = p(
8
+ ({ options: a, value: n, onValueChange: l, label: s, className: h, id: m, disabled: _, ...w }, N) => {
9
+ const { className: o, ...u } = D({ id: m }, "Dropdown"), [f, g] = C(!1);
10
+ return /* @__PURE__ */ e("div", { className: i(o, h), id: m, ...u, ...w, children: /* @__PURE__ */ t(
11
11
  $,
12
12
  {
13
- value: a,
13
+ value: n,
14
14
  onValueChange: (r) => {
15
15
  l(r);
16
16
  },
@@ -21,15 +21,15 @@ const y = d.forwardRef(
21
21
  {
22
22
  className: `${o}__trigger`,
23
23
  "aria-label": s,
24
- ref: w,
24
+ ref: N,
25
25
  disabled: _,
26
26
  children: [
27
- /* @__PURE__ */ e(I, { placeholder: a }),
27
+ /* @__PURE__ */ e(I, { placeholder: n }),
28
28
  /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(
29
29
  c,
30
30
  {
31
31
  icon: "ChevronDown",
32
- className: i({ [`${o}__trigger-icon-expanded`]: N }),
32
+ className: i({ [`${o}__trigger-icon-expanded`]: f }),
33
33
  height: "1rem",
34
34
  width: "1rem"
35
35
  }
@@ -37,19 +37,19 @@ const y = d.forwardRef(
37
37
  ]
38
38
  }
39
39
  ),
40
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ t(R, { className: `${o}__content`, position: "popper", children: [
41
- /* @__PURE__ */ e(S, { className: `${o}__scroll-button__up`, children: /* @__PURE__ */ e(c, { icon: "ChevronDown" }) }),
42
- /* @__PURE__ */ e(O, { className: `${o}__viewport`, children: n.map((r) => /* @__PURE__ */ e(
43
- p,
40
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ t(S, { className: `${o}__content`, position: "popper", children: [
41
+ /* @__PURE__ */ e(O, { className: `${o}__scroll-button__up`, children: /* @__PURE__ */ e(c, { icon: "ChevronDown" }) }),
42
+ /* @__PURE__ */ e(P, { className: `${o}__viewport`, children: a.map((r) => /* @__PURE__ */ e(
43
+ d,
44
44
  {
45
45
  value: r.value,
46
- disabled: r.value === a,
46
+ disabled: r.value === n,
47
47
  className: o,
48
48
  children: r.label
49
49
  },
50
50
  r.value
51
51
  )) }),
52
- /* @__PURE__ */ e(P, { className: `${o}__scroll-button`, children: /* @__PURE__ */ e(c, { icon: "ChevronDown" }) })
52
+ /* @__PURE__ */ e(R, { className: `${o}__scroll-button`, children: /* @__PURE__ */ e(c, { icon: "ChevronDown" }) })
53
53
  ] }) })
54
54
  ]
55
55
  }
@@ -57,10 +57,10 @@ const y = d.forwardRef(
57
57
  }
58
58
  );
59
59
  y.displayName = "Dropdown";
60
- const p = d.forwardRef(
61
- ({ children: n, className: a, ...l }, s) => /* @__PURE__ */ e(V, { className: `${a}__item`, ...l, ref: s, children: /* @__PURE__ */ e(j, { children: n }) })
60
+ const d = p(
61
+ ({ children: a, className: n, ...l }, s) => /* @__PURE__ */ e(V, { className: `${n}__item`, ...l, ref: s, children: /* @__PURE__ */ e(j, { children: a }) })
62
62
  );
63
- p.displayName = "DropdownSelectItem";
63
+ d.displayName = "DropdownSelectItem";
64
64
  export {
65
65
  y as default
66
66
  };
@@ -1,5 +1,5 @@
1
1
  import { SpacingTokens } from '../../utils';
2
- export interface GridProps<ElementType = HTMLElement> extends React.HTMLAttributes<ElementType> {
2
+ export interface GridProps<GridElementType = HTMLElement> extends React.HTMLAttributes<GridElementType> {
3
3
  /**
4
4
  * A Grid must have children
5
5
  */
@@ -7,7 +7,7 @@ export interface GridProps<ElementType = HTMLElement> extends React.HTMLAttribut
7
7
  /**
8
8
  * Optional element to render as the top-level component e.g. 'div', 'span', CustomComponent, etc. Defaults to 'section'.
9
9
  */
10
- element?: React.ElementType<GridProps<ElementType>>;
10
+ element?: React.ElementType;
11
11
  /**
12
12
  * The gap between the rows in the grid. Defaults to 'md'.
13
13
  */
@@ -26,5 +26,8 @@ export interface GridProps<ElementType = HTMLElement> extends React.HTMLAttribut
26
26
  *
27
27
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-layouts-grid--overview)
28
28
  */
29
- export declare function Grid({ children, className, element: Element, columnGap, rowGap, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
29
+ type GridComponent = <T extends HTMLElement = HTMLElement>(props: GridProps<T> & {
30
+ ref?: React.Ref<T>;
31
+ }) => React.ReactElement | null;
32
+ declare const Grid: GridComponent;
30
33
  export default Grid;
@@ -1,27 +1,29 @@
1
- import { jsx as c } from "react/jsx-runtime";
1
+ import { jsx as d } from "react/jsx-runtime";
2
2
  import l from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as d, SpacingTokens as e } from "../../utils/index.js";
3
+ import { getCommonProps as p, SpacingTokens as m } from "../../utils/index.js";
4
4
  import { determineGridClassName as f } from "./utils.js";
5
- function C({
5
+ import { forwardRef as G } from "react";
6
+ const N = ({
6
7
  children: o,
7
- className: s,
8
- element: r = "section",
9
- columnGap: a = e.md,
10
- rowGap: t = e.lg,
11
- ...m
12
- }) {
13
- const { className: n, ...i } = d(m, "Grid");
14
- return /* @__PURE__ */ c(
15
- r,
8
+ className: r,
9
+ element: s = "section",
10
+ columnGap: a = m.md,
11
+ rowGap: t = m.lg,
12
+ ...e
13
+ }, n) => {
14
+ const { className: i, ...c } = p(e, "Grid");
15
+ return /* @__PURE__ */ d(
16
+ s,
16
17
  {
17
- ...i,
18
- className: l(f(n, a, t), s),
19
- ...m,
18
+ ...c,
19
+ className: l(f(i, a, t), r),
20
+ ...e,
21
+ ref: n,
20
22
  children: o
21
23
  }
22
24
  );
23
- }
25
+ }, g = G(N);
26
+ g.displayName = "Grid";
24
27
  export {
25
- C as Grid,
26
- C as default
28
+ g as default
27
29
  };