@phillips/seldon 1.143.2 → 1.144.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 (56) hide show
  1. package/dist/components/ComboBox/ComboBox.d.ts +69 -0
  2. package/dist/components/ComboBox/ComboBox.js +221 -0
  3. package/dist/components/ComboBox/ComboBox.stories.d.ts +18 -0
  4. package/dist/components/ComboBox/ComboBox.test.d.ts +1 -0
  5. package/dist/components/ComboBox/index.d.ts +1 -0
  6. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.d.ts +38 -0
  7. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.stories.d.ts +14 -0
  8. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.test.d.ts +1 -0
  9. package/dist/index.d.ts +9 -1
  10. package/dist/index.js +108 -106
  11. package/dist/node_modules/@radix-ui/react-context/dist/index.js +34 -49
  12. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +12 -12
  13. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  14. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  15. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +68 -0
  16. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  17. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  18. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  19. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  20. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  21. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  22. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
  23. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  24. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  25. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +32 -0
  26. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  27. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  28. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +23 -22
  29. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  30. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  31. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  32. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-context/dist/index.js +53 -0
  33. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  34. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  35. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  36. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  37. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
  38. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  39. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  40. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  41. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  42. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  43. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  44. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  45. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  46. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  47. package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.js +17 -0
  48. package/dist/node_modules/cmdk/dist/index.js +312 -0
  49. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.js +25 -0
  50. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +31 -0
  51. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  52. package/dist/scss/_vars.scss +3 -0
  53. package/dist/scss/_vars.scss.js +3 -0
  54. package/dist/scss/componentStyles.scss +1 -0
  55. package/dist/scss/components/ComboBox/_combobox.scss +149 -0
  56. package/package.json +4 -2
@@ -0,0 +1,69 @@
1
+ import { default as React } from 'react';
2
+ export interface ComboBoxProps {
3
+ /**
4
+ * Boolean to specify whether you want the underlying label to be visually hidden
5
+ */
6
+ hideLabel?: boolean;
7
+ /**
8
+ * List of options to be displayed in the ComboBox.
9
+ */
10
+ options: {
11
+ label?: string;
12
+ value: string;
13
+ }[];
14
+ /**
15
+ * Unique id for the ComboBox.
16
+ */
17
+ id: string;
18
+ /**
19
+ * Optional className for custom styling.
20
+ */
21
+ className?: string;
22
+ /**
23
+ * Label for the ComboBox.
24
+ */
25
+ labelText: string;
26
+ /**
27
+ * Optional placeholder text for the input.
28
+ */
29
+ placeholder?: string;
30
+ /**
31
+ * Input value for the ComboBox.
32
+ */
33
+ inputValue: string;
34
+ /**
35
+ * Passed in function to handle input value changes.
36
+ */
37
+ setInputValue: (value: string) => void;
38
+ /**
39
+ * aria-label optional input label
40
+ */
41
+ ariaLabelInput?: string;
42
+ /**
43
+ * aria-label for the clear button
44
+ */
45
+ ariaLabelClear?: string;
46
+ /**
47
+ * aria-label for the dropdown button
48
+ */
49
+ ariaLabelDropdown?: string;
50
+ /**
51
+ * aria-label for content
52
+ */
53
+ ariaLabelContent?: string;
54
+ /**
55
+ * If true, the input will be cleared when the user clicks away when the input value is not in the options list.
56
+ */
57
+ autoClearInput?: boolean;
58
+ }
59
+ /**
60
+ * ## Overview
61
+ *
62
+ * This is a ComboBox component that allows users to select from a list of options or enter a custom value.
63
+ *
64
+ * [Figma Link] https://www.figma.com/design/rIefa3bRPyZbZmtyV9PSQv/My-Account?node-id=1-3&p=f&m=dev
65
+ *
66
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-comboBox--overview)
67
+ */
68
+ declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLDivElement>>;
69
+ export default ComboBox;
@@ -0,0 +1,221 @@
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Root as D, Trigger as E, Portal as T, Content as j } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
3
+ import p from "../../node_modules/classnames/index.js";
4
+ import { Command as w, CommandInput as F, CommandList as K, CommandGroup as G, CommandItem as X } from "../../node_modules/cmdk/dist/index.js";
5
+ import l from "react";
6
+ import { useOnClickOutside as q } from "../../node_modules/usehooks-ts/dist/index.js";
7
+ import "../../assets/formatted/AccountActive.js";
8
+ import "../../assets/formatted/Account.js";
9
+ import "../../assets/formatted/Add.js";
10
+ import "../../assets/formatted/AppleAppStoreBadge.js";
11
+ import "../../assets/formatted/ArrowDown.js";
12
+ import "../../assets/formatted/ArrowLeft.js";
13
+ import "../../assets/formatted/ArrowRight.js";
14
+ import "../../assets/formatted/ArrowUp.js";
15
+ import "../../assets/formatted/Bag.js";
16
+ import "../../assets/formatted/Calendar.js";
17
+ import z from "../../assets/formatted/ChevronDown.js";
18
+ import "../../assets/formatted/ChevronLeft.js";
19
+ import "../../assets/formatted/ChevronRight.js";
20
+ import "../../assets/formatted/ChevronUp.js";
21
+ import A from "../../assets/formatted/CloseX.js";
22
+ import "../../assets/formatted/ConditionReport.js";
23
+ import "../../assets/formatted/Delete.js";
24
+ import "../../assets/formatted/Download.js";
25
+ import "../../assets/formatted/Edit.js";
26
+ import "../../assets/formatted/Email.js";
27
+ import "../../assets/formatted/Error.js";
28
+ import "../../assets/formatted/ExternalLink.js";
29
+ import "../../assets/formatted/Facebook.js";
30
+ import "../../assets/formatted/FavoriteActive.js";
31
+ import "../../assets/formatted/Favorite.js";
32
+ import "../../assets/formatted/Filters.js";
33
+ import "../../assets/formatted/Fullscreen.js";
34
+ import "../../assets/formatted/FullscreenExit.js";
35
+ import "../../assets/formatted/GavelActive.js";
36
+ import "../../assets/formatted/Gavel.js";
37
+ import "../../assets/formatted/Grid.js";
38
+ import "../../assets/formatted/Hide.js";
39
+ import "../../assets/formatted/HomeActive.js";
40
+ import "../../assets/formatted/Home.js";
41
+ import "../../assets/formatted/IconGreenCircle.js";
42
+ import "../../assets/formatted/IconRedCircle.js";
43
+ import "../../assets/formatted/Icon.js";
44
+ import "../../assets/formatted/Instagram.js";
45
+ import "../../assets/formatted/LinkedIn.js";
46
+ import "../../assets/formatted/List.js";
47
+ import "../../assets/formatted/Lock.js";
48
+ import "../../assets/formatted/MagnificentSeven.js";
49
+ import "../../assets/formatted/Menu.js";
50
+ import "../../assets/formatted/Mute.js";
51
+ import "../../assets/formatted/Pause.js";
52
+ import "../../assets/formatted/PhillipsAppIcon.js";
53
+ import "../../assets/formatted/PhillipsLogo.js";
54
+ import "../../assets/formatted/Play.js";
55
+ import "../../assets/formatted/Red.js";
56
+ import "../../assets/formatted/Refresh.js";
57
+ import "../../assets/formatted/Search.js";
58
+ import "../../assets/formatted/SellActive.js";
59
+ import "../../assets/formatted/Sell.js";
60
+ import "../../assets/formatted/Share.js";
61
+ import "../../assets/formatted/Subtract.js";
62
+ import "../../assets/formatted/Success.js";
63
+ import "../../assets/formatted/Tooltip.js";
64
+ import "../../assets/formatted/TwitterX.js";
65
+ import "../../assets/formatted/Upload.js";
66
+ import "../../assets/formatted/View.js";
67
+ import "../../assets/formatted/VolumeMaximum.js";
68
+ import "../../assets/formatted/VolumeMid.js";
69
+ import "../../assets/formatted/VolumeMinimum.js";
70
+ import "../../assets/formatted/WeChat.js";
71
+ import { getCommonProps as H } from "../../utils/index.js";
72
+ import { getScssVar as v } from "../../utils/scssUtils.js";
73
+ const J = l.forwardRef(function({
74
+ options: N = [],
75
+ className: g,
76
+ id: r,
77
+ labelText: L,
78
+ placeholder: x,
79
+ inputValue: m = "",
80
+ setInputValue: i,
81
+ ariaLabelDropdown: d,
82
+ ariaLabelInput: f,
83
+ ariaLabelClear: u,
84
+ ariaLabelContent: _,
85
+ hideLabel: R = !1,
86
+ autoClearInput: O = !0,
87
+ ...k
88
+ }, y) {
89
+ const { className: e, ...I } = H({ id: r }, "ComboBox"), [C, s] = l.useState(!1), $ = l.useRef(null), S = z, B = A, b = l.useRef(null), P = l.useRef({}), c = N.filter(
90
+ (o) => o.value.toLowerCase().includes(m.toLowerCase()) || o.label && o.label.toLowerCase().includes(m.toLowerCase())
91
+ );
92
+ return q(b, (o) => {
93
+ if (o.target.closest(`.${e}__item`) || o.target.closest(`.${e}__content`))
94
+ return;
95
+ !c.some(
96
+ (a) => a.value.toLowerCase() === m.toLowerCase()
97
+ ) && O && i(""), s(!1), o.stopPropagation();
98
+ }), /* @__PURE__ */ t("div", { ref: y, className: p(e, g), id: r, ...I, ...k, children: /* @__PURE__ */ n("div", { ref: b, children: [
99
+ /* @__PURE__ */ t(
100
+ "label",
101
+ {
102
+ htmlFor: `${r}-input`,
103
+ className: p(`${e}__label`, {
104
+ [`${e}__label--hidden`]: R
105
+ }),
106
+ "data-testid": `${r}-label`,
107
+ children: L
108
+ }
109
+ ),
110
+ /* @__PURE__ */ t(
111
+ w,
112
+ {
113
+ loop: !0,
114
+ onKeyDown: (o) => {
115
+ setTimeout(() => {
116
+ o.key === "Escape" && s(!1);
117
+ }, 0);
118
+ },
119
+ children: /* @__PURE__ */ n(D, { open: !0, children: [
120
+ /* @__PURE__ */ n("div", { className: `${e}__input-wrapper`, children: [
121
+ /* @__PURE__ */ t(E, { asChild: !0, children: /* @__PURE__ */ t(
122
+ F,
123
+ {
124
+ ref: $,
125
+ placeholder: x,
126
+ value: m,
127
+ onValueChange: (o) => {
128
+ i(o), s(!0);
129
+ },
130
+ onKeyDown: (o) => {
131
+ o.key === "Tab" && s(!1);
132
+ },
133
+ onFocus: () => {
134
+ s((o) => !o), i(m);
135
+ },
136
+ className: `${e}__input`,
137
+ tabIndex: 0,
138
+ "aria-label": f || `${r}-input`,
139
+ "data-testid": `${r}-input`
140
+ }
141
+ ) }),
142
+ m.length > 0 && /* @__PURE__ */ t(
143
+ "button",
144
+ {
145
+ className: `${e}__close-button`,
146
+ "data-testid": `${r}-item-close-button`,
147
+ onClick: () => i(""),
148
+ "aria-label": u || `${r}-clear`,
149
+ tabIndex: -1,
150
+ children: /* @__PURE__ */ t("div", { className: `${e}__icon`, children: /* @__PURE__ */ t(
151
+ B,
152
+ {
153
+ color: v("", "$primary-black"),
154
+ height: 18,
155
+ width: 18,
156
+ className: `${e}__icon-button`
157
+ }
158
+ ) })
159
+ }
160
+ ),
161
+ /* @__PURE__ */ t(
162
+ "button",
163
+ {
164
+ "aria-label": d || `${r}-dropdown`,
165
+ className: `${e}__dropdown-button`,
166
+ onClick: () => $.current?.focus(),
167
+ "data-testid": `${r}-dropdown`,
168
+ tabIndex: -1,
169
+ children: /* @__PURE__ */ t(
170
+ "div",
171
+ {
172
+ className: p(`${e}__icon`, {
173
+ [`${e}__icon--flipped`]: C
174
+ }),
175
+ children: /* @__PURE__ */ t(
176
+ S,
177
+ {
178
+ color: v("", "$pure-black"),
179
+ height: 18,
180
+ width: 18,
181
+ className: `${e}__icon-button`
182
+ }
183
+ )
184
+ }
185
+ )
186
+ }
187
+ )
188
+ ] }),
189
+ /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(
190
+ j,
191
+ {
192
+ className: `${e}__content`,
193
+ "aria-label": _ || `${r}-content`,
194
+ children: C && /* @__PURE__ */ t(K, { className: `${e}__list`, children: c.some(
195
+ (o) => o.value.toLowerCase().includes(m.toLowerCase()) || o.label && o.label.toLowerCase().includes(m.toLowerCase())
196
+ ) ? /* @__PURE__ */ t(G, { children: c.map(
197
+ (o, h) => (o.value.toLowerCase().includes(m.toLowerCase()) || o.label && o.label.toLowerCase().includes(m.toLowerCase())) && /* @__PURE__ */ t(
198
+ X,
199
+ {
200
+ className: `${e}__item`,
201
+ value: o.label ? `${o.label} ${o.value}` : o.value,
202
+ ref: (a) => P.current[o.value] = a,
203
+ onSelect: (a) => {
204
+ i(a), s(!1);
205
+ },
206
+ children: o.label ? `${o.label} ${o.value}` : o.value
207
+ },
208
+ `${o.value}-${h}`
209
+ )
210
+ ) }) : /* @__PURE__ */ t(w.Empty, { children: "No Options." }) })
211
+ }
212
+ ) })
213
+ ] })
214
+ }
215
+ )
216
+ ] }) });
217
+ });
218
+ J.displayName = "ComboBox";
219
+ export {
220
+ J as default
221
+ };
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { ComboBoxProps } from './ComboBox';
3
+ declare const meta: {
4
+ title: string;
5
+ component: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLDivElement>>;
6
+ };
7
+ export default meta;
8
+ export declare const Playground: {
9
+ (props: ComboBoxProps): import("react/jsx-runtime").JSX.Element;
10
+ args: {
11
+ options: {
12
+ value: string;
13
+ }[];
14
+ id: string;
15
+ labelText: string;
16
+ };
17
+ argTypes: {};
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default as ComboBox, type ComboBoxProps } from './ComboBox';
@@ -0,0 +1,38 @@
1
+ import { default as React } from 'react';
2
+ export interface PhoneNumberPickerProps {
3
+ /**
4
+ * Unique id for the ComboBox.
5
+ */
6
+ id: string;
7
+ /**
8
+ * Optional className for custom styling.
9
+ */
10
+ className?: string;
11
+ /**
12
+ * Label for the ComboBox.
13
+ */
14
+ labelText: string;
15
+ /**
16
+ * Optional placeholder text for the input.
17
+ */
18
+ placeholder?: string;
19
+ /**
20
+ * Input value for the ComboBox.
21
+ */
22
+ inputValue: string;
23
+ /**
24
+ * Passed in function to handle input value changes.
25
+ */
26
+ setInputValue: (value: string) => void;
27
+ }
28
+ /**
29
+ * ## Overview
30
+ *
31
+ * Overview of PhoneNumberPicker component
32
+ *
33
+ * [Figma Link] https://www.figma.com/design/rIefa3bRPyZbZmtyV9PSQv/My-Account?node-id=1-3&p=f&m=dev
34
+ *
35
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-PhoneNumberPicker--overview)
36
+ */
37
+ declare const PhoneNumberPicker: React.ForwardRefExoticComponent<PhoneNumberPickerProps & React.RefAttributes<HTMLDivElement>>;
38
+ export default PhoneNumberPicker;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { PhoneNumberPickerProps } from './PhoneNumberPicker';
3
+ declare const meta: {
4
+ title: string;
5
+ component: React.ForwardRefExoticComponent<PhoneNumberPickerProps & React.RefAttributes<HTMLDivElement>>;
6
+ };
7
+ export default meta;
8
+ export declare const Playground: {
9
+ ({ ...props }: PhoneNumberPickerProps): import("react/jsx-runtime").JSX.Element;
10
+ args: {
11
+ labelText: string;
12
+ id: string;
13
+ };
14
+ };
package/dist/index.d.ts CHANGED
@@ -28,7 +28,6 @@ export { default as Navigation, type NavigationProps } from './components/Naviga
28
28
  export { default as NavigationItem, type NavigationItemProps, } from './components/Navigation/NavigationItem/NavigationItem';
29
29
  export { default as NavigationItemTrigger, type NavigationItemTriggerProps, } from './components/Navigation/NavigationItemTrigger/NavigationItemTrigger';
30
30
  export { default as NavigationList, type NavigationListProps, } from './components/Navigation/NavigationList/NavigationList';
31
- export { default as PageContentWrapper } from './components/PageContentWrapper/PageContentWrapper';
32
31
  export { default as Pagination, type PaginationOption, type PaginationOptionValue, type PaginationProps, } from './components/Pagination/Pagination';
33
32
  export * from './components/PinchZoom';
34
33
  export { default as Row, type RowProps } from './components/Row/Row';
@@ -55,6 +54,15 @@ export { default as UserManagement, type UserManagementProps } from './patterns/
55
54
  export { default as StatefulViewingsList, type StatefulViewingsListProps, } from './patterns/ViewingsList/StatefulViewingsList';
56
55
  export { default as ViewingsList, type ViewingsListProps } from './patterns/ViewingsList/ViewingsList';
57
56
  export * from './providers/SeldonProvider/SeldonProvider';
57
+ export * from './components/Carousel';
58
+ export * from './components/ComboBox';
59
+ export * from './components/Detail';
60
+ export { default as PageContentWrapper } from './components/PageContentWrapper/PageContentWrapper';
61
+ export * from './components/PinchZoom';
62
+ export * from './components/SeldonImage';
63
+ export * from './components/Tabs';
64
+ export * from './patterns/DetailList';
65
+ export * from './patterns/SaleHeaderBanner';
58
66
  export { default as Footer, type FooterProps } from './site-furniture/Footer/Footer';
59
67
  export { default as Header, type HeaderProps } from './site-furniture/Header/Header';
60
68
  export * from './types/commonTypes';