@glasshome/ui 1.40.0 → 1.42.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 (105) hide show
  1. package/SPEC.md +25 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/lib/anchor-placement.d.ts +30 -0
  5. package/dist/lib/behavior/anchored.d.ts +12 -0
  6. package/dist/lib/behavior/collection.d.ts +24 -0
  7. package/dist/lib/behavior/controllable.d.ts +8 -0
  8. package/dist/lib/behavior/dismiss.d.ts +11 -0
  9. package/dist/lib/behavior/focus-scope.d.ts +18 -0
  10. package/dist/lib/behavior/hide-outside.d.ts +7 -0
  11. package/dist/lib/behavior/layer-stack.d.ts +33 -0
  12. package/dist/lib/behavior/modal-root.d.ts +66 -0
  13. package/dist/lib/behavior/polymorphic.d.ts +6 -0
  14. package/dist/lib/behavior/presence.d.ts +18 -0
  15. package/dist/lib/behavior/solid.d.ts +13 -0
  16. package/dist/lib/motion-classes.d.ts +5 -2
  17. package/dist/lib/overlay-classes.d.ts +4 -1
  18. package/dist/lib/page-cover.d.ts +8 -0
  19. package/dist/lib/shadow-layer.d.ts +8 -6
  20. package/dist/solid/alert-dialog.d.ts +13 -15
  21. package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -6
  22. package/dist/solid/bottom-sheet/constants.d.ts +1 -1
  23. package/dist/solid/confirm-dialog.d.ts +22 -0
  24. package/dist/solid/dialog-parts.d.ts +78 -15
  25. package/dist/solid/dialog.d.ts +9 -15
  26. package/dist/solid/docked-panel.d.ts +1 -5
  27. package/dist/solid/icon-nodes.d.ts +13 -0
  28. package/dist/solid/index.d.ts +9 -5
  29. package/dist/solid/index.js +8211 -7974
  30. package/dist/solid/responsive-dialog.d.ts +5 -6
  31. package/dist/solid/sheet.d.ts +6 -13
  32. package/dist/solid/stale-veil.d.ts +7 -0
  33. package/dist/solid/tabs.d.ts +29 -8
  34. package/dist/solid/toggle-group.d.ts +30 -5
  35. package/dist/solid/tooltip.d.ts +71 -9
  36. package/dist/{utils-DXEj_oXa.js → utils-CxAii-e9.js} +606 -414
  37. package/package.json +4 -2
  38. package/src/index.ts +1 -0
  39. package/src/lib/anchor-placement.ts +68 -2
  40. package/src/lib/behavior/anchored.ts +88 -0
  41. package/src/lib/behavior/collection.ts +181 -0
  42. package/src/lib/behavior/controllable.ts +22 -0
  43. package/src/lib/behavior/dismiss.ts +145 -0
  44. package/src/lib/behavior/focus-scope.ts +202 -0
  45. package/src/lib/behavior/hide-outside.ts +85 -0
  46. package/src/lib/behavior/layer-stack.ts +125 -0
  47. package/src/lib/behavior/modal-root.tsx +446 -0
  48. package/src/lib/behavior/polymorphic.tsx +30 -0
  49. package/src/lib/behavior/presence.ts +89 -0
  50. package/src/lib/behavior/solid.ts +30 -0
  51. package/src/lib/clipboard.ts +3 -2
  52. package/src/lib/motion-classes.ts +27 -2
  53. package/src/lib/overlay-classes.ts +9 -4
  54. package/src/lib/page-cover.ts +47 -0
  55. package/src/lib/shadow-layer.ts +48 -66
  56. package/src/solid/alert-dialog.tsx +45 -81
  57. package/src/solid/alert.tsx +1 -1
  58. package/src/solid/area-picker.tsx +2 -1
  59. package/src/solid/badge.tsx +5 -5
  60. package/src/solid/bottom-sheet/bottom-sheet.tsx +72 -128
  61. package/src/solid/bottom-sheet/constants.ts +3 -1
  62. package/src/solid/bottom-sheet/drag-controller.ts +11 -0
  63. package/src/solid/breadcrumb.tsx +4 -4
  64. package/src/solid/button-group.tsx +4 -4
  65. package/src/solid/card.tsx +5 -4
  66. package/src/solid/confirm-dialog.tsx +62 -0
  67. package/src/solid/context-menu.tsx +12 -2
  68. package/src/solid/dialog-parts.tsx +181 -42
  69. package/src/solid/dialog.tsx +46 -74
  70. package/src/solid/dock-edit.tsx +5 -4
  71. package/src/solid/dock.tsx +3 -3
  72. package/src/solid/dropdown-menu.tsx +15 -7
  73. package/src/solid/entity-selector.tsx +2 -1
  74. package/src/solid/form.tsx +4 -3
  75. package/src/solid/hover-card.tsx +7 -2
  76. package/src/solid/icon-nodes.ts +71 -0
  77. package/src/solid/icon-picker.tsx +2 -1
  78. package/src/solid/icon.tsx +42 -39
  79. package/src/solid/image-picker.tsx +14 -13
  80. package/src/solid/index.ts +9 -2
  81. package/src/solid/input-group.tsx +5 -3
  82. package/src/solid/input-otp.tsx +2 -1
  83. package/src/solid/item.tsx +4 -4
  84. package/src/solid/logo.tsx +5 -4
  85. package/src/solid/picker-row.tsx +5 -4
  86. package/src/solid/picker-search.tsx +2 -1
  87. package/src/solid/popover.tsx +18 -10
  88. package/src/solid/responsive-dialog.tsx +17 -10
  89. package/src/solid/sheet.tsx +47 -79
  90. package/src/solid/spotlight.tsx +23 -11
  91. package/src/solid/stale-veil.tsx +20 -0
  92. package/src/solid/switch.tsx +8 -6
  93. package/src/solid/tabs.tsx +373 -53
  94. package/src/solid/toggle-group.tsx +305 -93
  95. package/src/solid/tooltip.tsx +285 -26
  96. package/src/styles/globals.css +6 -2
  97. package/src/styles/theme.css +10 -5
  98. package/dist/lib/when-animations-settle.d.ts +0 -4
  99. package/dist/solid/bottom-sheet/focus-trap.d.ts +0 -6
  100. package/dist/solid/bottom-sheet/scroll-lock.d.ts +0 -2
  101. package/dist/solid/bottom-sheet/sheet-motion.d.ts +0 -1
  102. package/src/lib/when-animations-settle.ts +0 -12
  103. package/src/solid/bottom-sheet/focus-trap.ts +0 -63
  104. package/src/solid/bottom-sheet/scroll-lock.ts +0 -66
  105. package/src/solid/bottom-sheet/sheet-motion.ts +0 -4
package/SPEC.md CHANGED
@@ -180,7 +180,8 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
180
180
  | a panel | `<Card>` | `border bg-card/NN backdrop-blur` |
181
181
  | a floating panel | `<Overlay>` / the overlay-wearing primitive | raw `bg-popover shadow` |
182
182
  | a modal | `<ResponsiveDialog>` (desktop dialog + mobile bottom sheet), `<Dialog>` for desktop-only; `anchor={el}` on the content opens the desktop panel beside the element that opened it | `<Sheet side="bottom">` as a modal; a popover restyled or repositioned as a modal |
183
- | an avatar or icon beside a modal title | `<Header media={…}>` | a hand-rolled row inside the header |
183
+ | the top of a modal: what it is about and what it asks | `<ResponsiveDialogHead icon tone title line>` (or `DialogHead`, `AlertDialogHead`; `avatar` for a dialog about a person): media, a few-word title, one line, no free children | `*Header` with a title, a paragraph and a hand-rolled media row; a title and a paragraph with no media |
184
+ | a yes/no on one object | `<ConfirmDialog icon title line actionLabel onConfirm>`; `children` shows the thing | a hand-written `AlertDialogContent` with a header and a paragraph |
184
185
  | a word a homeowner may not know (an account kind, a feature name) | `<Term term={…}>`: tap opens an icon, one line and a docs link in place; the app keeps one glossary of definitions | a helper paragraph or a hover-only tooltip explaining it |
185
186
  | a tab row in a modal header | `<Tabs layout="split">` around the parts, `<Header wrap action={<TabsList class="w-auto">…}>` | `class="contents"` on `Tabs` and `flex-wrap` by hand |
186
187
  | a form inside a modal | `<Body as="form" id="…">` + a footer button with `form="…"` | a `display: contents` form wrapper inside the Body |
@@ -201,6 +202,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
201
202
  | one colour out of a few | `<SwatchPicker>` (+ a picker as its child) | round buttons by hand |
202
203
  | an editor that leaves the page live behind it | `<DockedPanel>` + its Header, Body, Footer | a `<Sheet>` with its scrim hidden |
203
204
  | tabs above a stack of toggle groups | `<TabsTrigger icon>` | an `<Icon>` placed inside the trigger by hand |
205
+ | a tab row on its own, a glyph beside each word | `<TabsTrigger icon inline>` | an `<Icon>` placed inside the trigger by hand |
204
206
  | picking one area, or several | `<AreaPicker>` (`values` + `onValuesChange` for multi) | a hand-rolled checkbox list of areas |
205
207
  | a field-shaped picker's trigger | `<PickerTrigger>` (chevron, clear button, expanded state) | a `PICKER_TRIGGER` button with its own chevron |
206
208
  | a table that can grow past a screenful | `createTableWindow(rows, { resetOn })` + `<TableLoadMore>` at its end | every row rendered at once; an `IntersectionObserver` by hand |
@@ -216,6 +218,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
216
218
  | tools beside the dock while a mode is on, or a control that belongs to the dock but is no item | `<Dock companion companionOpen>`: a second glass unit that grows out of the dock, above a bottom dock and under a side dock (so a side dock keeps its width), and adds to its measured size; `<Dock lead>`: inside the glass before the strip, never paged away | a bar positioned against `--dock-height` in the app, a chip that pages with the items |
217
219
  | a segmented pick in a column | `<ToggleGroup orientation="vertical">` | a column of buttons with a hand-drawn selection |
218
220
  | pointing at a control while the user operates it | `<Spotlight>` (`blocking` on a targetless veil so the action inside the bubble is the only press that lands; a target taller than half the viewport places the bubble inside it, near the top, instead of above or below; the bubble carries a tail toward its `anchor`, which defaults to `target` and may point at a different element than the hole) | a hand-rolled fixed overlay with a cutout |
221
+ | marking content that is a moment old and not live yet | `<StaleVeil shown>` as the last child of a positioned parent, with `STALE_CONTENT` (black and white, no transition) on that parent, surface tint included: a 40% veil in `--background` that fades in once on `--duration-state`, inert and `aria-hidden` (the host names and announces the state) | a hand-rolled dim `div`, a `backdrop-filter` grey, a looping pulse or a spinner over the content |
219
222
 
220
223
  Server-run `.astro` markup imports `@glasshome/ui/solid` too: the `solid`
221
224
  export condition hands Astro the source, and a component with no `client:`
@@ -250,6 +253,20 @@ answer; every rule here makes that hunt shorter.
250
253
  stop at one bordered row layer (`SectionRow`, `OptionCard`). A `Card` or
251
254
  `SectionCard` never goes inside another glass surface.
252
255
 
256
+ ## Dialog anatomy
257
+
258
+ A homeowner opens a dialog with one question: what is this asking me? The head answers it before any line is read.
259
+
260
+ 1. **Head.** `*Head`: media (a toned icon per state, or the avatar when the dialog is about a person), a title of at most six words that names the outcome or the question ("Same person?", "Remove Anna?"), and at most one line of at most 90 characters and one sentence. No free children.
261
+ 2. **Body shows the thing.** Avatars, a code, a preview, the choices. A paragraph of help becomes the thing itself, or a `Term` in the line.
262
+ 3. **Left-aligned.** No `text-center`, `self-center`, `mx-auto` or a centred `flex-col` stack. A code or a QR may centre with a `dialog-anatomy-ok` reason.
263
+ 4. **Actions live in the Footer**, right-aligned, primary last. A Body holds no `Button` except an icon button, a `CopyButton`, a link, an `Alert` action and a button inside a row (`SectionRow`, `li`, `OptionCard`, input group). A Head `action` is a step indicator, tabs, a close or a link, never the work.
264
+ 5. **The Footer holds buttons**: no sentence, no `mr-auto`, no `justify-*`. A confirm is `ConfirmDialog`.
265
+ 6. **A confirm names its object** in the title and its consequence in the line.
266
+ 7. **A workbench** (a search palette, a catalog) has no Head and carries `ariaLabel`.
267
+
268
+ Held by the `dialog-anatomy` gate in apps and in this package.
269
+
253
270
  ## Motion (the pillar)
254
271
 
255
272
  Motion is one system, not per-component flair. Four rules, all held by
@@ -280,10 +297,16 @@ Motion is one system, not per-component flair. Four rules, all held by
280
297
  lifecycle; hub calls it directly. Light-DOM loops gate on that attribute,
281
298
  widget shadow roots on the inherited `--motion-ambient` (1 live, else 0)
282
299
  or, for a loop that can only pause, `--motion-play` (`running` live, else
283
- `paused`). A wrapper with `data-motion="still"` opts out: thumbnails are
300
+ `paused`). The tokens go live only under `[data-motion-reader]`, which the
301
+ widget realm puts on a widget whose styles name them: a custom property
302
+ written on `html` restyles the whole page. A wrapper with `data-motion="still"` opts out: thumbnails are
284
303
  stills. A mode indicator is not decoration: it may loop for as long
285
304
  as its mode is on, provided the mode itself is bounded (dash leaves edit mode
286
305
  after three idle minutes). `.glass-edge-orbit` is that rim.
306
+ An open modal pauses all of it under itself: once its open animation ends,
307
+ `coverPage()` sets `data-covered` on the app's `[data-page]` root (never
308
+ `html`), and a sealed widget's modal reaches it through the realm. An app
309
+ without a `[data-page]` root gets no pause.
287
310
 
288
311
  `HOLD_MOTION`: hold progress. A fill grows out of the touch while held, dissolves once the hold fires, and drains back faster if let go early (holding the dock to change modes).
289
312
 
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { CONTROL_H, CONTROL_ON, FIELD_CHROME, FIELD_CONTROL, FIELD_TEXT, FOCUS_R
8
8
  export { Z, Z_CLASS } from "./lib/layers.js";
9
9
  export { LOGO_DEFAULT_SIZE, LOGO_DEFAULT_SRC, LOGO_DEFAULT_SUB, LOGO_MARK_CLASS, LOGO_MARK_PX, LOGO_NAME_CLASS, LOGO_ROOT_CLASS, LOGO_SIZES, LOGO_STACK_CLASS, LOGO_SUB_CLASS, type LogoSize, } from "./lib/logo-lockup.js";
10
10
  export { MENU_ITEM, MENU_ITEM_BASE, MENU_ITEM_X, MENU_LABEL, MENU_SEPARATOR, } from "./lib/menu-classes.js";
11
- export { FIELD_MOTION, MODAL_MOTION, MORPH_MOTION, OVERLAY_MOTION, PRESS_DIP, SCRIM_MOTION, SETTLE_MOTION, STAGGER, } from "./lib/motion-classes.js";
11
+ export { FIELD_MOTION, MODAL_MOTION, MORPH_MOTION, OVERLAY_MOTION, PRESS_DIP, SCRIM_MOTION, SETTLE_MOTION, STAGGER, STALE_CONTENT, } from "./lib/motion-classes.js";
12
12
  export { createHold, HOLD_GRACE_MS, HOLD_MS, spendLongPress } from "./lib/hold.js";
13
13
  export type { Hold, HoldOptions, HoldPress } from "./lib/hold.js";
14
14
  export { MOTION_WINDOW_MS, startMotionWindow } from "./lib/motion-window.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as e, $t as t, A as n, B as r, Bt as i, C as a, D as ee, Dt as te, E as ne, Et as o, F as s, G as c, Gt as l, H as u, I as d, It as f, J as p, Jt as m, K as h, L as g, M as _, Mt as v, N as y, O as b, Ot as x, P as S, R as C, Rt as w, S as T, U as E, Ut as D, V as O, Vt as k, W as A, Wt as j, Xt as M, Yt as N, Z as P, Zt as F, _ as I, _t as L, at as R, b as z, c as B, cn as V, ct as H, d as U, dn as W, dt as G, en as K, et as q, f as J, ft as Y, g as X, gt as Z, h as re, ht as ie, i as ae, in as oe, it as se, j as ce, jt as le, k as ue, l as de, ln as fe, lt as pe, m as me, mt as he, n as ge, nn as _e, nt as ve, o as ye, on as be, ot as xe, p as Se, pt as Ce, q as we, qt as Te, r as Ee, rn as De, rt as Oe, s as ke, sn as Ae, st as je, t as Me, tn as Ne, tt as Pe, u as Fe, un as Q, ut as Ie, v as Le, w as Re, x as ze, y as Be, yt as Ve, z as He, zt as Ue } from "./utils-DXEj_oXa.js";
1
+ import { A as e, B as t, Bt as n, C as r, Cn as i, D as a, Dn as ee, En as te, F as ne, G as o, Gt as s, H as c, I as l, J as u, K as d, L as f, M as p, Mt as m, N as h, P as g, Qt as _, R as v, S as y, Sn as b, T as x, Tn as S, U as C, V as w, Vt as T, W as E, Wt as D, X as O, Y as k, Yt as A, Z as j, Zt as M, _ as N, _n as P, _t as F, an as I, at as L, b as R, bn as z, bt as B, c as V, ct as H, d as U, dn as W, dt as G, en as K, et as q, f as J, fn as Y, ft as X, g as Z, gn as re, gt as ie, h as ae, hn as oe, ht as se, i as ce, in as le, it as ue, j as de, l as fe, ln as pe, lt as me, m as he, mt as ge, n as _e, nt as ve, o as ye, on as be, ot as xe, p as Se, pn as Ce, pt as we, q as Te, r as Ee, rn as De, rt as Oe, s as ke, st as Ae, t as je, tn as Me, u as Ne, un as Pe, ut as Fe, v as Q, vn as Ie, vt as Le, w as Re, wn as ze, y as Be, yn as Ve, yt as He, z as Ue, zt as We } from "./utils-CxAii-e9.js";
2
2
  //#region src/lib/motion-window.ts
3
3
  var $ = 3e4;
4
- function We(e = $) {
4
+ function Ge(e = $) {
5
5
  let t, n = document.documentElement, r = () => {
6
6
  clearTimeout(t), t = void 0, delete n.dataset.motion;
7
7
  }, i = () => {
@@ -17,4 +17,4 @@ function We(e = $) {
17
17
  };
18
18
  }
19
19
  //#endregion
20
- export { t as ALERT_CLASS, K as ALERT_CONTENT_CLASS, Ne as ALERT_DESCRIPTION_CLASS, _e as ALERT_ICON_BG_CLASS, De as ALERT_ICON_CLASS, oe as ALERT_ICON_PATHS, be as ALERT_TITLE_CLASS, Ae as ALERT_TONES, Te as BUTTON_DEFAULT_CLASS, m as BUTTON_OUTLINE_CLASS, Ve as CARD_BLUR, o as CARD_SURFACE, te as CARD_SURFACE_BASE, x as CARD_SURFACE_OPAQUE, q as CAROUSEL_DOTS, Pe as CAROUSEL_VIEWPORT, me as CHIP, je as CONTROL_H, I as CONTROL_H_TOUCH, H as CONTROL_ON, pe as FIELD_CHROME, Ie as FIELD_CONTROL, f as FIELD_MOTION, G as FIELD_TEXT, z as FLOATING_PANEL, Y as FOCUS_RING, b as HOLD_GRACE_MS, ue as HOLD_MS, N as ICON_BUTTON_CLASS, re as ICON_PILL, X as ICON_PILL_TINT, Ce as INPUT_CLASS, he as INPUT_SURFACE, ie as INVALID_RING, g as LOGO_DEFAULT_SIZE, C as LOGO_DEFAULT_SRC, He as LOGO_DEFAULT_SUB, r as LOGO_MARK_CLASS, O as LOGO_MARK_PX, u as LOGO_NAME_CLASS, E as LOGO_ROOT_CLASS, A as LOGO_SIZES, c as LOGO_STACK_CLASS, h as LOGO_SUB_CLASS, _ as MENU_ITEM, y as MENU_ITEM_BASE, S as MENU_ITEM_X, s as MENU_LABEL, d as MENU_SEPARATOR, ge as MOBILE_BREAKPOINT, w as MODAL_MOTION, Ue as MORPH_MOTION, $ as MOTION_WINDOW_MS, M as OUTLINE_SURFACE, ze as OVERLAY_BLUR, i as OVERLAY_MOTION, T as OVERLAY_SURFACE, a as OVERLAY_SURFACE_BASE, Re as OVERLAY_SURFACE_OPAQUE, Le as PICKER_LIST, Be as PICKER_TRIGGER, R as POSITION_BAR, xe as POSITION_BAR_LIT, k as PRESS_DIP, ne as SCRIM_CLASS, D as SCRIM_MOTION, Fe as SECTION_INNER_RADIUS, U as SECTION_OUTER_RADIUS, J as SECTION_PADDING, Se as SECTION_ROW_CLASS, le as SECTION_ROW_SURFACE, de as SEGMENT_ITEM, j as SETTLE_MOTION, l as STAGGER, ae as THUMB_CLASS, ye as THUMB_RAIL_BLEED, ke as THUMB_RAIL_PAD, B as THUMB_SIZE, v as TRACK_SURFACE, we as Z, p as Z_CLASS, V as alertBorder, fe as alertFill, Q as alertIconBgStyle, W as alertIconFill, ee as anchorToTriggerTop, F as buttonVariants, ve as carouselDot, Oe as carouselItem, se as carouselTrack, Me as cn, Z as copyImage, L as copyText, n as createHold, Ee as createIsMobile, P as glassToneText, ce as spendLongPress, We as startMotionWindow, e as toneTextMix };
20
+ export { oe as ALERT_CLASS, re as ALERT_CONTENT_CLASS, P as ALERT_DESCRIPTION_CLASS, Ie as ALERT_ICON_BG_CLASS, Ve as ALERT_ICON_CLASS, z as ALERT_ICON_PATHS, b as ALERT_TITLE_CLASS, i as ALERT_TONES, pe as BUTTON_DEFAULT_CLASS, Pe as BUTTON_OUTLINE_CLASS, m as CARD_BLUR, We as CARD_SURFACE, n as CARD_SURFACE_BASE, T as CARD_SURFACE_OPAQUE, Oe as CAROUSEL_DOTS, ue as CAROUSEL_VIEWPORT, he as CHIP, Fe as CONTROL_H, N as CONTROL_H_TOUCH, G as CONTROL_ON, X as FIELD_CHROME, we as FIELD_CONTROL, A as FIELD_MOTION, ge as FIELD_TEXT, R as FLOATING_PANEL, se as FOCUS_RING, de as HOLD_GRACE_MS, p as HOLD_MS, W as ICON_BUTTON_CLASS, ae as ICON_PILL, Z as ICON_PILL_TINT, ie as INPUT_CLASS, F as INPUT_SURFACE, Le as INVALID_RING, t as LOGO_DEFAULT_SIZE, w as LOGO_DEFAULT_SRC, c as LOGO_DEFAULT_SUB, C as LOGO_MARK_CLASS, E as LOGO_MARK_PX, o as LOGO_NAME_CLASS, d as LOGO_ROOT_CLASS, Te as LOGO_SIZES, u as LOGO_STACK_CLASS, k as LOGO_SUB_CLASS, ne as MENU_ITEM, l as MENU_ITEM_BASE, f as MENU_ITEM_X, v as MENU_LABEL, Ue as MENU_SEPARATOR, _e as MOBILE_BREAKPOINT, M as MODAL_MOTION, _ as MORPH_MOTION, $ as MOTION_WINDOW_MS, Y as OUTLINE_SURFACE, y as OVERLAY_BLUR, K as OVERLAY_MOTION, r as OVERLAY_SURFACE, Re as OVERLAY_SURFACE_BASE, x as OVERLAY_SURFACE_OPAQUE, Q as PICKER_LIST, Be as PICKER_TRIGGER, H as POSITION_BAR, me as POSITION_BAR_LIT, Me as PRESS_DIP, a as SCRIM_CLASS, De as SCRIM_MOTION, Ne as SECTION_INNER_RADIUS, U as SECTION_OUTER_RADIUS, J as SECTION_PADDING, Se as SECTION_ROW_CLASS, D as SECTION_ROW_SURFACE, fe as SEGMENT_ITEM, le as SETTLE_MOTION, I as STAGGER, be as STALE_CONTENT, ce as THUMB_CLASS, ye as THUMB_RAIL_BLEED, ke as THUMB_RAIL_PAD, V as THUMB_SIZE, s as TRACK_SURFACE, O as Z, j as Z_CLASS, ze as alertBorder, S as alertFill, te as alertIconBgStyle, ee as alertIconFill, e as anchorToTriggerTop, Ce as buttonVariants, L as carouselDot, xe as carouselItem, Ae as carouselTrack, je as cn, He as copyImage, B as copyText, h as createHold, Ee as createIsMobile, q as glassToneText, g as spendLongPress, Ge as startMotionWindow, ve as toneTextMix };
@@ -1,4 +1,34 @@
1
1
  import type { JSX } from "solid-js";
2
+ export interface Box {
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export type Side = "top" | "bottom" | "left" | "right";
9
+ export type Align = "start" | "center" | "end";
10
+ export interface AnchorPlace {
11
+ side: Side;
12
+ align: Align;
13
+ offset: number;
14
+ matchAnchorWidth: boolean;
15
+ }
16
+ export interface Placement {
17
+ left: number;
18
+ top: number;
19
+ side: Side;
20
+ maxWidth: number;
21
+ maxHeight: number;
22
+ }
23
+ /** Where a part of this size sits beside its anchor: on the chosen side, or the opposite when that
24
+ * side lacks room and the other has more, aligned along the edge and held 16px inside the viewport. */
25
+ export declare function placeBeside(anchor: Box, floating: {
26
+ width: number;
27
+ height: number;
28
+ }, viewport: {
29
+ width: number;
30
+ height: number;
31
+ }, place: AnchorPlace): Placement;
2
32
  /** A panel that grows out of the element that opened it. The --morph-* values start the panel
3
33
  * clipped to the element's box (MORPH_MOTION's keyframes), so it unrolls out of it. */
4
34
  export declare function overAnchor(anchor: HTMLElement, width: number, height?: number): JSX.CSSProperties;
@@ -0,0 +1,12 @@
1
+ import type { Accessor } from "solid-js";
2
+ import { type Align, type Side } from "../anchor-placement";
3
+ export interface AnchoredOptions {
4
+ anchor: Accessor<Element | undefined>;
5
+ floating: Accessor<HTMLElement | undefined>;
6
+ open: Accessor<boolean>;
7
+ side?: Accessor<Side>;
8
+ align?: Accessor<Align>;
9
+ offset?: number;
10
+ matchAnchorWidth?: boolean;
11
+ }
12
+ export declare function createAnchored(options: AnchoredOptions): void;
@@ -0,0 +1,24 @@
1
+ import { type Accessor } from "solid-js";
2
+ export declare const TYPEAHEAD_MS = 1000;
3
+ type Orientation = "horizontal" | "vertical";
4
+ type HighlightBy = "keyboard" | "pointer";
5
+ export interface CollectionOptions {
6
+ root: Accessor<HTMLElement | undefined>;
7
+ itemSelector: string;
8
+ orientation: Accessor<Orientation>;
9
+ focus: "roving" | "virtual";
10
+ loop?: Accessor<boolean>;
11
+ dir?: Accessor<"ltr" | "rtl">;
12
+ /** Keys that hold the tab stop while focus is outside, first present wins (a selected tab). */
13
+ preferred?: Accessor<readonly string[]>;
14
+ }
15
+ export interface Collection {
16
+ highlighted: Accessor<string | undefined>;
17
+ highlight: (key: string, by: HighlightBy) => void;
18
+ tabIndex: (key: string) => 0 | -1;
19
+ onKeyDown: (event: KeyboardEvent) => void;
20
+ /** Items call this as they mount, unmount or change disabled, so the tab stop always sits on a present, enabled item. */
21
+ refresh: () => void;
22
+ }
23
+ export declare function createCollection(options: CollectionOptions): Collection;
24
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type Accessor } from "solid-js";
2
+ export interface ControllableOptions<T> {
3
+ value: Accessor<T | undefined>;
4
+ defaultValue: Accessor<T>;
5
+ onChange?: (next: T) => void;
6
+ equals?: (a: T, b: T) => boolean;
7
+ }
8
+ export declare function createControllableSignal<T>(options: ControllableOptions<T>): [Accessor<T>, (next: T) => void];
@@ -0,0 +1,11 @@
1
+ import type { Accessor } from "solid-js";
2
+ import { type LayerHandle } from "./layer-stack";
3
+ export type DismissReason = "escape" | "outside-press";
4
+ export interface DismissOptions {
5
+ layer: LayerHandle;
6
+ /** `event` is the keydown for `escape` and the pointerdown for `outside-press`. */
7
+ onDismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void;
8
+ outsidePress?: Accessor<boolean>;
9
+ escapeFrom?: "layer" | "document";
10
+ }
11
+ export declare function createDismiss(options: DismissOptions): void;
@@ -0,0 +1,18 @@
1
+ import { type Accessor } from "solid-js";
2
+ export declare const CANDIDATES = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
3
+ export type InitialFocus = "container" | "first" | ((container: HTMLElement) => HTMLElement | null);
4
+ export interface FocusScopeOptions {
5
+ container: Accessor<HTMLElement | undefined>;
6
+ active: Accessor<boolean>;
7
+ trapped: Accessor<boolean>;
8
+ initialFocus?: InitialFocus;
9
+ }
10
+ export interface FocusScope {
11
+ skipRestore(): void;
12
+ untrap(): void;
13
+ }
14
+ export declare const hasFocus: (el: Element) => boolean;
15
+ export declare function focusWithoutTracking(el: HTMLElement | null | undefined, options?: {
16
+ preventScroll?: boolean;
17
+ }): boolean;
18
+ export declare function createFocusScope(options: FocusScopeOptions): FocusScope;
@@ -0,0 +1,7 @@
1
+ import { type Accessor } from "solid-js";
2
+ import type { LayerHandle } from "./layer-stack";
3
+ export interface HideOutsideOptions {
4
+ layer: LayerHandle;
5
+ active: Accessor<boolean>;
6
+ }
7
+ export declare function createHideOutside(options: HideOutsideOptions): void;
@@ -0,0 +1,33 @@
1
+ import { type Accessor } from "solid-js";
2
+ export type LayerKind = "modal" | "popover" | "menu" | "tooltip" | "tour";
3
+ export type TopLayer = "auto" | "manual";
4
+ export interface LayerOptions {
5
+ element: Accessor<HTMLElement | undefined>;
6
+ open: Accessor<boolean>;
7
+ kind: LayerKind;
8
+ escape: Accessor<boolean>;
9
+ readsOwnEscape?: boolean;
10
+ dismiss?: () => void;
11
+ trigger?: Accessor<Element | undefined>;
12
+ topLayer?: TopLayer;
13
+ }
14
+ export interface Layer {
15
+ readonly id: number;
16
+ readonly kind: LayerKind;
17
+ readonly readsOwnEscape: boolean;
18
+ element(): HTMLElement | undefined;
19
+ trigger(): Element | undefined;
20
+ escape(): boolean;
21
+ dismiss?: () => void;
22
+ }
23
+ export interface LayerHandle {
24
+ layer: Accessor<Layer | undefined>;
25
+ isTop: Accessor<boolean>;
26
+ above(): readonly Layer[];
27
+ containsPath(path: readonly EventTarget[]): boolean;
28
+ }
29
+ export declare const layerStack: {
30
+ layers: Accessor<readonly Layer[]>;
31
+ top: Accessor<Layer | undefined>;
32
+ };
33
+ export declare function registerLayer(options: LayerOptions): LayerHandle;
@@ -0,0 +1,66 @@
1
+ import { type Accessor, type ComponentProps, type JSX, type ValidComponent } from "solid-js";
2
+ export type ModalRole = "dialog" | "alertdialog";
3
+ export interface ModalRootProps {
4
+ open?: boolean;
5
+ defaultOpen?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ modal?: boolean;
8
+ keep?: boolean;
9
+ role?: ModalRole;
10
+ children?: JSX.Element;
11
+ }
12
+ export interface ModalContext {
13
+ isOpen: Accessor<boolean>;
14
+ close: () => void;
15
+ toggle: () => void;
16
+ modal: Accessor<boolean>;
17
+ keep: Accessor<boolean>;
18
+ dormant: Accessor<boolean>;
19
+ bindDormant: (source: Accessor<boolean>) => void;
20
+ readonly role: ModalRole;
21
+ titleId: Accessor<string | undefined>;
22
+ registerTitle: (id: string) => () => void;
23
+ descriptionId: Accessor<string | undefined>;
24
+ registerDescription: (id: string) => () => void;
25
+ contentId: Accessor<string | undefined>;
26
+ registerContent: (id: string) => () => void;
27
+ triggerRef: Accessor<HTMLElement | undefined>;
28
+ setTriggerRef: (el: HTMLElement | undefined) => void;
29
+ panel: Accessor<HTMLElement | undefined>;
30
+ setPanel: (el: HTMLElement | undefined) => void;
31
+ }
32
+ export declare function useDialogContext(): ModalContext;
33
+ /** Whether the modal around the caller is closed and kept; false outside one, so a ticker inside can pause. */
34
+ export declare function useDialogDormant(): Accessor<boolean>;
35
+ export declare function ModalRoot(props: ModalRootProps): JSX.Element;
36
+ export type ModalPartProps<T extends ValidComponent> = {
37
+ as?: T;
38
+ } & Omit<ComponentProps<T>, "as">;
39
+ export declare function ModalTrigger<T extends ValidComponent = "button">(props: ModalPartProps<T>): JSX.Element;
40
+ export declare function ModalTitle<T extends ValidComponent = "h2">(props: ModalPartProps<T>): JSX.Element;
41
+ export declare function ModalDescription<T extends ValidComponent = "p">(props: ModalPartProps<T>): JSX.Element;
42
+ export interface ModalFrameProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "ref" | "style" | "role" | "class"> {
43
+ slot: string;
44
+ panelClass: string;
45
+ scrimClass: string;
46
+ panelStyle?: JSX.CSSProperties;
47
+ ariaLabel?: string;
48
+ ref?: (el: HTMLElement) => void;
49
+ as?: ValidComponent;
50
+ mount?: Node;
51
+ exitMs: number;
52
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
53
+ onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
54
+ onInteractOutside?: (event: InteractOutsideEvent) => void;
55
+ onOpenAutoFocus?: (event: Event) => void;
56
+ onCloseAutoFocus?: (event: Event) => void;
57
+ }
58
+ interface OutsideDetail<T extends Event> {
59
+ originalEvent: T;
60
+ isContextMenu: boolean;
61
+ }
62
+ export type PointerDownOutsideEvent = CustomEvent<OutsideDetail<PointerEvent>>;
63
+ export type FocusOutsideEvent = CustomEvent<OutsideDetail<FocusEvent>>;
64
+ export type InteractOutsideEvent = PointerDownOutsideEvent | FocusOutsideEvent;
65
+ export declare function ModalFrame(props: ModalFrameProps): JSX.Element;
66
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type ComponentProps, type JSX, type ValidComponent } from "solid-js";
2
+ export type PolymorphicProps<D extends ValidComponent> = {
3
+ as?: ValidComponent;
4
+ defaultAs: D;
5
+ } & ComponentProps<D>;
6
+ export declare function Polymorphic<D extends ValidComponent>(props: PolymorphicProps<D>): JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type Accessor } from "solid-js";
2
+ export type PresencePhase = "opening" | "open" | "closing" | "closed";
3
+ export type MotionEvent = AnimationEvent | TransitionEvent;
4
+ export interface PresenceOptions {
5
+ present: Accessor<boolean>;
6
+ element: Accessor<Element | undefined>;
7
+ exitMs: number;
8
+ accept?: (e: MotionEvent) => boolean;
9
+ keep?: Accessor<boolean>;
10
+ }
11
+ export interface Presence {
12
+ mounted: Accessor<boolean>;
13
+ phase: Accessor<PresencePhase>;
14
+ dormant: Accessor<boolean>;
15
+ }
16
+ export declare const PRESENCE_TIMEOUT_MS = 1000;
17
+ export declare function watchMotion(el: Element, exitMs: number, done: () => void, accept?: (e: MotionEvent) => boolean): () => void;
18
+ export declare function createPresence(options: PresenceOptions): Presence;
@@ -0,0 +1,13 @@
1
+ import { type JSX, mergeProps } from "solid-js";
2
+ export declare function effect<T>(compute: () => T, apply: (value: T) => (() => void) | void): void;
3
+ export declare const merge: typeof mergeProps;
4
+ export declare function omit<T extends object, K extends keyof T>(props: T, ...keys: K[]): {
5
+ [P in keyof T as Exclude<P, K>]: T[P];
6
+ };
7
+ /** Solid's handler prop is a union: a plain function, or the bound
8
+ * `[handler, data]` form that calls `handler(data, event)`. A wrapper that
9
+ * only checks for a function silently drops the bound one. */
10
+ export declare function callEventHandler<T, E extends Event>(event: E & {
11
+ currentTarget: T;
12
+ target: Element;
13
+ }, handler: JSX.EventHandlerUnion<T, E> | undefined): void;
@@ -3,12 +3,15 @@ export declare const FIELD_MOTION = "data-[closed]:animate-select-out data-[expa
3
3
  export declare const MORPH_MOTION = "[--morph-w:var(--kb-popper-anchor-width)] min-w-[var(--kb-popper-anchor-width)] data-[expanded]:animate-morph-in data-[closed]:animate-morph-out";
4
4
  export declare const ANCHORED_MOTION = "data-[expanded]:animate-anchored-in data-[closed]:animate-morph-out";
5
5
  export declare const STAGGER = "gh-stagger";
6
- export declare const MODAL_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[expanded]:zoom-in-[0.94] data-[expanded]:slide-in-from-bottom-2 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fade-out-0 data-[closed]:zoom-out-[0.96]";
7
- export declare const SCRIM_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fade-out-0";
6
+ export declare const MODAL_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[expanded]:zoom-in-[0.94] data-[expanded]:slide-in-from-bottom-2 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0 data-[closed]:zoom-out-[0.96]";
7
+ export declare const SCRIM_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0";
8
8
  export declare const SETTLE_MOTION = "animate-in fade-in-0 slide-in-from-bottom-1 duration-(--duration-state) ease-(--ease-expand)";
9
+ export declare const VEIL_MOTION = "animate-in fade-in-0 duration-(--duration-state) ease-(--ease-emphasis) motion-reduce:animate-none in-[.reduce-motion]:animate-none";
10
+ export declare const STALE_CONTENT = "grayscale";
9
11
  export declare const PRESS_DIP = "active:scale-[0.97]";
10
12
  export declare const HOLD_MOTION = "scale-0 opacity-0 transition-[scale,opacity] duration-(--duration-state) ease-(--ease-contract) data-[hold]:scale-100 data-[hold]:opacity-100 data-[hold]:duration-(--duration-hold) data-[hold]:ease-linear data-[fired]:scale-100 data-[fired]:opacity-0";
11
13
  export declare const DOCK_ARRIVE_MOTION = "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 ring-2 ring-primary shadow-[0_0_14px_var(--primary)] group-data-[arrived]:animate-dock-arrive";
12
14
  export declare const DOCK_EDIT_MOTION = "data-[editing]:animate-dock-jiggle data-[editing]:nth-even:[animation-direction:alternate-reverse] data-[dragging]:animate-none";
13
15
  export declare const RISE_MOTION = "origin-bottom transition-[opacity,scale,translate] data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:pointer-events-none data-[closed]:translate-y-2 data-[closed]:scale-95 data-[closed]:opacity-0";
14
16
  export declare const TRAVEL_MOTION = "transition-[translate,clip-path] duration-(--duration-morph) ease-(--ease-expand)";
17
+ export declare const MOTION_EXIT_MS: Record<"overlay" | "modal" | "anchored" | "scrim" | "field" | "sheet", number>;
@@ -2,7 +2,9 @@ export declare const OVERLAY_BLUR = "backdrop-blur-[var(--glass-blur,var(--mater
2
2
  export declare const OVERLAY_SURFACE_BASE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)]";
3
3
  export declare const OVERLAY_SURFACE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(var(--_material-vibrancy,1)*1.2)] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
4
4
  export declare const OVERLAY_SURFACE_OPAQUE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:var(--popover)]";
5
- export declare const SCRIM_CLASS = "bg-scrim backdrop-blur-md";
5
+ export declare const SCRIM_CLASS = "bg-scrim backdrop-blur-md pointer-coarse:backdrop-blur-none";
6
+ export declare const SCROLL_CONTAIN = "overscroll-contain";
7
+ export declare const SCRIM_CONTAIN = "overscroll-contain overflow-hidden";
6
8
  export declare const PANEL_TAIL: string;
7
9
  export declare const FLOATING_PANEL_SURFACE: string;
8
10
  export declare const FLOATING_PANEL: string;
@@ -12,3 +14,4 @@ export declare const anchorToTriggerTop: (anchor?: HTMLElement) => {
12
14
  width: number;
13
15
  height: number;
14
16
  };
17
+ export declare const LAYER_ROOT: string;
@@ -0,0 +1,8 @@
1
+ /** On a modal's panel from the end of its open animation; the widget realm carries it out of a sealed widget. */
2
+ export declare const COVERING_ATTR = "data-covering";
3
+ /** Pauses the page's ambient loops while a modal covers it: one attribute on the app's [data-page] root, never on html. Returns the release. */
4
+ export declare function coverPage(): () => void;
5
+ /** A modal panel covers the page from now until the returned release runs. */
6
+ export declare function coverNow(panel: Element): () => void;
7
+ /** A modal panel covers the page once its open animation ends, if it is still open then, until the returned release runs. */
8
+ export declare function coverOnceOpen(panel: Element, open: () => boolean): () => void;
@@ -1,7 +1,12 @@
1
1
  import { type Accessor } from "solid-js";
2
- import { type InitialFocus } from "../solid/bottom-sheet/focus-trap.js";
3
2
  /** True for a node inside a shadow root, where page-level layer logic sees only the root's host. */
4
3
  export declare const inShadowRoot: (node: Node | undefined) => boolean;
4
+ export declare const ReportCovered: import("solid-js").Context<((covered: Accessor<boolean>) => void) | undefined>;
5
+ /** True while a layer of this Kobalte root sits under an owned modal; the root drops `modal` then. */
6
+ export declare function createCoveredRoot(): {
7
+ covered: Accessor<boolean>;
8
+ report: (covered: Accessor<boolean>) => void;
9
+ };
5
10
  type OutsideEvent = {
6
11
  target: EventTarget | null;
7
12
  preventDefault(): void;
@@ -12,9 +17,10 @@ type AutoFocusEvent = {
12
17
  export interface LayerHandlers {
13
18
  onInteractOutside: (e: OutsideEvent) => void;
14
19
  onCloseAutoFocus: (e: AutoFocusEvent) => void;
15
- onOpenAutoFocus: (e: AutoFocusEvent) => void;
16
20
  /** The shadow root's host while the layer is in one: what the page sees as the target of anything inside. */
17
21
  host: () => Element | undefined;
22
+ /** An owned modal sits above the layer: the modal owns every press and focus until it closes. */
23
+ covered: Accessor<boolean>;
18
24
  }
19
25
  interface ShadowLayerOptions {
20
26
  content: Accessor<HTMLElement | undefined>;
@@ -25,13 +31,9 @@ interface ShadowLayerOptions {
25
31
  trigger?: Accessor<Element | undefined>;
26
32
  /** Menus: any press outside the layer and the layers above it dismisses it, newest or not, as Kobalte's menus do. */
27
33
  tree?: boolean;
28
- /** The layer keeps Tab inside itself (dialogs); its initial focus is then ui's, not Kobalte's. */
29
- trapsFocus?: boolean;
30
- initialFocus?: InitialFocus;
31
34
  consumer: {
32
35
  onInteractOutside?: (e: never) => void;
33
36
  onCloseAutoFocus?: (e: never) => void;
34
- onOpenAutoFocus?: (e: never) => void;
35
37
  };
36
38
  }
37
39
  /**
@@ -1,25 +1,23 @@
1
- import { AlertDialog as AlertDialogPrimitive } from "@kobalte/core/alert-dialog";
2
1
  import type { VariantProps } from "cva";
3
- import { type Component, type ComponentProps, type ParentComponent } from "solid-js";
2
+ import { type Component, type JSX, type ParentComponent } from "solid-js";
4
3
  import { buttonVariants } from "../lib/button-variants.js";
5
- import { type ModalDismissProps, type ModalSize } from "./dialog-parts.js";
6
- declare const AlertDialog: ParentComponent<ComponentProps<typeof AlertDialogPrimitive>>;
7
- declare const AlertDialogTrigger: Component<ComponentProps<typeof AlertDialogPrimitive.Trigger>>;
8
- type AlertDialogContentProps = ComponentProps<typeof AlertDialogPrimitive.Content> & {
4
+ import { type ModalHeadProps, type ModalContentProps, type ModalDismissProps, type ModalSize } from "./dialog-parts.js";
5
+ declare const AlertDialog: ParentComponent<import("./dialog-parts.js").ModalRootSkinProps>;
6
+ declare const AlertDialogTrigger: <T extends import("solid-js").ValidComponent = "button">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, AlertDialogTitle: <T extends import("solid-js").ValidComponent = "h2">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, AlertDialogDescription: <T extends import("solid-js").ValidComponent = "p">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element;
7
+ type AlertDialogContentProps = ModalContentProps & {
9
8
  size?: ModalSize;
10
9
  /** Names a panel that has no `AlertDialogTitle`. A registered Title wins. */
11
10
  ariaLabel?: string;
12
11
  };
13
12
  declare const AlertDialogContent: ParentComponent<AlertDialogContentProps>;
14
- declare const AlertDialogHeader: Component<import("solid-js").JSX.HTMLAttributes<HTMLDivElement> & {
15
- media?: import("solid-js").JSX.Element;
16
- action?: import("solid-js").JSX.Element;
17
- wrap?: boolean;
18
- }>, AlertDialogBody: Component<import("solid-js").JSX.HTMLAttributes<HTMLDivElement> & {
13
+ declare const AlertDialogHeader: Component<import("./dialog-parts.js").ModalHeaderProps>, AlertDialogBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
19
14
  as?: import("solid-js").ValidComponent;
20
- }>, AlertDialogFooter: Component<import("solid-js").JSX.HTMLAttributes<HTMLDivElement>>;
21
- declare const AlertDialogTitle: Component<ComponentProps<typeof AlertDialogPrimitive.Title>>;
22
- declare const AlertDialogDescription: Component<ComponentProps<typeof AlertDialogPrimitive.Description>>;
15
+ }>, AlertDialogFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
16
+ /** An alert dialog is read aloud as a description, and the line carries the consequence. */
17
+ type AlertDialogHeadProps = ModalHeadProps & {
18
+ line: JSX.Element;
19
+ };
20
+ declare const AlertDialogHead: Component<AlertDialogHeadProps>;
23
21
  type AlertDialogButtonProps = ModalDismissProps & Partial<Pick<VariantProps<typeof buttonVariants>, "variant" | "size">>;
24
22
  /** Confirming action. Pass `variant` (e.g. "destructive"); layering a second
25
23
  * buttonVariants() call through `class` cannot work, because the variants
@@ -28,4 +26,4 @@ type AlertDialogButtonProps = ModalDismissProps & Partial<Pick<VariantProps<type
28
26
  declare const AlertDialogAction: ParentComponent<AlertDialogButtonProps>;
29
27
  /** This family's Close: the outline button that dismisses without acting. */
30
28
  declare const AlertDialogCancel: ParentComponent<AlertDialogButtonProps>;
31
- export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, };
29
+ export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHead, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, };
@@ -1,5 +1,5 @@
1
1
  import { type Component, type ComponentProps, type JSX, type ParentComponent, type ValidComponent } from "solid-js";
2
- import { type InitialFocus } from "./focus-trap.js";
2
+ import { type InitialFocus } from "../../lib/behavior/focus-scope.js";
3
3
  interface BottomSheetRootProps {
4
4
  open?: boolean;
5
5
  defaultOpen?: boolean;
@@ -25,11 +25,7 @@ interface BottomSheetContentProps extends ComponentProps<"div"> {
25
25
  }
26
26
  declare const BottomSheetContent: ParentComponent<BottomSheetContentProps>;
27
27
  declare const BottomSheetHandle: Component<ComponentProps<"div">>;
28
- declare const BottomSheetHeader: Component<JSX.HTMLAttributes<HTMLDivElement> & {
29
- media?: JSX.Element;
30
- action?: JSX.Element;
31
- wrap?: boolean;
32
- }>, BottomSheetBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
28
+ declare const BottomSheetHeader: Component<import("../dialog-parts.js").ModalHeaderProps>, BottomSheetBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
33
29
  as?: ValidComponent;
34
30
  }>, BottomSheetFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
35
31
  declare const BottomSheetTitle: Component<ComponentProps<"h2">>;
@@ -1,5 +1,5 @@
1
1
  export declare const EASE = "cubic-bezier(0.32, 0.72, 0, 1)";
2
- export declare const TRANSITION_MS = 500;
2
+ export declare const TRANSITION_MS: number;
3
3
  export declare const DEAD_ZONE_PX = 6;
4
4
  export declare const CLOSE_DISTANCE_RATIO = 0.4;
5
5
  export declare const CLOSE_VELOCITY_PX_PER_MS = 0.5;
@@ -0,0 +1,22 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface ConfirmDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ /** The glyph that tells this confirm from the next. */
6
+ icon: string;
7
+ /** Defaults to destructive red when `destructive`, else the material accent. */
8
+ tone?: string;
9
+ /** The question or the outcome, naming its object: "Remove Anna?". */
10
+ title: string;
11
+ /** The consequence, one line. */
12
+ line: JSX.Element;
13
+ actionLabel: string;
14
+ /** Defaults to true: nearly every confirm is a delete or a removal. */
15
+ destructive?: boolean;
16
+ busy?: boolean;
17
+ onConfirm: () => void;
18
+ /** The thing the confirm is about (avatars, a preview), shown instead of described. */
19
+ children?: JSX.Element;
20
+ }
21
+ /** A yes/no on one object: media, a short question, the consequence, Cancel and the action. */
22
+ export declare function ConfirmDialog(props: ConfirmDialogProps): JSX.Element;