@ada-cx/lovelace 1.18.0 → 1.18.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
export interface SheetOverlayProps {
|
|
3
3
|
/** Whether the sheet is open. */
|
|
4
4
|
isOpen: boolean;
|
|
@@ -10,6 +10,8 @@ export interface SheetOverlayProps {
|
|
|
10
10
|
"aria-label"?: string;
|
|
11
11
|
/** Id of the element describing the sheet, typically a `Sheet.Body`. */
|
|
12
12
|
"aria-describedby"?: string;
|
|
13
|
+
/** Maximum sheet height. Defaults to 80% of the available height. */
|
|
14
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
13
15
|
className?: string;
|
|
14
16
|
children: ReactNode;
|
|
15
17
|
}
|
|
@@ -23,4 +25,4 @@ export interface SheetOverlayProps {
|
|
|
23
25
|
* `aria-label` prop — with neither (e.g. an actions-only Confirm sheet) RAC
|
|
24
26
|
* emits a missing-name warning.
|
|
25
27
|
*/
|
|
26
|
-
export declare function SheetOverlay({ isOpen, onOpenChange, isDismissable, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, className, children, }: SheetOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function SheetOverlay({ isOpen, onOpenChange, isDismissable, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, className, maxHeight, children, }: SheetOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,21 +5,22 @@ import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
|
5
5
|
import { Dialog as s, Modal as c, ModalOverlay as l } from "react-aria-components";
|
|
6
6
|
import { useLocale as u } from "react-aria";
|
|
7
7
|
//#region src/components/SheetOverlay/SheetOverlay.tsx
|
|
8
|
-
function d({ isOpen: d, onOpenChange: f, isDismissable: p = !0, "aria-label": m, "aria-describedby": h, className: g,
|
|
9
|
-
let { direction:
|
|
8
|
+
function d({ isOpen: d, onOpenChange: f, isDismissable: p = !0, "aria-label": m, "aria-describedby": h, className: g, maxHeight: _, children: v }) {
|
|
9
|
+
let { direction: y } = u();
|
|
10
10
|
return /* @__PURE__ */ o(l, {
|
|
11
11
|
isOpen: d,
|
|
12
12
|
onOpenChange: f,
|
|
13
13
|
isDismissable: p,
|
|
14
14
|
className: i,
|
|
15
|
-
dir:
|
|
15
|
+
dir: y,
|
|
16
16
|
children: [/* @__PURE__ */ a(t, {}), /* @__PURE__ */ a(c, {
|
|
17
17
|
className: r,
|
|
18
|
+
style: { maxHeight: _ },
|
|
18
19
|
children: /* @__PURE__ */ a(s, {
|
|
19
20
|
"aria-label": m,
|
|
20
21
|
"aria-describedby": h,
|
|
21
22
|
className: e(n, g),
|
|
22
|
-
children:
|
|
23
|
+
children: v
|
|
23
24
|
})
|
|
24
25
|
})]
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetOverlay.js","names":[],"sources":["../../../src/components/SheetOverlay/SheetOverlay.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport {\n\tDialog as AriaDialog,\n\tModal,\n\tModalOverlay,\n} from \"react-aria-components\";\nimport { OverlayRegistration } from \"../../hooks/overlayRegistry.js\";\nimport { cx } from \"../../utils/cx.js\";\nimport { sheetDialog, sheetModal, sheetScrim } from \"./SheetOverlay.css.js\";\n\nexport interface SheetOverlayProps {\n\t/** Whether the sheet is open. */\n\tisOpen: boolean;\n\t/** Called with the next open state on dismiss (scrim tap, Escape) or programmatic close. */\n\tonOpenChange: (isOpen: boolean) => void;\n\t/** Dismiss on scrim tap. Escape always cancels (RAC default). Defaults to `true`. */\n\tisDismissable?: boolean;\n\t/** Accessible name fallback when the child has no `Sheet.Title`. */\n\t\"aria-label\"?: string;\n\t/** Id of the element describing the sheet, typically a `Sheet.Body`. */\n\t\"aria-describedby\"?: string;\n\tclassName?: string;\n\tchildren: ReactNode;\n}\n\n/**\n * Modal bottom-sheet presentation: dark scrim, focus-trap, dismiss-on-tap/Escape,\n * bottom-anchored, rounded-top corners, slide-up. Wraps arbitrary children\n * (typically a `Sheet`). For a full-window surface use `FullscreenOverlay`; for a\n * centered dialog `Dialog`; for a non-dimming bottom bubble `BubbleOverlay`.\n *\n * Give the dialog an accessible name via either a `Sheet.Title` or the\n * `aria-label` prop — with neither (e.g. an actions-only Confirm sheet) RAC\n * emits a missing-name warning.\n */\nexport function SheetOverlay({\n\tisOpen,\n\tonOpenChange,\n\tisDismissable = true,\n\t\"aria-label\": ariaLabel,\n\t\"aria-describedby\": ariaDescribedBy,\n\tclassName,\n\tchildren,\n}: SheetOverlayProps) {\n\t// Stated, not inherited: this renders through a portal, so its direction must\n\t// not depend on where the portal lands. See the portalled-surface scenario\n\t// under the RTL requirement in openspec/specs/accessibility/spec.md.\n\tconst { direction } = useLocale();\n\n\treturn (\n\t\t<ModalOverlay\n\t\t\tisOpen={isOpen}\n\t\t\tonOpenChange={onOpenChange}\n\t\t\tisDismissable={isDismissable}\n\t\t\tclassName={sheetScrim}\n\t\t\tdir={direction}\n\t\t>\n\t\t\t<OverlayRegistration />\n\t\t\t<Modal className={sheetModal}>\n\t\t\t\t<AriaDialog\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\tclassName={cx(sheetDialog, className)}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</AriaDialog>\n\t\t\t</Modal>\n\t\t</ModalOverlay>\n\t);\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"SheetOverlay.js","names":[],"sources":["../../../src/components/SheetOverlay/SheetOverlay.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport {\n\tDialog as AriaDialog,\n\tModal,\n\tModalOverlay,\n} from \"react-aria-components\";\nimport { OverlayRegistration } from \"../../hooks/overlayRegistry.js\";\nimport { cx } from \"../../utils/cx.js\";\nimport { sheetDialog, sheetModal, sheetScrim } from \"./SheetOverlay.css.js\";\n\nexport interface SheetOverlayProps {\n\t/** Whether the sheet is open. */\n\tisOpen: boolean;\n\t/** Called with the next open state on dismiss (scrim tap, Escape) or programmatic close. */\n\tonOpenChange: (isOpen: boolean) => void;\n\t/** Dismiss on scrim tap. Escape always cancels (RAC default). Defaults to `true`. */\n\tisDismissable?: boolean;\n\t/** Accessible name fallback when the child has no `Sheet.Title`. */\n\t\"aria-label\"?: string;\n\t/** Id of the element describing the sheet, typically a `Sheet.Body`. */\n\t\"aria-describedby\"?: string;\n\t/** Maximum sheet height. Defaults to 80% of the available height. */\n\tmaxHeight?: CSSProperties[\"maxHeight\"];\n\tclassName?: string;\n\tchildren: ReactNode;\n}\n\n/**\n * Modal bottom-sheet presentation: dark scrim, focus-trap, dismiss-on-tap/Escape,\n * bottom-anchored, rounded-top corners, slide-up. Wraps arbitrary children\n * (typically a `Sheet`). For a full-window surface use `FullscreenOverlay`; for a\n * centered dialog `Dialog`; for a non-dimming bottom bubble `BubbleOverlay`.\n *\n * Give the dialog an accessible name via either a `Sheet.Title` or the\n * `aria-label` prop — with neither (e.g. an actions-only Confirm sheet) RAC\n * emits a missing-name warning.\n */\nexport function SheetOverlay({\n\tisOpen,\n\tonOpenChange,\n\tisDismissable = true,\n\t\"aria-label\": ariaLabel,\n\t\"aria-describedby\": ariaDescribedBy,\n\tclassName,\n\tmaxHeight,\n\tchildren,\n}: SheetOverlayProps) {\n\t// Stated, not inherited: this renders through a portal, so its direction must\n\t// not depend on where the portal lands. See the portalled-surface scenario\n\t// under the RTL requirement in openspec/specs/accessibility/spec.md.\n\tconst { direction } = useLocale();\n\n\treturn (\n\t\t<ModalOverlay\n\t\t\tisOpen={isOpen}\n\t\t\tonOpenChange={onOpenChange}\n\t\t\tisDismissable={isDismissable}\n\t\t\tclassName={sheetScrim}\n\t\t\tdir={direction}\n\t\t>\n\t\t\t<OverlayRegistration />\n\t\t\t<Modal className={sheetModal} style={{ maxHeight }}>\n\t\t\t\t<AriaDialog\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\tclassName={cx(sheetDialog, className)}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</AriaDialog>\n\t\t\t</Modal>\n\t\t</ModalOverlay>\n\t);\n}\n"],"mappings":";;;;;;;AAsCA,SAAgB,EAAa,EAC5B,WACA,iBACA,mBAAgB,IAChB,cAAc,GACd,oBAAoB,GACpB,cACA,cACA,eACqB;CAIrB,IAAM,EAAE,iBAAc,GAAW;AAEjC,QACC,kBAAC,GAAD;EACS;EACM;EACC;EACf,WAAW;EACX,KAAK;YALN,CAOC,kBAAC,GAAD,EAAuB,CAAA,EACvB,kBAAC,GAAD;GAAO,WAAW;GAAY,OAAO,EAAE,cAAW;aACjD,kBAAC,GAAD;IACC,cAAY;IACZ,oBAAkB;IAClB,WAAW,EAAG,GAAa,EAAU;IAEpC;IACW,CAAA;GACN,CAAA,CACM"}
|
package/package.json
CHANGED