@phillips/seldon 1.51.1 → 1.52.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 (50) hide show
  1. package/dist/assets/account_circle.svg.js +2 -2
  2. package/dist/components/Accordion/AccordionItem.d.ts +8 -4
  3. package/dist/components/Accordion/AccordionItem.js +67 -65
  4. package/dist/components/Dropdown/Dropdown.d.ts +2 -2
  5. package/dist/components/Header/Header.d.ts +20 -13
  6. package/dist/components/Header/Header.js +73 -76
  7. package/dist/components/Header/utils.d.ts +2 -9
  8. package/dist/components/Header/utils.js +3 -7
  9. package/dist/components/LanguageSelector/LanguageSelector.d.ts +36 -0
  10. package/dist/components/LanguageSelector/LanguageSelector.js +73 -0
  11. package/dist/components/LanguageSelector/index.d.ts +1 -0
  12. package/dist/components/Link/Link.d.ts +3 -11
  13. package/dist/components/Link/index.d.ts +2 -0
  14. package/dist/components/Navigation/Navigation.d.ts +12 -4
  15. package/dist/components/Navigation/Navigation.js +34 -51
  16. package/dist/components/Navigation/NavigationItem/NavigationItem.d.ts +15 -10
  17. package/dist/components/Navigation/NavigationItem/NavigationItem.js +19 -37
  18. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.d.ts +12 -3
  19. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +33 -29
  20. package/dist/components/Navigation/NavigationList/NavigationList.d.ts +2 -2
  21. package/dist/components/Navigation/NavigationList/NavigationList.js +31 -32
  22. package/dist/components/Search/Search.d.ts +1 -1
  23. package/dist/components/Search/Search.js +134 -122
  24. package/dist/components/Search/SearchButton.js +21 -17
  25. package/dist/components/Search/SearchResults/SearchResults.js +14 -13
  26. package/dist/components/UserManagement/UserManagement.d.ts +21 -13
  27. package/dist/components/UserManagement/UserManagement.js +31 -61
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +65 -62
  30. package/dist/scss/_utils.scss +13 -3
  31. package/dist/scss/_vars.scss +30 -11
  32. package/dist/scss/componentStyles.scss +1 -0
  33. package/dist/scss/components/Accordion/_accordion.scss +3 -0
  34. package/dist/scss/components/Dropdown/_dropdown.scss +2 -0
  35. package/dist/scss/components/Header/_header.scss +72 -86
  36. package/dist/scss/components/LanguageSelector/_languageSelector.scss +47 -0
  37. package/dist/scss/components/Link/_link.scss +15 -4
  38. package/dist/scss/components/LinkList/_linkList.scss +4 -0
  39. package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +4 -119
  40. package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +75 -0
  41. package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +29 -42
  42. package/dist/scss/components/Navigation/_navigation.scss +24 -82
  43. package/dist/scss/components/Search/SearchResults/_searchResults.scss +1 -25
  44. package/dist/scss/components/Search/_search.scss +48 -7
  45. package/dist/scss/components/Search/_searchButton.scss +6 -2
  46. package/dist/scss/components/UserManagement/_userManagement.scss +33 -94
  47. package/dist/scss/components/Video/_video.scss +1 -0
  48. package/dist/utils/index.d.ts +1 -0
  49. package/dist/utils/index.js +31 -24
  50. package/package.json +2 -1
@@ -1,54 +1,37 @@
1
- import { jsxs as r, jsx as c } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { findChildrenOfType as m, px as a } from "../../utils/index.js";
4
- import b from "../../node_modules/classnames/index.js";
5
- import { HeaderContext as _ } from "../Header/Header.js";
6
- import p from "./NavigationList/NavigationList.js";
7
- const g = ({
8
- backBtnLabel: f,
9
- children: i,
10
- className: v,
11
- id: e,
12
- visible: s = !0
13
- }) => {
14
- const { defaultMobileMenuLabel: o, isExpanded: d, expandedItem: n, setExpandedItem: x, isSearchExpanded: $ } = l.useContext(_), h = () => x(n === o ? n : o), t = m(i, p), u = m(i, p, !0);
15
- return /* @__PURE__ */ r(
16
- "nav",
17
- {
18
- role: "navigation",
19
- "aria-labelledby": `${e}-label`,
20
- "data-testid": e,
21
- id: e,
22
- className: b(`${a}-nav`, v, { [`${a}-nav--expanded`]: d }),
23
- children: [
24
- /* @__PURE__ */ c(
25
- "button",
26
- {
27
- "data-testid": `${e}-back-btn`,
28
- tabIndex: d ? 0 : -1,
29
- className: `${a}-nav__back-btn`,
30
- onClick: h,
31
- children: f
32
- }
33
- ),
34
- /* @__PURE__ */ c(
35
- "h2",
36
- {
37
- id: `${e}-label`,
38
- "data-testid": `${e}-label`,
39
- className: b(`${a}-nav__label`, { [`${a}-nav__label--hidden`]: !s }),
40
- style: { "--visible": s ? "visible" : "hidden" },
41
- children: n || "Main Menu"
42
- }
43
- ),
44
- /* @__PURE__ */ r("div", { className: `${a}-nav__list-container`, children: [
45
- l.isValidElement(t == null ? void 0 : t[0]) ? l.cloneElement(t[0], { isOffScreen: $ }) : void 0,
46
- u
1
+ import { jsx as x, jsxs as h } from "react/jsx-runtime";
2
+ import e, { forwardRef as E } from "react";
3
+ import { findChildrenOfType as l, findChildrenExcludingTypes as N, px as d } from "../../utils/index.js";
4
+ import C from "../../node_modules/classnames/index.js";
5
+ import { HeaderContext as y } from "../Header/Header.js";
6
+ import m from "./NavigationList/NavigationList.js";
7
+ import c from "../LanguageSelector/LanguageSelector.js";
8
+ const S = E(
9
+ ({ children: i, className: f, id: n, visible: p = !0, ...v }, g) => {
10
+ var r, s;
11
+ const { isSearchExpanded: a } = e.useContext(y), o = (r = l(i, m)) == null ? void 0 : r[0], u = N(i, [m, c]), t = (s = l(i, c)) == null ? void 0 : s[0];
12
+ return /* @__PURE__ */ x(
13
+ "nav",
14
+ {
15
+ role: "navigation",
16
+ "data-testid": n,
17
+ id: n,
18
+ style: { "--visible": p ? "visible" : "hidden" },
19
+ className: C(`${d}-nav`, f),
20
+ ...v,
21
+ ref: g,
22
+ children: /* @__PURE__ */ h("div", { className: `${d}-nav__list-container`, children: [
23
+ u,
24
+ e.isValidElement(o) ? e.cloneElement(o, { isOffScreen: a }) : void 0,
25
+ /* This is not visible through css when in desktop breakpoint */
26
+ e.isValidElement(t) && t ? e.cloneElement(t, {
27
+ isHidden: a
28
+ }) : void 0
47
29
  ] })
48
- ]
49
- }
50
- );
51
- };
30
+ }
31
+ );
32
+ }
33
+ );
34
+ S.displayName = "Navigation";
52
35
  export {
53
- g as default
36
+ S as default
54
37
  };
@@ -1,23 +1,19 @@
1
- import * as React from 'react';
2
1
  import { LinkProps } from '../../Link/Link';
3
2
  import { LinkVariants } from '../../Link/types';
4
- export interface NavigationItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
3
+ import { ComponentProps, ElementType, ReactNode } from 'react';
4
+ export interface NavigationItemProps extends ComponentProps<'li'> {
5
5
  /**
6
6
  * Optional badge for navigation item. Used currently for location of auctions
7
7
  */
8
- badge?: React.ReactNode;
8
+ badge?: ReactNode;
9
9
  /**
10
10
  * href link
11
11
  */
12
12
  href?: string;
13
- /**
14
- * Optional listen to onClick event
15
- */
16
- onClick?: (event: React.MouseEvent<HTMLLIElement>) => void;
17
13
  /**
18
14
  * Label for the navigation item
19
15
  */
20
- label?: React.ReactNode;
16
+ label?: ReactNode;
21
17
  /**
22
18
  * Optional group for navigation items
23
19
  */
@@ -29,7 +25,16 @@ export interface NavigationItemProps extends Omit<React.HTMLAttributes<HTMLLIEle
29
25
  /**
30
26
  * Element to render within the navigation item, renders <Link> by default
31
27
  */
32
- element?: React.ElementType<LinkProps>;
28
+ element?: ElementType<LinkProps>;
33
29
  }
34
- declare const NavigationItem: ({ badge, className, href, label, navGroup, navType, onClick, element: Component, ...props }: React.PropsWithChildren<NavigationItemProps>) => import("react/jsx-runtime").JSX.Element;
30
+ /**
31
+ * ## Overview
32
+ *
33
+ * Renders a styled link within the Header->Navigation component. It supports both mobile and desktop layouts. It can be used with Remix links as well.
34
+ *
35
+ * [Figma Link](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10570-6295&m=dev)
36
+ *
37
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-languageselector--overview)
38
+ */
39
+ declare const NavigationItem: import("react").ForwardRefExoticComponent<Omit<NavigationItemProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
35
40
  export default NavigationItem;
@@ -1,44 +1,26 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { px as t } from "../../../utils/index.js";
4
- import x from "../../../node_modules/classnames/index.js";
5
- import _ from "../../Link/Link.js";
6
- import { LinkVariants as v } from "../../Link/types.js";
7
- import { HeaderContext as $ } from "../../Header/Header.js";
8
- const j = ({
9
- badge: a,
10
- className: r = "",
11
- href: i,
12
- label: n,
13
- navGroup: s,
14
- navType: m,
15
- onClick: o,
16
- element: l = _,
17
- ...d
18
- }) => {
19
- const { expandedItem: c } = f.useContext($);
20
- return /* @__PURE__ */ e(
1
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
+ import { px as i } from "../../../utils/index.js";
3
+ import f from "../../../node_modules/classnames/index.js";
4
+ import v from "../../Link/Link.js";
5
+ import { LinkVariants as N } from "../../Link/types.js";
6
+ import { forwardRef as _ } from "react";
7
+ const $ = _(
8
+ ({ badge: e, className: t = "", href: n, label: m, navGroup: s, navType: r, onClick: o, element: l = v, ...d }, p) => /* @__PURE__ */ a(
21
9
  "li",
22
10
  {
23
11
  ...d,
24
12
  onClick: o,
25
- "data-testid": `nav-item-${n}`,
26
- className: x(`${t}-nav__item`, s, r),
27
- children: /* @__PURE__ */ p(
28
- l,
29
- {
30
- href: i,
31
- variant: m || v.snwHeaderLink,
32
- tabIndex: c === "" ? 0 : -1,
33
- children: [
34
- /* @__PURE__ */ e("span", { className: `${t}-nav__item--label`, children: n }),
35
- a ? /* @__PURE__ */ e("span", { className: `${t}-nav__item--badge `, children: ` • ${a}` }) : null
36
- ]
37
- }
38
- )
13
+ "data-testid": `nav-item-${m}`,
14
+ className: f(`${i}-nav__item`, s, t),
15
+ ref: p,
16
+ children: /* @__PURE__ */ c(l, { href: n, variant: r || N.snwHeaderLink, children: [
17
+ /* @__PURE__ */ a("span", { className: `${i}-nav__item--label`, children: m }),
18
+ e ? /* @__PURE__ */ a("span", { className: `${i}-nav__item--badge `, children: ` • ${e}` }) : null
19
+ ] })
39
20
  }
40
- );
41
- };
21
+ )
22
+ );
23
+ $.displayName = "NavigationItem";
42
24
  export {
43
- j as default
25
+ $ as default
44
26
  };
@@ -1,9 +1,18 @@
1
- import * as React from 'react';
2
- export interface NavigationItemTriggerProps extends React.HTMLAttributes<HTMLElement> {
1
+ import React, { ComponentProps } from 'react';
2
+ export interface NavigationItemTriggerProps extends ComponentProps<'li'> {
3
3
  /**
4
4
  * Label for the navigation item
5
5
  */
6
6
  label: string;
7
7
  }
8
- declare const NavigationItemTrigger: ({ id, label, children, className, ...props }: React.PropsWithChildren<NavigationItemTriggerProps>) => import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * ## Overview
10
+ *
11
+ * Supports clicking in mobile mode and hovering in desktop mode to expand the child navigation lists
12
+ *
13
+ * [Figma Link](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10570-6295&m=dev)
14
+ *
15
+ * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-languageselector--overview)
16
+ */
17
+ declare const NavigationItemTrigger: React.ForwardRefExoticComponent<Omit<NavigationItemTriggerProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
9
18
  export default NavigationItemTrigger;
@@ -1,31 +1,35 @@
1
- import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { px as t } from "../../../utils/index.js";
4
- import p from "../../../node_modules/classnames/index.js";
5
- import { HeaderContext as x } from "../../Header/Header.js";
6
- const u = ({
7
- id: r,
8
- label: e,
9
- children: i,
10
- className: m,
11
- ...o
12
- }) => {
13
- const { expandedItem: a, onSelect: s } = l.useContext(x), c = () => s(e);
14
- return /* @__PURE__ */ d(
15
- "li",
16
- {
17
- "aria-expanded": a === e,
18
- "data-testid": `nav-item-trigger-${r}`,
19
- className: p(m, `${t}-nav__item`, { [`${t}-nav__item--expanded`]: a === e }),
20
- onClick: c,
21
- ...o,
22
- children: [
23
- /* @__PURE__ */ n("button", { className: `${t}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ n("label", { className: `${t}-nav__item--label`, children: e }) }),
24
- i
25
- ]
26
- }
27
- );
28
- };
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { getCommonProps as g, findChildrenOfType as v, px as s } from "../../../utils/index.js";
3
+ import N from "../../../node_modules/classnames/index.js";
4
+ import _, { forwardRef as x, useState as b } from "react";
5
+ import { TextVariants as T } from "../../Text/types.js";
6
+ import h from "../../Text/Text.js";
7
+ import O from "../NavigationList/NavigationList.js";
8
+ const I = x(
9
+ ({ id: n, label: i, children: m, className: l, onClick: p, ...d }, u) => {
10
+ const { className: e, ...c } = g({ id: n }, "NavigationItemTrigger"), [t, a] = b(!1), r = v(m, O);
11
+ return /* @__PURE__ */ f(
12
+ "li",
13
+ {
14
+ ...c,
15
+ ref: u,
16
+ "aria-expanded": t,
17
+ className: N(l, e, `${s}-nav__item`, {
18
+ [`${e}--hovered`]: t
19
+ }),
20
+ onClick: p,
21
+ onMouseOver: () => a(!0),
22
+ onMouseOut: () => a(!1),
23
+ ...d,
24
+ children: [
25
+ /* @__PURE__ */ o("button", { className: `${s}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ o(h, { variant: T.snwHeaderLink, children: i }) }),
26
+ r ? _.cloneElement(r[0], { className: `${e}__submenu` }) : void 0
27
+ ]
28
+ }
29
+ );
30
+ }
31
+ );
32
+ I.displayName = "NavigationItemTrigger";
29
33
  export {
30
- u as default
34
+ I as default
31
35
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export interface NavigationListProps extends React.HTMLAttributes<HTMLElement> {
2
+ export interface NavigationListProps extends React.ComponentProps<'ul'> {
3
3
  /**
4
4
  * id for the navigation list
5
5
  */
@@ -9,5 +9,5 @@ export interface NavigationListProps extends React.HTMLAttributes<HTMLElement> {
9
9
  */
10
10
  isOffScreen?: boolean;
11
11
  }
12
- declare const NavigationList: React.FC<NavigationListProps>;
12
+ declare const NavigationList: React.ForwardRefExoticComponent<Omit<NavigationListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
13
13
  export default NavigationList;
@@ -1,36 +1,35 @@
1
- import { jsxs as c, jsx as _ } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as _ } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import { px as a } from "../../../utils/index.js";
4
- import l from "../../../node_modules/classnames/index.js";
5
- import { HeaderContext as f } from "../../Header/Header.js";
6
- const $ = ({ id: o, children: n, className: m, isOffScreen: p, ...v }) => {
7
- const { isExpanded: i } = r.useContext(f), s = r.Children.toArray(n).filter((t) => {
8
- if (t && t.props.navGroup === "nav-link-lg")
9
- return t;
10
- }), e = r.Children.toArray(n).filter((t) => {
11
- if (t && t.props.navGroup === "nav-link-sm")
12
- return t;
13
- });
14
- return /* @__PURE__ */ c(
15
- "ul",
16
- {
17
- id: o,
18
- "data-testid": o,
19
- role: "list",
20
- "aria-expanded": i,
21
- className: l(m, `${a}-nav__list`, {
22
- [`${a}-nav__list--expanded`]: i,
23
- [`${a}-nav__list--offscreen`]: p
24
- }),
25
- ...v,
26
- children: [
27
- s.length > 0 ? /* @__PURE__ */ _("div", { className: l(`${a}-nav__list__section`, `${a}-nav__list__section--large-cta`), children: s }) : null,
28
- e.length > 0 ? /* @__PURE__ */ _("div", { className: l(`${a}-nav__list__section`, `${a}-nav__list__section--small-cta`), children: e }) : null,
29
- !s.length && !e.length ? n : null
30
- ]
31
- }
32
- );
33
- };
4
+ import e from "../../../node_modules/classnames/index.js";
5
+ const c = r.forwardRef(
6
+ ({ id: i, children: s, className: m, isOffScreen: o }, v) => {
7
+ const n = r.Children.toArray(s).filter((t) => {
8
+ if (t && t.props.navGroup === "nav-link-lg")
9
+ return t;
10
+ }), l = r.Children.toArray(s).filter((t) => {
11
+ if (t && t.props.navGroup === "nav-link-sm")
12
+ return t;
13
+ });
14
+ return /* @__PURE__ */ p(
15
+ "ul",
16
+ {
17
+ "aria-hidden": o,
18
+ id: i,
19
+ "data-testid": i,
20
+ role: "list",
21
+ className: e(m, `${a}-nav__list`, { [`${a}-nav__list--offscreen`]: o }),
22
+ ref: v,
23
+ children: [
24
+ n.length > 0 ? /* @__PURE__ */ _("div", { className: e(`${a}-nav__list__section`, `${a}-nav__list__section--large-cta`), children: n }) : null,
25
+ l.length > 0 ? /* @__PURE__ */ _("div", { className: e(`${a}-nav__list__section`, `${a}-nav__list__section--small-cta`), children: l }) : null,
26
+ !n.length && !l.length ? s : null
27
+ ]
28
+ }
29
+ );
30
+ }
31
+ );
32
+ c.displayName = "NavigationList";
34
33
  export {
35
- $ as default
34
+ c as default
36
35
  };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { type SearchResultsProps } from './SearchResults/SearchResults';
3
3
  export interface SearchProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /**