@phillips/seldon 1.246.0 → 1.247.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 (53) hide show
  1. package/dist/_virtual/index12.js +2 -2
  2. package/dist/_virtual/index13.js +2 -2
  3. package/dist/assets/formatted/Search.js +8 -9
  4. package/dist/components/Input/utils.js +5 -3
  5. package/dist/components/Navigation/Navigation.js +51 -27
  6. package/dist/components/Navigation/Navigation.stories.d.ts +1 -2
  7. package/dist/components/Navigation/NavigationItem/NavigationItem.d.ts +8 -0
  8. package/dist/components/Navigation/NavigationItem/NavigationItem.js +43 -42
  9. package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationDesktopSubmenu.d.ts +17 -0
  10. package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationDesktopSubmenu.js +70 -0
  11. package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationItemWithSubmenu.d.ts +31 -0
  12. package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationItemWithSubmenu.js +68 -0
  13. package/dist/components/Navigation/NavigationItemWithSubmenu/index.d.ts +2 -0
  14. package/dist/components/Navigation/NavigationList/NavigationList.d.ts +11 -8
  15. package/dist/components/Navigation/NavigationList/NavigationList.js +21 -46
  16. package/dist/components/Navigation/NavigationSubmenu/NavigationSubmenu.d.ts +33 -0
  17. package/dist/components/Navigation/NavigationSubmenu/NavigationSubmenu.js +41 -0
  18. package/dist/components/Navigation/NavigationSubmenu/NavigationSubmenu.test.d.ts +1 -0
  19. package/dist/components/Search/Search.js +51 -47
  20. package/dist/components/Search/SearchButton.js +10 -10
  21. package/dist/components/Search/SearchResults/SearchResults.d.ts +2 -1
  22. package/dist/components/Search/SearchResults/SearchResults.js +22 -21
  23. package/dist/index.d.ts +3 -1
  24. package/dist/index.js +201 -197
  25. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +597 -0
  26. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  27. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-collection/dist/index.js +50 -0
  28. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  29. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  30. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  31. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  32. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  33. package/dist/node_modules/@radix-ui/react-navigation-menu/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
  34. package/dist/node_modules/ics/dist/schema/index.js +1 -1
  35. package/dist/node_modules/ics/dist/utils/index.js +1 -1
  36. package/dist/patterns/UserManagement/UserManagement.js +45 -27
  37. package/dist/scss/componentStyles.scss +1 -1
  38. package/dist/scss/components/Accordion/_accordion.scss +6 -0
  39. package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +0 -12
  40. package/dist/scss/components/Navigation/NavigationItemWithSubmenu/_navigationItemWithSubmenu.scss +114 -0
  41. package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +15 -3
  42. package/dist/scss/components/Navigation/_navigation.scss +109 -0
  43. package/dist/scss/components/Search/_search.scss +1 -0
  44. package/dist/scss/site-furniture/Header/_header.scss +24 -0
  45. package/dist/site-furniture/Header/Header.d.ts +8 -4
  46. package/dist/site-furniture/Header/Header.js +55 -50
  47. package/dist/site-furniture/Header/Header.stories.d.ts +278 -0
  48. package/dist/site-furniture/Header/utils.js +1 -2
  49. package/package.json +5 -1
  50. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.d.ts +0 -22
  51. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +0 -80
  52. package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +0 -111
  53. /package/dist/components/Navigation/{NavigationItemTrigger/NavigationItemTrigger.test.d.ts → NavigationItemWithSubmenu/NavigationItemWithSubmenu.test.d.ts} +0 -0
@@ -5,8 +5,7 @@ const t = {
5
5
  setIsSearchExpanded: e,
6
6
  closeMenu: e,
7
7
  activeSubmenuId: null,
8
- setActiveSubmenuId: e,
9
- closeTimeoutRef: { current: null }
8
+ setActiveSubmenuId: e
10
9
  };
11
10
  export {
12
11
  t as defaultHeaderContext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.246.0",
3
+ "version": "1.247.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -34,6 +34,8 @@
34
34
  "chromatic": "STORYBOOK=1 chromatic",
35
35
  "build:storybook": "storybook build",
36
36
  "preview": "npx http-server storybook-static",
37
+ "test:e2e": "playwright test e2e",
38
+ "test:e2e:headed": "playwright test e2e --headed",
37
39
  "clean": "rimraf './dist'",
38
40
  "clean:stories": "rimraf './storybook-static'",
39
41
  "create-component": "node --no-warnings --loader ts-node/esm .template/scripts/createComponent.ts",
@@ -52,6 +54,7 @@
52
54
  "@radix-ui/react-collapsible": "^1.1.0",
53
55
  "@radix-ui/react-dialog": "^1.1.4",
54
56
  "@radix-ui/react-dropdown-menu": "^2.1.14",
57
+ "@radix-ui/react-navigation-menu": "^1.2.14",
55
58
  "@radix-ui/react-popover": "^1.1.11",
56
59
  "@radix-ui/react-progress": "^1.1.7",
57
60
  "@radix-ui/react-select": "^2.1.1",
@@ -84,6 +87,7 @@
84
87
  "@commitlint/config-conventional": "^19.2.2",
85
88
  "@eslint/js": "^9.15.0",
86
89
  "@figma/code-connect": "^0.2.1",
90
+ "@playwright/test": "^1.58.2",
87
91
  "@semantic-release/changelog": "^6.0.3",
88
92
  "@semantic-release/git": "^10.0.1",
89
93
  "@semantic-release/github": "^12.0.0",
@@ -1,22 +0,0 @@
1
- import { default as React, ComponentProps } from 'react';
2
- export interface NavigationItemTriggerProps extends ComponentProps<'li'> {
3
- /**
4
- * Label for the navigation item
5
- */
6
- label: string;
7
- /**
8
- * ID for the trigger - required for context-based submenu management
9
- */
10
- id?: string;
11
- }
12
- /**
13
- * ## Overview
14
- *
15
- * Supports clicking in mobile mode and hovering in desktop mode to expand the child navigation lists
16
- *
17
- * [Figma Link](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/EASEL-Compendium%3A-Tokens%2C-Components-%26-Patterns?node-id=10570-6295&m=dev)
18
- *
19
- * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-languageselector--overview)
20
- */
21
- declare const NavigationItemTrigger: React.ForwardRefExoticComponent<Omit<NavigationItemTriggerProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
22
- export default NavigationItemTrigger;
@@ -1,80 +0,0 @@
1
- import { jsx as o, Fragment as $, jsxs as h } from "react/jsx-runtime";
2
- import I from "../../../_virtual/index.js";
3
- import r, { forwardRef as M, useEffect as E } from "react";
4
- import O from "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
5
- import { SSRMediaQuery as T } from "../../../providers/SeldonProvider/utils.js";
6
- import { HeaderContext as C } from "../../../site-furniture/Header/Header.js";
7
- import { getCommonProps as A, findChildrenOfType as P, focusElementById as j, px as v } from "../../../utils/index.js";
8
- import w from "../../Accordion/Accordion.js";
9
- import B from "../../Accordion/AccordionItem.js";
10
- import { TextVariants as b } from "../../Text/types.js";
11
- import N from "../../Text/Text.js";
12
- import L from "../NavigationList/NavigationList.js";
13
- const q = ({ id: t, label: i, children: s }) => {
14
- const { isMenuOpen: u } = r.useContext(C);
15
- return /* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(
16
- B,
17
- {
18
- hasTransition: !0,
19
- id: `accordion-item-${t}`,
20
- label: /* @__PURE__ */ o(N, { variant: b.linkStylised, children: i }),
21
- children: s
22
- },
23
- `accordion-key-${i}`
24
- ) }, `accordion-key-${i}-${u}`);
25
- }, F = M(
26
- ({ id: t, label: i, children: s, className: u, onClick: x, ...S }, a) => {
27
- const { className: m, ...f } = A({ id: t }, "NavigationItemTrigger"), e = P(s, L), {
28
- closeMenu: g,
29
- activeSubmenuId: k,
30
- setActiveSubmenuId: l,
31
- closeTimeoutRef: d
32
- } = r.useContext(C), R = r.useRef(null), n = d || R, p = k === t, _ = r.useCallback(() => {
33
- n.current && (clearTimeout(n.current), n.current = null), l?.(t || null), e && e[0]?.props?.id && j(e[0].props.id, !0);
34
- const c = a && "current" in a ? a.current : null;
35
- c && c.focus();
36
- }, [e, a, t, l, n]), y = r.useCallback(() => {
37
- n.current = setTimeout(() => {
38
- l?.(null), n.current = null;
39
- }, 200);
40
- }, [l, n]);
41
- return E(() => () => {
42
- !d && n.current && clearTimeout(n.current);
43
- }, [d, n]), /* @__PURE__ */ o($, { children: /* @__PURE__ */ h(O, { enabled: p, allowPinchZoom: !0, removeScrollBar: !1, children: [
44
- /* @__PURE__ */ o(T.Media, { lessThan: "md", children: /* @__PURE__ */ o(q, { id: t, label: i, ...f, children: e ? r.cloneElement(e[0], {
45
- className: `${m}__submenu--mobile`,
46
- onClick: (c) => {
47
- e[0].props?.onClick?.(c), l?.(null), g?.();
48
- }
49
- }) : null }) }),
50
- /* @__PURE__ */ o(T.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ h(
51
- "li",
52
- {
53
- ...f,
54
- ref: a,
55
- "aria-expanded": p,
56
- className: I(u, m, `${v}-nav__item`, {
57
- [`${m}--hovered`]: p
58
- }),
59
- onClick: x,
60
- onMouseOver: _,
61
- onMouseOut: y,
62
- ...S,
63
- children: [
64
- /* @__PURE__ */ o("button", { className: `${v}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ o(N, { variant: b.linkStylised, children: i }) }),
65
- e ? r.cloneElement(e[0], {
66
- className: `${m}__submenu`,
67
- onClick: (c) => {
68
- e[0].props?.onClick?.(c), l?.(null), g?.();
69
- }
70
- }) : null
71
- ]
72
- }
73
- ) })
74
- ] }) });
75
- }
76
- );
77
- F.displayName = "NavigationItemTrigger";
78
- export {
79
- F as default
80
- };
@@ -1,111 +0,0 @@
1
- @use '../../../allPartials' as *;
2
-
3
- .#{$px}-navigation-item-trigger {
4
- flex-direction: column;
5
- justify-content: center;
6
-
7
- @include isHeaderMobile {
8
- display: none;
9
- }
10
-
11
- & > button {
12
- color: $pure-black;
13
- display: flex;
14
- justify-content: flex-start;
15
- position: relative;
16
- width: 100%;
17
-
18
- @include isHeaderDesktop {
19
- color: unset;
20
- justify-content: center;
21
-
22
- &:focus-visible {
23
- @include focus-ring($border-radius: $radius-xs);
24
- }
25
- }
26
- }
27
-
28
- @include isHeaderDesktop {
29
- &--hovered button::after {
30
- background-color: $pure-black;
31
- bottom: -1px;
32
- content: '';
33
- height: 1px;
34
- left: 0;
35
- position: absolute;
36
- right: 0;
37
- }
38
-
39
- & > &__submenu {
40
- align-items: flex-start;
41
- height: fit-content;
42
- max-height: 0;
43
- opacity: 0;
44
- padding: $padding-md;
45
- pointer-events: none;
46
- position: fixed; // has to bust out of the box containing it on desktop
47
- right: 0;
48
- top: calc(
49
- var(--banner-height) + #{$header-height}
50
- ); // will be dynamically set again when notification banner is shown
51
-
52
- transition:
53
- max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
54
- opacity 0.2s cubic-bezier(0.65, 0, 0.35, 1);
55
- width: 100%;
56
-
57
- .#{$px}-nav__list__section {
58
- opacity: 0;
59
- transition: opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1) 0.2s;
60
- }
61
- }
62
-
63
- &--hovered &__submenu {
64
- cursor: default;
65
- left: 0;
66
- max-height: calc(90vh - #{$header-height} + var(--banner-height));
67
- opacity: 1;
68
- -ms-overflow-style: none; /* Internet Explorer 10+ */
69
- overflow-y: scroll;
70
- pointer-events: all;
71
- scrollbar-width: none; /* Firefox */
72
- transition:
73
- max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
74
- opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1);
75
-
76
- &::-webkit-scrollbar {
77
- display: none; /* Safari and Chrome */
78
- }
79
-
80
- .#{$px}-nav__list__section {
81
- opacity: 1;
82
- }
83
- }
84
- }
85
-
86
- &__submenu--mobile.#{$px}-nav__list {
87
- padding: 0 0 $snowflake-menu-padding;
88
- }
89
-
90
- @include isHeaderDesktop {
91
- ul {
92
- background-color: $pure-white;
93
- height: auto;
94
- left: 0;
95
- overflow: hidden;
96
- position: absolute;
97
-
98
- li {
99
- display: inline;
100
-
101
- button,
102
- a,
103
- p {
104
- @include isHeaderDesktop {
105
- border: none;
106
- }
107
- }
108
- }
109
- }
110
- }
111
- }