@pathscale/ui 3.0.0 → 3.2.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 (103) hide show
  1. package/README.md +13 -2
  2. package/dist/components/accordion/Accordion.css +24 -1
  3. package/dist/components/alert/Alert.css +11 -1
  4. package/dist/components/auth-field-group/AuthFieldGroup.css +11 -3
  5. package/dist/components/button/Button.css +37 -10
  6. package/dist/components/calendar/Calendar.generated.d.ts +19 -2
  7. package/dist/components/calendar/Calendar.generated.js +30 -23
  8. package/dist/components/calendar/index.d.ts +1 -1
  9. package/dist/components/card/Card.generated.d.ts +38 -2
  10. package/dist/components/card/Card.generated.js +99 -45
  11. package/dist/components/card/Card.interactions.d.ts +70 -0
  12. package/dist/components/card/Card.interactions.js +19 -0
  13. package/dist/components/card/index.d.ts +1 -1
  14. package/dist/components/checkbox/Checkbox.generated.d.ts +23 -2
  15. package/dist/components/checkbox/Checkbox.generated.js +14 -6
  16. package/dist/components/collapsible/Collapsible.css +17 -1
  17. package/dist/components/color-wheel-flower/ColorWheelFlower.generated.d.ts +8 -0
  18. package/dist/components/color-wheel-flower/ColorWheelFlower.generated.js +14 -1
  19. package/dist/components/color-wheel-flower/colorWheelFlowerContext.d.ts +9 -2
  20. package/dist/components/color-wheel-flower/colorWheelFlowerContext.js +2 -4
  21. package/dist/components/connection-settings/ConnectionSettings.css +76 -0
  22. package/dist/components/connection-settings/ConnectionSettings.generated.d.ts +45 -0
  23. package/dist/components/connection-settings/ConnectionSettings.generated.js +300 -0
  24. package/dist/components/connection-settings/ConnectionSettings.recipe.d.ts +54 -0
  25. package/dist/components/connection-settings/ConnectionSettings.recipe.js +111 -0
  26. package/dist/components/connection-settings/index.d.ts +2 -0
  27. package/dist/components/connection-settings/index.js +1 -0
  28. package/dist/components/date-picker/DatePicker.generated.d.ts +3 -1
  29. package/dist/components/date-picker/DatePicker.generated.js +8 -5
  30. package/dist/components/date-range-picker/DateRangePicker.generated.d.ts +3 -1
  31. package/dist/components/date-range-picker/DateRangePicker.generated.js +9 -6
  32. package/dist/components/dialog/Dialog.generated.js +17 -79
  33. package/dist/components/drawer/Drawer.a11y.d.ts +1 -3
  34. package/dist/components/drawer/Drawer.a11y.js +2 -30
  35. package/dist/components/drawer/Drawer.generated.d.ts +24 -0
  36. package/dist/components/drawer/Drawer.generated.js +65 -58
  37. package/dist/components/grid/Grid.generated.js +3 -3
  38. package/dist/components/icon/Icon.generated.d.ts +15 -0
  39. package/dist/components/icon/Icon.generated.js +11 -2
  40. package/dist/components/immersive-landing/ImmersiveLanding.css +1 -1
  41. package/dist/components/immersive-landing/components/CookieConsent.interactions.d.ts +24 -0
  42. package/dist/components/immersive-landing/components/CookieConsent.interactions.js +2 -0
  43. package/dist/components/immersive-landing/components/CookieConsent.js +52 -47
  44. package/dist/components/immersive-landing/components/FirefoxPWABanner.js +10 -10
  45. package/dist/components/immersive-landing/types.d.ts +15 -0
  46. package/dist/components/input/Input.css +5 -3
  47. package/dist/components/input/Input.generated.js +6 -3
  48. package/dist/components/language-switcher/LanguageSwitcher.generated.js +1 -1
  49. package/dist/components/live-chat/LiveChatPanel.generated.js +2 -6
  50. package/dist/components/live-chat/LiveChatPanel.interactions.d.ts +21 -0
  51. package/dist/components/live-chat/LiveChatPanel.interactions.js +10 -0
  52. package/dist/components/password-field/PasswordField.generated.d.ts +9 -1
  53. package/dist/components/password-field/PasswordField.generated.js +2 -2
  54. package/dist/components/password-field/PasswordField.interactions.d.ts +2 -2
  55. package/dist/components/password-field/PasswordField.interactions.js +2 -2
  56. package/dist/components/popover/Popover.a11y.d.ts +47 -0
  57. package/dist/components/popover/Popover.a11y.js +19 -0
  58. package/dist/components/popover/Popover.generated.d.ts +26 -0
  59. package/dist/components/popover/Popover.generated.js +119 -46
  60. package/dist/components/radio/Radio.generated.d.ts +26 -2
  61. package/dist/components/radio/Radio.generated.js +9 -5
  62. package/dist/components/range-calendar/RangeCalendar.generated.d.ts +3 -1
  63. package/dist/components/range-calendar/RangeCalendar.generated.js +4 -1
  64. package/dist/components/select/Select.generated.js +5 -0
  65. package/dist/components/slider/Slider.generated.d.ts +14 -1
  66. package/dist/components/slider/Slider.generated.js +3 -2
  67. package/dist/components/switch/Switch.css +0 -3
  68. package/dist/components/switch/Switch.generated.d.ts +23 -2
  69. package/dist/components/switch/Switch.generated.js +21 -44
  70. package/dist/components/switch/Switch.recipe.d.ts +61 -38
  71. package/dist/components/switch/Switch.recipe.js +88 -68
  72. package/dist/components/table/MobileListView.generated.js +1 -1
  73. package/dist/components/text/Text.generated.d.ts +26 -1
  74. package/dist/components/text/Text.generated.js +14 -13
  75. package/dist/components/text/Text.recipe.d.ts +17 -5
  76. package/dist/components/text/Text.recipe.js +7 -13
  77. package/dist/components/text/index.d.ts +1 -1
  78. package/dist/components/theme-color-picker/ThemeColorPicker.generated.js +1 -1
  79. package/dist/hooks/connection/createConnectionSettings.d.ts +128 -0
  80. package/dist/hooks/connection/createConnectionSettings.js +211 -0
  81. package/dist/hooks/connection/index.d.ts +2 -0
  82. package/dist/hooks/connection/index.js +1 -0
  83. package/dist/hooks/date/date.names.d.ts +107 -0
  84. package/dist/hooks/date/date.names.js +74 -0
  85. package/dist/hooks/date/date.utils.d.ts +11 -1
  86. package/dist/hooks/date/date.utils.js +3 -6
  87. package/dist/hooks/date/index.d.ts +1 -0
  88. package/dist/hooks/date/index.js +1 -0
  89. package/dist/hooks/date/useCalendarState.d.ts +12 -5
  90. package/dist/hooks/date/useCalendarState.js +7 -19
  91. package/dist/hooks/form/createForm.d.ts +4 -4
  92. package/dist/hooks/form/createForm.js +7 -9
  93. package/dist/index.d.ts +8 -4
  94. package/dist/index.js +3 -1
  95. package/dist/layouts.manifest.json +4 -1
  96. package/dist/lib/focus.d.ts +31 -0
  97. package/dist/lib/focus.js +39 -0
  98. package/dist/lib/overlay.d.ts +94 -0
  99. package/dist/lib/overlay.js +72 -0
  100. package/dist/purge-manifest.json +14427 -15269
  101. package/dist/responsive-classes.txt +450 -0
  102. package/dist/styles/base/index.css +42 -0
  103. package/package.json +11 -6
@@ -3,6 +3,8 @@ import { defineComponent } from "solid-layouts/solid-2/application-boundary";
3
3
  import "./Dialog.css";
4
4
  import { Show, createContext, createSignal, createTrackedEffect, createUniqueId, omit, onCleanup, useContext } from "solid-js";
5
5
  import { twMerge } from "../../lib/twMerge.js";
6
+ import { focusFirst } from "../../lib/focus.js";
7
+ import { lockBodyScroll, registerOverlay } from "../../lib/overlay.js";
6
8
  import "../_shared/material.css";
7
9
  import { CLASSES, componentRecipe } from "./Dialog.recipe.js";
8
10
  var _tmpl$ = /*#__PURE__*/ template("<div>"), _tmpl$2 = /*#__PURE__*/ template("<button>"), _tmpl$3 = /*#__PURE__*/ template("<div><div>"), _tmpl$4 = /*#__PURE__*/ template("<h2>"), _tmpl$5 = /*#__PURE__*/ template('<svg><path d="M18 6L6 18M6 6L18 18"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>');
@@ -13,61 +15,7 @@ const useModalContext = ()=>{
13
15
  return context;
14
16
  };
15
17
  const isVisibleState = (state)=>"entering" === state || "open" === state;
16
- let bodyLockCount = 0;
17
- let previousBodyOverflow = "";
18
- let previousBodyPaddingRight = "";
19
- const lockBodyScroll = ()=>{
20
- if (0 === bodyLockCount) {
21
- previousBodyOverflow = document.body.style.overflow;
22
- previousBodyPaddingRight = document.body.style.paddingRight;
23
- const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
24
- if (scrollbarWidth > 0) document.body.style.paddingRight = `${scrollbarWidth}px`;
25
- document.body.style.overflow = "hidden";
26
- }
27
- bodyLockCount += 1;
28
- };
29
- const unlockBodyScroll = ()=>{
30
- if (bodyLockCount <= 0) return;
31
- bodyLockCount -= 1;
32
- if (0 === bodyLockCount) {
33
- document.body.style.overflow = previousBodyOverflow;
34
- document.body.style.paddingRight = previousBodyPaddingRight;
35
- }
36
- };
37
- const FOCUSABLE_SELECTOR = "a[href],area[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),iframe,object,embed,[contenteditable='true'],[tabindex]:not([tabindex='-1'])";
38
- const getFocusableElements = (container)=>Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter((element)=>{
39
- if (element.hasAttribute("disabled")) return false;
40
- if ("true" === element.getAttribute("aria-hidden")) return false;
41
- if (element.tabIndex < 0) return false;
42
- return !element.hidden;
43
- });
44
- const trapFocus = (event, container)=>{
45
- const focusable = getFocusableElements(container);
46
- if (0 === focusable.length) {
47
- event.preventDefault();
48
- container.focus();
49
- return;
50
- }
51
- const first = focusable[0];
52
- const last = focusable[focusable.length - 1];
53
- const active = document.activeElement;
54
- if (!event.shiftKey && active === last) {
55
- event.preventDefault();
56
- first.focus();
57
- return;
58
- }
59
- if (event.shiftKey && (active === first || active === container)) {
60
- event.preventDefault();
61
- last.focus();
62
- }
63
- };
64
- const focusFirstElement = (container)=>{
65
- const autofocus = container.querySelector("[autofocus]");
66
- if (autofocus) return void autofocus.focus();
67
- const focusable = getFocusableElements(container);
68
- if (focusable.length > 0) return void focusable[0].focus();
69
- container.focus();
70
- };
18
+ const focusFirstElement = focusFirst;
71
19
  const __solidLayoutDialogRoot = (_stable, p)=>{
72
20
  const others = omit(p, "children", "class", "dataTheme", "style", "ref", "open", "defaultOpen", "onOpenChange", "isDismissable", "shouldCloseOnEsc", "shouldCloseOnBackdropClick", "placement", "size", "backdrop", "scrollBehavior");
73
21
  const [internalOpen, setInternalOpen] = createSignal(Boolean(p.defaultOpen));
@@ -107,22 +55,18 @@ const __solidLayoutDialogRoot = (_stable, p)=>{
107
55
  onCleanup(()=>{
108
56
  if (exitTimer) clearTimeout(exitTimer);
109
57
  });
110
- let hasScrollLock = false;
58
+ let releaseScrollLock;
111
59
  createTrackedEffect(()=>{
112
60
  const shouldLock = isVisibleState(animState());
113
- if (shouldLock && !hasScrollLock) {
114
- lockBodyScroll();
115
- hasScrollLock = true;
116
- } else if (!shouldLock && hasScrollLock) {
117
- unlockBodyScroll();
118
- hasScrollLock = false;
61
+ if (shouldLock && !releaseScrollLock) releaseScrollLock = lockBodyScroll();
62
+ else if (!shouldLock && releaseScrollLock) {
63
+ releaseScrollLock();
64
+ releaseScrollLock = void 0;
119
65
  }
120
66
  });
121
67
  onCleanup(()=>{
122
- if (hasScrollLock) {
123
- unlockBodyScroll();
124
- hasScrollLock = false;
125
- }
68
+ releaseScrollLock?.();
69
+ releaseScrollLock = void 0;
126
70
  });
127
71
  let restoreFocusTarget = null;
128
72
  createTrackedEffect(()=>{
@@ -134,20 +78,14 @@ const __solidLayoutDialogRoot = (_stable, p)=>{
134
78
  queueMicrotask(()=>{
135
79
  if (!content.contains(document.activeElement)) focusFirstElement(content);
136
80
  });
137
- const handleDocumentKeyDown = (event)=>{
138
- if (!isVisibleState(animState())) return;
139
- if ("Escape" === event.key) {
140
- if (false !== p.isDismissable && false !== p.shouldCloseOnEsc) {
141
- event.preventDefault();
142
- setIsOpen(false);
143
- }
144
- return;
145
- }
146
- if ("Tab" === event.key) trapFocus(event, content);
147
- };
148
- document.addEventListener("keydown", handleDocumentKeyDown);
81
+ const releaseOverlay = registerOverlay({
82
+ dismissable: ()=>false !== p.isDismissable && false !== p.shouldCloseOnEsc,
83
+ dismiss: ()=>setIsOpen(false),
84
+ element: ()=>contentRef() ?? void 0,
85
+ modal: true
86
+ });
149
87
  return ()=>{
150
- document.removeEventListener("keydown", handleDocumentKeyDown);
88
+ releaseOverlay();
151
89
  };
152
90
  });
153
91
  createTrackedEffect(()=>{
@@ -6,6 +6,4 @@ export type DrawerAnimState = "entering" | "open" | "exiting" | "closed";
6
6
  export type DrawerCloseReason = "escape" | "backdrop" | "trigger" | "api";
7
7
  export declare const isSidePlacement: (placement: DrawerPlacement) => placement is "left" | "right";
8
8
  export declare const isVisibleState: (state: DrawerAnimState) => state is "open" | "entering";
9
- export declare const getFocusable: (container: HTMLElement) => HTMLElement[];
10
- export declare const focusFirst: (container: HTMLElement) => void;
11
- export declare const trapFocus: (event: KeyboardEvent, container: HTMLElement) => void;
9
+ export { focusFirst, getFocusable, trapFocus } from "../../lib/focus";
@@ -1,32 +1,4 @@
1
1
  const isSidePlacement = (placement)=>"left" === placement || "right" === placement;
2
2
  const isVisibleState = (state)=>"entering" === state || "open" === state;
3
- const FOCUSABLE_SELECTOR = "a[href],area[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[contenteditable='true'],[tabindex]:not([tabindex='-1'])";
4
- const getFocusable = (container)=>Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter((el)=>!el.hidden && el.tabIndex >= 0 && "true" !== el.getAttribute("aria-hidden"));
5
- const focusFirst = (container)=>{
6
- const autofocus = container.querySelector("[autofocus]");
7
- if (autofocus) return void autofocus.focus();
8
- const nodes = getFocusable(container);
9
- if (nodes.length > 0) return void nodes[0].focus();
10
- container.focus();
11
- };
12
- const trapFocus = (event, container)=>{
13
- const nodes = getFocusable(container);
14
- if (0 === nodes.length) {
15
- event.preventDefault();
16
- container.focus();
17
- return;
18
- }
19
- const first = nodes[0];
20
- const last = nodes[nodes.length - 1];
21
- const active = document.activeElement;
22
- if (!event.shiftKey && active === last) {
23
- event.preventDefault();
24
- first.focus();
25
- return;
26
- }
27
- if (event.shiftKey && (active === first || active === container)) {
28
- event.preventDefault();
29
- last.focus();
30
- }
31
- };
32
- export { focusFirst, getFocusable, isSidePlacement, isVisibleState, trapFocus };
3
+ export { focusFirst, getFocusable, trapFocus } from "../../lib/focus.js";
4
+ export { isSidePlacement, isVisibleState };
@@ -1,5 +1,6 @@
1
1
  import type { Component as __LayoutComponent } from "solid-js";
2
2
  import "./Drawer.css";
3
+ import { type ValidComponent } from "solid-js";
3
4
  import { type JSX } from "@solidjs/web";
4
5
  import "../_shared/material.css";
5
6
  import type { Material, UIBaseProps } from "../vocabulary";
@@ -22,6 +23,29 @@ export type DrawerRootProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children
22
23
  };
23
24
  export type DrawerTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "children"> & UIBaseProps & {
24
25
  children: JSX.Element;
26
+ /**
27
+ * The component to be the trigger, instead of a bare button.
28
+ *
29
+ * `Drawer.Trigger` renders a `button`, which is right when the trigger is
30
+ * a word or a glyph and wrong when the call site hands it a control:
31
+ * `<Drawer.Trigger><Button>Menu</Button></Drawer.Trigger>` produced a
32
+ * `button` wrapping a `button` at an identical box with an identical name,
33
+ * so every trigger was announced twice and the press by coordinate landed
34
+ * on the outer one rather than on the control that was written. Nested
35
+ * interactive content is also invalid HTML.
36
+ *
37
+ * `as` makes the control *be* the trigger, so there is one element:
38
+ *
39
+ * ```tsx
40
+ * <Drawer.Trigger as={Button} variant="ghost">Menu</Drawer.Trigger>
41
+ * ```
42
+ *
43
+ * The wiring and anything else written here go to the delegate. The
44
+ * trigger's own class is a button reset and is dropped, because a control
45
+ * does not want one; so is `data-slot="drawer-trigger"`, since the
46
+ * delegate's recipe owns that attribute.
47
+ */
48
+ as?: ValidComponent;
25
49
  };
26
50
  export type DrawerBackdropProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & UIBaseProps & {
27
51
  children: JSX.Element;
@@ -1,34 +1,14 @@
1
- import { Portal, className, createComponent, delegateEvents, effect, insert, memo, mergeProps, ref, spread, template } from "@solidjs/web";
1
+ import { Dynamic, Portal, className, createComponent, delegateEvents, effect, insert, memo, mergeProps, ref, spread, template } from "@solidjs/web";
2
2
  import { defineComponent } from "solid-layouts/solid-2/application-boundary";
3
3
  import "./Drawer.css";
4
4
  import { Show, createSignal, createTrackedEffect, createUniqueId, omit, onCleanup } from "solid-js";
5
5
  import { twMerge } from "../../lib/twMerge.js";
6
+ import { lockBodyScroll, registerOverlay } from "../../lib/overlay.js";
6
7
  import "../_shared/material.css";
7
- import { focusFirst, isSidePlacement, isVisibleState, trapFocus } from "./Drawer.a11y.js";
8
+ import { focusFirst, isSidePlacement, isVisibleState } from "./Drawer.a11y.js";
8
9
  import { CLASSES, componentRecipe } from "./Drawer.recipe.js";
9
10
  import { DrawerContext, useDrawerContext } from "./Drawer.context.js";
10
11
  var _tmpl$ = /*#__PURE__*/ template("<div>"), _tmpl$2 = /*#__PURE__*/ template("<button>"), _tmpl$3 = /*#__PURE__*/ template("<h2>"), _tmpl$4 = /*#__PURE__*/ template("<div><div data-slot=drawer-handle-bar>"), _tmpl$5 = /*#__PURE__*/ template("<button><!><!><!>"), _tmpl$6 = /*#__PURE__*/ template("<span>"), _tmpl$7 = /*#__PURE__*/ template("<span data-slot=drawer-close>");
11
- let bodyLockCount = 0;
12
- let prevBodyOverflow = "";
13
- let prevBodyPaddingRight = "";
14
- const lockBodyScroll = ()=>{
15
- if (0 === bodyLockCount) {
16
- prevBodyOverflow = document.body.style.overflow;
17
- prevBodyPaddingRight = document.body.style.paddingRight;
18
- const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
19
- if (scrollbarWidth > 0) document.body.style.paddingRight = `${scrollbarWidth}px`;
20
- document.body.style.overflow = "hidden";
21
- }
22
- bodyLockCount += 1;
23
- };
24
- const unlockBodyScroll = ()=>{
25
- if (bodyLockCount <= 0) return;
26
- bodyLockCount -= 1;
27
- if (0 === bodyLockCount) {
28
- document.body.style.overflow = prevBodyOverflow;
29
- document.body.style.paddingRight = prevBodyPaddingRight;
30
- }
31
- };
32
12
  const EXIT_MS = 200;
33
13
  const __solidLayoutDrawerRoot = (_stable, p)=>{
34
14
  const others = omit(p, "children", "class", "dataTheme", "style", "open", "defaultOpen", "onOpenChange", "placement", "size", "backdrop", "scrollBehavior", "isDismissable", "shouldCloseOnEsc", "shouldCloseOnBackdropClick", "trapFocus", "restoreFocus");
@@ -87,19 +67,18 @@ const __solidLayoutDrawerRoot = (_stable, p)=>{
87
67
  onCleanup(()=>{
88
68
  if (exitTimer) clearTimeout(exitTimer);
89
69
  });
90
- let hasScrollLock = false;
70
+ let releaseScrollLock;
91
71
  createTrackedEffect(()=>{
92
72
  const visible = isVisibleState(animState());
93
- if (visible && !hasScrollLock) {
94
- lockBodyScroll();
95
- hasScrollLock = true;
96
- } else if (!visible && hasScrollLock) {
97
- unlockBodyScroll();
98
- hasScrollLock = false;
73
+ if (visible && !releaseScrollLock) releaseScrollLock = lockBodyScroll();
74
+ else if (!visible && releaseScrollLock) {
75
+ releaseScrollLock();
76
+ releaseScrollLock = void 0;
99
77
  }
100
78
  });
101
79
  onCleanup(()=>{
102
- if (hasScrollLock) unlockBodyScroll();
80
+ releaseScrollLock?.();
81
+ releaseScrollLock = void 0;
103
82
  });
104
83
  let restoreFocusTarget = null;
105
84
  createTrackedEffect(()=>{
@@ -113,17 +92,15 @@ const __solidLayoutDrawerRoot = (_stable, p)=>{
113
92
  queueMicrotask(()=>{
114
93
  if (trapFocusEnabled() && !dialog.contains(document.activeElement)) focusFirst(dialog);
115
94
  });
116
- const onKeyDown = (event)=>{
117
- if (!isVisibleState(animState())) return;
118
- if ("Escape" === event.key) {
119
- event.preventDefault();
120
- requestClose("escape");
121
- return;
122
- }
123
- if ("Tab" === event.key && trapFocusEnabled()) trapFocus(event, dialog);
95
+ const releaseOverlay = registerOverlay({
96
+ dismissable: ()=>isDismissable() && shouldCloseOnEsc(),
97
+ dismiss: ()=>requestClose("escape"),
98
+ element: ()=>dialog,
99
+ modal: trapFocusEnabled()
100
+ });
101
+ return ()=>{
102
+ releaseOverlay();
124
103
  };
125
- document.addEventListener("keydown", onKeyDown);
126
- return ()=>document.removeEventListener("keydown", onKeyDown);
127
104
  });
128
105
  createTrackedEffect(()=>{
129
106
  if ("closed" !== animState() || !restoreFocusEnabled()) return;
@@ -202,36 +179,66 @@ const DrawerRoot = defineComponent({
202
179
  ]
203
180
  });
204
181
  const __solidLayoutDrawerTrigger = (_stable, p)=>{
205
- const others = omit(p, "children", "class", "dataTheme", "style", "onClick");
182
+ const others = omit(p, "children", "class", "dataTheme", "style", "onClick", "as");
206
183
  const ctx = useDrawerContext();
207
184
  const handleClick = (event)=>{
208
185
  ctx.setIsOpen(true);
209
186
  if ("function" == typeof p.onClick) p.onClick(event);
210
187
  };
211
- var _el$2 = _tmpl$2();
212
- spread(_el$2, mergeProps(others, {
213
- type: "button",
214
- get ["class"] () {
215
- return twMerge(CLASSES.Trigger.base, p.class);
216
- },
217
- "data-slot": "drawer-trigger",
218
- get ["data-theme"] () {
219
- return p.dataTheme;
188
+ return createComponent(Show, {
189
+ get when () {
190
+ return p.as;
220
191
  },
221
- get style () {
222
- return p.style;
192
+ get fallback () {
193
+ var _el$2 = _tmpl$2();
194
+ spread(_el$2, mergeProps(others, {
195
+ type: "button",
196
+ get ["class"] () {
197
+ return twMerge(CLASSES.Trigger.base, p.class);
198
+ },
199
+ "data-slot": "drawer-trigger",
200
+ get ["data-theme"] () {
201
+ return p.dataTheme;
202
+ },
203
+ get style () {
204
+ return p.style;
205
+ },
206
+ onClick: handleClick
207
+ }), true);
208
+ insert(_el$2, ()=>p.children);
209
+ return _el$2;
223
210
  },
224
- onClick: handleClick
225
- }), true);
226
- insert(_el$2, ()=>p.children);
227
- return _el$2;
211
+ get children () {
212
+ return createComponent(Dynamic, mergeProps({
213
+ get component () {
214
+ return p.as;
215
+ }
216
+ }, others, {
217
+ type: "button",
218
+ get ["class"] () {
219
+ return p.class;
220
+ },
221
+ get ["data-theme"] () {
222
+ return p.dataTheme;
223
+ },
224
+ get style () {
225
+ return p.style;
226
+ },
227
+ onClick: handleClick,
228
+ get children () {
229
+ return p.children;
230
+ }
231
+ }));
232
+ }
233
+ });
228
234
  };
229
235
  const DrawerTrigger = defineComponent({
230
236
  recipe: componentRecipe,
231
237
  layout: __solidLayoutDrawerTrigger,
232
238
  embedded: true,
233
239
  behaviour: [
234
- "children"
240
+ "children",
241
+ "as"
235
242
  ]
236
243
  });
237
244
  const __solidLayoutDrawerContent = (_stable, p)=>{
@@ -1,7 +1,7 @@
1
1
  import { Dynamic, createComponent, mergeProps } from "@solidjs/web";
2
2
  import { defineComponent } from "solid-layouts/solid-2/application-boundary";
3
3
  import "./Grid.css";
4
- import { children, merge, omit } from "solid-js";
4
+ import { children, createMemo, merge, omit } from "solid-js";
5
5
  import { twMerge } from "../../lib/twMerge.js";
6
6
  import clsx from "clsx";
7
7
  import { mapResponsiveProp } from "../utils.js";
@@ -12,13 +12,13 @@ const __solidLayoutGrid = (_stable, p)=>{
12
12
  }, p);
13
13
  const rest = omit(merged, "as", "class", "children", "cols", "rows", "flow", "gap", "autoCols", "autoRows");
14
14
  const resolvedChildren = children(()=>merged.children);
15
- const classes = clsx(CLASSES.base, mapResponsiveProp(merged.cols, CLASSES.cols), mapResponsiveProp(merged.rows, CLASSES.rows), mapResponsiveProp(merged.flow, CLASSES.flow), mapResponsiveProp(merged.gap, CLASSES.gap), mapResponsiveProp(merged.autoCols, CLASSES.autoCols), mapResponsiveProp(merged.autoRows, CLASSES.autoRows), merged.class);
15
+ const classes = createMemo(()=>clsx(CLASSES.base, mapResponsiveProp(merged.cols, CLASSES.cols), mapResponsiveProp(merged.rows, CLASSES.rows), mapResponsiveProp(merged.flow, CLASSES.flow), mapResponsiveProp(merged.gap, CLASSES.gap), mapResponsiveProp(merged.autoCols, CLASSES.autoCols), mapResponsiveProp(merged.autoRows, CLASSES.autoRows), merged.class));
16
16
  return createComponent(Dynamic, mergeProps({
17
17
  get component () {
18
18
  return merged.as;
19
19
  }
20
20
  }, ()=>({
21
- class: twMerge(classes)
21
+ class: twMerge(classes())
22
22
  }), rest, {
23
23
  get children () {
24
24
  return resolvedChildren();
@@ -19,5 +19,20 @@ export type IconProps = UIBaseProps & {
19
19
  width?: number;
20
20
  height?: number;
21
21
  flavor?: Flavor;
22
+ /**
23
+ * What this icon means, for an icon that carries meaning on its own.
24
+ *
25
+ * Most icons sit beside a label that already says it, and repeating it makes
26
+ * a reader hear the same thing twice; those stay hidden, which is the
27
+ * default and stays the default. The ones that need this are the icons that
28
+ * *are* the label: a status glyph in a table cell, a lone mark in a square
29
+ * button, a trend arrow next to a bare number.
30
+ *
31
+ * Setting it swaps `aria-hidden="true"` for `role="img"` and this name. The
32
+ * default was right and there was simply no way off it: `aria-hidden` was
33
+ * written straight into the markup, so it survived any `aria-label` a call
34
+ * site passed through and the icon stayed out of the tree regardless.
35
+ */
36
+ label?: string;
22
37
  };
23
38
  export declare const IconLayout: __LayoutComponent<IconProps>;
@@ -21,7 +21,15 @@ const __solidLayoutIconLayout = (_stable, p)=>(()=>{
21
21
  get ["data-source"] () {
22
22
  return "string" == typeof p.src ? "preload" : "svg";
23
23
  },
24
- "aria-hidden": "true"
24
+ get role () {
25
+ return p.label ? "img" : void 0;
26
+ },
27
+ get ["aria-label"] () {
28
+ return p.label;
29
+ },
30
+ get ["aria-hidden"] () {
31
+ return p.label ? void 0 : "true";
32
+ }
25
33
  }), true);
26
34
  insert(_el$, createComponent(Show, {
27
35
  get when () {
@@ -53,7 +61,8 @@ const IconLayout = defineComponent({
53
61
  "src",
54
62
  "width",
55
63
  "height",
56
- "flavor"
64
+ "flavor",
65
+ "label"
57
66
  ]
58
67
  });
59
68
  export { IconLayout };
@@ -358,7 +358,7 @@
358
358
  .immersive-landing-cookie__manage-button {
359
359
  border: 0;
360
360
  background: transparent;
361
- color: color-mix(in oklab, var(--color-base-content) 70%, transparent);
361
+ color: var(--color-base-content);
362
362
  font-size: 0.875rem;
363
363
  text-decoration: underline;
364
364
  cursor: pointer;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Whether a press on the preferences backdrop should dismiss the dialog.
3
+ *
4
+ * The backdrop closes the dialog and is an ancestor of the panel, so every
5
+ * press inside the panel reaches it too. The panel guarded itself the usual
6
+ * way, with `stopPropagation()` on its own click handler, and that guard does
7
+ * not hold in the browser engine the fleet ships: `stopPropagation` is defined
8
+ * there, but event dispatch is deferred, so the host has finished propagating
9
+ * before it calls into the page and the call is a no-op. The engine expresses
10
+ * the same intent as a flag fixed when the listener is registered, which means
11
+ * no runtime call can ever express it. Measured on two sites: pressing
12
+ * Analytics or Marketing closed the whole dialog, so no category could be
13
+ * changed at all.
14
+ *
15
+ * Comparing the press target against the element the handler is bound to needs
16
+ * nothing from the engine beyond the two properties every event already
17
+ * carries. A press that started inside the panel reports the panel, or
18
+ * something under it, as its target, and only a press that landed on the
19
+ * backdrop itself reports the backdrop.
20
+ */
21
+ export declare const dismissesOnBackdropPress: (event: {
22
+ target: EventTarget | null;
23
+ currentTarget: EventTarget | null;
24
+ }) => boolean;
@@ -0,0 +1,2 @@
1
+ const dismissesOnBackdropPress = (event)=>event.target === event.currentTarget;
2
+ export { dismissesOnBackdropPress };