@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.
- package/dist/components/Banner/Banner.css.d.ts +1 -0
- package/dist/components/Banner/Banner.css.js +7 -0
- package/dist/components/Banner/Banner.css.js.map +1 -0
- package/dist/components/Banner/Banner.d.ts +51 -0
- package/dist/components/Banner/Banner.js +25 -0
- package/dist/components/Banner/Banner.js.map +1 -0
- package/dist/components/Banner/BannerSurface.d.ts +17 -0
- package/dist/components/Banner/BannerSurface.js +65 -0
- package/dist/components/Banner/BannerSurface.js.map +1 -0
- package/dist/components/Banner/index.d.ts +1 -0
- package/dist/components/BubbleOverlay/BubbleOverlay.js +21 -20
- package/dist/components/BubbleOverlay/BubbleOverlay.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.css.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.css.js +6 -6
- package/dist/components/Checkbox/Checkbox.css.js.map +1 -1
- package/dist/components/Checkbox/CheckboxGroup.d.ts +15 -0
- package/dist/components/Checkbox/CheckboxGroup.js +16 -0
- package/dist/components/Checkbox/CheckboxGroup.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Dialog/DialogIcon.js +5 -5
- package/dist/components/DialogOverlay/DialogOverlay.js +23 -22
- package/dist/components/DialogOverlay/DialogOverlay.js.map +1 -1
- package/dist/components/FullscreenOverlay/FullscreenOverlay.js +21 -20
- package/dist/components/FullscreenOverlay/FullscreenOverlay.js.map +1 -1
- package/dist/components/Input/InputRoot.js +4 -4
- package/dist/components/Input/InputTextArea.js +7 -7
- package/dist/components/MenuItem/MenuItemRoot.js +9 -9
- package/dist/components/SheetOverlay/SheetOverlay.js +22 -21
- package/dist/components/SheetOverlay/SheetOverlay.js.map +1 -1
- package/dist/components/ToastNotification/ToastNotification.css.d.ts +1 -14
- package/dist/components/ToastNotification/ToastNotification.css.js +1 -9
- package/dist/components/ToastNotification/ToastNotification.css.js.map +1 -1
- package/dist/components/ToastNotification/ToastNotification.d.ts +30 -11
- package/dist/components/ToastNotification/ToastNotification.js +29 -18
- package/dist/components/ToastNotification/ToastNotification.js.map +1 -1
- package/dist/components/ToastNotification/index.d.ts +1 -1
- package/dist/components/ToastRegion/ToastContent.d.ts +9 -0
- package/dist/components/ToastRegion/ToastRegion.css.d.ts +2 -0
- package/dist/components/ToastRegion/ToastRegion.css.js +7 -0
- package/dist/components/ToastRegion/ToastRegion.css.js.map +1 -0
- package/dist/components/ToastRegion/ToastRegion.d.ts +45 -0
- package/dist/components/ToastRegion/ToastRegion.js +38 -0
- package/dist/components/ToastRegion/ToastRegion.js.map +1 -0
- package/dist/components/ToastRegion/ToastRegionItem.d.ts +13 -0
- package/dist/components/ToastRegion/ToastRegionItem.js +49 -0
- package/dist/components/ToastRegion/ToastRegionItem.js.map +1 -0
- package/dist/components/ToastRegion/ToastRegionLandmark.d.ts +15 -0
- package/dist/components/ToastRegion/ToastRegionLandmark.js +62 -0
- package/dist/components/ToastRegion/ToastRegionLandmark.js.map +1 -0
- package/dist/components/ToastRegion/index.d.ts +4 -0
- package/dist/components/ToastRegion/index.js +3 -0
- package/dist/components/Tooltip/Tooltip.js +8 -8
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/overlayRegistry.d.ts +22 -0
- package/dist/hooks/overlayRegistry.js +32 -0
- package/dist/hooks/overlayRegistry.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +77 -72
- package/dist/runtime/LovelaceProvider.js +12 -12
- package/dist/style.css +1 -1
- package/dist/utils/animation.d.ts +28 -0
- package/dist/utils/animation.js +68 -0
- package/dist/utils/animation.js.map +1 -0
- 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"}
|
|
@@ -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 {
|
|
5
|
-
import {
|
|
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:
|
|
8
|
-
let { direction: h } =
|
|
9
|
-
return /* @__PURE__ */ a(
|
|
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:
|
|
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(
|
|
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,
|
|
30
|
+
export { u as Tooltip, c as TooltipTrigger };
|
|
31
31
|
|
|
32
32
|
//# sourceMappingURL=Tooltip.js.map
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
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,
|
|
12
|
-
return
|
|
11
|
+
let [t, r] = i(() => e === "auto" ? s() ? "dark" : "light" : e);
|
|
12
|
+
return n(() => {
|
|
13
13
|
if (e !== "auto") {
|
|
14
|
-
|
|
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),
|
|
19
|
-
|
|
18
|
+
let t = window.matchMedia(o), n = (e) => {
|
|
19
|
+
r(e ? "dark" : "light");
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
let i = (e) =>
|
|
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:
|
|
27
|
-
let l = c(
|
|
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(
|
|
36
|
+
children: u != null && /* @__PURE__ */ t(a, {
|
|
37
37
|
getContainer: () => u,
|
|
38
38
|
children: s
|
|
39
39
|
})
|