@adea-ai/ui 0.162.17 → 0.162.18
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/lib/overlay.d.ts
CHANGED
|
@@ -81,7 +81,9 @@ export declare const overlayMotion = "data-expanded:animate-in data-expanded:fad
|
|
|
81
81
|
/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */
|
|
82
82
|
export declare const tooltipMotion = "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-expanded:duration-150 data-closed:duration-100";
|
|
83
83
|
/** Popover-style motion: no zoom, so a panel anchored to a control does not
|
|
84
|
-
* appear to breathe away from it.
|
|
84
|
+
* appear to breathe away from it. The duration is animation-only: `duration-*`
|
|
85
|
+
* also transitions every property, so a panel that settles after its first
|
|
86
|
+
* position would slide from the stale one instead of appearing at the anchor. */
|
|
85
87
|
export declare const popoverMotion: string;
|
|
86
88
|
/** The popper arrow. Sized in the component; coloured here. */
|
|
87
89
|
export declare const popoverArrow = "fill-popover stroke-border";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/lib/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAS,CAAA;AAEhC;+EAC+E;AAC/E,eAAO,MAAM,cAAc,iFACqD,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,4EACiD,CAAA;AAE3E;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAAwD,CAAA;AAEjF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,6DAA6D,CAAA;AAE3F,gDAAgD;AAChD,eAAO,MAAM,YAAY,yFAC+D,CAAA;AAExF,+DAA+D;AAC/D,e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data-closed:durat
|
|
|
82
82
|
/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */
|
|
83
83
|
var tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`;
|
|
84
84
|
/** Popover-style motion: no zoom, so a panel anchored to a control does not
|
|
85
|
-
* appear to breathe away from it.
|
|
86
|
-
|
|
85
|
+
* appear to breathe away from it. The duration is animation-only: `duration-*`
|
|
86
|
+
* also transitions every property, so a panel that settles after its first
|
|
87
|
+
* position would slide from the stale one instead of appearing at the anchor. */
|
|
88
|
+
var popoverMotion = "data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-expanded:animation-duration-150 data-closed:animation-duration-100";
|
|
87
89
|
/** The popper arrow. Sized in the component; coloured here. */
|
|
88
90
|
var popoverArrow = "fill-popover stroke-border";
|
|
89
91
|
/**
|
package/dist/lib/overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/**\n * One CSS layout unit (1/64px), added to every side offset. ui-sdk snaps a\n * layer's position to whole device pixels after undoing the layer's entry\n * transform (`zoom-in-95`), and that undo carries float noise of about 1e-7px:\n * a layer due at an anchor edge of 75.5px lands at 75.4999997px and snaps to\n * 75px, half a pixel inside its trigger. A layout unit is far above the noise\n * and far below a pixel, so whole-pixel anchors land exactly where they did and\n * half-pixel ones round away from the anchor as intended. Remove once ui-sdk\n * rounds its untransformed origin (ui-notes/ui-sdk-issue-snap.md).\n */\nexport const SNAP_GUARD = 1 / 64\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:focus-outline outline-none'\n\n/**\n * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are the open and closed state every overlay\n * part carries (the names it had under Kobalte, kept by the overlays on top of\n * ui-sdk's `data-open`); `data-side-*` come from the positioning and let a menu\n * slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/**\n * A destructive action keeps readable body text; its icon takes the status colour and the\n * highlight a destructive tint. No edge bar: the row lines up with its neighbours.\n */\nexport const destructiveMenuItem =\n 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempted nodes carrying this attribute\n * from both, so every floating layer carries it.\n *\n * ui-sdk renders popups in place in the browser's top layer and makes the page\n * behind a modal inert itself, so nothing in it reads this attribute; it stays\n * until the overlays that spread it stop doing so.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walked body children added after its layer\n * opened and aria-hid them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n\n/**\n * Elements the kit itself has made inert (ModalDialog's background), counted per\n * writer. The dialog layer's guard against ui-sdk clearing app-set `inert` (see\n * `guardAppInert` in dialog-layer.tsx) skips these: they are the kit's own\n * bookkeeping, which ModalDialog undoes itself, not inertness an app asked for.\n */\nconst kitInertWriters = new WeakMap<Element, number>()\n\nexport function holdKitInert(nodes: readonly Element[]): () => void {\n for (const node of nodes) kitInertWriters.set(node, (kitInertWriters.get(node) ?? 0) + 1)\n return () => {\n for (const node of nodes) {\n const count = (kitInertWriters.get(node) ?? 1) - 1\n if (count > 0) kitInertWriters.set(node, count)\n else kitInertWriters.delete(node)\n }\n }\n}\n\nexport const isKitInert = (node: Element) => kitInertWriters.has(node)\n"],"mappings":";;;;;;;;;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,IAAI,IAAI"}
|
|
1
|
+
{"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/**\n * One CSS layout unit (1/64px), added to every side offset. ui-sdk snaps a\n * layer's position to whole device pixels after undoing the layer's entry\n * transform (`zoom-in-95`), and that undo carries float noise of about 1e-7px:\n * a layer due at an anchor edge of 75.5px lands at 75.4999997px and snaps to\n * 75px, half a pixel inside its trigger. A layout unit is far above the noise\n * and far below a pixel, so whole-pixel anchors land exactly where they did and\n * half-pixel ones round away from the anchor as intended. Remove once ui-sdk\n * rounds its untransformed origin (ui-notes/ui-sdk-issue-snap.md).\n */\nexport const SNAP_GUARD = 1 / 64\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:focus-outline outline-none'\n\n/**\n * The tip: shadcn's inverted chip, foreground on background, so an explanation\n * never reads as a popover that could hold controls. The side rail draws it\n * flush to a collapsed row and every floating tooltip composes the same fill\n * and type, so a control never explains itself in two visual languages.\n */\nexport const tooltipTip = 'bg-foreground text-background rounded-md text-xs font-medium'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are the open and closed state every overlay\n * part carries (the names it had under Kobalte, kept by the overlays on top of\n * ui-sdk's `data-open`); `data-side-*` come from the positioning and let a menu\n * slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. The duration is animation-only: `duration-*`\n * also transitions every property, so a panel that settles after its first\n * position would slide from the stale one instead of appearing at the anchor. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:animation-duration-150 data-closed:animation-duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/**\n * A destructive action keeps readable body text; its icon takes the status colour and the\n * highlight a destructive tint. No edge bar: the row lines up with its neighbours.\n */\nexport const destructiveMenuItem =\n 'text-foreground data-[highlighted]:bg-destructive-subtle [&_svg:not([data-slot$=-indicator]_*)]:text-destructive!'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto text-xs tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempted nodes carrying this attribute\n * from both, so every floating layer carries it.\n *\n * ui-sdk renders popups in place in the browser's top layer and makes the page\n * behind a modal inert itself, so nothing in it reads this attribute; it stays\n * until the overlays that spread it stop doing so.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walked body children added after its layer\n * opened and aria-hid them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n\n/**\n * Elements the kit itself has made inert (ModalDialog's background), counted per\n * writer. The dialog layer's guard against ui-sdk clearing app-set `inert` (see\n * `guardAppInert` in dialog-layer.tsx) skips these: they are the kit's own\n * bookkeeping, which ModalDialog undoes itself, not inertness an app asked for.\n */\nconst kitInertWriters = new WeakMap<Element, number>()\n\nexport function holdKitInert(nodes: readonly Element[]): () => void {\n for (const node of nodes) kitInertWriters.set(node, (kitInertWriters.get(node) ?? 0) + 1)\n return () => {\n for (const node of nodes) {\n const count = (kitInertWriters.get(node) ?? 1) - 1\n if (count > 0) kitInertWriters.set(node, count)\n else kitInertWriters.delete(node)\n }\n }\n}\n\nexport const isKitInert = (node: Element) => kitInertWriters.has(node)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,aAAa,IAAI;;;AAI9B,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aAAa;;;;;;;;;;;;AAa1B,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;;;AAM5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;;;;AAYF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;;;;;AAkBlC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB;;;;;;;AAQlC,IAAM,kCAAkB,IAAI,QAAyB;AAErD,SAAgB,aAAa,OAAuC;CAClE,KAAK,MAAM,QAAQ,OAAO,gBAAgB,IAAI,OAAO,gBAAgB,IAAI,IAAI,KAAK,KAAK,CAAC;CACxF,aAAa;EACX,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,SAAS,gBAAgB,IAAI,IAAI,KAAK,KAAK;GACjD,IAAI,QAAQ,GAAG,gBAAgB,IAAI,MAAM,KAAK;QACzC,gBAAgB,OAAO,IAAI;EAClC;CACF;AACF;AAEA,IAAa,cAAc,SAAkB,gBAAgB,IAAI,IAAI"}
|
|
@@ -107,10 +107,12 @@ export const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-clo
|
|
|
107
107
|
export const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`
|
|
108
108
|
|
|
109
109
|
/** Popover-style motion: no zoom, so a panel anchored to a control does not
|
|
110
|
-
* appear to breathe away from it.
|
|
110
|
+
* appear to breathe away from it. The duration is animation-only: `duration-*`
|
|
111
|
+
* also transitions every property, so a panel that settles after its first
|
|
112
|
+
* position would slide from the stale one instead of appearing at the anchor. */
|
|
111
113
|
export const popoverMotion =
|
|
112
114
|
'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +
|
|
113
|
-
'data-expanded:duration-150 data-closed:duration-100'
|
|
115
|
+
'data-expanded:animation-duration-150 data-closed:animation-duration-100'
|
|
114
116
|
|
|
115
117
|
/** The popper arrow. Sized in the component; coloured here. */
|
|
116
118
|
export const popoverArrow = 'fill-popover stroke-border'
|
package/package.json
CHANGED
package/src/lib/overlay.ts
CHANGED
|
@@ -107,10 +107,12 @@ export const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-clo
|
|
|
107
107
|
export const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`
|
|
108
108
|
|
|
109
109
|
/** Popover-style motion: no zoom, so a panel anchored to a control does not
|
|
110
|
-
* appear to breathe away from it.
|
|
110
|
+
* appear to breathe away from it. The duration is animation-only: `duration-*`
|
|
111
|
+
* also transitions every property, so a panel that settles after its first
|
|
112
|
+
* position would slide from the stale one instead of appearing at the anchor. */
|
|
111
113
|
export const popoverMotion =
|
|
112
114
|
'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +
|
|
113
|
-
'data-expanded:duration-150 data-closed:duration-100'
|
|
115
|
+
'data-expanded:animation-duration-150 data-closed:animation-duration-100'
|
|
114
116
|
|
|
115
117
|
/** The popper arrow. Sized in the component; coloured here. */
|
|
116
118
|
export const popoverArrow = 'fill-popover stroke-border'
|