@ada-cx/lovelace 1.4.0 → 1.6.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 (64) hide show
  1. package/dist/components/Banner/Banner.css.d.ts +1 -0
  2. package/dist/components/Banner/Banner.css.js +7 -0
  3. package/dist/components/Banner/Banner.css.js.map +1 -0
  4. package/dist/components/Banner/Banner.d.ts +51 -0
  5. package/dist/components/Banner/Banner.js +25 -0
  6. package/dist/components/Banner/Banner.js.map +1 -0
  7. package/dist/components/Banner/BannerSurface.d.ts +17 -0
  8. package/dist/components/Banner/BannerSurface.js +65 -0
  9. package/dist/components/Banner/BannerSurface.js.map +1 -0
  10. package/dist/components/Banner/index.d.ts +1 -0
  11. package/dist/components/BubbleOverlay/BubbleOverlay.js +21 -20
  12. package/dist/components/BubbleOverlay/BubbleOverlay.js.map +1 -1
  13. package/dist/components/Checkbox/Checkbox.css.d.ts +1 -0
  14. package/dist/components/Checkbox/Checkbox.css.js +6 -6
  15. package/dist/components/Checkbox/Checkbox.css.js.map +1 -1
  16. package/dist/components/Checkbox/CheckboxGroup.d.ts +15 -0
  17. package/dist/components/Checkbox/CheckboxGroup.js +16 -0
  18. package/dist/components/Checkbox/CheckboxGroup.js.map +1 -0
  19. package/dist/components/Checkbox/index.d.ts +1 -0
  20. package/dist/components/Dialog/DialogIcon.js +5 -5
  21. package/dist/components/DialogOverlay/DialogOverlay.js +23 -22
  22. package/dist/components/DialogOverlay/DialogOverlay.js.map +1 -1
  23. package/dist/components/FullscreenOverlay/FullscreenOverlay.js +21 -20
  24. package/dist/components/FullscreenOverlay/FullscreenOverlay.js.map +1 -1
  25. package/dist/components/Input/InputRoot.js +4 -4
  26. package/dist/components/Input/InputTextArea.js +7 -7
  27. package/dist/components/MenuItem/MenuItemRoot.js +9 -9
  28. package/dist/components/SheetOverlay/SheetOverlay.js +22 -21
  29. package/dist/components/SheetOverlay/SheetOverlay.js.map +1 -1
  30. package/dist/components/ToastNotification/ToastNotification.css.d.ts +1 -14
  31. package/dist/components/ToastNotification/ToastNotification.css.js +1 -9
  32. package/dist/components/ToastNotification/ToastNotification.css.js.map +1 -1
  33. package/dist/components/ToastNotification/ToastNotification.d.ts +30 -11
  34. package/dist/components/ToastNotification/ToastNotification.js +29 -18
  35. package/dist/components/ToastNotification/ToastNotification.js.map +1 -1
  36. package/dist/components/ToastNotification/index.d.ts +1 -1
  37. package/dist/components/ToastRegion/ToastContent.d.ts +9 -0
  38. package/dist/components/ToastRegion/ToastRegion.css.d.ts +2 -0
  39. package/dist/components/ToastRegion/ToastRegion.css.js +7 -0
  40. package/dist/components/ToastRegion/ToastRegion.css.js.map +1 -0
  41. package/dist/components/ToastRegion/ToastRegion.d.ts +45 -0
  42. package/dist/components/ToastRegion/ToastRegion.js +38 -0
  43. package/dist/components/ToastRegion/ToastRegion.js.map +1 -0
  44. package/dist/components/ToastRegion/ToastRegionItem.d.ts +13 -0
  45. package/dist/components/ToastRegion/ToastRegionItem.js +49 -0
  46. package/dist/components/ToastRegion/ToastRegionItem.js.map +1 -0
  47. package/dist/components/ToastRegion/ToastRegionLandmark.d.ts +15 -0
  48. package/dist/components/ToastRegion/ToastRegionLandmark.js +62 -0
  49. package/dist/components/ToastRegion/ToastRegionLandmark.js.map +1 -0
  50. package/dist/components/ToastRegion/index.d.ts +4 -0
  51. package/dist/components/ToastRegion/index.js +3 -0
  52. package/dist/components/Tooltip/Tooltip.js +8 -8
  53. package/dist/hooks/index.d.ts +1 -0
  54. package/dist/hooks/overlayRegistry.d.ts +22 -0
  55. package/dist/hooks/overlayRegistry.js +32 -0
  56. package/dist/hooks/overlayRegistry.js.map +1 -0
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.js +77 -72
  59. package/dist/runtime/LovelaceProvider.js +12 -12
  60. package/dist/style.css +1 -1
  61. package/dist/utils/animation.d.ts +28 -0
  62. package/dist/utils/animation.js +68 -0
  63. package/dist/utils/animation.js.map +1 -0
  64. package/package.json +3 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastRegionLandmark.js","names":[],"sources":["../../../src/components/ToastRegion/ToastRegionLandmark.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport { useEffect, useRef } from \"react\";\nimport {\n\tmergeProps,\n\tuseFocusWithin,\n\tuseHover,\n\tuseToastRegion,\n} from \"react-aria\";\nimport type { QueuedToast, ToastState } from \"react-stately\";\nimport { cx } from \"../../utils/cx.js\";\nimport type { ToastContent } from \"./ToastContent.js\";\nimport { toastRegion } from \"./ToastRegion.css.js\";\nimport { ToastRegionItem } from \"./ToastRegionItem.js\";\n\nexport interface ToastRegionLandmarkProps {\n\t\"aria-label\"?: string;\n\tstate: ToastState<ToastContent>;\n\t/** Visible toasts followed by any still playing their exit animation. */\n\ttoasts: QueuedToast<ToastContent>[];\n\t/** Keys of the leaving toasts that held the top of the region. */\n\tleavingFromTop: Set<string>;\n\tonExited: (key: string) => void;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n}\n\nexport function ToastRegionLandmark({\n\tstate,\n\ttoasts,\n\tleavingFromTop,\n\tonExited,\n\tclassName,\n\tstyle,\n\t...props\n}: ToastRegionLandmarkProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst { regionProps } = useToastRegion(props, state, ref);\n\n\t// `useToastRegion` only pauses on a hover or focus change, while a toast starts\n\t// its own countdown as it mounts. A toast that takes the slot while the reader\n\t// is already on the region would therefore run down under them, since nothing\n\t// enters or leaves to trigger that pause — and on a one-slot surface that is\n\t// the ordinary path, not an edge case.\n\t//\n\t// Hover and focus are tracked apart: leaving one while the other still holds\n\t// is not the reader letting go.\n\tconst isHovered = useRef(false);\n\tconst isFocused = useRef(false);\n\tconst { hoverProps } = useHover({\n\t\tonHoverStart: () => {\n\t\t\tisHovered.current = true;\n\t\t},\n\t\tonHoverEnd: () => {\n\t\t\tisHovered.current = false;\n\t\t},\n\t});\n\tconst { focusWithinProps } = useFocusWithin({\n\t\tonFocusWithin: () => {\n\t\t\tisFocused.current = true;\n\t\t},\n\t\tonBlurWithin: () => {\n\t\t\tisFocused.current = false;\n\t\t},\n\t});\n\tconst stateRef = useRef(state);\n\tstateRef.current = state;\n\tconst { visibleToasts } = state;\n\tuseEffect(() => {\n\t\tif (visibleToasts.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst element = ref.current;\n\t\t// The landmark unmounts whenever the slot empties, so a pointer resting\n\t\t// where the next toast lands has no enter event left to report itself with.\n\t\t// The browser keeps `:hover` current across that, so ask the element.\n\t\tconst isUnderPointer = element?.matches(\":hover\") ?? false;\n\t\tif (!(isHovered.current || isFocused.current || isUnderPointer)) {\n\t\t\treturn;\n\t\t}\n\t\tstateRef.current.pauseAll();\n\n\t\t// The pause has to release itself. `useToastRegion` resumes only from its own\n\t\t// hover and focus callbacks, and `useHover` reports no hover end for a pointer\n\t\t// it never saw arrive — or for a touch pointer, which it ignores in both\n\t\t// directions. Without this the countdown never restarts, so the toast holds\n\t\t// the slot for good and the consumer never hears it close.\n\t\tconst stop = () => {\n\t\t\tdocument.removeEventListener(\"pointerover\", onPointerOver, true);\n\t\t\tdocument.removeEventListener(\"pointerout\", onPointerOut, true);\n\t\t\twindow.removeEventListener(\"blur\", onWindowBlur);\n\t\t};\n\t\tconst release = () => {\n\t\t\tif (isFocused.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstateRef.current.resumeAll();\n\t\t\tstop();\n\t\t};\n\t\tconst onPointerOver = (event: PointerEvent) => {\n\t\t\tconst target = event.target;\n\t\t\tif (element && target instanceof Node && element.contains(target)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trelease();\n\t\t};\n\t\t// A pointer that leaves the document reports no further `pointerover`, so\n\t\t// watching that alone leaves the countdown paused for good. Leaving the\n\t\t// document is a null `relatedTarget`; leaving the frame entirely is the blur.\n\t\tconst onPointerOut = (event: PointerEvent) => {\n\t\t\tif (event.relatedTarget === null) {\n\t\t\t\trelease();\n\t\t\t}\n\t\t};\n\t\tconst onWindowBlur = () => release();\n\t\tdocument.addEventListener(\"pointerover\", onPointerOver, true);\n\t\tdocument.addEventListener(\"pointerout\", onPointerOut, true);\n\t\twindow.addEventListener(\"blur\", onWindowBlur);\n\t\treturn stop;\n\t}, [visibleToasts]);\n\n\treturn (\n\t\t<div\n\t\t\t{...mergeProps(regionProps, hoverProps, focusWithinProps)}\n\t\t\tref={ref}\n\t\t\tclassName={cx(toastRegion, className)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{toasts.map((toast) => {\n\t\t\t\tconst isPresent = state.visibleToasts.some(\n\t\t\t\t\t(visible) => visible.key === toast.key,\n\t\t\t\t);\n\t\t\t\treturn (\n\t\t\t\t\t<ToastRegionItem\n\t\t\t\t\t\tkey={toast.key}\n\t\t\t\t\t\ttoast={toast}\n\t\t\t\t\t\tstate={state}\n\t\t\t\t\t\tisPresent={isPresent}\n\t\t\t\t\t\t// A toast leaving the top while another is on screen is the slot\n\t\t\t\t\t\t// changing message, so the two slide past each other rather than\n\t\t\t\t\t\t// each animating alone. The motion takes the leaving one out of\n\t\t\t\t\t\t// flow at the region's top, so it is only right for a toast that\n\t\t\t\t\t\t// sat there — one leaving from deeper in a stack stays in flow and\n\t\t\t\t\t\t// lets the stack close over it.\n\t\t\t\t\t\tisReplacing={\n\t\t\t\t\t\t\t!isPresent &&\n\t\t\t\t\t\t\tleavingFromTop.has(toast.key) &&\n\t\t\t\t\t\t\tstate.visibleToasts.length > 0\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonExited={onExited}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AA0BA,SAAgB,EAAoB,EACnC,UACA,WACA,mBACA,aACA,cACA,UACA,GAAG,KACyB;CAC5B,IAAM,IAAM,EAAuB,KAAK,EAClC,EAAE,mBAAgB,EAAe,GAAO,GAAO,EAAI,EAUnD,IAAY,EAAO,GAAM,EACzB,IAAY,EAAO,GAAM,EACzB,EAAE,kBAAe,EAAS;EAC/B,oBAAoB;AACnB,KAAU,UAAU;;EAErB,kBAAkB;AACjB,KAAU,UAAU;;EAErB,CAAC,EACI,EAAE,wBAAqB,EAAe;EAC3C,qBAAqB;AACpB,KAAU,UAAU;;EAErB,oBAAoB;AACnB,KAAU,UAAU;;EAErB,CAAC,EACI,IAAW,EAAO,EAAM;AAC9B,GAAS,UAAU;CACnB,IAAM,EAAE,qBAAkB;AAsD1B,QArDA,QAAgB;AACf,MAAI,EAAc,WAAW,EAC5B;EAED,IAAM,IAAU,EAAI,SAId,IAAiB,GAAS,QAAQ,SAAS,IAAI;AACrD,MAAI,EAAE,EAAU,WAAW,EAAU,WAAW,GAC/C;AAED,IAAS,QAAQ,UAAU;EAO3B,IAAM,UAAa;AAGlB,GAFA,SAAS,oBAAoB,eAAe,GAAe,GAAK,EAChE,SAAS,oBAAoB,cAAc,GAAc,GAAK,EAC9D,OAAO,oBAAoB,QAAQ,EAAa;KAE3C,UAAgB;AACjB,KAAU,YAGd,EAAS,QAAQ,WAAW,EAC5B,GAAM;KAED,KAAiB,MAAwB;GAC9C,IAAM,IAAS,EAAM;AACjB,QAAW,aAAkB,QAAQ,EAAQ,SAAS,EAAO,IAGjE,GAAS;KAKJ,KAAgB,MAAwB;AAC7C,GAAI,EAAM,kBAAkB,QAC3B,GAAS;KAGL,UAAqB,GAAS;AAIpC,SAHA,SAAS,iBAAiB,eAAe,GAAe,GAAK,EAC7D,SAAS,iBAAiB,cAAc,GAAc,GAAK,EAC3D,OAAO,iBAAiB,QAAQ,EAAa,EACtC;IACL,CAAC,EAAc,CAAC,EAGlB,kBAAC,OAAD;EACC,GAAI,EAAW,GAAa,GAAY,EAAiB;EACpD;EACL,WAAW,EAAG,GAAa,EAAU;EAC9B;YAEN,EAAO,KAAK,MAAU;GACtB,IAAM,IAAY,EAAM,cAAc,MACpC,MAAY,EAAQ,QAAQ,EAAM,IACnC;AACD,UACC,kBAAC,GAAD;IAEQ;IACA;IACI;IAOX,aACC,CAAC,KACD,EAAe,IAAI,EAAM,IAAI,IAC7B,EAAM,cAAc,SAAS;IAEpB;IACT,EAhBI,EAAM,IAgBV;IAEF;EACG,CAAA"}
@@ -0,0 +1,4 @@
1
+ export type { ToastOptions } from "react-stately";
2
+ export { ToastQueue } from "react-stately";
3
+ export type { ToastContent } from "./ToastContent.js";
4
+ export { ToastRegion, type ToastRegionProps } from "./ToastRegion.js";
@@ -0,0 +1,3 @@
1
+ import "./ToastRegion.js";
2
+ import { ToastQueue as e } from "react-stately";
3
+ export { e as ToastQueue };
@@ -1,19 +1,19 @@
1
1
  import { cx as e } from "../../utils/cx.js";
2
2
  import { arrow as t, arrowSvg as n, tooltip as r } from "./Tooltip.css.js";
3
3
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
- import { useLocale as o } from "react-aria";
5
- import { OverlayArrow as s, Tooltip as c, TooltipTrigger as l } from "react-aria-components";
4
+ import { OverlayArrow as o, Tooltip as s, TooltipTrigger as c } from "react-aria-components";
5
+ import { useLocale as l } from "react-aria";
6
6
  //#region src/components/Tooltip/Tooltip.tsx
7
- function u({ placement: l = "top", offset: u = 6, className: d, style: f, children: p, ...m }) {
8
- let { direction: h } = o();
9
- return /* @__PURE__ */ a(c, {
7
+ function u({ placement: c = "top", offset: u = 6, className: d, style: f, children: p, ...m }) {
8
+ let { direction: h } = l();
9
+ return /* @__PURE__ */ a(s, {
10
10
  ...m,
11
- placement: l,
11
+ placement: c,
12
12
  offset: u,
13
13
  className: e(r, d),
14
14
  style: f,
15
15
  dir: h,
16
- children: [/* @__PURE__ */ i(s, {
16
+ children: [/* @__PURE__ */ i(o, {
17
17
  className: t,
18
18
  children: /* @__PURE__ */ i("svg", {
19
19
  className: n,
@@ -27,6 +27,6 @@ function u({ placement: l = "top", offset: u = 6, className: d, style: f, childr
27
27
  });
28
28
  }
29
29
  //#endregion
30
- export { u as Tooltip, l as TooltipTrigger };
30
+ export { u as Tooltip, c as TooltipTrigger };
31
31
 
32
32
  //# sourceMappingURL=Tooltip.js.map
@@ -1,2 +1,3 @@
1
+ export { useRegisterOverlay } from "./overlayRegistry.js";
1
2
  export { readPrefersReducedMotion, usePrefersReducedMotion, } from "./usePrefersReducedMotion.js";
2
3
  export { useSubmitOnEnter } from "./useSubmitOnEnter.js";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Counts one modal overlay as open for as long as the calling component is
3
+ * mounted, so a surface underneath can stand down while it is.
4
+ *
5
+ * Call it from a component rendered **inside** the overlay, not from the one that
6
+ * renders the overlay. RAC mounts an overlay's children for exactly the window the
7
+ * scrim is on screen, which includes its exit transition — keying off an `isOpen`
8
+ * prop instead releases the count while the scrim is still painted and still
9
+ * blocking the pointer. `OverlayRegistration` is that component; render one inside
10
+ * any `ModalOverlay` this package does not already wrap.
11
+ */
12
+ export declare function useRegisterOverlay(): void;
13
+ /** Registers its overlay for as long as it is rendered. Renders nothing. */
14
+ export declare function OverlayRegistration(): null;
15
+ /**
16
+ * Whether any modal overlay is open.
17
+ *
18
+ * For a surface that has to stand down while one is: an overlay traps focus and
19
+ * paints over everything below it, so anything left underneath is unreachable by
20
+ * pointer while still being announced and focusable.
21
+ */
22
+ export declare function useHasOpenOverlay(): boolean;
@@ -0,0 +1,32 @@
1
+ import { useLayoutEffect as e, useSyncExternalStore as t } from "react";
2
+ //#region src/hooks/overlayRegistry.tsx
3
+ var n = 0, r = /* @__PURE__ */ new Set();
4
+ function i(e) {
5
+ return r.add(e), () => {
6
+ r.delete(e);
7
+ };
8
+ }
9
+ function a() {
10
+ return n > 0;
11
+ }
12
+ function o() {
13
+ return !1;
14
+ }
15
+ function s() {
16
+ for (let e of r) e();
17
+ }
18
+ function c() {
19
+ e(() => (n += 1, s(), () => {
20
+ --n, s();
21
+ }), []);
22
+ }
23
+ function l() {
24
+ return c(), null;
25
+ }
26
+ function u() {
27
+ return t(i, a, o);
28
+ }
29
+ //#endregion
30
+ export { l as OverlayRegistration, u as useHasOpenOverlay, c as useRegisterOverlay };
31
+
32
+ //# sourceMappingURL=overlayRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlayRegistry.js","names":[],"sources":["../../src/hooks/overlayRegistry.tsx"],"sourcesContent":["import { useLayoutEffect, useSyncExternalStore } from \"react\";\n\n/**\n * How many modal overlays are mounted right now.\n *\n * Module-level because the reader is not an ancestor of the overlays: the toast\n * region sits in the consumer's chrome while every overlay renders through a\n * portal, so there is no shared provider to hang this on that a consumer could\n * not forget to mount.\n */\nlet openOverlays = 0;\nconst subscribers = new Set<() => void>();\n\nfunction subscribe(onStoreChange: () => void): () => void {\n\tsubscribers.add(onStoreChange);\n\treturn () => {\n\t\tsubscribers.delete(onStoreChange);\n\t};\n}\n\nfunction getSnapshot(): boolean {\n\treturn openOverlays > 0;\n}\n\nfunction getServerSnapshot(): boolean {\n\treturn false;\n}\n\nfunction publish(): void {\n\tfor (const onStoreChange of subscribers) {\n\t\tonStoreChange();\n\t}\n}\n\n/**\n * Counts one modal overlay as open for as long as the calling component is\n * mounted, so a surface underneath can stand down while it is.\n *\n * Call it from a component rendered **inside** the overlay, not from the one that\n * renders the overlay. RAC mounts an overlay's children for exactly the window the\n * scrim is on screen, which includes its exit transition — keying off an `isOpen`\n * prop instead releases the count while the scrim is still painted and still\n * blocking the pointer. `OverlayRegistration` is that component; render one inside\n * any `ModalOverlay` this package does not already wrap.\n */\nexport function useRegisterOverlay(): void {\n\t// Layout, not passive: a passive effect runs after the commit is painted, so\n\t// the frame that puts the scrim up would also show whatever was standing down\n\t// underneath it, and a toast mounted for that frame announces itself.\n\tuseLayoutEffect(() => {\n\t\topenOverlays += 1;\n\t\tpublish();\n\t\treturn () => {\n\t\t\topenOverlays -= 1;\n\t\t\tpublish();\n\t\t};\n\t}, []);\n}\n\n/** Registers its overlay for as long as it is rendered. Renders nothing. */\nexport function OverlayRegistration(): null {\n\tuseRegisterOverlay();\n\treturn null;\n}\n\n/**\n * Whether any modal overlay is open.\n *\n * For a surface that has to stand down while one is: an overlay traps focus and\n * paints over everything below it, so anything left underneath is unreachable by\n * pointer while still being announced and focusable.\n */\nexport function useHasOpenOverlay(): boolean {\n\treturn useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"mappings":";;AAUA,IAAI,IAAe,GACb,oBAAc,IAAI,KAAiB;AAEzC,SAAS,EAAU,GAAuC;AAEzD,QADA,EAAY,IAAI,EAAc,QACjB;AACZ,IAAY,OAAO,EAAc;;;AAInC,SAAS,IAAuB;AAC/B,QAAO,IAAe;;AAGvB,SAAS,IAA6B;AACrC,QAAO;;AAGR,SAAS,IAAgB;AACxB,MAAK,IAAM,KAAiB,EAC3B,IAAe;;AAejB,SAAgB,IAA2B;AAI1C,UACC,KAAgB,GAChB,GAAS,QACI;AAEZ,EADA,KACA,GAAS;KAER,EAAE,CAAC;;AAIP,SAAgB,IAA4B;AAE3C,QADA,GAAoB,EACb;;AAUR,SAAgB,IAA6B;AAC5C,QAAO,EAAqB,GAAW,GAAa,EAAkB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./components/AgentMessage/index.js";
2
2
  export * from "./components/Avatar/index.js";
3
+ export * from "./components/Banner/index.js";
3
4
  export * from "./components/BubbleOverlay/index.js";
4
5
  export * from "./components/Button/index.js";
5
6
  export * from "./components/Checkbox/index.js";
@@ -26,6 +27,7 @@ export * from "./components/Spinner/index.js";
26
27
  export * from "./components/Survey/index.js";
27
28
  export * from "./components/ThinkingShimmer/index.js";
28
29
  export * from "./components/ToastNotification/index.js";
30
+ export * from "./components/ToastRegion/index.js";
29
31
  export * from "./components/Toggle/index.js";
30
32
  export * from "./components/Tooltip/index.js";
31
33
  export * from "./components/TypingIndicator/index.js";
package/dist/index.js CHANGED
@@ -1,75 +1,80 @@
1
1
  import { AvatarPlaceholder as e } from "./components/Avatar/AvatarPlaceholder.js";
2
2
  import { Avatar as t } from "./components/Avatar/Avatar.js";
3
3
  import { AgentMessage as n } from "./components/AgentMessage/AgentMessage.js";
4
- import { BubbleOverlay as r } from "./components/BubbleOverlay/BubbleOverlay.js";
5
- import { Button as i } from "./components/Button/Button.js";
6
- import { Checkbox as a } from "./components/Checkbox/Checkbox.js";
7
- import { Chip as o } from "./components/Chip/Chip.js";
8
- import { Icon as s } from "./components/Icon/Icon.js";
9
- import { Checkmark as c } from "./components/Icon/icons/Checkmark.js";
10
- import { ExclamationTriangle as l } from "./components/Icon/icons/ExclamationTriangle.js";
11
- import { Dialog as u } from "./components/Dialog/Dialog.js";
12
- import { DialogOverlay as d } from "./components/DialogOverlay/DialogOverlay.js";
13
- import { Divider as f } from "./components/Divider/Divider.js";
14
- import { FullscreenOverlay as p } from "./components/FullscreenOverlay/FullscreenOverlay.js";
15
- import { Header as m } from "./components/Header/Header.js";
16
- import { AdaLogo as h } from "./components/Icon/icons/AdaLogo.js";
17
- import { ArrowDown as g } from "./components/Icon/icons/ArrowDown.js";
18
- import { ArrowLeft as _ } from "./components/Icon/icons/ArrowLeft.js";
19
- import { ArrowNortheast as v } from "./components/Icon/icons/ArrowNortheast.js";
20
- import { ArrowNorthwest as y } from "./components/Icon/icons/ArrowNorthwest.js";
21
- import { ArrowRight as b } from "./components/Icon/icons/ArrowRight.js";
22
- import { Bell as x } from "./components/Icon/icons/Bell.js";
23
- import { BellSlash as S } from "./components/Icon/icons/BellSlash.js";
24
- import { ChevronLeft as C } from "./components/Icon/icons/ChevronLeft.js";
25
- import { ChevronRight as w } from "./components/Icon/icons/ChevronRight.js";
26
- import { CloudUpload as T } from "./components/Icon/icons/CloudUpload.js";
27
- import { Download as E } from "./components/Icon/icons/Download.js";
28
- import { Ellipses as D } from "./components/Icon/icons/Ellipses.js";
29
- import { Email as O } from "./components/Icon/icons/Email.js";
30
- import { ExclamationSync as k } from "./components/Icon/icons/ExclamationSync.js";
31
- import { Eye as A } from "./components/Icon/icons/Eye.js";
32
- import { EyeSlash as j } from "./components/Icon/icons/EyeSlash.js";
33
- import { Language as M } from "./components/Icon/icons/Language.js";
34
- import { MediaSlash as N } from "./components/Icon/icons/MediaSlash.js";
35
- import { MessagingFill as P } from "./components/Icon/icons/MessagingFill.js";
36
- import { Minimize as F } from "./components/Icon/icons/Minimize.js";
37
- import { Mute as I } from "./components/Icon/icons/Mute.js";
38
- import { Paperclip as L } from "./components/Icon/icons/Paperclip.js";
39
- import { PersonFill as R } from "./components/Icon/icons/PersonFill.js";
40
- import { PlayFill as z } from "./components/Icon/icons/PlayFill.js";
41
- import { SendFill as B } from "./components/Icon/icons/SendFill.js";
42
- import { StarBadgeFill as V } from "./components/Icon/icons/StarBadgeFill.js";
43
- import { ThumbsDown as H } from "./components/Icon/icons/ThumbsDown.js";
44
- import { ThumbsUp as U } from "./components/Icon/icons/ThumbsUp.js";
45
- import { Volume as W } from "./components/Icon/icons/Volume.js";
46
- import { Xmark as G } from "./components/Icon/icons/Xmark.js";
47
- import { XmarkCircle as K } from "./components/Icon/icons/XmarkCircle.js";
48
- import { IconButton as q } from "./components/IconButton/IconButton.js";
49
- import { Image as J } from "./components/Image/Image.js";
50
- import { Input as Y } from "./components/Input/Input.js";
51
- import { Link as X } from "./components/Link/Link.js";
52
- import { Menu as Z } from "./components/MenuItem/Menu.js";
53
- import { MenuItem as Q } from "./components/MenuItem/MenuItem.js";
54
- import { PictureMessage as $ } from "./components/PictureMessage/PictureMessage.js";
55
- import { PillButton as ee } from "./components/PillButton/PillButton.js";
56
- import { ProactiveMessage as te } from "./components/ProactiveMessage/ProactiveMessage.js";
57
- import { Radio as ne } from "./components/Radio/Radio.js";
58
- import { RadioGroup as re } from "./components/Radio/RadioGroup.js";
59
- import { ScrollMarker as ie } from "./components/ScrollMarker/ScrollMarker.js";
60
- import { Sheet as ae } from "./components/Sheet/Sheet.js";
61
- import { SheetOverlay as oe } from "./components/SheetOverlay/SheetOverlay.js";
62
- import { readPrefersReducedMotion as se, usePrefersReducedMotion as ce } from "./hooks/usePrefersReducedMotion.js";
63
- import { useSubmitOnEnter as le } from "./hooks/useSubmitOnEnter.js";
64
- import { Spinner as ue } from "./components/Spinner/Spinner.js";
65
- import { SurveyRating as de } from "./components/Survey/SurveyRating/SurveyRating.js";
66
- import { SurveySelect as fe } from "./components/Survey/SurveySelect/SurveySelect.js";
67
- import { ThinkingShimmer as pe } from "./components/ThinkingShimmer/ThinkingShimmer.js";
68
- import { ToastNotification as me } from "./components/ToastNotification/ToastNotification.js";
69
- import { Toggle as he } from "./components/Toggle/Toggle.js";
70
- import { Tooltip as ge, TooltipTrigger as _e } from "./components/Tooltip/Tooltip.js";
71
- import { TypingIndicator as ve } from "./components/TypingIndicator/TypingIndicator.js";
72
- import { UserMessage as ye } from "./components/UserMessage/UserMessage.js";
73
- import { LOVELACE_SURFACES as be, contrastRatioBetween as xe, createBrandOverrides as Se, isLegibleAgainst as Ce, isLegibleOnSurface as we, readableTextOnAccent as Te } from "./runtime/branding.js";
74
- import { LovelaceProvider as Ee, useResolvedTheme as De } from "./runtime/LovelaceProvider.js";
75
- export { h as AdaLogo, n as AgentMessage, g as ArrowDown, _ as ArrowLeft, v as ArrowNortheast, y as ArrowNorthwest, b as ArrowRight, t as Avatar, e as AvatarPlaceholder, x as Bell, S as BellSlash, r as BubbleOverlay, i as Button, a as Checkbox, c as Checkmark, C as ChevronLeft, w as ChevronRight, o as Chip, T as CloudUpload, u as Dialog, d as DialogOverlay, f as Divider, E as Download, D as Ellipses, O as Email, k as ExclamationSync, l as ExclamationTriangle, A as Eye, j as EyeSlash, p as FullscreenOverlay, m as Header, s as Icon, q as IconButton, J as Image, Y as Input, be as LOVELACE_SURFACES, M as Language, X as Link, Ee as LovelaceProvider, N as MediaSlash, Z as Menu, Q as MenuItem, P as MessagingFill, F as Minimize, I as Mute, L as Paperclip, R as PersonFill, $ as PictureMessage, ee as PillButton, z as PlayFill, te as ProactiveMessage, ne as Radio, re as RadioGroup, ie as ScrollMarker, B as SendFill, ae as Sheet, oe as SheetOverlay, ue as Spinner, V as StarBadgeFill, de as SurveyRating, fe as SurveySelect, pe as ThinkingShimmer, H as ThumbsDown, U as ThumbsUp, me as ToastNotification, he as Toggle, ge as Tooltip, _e as TooltipTrigger, ve as TypingIndicator, ye as UserMessage, W as Volume, G as Xmark, K as XmarkCircle, xe as contrastRatioBetween, Se as createBrandOverrides, Ce as isLegibleAgainst, we as isLegibleOnSurface, se as readPrefersReducedMotion, Te as readableTextOnAccent, ce as usePrefersReducedMotion, De as useResolvedTheme, le as useSubmitOnEnter };
4
+ import { readPrefersReducedMotion as r, usePrefersReducedMotion as i } from "./hooks/usePrefersReducedMotion.js";
5
+ import { Icon as a } from "./components/Icon/Icon.js";
6
+ import { AdaLogo as o } from "./components/Icon/icons/AdaLogo.js";
7
+ import { ArrowDown as s } from "./components/Icon/icons/ArrowDown.js";
8
+ import { ArrowLeft as c } from "./components/Icon/icons/ArrowLeft.js";
9
+ import { ArrowNortheast as l } from "./components/Icon/icons/ArrowNortheast.js";
10
+ import { ArrowNorthwest as u } from "./components/Icon/icons/ArrowNorthwest.js";
11
+ import { ArrowRight as d } from "./components/Icon/icons/ArrowRight.js";
12
+ import { Bell as f } from "./components/Icon/icons/Bell.js";
13
+ import { BellSlash as p } from "./components/Icon/icons/BellSlash.js";
14
+ import { Checkmark as m } from "./components/Icon/icons/Checkmark.js";
15
+ import { ChevronLeft as h } from "./components/Icon/icons/ChevronLeft.js";
16
+ import { ChevronRight as g } from "./components/Icon/icons/ChevronRight.js";
17
+ import { CloudUpload as _ } from "./components/Icon/icons/CloudUpload.js";
18
+ import { Download as v } from "./components/Icon/icons/Download.js";
19
+ import { Ellipses as y } from "./components/Icon/icons/Ellipses.js";
20
+ import { Email as b } from "./components/Icon/icons/Email.js";
21
+ import { ExclamationSync as x } from "./components/Icon/icons/ExclamationSync.js";
22
+ import { ExclamationTriangle as S } from "./components/Icon/icons/ExclamationTriangle.js";
23
+ import { Eye as C } from "./components/Icon/icons/Eye.js";
24
+ import { EyeSlash as w } from "./components/Icon/icons/EyeSlash.js";
25
+ import { Language as T } from "./components/Icon/icons/Language.js";
26
+ import { MediaSlash as E } from "./components/Icon/icons/MediaSlash.js";
27
+ import { MessagingFill as D } from "./components/Icon/icons/MessagingFill.js";
28
+ import { Minimize as O } from "./components/Icon/icons/Minimize.js";
29
+ import { Mute as k } from "./components/Icon/icons/Mute.js";
30
+ import { Paperclip as A } from "./components/Icon/icons/Paperclip.js";
31
+ import { PersonFill as j } from "./components/Icon/icons/PersonFill.js";
32
+ import { PlayFill as M } from "./components/Icon/icons/PlayFill.js";
33
+ import { SendFill as N } from "./components/Icon/icons/SendFill.js";
34
+ import { StarBadgeFill as P } from "./components/Icon/icons/StarBadgeFill.js";
35
+ import { ThumbsDown as F } from "./components/Icon/icons/ThumbsDown.js";
36
+ import { ThumbsUp as I } from "./components/Icon/icons/ThumbsUp.js";
37
+ import { Volume as L } from "./components/Icon/icons/Volume.js";
38
+ import { Xmark as R } from "./components/Icon/icons/Xmark.js";
39
+ import { XmarkCircle as z } from "./components/Icon/icons/XmarkCircle.js";
40
+ import { IconButton as B } from "./components/IconButton/IconButton.js";
41
+ import { ToastNotification as V } from "./components/ToastNotification/ToastNotification.js";
42
+ import { Banner as H } from "./components/Banner/Banner.js";
43
+ import { useRegisterOverlay as U } from "./hooks/overlayRegistry.js";
44
+ import { BubbleOverlay as W } from "./components/BubbleOverlay/BubbleOverlay.js";
45
+ import { Button as G } from "./components/Button/Button.js";
46
+ import { Checkbox as K } from "./components/Checkbox/Checkbox.js";
47
+ import { CheckboxGroup as q } from "./components/Checkbox/CheckboxGroup.js";
48
+ import { Chip as J } from "./components/Chip/Chip.js";
49
+ import { Dialog as Y } from "./components/Dialog/Dialog.js";
50
+ import { DialogOverlay as X } from "./components/DialogOverlay/DialogOverlay.js";
51
+ import { Divider as Z } from "./components/Divider/Divider.js";
52
+ import { FullscreenOverlay as Q } from "./components/FullscreenOverlay/FullscreenOverlay.js";
53
+ import { Header as $ } from "./components/Header/Header.js";
54
+ import { Image as ee } from "./components/Image/Image.js";
55
+ import { Input as te } from "./components/Input/Input.js";
56
+ import { Link as ne } from "./components/Link/Link.js";
57
+ import { Menu as re } from "./components/MenuItem/Menu.js";
58
+ import { MenuItem as ie } from "./components/MenuItem/MenuItem.js";
59
+ import { PictureMessage as ae } from "./components/PictureMessage/PictureMessage.js";
60
+ import { PillButton as oe } from "./components/PillButton/PillButton.js";
61
+ import { ProactiveMessage as se } from "./components/ProactiveMessage/ProactiveMessage.js";
62
+ import { Radio as ce } from "./components/Radio/Radio.js";
63
+ import { RadioGroup as le } from "./components/Radio/RadioGroup.js";
64
+ import { ScrollMarker as ue } from "./components/ScrollMarker/ScrollMarker.js";
65
+ import { Sheet as de } from "./components/Sheet/Sheet.js";
66
+ import { SheetOverlay as fe } from "./components/SheetOverlay/SheetOverlay.js";
67
+ import { useSubmitOnEnter as pe } from "./hooks/useSubmitOnEnter.js";
68
+ import { Spinner as me } from "./components/Spinner/Spinner.js";
69
+ import { SurveyRating as he } from "./components/Survey/SurveyRating/SurveyRating.js";
70
+ import { SurveySelect as ge } from "./components/Survey/SurveySelect/SurveySelect.js";
71
+ import { ThinkingShimmer as _e } from "./components/ThinkingShimmer/ThinkingShimmer.js";
72
+ import { ToastRegion as ve } from "./components/ToastRegion/ToastRegion.js";
73
+ import { ToastQueue as ye } from "./components/ToastRegion/index.js";
74
+ import { Toggle as be } from "./components/Toggle/Toggle.js";
75
+ import { Tooltip as xe, TooltipTrigger as Se } from "./components/Tooltip/Tooltip.js";
76
+ import { TypingIndicator as Ce } from "./components/TypingIndicator/TypingIndicator.js";
77
+ import { UserMessage as we } from "./components/UserMessage/UserMessage.js";
78
+ import { LOVELACE_SURFACES as Te, contrastRatioBetween as Ee, createBrandOverrides as De, isLegibleAgainst as Oe, isLegibleOnSurface as ke, readableTextOnAccent as Ae } from "./runtime/branding.js";
79
+ import { LovelaceProvider as je, useResolvedTheme as Me } from "./runtime/LovelaceProvider.js";
80
+ export { o as AdaLogo, n as AgentMessage, s as ArrowDown, c as ArrowLeft, l as ArrowNortheast, u as ArrowNorthwest, d as ArrowRight, t as Avatar, e as AvatarPlaceholder, H as Banner, f as Bell, p as BellSlash, W as BubbleOverlay, G as Button, K as Checkbox, q as CheckboxGroup, m as Checkmark, h as ChevronLeft, g as ChevronRight, J as Chip, _ as CloudUpload, Y as Dialog, X as DialogOverlay, Z as Divider, v as Download, y as Ellipses, b as Email, x as ExclamationSync, S as ExclamationTriangle, C as Eye, w as EyeSlash, Q as FullscreenOverlay, $ as Header, a as Icon, B as IconButton, ee as Image, te as Input, Te as LOVELACE_SURFACES, T as Language, ne as Link, je as LovelaceProvider, E as MediaSlash, re as Menu, ie as MenuItem, D as MessagingFill, O as Minimize, k as Mute, A as Paperclip, j as PersonFill, ae as PictureMessage, oe as PillButton, M as PlayFill, se as ProactiveMessage, ce as Radio, le as RadioGroup, ue as ScrollMarker, N as SendFill, de as Sheet, fe as SheetOverlay, me as Spinner, P as StarBadgeFill, he as SurveyRating, ge as SurveySelect, _e as ThinkingShimmer, F as ThumbsDown, I as ThumbsUp, V as ToastNotification, ye as ToastQueue, ve as ToastRegion, be as Toggle, xe as Tooltip, Se as TooltipTrigger, Ce as TypingIndicator, we as UserMessage, L as Volume, R as Xmark, z as XmarkCircle, Ee as contrastRatioBetween, De as createBrandOverrides, Oe as isLegibleAgainst, ke as isLegibleOnSurface, r as readPrefersReducedMotion, Ae as readableTextOnAccent, i as usePrefersReducedMotion, U as useRegisterOverlay, Me as useResolvedTheme, pe as useSubmitOnEnter };
@@ -1,30 +1,30 @@
1
1
  import { tokenName as e } from "../tokens/tokens.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- import { UNSAFE_PortalProvider as n } from "react-aria";
4
- import { useEffect as r, useMemo as i, useState as a } from "react";
3
+ import { useEffect as n, useMemo as r, useState as i } from "react";
4
+ import { UNSAFE_PortalProvider as a } from "react-aria";
5
5
  //#region src/runtime/LovelaceProvider.tsx
6
6
  var o = "(prefers-color-scheme: dark)";
7
7
  function s() {
8
8
  return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(o).matches;
9
9
  }
10
10
  function c(e) {
11
- let [t, n] = a(() => e === "auto" ? s() ? "dark" : "light" : e);
12
- return r(() => {
11
+ let [t, r] = i(() => e === "auto" ? s() ? "dark" : "light" : e);
12
+ return n(() => {
13
13
  if (e !== "auto") {
14
- n(e);
14
+ r(e);
15
15
  return;
16
16
  }
17
17
  if (typeof window > "u" || typeof window.matchMedia != "function") return;
18
- let t = window.matchMedia(o), r = (e) => {
19
- n(e ? "dark" : "light");
18
+ let t = window.matchMedia(o), n = (e) => {
19
+ r(e ? "dark" : "light");
20
20
  };
21
- r(t.matches);
22
- let i = (e) => r(e.matches);
21
+ n(t.matches);
22
+ let i = (e) => n(e.matches);
23
23
  return t.addEventListener("change", i), () => t.removeEventListener("change", i);
24
24
  }, [e]), t;
25
25
  }
26
- function l({ theme: r = "auto", override: o, children: s }) {
27
- let l = c(r), [u, d] = a(null), f = i(() => {
26
+ function l({ theme: n = "auto", override: o, children: s }) {
27
+ let l = c(n), [u, d] = i(null), f = r(() => {
28
28
  let t = { display: "contents" };
29
29
  for (let [n, r] of Object.entries(o ?? {})) r != null && (t[e(n)] = r);
30
30
  return t;
@@ -33,7 +33,7 @@ function l({ theme: r = "auto", override: o, children: s }) {
33
33
  ref: d,
34
34
  "data-theme": l,
35
35
  style: f,
36
- children: u != null && /* @__PURE__ */ t(n, {
36
+ children: u != null && /* @__PURE__ */ t(a, {
37
37
  getContainer: () => u,
38
38
  children: s
39
39
  })