@phillips/seldon 1.51.1 → 1.53.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 (64) hide show
  1. package/dist/assets/account_circle.svg.js +2 -2
  2. package/dist/assets/minus.svg.js +1 -1
  3. package/dist/assets/plus.svg.js +1 -1
  4. package/dist/components/Accordion/AccordionItem.d.ts +8 -4
  5. package/dist/components/Accordion/AccordionItem.js +67 -65
  6. package/dist/components/Collapsible/Collapsible.d.ts +10 -0
  7. package/dist/components/Collapsible/Collapsible.js +13 -0
  8. package/dist/components/Collapsible/CollapsibleContent.d.ts +11 -0
  9. package/dist/components/Collapsible/CollapsibleContent.js +21 -0
  10. package/dist/components/Collapsible/CollapsibleTrigger.d.ts +10 -0
  11. package/dist/components/Collapsible/CollapsibleTrigger.js +21 -0
  12. package/dist/components/Collapsible/index.d.ts +3 -0
  13. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  14. package/dist/components/Header/Header.d.ts +20 -13
  15. package/dist/components/Header/Header.js +73 -76
  16. package/dist/components/Header/utils.d.ts +2 -9
  17. package/dist/components/Header/utils.js +3 -7
  18. package/dist/components/LanguageSelector/LanguageSelector.d.ts +36 -0
  19. package/dist/components/LanguageSelector/LanguageSelector.js +73 -0
  20. package/dist/components/LanguageSelector/index.d.ts +1 -0
  21. package/dist/components/Link/Link.d.ts +3 -11
  22. package/dist/components/Link/index.d.ts +2 -0
  23. package/dist/components/Navigation/Navigation.d.ts +12 -4
  24. package/dist/components/Navigation/Navigation.js +34 -51
  25. package/dist/components/Navigation/NavigationItem/NavigationItem.d.ts +15 -10
  26. package/dist/components/Navigation/NavigationItem/NavigationItem.js +19 -37
  27. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.d.ts +12 -3
  28. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +33 -29
  29. package/dist/components/Navigation/NavigationList/NavigationList.d.ts +2 -2
  30. package/dist/components/Navigation/NavigationList/NavigationList.js +31 -32
  31. package/dist/components/ReadMore/ReadMore.d.ts +35 -0
  32. package/dist/components/ReadMore/ReadMore.js +57 -0
  33. package/dist/components/ReadMore/index.d.ts +1 -0
  34. package/dist/components/Search/Search.d.ts +1 -1
  35. package/dist/components/Search/Search.js +134 -122
  36. package/dist/components/Search/SearchButton.js +21 -17
  37. package/dist/components/Search/SearchResults/SearchResults.js +14 -13
  38. package/dist/components/UserManagement/UserManagement.d.ts +21 -13
  39. package/dist/components/UserManagement/UserManagement.js +31 -61
  40. package/dist/index.d.ts +3 -0
  41. package/dist/index.js +87 -76
  42. package/dist/scss/_utils.scss +13 -3
  43. package/dist/scss/_vars.scss +30 -11
  44. package/dist/scss/componentStyles.scss +2 -0
  45. package/dist/scss/components/Accordion/_accordion.scss +3 -0
  46. package/dist/scss/components/Button/_button.scss +2 -2
  47. package/dist/scss/components/Dropdown/_dropdown.scss +2 -0
  48. package/dist/scss/components/Header/_header.scss +72 -86
  49. package/dist/scss/components/LanguageSelector/_languageSelector.scss +47 -0
  50. package/dist/scss/components/Link/_link.scss +15 -4
  51. package/dist/scss/components/LinkList/_linkList.scss +4 -0
  52. package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +4 -119
  53. package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +75 -0
  54. package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +29 -42
  55. package/dist/scss/components/Navigation/_navigation.scss +24 -82
  56. package/dist/scss/components/ReadMore/_readMore.scss +58 -0
  57. package/dist/scss/components/Search/SearchResults/_searchResults.scss +1 -25
  58. package/dist/scss/components/Search/_search.scss +48 -7
  59. package/dist/scss/components/Search/_searchButton.scss +6 -2
  60. package/dist/scss/components/UserManagement/_userManagement.scss +33 -94
  61. package/dist/scss/components/Video/_video.scss +1 -0
  62. package/dist/utils/index.d.ts +1 -0
  63. package/dist/utils/index.js +31 -24
  64. package/package.json +3 -1
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- const C = (t) => /* @__PURE__ */ e.createElement("svg", { width: 19, height: 20, viewBox: "0 0 19 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M9.5026 0.833984C4.4426 0.833984 0.335938 4.94065 0.335938 10.0007C0.335938 15.0607 4.4426 19.1673 9.5026 19.1673C14.5626 19.1673 18.6693 15.0607 18.6693 10.0007C18.6693 4.94065 14.5626 0.833984 9.5026 0.833984ZM9.5026 3.58398C11.0243 3.58398 12.2526 4.81232 12.2526 6.33398C12.2526 7.85565 11.0243 9.08398 9.5026 9.08398C7.98094 9.08398 6.7526 7.85565 6.7526 6.33398C6.7526 4.81232 7.98094 3.58398 9.5026 3.58398ZM9.5026 16.6007C7.21094 16.6007 5.1851 15.4273 4.0026 13.649C4.0301 11.8248 7.66927 10.8257 9.5026 10.8257C11.3268 10.8257 14.9751 11.8248 15.0026 13.649C13.8201 15.4273 11.7943 16.6007 9.5026 16.6007Z", fill: "#ADADAD" }));
2
+ const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("g", { clipPath: "url(#clip0_11553_447)" }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.5 5.5C10.5 6.88071 9.38071 8 8 8C6.61929 8 5.5 6.88071 5.5 5.5C5.5 4.11929 6.61929 3 8 3C9.38071 3 10.5 4.11929 10.5 5.5ZM9.5 5.5C9.5 6.32843 8.82843 7 8 7C7.17157 7 6.5 6.32843 6.5 5.5C6.5 4.67157 7.17157 4 8 4C8.82843 4 9.5 4.67157 9.5 5.5Z", fill: "black" }), /* @__PURE__ */ e.createElement("path", { d: "M5.375 10C4.75 10 4.5 10.75 4.5 11.0769V12.5C4.5 12.75 4.25 13 4 13C3.75 13 3.5 12.75 3.5 12.5V11.0769C3.5 10.0148 4.33947 9 5.375 9H10.625C11.6605 9 12.5 10.0148 12.5 11.0769V12.5C12.5 12.75 12.25 13 12 13C11.75 13 11.5 12.75 11.5 12.5V11.0769C11.5 10.75 11.2463 10 10.625 10H5.375Z", fill: "black" })), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", { id: "clip0_11553_447" }, /* @__PURE__ */ e.createElement("rect", { width: 16, height: 16, fill: "white" }))));
3
3
  export {
4
- C as default
4
+ t as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "#323232" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "#323232" }));
2
+ const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "currentColor" }));
3
3
  export {
4
4
  t as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "#323232" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.1071 4.5C12.5805 4.5 12.9643 4.83579 12.9643 5.25L12.9643 18.75C12.9643 19.1642 12.5805 19.5 12.1071 19.5C11.6338 19.5 11.25 19.1642 11.25 18.75L11.25 5.25C11.25 4.83579 11.6338 4.5 12.1071 4.5Z", fill: "#323232" }));
2
+ const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 11.8929C4.5 11.4195 4.83579 11.0357 5.25 11.0357L18.75 11.0357C19.1642 11.0357 19.5 11.4195 19.5 11.8929C19.5 12.3662 19.1642 12.75 18.75 12.75L5.25 12.75C4.83579 12.75 4.5 12.3662 4.5 11.8929Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.1071 4.5C12.5805 4.5 12.9643 4.83579 12.9643 5.25L12.9643 18.75C12.9643 19.1642 12.5805 19.5 12.1071 19.5C11.6338 19.5 11.25 19.1642 11.25 18.75L11.25 5.25C11.25 4.83579 11.6338 4.5 12.1071 4.5Z", fill: "currentColor" }));
3
3
  export {
4
4
  t as default
5
5
  };
@@ -7,15 +7,19 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
7
7
  /**
8
8
  * When true, prevents the user from interacting with the item.
9
9
  */
10
- isLocked: boolean;
10
+ isLocked?: boolean;
11
11
  /**
12
12
  * Determines whether the variation on text style is large or small.
13
13
  */
14
14
  variation: string;
15
15
  /**
16
- * Text string for the Accordion header for label.
16
+ * Uniqueid for the Accordion Item.
17
17
  */
18
- label: string;
18
+ id: string;
19
+ /**
20
+ * Accordion item label.
21
+ */
22
+ label: React.ReactNode;
19
23
  /**
20
24
  * Child element pass in to display as item content.
21
25
  */
@@ -25,5 +29,5 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
25
29
  */
26
30
  hasTransition?: boolean;
27
31
  }
28
- declare const AccordionItem: ({ isLocked, variation, label, isLastItem, hasTransition, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
32
+ declare const AccordionItem: ({ isLocked, variation, id, label, isLastItem, hasTransition, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
29
33
  export default AccordionItem;
@@ -1,108 +1,110 @@
1
- import { jsxs as g, jsx as t, Fragment as h } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as o, Fragment as h } from "react/jsx-runtime";
2
2
  import { getCommonProps as $ } from "../../utils/index.js";
3
- import v from "../../assets/plus.svg.js";
4
- import f from "../../assets/minus.svg.js";
3
+ import f from "../../assets/plus.svg.js";
4
+ import v from "../../assets/minus.svg.js";
5
5
  import I from "../../assets/lock.svg.js";
6
- import a from "../../node_modules/classnames/index.js";
7
- import { Item as _, Trigger as C, Content as p } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
- import { getIconClasses as u } from "./utils.js";
9
- const x = ({
6
+ import d from "../../node_modules/classnames/index.js";
7
+ import { Item as _, Trigger as C, Content as x } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
+ import { getIconClasses as p } from "./utils.js";
9
+ const N = ({
10
10
  children: n,
11
- className: d,
12
- baseClassName: o,
13
- disable: i,
11
+ className: s,
12
+ baseClassName: t,
13
+ disable: c,
14
14
  isLargeVariation: e,
15
- id: c
15
+ id: r
16
16
  }) => {
17
- const r = i, l = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
17
+ const a = c, l = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
18
18
  I,
19
19
  {
20
- className: u(o, e, "lock"),
21
- "data-testid": `${c}-lockedIcon`,
20
+ className: p(t, e, "lock"),
21
+ "data-testid": `${r}-lockedIcon`,
22
22
  "aria-hidden": !0
23
23
  }
24
- ) }), m = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
25
- v,
24
+ ) }), u = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
25
+ f,
26
26
  {
27
- className: u(o, e, "plus"),
28
- "data-testid": `${c}-plusIcon`,
27
+ className: p(t, e, "plus"),
28
+ "data-testid": `${r}-plusIcon`,
29
29
  "aria-hidden": !0
30
30
  }
31
- ) }), s = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
32
- f,
31
+ ) }), i = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
32
+ v,
33
33
  {
34
- className: u(o, e, "minus"),
35
- "data-testid": `${c}-minusIcon`,
34
+ className: p(t, e, "minus"),
35
+ "data-testid": `${r}-minusIcon`,
36
36
  "aria-hidden": !0
37
37
  }
38
38
  ) });
39
- return /* @__PURE__ */ t(
39
+ return /* @__PURE__ */ o(
40
40
  C,
41
41
  {
42
- "data-disabled": i,
42
+ "data-disabled": c,
43
43
  asChild: !0,
44
- className: a(o, { [`${o}--hoverable`]: !i }, d),
45
- children: /* @__PURE__ */ g("div", { "data-testid": `${c}-trigger`, children: [
46
- /* @__PURE__ */ t("div", { className: a(`${o}__text`, { [`${o}__text--lg`]: e }), children: n }),
47
- r && l,
48
- !r && m,
49
- !r && s
44
+ className: d(t, { [`${t}--hoverable`]: !c }, s),
45
+ children: /* @__PURE__ */ g("div", { "data-testid": `${r}-trigger`, children: [
46
+ /* @__PURE__ */ o("div", { className: d(`${t}__text`, { [`${t}__text--lg`]: e }), children: n }),
47
+ a && l,
48
+ !a && u,
49
+ !a && i
50
50
  ] })
51
51
  }
52
52
  );
53
- }, N = ({
53
+ }, A = ({
54
54
  children: n,
55
- baseClassName: d,
56
- disable: o,
57
- hasTransition: i,
55
+ baseClassName: s,
56
+ disable: t,
57
+ hasTransition: c,
58
58
  isLargeVariation: e,
59
- className: c
60
- }) => /* @__PURE__ */ t(h, { children: o && n ? /* @__PURE__ */ t("div", { children: n }) : /* @__PURE__ */ t(
61
- p,
59
+ className: r
60
+ }) => /* @__PURE__ */ o(h, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
61
+ x,
62
62
  {
63
63
  asChild: !0,
64
- className: a(
65
- { [`${d}__content--lg`]: e },
66
- { [`${d}--transition`]: i },
67
- c
64
+ className: d(
65
+ { [`${s}__content--lg`]: e },
66
+ { [`${s}--transition`]: c },
67
+ r
68
68
  ),
69
69
  children: n
70
70
  }
71
- ) }), F = ({
72
- isLocked: n,
73
- variation: d,
74
- label: o,
75
- isLastItem: i,
76
- hasTransition: e = !1,
77
- children: c,
78
- ...r
71
+ ) }), H = ({
72
+ isLocked: n = !1,
73
+ variation: s,
74
+ id: t,
75
+ label: c,
76
+ isLastItem: e,
77
+ hasTransition: r = !1,
78
+ children: a,
79
+ ...l
79
80
  }) => {
80
- const { className: l } = $(r, "Accordion"), m = d === "lg", s = `${l}-item`;
81
+ const { className: u } = $({ id: t }, "Accordion"), i = s === "lg", m = `${u}-item`;
81
82
  return /* @__PURE__ */ g(
82
83
  _,
83
84
  {
84
85
  disabled: n,
85
- value: o,
86
- className: a(s, { [`${s}__border-bottom`]: !i }),
86
+ value: t,
87
+ className: d(m, { [`${m}__border-bottom`]: !e }),
88
+ ...l,
87
89
  children: [
88
- /* @__PURE__ */ t(
89
- x,
90
+ /* @__PURE__ */ o(
91
+ N,
90
92
  {
91
93
  disable: n,
92
- isLargeVariation: m,
93
- id: r == null ? void 0 : r.id,
94
- baseClassName: `${s}-label`,
95
- children: o
94
+ isLargeVariation: i,
95
+ id: t,
96
+ baseClassName: `${m}-label`,
97
+ children: c
96
98
  }
97
99
  ),
98
- /* @__PURE__ */ t(
99
- N,
100
+ /* @__PURE__ */ o(
101
+ A,
100
102
  {
101
103
  disable: n,
102
- hasTransition: e,
103
- isLargeVariation: m,
104
- baseClassName: s,
105
- children: c
104
+ hasTransition: r,
105
+ isLargeVariation: i,
106
+ baseClassName: m,
107
+ children: a
106
108
  }
107
109
  )
108
110
  ]
@@ -110,5 +112,5 @@ const x = ({
110
112
  );
111
113
  };
112
114
  export {
113
- F as default
115
+ H as default
114
116
  };
@@ -0,0 +1,10 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+ export type CollapsibleProps = CollapsiblePrimitive.CollapsibleProps;
3
+ /**
4
+ * ## Overview
5
+ *
6
+ * A 1:1 port of the [Radix UI Collapsible Component](https://www.radix-ui.com/primitives/docs/components/collapsible).
7
+ *
8
+ */
9
+ declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export default Collapsible;
@@ -0,0 +1,13 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { Root as e } from "../../node_modules/@radix-ui/react-collapsible/dist/index.js";
3
+ import { getCommonProps as t } from "../../utils/index.js";
4
+ import p from "../../node_modules/classnames/index.js";
5
+ import { forwardRef as i } from "react";
6
+ const f = i(({ className: m, ...o }, s) => {
7
+ const { className: a, ...r } = t(o, "Collapsible");
8
+ return /* @__PURE__ */ l(e, { className: p(a, m), ...r, ...o, ref: s });
9
+ });
10
+ f.displayName = "Collapsible";
11
+ export {
12
+ f as default
13
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
3
+ export type CollapsibleContentProps = CollapsiblePrimitive.CollapsibleContentProps;
4
+ /**
5
+ * ## Overview
6
+ *
7
+ * A 1:1 port of the [Radix UI Collapsible Content Component](https://www.radix-ui.com/primitives/docs/components/collapsible#content).
8
+ *
9
+ */
10
+ declare const CollapsibleContent: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>>;
11
+ export default CollapsibleContent;
@@ -0,0 +1,21 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { Content as r } from "../../node_modules/@radix-ui/react-collapsible/dist/index.js";
4
+ import { getCommonProps as n } from "../../utils/index.js";
5
+ import p from "../../node_modules/classnames/index.js";
6
+ const f = l.forwardRef(({ className: t, ...o }, e) => {
7
+ const { className: a, ...m } = n(o, "CollapsibleContent");
8
+ return /* @__PURE__ */ s(
9
+ r,
10
+ {
11
+ ref: e,
12
+ className: p(a, t),
13
+ ...m,
14
+ ...o
15
+ }
16
+ );
17
+ });
18
+ f.displayName = "CollapsibleContent";
19
+ export {
20
+ f as default
21
+ };
@@ -0,0 +1,10 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+ export type CollapsibleTriggerProps = CollapsiblePrimitive.CollapsibleTriggerProps;
3
+ /**
4
+ * ## Overview
5
+ *
6
+ * A 1:1 port of the [Radix UI Collapsible Trigger Component](https://www.radix-ui.com/primitives/docs/components/collapsible#trigger).
7
+ *
8
+ */
9
+ declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
10
+ export default CollapsibleTrigger;
@@ -0,0 +1,21 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { Trigger as l } from "../../node_modules/@radix-ui/react-collapsible/dist/index.js";
3
+ import { getCommonProps as i } from "../../utils/index.js";
4
+ import t from "../../node_modules/classnames/index.js";
5
+ import { forwardRef as p } from "react";
6
+ const g = p(({ className: o, ...r }, m) => {
7
+ const { className: s, ...e } = i(r, "CollapsibleTrigger");
8
+ return /* @__PURE__ */ a(
9
+ l,
10
+ {
11
+ className: t(s, o),
12
+ ...e,
13
+ ...r,
14
+ ref: m
15
+ }
16
+ );
17
+ });
18
+ g.displayName = "CollapsibleTrigger";
19
+ export {
20
+ g as default
21
+ };
@@ -0,0 +1,3 @@
1
+ export { default as Collapsible, type CollapsibleProps } from './Collapsible';
2
+ export { default as CollapsibleContent, type CollapsibleContentProps } from './CollapsibleContent';
3
+ export { default as CollapsibleTrigger, type CollapsibleTriggerProps } from './CollapsibleTrigger';
@@ -1,7 +1,7 @@
1
- import React, { ComponentProps } from 'react';
1
+ import React, { ComponentPropsWithoutRef } from 'react';
2
2
  import * as DropdownSelect from '@radix-ui/react-select';
3
3
  import { DropdownItem } from './types';
4
- export interface DropdownProps extends Omit<DropdownSelect.SelectProps, 'defaultValue' | 'dir'>, Omit<ComponentProps<'div'>, 'ref'> {
4
+ export interface DropdownProps extends Omit<DropdownSelect.SelectProps, 'defaultValue' | 'dir'>, ComponentPropsWithoutRef<'div'> {
5
5
  /**
6
6
  * All options to be listed in the dropdown
7
7
  */
@@ -1,13 +1,10 @@
1
- import * as React from 'react';
2
- export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
3
- /**
4
- * Default mobile menu label
5
- */
6
- defaultMobileMenuLabel?: string;
1
+ import React from 'react';
2
+ import { Component, ComponentProps, ReactElement } from 'react';
3
+ export interface HeaderProps extends ComponentProps<'header'> {
7
4
  /**
8
5
  * Logo src
9
6
  */
10
- logo?: React.ReactElement<React.Component> | string;
7
+ logo?: ReactElement<Component> | string;
11
8
  /**
12
9
  * Toggle open text
13
10
  */
@@ -22,11 +19,10 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
22
19
  logoText?: string;
23
20
  }
24
21
  export type HeaderContextType = {
25
- defaultMobileMenuLabel: string;
26
- expandedItem: string;
27
- setExpandedItem: (item: string) => void;
28
- isExpanded: boolean;
29
- onSelect: (label: string) => void;
22
+ /**
23
+ * Used for mobile navigation menu hiding and showing
24
+ */
25
+ isMenuOpen: boolean;
30
26
  /**
31
27
  * Is the user within the search input and searching
32
28
  */
@@ -37,5 +33,16 @@ export type HeaderContextType = {
37
33
  setIsSearchExpanded: React.Dispatch<React.SetStateAction<boolean>>;
38
34
  };
39
35
  export declare const HeaderContext: React.Context<HeaderContextType>;
40
- declare const Header: ({ defaultMobileMenuLabel, logo, className, children, toggleOpenText, toggleCloseText, logoText, ...props }: React.PropsWithChildren<HeaderProps>) => import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * ## Overview
38
+ *
39
+ * This component allows navigation, search, login/logout, and language selection and supports desktop and mobile layouts
40
+ *
41
+ * [Figma Link Mobile](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10877-33417&node-type=INSTANCE&m=dev)
42
+ *
43
+ * [Figma Link Desktop](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10570-6295&node-type=FRAME&m=dev)
44
+ *
45
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-header--overview)
46
+ */
47
+ declare const Header: React.ForwardRefExoticComponent<Omit<HeaderProps, "ref"> & React.RefAttributes<HTMLElement>>;
41
48
  export default Header;
@@ -1,79 +1,76 @@
1
- import { jsxs as _, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
+ import l, { createContext as O, forwardRef as P, useState as h } from "react";
2
3
  import s from "../../node_modules/classnames/index.js";
3
- import * as o from "react";
4
- import { findChildrenOfType as x, px as a } from "../../utils/index.js";
5
- import v from "../Search/Search.js";
6
- import k from "../../assets/PhillipsLogo.svg.js";
7
- import { defaultHeaderContext as T } from "./utils.js";
8
- const w = o.createContext(T), D = ({
9
- defaultMobileMenuLabel: r = "Main Menu",
10
- logo: d = /* @__PURE__ */ t(k, {}),
11
- className: S,
12
- children: h,
13
- toggleOpenText: l = "Open Menu",
14
- toggleCloseText: m = "Close Menu",
15
- logoText: f = "Home Page",
16
- ...E
17
- }) => {
18
- const $ = x(h, v), u = x(h, v, !0), [c, y] = o.useState(!1), [p, i] = o.useState(r), [C, I] = o.useState(!1), n = c ? m : l, N = p !== r, g = function() {
19
- y((e) => !e), i(r);
20
- }, H = function(e) {
21
- i((j) => j === r ? e : r);
22
- }, P = (e) => {
23
- I(e);
24
- };
25
- return /* @__PURE__ */ _("header", { ...E, className: s(`${a}-header`, S), children: [
26
- /* @__PURE__ */ t("div", { className: `${a}-header__top-row`, children: /* @__PURE__ */ t(
27
- "h1",
28
- {
29
- "data-testid": "header-logo",
30
- className: `${a}-header__logo`,
31
- tabIndex: n === l ? 0 : -1,
32
- children: /* @__PURE__ */ t("a", { href: "/", "aria-label": f, children: typeof d == "object" ? d : /* @__PURE__ */ t("img", { alt: "Phillips", "data-testid": "header-logo-img", src: d, height: "14" }) })
33
- }
34
- ) }),
35
- /* @__PURE__ */ t(
36
- "div",
37
- {
38
- className: s(`${a}-header__overlay`, { [`${a}-header__overlay--active`]: c }),
39
- "data-testid": "header-overlay",
40
- onClick: g
41
- }
42
- ),
43
- /* @__PURE__ */ t(
44
- "button",
45
- {
46
- "aria-label": n,
47
- "data-testid": "mobile-menu-toggle",
48
- type: "button",
49
- onClick: g,
50
- className: s(`${a}-header__toggle-btn`, {
51
- [`${a}-header__toggle-btn--open`]: n === m
52
- }),
53
- children: /* @__PURE__ */ t("span", { children: n })
54
- }
55
- ),
56
- /* @__PURE__ */ _(
57
- w.Provider,
58
- {
59
- value: {
60
- defaultMobileMenuLabel: r,
61
- expandedItem: p,
62
- setExpandedItem: (e) => i(e),
63
- isExpanded: N,
64
- onSelect: (e) => H(e),
65
- isSearchExpanded: C,
66
- setIsSearchExpanded: P
67
- },
68
- children: [
69
- /* @__PURE__ */ t("div", { className: s(`${a}-header__nav`, { [`${a}-header__nav--open`]: c }), children: u }),
70
- $
71
- ]
72
- }
73
- )
74
- ] });
75
- };
4
+ import { findChildrenOfType as i, findChildrenExcludingTypes as T, px as e } from "../../utils/index.js";
5
+ import j from "../../assets/PhillipsLogo.svg.js";
6
+ import p from "../UserManagement/UserManagement.js";
7
+ import g from "../LanguageSelector/LanguageSelector.js";
8
+ import f from "../Navigation/Navigation.js";
9
+ import { defaultHeaderContext as w } from "./utils.js";
10
+ const I = O(w), L = P(
11
+ ({
12
+ logo: d = /* @__PURE__ */ a(j, {}),
13
+ className: u,
14
+ children: r,
15
+ toggleOpenText: _ = "Open Menu",
16
+ toggleCloseText: v = "Close Menu",
17
+ logoText: x = "Home Page",
18
+ ...C
19
+ }, $) => {
20
+ const b = i(r, p), m = i(r, g), [c, y] = h(!1), E = i(r, f), N = T(r, [f, p, g]), [n, M] = h(!1), S = n ? v : _, H = function() {
21
+ M((t) => !t);
22
+ };
23
+ return /* @__PURE__ */ o("header", { ...C, className: s(`${e}-header`, u), ref: $, children: [
24
+ /* @__PURE__ */ o("div", { className: `${e}-header__top-row`, children: [
25
+ m,
26
+ " ",
27
+ /* @__PURE__ */ o(
28
+ "button",
29
+ {
30
+ "aria-label": S,
31
+ "data-testid": "mobile-menu-toggle",
32
+ type: "button",
33
+ onClick: H,
34
+ className: s(`${e}-header__toggle-btn`, {
35
+ [`${e}-header__toggle-btn--open`]: n
36
+ }),
37
+ children: [
38
+ /* @__PURE__ */ a("span", {}),
39
+ " "
40
+ ]
41
+ }
42
+ ),
43
+ /* @__PURE__ */ a("h1", { "data-testid": "header-logo", className: `${e}-header__logo`, children: /* @__PURE__ */ a("a", { href: "/", "aria-label": x, children: typeof d == "object" ? d : /* @__PURE__ */ a("img", { alt: "Phillips", "data-testid": "header-logo-img", src: d, height: "14" }) }) }),
44
+ b
45
+ ] }),
46
+ /* @__PURE__ */ a("div", { className: s(`${e}-header__nav`, { [`${e}-header__nav--closed`]: !n }), children: /* @__PURE__ */ o(
47
+ I.Provider,
48
+ {
49
+ value: {
50
+ isMenuOpen: n,
51
+ isSearchExpanded: c,
52
+ setIsSearchExpanded: y
53
+ },
54
+ children: [
55
+ l.Children.map(
56
+ E,
57
+ (t) => l.isValidElement(t) ? l.cloneElement(t, {
58
+ children: [
59
+ ...l.Children.toArray(t.props.children),
60
+ m
61
+ ]
62
+ }) : t
63
+ ),
64
+ N
65
+ ]
66
+ }
67
+ ) }),
68
+ /* @__PURE__ */ a("div", { className: s(`${e}-header__overlay`, { [`${e}-header__overlay--active`]: c }) })
69
+ ] });
70
+ }
71
+ );
72
+ L.displayName = "Header";
76
73
  export {
77
- w as HeaderContext,
78
- D as default
74
+ I as HeaderContext,
75
+ L as default
79
76
  };
@@ -1,9 +1,2 @@
1
- export declare const defaultHeaderContext: {
2
- defaultMobileMenuLabel: string;
3
- expandedItem: string;
4
- setExpandedItem: () => void;
5
- isExpanded: boolean;
6
- onSelect: () => void;
7
- isSearchExpanded: boolean;
8
- setIsSearchExpanded: () => void;
9
- };
1
+ import { HeaderContextType } from './Header';
2
+ export declare const defaultHeaderContext: HeaderContextType;
@@ -1,13 +1,9 @@
1
1
  import { noOp as e } from "../../utils/index.js";
2
- const d = {
3
- defaultMobileMenuLabel: "",
4
- expandedItem: "",
5
- setExpandedItem: e,
6
- isExpanded: !1,
7
- onSelect: e,
2
+ const n = {
3
+ isMenuOpen: !1,
8
4
  isSearchExpanded: !1,
9
5
  setIsSearchExpanded: e
10
6
  };
11
7
  export {
12
- d as defaultHeaderContext
8
+ n as defaultHeaderContext
13
9
  };
@@ -0,0 +1,36 @@
1
+ import { ComponentProps } from 'react';
2
+ import { SupportedLanguages } from '../../types/commonTypes';
3
+ export type LanguageOption = {
4
+ label: string;
5
+ value: SupportedLanguages;
6
+ };
7
+ export interface LanguageSelectorProps extends ComponentProps<'div'> {
8
+ /**
9
+ * Available language options to select from
10
+ */
11
+ languageOptions?: LanguageOption[];
12
+ /**
13
+ * The currently selected language, shows in the input
14
+ */
15
+ currentLanguage?: SupportedLanguages;
16
+ /**
17
+ * Called when the language is changed in the dropdown
18
+ * @param language
19
+ */
20
+ onLanguageChange?: (language: SupportedLanguages) => void;
21
+ /**
22
+ * hide or show with an opacity transition
23
+ */
24
+ isHidden?: boolean;
25
+ }
26
+ /**
27
+ * ## Overview
28
+ *
29
+ * This is used in the Header component to allow users to change the language of the site. It is a controlled component.
30
+ *
31
+ * [Figma Link](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10570-6295&m=dev)
32
+ *
33
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-languageselector--overview)
34
+ */
35
+ declare const LanguageSelector: import("react").ForwardRefExoticComponent<Omit<LanguageSelectorProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
36
+ export default LanguageSelector;