@phillips/seldon 1.51.0 → 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
@@ -2,121 +2,60 @@
2
2
 
3
3
  .#{$px}-user-management {
4
4
  align-items: center;
5
+ cursor: pointer;
5
6
  display: flex;
6
- height: $user-management-height;
7
+ gap: 0 $spacing-xsm;
7
8
  justify-content: flex-end;
8
- left: 0;
9
- padding: 0 $spacing-md;
10
- position: fixed;
11
- right: 0;
12
- top: 0;
13
- width: 100%;
9
+ min-height: 42px; // stop bounce after the user is logged in
10
+ min-width: 92px; // needed to handle the loading states and language swapping
14
11
 
15
- @include isHeaderMobile {
16
- align-items: flex-start;
17
- background: transparent;
18
- flex-direction: column;
19
- height: unset;
20
- margin-top: auto;
21
- padding: 0;
22
- position: unset;
23
-
24
- .#{$px}-nav__item-trigger {
25
- text-align: unset;
26
- }
12
+ @include media($size-xl) {
13
+ min-width: 104px; // stop bounce after the user is logged in
27
14
  }
28
15
 
29
- > li {
30
- border: none;
31
- display: flex;
32
- flex-wrap: wrap;
33
- justify-content: flex-end;
16
+ @include isHeaderMobile {
17
+ justify-content: center;
18
+ min-width: 44px; // matching the size of mobile menu icon to allow for equal spacing and centering of logo
34
19
  }
35
20
 
36
- &__account-wrapper {
21
+ &__login {
37
22
  align-items: center;
23
+ background-color: unset;
24
+ border: unset;
25
+ border-bottom: 1px solid transparent;
26
+ cursor: pointer;
38
27
  display: flex;
28
+ gap: 0 $spacing-xsm;
29
+ padding-bottom: $padding-xsm;
39
30
 
40
- @include isHeaderMobile {
41
- width: 100%;
31
+ &:hover {
32
+ @include underline($padding-xsm);
42
33
  }
43
34
 
44
- .#{$px}-link {
35
+ > p.#{$px}-text {
36
+ margin: 0;
37
+
45
38
  @include isHeaderMobile {
46
- width: 100%;
39
+ display: none;
47
40
  }
48
41
  }
49
42
  }
50
43
 
51
- &__login {
52
- cursor: pointer;
53
- }
54
-
55
44
  &__account-icon {
56
- cursor: pointer;
45
+ height: 1.5rem;
46
+ width: 1.5rem;
57
47
 
58
- &:hover,
59
- &:focus,
60
- &:focus-within {
61
- path {
62
- fill: $soft-black;
63
- }
64
- }
65
-
66
- @include isHeaderMobile {
67
- display: none;
48
+ a {
49
+ align-items: center;
50
+ display: flex;
51
+ height: $mobile-minimum-clickable-area;
52
+ justify-content: center;
53
+ width: $mobile-minimum-clickable-area;
68
54
  }
69
- }
70
55
 
71
- .#{$px}-nav__item {
72
- > a {
73
- padding: 0.5rem;
74
- }
75
-
76
- &:hover,
77
- &:focus,
78
- &:focus-within {
79
- &::after {
80
- opacity: 0;
81
- }
82
- .#{$px}-user-management__language {
83
- &__selections {
84
- padding: 0.8125rem;
85
- }
86
- }
87
- }
88
- .#{$px}-user-management__language {
89
- &__selections {
90
- padding: 0.8125rem;
91
-
92
- @include isHeaderDesktop {
93
- background: $off-white;
94
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 85%);
95
- display: block;
96
- left: unset;
97
- min-height: unset;
98
- min-width: 130px;
99
- padding: 0;
100
- position: absolute;
101
- right: 0;
102
- top: $user-management-height;
103
- width: 100%;
104
-
105
- > li {
106
- height: auto;
107
- }
108
- .#{$px}-input {
109
- &--inline {
110
- gap: 0.825rem;
111
- }
112
-
113
- &__input {
114
- height: 18px;
115
- width: 18px;
116
- }
117
- }
118
- }
119
- }
56
+ @mixin isHeaderDesktop {
57
+ height: 1.5rem;
58
+ width: 1.5rem;
120
59
  }
121
60
  }
122
61
  }
@@ -13,5 +13,6 @@
13
13
  inset: 0;
14
14
  position: absolute;
15
15
  width: 100%;
16
+ z-index: 0;
16
17
  }
17
18
  }
@@ -100,5 +100,6 @@ export declare const emailValidation: (email: string) => boolean;
100
100
  *
101
101
  */
102
102
  export declare const findChildrenOfType: <ComponentProps>(children: React.ReactNode, componentType?: React.ElementType, inverse?: boolean) => React.ReactElement<ComponentProps, string | React.JSXElementConstructor<any>>[] | null;
103
+ export declare const findChildrenExcludingTypes: <ComponentProps>(children: React.ReactNode, excludedTypes: React.ElementType[]) => React.ReactElement<ComponentProps, string | React.JSXElementConstructor<any>>[] | null;
103
104
  export declare const encodeURLSearchParams: (url: string) => string;
104
105
  export {};
@@ -1,55 +1,62 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { kebabCase as c } from "../node_modules/change-case/dist/index.js";
3
- import * as u from "react";
4
- const o = "seldon", v = ({ id: e, ...r }, t) => {
5
- const n = c(t);
2
+ import { kebabCase as u } from "../node_modules/change-case/dist/index.js";
3
+ import * as c from "react";
4
+ const s = "seldon", v = ({ id: e, ...r }, n) => {
5
+ const t = u(n);
6
6
  return {
7
7
  ...r,
8
- "data-testid": e ? `${n}-${e}` : `${n}`,
9
- className: `${o}-${n}`
8
+ "data-testid": e ? `${t}-${e}` : `${t}`,
9
+ className: `${s}-${t}`
10
10
  };
11
11
  };
12
- var x = /* @__PURE__ */ ((e) => (e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))(x || {}), $ = /* @__PURE__ */ ((e) => (e.micro = "micro", e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))($ || {});
12
+ var x = /* @__PURE__ */ ((e) => (e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))(x || {}), f = /* @__PURE__ */ ((e) => (e.micro = "micro", e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))(f || {});
13
13
  const C = () => {
14
14
  };
15
- function w({
15
+ function g({
16
16
  disabled: e = !1,
17
17
  id: r,
18
- invalid: t = !1,
19
- invalidText: n = "invalid",
18
+ invalid: n = !1,
19
+ invalidText: t = "invalid",
20
20
  readOnly: a = !1,
21
- type: s,
21
+ type: o,
22
22
  warn: i = !1,
23
23
  warnText: m
24
24
  }) {
25
25
  const l = {
26
26
  disabled: !a && e,
27
- invalid: !a && !e && t,
27
+ invalid: !a && !e && n,
28
28
  invalidId: `${r}-error-msg`,
29
- type: s === "toggle" ? "checkbox" : s,
30
- warn: !a && !e && !t && i,
29
+ type: o === "toggle" ? "checkbox" : o,
30
+ warn: !a && !e && !n && i,
31
31
  warnId: `${r}-warn-msg`,
32
32
  validation: null
33
33
  };
34
- return l.invalid && (l.validation = /* @__PURE__ */ d("div", { className: `${o}-input__validation ${o}-${s}-input--invalid`, id: l.invalidId, children: n })), l.warn && (l.validation = /* @__PURE__ */ d("div", { className: `${o}-input__validation ${o}-${s}-input--warn`, id: l.warnId, children: m })), l;
34
+ return l.invalid && (l.validation = /* @__PURE__ */ d("div", { className: `${s}-input__validation ${s}-${o}-input--invalid`, id: l.invalidId, children: t })), l.warn && (l.validation = /* @__PURE__ */ d("div", { className: `${s}-input__validation ${s}-${o}-input--warn`, id: l.warnId, children: m })), l;
35
35
  }
36
- const g = (/* @__PURE__ */ new Date()).getFullYear(), h = (e, r = "end", t = "vertical") => `${o}-padding-${t}-${e}-${r}`, I = (e) => /(.+)@(.+){2,}\.(.+){2,}/i.test(e), N = (e, r, t = !1) => {
37
- const n = u.Children.toArray(e).filter((a) => a && a.type === r && !t ? a : a && a.type !== r && t);
36
+ const w = (/* @__PURE__ */ new Date()).getFullYear(), h = (e, r = "end", n = "vertical") => `${s}-padding-${n}-${e}-${r}`, y = (e) => /(.+)@(.+){2,}\.(.+){2,}/i.test(e), I = (e, r, n = !1) => {
37
+ const t = c.Children.toArray(e).filter((a) => a && a.type === r && !n ? a : a && a.type !== r && n);
38
+ return t.length > 0 ? t : null;
39
+ }, N = (e, r) => {
40
+ const n = c.Children.toArray(e).filter((t) => {
41
+ if (t && t.type && !r.includes(t.type))
42
+ return t;
43
+ });
38
44
  return n.length > 0 ? n : null;
39
45
  }, R = (e) => {
40
- const r = e.split("?"), t = new URLSearchParams(r[1]), a = Array.from(t.entries()).map(([i, m]) => [i, encodeURIComponent(m)]).map(([i, m]) => `${i}=${m}`).join("&");
46
+ const r = e.split("?"), n = new URLSearchParams(r[1]), a = Array.from(n.entries()).map(([i, m]) => [i, encodeURIComponent(m)]).map(([i, m]) => `${i}=${m}`).join("&");
41
47
  return `${r[0]}?${a}`;
42
48
  };
43
49
  export {
44
50
  x as PaddingTokens,
45
- $ as SpacingTokens,
46
- g as defaultYear,
47
- I as emailValidation,
51
+ f as SpacingTokens,
52
+ w as defaultYear,
53
+ y as emailValidation,
48
54
  R as encodeURLSearchParams,
49
- N as findChildrenOfType,
55
+ N as findChildrenExcludingTypes,
56
+ I as findChildrenOfType,
50
57
  h as generatePaddingClassName,
51
58
  v as getCommonProps,
52
59
  C as noOp,
53
- o as px,
54
- w as useNormalizedInputProps
60
+ s as px,
61
+ g as useNormalizedInputProps
55
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.51.0",
3
+ "version": "1.52.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -57,6 +57,7 @@
57
57
  "@chromatic-com/storybook": "^1.6.1",
58
58
  "@commitlint/cli": "^19.3.0",
59
59
  "@commitlint/config-conventional": "^19.2.2",
60
+ "@faker-js/faker": "^9.0.0",
60
61
  "@figma/code-connect": "^0.2.1",
61
62
  "@semantic-release/changelog": "^6.0.3",
62
63
  "@semantic-release/git": "^10.0.1",