@phillips/seldon 1.55.1 → 1.57.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 (25) hide show
  1. package/dist/components/Button/types.d.ts +2 -1
  2. package/dist/components/Button/types.js +1 -1
  3. package/dist/components/IconButton/IconButton.d.ts +10 -1
  4. package/dist/components/IconButton/IconButton.js +22 -14
  5. package/dist/components/Navigation/NavigationItem/NavigationItem.d.ts +1 -1
  6. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +46 -30
  7. package/dist/components/Navigation/NavigationList/NavigationList.d.ts +8 -0
  8. package/dist/components/Navigation/NavigationList/NavigationList.js +31 -23
  9. package/dist/components/Search/Search.js +71 -71
  10. package/dist/scss/_vars.scss +6 -3
  11. package/dist/scss/components/Button/_button.scss +141 -36
  12. package/dist/scss/components/IconButton/_iconButton.scss +79 -25
  13. package/dist/scss/components/Link/_link.scss +0 -1
  14. package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +33 -1
  15. package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +7 -3
  16. package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +41 -0
  17. package/dist/scss/components/Navigation/_navigation.scss +6 -1
  18. package/dist/scss/components/Search/SearchResults/_searchResults.scss +4 -0
  19. package/dist/scss/components/Search/_search.scss +51 -22
  20. package/dist/scss/components/Search/_searchButton.scss +6 -0
  21. package/dist/scss/patterns/LanguageSelector/_languageSelector.scss +25 -1
  22. package/dist/scss/patterns/UserManagement/_userManagement.scss +4 -1
  23. package/dist/scss/site-furniture/Header/_header.scss +13 -3
  24. package/dist/site-furniture/Header/Header.js +8 -1
  25. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  export declare enum ButtonVariants {
2
2
  primary = "primary",
3
3
  secondary = "secondary",
4
- ghost = "ghost"
4
+ ghost = "ghost",
5
+ tertiary = "tertiary"
5
6
  }
@@ -1,4 +1,4 @@
1
- var e = /* @__PURE__ */ ((r) => (r.primary = "primary", r.secondary = "secondary", r.ghost = "ghost", r))(e || {});
1
+ var e = /* @__PURE__ */ ((r) => (r.primary = "primary", r.secondary = "secondary", r.ghost = "ghost", r.tertiary = "tertiary", r))(e || {});
2
2
  export {
3
3
  e as ButtonVariants
4
4
  };
@@ -1,3 +1,4 @@
1
+ import { ButtonVariants } from '../Button/types';
1
2
  export interface IconButtonProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> {
2
3
  /**
3
4
  * Button contents
@@ -7,6 +8,14 @@ export interface IconButtonProps extends Omit<React.HTMLAttributes<HTMLButtonEle
7
8
  * How large should the button be?
8
9
  */
9
10
  size?: 'sm' | 'md' | 'lg';
11
+ /**
12
+ * Mainly used for styling
13
+ */
14
+ variant?: ButtonVariants;
15
+ /**
16
+ * Should the button be disabled?
17
+ */
18
+ isDisabled?: boolean;
10
19
  }
11
- declare const IconButton: ({ children, size, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const IconButton: ({ children, size, variant, isDisabled, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
12
21
  export default IconButton;
@@ -1,21 +1,29 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import c from "../../node_modules/classnames/index.js";
3
- import e from "../Button/Button.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import f from "../../node_modules/classnames/index.js";
3
+ import p from "../Button/Button.js";
4
4
  import { getCommonProps as i } from "../../utils/index.js";
5
- import { ButtonVariants as p } from "../Button/types.js";
6
- const x = ({ children: m, size: r = "md", className: s, ...o }) => {
7
- const { className: t, ...a } = i(o, "IconButton");
8
- return /* @__PURE__ */ n(
9
- e,
5
+ import { ButtonVariants as l } from "../Button/types.js";
6
+ const C = ({
7
+ children: s,
8
+ size: r = "md",
9
+ variant: m = l.primary,
10
+ isDisabled: a = !1,
11
+ className: n,
12
+ ...t
13
+ }) => {
14
+ const { className: o, ...e } = i(t, "IconButton");
15
+ return /* @__PURE__ */ c(
16
+ p,
10
17
  {
11
- ...a,
12
- variant: p.primary,
13
- className: c(t, `${t}--${r}`, s),
14
- ...o,
15
- children: m
18
+ ...e,
19
+ variant: m,
20
+ className: f(o, `${o}--${r}`, `${o}--${m}`, n),
21
+ isDisabled: a,
22
+ ...t,
23
+ children: s
16
24
  }
17
25
  );
18
26
  };
19
27
  export {
20
- x as default
28
+ C as default
21
29
  };
@@ -17,7 +17,7 @@ export interface NavigationItemProps extends ComponentProps<'li'> {
17
17
  /**
18
18
  * Optional group for navigation items
19
19
  */
20
- navGroup?: 'nav-link-lg' | 'nav-link-sm';
20
+ navGroup?: 'nav-link-start' | 'nav-link-end';
21
21
  /**
22
22
  * Optional type for navigation item
23
23
  */
@@ -1,35 +1,51 @@
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";
1
+ import { jsxs as c, Fragment as _, jsx as e } from "react/jsx-runtime";
2
+ import { getCommonProps as T, findChildrenOfType as b, px as l } from "../../../utils/index.js";
3
+ import x from "../../../node_modules/classnames/index.js";
4
+ import d, { forwardRef as I, useState as M } from "react";
5
+ import { TextVariants as u } from "../../Text/types.js";
6
+ import f from "../../Text/Text.js";
7
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
- );
8
+ import $ from "../../Accordion/Accordion.js";
9
+ import S from "../../Accordion/AccordionItem.js";
10
+ import { SSRMediaQuery as p } from "../../../providers/utils.js";
11
+ const y = ({ id: r, label: n, children: t }) => /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
12
+ S,
13
+ {
14
+ variation: "sm",
15
+ id: r != null ? r : `${n}-accordion`,
16
+ label: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: n }),
17
+ children: t
18
+ }
19
+ ) }), C = I(
20
+ ({ id: r, label: n, children: t, className: g, onClick: v, ...h }, N) => {
21
+ const { className: o, ...i } = T({ id: r }, "NavigationItemTrigger"), [m, s] = M(!1), a = b(t, O);
22
+ return /* @__PURE__ */ c(_, { children: [
23
+ /* @__PURE__ */ e(p.Media, { lessThan: "md", children: /* @__PURE__ */ e(y, { id: r, label: n, ...i, children: a ? d.cloneElement(a[0], {
24
+ className: `${o}__submenu--mobile`
25
+ }) : void 0 }) }),
26
+ /* @__PURE__ */ e(p.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ c(
27
+ "li",
28
+ {
29
+ ...i,
30
+ ref: N,
31
+ "aria-expanded": m,
32
+ className: x(g, o, `${l}-nav__item`, {
33
+ [`${o}--hovered`]: m
34
+ }),
35
+ onClick: v,
36
+ onMouseOver: () => s(!0),
37
+ onMouseOut: () => s(!1),
38
+ ...h,
39
+ children: [
40
+ /* @__PURE__ */ e("button", { className: `${l}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: n }) }),
41
+ a ? d.cloneElement(a[0], { className: `${o}__submenu` }) : void 0
42
+ ]
43
+ }
44
+ ) })
45
+ ] });
30
46
  }
31
47
  );
32
- I.displayName = "NavigationItemTrigger";
48
+ C.displayName = "NavigationItemTrigger";
33
49
  export {
34
- I as default
50
+ C as default
35
51
  };
@@ -8,6 +8,14 @@ export interface NavigationListProps extends React.ComponentProps<'ul'> {
8
8
  * Is the nav list offscreen?
9
9
  */
10
10
  isOffScreen?: boolean;
11
+ /**
12
+ * Optional left section heading
13
+ */
14
+ leftSectionHeading?: string;
15
+ /**
16
+ * Optional right section heading
17
+ */
18
+ rightSectionHeading?: string;
11
19
  }
12
20
  declare const NavigationList: React.ForwardRefExoticComponent<Omit<NavigationListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
13
21
  export default NavigationList;
@@ -1,35 +1,43 @@
1
- import { jsxs as p, jsx as _ } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { px as a } from "../../../utils/index.js";
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;
1
+ import { jsxs as e, jsx as c } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { px as t } from "../../../utils/index.js";
4
+ import l from "../../../node_modules/classnames/index.js";
5
+ import { TextVariants as p } from "../../Text/types.js";
6
+ import f from "../../Text/Text.js";
7
+ const h = i.forwardRef(
8
+ ({ id: o, children: n, className: d, isOffScreen: _, leftSectionHeading: m, rightSectionHeading: v }, u) => {
9
+ const s = i.Children.toArray(n).filter((a) => {
10
+ if (a && a.props.navGroup === "nav-link-start")
11
+ return a;
12
+ }), r = i.Children.toArray(n).filter((a) => {
13
+ if (a && a.props.navGroup === "nav-link-end")
14
+ return a;
13
15
  });
14
- return /* @__PURE__ */ p(
16
+ return /* @__PURE__ */ e(
15
17
  "ul",
16
18
  {
17
- "aria-hidden": o,
18
- id: i,
19
- "data-testid": i,
19
+ "aria-hidden": _,
20
+ id: o,
21
+ "data-testid": o,
20
22
  role: "list",
21
- className: e(m, `${a}-nav__list`, { [`${a}-nav__list--offscreen`]: o }),
22
- ref: v,
23
+ className: l(d, `${t}-nav__list`, { [`${t}-nav__list--offscreen`]: _ }),
24
+ ref: u,
23
25
  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
26
+ s.length > 0 ? /* @__PURE__ */ e("div", { className: l(`${t}-nav__list__section`, `${t}-nav__list__section--start`), children: [
27
+ m ? /* @__PURE__ */ c(f, { variant: p.heading4, className: `${t}-nav__list__section--start__title`, children: m }) : null,
28
+ s
29
+ ] }) : null,
30
+ r.length > 0 ? /* @__PURE__ */ e("div", { className: l(`${t}-nav__list__section`, `${t}-nav__list__section--end`), children: [
31
+ v ? /* @__PURE__ */ c(f, { variant: p.heading4, className: `${t}-nav__list__section--end__title`, children: v }) : null,
32
+ r
33
+ ] }) : null,
34
+ !s.length && !r.length ? n : null
27
35
  ]
28
36
  }
29
37
  );
30
38
  }
31
39
  );
32
- c.displayName = "NavigationList";
40
+ h.displayName = "NavigationList";
33
41
  export {
34
- c as default
42
+ h as default
35
43
  };
@@ -1,23 +1,23 @@
1
- import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
- import c, { useEffect as P } from "react";
3
- import { getCommonProps as y, px as j, encodeURLSearchParams as C } from "../../utils/index.js";
1
+ import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
+ import i, { useEffect as y } from "react";
3
+ import { getCommonProps as j, px as D, encodeURLSearchParams as C } from "../../utils/index.js";
4
4
  import p from "../../node_modules/classnames/index.js";
5
- import D from "../Input/Input.js";
6
- import H from "../Link/Link.js";
7
- import O from "./SearchResults/SearchResults.js";
8
- import { TextVariants as V } from "../Text/types.js";
9
- import A from "../Text/Text.js";
10
- import { useOnClickOutside as F } from "../../node_modules/usehooks-ts/dist/index.js";
11
- import { HeaderContext as K } from "../../site-furniture/Header/Header.js";
12
- import { SearchButton as M } from "./SearchButton.js";
13
- import U from "../../node_modules/react-transition-group/esm/CSSTransition.js";
14
- const te = ({
5
+ import H from "../Input/Input.js";
6
+ import O from "../Link/Link.js";
7
+ import V from "./SearchResults/SearchResults.js";
8
+ import { TextVariants as A } from "../Text/types.js";
9
+ import F from "../Text/Text.js";
10
+ import { useOnClickOutside as K } from "../../node_modules/usehooks-ts/dist/index.js";
11
+ import { HeaderContext as M } from "../../site-furniture/Header/Header.js";
12
+ import { SearchButton as U } from "./SearchButton.js";
13
+ import q from "../../node_modules/react-transition-group/esm/CSSTransition.js";
14
+ const ne = ({
15
15
  onSearch: u,
16
- searchResults: E = [],
17
- state: i = "idle",
18
- defaultValue: N = "",
19
- className: R,
20
- placeholder: I = "",
16
+ searchResults: N = [],
17
+ state: c = "idle",
18
+ defaultValue: E = "",
19
+ className: I,
20
+ placeholder: R = "",
21
21
  searchButtonText: l = "Search",
22
22
  loadingText: b = "Search In Progress...",
23
23
  invalidText: w = "Invalid search",
@@ -26,119 +26,119 @@ const te = ({
26
26
  ...S
27
27
  }) => {
28
28
  var g;
29
- const { className: e, "data-testid": d, ...L } = y(S, "Search"), o = c.useContext(K), m = c.useRef(null), f = c.useRef(null), x = c.useRef(null), a = o.isSearchExpanded, s = (g = m.current) == null ? void 0 : g.value;
30
- F(x, () => $(!1));
31
- const v = (r) => {
32
- var n;
29
+ const { className: e, "data-testid": d, ...L } = j(S, "Search"), o = i.useContext(M), m = i.useRef(null), h = i.useRef(null), v = i.useRef(null), t = o.isSearchExpanded, n = (g = m.current) == null ? void 0 : g.value, T = u ? (r) => {
30
+ u(r.target.value);
31
+ } : void 0;
32
+ K(v, () => $(!1));
33
+ const x = (r) => {
34
+ var s;
33
35
  if (r.stopPropagation(), r.key === "Enter") {
34
- if (r.preventDefault(), s && s.length > 2) {
35
- const T = C(_(s));
36
- window.location.href = T;
36
+ if (r.preventDefault(), n && n.length > 2) {
37
+ const P = C(_(n));
38
+ window.location.href = P;
37
39
  }
38
40
  r.currentTarget instanceof HTMLAnchorElement && r.currentTarget.click();
39
41
  }
40
- r.key === "Escape" && (o.setIsSearchExpanded(!1), (n = f.current) == null || n.reset());
42
+ r.key === "Escape" && (o.setIsSearchExpanded(!1), (s = h.current) == null || s.reset());
41
43
  };
42
- P(() => {
44
+ y(() => {
43
45
  var r;
44
- if (a) {
46
+ if (t) {
45
47
  (r = m.current) == null || r.focus();
46
48
  return;
47
49
  }
48
- }, [a]);
50
+ }, [t]);
49
51
  const $ = (r) => {
50
- var n;
51
- o.setIsSearchExpanded(r), (n = f.current) == null || n.reset();
52
+ var s;
53
+ o.setIsSearchExpanded(r), (s = h.current) == null || s.reset();
52
54
  };
53
- return /* @__PURE__ */ h(
55
+ return /* @__PURE__ */ a("div", { className: `${e}__container`, children: /* @__PURE__ */ f(
54
56
  "div",
55
57
  {
56
58
  onClick: () => o.setIsSearchExpanded(!0),
57
- className: `${e}__container`,
58
- ref: x,
59
+ className: `${e}__container__inner`,
60
+ ref: v,
59
61
  children: [
60
- /* @__PURE__ */ t(A, { variant: V.heading4, className: `${e}__container__label`, children: l }),
61
- /* @__PURE__ */ t(
62
+ /* @__PURE__ */ a(F, { variant: A.heading4, className: `${e}__container__inner__label`, children: l }),
63
+ /* @__PURE__ */ a(
62
64
  "div",
63
65
  {
64
66
  ...L,
65
- className: p(e, R, { [`${e}--active`]: a }),
67
+ className: p(e, I, { [`${e}--active`]: t }),
66
68
  "data-testid": d,
67
69
  role: "search",
68
70
  ...S,
69
- children: /* @__PURE__ */ h(
71
+ children: /* @__PURE__ */ f(
70
72
  "form",
71
73
  {
72
74
  "data-testid": `${d}-form`,
73
75
  className: p(`${e}__form`, {
74
- [`${e}__form--active`]: a
76
+ [`${e}__form--active`]: t
75
77
  }),
76
- ref: f,
78
+ ref: h,
77
79
  children: [
78
- /* @__PURE__ */ h(
80
+ /* @__PURE__ */ f(
79
81
  "div",
80
82
  {
81
83
  className: p(`${e}__content-wrapper`, {
82
- [`${e}__content-wrapper--active`]: a
84
+ [`${e}__content-wrapper--active`]: t
83
85
  }),
84
86
  role: "combobox",
85
87
  "aria-haspopup": "listbox",
86
88
  children: [
87
- /* @__PURE__ */ t(
88
- U,
89
+ /* @__PURE__ */ a(
90
+ q,
89
91
  {
90
- in: a,
91
- classNames: `${j}-input`,
92
+ in: t,
93
+ classNames: `${D}-input`,
92
94
  addEndListener: () => {
93
95
  },
94
- children: /* @__PURE__ */ t(
95
- D,
96
+ children: /* @__PURE__ */ a(
97
+ H,
96
98
  {
97
- "aria-hidden": !a,
99
+ "aria-hidden": !t,
98
100
  className: `${e}__input`,
99
101
  id: "search-input",
100
102
  hideLabel: !0,
101
103
  labelText: l,
102
- placeholder: a ? I : "",
104
+ placeholder: t ? R : "",
103
105
  type: "text",
104
- defaultValue: N,
105
- invalid: i === "invalid",
106
+ defaultValue: E,
107
+ invalid: c === "invalid",
106
108
  invalidText: w,
107
- onKeyDown: v,
108
- onChange: u ? (r) => {
109
- u(r.target.value);
110
- } : void 0,
109
+ onKeyDown: x,
110
+ onChange: T,
111
111
  ref: m
112
112
  }
113
113
  )
114
114
  }
115
115
  ),
116
- /* @__PURE__ */ t(
117
- M,
116
+ /* @__PURE__ */ a(
117
+ U,
118
118
  {
119
119
  className: e,
120
120
  searchButtonText: l,
121
- state: i,
121
+ state: c,
122
122
  testId: d,
123
- isSearchExpanded: a,
123
+ isSearchExpanded: t,
124
124
  setIsSearchExpanded: $
125
125
  }
126
126
  )
127
127
  ]
128
128
  }
129
129
  ),
130
- s && s.length > 2 ? /* @__PURE__ */ t(
131
- O,
130
+ n && n.length > 2 ? /* @__PURE__ */ a(
131
+ V,
132
132
  {
133
- autoCompleteResults: E,
134
- isLoading: i === "loading",
133
+ autoCompleteResults: N,
134
+ isLoading: c === "loading",
135
135
  loadingText: b,
136
- onKeyDown: v,
137
- children: /* @__PURE__ */ t("li", { className: `${e}__result`, children: /* @__PURE__ */ t(
138
- H,
136
+ onKeyDown: x,
137
+ children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
138
+ O,
139
139
  {
140
- href: ((r) => C(_(r)))(s),
141
- children: /* @__PURE__ */ t("p", { children: k(s) })
140
+ href: ((r) => C(_(r)))(n),
141
+ children: /* @__PURE__ */ a("p", { children: k(n) })
142
142
  }
143
143
  ) }, "viewAllSearchResults")
144
144
  }
@@ -150,8 +150,8 @@ const te = ({
150
150
  )
151
151
  ]
152
152
  }
153
- );
153
+ ) });
154
154
  };
155
155
  export {
156
- te as default
156
+ ne as default
157
157
  };
@@ -52,6 +52,9 @@ $post-sale-magenta: $post-sale-pink;
52
52
  $header-color: $pure-black;
53
53
  $text-color: $soft-black;
54
54
 
55
+ // Interactive Colors
56
+ $button-hover: #75716f;
57
+
55
58
  ////////////////////////
56
59
  /// FONTS:
57
60
  ///////////////////////
@@ -348,15 +351,15 @@ $margin-xxl: var(--spacing-xxl);
348
351
  ///////////////////////
349
352
  /* stylelint-disable-next-line no-duplicate-selectors */
350
353
  :root {
351
- --header-height: 75px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
354
+ --header-height: 73px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
352
355
  --search-size: 2.625rem; // This should be calculated from the scaling text and scaling spacing tokens instead of hardcoding in case they change
353
356
 
354
357
  @media (min-width: $breakpoint-md) {
355
- --header-height: 109px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
358
+ --header-height: 123px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
356
359
  }
357
360
 
358
361
  @media (min-width: $breakpoint-xl) {
359
- --header-height: 121px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
362
+ --header-height: 135px; // ideally we would calculate the size from the current text size plus spacing components so that it scales with the text size and spacing
360
363
  --search-size: 2.875rem; // This should be calculated from the scaling text and scaling spacing tokens instead of hardcoding in case they change
361
364
  }
362
365
  }
@@ -5,52 +5,123 @@
5
5
 
6
6
  align-items: center;
7
7
  background-color: $pure-black;
8
- border: 0;
9
- border-radius: 3em;
10
- color: white;
8
+ border: 1px solid transparent;
9
+ border-radius: 100px;
10
+ color: $pure-white;
11
11
  cursor: pointer;
12
12
  display: inline-flex;
13
+ font-weight: 600;
14
+ gap: $margin-xsm;
13
15
  justify-content: center;
14
- min-width: 3rem;
15
- padding: 0.5em $spacing-md;
16
+ padding: 0 $padding-md;
17
+ position: relative;
16
18
  transition:
17
19
  color 0.25s,
18
- background-color 0.25s,
19
- font-weight 0.25s;
20
+ background-color 0.25s;
21
+
22
+ svg {
23
+ fill: $pure-white;
24
+
25
+ path {
26
+ fill: $pure-white;
27
+ transition: 0.25s;
28
+ }
29
+ }
30
+
31
+ &:hover {
32
+ background-color: $button-hover;
33
+
34
+ svg {
35
+ fill: $pure-white;
36
+ }
37
+ }
20
38
 
21
- &:hover,
22
39
  &:focus-visible {
23
- background-color: $primary-black;
40
+ outline: 0.5px solid $pure-white;
41
+ outline-offset: -4.5px;
24
42
 
25
43
  svg {
26
44
  fill: $pure-white;
27
45
  }
28
46
  }
29
47
 
30
- svg {
31
- fill: $pure-white;
32
- margin-inline-end: 0.5rem;
33
- transition: fill 0.25s;
34
- width: 1em;
48
+ &--sm {
49
+ font-size: 0.75rem;
50
+ height: 44px;
51
+
52
+ svg {
53
+ height: 1rem;
54
+ width: 1rem;
55
+ }
56
+ }
57
+
58
+ &--md,
59
+ &--lg {
60
+ font-size: 1rem;
61
+ height: 48px;
62
+
63
+ svg {
64
+ height: 1.25rem;
65
+ width: 1.25rem;
66
+ }
35
67
  }
36
68
 
37
69
  &--secondary,
38
70
  &--ghost {
39
- background-color: transparent;
40
- border: 1px solid;
41
- color: $text-color;
71
+ background-color: $pure-white;
72
+ border: 1px solid $pure-black;
73
+ color: $pure-black;
74
+ mix-blend-mode: difference;
75
+ position: relative;
76
+ transition: border 0.3s ease-out;
77
+
78
+ &::before {
79
+ border-radius: 100px;
80
+ box-sizing: border-box;
81
+ content: '';
82
+ display: inline-block;
83
+ height: 0;
84
+ left: 50%;
85
+ position: absolute;
86
+ top: 50%;
87
+ transition: all 0.25s ease;
88
+ width: 0;
89
+ z-index: -2;
90
+ }
42
91
 
43
- &:hover,
44
- &:focus-visible {
92
+ &:hover {
93
+ background-color: transparent;
94
+ border: 1px solid transparent;
45
95
  color: $pure-white;
46
96
 
47
97
  svg {
48
98
  fill: $pure-white;
99
+
100
+ path {
101
+ fill: $pure-white;
102
+ }
103
+ }
104
+
105
+ &::before {
106
+ background: $button-hover;
107
+ height: 100%;
108
+ left: 0;
109
+ top: 0;
110
+ width: 100%;
49
111
  }
50
112
  }
51
113
 
114
+ &:focus-visible {
115
+ background-color: $pure-white;
116
+ outline-color: $soft-black;
117
+ }
118
+
52
119
  svg {
53
- fill: $text-color;
120
+ fill: $pure-black;
121
+
122
+ path {
123
+ fill: $pure-black;
124
+ }
54
125
  }
55
126
  }
56
127
 
@@ -58,35 +129,69 @@
58
129
  border-color: transparent;
59
130
  }
60
131
 
61
- &.#{$px}-button--icon-last svg {
62
- margin-inline-end: unset;
63
- margin-inline-start: 0.5rem;
64
- }
132
+ &--tertiary {
133
+ background-color: transparent;
134
+ border: 0;
135
+ color: $pure-black;
136
+ height: 28px;
137
+ padding: 0;
65
138
 
66
- &--sm {
67
- font-size: 0.75rem;
68
- }
139
+ svg {
140
+ fill: $pure-black;
69
141
 
70
- &--md {
71
- font-size: 1rem;
72
- }
142
+ path {
143
+ fill: $pure-black;
144
+ }
145
+ }
73
146
 
74
- &--lg {
75
- font-size: 1.05rem;
76
- padding: 0.75em 1.75em;
147
+ &:hover {
148
+ background-color: transparent;
149
+ color: $button-hover;
150
+
151
+ svg {
152
+ fill: $button-hover;
153
+
154
+ path {
155
+ fill: $button-hover;
156
+ }
157
+ }
158
+ }
159
+
160
+ &:focus-visible {
161
+ background-color: $pure-white;
162
+ border-radius: 0;
163
+ outline-color: $soft-black;
164
+ outline-offset: 4.5px;
165
+ padding: 0 4px;
166
+ }
77
167
  }
78
168
 
79
169
  &:disabled {
80
170
  background-color: $white;
81
- border: 1px solid $medium-gray;
82
- color: $medium-gray;
171
+ border: 1px solid $light-gray;
172
+ color: $light-gray;
83
173
  cursor: default;
84
174
 
175
+ &:hover {
176
+ &::before {
177
+ all: unset;
178
+ }
179
+ }
180
+
85
181
  svg {
86
- fill: $medium-gray;
182
+ fill: $light-gray;
183
+
184
+ path {
185
+ fill: $light-gray;
186
+ }
87
187
  }
88
188
  }
89
189
 
190
+ &--ghost:disabled,
191
+ &--tertiary:disabled {
192
+ border-color: transparent;
193
+ }
194
+
90
195
  * {
91
196
  margin: 0;
92
197
  }
@@ -1,49 +1,103 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-icon-button {
4
- background-color: unset;
5
- border: unset;
6
- color: $text-color;
7
- min-width: unset;
8
- padding: unset;
4
+ padding: 0;
9
5
 
10
6
  & > svg {
11
- fill: $pure-black;
12
- height: 100%;
13
- margin-inline-end: unset;
14
- width: 100%;
7
+ position: absolute;
15
8
  }
16
9
 
17
- &:hover {
18
- background-color: unset;
19
- opacity: 0.75;
10
+ &:focus {
11
+ &:focus {
12
+ outline: 0.5px solid $soft-black;
13
+ outline-offset: -4.5px;
14
+
15
+ svg {
16
+ fill: $pure-white;
17
+ }
18
+ }
19
+ }
20
+
21
+ &--primary,
22
+ &--ghost {
23
+ background: $pure-white;
24
+ color: $pure-black;
25
+ height: 44px;
26
+ width: 44px;
20
27
 
21
28
  & > svg {
22
29
  fill: $pure-black;
30
+ height: 100%;
31
+ height: 1.5rem;
32
+ margin-inline-end: unset;
33
+ position: absolute;
34
+ width: 100%;
35
+ width: 1.5rem;
36
+
37
+ path {
38
+ fill: $pure-black;
39
+ }
40
+ }
41
+
42
+ &:hover {
43
+ svg {
44
+ fill: $pure-white;
45
+
46
+ path {
47
+ fill: $pure-white;
48
+ }
49
+ }
23
50
  }
24
51
  }
25
52
 
26
- &:focus {
27
- background-color: unset;
28
- fill: $pure-black;
53
+ &--ghost {
54
+ border-color: transparent;
55
+
56
+ svg {
57
+ fill: $keyline-gray;
58
+
59
+ path {
60
+ fill: $keyline-gray;
61
+ }
62
+ }
63
+ }
64
+
65
+ &--secondary,
66
+ &--tertiary {
67
+ height: 28px;
68
+ width: 28px;
29
69
 
30
70
  & > svg {
31
71
  fill: $pure-black;
72
+ height: 100%;
73
+ height: 1rem;
74
+ margin-inline-end: unset;
75
+ position: absolute;
76
+ width: 100%;
77
+ width: 1rem;
78
+
79
+ path {
80
+ fill: $pure-black;
81
+ }
32
82
  }
33
83
  }
34
84
 
35
- &--sm {
36
- height: 1rem;
37
- width: 1rem;
85
+ &--tertiary {
86
+ &:focus {
87
+ border-radius: 100px;
88
+ }
38
89
  }
39
90
 
40
- &--md {
41
- height: 1.5rem;
42
- width: 1.5rem;
43
- }
91
+ &:disabled {
92
+ background-color: $white;
93
+ border: 1px solid $light-gray;
44
94
 
45
- &--lg {
46
- height: 2rem;
47
- width: 2rem;
95
+ svg {
96
+ fill: $light-gray;
97
+
98
+ path {
99
+ fill: $light-gray;
100
+ }
101
+ }
48
102
  }
49
103
  }
@@ -3,7 +3,6 @@
3
3
  .#{$px}-link {
4
4
  color: $pure-black;
5
5
  text-decoration: none;
6
- white-space: nowrap;
7
6
 
8
7
  &--email,
9
8
  &--link {
@@ -65,9 +65,41 @@
65
65
  flex-direction: column;
66
66
  gap: $spacing-sm;
67
67
 
68
- &--large-cta {
68
+ .#{$px}-text {
69
+ margin-bottom: 0;
70
+ }
71
+
72
+ &--start,
73
+ &--end {
74
+ &__title {
75
+ @include isHeaderMobile {
76
+ border-bottom: 1px solid $light-gray;
77
+ padding-bottom: 0.625rem;
78
+ }
79
+ }
80
+ }
81
+
82
+ &--end {
83
+ @include isHeaderMobile {
84
+ margin-top: $spacing-md;
85
+ }
86
+ }
87
+
88
+ &--start {
69
89
  margin-right: 1rem;
70
90
 
91
+ & li:last-child {
92
+ a {
93
+ border-bottom: 0;
94
+ padding: $spacing-sm 0;
95
+ text-decoration: underline;
96
+
97
+ span {
98
+ text-transform: uppercase;
99
+ }
100
+ }
101
+ }
102
+
71
103
  @include isHeaderMobile {
72
104
  margin-right: 0;
73
105
  }
@@ -4,12 +4,15 @@
4
4
  flex-direction: column;
5
5
  justify-content: center;
6
6
 
7
+ @include isHeaderMobile {
8
+ display: none;
9
+ }
10
+
7
11
  & > button {
8
12
  color: $pure-black;
9
13
  display: flex;
10
14
  justify-content: flex-start;
11
15
  position: relative;
12
- white-space: nowrap;
13
16
  width: 100%;
14
17
 
15
18
  @include isHeaderDesktop {
@@ -30,12 +33,14 @@
30
33
  }
31
34
 
32
35
  & > &__submenu {
36
+ border-top: 1px solid $light-gray;
33
37
  pointer-events: none;
34
38
  transform: translateY(-100%);
35
39
  transition: none; // remove this when implementing submenu transitions
36
40
  }
37
41
 
38
42
  &--hovered &__submenu {
43
+ align-items: flex-start;
39
44
  height: fit-content;
40
45
  left: 0;
41
46
  max-height: unset;
@@ -44,7 +49,7 @@
44
49
  pointer-events: all;
45
50
  position: fixed; // has to bust out of the box containing it on desktop
46
51
  right: 0;
47
- top: calc($header-height);
52
+ top: $header-height;
48
53
  transform: translateY(0);
49
54
  }
50
55
  }
@@ -61,7 +66,6 @@
61
66
 
62
67
  li {
63
68
  display: inline;
64
- white-space: nowrap;
65
69
 
66
70
  button,
67
71
  a,
@@ -37,8 +37,49 @@ $top-transition: top 0.25s ease-in 0.1s;
37
37
  z-index: 5;
38
38
  }
39
39
 
40
+ &__section {
41
+ display: grid;
42
+ gap: $spacing-sm;
43
+ width: 50%;
44
+
45
+ &:only-child {
46
+ width: 100%;
47
+ }
48
+ }
49
+
50
+ .#{$px}-accordion {
51
+ display: none;
52
+ }
53
+ }
54
+
55
+ @include isHeaderMobile {
40
56
  &__section {
41
57
  width: 100%;
42
58
  }
59
+ .#{$px}-accordion {
60
+ border-bottom: 0;
61
+ border-top: 0;
62
+ margin-bottom: 0;
63
+
64
+ &-item {
65
+ padding: $spacing-sm 0;
66
+
67
+ &__border-bottom {
68
+ border-bottom: 1px solid $light-gray;
69
+ }
70
+
71
+ &-label {
72
+ opacity: 1;
73
+ }
74
+ }
75
+ }
76
+ .#{$px}-link--snwHeaderLink {
77
+ border-bottom: 1px solid $light-gray;
78
+ flex-wrap: wrap;
79
+ padding: $spacing-sm 0;
80
+ }
81
+ .#{$px}-link--snwFlyoutLink {
82
+ padding: 0;
83
+ }
43
84
  }
44
85
  }
@@ -13,13 +13,18 @@
13
13
  justify-content: center;
14
14
  padding: 0 $spacing-sm;
15
15
  position: relative;
16
+ width: 100%;
16
17
 
17
18
  > .#{$px}-nav__list {
18
- border-top: 1px solid $light-gray;
19
+ padding-top: 0;
19
20
 
20
21
  @include isHeaderDesktop {
21
22
  border-top: unset;
22
23
  }
24
+
25
+ .#{$px}-nav__item + .#{$px}-accordion {
26
+ border-top: 0;
27
+ }
23
28
  }
24
29
 
25
30
  @include isHeaderDesktop {
@@ -11,6 +11,10 @@
11
11
  top: $search-size;
12
12
  width: 100%;
13
13
 
14
+ @include isHeaderMobile {
15
+ padding: $spacing-sm 0;
16
+ }
17
+
14
18
  &-container {
15
19
  background: $white;
16
20
  display: flex;
@@ -15,8 +15,13 @@
15
15
  top: 0;
16
16
  }
17
17
 
18
+ @include isHeaderMobile {
19
+ left: calc(100% - $search-size - $spacing-md);
20
+ right: $spacing-md;
21
+ }
22
+
18
23
  &--active {
19
- left: 0;
24
+ left: $spacing-md;
20
25
  transition: left 0.25s ease-in 0.2s;
21
26
  }
22
27
 
@@ -85,6 +90,14 @@
85
90
  margin: 0;
86
91
  padding: $spacing-sm 0 $spacing-sm $spacing-sm;
87
92
 
93
+ @include isHeaderMobile {
94
+ height: calc(var(--spacing-md) + var(--search-size));
95
+ line-height: calc(var(--spacing-md) + var(--search-size));
96
+ padding: $spacing-md 0;
97
+ position: relative;
98
+ top: calc($spacing-md * -1);
99
+ }
100
+
88
101
  @include media($size-xl) {
89
102
  height: 2.875rem;
90
103
  }
@@ -102,34 +115,50 @@
102
115
  }
103
116
 
104
117
  .#{$px}-search__container {
105
- cursor: pointer;
106
- display: flex;
107
- justify-content: space-between;
108
- padding: $padding-md 0;
109
- pointer-events: all;
110
-
111
- @include isHeaderDesktop {
112
- cursor: default;
113
- padding: 0;
114
- }
115
-
116
118
  @include isHeaderMobile {
119
+ border-bottom: 1px solid $light-gray;
120
+ left: 50%;
121
+ margin-left: -50vw;
117
122
  position: relative;
123
+ width: 100vw;
118
124
  }
119
125
 
120
- &__label {
121
- display: none;
122
- margin: 0;
126
+ &__inner {
127
+ cursor: pointer;
128
+ display: flex;
129
+ justify-content: space-between;
130
+ padding: 0 $padding-md;
131
+ pointer-events: all;
132
+
133
+ @include isHeaderDesktop {
134
+ cursor: default;
135
+ padding: 0;
136
+ }
123
137
 
124
138
  @include isHeaderMobile {
125
139
  align-items: center;
126
- cursor: pointer;
127
- display: flex;
128
- flex-wrap: wrap;
129
- height: $search-size;
130
- margin: 0;
131
- padding: 0 $spacing-sm;
132
- pointer-events: all;
140
+ height: calc(var(--spacing-md) + var(--search-size));
141
+ position: relative;
142
+ }
143
+
144
+ .#{$px}-text {
145
+ margin-bottom: 0;
146
+ padding-left: 0;
147
+ }
148
+
149
+ &__label {
150
+ display: none;
151
+
152
+ @include isHeaderMobile {
153
+ align-items: center;
154
+ cursor: pointer;
155
+ display: flex;
156
+ flex-wrap: wrap;
157
+ height: $search-size;
158
+ margin: 0;
159
+ padding: 0 $spacing-sm;
160
+ pointer-events: all;
161
+ }
133
162
  }
134
163
  }
135
164
  }
@@ -16,6 +16,12 @@
16
16
  top: 0;
17
17
  width: $search-size;
18
18
 
19
+ @include isHeaderMobile {
20
+ height: calc($spacing-md + $search-size);
21
+ justify-content: flex-end;
22
+ top: calc($spacing-md * -1);
23
+ }
24
+
19
25
  @include media($size-xl) {
20
26
  padding: 0 0 0.125rem;
21
27
  }
@@ -5,7 +5,6 @@
5
5
  display: flex;
6
6
  min-width: 87px; // needed to handle English vs Chinese option. Arguably this should be determined by the Dropdown component the longest element in the dropdown
7
7
  opacity: 1;
8
- padding-bottom: 10rem; // needed for bottom accordion
9
8
  transition: opacity 0.25s ease-in;
10
9
 
11
10
  &--hidden {
@@ -13,6 +12,31 @@
13
12
  pointer-events: none;
14
13
  }
15
14
 
15
+ @include isHeaderDesktop {
16
+ &.#{$px}-accordion {
17
+ display: none;
18
+ }
19
+ }
20
+
21
+ @include isHeaderMobile {
22
+ border-top: 0;
23
+ &.#{$px}-accordion {
24
+ border-bottom: 0;
25
+ }
26
+ .#{$px}-accordion-item {
27
+ border-top: 1px solid $light-gray;
28
+ padding: $spacing-sm 0;
29
+
30
+ &-label {
31
+ opacity: 1;
32
+ }
33
+
34
+ &__border-bottom {
35
+ border-bottom: 0;
36
+ }
37
+ }
38
+ }
39
+
16
40
  &.#{$px}-dropdown {
17
41
  display: flex;
18
42
  padding: 0;
@@ -15,7 +15,6 @@
15
15
  }
16
16
 
17
17
  @include isHeaderMobile {
18
- justify-content: center;
19
18
  min-width: 44px; // matching the size of mobile menu icon to allow for equal spacing and centering of logo
20
19
  }
21
20
 
@@ -36,6 +35,10 @@
36
35
  @include underline($padding-xsm);
37
36
  }
38
37
 
38
+ @include isHeaderMobile {
39
+ padding-right: 0;
40
+ }
41
+
39
42
  > p.#{$px}-text {
40
43
  margin: 0;
41
44
 
@@ -17,7 +17,7 @@
17
17
  cursor: pointer;
18
18
  display: flex;
19
19
  height: $mobile-minimum-clickable-area;
20
- justify-content: center;
20
+ justify-content: flex-start;
21
21
  padding: 0;
22
22
  width: $mobile-minimum-clickable-area;
23
23
 
@@ -27,7 +27,7 @@
27
27
 
28
28
  /* This is a pseudo icon shown within the button, so we can do fancy transitions */
29
29
  span {
30
- background-color: $dark-gray;
30
+ background-color: $pure-black;
31
31
  color: transparent;
32
32
  display: block;
33
33
  height: 2px;
@@ -37,7 +37,7 @@
37
37
 
38
38
  &::before,
39
39
  &::after {
40
- background-color: $dark-gray;
40
+ background-color: $pure-black;
41
41
  content: '';
42
42
  display: block;
43
43
  height: 2px;
@@ -112,9 +112,19 @@
112
112
  display: flex;
113
113
  padding: 0 $spacing-md;
114
114
 
115
+ @include isHeaderMobile {
116
+ flex-direction: column;
117
+ height: calc(100vh - var(--header-height) - 1px);
118
+ justify-content: flex-start;
119
+ }
120
+
115
121
  @include isHeaderDesktop {
116
122
  padding-right: $search-size;
117
123
  }
124
+
125
+ @media (min-width: $breakpoint-md) and (max-width: calc($breakpoint-md + 40px)) {
126
+ padding: 0 2rem 0 0;
127
+ }
118
128
  }
119
129
 
120
130
  @include isHeaderDesktop {
@@ -65,7 +65,14 @@ const I = O(R), L = T(
65
65
  ]
66
66
  }
67
67
  ) }),
68
- /* @__PURE__ */ a("div", { className: d(`${e}-header__overlay`, { [`${e}-header__overlay--active`]: c }) })
68
+ /* @__PURE__ */ a(
69
+ "div",
70
+ {
71
+ className: d(`${e}-header__overlay`, {
72
+ [`${e}-header__overlay--active`]: c
73
+ })
74
+ }
75
+ )
69
76
  ] });
70
77
  }
71
78
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.55.1",
3
+ "version": "1.57.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"