@phillips/seldon 1.61.0 → 1.62.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.
@@ -1,9 +1,9 @@
1
- import { jsxs as g, jsx as o, Fragment as h } from "react/jsx-runtime";
2
- import { getCommonProps as $ } from "../../utils/index.js";
3
- import f from "../../assets/plus.svg.js";
4
- import v from "../../assets/minus.svg.js";
1
+ import { jsxs as h, jsx as o, Fragment as g } from "react/jsx-runtime";
2
+ import { getCommonProps as v } from "../../utils/index.js";
3
+ import $ from "../../assets/plus.svg.js";
4
+ import f from "../../assets/minus.svg.js";
5
5
  import I from "../../assets/lock.svg.js";
6
- import d from "../../node_modules/classnames/index.js";
6
+ import m from "../../node_modules/classnames/index.js";
7
7
  import { Item as _, Trigger as C, Content as N } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
8
  import { getIconClasses as p } from "./utils.js";
9
9
  const x = ({
@@ -22,14 +22,14 @@ const x = ({
22
22
  "aria-hidden": !0
23
23
  }
24
24
  ) }), u = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
25
- f,
25
+ $,
26
26
  {
27
27
  className: p(t, e, "plus"),
28
28
  "data-testid": `${r}-plusIcon`,
29
29
  "aria-hidden": !0
30
30
  }
31
31
  ) }), i = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
32
- v,
32
+ f,
33
33
  {
34
34
  className: p(t, e, "minus"),
35
35
  "data-testid": `${r}-minusIcon`,
@@ -41,9 +41,9 @@ const x = ({
41
41
  {
42
42
  "data-disabled": c,
43
43
  asChild: !0,
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 }),
44
+ className: m(t, { [`${t}--hoverable`]: !c }, s),
45
+ children: /* @__PURE__ */ h("div", { "data-testid": `${r}-trigger`, children: [
46
+ /* @__PURE__ */ o("div", { className: m(`${t}__text`, { [`${t}__text--lg`]: e }), children: n }),
47
47
  a && l,
48
48
  !a && u,
49
49
  !a && i
@@ -57,11 +57,11 @@ const x = ({
57
57
  hasTransition: c,
58
58
  isLargeVariation: e,
59
59
  className: r
60
- }) => /* @__PURE__ */ o(h, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
60
+ }) => /* @__PURE__ */ o(g, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
61
61
  N,
62
62
  {
63
63
  asChild: !0,
64
- className: d(
64
+ className: m(
65
65
  { [`${s}__content--lg`]: e },
66
66
  { [`${s}--transition`]: c },
67
67
  r
@@ -78,13 +78,13 @@ const x = ({
78
78
  children: a,
79
79
  ...l
80
80
  }) => {
81
- const { className: u } = $({ id: t }, "Accordion"), i = s === "lg", m = `${u}-item`;
82
- return /* @__PURE__ */ g(
81
+ const { className: u } = v({ id: t }, "Accordion"), i = s === "lg", d = `${u}-item`;
82
+ return /* @__PURE__ */ h(
83
83
  _,
84
84
  {
85
85
  disabled: n,
86
86
  value: t,
87
- className: d(m, { [`${m}__border-bottom`]: !e }),
87
+ className: m(d, { [`${d}__border-bottom`]: !e }),
88
88
  ...l,
89
89
  children: [
90
90
  /* @__PURE__ */ o(
@@ -93,7 +93,7 @@ const x = ({
93
93
  disable: n,
94
94
  isLargeVariation: i,
95
95
  id: t,
96
- baseClassName: `${m}-label`,
96
+ baseClassName: `${d}-label`,
97
97
  children: c
98
98
  }
99
99
  ),
@@ -103,8 +103,8 @@ const x = ({
103
103
  disable: n,
104
104
  hasTransition: r,
105
105
  isLargeVariation: i,
106
- baseClassName: m,
107
- children: a
106
+ baseClassName: d,
107
+ children: /* @__PURE__ */ o("div", { className: "radix-accordion-content", children: a })
108
108
  }
109
109
  )
110
110
  ]
@@ -1,44 +1,46 @@
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";
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";
3
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";
4
+ import l, { forwardRef as $, useState as I } from "react";
5
+ import { TextVariants as p } from "../../Text/types.js";
6
6
  import f from "../../Text/Text.js";
7
- import O from "../NavigationList/NavigationList.js";
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,
7
+ import M from "../NavigationList/NavigationList.js";
8
+ import O from "../../Accordion/Accordion.js";
9
+ import y from "../../Accordion/AccordionItem.js";
10
+ import { SSRMediaQuery as u } from "../../../providers/utils.js";
11
+ const S = ({ id: i, label: r, children: a }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
12
+ y,
13
13
  {
14
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`
15
+ hasTransition: !0,
16
+ id: `accordion-item-${i}`,
17
+ label: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }),
18
+ children: a
19
+ },
20
+ `accordion-key-${r}`
21
+ ) }), C = $(
22
+ ({ id: i, label: r, children: a, className: g, onClick: v, ...h }, N) => {
23
+ const { className: n, ...t } = _({ id: i }, "NavigationItemTrigger"), [m, s] = I(!1), o = b(a, M);
24
+ return /* @__PURE__ */ d(T, { children: [
25
+ /* @__PURE__ */ e(u.Media, { lessThan: "md", children: /* @__PURE__ */ e(S, { id: i, label: r, ...t, children: o ? l.cloneElement(o[0], {
26
+ className: `${n}__submenu--mobile`
25
27
  }) : void 0 }) }),
26
- /* @__PURE__ */ e(p.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ c(
28
+ /* @__PURE__ */ e(u.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ d(
27
29
  "li",
28
30
  {
29
- ...i,
31
+ ...t,
30
32
  ref: N,
31
33
  "aria-expanded": m,
32
- className: x(g, o, `${l}-nav__item`, {
33
- [`${o}--hovered`]: m
34
+ className: x(g, n, `${c}-nav__item`, {
35
+ [`${n}--hovered`]: m
34
36
  }),
35
37
  onClick: v,
36
38
  onMouseOver: () => s(!0),
37
39
  onMouseOut: () => s(!1),
38
40
  ...h,
39
41
  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
+ /* @__PURE__ */ e("button", { className: `${c}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }) }),
43
+ o ? l.cloneElement(o[0], { className: `${n}__submenu` }) : void 0
42
44
  ]
43
45
  }
44
46
  ) })
@@ -1,9 +1,9 @@
1
1
  import { jsxs as b, Fragment as L, jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
- import { getCommonProps as S, noOp as x } from "../../utils/index.js";
4
- import C from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as S, noOp as T } from "../../utils/index.js";
4
+ import x from "../../node_modules/classnames/index.js";
5
5
  import { SupportedLanguages as s } from "../../types/commonTypes.js";
6
- import T from "../../components/Dropdown/Dropdown.js";
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
9
  import y from "../../components/Navigation/NavigationItem/NavigationItem.js";
@@ -17,15 +17,16 @@ const j = ({
17
17
  value: n,
18
18
  // can't be passed to the accordion
19
19
  onValueChange: r,
20
- label: m,
20
+ label: t,
21
21
  options: l,
22
- ...t
23
- }) => /* @__PURE__ */ e(k, { ...t, children: /* @__PURE__ */ e(
22
+ ...m
23
+ }) => /* @__PURE__ */ e(k, { ...m, children: /* @__PURE__ */ e(
24
24
  w,
25
25
  {
26
26
  variation: "sm",
27
+ hasTransition: !0,
27
28
  id: a != null ? a : "language-selector-accordion",
28
- label: /* @__PURE__ */ e(P, { variant: E.snwHeaderLink, children: m }),
29
+ label: /* @__PURE__ */ e(P, { variant: E.snwHeaderLink, children: t }),
29
30
  children: /* @__PURE__ */ e(V, { id: `${a}-navlist`, children: l.map((o) => /* @__PURE__ */ e(
30
31
  y,
31
32
  {
@@ -44,27 +45,27 @@ const j = ({
44
45
  { label: "English", value: s.en },
45
46
  { label: "中文", value: s.zh }
46
47
  ],
47
- onLanguageChange: m = x,
48
+ onLanguageChange: t = T,
48
49
  id: l,
49
- isHidden: t,
50
+ isHidden: m,
50
51
  ...o
51
52
  }, c) => {
52
- var u, g;
53
- const { className: p, ...h } = S({ id: l }, "LanguageSelector"), v = (g = (u = r.find((i) => i.value === n)) == null ? void 0 : u.label) != null ? g : "English", d = {
53
+ var d, g;
54
+ const { className: p, ...h } = S({ id: l }, "LanguageSelector"), v = (g = (d = r.find((i) => i.value === n)) == null ? void 0 : d.label) != null ? g : "English", u = {
54
55
  ...h,
55
56
  ...o,
56
57
  id: l,
57
- className: C(p, a, {
58
- [`${p}--hidden`]: t
58
+ className: x(p, a, {
59
+ [`${p}--hidden`]: m
59
60
  }),
60
61
  options: r,
61
62
  value: n,
62
- onValueChange: (i) => m(i),
63
+ onValueChange: (i) => t(i),
63
64
  label: v
64
65
  };
65
66
  return /* @__PURE__ */ b(L, { children: [
66
- /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(T, { ...d, ref: c }) }),
67
- /* @__PURE__ */ e(f.Media, { lessThan: "md", children: /* @__PURE__ */ e(j, { ...d, ref: c }) })
67
+ /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(C, { ...u, ref: c }) }),
68
+ /* @__PURE__ */ e(f.Media, { lessThan: "md", children: /* @__PURE__ */ e(j, { ...u, ref: c }) })
68
69
  ] });
69
70
  }
70
71
  );
@@ -36,11 +36,11 @@
36
36
  }
37
37
 
38
38
  &--transition[data-state='open'] {
39
- animation: slide-down 250ms ease-out;
39
+ animation: slide-down 250ms ease-in-out;
40
40
  }
41
41
 
42
42
  &--transition[data-state='closed'] {
43
- animation: slide-up 250ms end;
43
+ animation: slide-up 250ms ease-in-out;
44
44
  }
45
45
 
46
46
  &[data-state='open'] {
@@ -66,10 +66,12 @@
66
66
  @keyframes slide-down {
67
67
  from {
68
68
  height: 0;
69
+ opacity: 0;
69
70
  }
70
71
 
71
72
  to {
72
73
  height: var(--radix-accordion-content-height);
74
+ opacity: 1;
73
75
  }
74
76
  }
75
77
 
@@ -33,24 +33,41 @@
33
33
  }
34
34
 
35
35
  & > &__submenu {
36
+ align-items: flex-start;
36
37
  border-top: 1px solid $light-gray;
38
+ height: fit-content;
39
+ max-height: 0;
40
+ opacity: 0;
41
+ padding: $padding-md;
37
42
  pointer-events: none;
38
- transform: translateY(-100%);
39
- transition: none; // remove this when implementing submenu transitions
43
+ position: fixed; // has to bust out of the box containing it on desktop
44
+ right: 0;
45
+ top: calc($header-height + 1px);
46
+ transition:
47
+ max-height 0.2s ease-in-out,
48
+ opacity 0s ease-in-out 0.2s,
49
+ z-index 0s ease-in-out 0.2s;
50
+ width: 100%;
51
+ z-index: -1;
52
+ .#{$px}-nav__list__section {
53
+ opacity: 0;
54
+ transition: opacity 0.5s ease-in-out;
55
+ }
40
56
  }
41
57
 
42
58
  &--hovered &__submenu {
43
- align-items: flex-start;
44
- height: fit-content;
45
59
  left: 0;
46
- max-height: unset;
60
+ max-height: 700px;
47
61
  opacity: 1;
48
- padding: $padding-md;
49
62
  pointer-events: all;
50
- position: fixed; // has to bust out of the box containing it on desktop
51
- right: 0;
52
- top: $header-height;
53
- transform: translateY(0);
63
+ transition:
64
+ max-height 0.25s ease-in-out,
65
+ z-index 0s ease-in-out 0.25s;
66
+ z-index: 1;
67
+
68
+ .#{$px}-nav__list__section {
69
+ opacity: 1;
70
+ }
54
71
  }
55
72
  }
56
73
 
@@ -59,10 +76,8 @@
59
76
  background-color: $pure-white;
60
77
  height: auto;
61
78
  left: 0;
62
- opacity: 0;
63
79
  overflow: hidden;
64
80
  position: absolute;
65
- z-index: -1;
66
81
 
67
82
  li {
68
83
  display: inline;
@@ -16,13 +16,18 @@
16
16
  }
17
17
 
18
18
  @include isHeaderMobile {
19
+ height: calc($search-size - 1px);
19
20
  left: calc(100% - $search-size - $spacing-md);
20
21
  right: $spacing-md;
21
22
  }
22
23
 
23
24
  &--active {
24
- left: $spacing-md;
25
+ left: 0;
25
26
  transition: left 0.25s ease-in 0.2s;
27
+
28
+ @include isHeaderMobile {
29
+ left: $spacing-md;
30
+ }
26
31
  }
27
32
 
28
33
  &__input-status-icon {
@@ -79,16 +84,16 @@
79
84
  border-bottom: 1px solid $pure-black;
80
85
  border-radius: unset;
81
86
  color: $pure-black;
82
- font-family: DistinctDisplay, sans-serif;
83
-
84
- // Tokenize later
85
- font-size: 0.875rem;
87
+ font-size: $string-size1;
86
88
  font-style: normal;
87
- font-variation-settings: 'wght' 400;
89
+ font-variation-settings: 'wght' 600;
88
90
  height: $search-size;
89
- line-height: 1.5rem;
91
+ letter-spacing: 0;
92
+ line-height: $string-line-height-size1;
90
93
  margin: 0;
91
- padding: $spacing-sm 0 $spacing-sm $spacing-sm;
94
+ padding: $spacing-xsm 0 $spacing-xsm $spacing-sm;
95
+
96
+ @include Montserrat;
92
97
 
93
98
  @include isHeaderMobile {
94
99
  height: calc(var(--spacing-md) + var(--search-size));
@@ -27,7 +27,6 @@
27
27
  display: flex;
28
28
  gap: 0 $spacing-xsm;
29
29
  justify-content: center;
30
- min-width: 44px;
31
30
  padding: 0;
32
31
  padding-bottom: $padding-xsm;
33
32
 
@@ -36,6 +35,7 @@
36
35
  }
37
36
 
38
37
  @include isHeaderMobile {
38
+ justify-content: flex-end;
39
39
  padding-right: 0;
40
40
  }
41
41
 
@@ -110,12 +110,13 @@
110
110
  }
111
111
  .#{$px}-nav__list-container {
112
112
  display: flex;
113
- padding: 0 $spacing-md;
113
+ padding: 0;
114
114
 
115
115
  @include isHeaderMobile {
116
116
  flex-direction: column;
117
117
  height: calc(100vh - var(--header-height) - 1px);
118
118
  justify-content: flex-start;
119
+ padding: 0 $spacing-md;
119
120
  }
120
121
 
121
122
  @include isHeaderDesktop {
@@ -127,6 +128,18 @@
127
128
  }
128
129
  }
129
130
 
131
+ @include isHeaderMobile {
132
+ left: 0;
133
+ position: absolute;
134
+ top: var(--header-height);
135
+ transition: left 0.25s ease-in-out;
136
+
137
+ &--closed {
138
+ display: unset;
139
+ left: -100vw;
140
+ }
141
+ }
142
+
130
143
  @include isHeaderDesktop {
131
144
  display: flex;
132
145
  height: unset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.61.0",
3
+ "version": "1.62.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"