@phillips/seldon 1.77.2 → 1.77.3

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.
@@ -1,112 +1,119 @@
1
- import { jsxs as $, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
2
  import { getCommonProps as f } from "../../utils/index.js";
3
3
  import g from "../../assets/plus.svg.js";
4
4
  import v from "../../assets/minus.svg.js";
5
- import I from "../../assets/lock.svg.js";
6
- import a from "../../node_modules/classnames/index.js";
7
- import { Item as _, Trigger as x, Content as C } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
- import { AccordionItemVariant as h } from "./types.js";
5
+ import _ from "../../assets/lock.svg.js";
6
+ import l from "../../node_modules/classnames/index.js";
7
+ import { Item as I, Trigger as x, Content as A } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
+ import { AccordionItemVariant as $ } from "./types.js";
9
9
  import { getIconClasses as u } from "./utils.js";
10
- const A = ({
10
+ const k = ({
11
11
  children: n,
12
- className: e,
12
+ className: r,
13
13
  baseClassName: o,
14
- disable: s,
15
- isLargeVariation: r,
16
- id: c
14
+ disable: d,
15
+ isLargeVariation: c,
16
+ id: e
17
17
  }) => {
18
- const i = s, l = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
19
- I,
18
+ const s = d, a = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
19
+ _,
20
20
  {
21
- className: u(o, r, "lock"),
22
- "data-testid": `${c}-lockedIcon`,
21
+ className: u(o, c, "lock"),
22
+ "data-testid": `${e}-lockedIcon`,
23
23
  "aria-hidden": !0
24
24
  }
25
25
  ) }), p = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
26
26
  g,
27
27
  {
28
- className: u(o, r, "plus"),
29
- "data-testid": `${c}-plusIcon`,
28
+ className: u(o, c, "plus"),
29
+ "data-testid": `${e}-plusIcon`,
30
30
  "aria-hidden": !0
31
31
  }
32
- ) }), d = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
32
+ ) }), i = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
33
33
  v,
34
34
  {
35
- className: u(o, r, "minus"),
36
- "data-testid": `${c}-minusIcon`,
35
+ className: u(o, c, "minus"),
36
+ "data-testid": `${e}-minusIcon`,
37
37
  "aria-hidden": !0
38
38
  }
39
39
  ) });
40
40
  return /* @__PURE__ */ t(
41
41
  x,
42
42
  {
43
- "data-disabled": s,
43
+ "data-disabled": d,
44
44
  asChild: !0,
45
- className: a(o, { [`${o}--hoverable`]: !s }, e),
46
- children: /* @__PURE__ */ $("div", { "data-testid": `${c}-trigger`, children: [
47
- /* @__PURE__ */ t("div", { className: a(`${o}__text`, { [`${o}__text--lg`]: r }), children: n }),
48
- i && l,
49
- !i && p,
50
- !i && d
45
+ className: l(
46
+ o,
47
+ { [`${o}--large`]: c },
48
+ { [`${o}--hoverable`]: !d },
49
+ r
50
+ ),
51
+ children: /* @__PURE__ */ h("div", { "data-testid": `${e}-trigger`, children: [
52
+ /* @__PURE__ */ t("div", { className: l(`${o}__text`, { [`${o}__text--lg`]: c }), children: n }),
53
+ s && a,
54
+ !s && p,
55
+ !s && i
51
56
  ] })
52
57
  }
53
58
  );
54
- }, N = ({
59
+ }, C = ({
55
60
  children: n,
56
- baseClassName: e,
61
+ baseClassName: r,
57
62
  disable: o,
58
- hasTransition: s,
59
- isLargeVariation: r,
60
- className: c
61
- }) => o && n ? /* @__PURE__ */ t("div", { children: n }) : /* @__PURE__ */ t(
62
- C,
63
+ hasTransition: d,
64
+ isLargeVariation: c,
65
+ className: e
66
+ }) => o && n ? /* @__PURE__ */ t("div", { className: `${r}__content--locked`, children: n }) : /* @__PURE__ */ t(
67
+ A,
63
68
  {
64
69
  asChild: !0,
65
- className: a(
66
- `${e}__content`,
67
- { [`${e}__content--lg`]: r },
68
- { [`${e}--transition`]: s },
69
- c
70
+ className: l(
71
+ `${r}__content`,
72
+ { [`${r}__content--lg`]: c },
73
+ { [`${r}--transition`]: d },
74
+ e
70
75
  ),
71
76
  children: n
72
77
  }
73
- ), q = ({
78
+ ), y = ({
74
79
  isLocked: n = !1,
75
- variant: e = h.sm,
80
+ variant: r = $.sm,
76
81
  id: o,
77
- label: s,
78
- isLastItem: r,
79
- hasTransition: c = !1,
80
- children: i,
81
- ...l
82
+ label: d,
83
+ isLastItem: c,
84
+ hasTransition: e = !1,
85
+ children: s,
86
+ ...a
82
87
  }) => {
83
- const { className: p } = f({ id: o }, "Accordion"), d = e === h.lg, m = `${p}-item`;
84
- return /* @__PURE__ */ $(
85
- _,
88
+ const { className: p } = f({ id: o }, "Accordion"), i = r === $.lg, m = `${p}-item`;
89
+ return /* @__PURE__ */ h(
90
+ I,
86
91
  {
87
92
  disabled: n,
88
93
  value: o,
89
- className: a(m, { [`${m}__border-bottom`]: !r }),
90
- ...l,
94
+ className: l(m, {
95
+ [`${m}__border-bottom`]: !c
96
+ }),
97
+ ...a,
91
98
  children: [
92
99
  /* @__PURE__ */ t(
93
- A,
100
+ k,
94
101
  {
95
102
  disable: n,
96
- isLargeVariation: d,
103
+ isLargeVariation: i,
97
104
  id: o,
98
105
  baseClassName: `${m}-label`,
99
- children: s
106
+ children: d
100
107
  }
101
108
  ),
102
109
  /* @__PURE__ */ t(
103
- N,
110
+ C,
104
111
  {
105
112
  disable: n,
106
- hasTransition: c,
107
- isLargeVariation: d,
113
+ hasTransition: e,
114
+ isLargeVariation: i,
108
115
  baseClassName: m,
109
- children: /* @__PURE__ */ t("div", { className: "radix-accordion-content", children: i })
116
+ children: /* @__PURE__ */ t("div", { className: "radix-accordion-content", children: s })
110
117
  }
111
118
  )
112
119
  ]
@@ -114,5 +121,5 @@ const A = ({
114
121
  );
115
122
  };
116
123
  export {
117
- q as default
124
+ y as default
118
125
  };
@@ -1,44 +1,46 @@
1
- import { jsxs as d, Fragment as T, jsx as e } from "react/jsx-runtime";
2
- import { getCommonProps as _, findChildrenOfType as b, px as c } from "../../../utils/index.js";
1
+ import { jsxs as c, Fragment as T, jsx as e } from "react/jsx-runtime";
2
+ import { getCommonProps as _, findChildrenOfType as b, px as d } from "../../../utils/index.js";
3
3
  import x from "../../../node_modules/classnames/index.js";
4
- import l, { forwardRef as $, useState as I } from "react";
5
- import { TextVariants as p } from "../../Text/types.js";
4
+ import l, { forwardRef as I, useState as $ } from "react";
5
+ import { TextVariants as u } from "../../Text/types.js";
6
6
  import f from "../../Text/Text.js";
7
7
  import M from "../NavigationList/NavigationList.js";
8
8
  import O from "../../Accordion/Accordion.js";
9
9
  import y from "../../Accordion/AccordionItem.js";
10
- import { SSRMediaQuery as u } from "../../../providers/SeldonProvider/utils.js";
11
- const S = ({ id: i, label: r, children: t }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
10
+ import { SSRMediaQuery as p } from "../../../providers/SeldonProvider/utils.js";
11
+ import { AccordionItemVariant as S } from "../../Accordion/types.js";
12
+ const C = ({ id: i, label: r, children: t }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
12
13
  y,
13
14
  {
14
15
  hasTransition: !0,
15
16
  id: `accordion-item-${i}`,
16
- label: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }),
17
+ label: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: r }),
18
+ variant: S.lg,
17
19
  children: t
18
20
  },
19
21
  `accordion-key-${r}`
20
- ) }), C = $(
21
- ({ id: i, label: r, children: t, className: g, onClick: h, ...v }, N) => {
22
- const { className: n, ...a } = _({ id: i }, "NavigationItemTrigger"), [m, s] = I(!1), o = b(t, M);
23
- return /* @__PURE__ */ d(T, { children: [
24
- /* @__PURE__ */ e(u.Media, { lessThan: "md", children: /* @__PURE__ */ e(S, { id: i, label: r, ...a, children: o ? l.cloneElement(o[0], {
22
+ ) }), E = I(
23
+ ({ id: i, label: r, children: t, className: g, onClick: v, ...h }, N) => {
24
+ const { className: n, ...a } = _({ id: i }, "NavigationItemTrigger"), [m, s] = $(!1), o = b(t, M);
25
+ return /* @__PURE__ */ c(T, { children: [
26
+ /* @__PURE__ */ e(p.Media, { lessThan: "md", children: /* @__PURE__ */ e(C, { id: i, label: r, ...a, children: o ? l.cloneElement(o[0], {
25
27
  className: `${n}__submenu--mobile`
26
28
  }) : void 0 }) }),
27
- /* @__PURE__ */ e(u.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ d(
29
+ /* @__PURE__ */ e(p.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ c(
28
30
  "li",
29
31
  {
30
32
  ...a,
31
33
  ref: N,
32
34
  "aria-expanded": m,
33
- className: x(g, n, `${c}-nav__item`, {
35
+ className: x(g, n, `${d}-nav__item`, {
34
36
  [`${n}--hovered`]: m
35
37
  }),
36
- onClick: h,
38
+ onClick: v,
37
39
  onMouseOver: () => s(!0),
38
40
  onMouseOut: () => s(!1),
39
- ...v,
41
+ ...h,
40
42
  children: [
41
- /* @__PURE__ */ e("button", { className: `${c}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }) }),
43
+ /* @__PURE__ */ e("button", { className: `${d}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: r }) }),
42
44
  o ? l.cloneElement(o[0], { className: `${n}__submenu` }) : void 0
43
45
  ]
44
46
  }
@@ -46,7 +48,7 @@ const S = ({ id: i, label: r, children: t }) => /* @__PURE__ */ e(O, { children:
46
48
  ] });
47
49
  }
48
50
  );
49
- C.displayName = "NavigationItemTrigger";
51
+ E.displayName = "NavigationItemTrigger";
50
52
  export {
51
- C as default
53
+ E as default
52
54
  };
@@ -6,69 +6,71 @@ import { SupportedLanguages as s } from "../../types/commonTypes.js";
6
6
  import C from "../../components/Dropdown/Dropdown.js";
7
7
  import k from "../../components/Accordion/Accordion.js";
8
8
  import w from "../../components/Accordion/AccordionItem.js";
9
- import y from "../../components/Navigation/NavigationItem/NavigationItem.js";
10
- import { LinkVariants as M } from "../../components/Link/types.js";
11
- import { TextVariants as E } from "../../components/Text/types.js";
12
- import P from "../../components/Text/Text.js";
13
- import V from "../../components/Navigation/NavigationList/NavigationList.js";
9
+ import { AccordionItemVariant as y } from "../../components/Accordion/types.js";
10
+ import M from "../../components/Navigation/NavigationItem/NavigationItem.js";
11
+ import { LinkVariants as V } from "../../components/Link/types.js";
12
+ import { TextVariants as A } from "../../components/Text/types.js";
13
+ import E from "../../components/Text/Text.js";
14
+ import I from "../../components/Navigation/NavigationList/NavigationList.js";
14
15
  import { SSRMediaQuery as f } from "../../providers/SeldonProvider/utils.js";
15
- const j = ({
16
+ const P = ({
16
17
  id: a,
17
- value: n,
18
+ value: l,
18
19
  // can't be passed to the accordion
19
- onValueChange: r,
20
+ onValueChange: o,
20
21
  label: t,
21
- options: l,
22
+ options: n,
22
23
  ...m
23
24
  }) => /* @__PURE__ */ e(k, { ...m, children: /* @__PURE__ */ e(
24
25
  w,
25
26
  {
26
27
  hasTransition: !0,
27
28
  id: a != null ? a : "language-selector-accordion",
28
- label: /* @__PURE__ */ e(P, { variant: E.snwHeaderLink, children: t }),
29
- children: /* @__PURE__ */ e(V, { id: `${a}-navlist`, children: l.map((o) => /* @__PURE__ */ e(
30
- y,
29
+ label: /* @__PURE__ */ e(E, { variant: A.snwHeaderLink, children: t }),
30
+ variant: y.lg,
31
+ children: /* @__PURE__ */ e(I, { id: `${a}-navlist`, children: n.map((r) => /* @__PURE__ */ e(
32
+ M,
31
33
  {
32
- label: o.label,
33
- onClick: () => r(o.value),
34
- navType: M.snwFlyoutLink
34
+ label: r.label,
35
+ onClick: () => o(r.value),
36
+ navType: V.snwFlyoutLink
35
37
  },
36
- o.value
38
+ r.value
37
39
  )) })
38
40
  }
39
- ) }), A = S(
41
+ ) }), j = S(
40
42
  ({
41
43
  className: a,
42
- currentLanguage: n = s.en,
43
- languageOptions: r = [
44
+ currentLanguage: l = s.en,
45
+ languageOptions: o = [
44
46
  { label: "English", value: s.en },
45
47
  { label: "中文", value: s.zh }
46
48
  ],
47
49
  onLanguageChange: t = T,
48
- id: l,
50
+ id: n,
49
51
  isHidden: m,
50
- ...o
52
+ ...r
51
53
  }, c) => {
52
- var d, g;
53
- const { className: p, ...h } = N({ id: l }, "LanguageSelector"), v = (g = (d = r.find((i) => i.value === n)) == null ? void 0 : d.label) != null ? g : "English", u = {
54
+ var u, g;
55
+ const { className: p, ...h } = N({ id: n }, "LanguageSelector"), v = (g = (u = o.find((i) => i.value === l)) == null ? void 0 : u.label) != null ? g : "English", d = {
54
56
  ...h,
55
- ...o,
56
- id: l,
57
+ ...r,
58
+ id: n,
57
59
  className: x(p, a, {
58
60
  [`${p}--hidden`]: m
59
61
  }),
60
- options: r,
61
- value: n,
62
+ options: o,
63
+ value: l,
62
64
  onValueChange: (i) => t(i),
63
65
  label: v
64
66
  };
65
67
  return /* @__PURE__ */ b(L, { children: [
66
- /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(C, { ...u, ref: c }) }),
67
- /* @__PURE__ */ e(f.Media, { lessThan: "md", children: /* @__PURE__ */ e(j, { ...u, ref: c }) })
68
+ /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(C, { ...d, ref: c }) }),
69
+ /* @__PURE__ */ e(f.Media, { lessThan: "md", children: /* @__PURE__ */ e(P, { ...d, ref: c }) })
68
70
  ] });
69
71
  }
70
72
  );
71
- A.displayName = "LanguageSelector";
73
+ j.displayName = "LanguageSelector";
72
74
  export {
73
- A as default
75
+ j as default
74
76
  };
@@ -2,14 +2,16 @@
2
2
 
3
3
  .#{$px}-accordion {
4
4
  border-top: 1px solid $light-gray;
5
- margin-bottom: 10px;
6
5
  width: 100%;
7
6
  }
8
7
 
9
8
  .#{$px}-accordion-item {
10
- padding: $spacing-sm 0;
11
9
  width: 100%;
12
10
 
11
+ &--large {
12
+ padding: $spacing-md 0;
13
+ }
14
+
13
15
  svg {
14
16
  max-width: unset;
15
17
  }
@@ -24,7 +26,11 @@
24
26
  }
25
27
 
26
28
  &__content {
27
- margin: $spacing-sm 0;
29
+ padding-bottom: $spacing-md;
30
+
31
+ &--locked {
32
+ padding-bottom: $spacing-sm;
33
+ }
28
34
  }
29
35
 
30
36
  &__content--lg {
@@ -84,6 +90,7 @@
84
90
  to {
85
91
  height: 0;
86
92
  opacity: 0;
93
+ padding: 0;
87
94
  }
88
95
  }
89
96
  }
@@ -93,6 +100,11 @@
93
100
  display: flex;
94
101
  flex-direction: row;
95
102
  justify-content: space-between;
103
+ padding: $spacing-sm 0;
104
+
105
+ &--large {
106
+ padding: $spacing-md 0;
107
+ }
96
108
 
97
109
  &--hoverable {
98
110
  cursor: pointer;
@@ -34,15 +34,17 @@
34
34
  position: relative;
35
35
  text-align: center;
36
36
 
37
- &:hover::after,
38
- &:focus-visible::after {
39
- background: $pure-black;
40
- bottom: -1px;
41
- content: '';
42
- height: 1px;
43
- left: 0;
44
- position: absolute;
45
- right: 0;
37
+ @include media($breakpoint-md) {
38
+ &:hover::after,
39
+ &:focus-visible::after {
40
+ background: $pure-black;
41
+ bottom: -1px;
42
+ content: '';
43
+ height: 1px;
44
+ left: 0;
45
+ position: absolute;
46
+ right: 0;
47
+ }
46
48
  }
47
49
  }
48
50
 
@@ -46,6 +46,7 @@
46
46
  max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
47
47
  opacity 0.2s cubic-bezier(0.65, 0, 0.35, 1);
48
48
  width: 100%;
49
+
49
50
  .#{$px}-nav__list__section {
50
51
  opacity: 0;
51
52
  transition: opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1) 0.2s;
@@ -67,6 +68,10 @@
67
68
  }
68
69
  }
69
70
 
71
+ &__submenu--mobile.#{$px}-nav__list {
72
+ padding: 0;
73
+ }
74
+
70
75
  @include isHeaderDesktop {
71
76
  ul {
72
77
  background-color: $pure-white;
@@ -62,12 +62,6 @@ $top-transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
62
62
  margin-bottom: 0;
63
63
 
64
64
  &-item {
65
- padding: $spacing-sm 0;
66
-
67
- &__border-bottom {
68
- border-bottom: 1px solid $light-gray;
69
- }
70
-
71
65
  &-label {
72
66
  opacity: 1;
73
67
  }
@@ -76,7 +70,7 @@ $top-transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
76
70
  .#{$px}-link--snwHeaderLink {
77
71
  border-bottom: 1px solid $light-gray;
78
72
  flex-wrap: wrap;
79
- padding: $spacing-sm 0;
73
+ padding: $spacing-md 0;
80
74
  }
81
75
  .#{$px}-link--snwFlyoutLink {
82
76
  padding: 0;
@@ -25,7 +25,9 @@
25
25
  }
26
26
  .#{$px}-accordion-item {
27
27
  border-top: 1px solid $light-gray;
28
- padding: $spacing-sm 0;
28
+ .#{$px}-nav__list {
29
+ padding: 0;
30
+ }
29
31
 
30
32
  &-label {
31
33
  opacity: 1;
@@ -80,26 +80,19 @@
80
80
 
81
81
  .#{$px}-accordion {
82
82
  border-bottom: 1px solid #eae8e4;
83
- border-top: 1px solid #eae8e4;
83
+ border-top: unset;
84
84
  margin-bottom: $spacing-md;
85
85
  width: 100%;
86
86
 
87
87
  &-item {
88
- padding: 0;
89
-
90
- ul {
91
- padding-bottom: $spacing-md;
92
- }
93
-
94
88
  &--expanded {
95
- margin-bottom: $spacing-md;
96
89
  margin-top: 0;
97
90
  padding: 0;
98
91
  }
99
92
 
100
93
  &-label {
101
94
  opacity: 1;
102
- padding: $spacing-sm 0;
95
+ padding: $spacing-md 0 $spacing-sm;
103
96
 
104
97
  @include media($size-md) {
105
98
  cursor: unset;
@@ -137,7 +137,7 @@
137
137
 
138
138
  &--closed {
139
139
  display: unset;
140
- left: -100vw;
140
+ left: -100%;
141
141
  }
142
142
  }
143
143
 
@@ -157,13 +157,6 @@
157
157
  height: 100%;
158
158
  }
159
159
  }
160
-
161
- .#{$px}-nav__item {
162
- .#{$px}-link--snwHeaderLink {
163
- align-content: center;
164
- height: 100%;
165
- }
166
- }
167
160
  }
168
161
 
169
162
  &__overlay {
@@ -185,4 +178,10 @@
185
178
  height: 1rem;
186
179
  width: 1.5rem;
187
180
  }
181
+
182
+ @include isHeaderMobile {
183
+ .#{$px}-nav__list .#{$px}-nav__item:last-child .#{$px}-link--snwHeaderLink {
184
+ border-bottom: none;
185
+ }
186
+ }
188
187
  }
@@ -36,7 +36,7 @@ export declare const HeaderContext: React.Context<HeaderContextType>;
36
36
  /**
37
37
  * ## Overview
38
38
  *
39
- * This component allows navigation, search, login/logout, and language selection and supports desktop and mobile layouts. It requires the <SeldonProvider> to be wrapped around it to support SSR Media Queries.
39
+ * This component allows navigation, search, login/logout, and language selection and supports desktop and mobile layouts. It requires the `<SeldonProvider>` to be wrapped around it to support SSR Media Queries.
40
40
  *
41
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
42
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.77.2",
3
+ "version": "1.77.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"