@lostgradient/cinder 0.25.1 → 0.26.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.
- package/CHANGELOG.md +237 -0
- package/components.json +13 -6
- package/dist/components/alert-dialog/index.js +2 -2
- package/dist/components/approval-card/index.js +2 -2
- package/dist/components/area-chart/area-chart.css +23 -0
- package/dist/components/area-chart/index.js +2 -2
- package/dist/components/autocomplete/index.js +2 -2
- package/dist/components/avatar-group/index.js +2 -2
- package/dist/components/backdrop/index.js +2 -2
- package/dist/components/bar-chart/bar-chart.css +23 -0
- package/dist/components/bar-chart/index.js +2 -2
- package/dist/components/button/button.css +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/code-block/index.js +2 -2
- package/dist/components/color-field/index.js +2 -2
- package/dist/components/combobox/index.js +2 -2
- package/dist/components/command-menu/index.js +2 -2
- package/dist/components/command-palette/command-palette.css +50 -46
- package/dist/components/command-palette/index.js +2 -2
- package/dist/components/confirm-dialog/index.js +2 -2
- package/dist/components/context-menu/index.js +2 -2
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/date-picker/index.js +2 -2
- package/dist/components/date-range-field/index.js +2 -2
- package/dist/components/drawer/index.js +2 -2
- package/dist/components/dropdown/index.js +2 -2
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/find-bar/find-bar.css +9 -1
- package/dist/components/focus-trap/index.js +2 -2
- package/dist/components/form-field/index.js +2 -2
- package/dist/components/guidance-region/index.css +1 -1
- package/dist/components/hover-card/index.js +2 -2
- package/dist/components/inline-confirm/index.js +2 -2
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.css +95 -6
- package/dist/components/invocation-rule-builder/index.js +2 -2
- package/dist/components/json-editor/index.js +2 -2
- package/dist/components/json-schema-editor/index.js +4 -4
- package/dist/components/key-value-editor/index.css +1 -1
- package/dist/components/line-chart/index.js +2 -2
- package/dist/components/line-chart/line-chart.css +23 -0
- package/dist/components/matrix-chart/index.js +2 -2
- package/dist/components/mega-menu/mega-menu.css +7 -1
- package/dist/components/menu-bar/index.js +3 -3
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal-region/index.css +1 -1
- package/dist/components/multi-select/index.js +2 -2
- package/dist/components/navigation-bar/index.js +2 -2
- package/dist/components/parameter-field/index.js +2 -2
- package/dist/components/parameter-field/parameter-field.css +7 -1
- package/dist/components/permission-matrix/index.js +2 -2
- package/dist/components/policy-lock/index.js +2 -2
- package/dist/components/popover/index.js +2 -2
- package/dist/components/popover/popover.css +86 -0
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/resizable-panels/resizable-panels.css +10 -7
- package/dist/components/schedule-builder/index.js +2 -2
- package/dist/components/schema-form/index.js +2 -2
- package/dist/components/scroll-area/index.js +2 -2
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/select.css +12 -2
- package/dist/components/selection-popover/index.js +2 -2
- package/dist/components/share-card/index.js +2 -2
- package/dist/components/sidebar/index.js +2 -2
- package/dist/components/slider/slider.css +7 -1
- package/dist/components/sortable-list/sortable-list.css +11 -7
- package/dist/components/speed-dial/index.js +2 -2
- package/dist/components/statistic-group/index.js +2 -2
- package/dist/components/statistic-group/statistic-group.css +116 -66
- package/dist/components/table/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/time-field/index.js +2 -2
- package/dist/components/time-field/time-field.css +9 -8
- package/dist/components/toast-region/index.js +2 -2
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/transfer-list/index.js +2 -2
- package/dist/components/virtual-list/_internal/adaptive-overscan.d.ts +87 -0
- package/dist/components/virtual-list/_internal/edge-proximity.d.ts +75 -0
- package/dist/components/virtual-list/_internal/frame-scheduler.d.ts +76 -0
- package/dist/components/virtual-list/_internal/geometry.d.ts +170 -0
- package/dist/components/virtual-list/_internal/list-semantics.d.ts +93 -0
- package/dist/components/virtual-list/_internal/measurement-window.d.ts +125 -0
- package/dist/components/virtual-list/_internal/reverse-order.d.ts +87 -0
- package/dist/components/virtual-list/_internal/scroll-restoration.d.ts +98 -0
- package/dist/components/virtual-list/_internal/sticky-items.d.ts +48 -0
- package/dist/components/virtual-list/_internal/virtual-list-measurement-store.svelte.d.ts +69 -0
- package/dist/components/virtual-list/index.d.ts +1 -1
- package/dist/components/virtual-list/index.js +2 -2
- package/dist/components/virtual-list/virtual-list.css +153 -0
- package/dist/components/virtual-list/virtual-list.schema.js +69 -6
- package/dist/components/virtual-list/virtual-list.svelte.d.ts +11 -8
- package/dist/components/virtual-list/virtual-list.types.d.ts +177 -4
- package/dist/index.browser.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -18
- package/dist/server/components/alert-dialog/index.js +1 -1
- package/dist/server/components/approval-card/index.js +1 -1
- package/dist/server/components/area-chart/index.js +1 -1
- package/dist/server/components/autocomplete/index.js +1 -1
- package/dist/server/components/avatar-group/index.js +1 -1
- package/dist/server/components/backdrop/index.js +1 -1
- package/dist/server/components/bar-chart/index.js +1 -1
- package/dist/server/components/checkbox/index.js +1 -1
- package/dist/server/components/code-block/index.js +1 -1
- package/dist/server/components/color-field/index.js +1 -1
- package/dist/server/components/combobox/index.js +1 -1
- package/dist/server/components/command-menu/index.js +1 -1
- package/dist/server/components/command-palette/index.js +2 -2
- package/dist/server/components/confirm-dialog/index.js +1 -1
- package/dist/server/components/context-menu/index.js +1 -1
- package/dist/server/components/data-table/index.js +1 -1
- package/dist/server/components/date-picker/index.js +1 -1
- package/dist/server/components/date-range-field/index.js +1 -1
- package/dist/server/components/drawer/index.js +1 -1
- package/dist/server/components/dropdown/index.js +1 -1
- package/dist/server/components/dropdown-menu/index.js +2 -2
- package/dist/server/components/focus-trap/index.js +1 -1
- package/dist/server/components/form-field/index.js +1 -1
- package/dist/server/components/hover-card/index.js +1 -1
- package/dist/server/components/inline-confirm/index.js +1 -1
- package/dist/server/components/input/index.js +1 -1
- package/dist/server/components/invocation-rule-builder/index.js +1 -1
- package/dist/server/components/json-editor/index.js +1 -1
- package/dist/server/components/json-schema-editor/index.js +1 -1
- package/dist/server/components/line-chart/index.js +1 -1
- package/dist/server/components/matrix-chart/index.js +1 -1
- package/dist/server/components/menu-bar/index.js +2 -2
- package/dist/server/components/modal/index.js +1 -1
- package/dist/server/components/multi-select/index.js +1 -1
- package/dist/server/components/navigation-bar/index.js +2 -2
- package/dist/server/components/parameter-field/index.js +1 -1
- package/dist/server/components/permission-matrix/index.js +1 -1
- package/dist/server/components/policy-lock/index.js +1 -1
- package/dist/server/components/popover/index.js +1 -1
- package/dist/server/components/radio-group/index.js +1 -1
- package/dist/server/components/schedule-builder/index.js +1 -1
- package/dist/server/components/schema-form/index.js +1 -1
- package/dist/server/components/scroll-area/index.js +1 -1
- package/dist/server/components/select/index.js +1 -1
- package/dist/server/components/selection-popover/index.js +1 -1
- package/dist/server/components/share-card/index.js +1 -1
- package/dist/server/components/sidebar/index.js +1 -1
- package/dist/server/components/speed-dial/index.js +2 -2
- package/dist/server/components/statistic-group/index.js +1 -1
- package/dist/server/components/table/index.js +1 -1
- package/dist/server/components/textarea/index.js +1 -1
- package/dist/server/components/time-field/index.js +1 -1
- package/dist/server/components/toast-region/index.js +1 -1
- package/dist/server/components/tooltip/index.js +1 -1
- package/dist/server/components/transfer-list/index.js +1 -1
- package/dist/server/components/virtual-list/index.js +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/{index.server-skq0f5sr.js → index.server-0jw25w9w.js} +1 -1
- package/dist/server/index.server-0kk20wvp.js +4 -0
- package/dist/server/{index.server-fzsqdajc.js → index.server-2awq6q9m.js} +1 -1
- package/dist/server/{index.server-e4hmhaeh.js → index.server-3xwvw6w2.js} +3 -3
- package/dist/server/{index.server-95h7xy01.js → index.server-428dh2t9.js} +2 -2
- package/dist/server/{index.server-jd88r74m.js → index.server-5dq66aja.js} +2 -2
- package/dist/server/{index.server-dvwfhf77.js → index.server-5s94r0kk.js} +2 -2
- package/dist/server/{index.server-qv6z5ta3.js → index.server-80qgcjnm.js} +1 -1
- package/dist/server/{index.server-7k2732ky.js → index.server-81abtrsw.js} +1 -1
- package/dist/server/{index.server-csmqnx5w.js → index.server-83q1gv2c.js} +1 -1
- package/dist/server/{index.server-qw8k9rjg.js → index.server-8fyav10d.js} +1 -1
- package/dist/server/{index.server-4dgjj4k1.js → index.server-8h5caecr.js} +2 -2
- package/dist/server/{index.server-emyqytmm.js → index.server-90n8sd9e.js} +1 -1
- package/dist/server/{index.server-0xrdyzvh.js → index.server-99penx1m.js} +1 -1
- package/dist/server/{index.server-p94j3jah.js → index.server-9g9d15z1.js} +1 -1
- package/dist/server/{index.server-xp9hkc81.js → index.server-9kbdx511.js} +1 -1
- package/dist/server/index.server-a2yhk45s.js +3 -0
- package/dist/server/{index.server-g8d2m2tk.js → index.server-acq55gjs.js} +1 -1
- package/dist/server/{index.server-ewze54tv.js → index.server-afjftjmr.js} +1 -1
- package/dist/server/{index.server-ejyye4gv.js → index.server-bfed6a8a.js} +1 -1
- package/dist/server/{index.server-z5ng08q2.js → index.server-c1746s0z.js} +1 -1
- package/dist/server/{index.server-gt1tfc1w.js → index.server-dmeztywe.js} +1 -1
- package/dist/server/{index.server-kzsppq0n.js → index.server-dyj3jdx9.js} +1 -1
- package/dist/server/index.server-dz92zvx6.js +4 -0
- package/dist/server/{index.server-3md8kdcr.js → index.server-e6682k08.js} +1 -1
- package/dist/server/{index.server-t1pshh65.js → index.server-ewkv461x.js} +1 -1
- package/dist/server/{index.server-zfgwhtmp.js → index.server-fa449wd3.js} +1 -1
- package/dist/server/{index.server-1kgwayct.js → index.server-fhfypmgw.js} +1 -1
- package/dist/server/{index.server-s4z8hsby.js → index.server-ge4adxs2.js} +1 -1
- package/dist/server/{index.server-68xyfsg3.js → index.server-gggkq22y.js} +2 -2
- package/dist/server/{index.server-acgwdamx.js → index.server-j52rbk57.js} +1 -1
- package/dist/server/{index.server-z0nwftx6.js → index.server-jm89hxfb.js} +1 -1
- package/dist/server/{index.server-xa98r8p2.js → index.server-jw0v64se.js} +1 -1
- package/dist/server/index.server-m321p69g.js +3 -0
- package/dist/server/{index.server-xyervw3d.js → index.server-m7q2tc41.js} +1 -1
- package/dist/server/{index.server-tnrxy86j.js → index.server-mak7dmj2.js} +1 -1
- package/dist/server/{index.server-n5g5h5k1.js → index.server-mw5r2524.js} +1 -1
- package/dist/server/{index.server-caf7s6m7.js → index.server-nwq1cg55.js} +1 -1
- package/dist/server/{index.server-3wdvs0wr.js → index.server-p423fy4q.js} +2 -2
- package/dist/server/{index.server-ks7fvwxt.js → index.server-prk5syj2.js} +1 -1
- package/dist/server/{index.server-6w9fp018.js → index.server-q4hytsq3.js} +1 -1
- package/dist/server/{index.server-5w2qw8fm.js → index.server-q597a1ck.js} +1 -1
- package/dist/server/{index.server-fz1pkvda.js → index.server-qgne9v2w.js} +1 -1
- package/dist/server/{index.server-1f2app32.js → index.server-rvdavf92.js} +1 -1
- package/dist/server/index.server-rwq20a22.js +3 -0
- package/dist/server/{index.server-0rvmnrw2.js → index.server-s9tjs45r.js} +1 -1
- package/dist/server/{index.server-cm2prec7.js → index.server-sqgxyfsw.js} +1 -1
- package/dist/server/{index.server-v6777tgn.js → index.server-t761nwvb.js} +1 -1
- package/dist/server/index.server-tbds8nwq.js +4 -0
- package/dist/server/index.server-tyhta5n3.js +3 -0
- package/dist/server/{index.server-yw7rah51.js → index.server-v5dxham4.js} +1 -1
- package/dist/server/index.server-va98cpyf.js +3 -0
- package/dist/server/index.server-vq1k69xt.js +3 -0
- package/dist/server/{index.server-egd355s6.js → index.server-wnf9btp7.js} +2 -2
- package/dist/server/{index.server-sjcbaztf.js → index.server-y3zgdtbv.js} +1 -1
- package/dist/server/{index.server-4tjtgzf9.js → index.server-y6vtbmyj.js} +1 -1
- package/dist/server/{index.server-2p2mjzzb.js → index.server-zff2qp1v.js} +1 -1
- package/dist/server/tokens/registry.generated.js +2 -2
- package/dist/tokens/registry.generated.js +2 -2
- package/package.json +2 -2
- package/src/_internal/form-field-frame.svelte +5 -0
- package/src/_internal/overlay.ts +14 -1
- package/src/components/_internal/create-command-list-state.svelte.ts +4 -0
- package/src/components/area-chart/area-chart.css +23 -0
- package/src/components/bar-chart/bar-chart.css +23 -0
- package/src/components/button/button.css +1 -1
- package/src/components/command-menu/command-menu.svelte +63 -7
- package/src/components/command-palette/command-palette.css +50 -46
- package/src/components/command-palette/command-palette.svelte +68 -78
- package/src/components/dropdown/dropdown.svelte +73 -18
- package/src/components/dropdown-menu/dropdown-menu.svelte +63 -7
- package/src/components/find-bar/find-bar.css +9 -1
- package/src/components/hover-card/hover-card.examples.json +11 -4
- package/src/components/input/input.css +95 -6
- package/src/components/input/input.svelte +44 -81
- package/src/components/line-chart/line-chart.css +23 -0
- package/src/components/mega-menu/mega-menu.css +7 -1
- package/src/components/menu-bar/menu-bar.svelte +12 -1
- package/src/components/multi-select/multi-select.svelte +7 -0
- package/src/components/navigation-bar/navigation-bar.svelte +82 -6
- package/src/components/parameter-field/parameter-field.css +7 -1
- package/src/components/popover/popover.css +86 -0
- package/src/components/resizable-panels/resizable-panels.css +10 -7
- package/src/components/select/select.css +12 -2
- package/src/components/selection-popover/selection-popover.svelte +24 -10
- package/src/components/share-card/share-card.svelte +24 -44
- package/src/components/slider/slider.css +7 -1
- package/src/components/sortable-list/sortable-list.css +11 -7
- package/src/components/speed-dial/speed-dial.svelte +23 -5
- package/src/components/statistic-group/statistic-group.css +116 -66
- package/src/components/statistic-group/statistic-group.examples.json +6 -0
- package/src/components/statistic-group/statistic-group.svelte +13 -1
- package/src/components/time-field/time-field.css +9 -8
- package/src/components/toast-region/toast-region.svelte +9 -0
- package/src/components/virtual-list/_internal/adaptive-overscan.ts +248 -0
- package/src/components/virtual-list/_internal/edge-proximity.ts +130 -0
- package/src/components/virtual-list/_internal/frame-scheduler.ts +136 -0
- package/src/components/virtual-list/_internal/geometry.ts +236 -0
- package/src/components/virtual-list/_internal/list-semantics.ts +151 -0
- package/src/components/virtual-list/_internal/measurement-window.ts +300 -0
- package/src/components/virtual-list/_internal/reverse-order.ts +146 -0
- package/src/components/virtual-list/_internal/scroll-restoration.ts +209 -0
- package/src/components/virtual-list/_internal/sticky-items.ts +111 -0
- package/src/components/virtual-list/_internal/virtual-list-measurement-store.svelte.ts +145 -0
- package/src/components/virtual-list/index.ts +7 -1
- package/src/components/virtual-list/virtual-list.css +153 -0
- package/src/components/virtual-list/virtual-list.examples.json +42 -0
- package/src/components/virtual-list/virtual-list.schema.json +53 -3
- package/src/components/virtual-list/virtual-list.schema.ts +64 -3
- package/src/components/virtual-list/virtual-list.svelte +1527 -36
- package/src/components/virtual-list/virtual-list.types.ts +181 -4
- package/src/index.ts +3 -0
- package/src/styles/tokens-base.css +29 -21
- package/src/tokens/cinder.resolver.json +8 -0
- package/src/tokens/index.json +1 -1
- package/src/tokens/registry.generated.json +29 -3
- package/src/tokens/registry.generated.ts +31 -3
- package/src/tokens/resolved/dark-reduced-motion.json +46 -16
- package/src/tokens/resolved/dark.json +46 -16
- package/src/tokens/resolved/light-reduced-motion.json +47 -17
- package/src/tokens/resolved/light.json +47 -17
- package/src/tokens/sets/semantic.tokens.json +120 -30
- package/src/tokens/themes/dark.tokens.json +115 -19
- package/src/tokens/themes/light.tokens.json +51 -3
- package/dist/server/index.server-191cnacw.js +0 -3
- package/dist/server/index.server-25dqx151.js +0 -3
- package/dist/server/index.server-77jyqvbv.js +0 -4
- package/dist/server/index.server-bgjrzr70.js +0 -3
- package/dist/server/index.server-khsp90vh.js +0 -3
- package/dist/server/index.server-ryk2pgbe.js +0 -4
- package/dist/server/index.server-tajr81bm.js +0 -3
- package/dist/server/index.server-vjzcrw3d.js +0 -4
- package/dist/server/index.server-zg3fx1n1.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,242 @@
|
|
|
1
1
|
# @lostgradient/cinder
|
|
2
2
|
|
|
3
|
+
## 0.26.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1539](https://github.com/stevekinney/cinder/pull/1539) [`50b2f3b`](https://github.com/stevekinney/cinder/commit/50b2f3baf2675dd813a295ba0bfef7ac156be89a) Thanks [@stevekinney](https://github.com/stevekinney)! - Retune the indicators that read too faint against `border.muted`/element-opacity compounding after CIN-245's translucent border tiers, and fix Popover's arrow rim compositing over the wrong backdrop.
|
|
8
|
+
|
|
9
|
+
**CIN-603.** Several persistent or interactive indicators either filled with `border.muted` (a 1.4:1 decorative-hairline tier) or compounded a structural tier with an element or child `opacity`, landing under WCAG 1.4.11's 3:1 floor in the dark arm — none of these were floors CIN-245 broke, all were already below 3:1 beforehand. Retuned: SortableList's drag-placeholder outline and Slider's tick both move to `border.control` with their diluting `opacity` removed (SortableList's box has no other visible content for that opacity to affect); ResizablePanels' handle line drops the child `opacity: 0.5` that diluted its `border.strong` color; AreaChart, BarChart, and LineChart's legend toggle buttons and Select's empty-state border move their dimming off the border itself (onto text color / a child swatch) so the border stays at `border.control`'s full alpha; ParameterField's rail and MegaMenu's indicator track move from `border.muted` to `border.control`. Every retuned site now measures at least 3:1 against all four surface tokens in both theme arms, asserted directly against the shipped component CSS in `check-token-contrast.test.ts`. The remaining `border.muted`/opacity-compounded sites (disabled states, StatusDot's connecting-pulse trough, Chat's rollback preview, RunStepTimeline's rewound marker) are unchanged and recorded as intentional in `docs/css-audit/translucent-border-seams.md` — disabled controls are exempt from the contrast floor outright, and the rest are deliberately faint/transient states rather than persistent affordances.
|
|
10
|
+
|
|
11
|
+
**CIN-606.** Popover's arrow rim and panel border used to composite over different surfaces: `background-clip: border-box` (the default) means the panel's own opaque background paints under its translucent border, but the arrow's outer triangle had no background of its own and painted its translucent edge straight onto whatever the popover floated over. Invisible while both tokens were opaque; visible now that `--cinder-border` is 48% alpha. The arrow's own border is now an opaque `surface-raised` backdrop, with a new `::before` repeating the same triangle in the translucent border color on top of it — matching the panel edge on every backdrop instead of only on `surface-raised`. HoverCard's differently-constructed arrow (`background: inherit`, a filled diamond) and Tooltip (no arrow at all) were verified unaffected, both by a Playwright pixel probe against the real rendered pixels rather than by eye.
|
|
12
|
+
|
|
13
|
+
## 0.26.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#1532](https://github.com/stevekinney/cinder/pull/1532) [`a9f69c8`](https://github.com/stevekinney/cinder/commit/a9f69c87cadca79fcd2d5febbd29a53456256802) Thanks [@stevekinney](https://github.com/stevekinney)! - Input inside a `FormField` keeps its native element when `label`, `description`, or `error` appears or disappears — the common case is validation setting `error` while the user is still in the field. A context-wrapped Input now always renders its own nested `FormFieldFrame`, with `label`/`description`/`error` simply absent when unset, instead of switching between that frame and a bare control render as those props become truthy. One stable code path means the `<input>` never moves between template arms, so focus, the selection range, and IME composition survive the toggle.
|
|
18
|
+
|
|
19
|
+
DOM contract change for consumers styling or querying the native control from inside a `FormField`-wrapped Input with no `label`, `description`, or `error` of its own: the control is now always inside a nested `.cinder-form-field` frame, where it previously rendered bare. Descendant selectors still match; a direct-child selector onto the bare control needs the frame's control wrapper inserted. `TimeField`'s own control-row sizing was the one in-repo case and is updated.
|
|
20
|
+
|
|
21
|
+
- [#1502](https://github.com/stevekinney/cinder/pull/1502) [`90b421f`](https://github.com/stevekinney/cinder/commit/90b421f4fecbf824cd972fdb23aef125ce887ba9) Thanks [@stevekinney](https://github.com/stevekinney)! - Input keeps its native element when a `leading` or `trailing` addon appears or disappears. The control wrapper is now always rendered — `.cinder-input-group` with addons, a boxless `.cinder-input-host` (`display: contents`) without — so the `<input>` has one stable position in the tree instead of moving between template arms, and focus, the selection range, and IME composition survive the toggle. Unadorned inputs lay out exactly as before, and the host carries `data-cinder-full-width` so ancestors that detect a full-width control by direct child keep matching.
|
|
22
|
+
|
|
23
|
+
DOM contract change for consumers styling the native control: an unadorned `.cinder-input` is no longer a direct child of its frame or of the element that composes it. Descendant selectors (`.your-row .cinder-input`) still match; a direct-child selector (`.your-row > .cinder-input`) must become `.your-row > .cinder-input-host > .cinder-input`. TimeField's own control-row sizing was the one in-repo case and is updated.
|
|
24
|
+
|
|
25
|
+
- [#1526](https://github.com/stevekinney/cinder/pull/1526) [`2a67495`](https://github.com/stevekinney/cinder/commit/2a674952360a5d1d2b71cce83566e39dc5003289) Thanks [@stevekinney](https://github.com/stevekinney)! - feat(tokens): one polarity ink, and neutral border tiers composed from it
|
|
26
|
+
|
|
27
|
+
Two related token changes.
|
|
28
|
+
|
|
29
|
+
**`--cinder-polarity-ink`** is new: the neutral ink that contrasts with whatever
|
|
30
|
+
the current theme paints underneath it — black in light mode, white in dark. The
|
|
31
|
+
three scrollbar washes are now `color-mix()` values over it rather than
|
|
32
|
+
open-coded `light-dark()` pairs, so they re-polarize together when it is
|
|
33
|
+
overridden at `:root` or in a `[data-theme]` block. A subtree override does not
|
|
34
|
+
reach them — the washes are declared at `:root`, so descendants inherit the
|
|
35
|
+
already-resolved values; retinting one region means redeclaring the washes
|
|
36
|
+
alongside the ink. Rendering is unchanged: `color-mix(in oklch, C, transparent 96%)`
|
|
37
|
+
computes byte-for-byte to `oklch(C / 0.04)`.
|
|
38
|
+
|
|
39
|
+
It is deliberately a complete color value rather than a bare `0% 0 0` component
|
|
40
|
+
triplet. A triplet assigned to a color property is an invalid declaration, and
|
|
41
|
+
CSS drops invalid declarations silently — the mistake renders as "nothing
|
|
42
|
+
changed" rather than as something you can see. Two new gates hold that line: the
|
|
43
|
+
generator rejects a bare component list in any color position, and a browser test
|
|
44
|
+
hands every public color token to the real CSS parser and asserts the declaration
|
|
45
|
+
sticks.
|
|
46
|
+
|
|
47
|
+
**`--cinder-border-ink`** is new, and `--cinder-border-muted`, `--cinder-border`,
|
|
48
|
+
and `--cinder-border-strong` are now alpha steps over it (19%, 48%, 58%) instead
|
|
49
|
+
of opaque per-arm colors. This is a **visual change**: an alpha border tracks the
|
|
50
|
+
surface underneath it, so each tier now reads at the same weight everywhere it is
|
|
51
|
+
used. The dark surface ramp spans L 0.11–0.28, and a single opaque border used to
|
|
52
|
+
measure 4.80:1 on `surface-inset` against 3.42:1 on `surface-raised` — a 29%
|
|
53
|
+
spread. Every tier now holds under 15% in both arms, gated in
|
|
54
|
+
`check-token-contrast.test.ts` alongside the existing per-surface floors.
|
|
55
|
+
|
|
56
|
+
Retinting all three tiers is now one override:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
:root {
|
|
60
|
+
--cinder-border-ink: light-dark(oklch(20% 0.03 280), oklch(86% 0.06 280));
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Two things to know if you consume these directly. A structural border mixed into
|
|
65
|
+
another color inherits its transparency, so `color-mix(in oklch, var(--cinder-surface),
|
|
66
|
+
var(--cinder-border-muted) 10%)` now yields a slightly translucent result. And two
|
|
67
|
+
of these borders on the same pixel stack their alpha — draw interior dividers as a
|
|
68
|
+
single edge on one of the two adjacent elements, which the `interior-border-weight`
|
|
69
|
+
stylelint rule already requires.
|
|
70
|
+
|
|
71
|
+
`--cinder-border-faint` and the four hued status borders (`info`, `success`,
|
|
72
|
+
`warning`, `danger`) stay opaque. Two neutral borders that wear another name do
|
|
73
|
+
become translucent, because they alias a tier: `--cinder-status-neutral-border`
|
|
74
|
+
is `--cinder-border`, and `--cinder-border-inverse`'s dark arm is
|
|
75
|
+
`--cinder-border-strong`. That is the intent — both are neutral structure, not a
|
|
76
|
+
hue that needs protecting.
|
|
77
|
+
|
|
78
|
+
Also fixes a pre-existing defect in the contrast gate itself: it composited
|
|
79
|
+
translucent colors in linear-light sRGB, but browsers composite on
|
|
80
|
+
gamma-encoded channels. Measured against Chromium, the old model reported roughly
|
|
81
|
+
1.5× more contrast than ships for a light ink over a dark surface — exactly the
|
|
82
|
+
dark-arm case these border tiers now use.
|
|
83
|
+
|
|
84
|
+
- [#1501](https://github.com/stevekinney/cinder/pull/1501) [`2a5991f`](https://github.com/stevekinney/cinder/commit/2a5991fded8c9730b6533bb0c1b87bfc1807b77b) Thanks [@stevekinney](https://github.com/stevekinney)! - Fix StatisticGroup's column collapse and row-end dividers. The group's `@container` rules queried the element that declared the container, so a standalone group never collapsed at the documented 30rem and 18rem thresholds. The public root (`.cinder-statistic-group`, which receives `class`, `style`, and every other prop) is now the query container, and the cells live in an inner `.cinder-statistic-group__grid`; a consumer that constrains the group's inline size constrains exactly what collapses, and a nested group queries its own width. The default variant's row-end divider suppression was also inert — the generic enabler out-ranked every `nth-child` suppressor by specificity — so every group that wrapped to a second row drew a divider at the end of each row. Divider rules are now enumerated per column count at uniform specificity and follow the collapse thresholds, so they describe the grid that actually renders. Note that the query measures the root's content box, so for the padded default variant the thresholds apply to the width the cells share.
|
|
85
|
+
|
|
86
|
+
DOM contract change for consumers styling the group: the grid moved from `.cinder-statistic-group` to an inner `.cinder-statistic-group__grid`, which is now the documented layout hook. Consumer `class` and `style` still land on `.cinder-statistic-group`, but a `grid-template-columns` or `gap` override written against the root no longer reaches the cells; target `.cinder-statistic-group__grid` instead, or keep using `--cinder-statistic-group-gap` on the root, which the grid still reads. `.cinder-statistic` cells are no longer direct children of `.cinder-statistic-group`: descendant selectors still match; a direct-child selector (`.cinder-statistic-group > .cinder-statistic`) must become `.cinder-statistic-group > .cinder-statistic-group__grid > .cinder-statistic`.
|
|
87
|
+
|
|
88
|
+
- [#1496](https://github.com/stevekinney/cinder/pull/1496) [`c7e34f0`](https://github.com/stevekinney/cinder/commit/c7e34f0c398e5cd6483fa803c61124740886f0a3) Thanks [@stevekinney](https://github.com/stevekinney)! - VirtualList: add `dynamicSize` for measured, variable-height rows, and a typed `ref` handle.
|
|
89
|
+
|
|
90
|
+
`dynamicSize` opts a list into measuring each rendered row with `ResizeObserver` and caching the
|
|
91
|
+
result, using `itemHeight` as the initial estimate for rows that have not been measured yet. When a
|
|
92
|
+
measurement differs from the estimate, the scroll offset is corrected before paint so the viewport
|
|
93
|
+
does not visibly jump. The fixed-height path remains the default and is untouched: with `dynamicSize`
|
|
94
|
+
off, no row is measured, no size is cached, and no scroll correction runs. (The component observes
|
|
95
|
+
its own scroll container to track viewport size in both modes, as it always has.)
|
|
96
|
+
|
|
97
|
+
`bind:ref` now exposes a typed `VirtualListRef` with `scrollToIndex(index, options)`, which accounts
|
|
98
|
+
for the measured sizes of every row before the target and accepts `align` and `behavior` options.
|
|
99
|
+
|
|
100
|
+
- [#1511](https://github.com/stevekinney/cinder/pull/1511) [`ff39cb2`](https://github.com/stevekinney/cinder/commit/ff39cb22181c19714703169af7870df68c3ebdec) Thanks [@stevekinney](https://github.com/stevekinney)! - VirtualList: add `horizontal` for inline-axis virtualization, with right-to-left support.
|
|
101
|
+
|
|
102
|
+
`horizontal` scrolls and lays rows out along the inline axis. `itemHeight` and `height` are
|
|
103
|
+
reinterpreted rather than renamed — `itemHeight` becomes each item's width, `height` becomes the
|
|
104
|
+
container's inline-size — and `--cinder-virtual-list-height` keeps its name while switching to drive
|
|
105
|
+
`inline-size`, so an existing theme override survives turning the prop on.
|
|
106
|
+
|
|
107
|
+
Right-to-left is handled rather than assumed. The writing direction is resolved from the container's
|
|
108
|
+
computed style, and the RTL `scrollLeft` convention is feature-detected once per document: browsers
|
|
109
|
+
disagree on both the sign and the origin of `scrollLeft` in a right-to-left container, and current
|
|
110
|
+
browsers use the negative convention that older ones did not.
|
|
111
|
+
|
|
112
|
+
- [#1512](https://github.com/stevekinney/cinder/pull/1512) [`80221ef`](https://github.com/stevekinney/cinder/commit/80221ef0088dbcdb82d58b5d04c7afd92c2b3032) Thanks [@stevekinney](https://github.com/stevekinney)! - VirtualList: add `reverse` for chat transcripts, and `onEndReached`/`onStartReached`
|
|
113
|
+
for bi-directional infinite scroll.
|
|
114
|
+
|
|
115
|
+
`reverse` opens the list at its newest item and returns there on every append,
|
|
116
|
+
regardless of where the reader has scrolled — distinct from `stickToBottom`, which
|
|
117
|
+
pins only when the reader is already at the bottom. Items keep their natural order;
|
|
118
|
+
`reverse` names the anchoring, not the ordering. Prepending older history anchors to
|
|
119
|
+
the row the reader was on instead of moving them.
|
|
120
|
+
|
|
121
|
+
`onEndReached` and `onStartReached` fire as the reader comes within `overscan` items
|
|
122
|
+
of either edge. Each fires once per approach and re-arms when the item count changes,
|
|
123
|
+
so appending in response allows the next page while a source that returns nothing
|
|
124
|
+
does not spin.
|
|
125
|
+
|
|
126
|
+
Also repairs two scroll reads left on the block axis by the `horizontal` work: the
|
|
127
|
+
dynamic re-pin comparison, and the settle loop in `scrollToIndex`, which saw no
|
|
128
|
+
movement on a horizontal list and so skipped its settle pass entirely.
|
|
129
|
+
|
|
130
|
+
- [#1516](https://github.com/stevekinney/cinder/pull/1516) [`93c7d03`](https://github.com/stevekinney/cinder/commit/93c7d0382b6325128e4970886a33abbb5ef7fd20) Thanks [@stevekinney](https://github.com/stevekinney)! - VirtualList: add `scrollRestoration`, which remembers the reader's position across
|
|
131
|
+
navigation.
|
|
132
|
+
|
|
133
|
+
The position is persisted to `sessionStorage` under a required `scrollRestorationId`.
|
|
134
|
+
There is deliberately no implicit key: one derived from position or mount order would
|
|
135
|
+
hand a remembered offset to the wrong list after an unrelated refactor, and two lists
|
|
136
|
+
on a page would overwrite each other.
|
|
137
|
+
|
|
138
|
+
The anchor is remembered by row KEY as well as index, because an index stops
|
|
139
|
+
describing the same row the moment the collection changes while the list is
|
|
140
|
+
unmounted — which is exactly what a feed does by growing at the front. It also carries
|
|
141
|
+
how far INTO that row the reader was, so a long transcript reopens mid-paragraph
|
|
142
|
+
rather than at the top of it.
|
|
143
|
+
|
|
144
|
+
Restoration waits for the row to exist rather than assuming it is gone: a list that
|
|
145
|
+
fetches its own data renders empty first, and one that pages incrementally may need
|
|
146
|
+
several pages before the saved row arrives. It keeps trying while the collection
|
|
147
|
+
grows, and yields to nothing — a pending restore outranks `reverse`'s opening pin, and
|
|
148
|
+
holds the infinite-scroll callbacks so they do not fetch a page merely because the
|
|
149
|
+
list rendered at offset zero for one frame. It does not hold them once it is itself
|
|
150
|
+
waiting for pagination to deliver the anchor.
|
|
151
|
+
|
|
152
|
+
Every storage access is guarded, reads included: some browsers throw on merely
|
|
153
|
+
touching `sessionStorage` in private mode, not only on writing.
|
|
154
|
+
|
|
155
|
+
- [#1518](https://github.com/stevekinney/cinder/pull/1518) [`36ce7f4`](https://github.com/stevekinney/cinder/commit/36ce7f4368a498789e3402bc89a5596e7e33e82a) Thanks [@stevekinney](https://github.com/stevekinney)! - VirtualList: add `stickyItems`, `smoothScroll`, and `adaptiveOverscan`, and give every
|
|
156
|
+
row `aria-posinset` and `aria-setsize`.
|
|
157
|
+
|
|
158
|
+
`stickyItems` pins the named indexes to the leading edge. The part virtualization
|
|
159
|
+
would otherwise break is keeping them mounted: a row whose index leaves the rendered
|
|
160
|
+
window is normally unmounted, so the heading would disappear exactly when it is meant
|
|
161
|
+
to be pinned. The active sticky row is kept in the DOM past its window, and the
|
|
162
|
+
rendered set is re-sorted by index so a keyed each block does not move it behind the
|
|
163
|
+
rows that follow it.
|
|
164
|
+
|
|
165
|
+
Rows now announce their position in the FULL collection rather than the rendered
|
|
166
|
+
window, which is what assistive technology needs on a virtualized list — otherwise a
|
|
167
|
+
10,000-row list reads as "3 of 12". `aria-posinset` is 1-based per the specification;
|
|
168
|
+
`context.index` stays 0-based.
|
|
169
|
+
|
|
170
|
+
Setting `stickyItems` also makes the list claim the Arrow, Page, Home, and End keys,
|
|
171
|
+
which it otherwise leaves to the browser. A pinned header covers the leading edge, so
|
|
172
|
+
a destination aligned flush to it lands underneath — in a list where the header and
|
|
173
|
+
its rows share a height, completely underneath. Destinations now clear the header, and
|
|
174
|
+
that applies to `scrollToIndex` calls of your own as well as to the keys: with
|
|
175
|
+
`stickyItems` set, `scrollToIndex(n, { align: 'start' })` stops at the header's height
|
|
176
|
+
above row `n` rather than at row `n` exactly. Page keys step by the rows the header
|
|
177
|
+
leaves visible rather than by the whole viewport, and Arrow and Page keys pass over
|
|
178
|
+
sticky rows themselves, which are on screen already for as long as their section is.
|
|
179
|
+
Home and End still go to the collection's true ends.
|
|
180
|
+
|
|
181
|
+
`smoothScroll` makes `scrollToIndex` animate by default, with an explicit `behavior`
|
|
182
|
+
in the call still winning. `adaptiveOverscan` grows `overscan` with scroll velocity
|
|
183
|
+
and shrinks it back when the reader slows, treating the configured value as a floor
|
|
184
|
+
and clamping the growth so a fling cannot mount thousands of rows. Under `dynamicSize`
|
|
185
|
+
it converts that velocity using the rows' measured average rather than the `itemHeight`
|
|
186
|
+
estimate, which otherwise widens the window by a fraction of what the reader is
|
|
187
|
+
actually outrunning.
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- [#1531](https://github.com/stevekinney/cinder/pull/1531) [`96166b5`](https://github.com/stevekinney/cinder/commit/96166b57671722bce2ccc4b0aac738e2077fb1db) Thanks [@stevekinney](https://github.com/stevekinney)! - Command Menu, Selection Popover, DropdownMenu (and its Context Menu, Menu Bar, and
|
|
192
|
+
modern Dropdown consumers), Speed Dial, the NavigationBar mobile panel, and
|
|
193
|
+
MultiSelect now register on the shared escape stack (`pushEscapeHandler` in
|
|
194
|
+
`src/_internal/overlay.ts`) instead of handling Escape only from their own
|
|
195
|
+
element-scoped `onkeydown` listener.
|
|
196
|
+
|
|
197
|
+
The shared LIFO stack now correctly arbitrates Escape between these overlays and
|
|
198
|
+
any other stacked overlay (Modal, Drawer, Popover, Combobox, and so on): the
|
|
199
|
+
top-most open overlay consumes the key and swallows it with `preventDefault()` +
|
|
200
|
+
`stopPropagation()`; a lower overlay never reacts to the same keystroke. Each of
|
|
201
|
+
these components also now dismisses on Escape with focus anywhere on the page, not
|
|
202
|
+
just while focus sits inside its own DOM tree — the previous anchor/target-scoped
|
|
203
|
+
listeners missed that case.
|
|
204
|
+
|
|
205
|
+
Command Menu's ghost-text-first two-stage Escape semantics are unchanged, now
|
|
206
|
+
routed through a single shared internal function called by both the anchor
|
|
207
|
+
listener and the stack registration. Dropdown's legacy `usesLegacySnippetApi`
|
|
208
|
+
branch splits by sub-branch: the non-popover fallback registers directly and
|
|
209
|
+
dismisses, while the native `supportsPopover` branch registers without calling
|
|
210
|
+
`preventDefault()` so the browser's own `popover="auto"` light-dismiss keeps
|
|
211
|
+
working — it only occupies the stack slot so a lower overlay doesn't react first.
|
|
212
|
+
DropdownMenu's registration is keyed per open instance, so Menu Bar's staged
|
|
213
|
+
submenu-then-menubar close falls out of LIFO ordering with no target-scoping
|
|
214
|
+
needed; Menu Bar's own Escape branch gained a `defaultPrevented` guard as
|
|
215
|
+
defense-in-depth. MultiSelect already registered via
|
|
216
|
+
`commandList.bindDismissal`; its stack handler now also calls
|
|
217
|
+
`stopPropagation()`, and its bubbling `onEscape` fallback gained the same
|
|
218
|
+
`defaultPrevented` guard used elsewhere.
|
|
219
|
+
|
|
220
|
+
- [#1513](https://github.com/stevekinney/cinder/pull/1513) [`2bfdd13`](https://github.com/stevekinney/cinder/commit/2bfdd13893dbddeb62cc9f0e044363c338e75a70) Thanks [@stevekinney](https://github.com/stevekinney)! - Share one declaration of the Input's invalid-hover border between the input, its host wrapper, and the group. The three surfaces that can paint that edge each derived it separately, so they could drift apart, and the duplication pushed the file past its raw-color allowance.
|
|
221
|
+
|
|
222
|
+
- [#1528](https://github.com/stevekinney/cinder/pull/1528) [`be234cb`](https://github.com/stevekinney/cinder/commit/be234cb68d0ee16dd67f0774f4aec9a608ecc594) Thanks [@stevekinney](https://github.com/stevekinney)! - Toast: `.cinder-toast-shell` now renders the canonical `data-cinder-closing` attribute (additive,
|
|
223
|
+
alongside the existing `data-cinder-presence`) for the full duration of a dismissed toast's exit
|
|
224
|
+
transition, per OVERLAY-POLICY.md's transition-lifecycle contract.
|
|
225
|
+
|
|
226
|
+
CommandPalette: adopts `SlidingDialogState` (the same exit-lifecycle mechanism Modal and Drawer use)
|
|
227
|
+
instead of closing instantly. Closing now renders `data-cinder-closing` on the panel and plays a real
|
|
228
|
+
`opacity`/`translate` exit transition, awaiting completion before the native dialog closes; the panel
|
|
229
|
+
enter/exit CSS moved from `animation`/`@keyframes` to `transition`-driven styles so the shared
|
|
230
|
+
`waitForTransitionCompletion` helper can detect it. The palette also now acquires the counted
|
|
231
|
+
`lockBodyScroll()` on open and releases it on close (a modal-class overlay guarantee it previously
|
|
232
|
+
lacked), and its SSR output is empty regardless of the initial `open` value (previously `open={true}`
|
|
233
|
+
emitted the dialog markup during SSR).
|
|
234
|
+
|
|
235
|
+
- [#1506](https://github.com/stevekinney/cinder/pull/1506) [`0b7c0f2`](https://github.com/stevekinney/cinder/commit/0b7c0f22252c2d317aa248621cddff782573d890) Thanks [@stevekinney](https://github.com/stevekinney)! - ShareCard renders its value field from a single `Input` call site. Previously the icon-only and `labelSnippet` layouts were two separate `Input` instances, so a parent that reactively changed `actions` across that boundary tore the field down and dropped the user's focus and selection. Now the actions move between the trailing addon and the sibling row as a prop update on the same element, and focus and the selection range survive.
|
|
236
|
+
|
|
237
|
+
- Updated dependencies [[`ed0dae6`](https://github.com/stevekinney/cinder/commit/ed0dae663219ee7e19bce957a6609c05ac55103d)]:
|
|
238
|
+
- @lostgradient/markdown@0.5.0
|
|
239
|
+
|
|
3
240
|
## 0.25.1
|
|
4
241
|
|
|
5
242
|
### Patch Changes
|
package/components.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"manifestVersion": 1,
|
|
4
4
|
"package": {
|
|
5
5
|
"name": "@lostgradient/cinder",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.26.1",
|
|
7
7
|
"framework": "svelte",
|
|
8
8
|
"frameworkVersionRange": ">=5.56.0 <6",
|
|
9
9
|
"classPrefix": "cinder-",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"opacity",
|
|
39
39
|
"overlay",
|
|
40
40
|
"pad",
|
|
41
|
+
"polarity",
|
|
41
42
|
"radius",
|
|
42
43
|
"ring",
|
|
43
44
|
"scrollbar",
|
|
@@ -5972,18 +5973,24 @@
|
|
|
5972
5973
|
"exportName": "VirtualList",
|
|
5973
5974
|
"category": "data-display",
|
|
5974
5975
|
"status": "beta",
|
|
5975
|
-
"purpose": "
|
|
5976
|
+
"purpose": "Windowing primitive for long lists along either axis, rendering only the visible rows plus overscan, with fixed-height rows by default and opt-in measured rows.",
|
|
5976
5977
|
"tags": ["list", "virtualization", "performance"],
|
|
5977
5978
|
"useWhen": [
|
|
5978
|
-
"Rendering thousands of
|
|
5979
|
-
"
|
|
5979
|
+
"Rendering thousands of rows: logs, event streams, activity feeds.",
|
|
5980
|
+
"Rows vary in size because they wrap or embed media — dynamicSize measures each.",
|
|
5981
|
+
"Windowing the inline axis — horizontal, which also resolves right-to-left.",
|
|
5982
|
+
"A transcript anchored to its newest message, or paging in at either edge."
|
|
5980
5983
|
],
|
|
5981
5984
|
"avoidWhen": [
|
|
5982
5985
|
{
|
|
5983
|
-
"reason": "
|
|
5986
|
+
"reason": "Two-dimensional grids, which need column virtualization and grid semantics.",
|
|
5987
|
+
"alternative": "data-grid"
|
|
5984
5988
|
},
|
|
5985
5989
|
{
|
|
5986
|
-
"reason": "
|
|
5990
|
+
"reason": "A native table or a hierarchy — data-table and tree window those already."
|
|
5991
|
+
},
|
|
5992
|
+
{
|
|
5993
|
+
"reason": "The collection is small enough to render in full."
|
|
5987
5994
|
}
|
|
5988
5995
|
],
|
|
5989
5996
|
"related": ["data-list", "data-table", "data-grid", "load-more"],
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var __create=Object.create;var __getProtoOf=Object.getPrototypeOf;var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node;var __toESMCache_esm;var __toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap;var cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};const to=isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:true})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true,configurable:true,set:__exportSetter.bind(all,name)})};var __esm=(fn,res)=>()=>(fn&&(res=fn(fn=0)),res);var __require=((x)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(x,{get:(a,b)=>(typeof require!=="undefined"?require:a)[b]}):x)(function(x){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});import"svelte/internal/disclose-version";import*as $2 from"svelte/internal/client";function classNames(...parts){return parts.filter((part)=>typeof part==="string"&&part.length>0).join(" ")}import*as $ from"svelte/internal/client";function restoreFocusTo(target){if(!target)return false;if(typeof document==="undefined")return false;if(!target.isConnected)return false;if(target.ownerDocument!==document)return false;try{target.focus()}catch{return false}return true}var sequentialFocusCandidateSelector=["a[href]","area[href]","button",'input:not([type="hidden"])',"select","textarea","summary","frame","iframe","audio[controls]","video[controls]","embed","object","[contenteditable]","[tabindex]"].join(", ");function getSequentialFocusTargets(root,range){if(!root)return[];const composedElements=collectComposedElements(root);const relativeIndex=range?composedElements.indexOf(range.relativeTo):-1;if(range&&relativeIndex===-1)return[];const tierReference=range?.tierReference??range?.relativeTo;const positionOf=range?new Map(composedElements.map((element,index)=>[element,index])):null;const candidates=composedElements.filter(isSequentialFocusTarget).filter((element)=>!range||isSequentialFocusTarget(tierReference)&&isSequentiallyAfterReference(element,tierReference,range.direction,(positionOf?.get(element)??-1)-relativeIndex)).filter((element)=>element.matches(sequentialFocusCandidateSelector)).filter(isSequentialCandidate);const radios=[];for(const candidate of candidates){if(!isRadio(candidate))continue;const rootNode=candidate.getRootNode();const name=candidate.getAttribute("name")??"";if(name==="")continue;const form=getFormOwner(candidate);const group=radios.find((entry)=>entry.root===rootNode&&entry.form===form&&entry.name===name);if(!group){const members=isParentNode(rootNode)?collectComposedElements(rootNode).filter(isSequentialFocusTarget).filter(isRadio).filter((radio)=>radio.getRootNode()===rootNode&&radio.getAttribute("name")===name&&getFormOwner(radio)===form&&isSequentialCandidate(radio)):[candidate];radios.push({root:rootNode,form,name,members})}}const inRangeCandidates=new Set(candidates);const radioRepresentatives=new Set(radios.flatMap(({members})=>{const checked=members.find((radio)=>("checked"in radio)&&radio.checked);if(checked)return[checked];const inRangeMembers=range?members.filter((member)=>inRangeCandidates.has(member)):members;const fallback=range?.direction==="before"?inRangeMembers.at(-1):inRangeMembers[0];return fallback?[fallback]:[]}));const groupedRadios=new Set(radios.flatMap(({members})=>members));return candidates.filter((candidate)=>!isRadio(candidate)||!groupedRadios.has(candidate)||radioRepresentatives.has(candidate)).sort((left,right)=>{const leftTabIndex=sequentialTabIndexValue(left);const rightTabIndex=sequentialTabIndexValue(right);if(leftTabIndex===rightTabIndex)return 0;if(leftTabIndex===0)return 1;if(rightTabIndex===0)return-1;return leftTabIndex-rightTabIndex})}function collectComposedElements(root){const elements=[];const visited=new Set;const visit=(element,fromSlot=false)=>{if(visited.has(element))return;if(!fromSlot&&element.assignedSlot)return;visited.add(element);elements.push(element);if(isSlotElement(element)){if(element.assignedNodes({flatten:false}).length>0){for(const child of element.assignedElements({flatten:true}))visit(child,true);return}}const childRoot=element.shadowRoot??element;for(const child of Array.from(childRoot.children))visit(child)};for(const child of Array.from(root.children))visit(child);return elements}function isSlotElement(element){return element.localName==="slot"&&typeof Reflect.get(element,"assignedElements")==="function"&&typeof Reflect.get(element,"assignedNodes")==="function"}function isSequentialCandidate(candidate){const explicitTabIndexValue=getExplicitTabIndexValue(candidate);if(candidate.matches('input[type="hidden"]'))return false;if(getTabIndexValue(candidate)<0||candidate.matches(":disabled")||closestComposed(candidate,"[hidden], [inert]")!==null||!isRendered(candidate))return false;if(candidate.matches("summary")&&explicitTabIndexValue===null)return isFirstDetailsSummary(candidate)&&!isInsideClosedDetails(candidate);if(isInsideClosedDetails(candidate))return false;return true}function hasNativeSequentialDefault(element){return element.matches('button, input:not([type="hidden"]), a[href], area[href], select, textarea, summary, frame, iframe')||element.matches("audio[controls], video[controls], embed[src]")||element.matches("object")&&(element.getAttribute("data")?.trim().length??0)>0||isHtmlElementNode(element)&&isEditingHost(element)}function isRadio(element){return isHtmlElementNode(element)&&element.localName==="input"&&element.getAttribute("type")?.toLowerCase()==="radio"}function getFormOwner(element){const formValue="form"in element?Reflect.get(element,"form"):null;return isHtmlElementNode(formValue)?formValue:null}function sequentialTabIndexValue(element){return Math.max(0,getTabIndexValue(element))}function isSequentiallyAfterReference(element,reference,direction,relativePosition){const referenceTabIndex=getTabIndexValue(reference);const elementTabIndex=getTabIndexValue(element);const referenceIsPositive=referenceTabIndex>0;const elementIsPositive=elementTabIndex>0;if(direction==="after"){if(referenceIsPositive){if(!elementIsPositive)return true;if(elementTabIndex!==referenceTabIndex)return elementTabIndex>referenceTabIndex;return relativePosition>0}if(elementIsPositive)return false;return relativePosition>0}if(referenceIsPositive){if(!elementIsPositive)return false;if(elementTabIndex!==referenceTabIndex)return elementTabIndex<referenceTabIndex;return relativePosition<0}if(elementIsPositive)return true;return relativePosition<0}function getTabIndexValue(element){return getExplicitTabIndexValue(element)??(hasNativeSequentialDefault(element)?0:-1)}function findSequentialEntryTarget(candidates,referenceTabIndex,direction){if(direction==="after"){if(referenceTabIndex>0){return candidates.find((candidate)=>getTabIndexValue(candidate)>=referenceTabIndex)??null}return candidates.find((candidate)=>getTabIndexValue(candidate)===0)??null}if(referenceTabIndex===0)return candidates.at(-1)??null;return[...candidates].reverse().find((candidate)=>{const candidateTabIndex=getTabIndexValue(candidate);return candidateTabIndex>0&&candidateTabIndex<=referenceTabIndex})??null}function getExplicitTabIndexValue(element){const rawValue=element.getAttribute("tabindex");if(rawValue!==null){const match=/^[\t\n\f\r ]*([+-]?\d+)/.exec(rawValue);if(match?.[1]){const parsedValue=Number(match[1]);return Number.isInteger(parsedValue)&&parsedValue>=-2147483648&&parsedValue<=2147483647?parsedValue:-1}}return null}function isEditingHost(element){return hasContentEditableState(element)&&!hasContentEditableState(element.parentElement)}function hasContentEditableState(element){for(let current=element;current;current=current.parentElement){const value=current.getAttribute("contenteditable")?.toLowerCase();if(value===""||value==="true"||value==="plaintext-only")return true;if(value==="false")return false}return false}function isFirstDetailsSummary(element){const details=element.parentElement;return details?.tagName==="DETAILS"&&Array.from(details.children).find((child)=>child.tagName==="SUMMARY")===element}function isInsideClosedDetails(element){let current=composedParentElement(element);while(current){const summary=Array.from(current.children).find((child)=>child.tagName==="SUMMARY");if(current.tagName==="DETAILS"&&!current.hasAttribute("open")&&!(summary&&composedContains(summary,element)))return true;current=composedParentElement(current)}return false}function composedContains(ancestor,descendant){for(let current=descendant;current;current=composedParentElement(current)){if(current===ancestor)return true}return false}function closestComposed(element,selector){let candidate=element;while(candidate){if(candidate.matches(selector))return candidate;candidate=composedParentElement(candidate)}return null}function isRendered(element){if(typeof getComputedStyle!=="function")return true;let candidate=element;while(candidate){const style=getComputedStyle(candidate);if(style.display==="none"||style.visibility==="hidden"||style.visibility==="collapse")return false;candidate=composedParentElement(candidate)}return true}function composedParentElement(element){return assignedSlotFor(element)??element.parentElement??shadowHost(element.getRootNode())}function assignedSlotFor(element){if(isElementNode(element.assignedSlot))return element.assignedSlot;const shadowRoot=element.parentElement?.shadowRoot;if(!shadowRoot)return null;for(const slot of shadowRoot.querySelectorAll("slot")){if(isSlotElement(slot)&&slot.assignedElements({flatten:true}).includes(element)){return slot}}return null}function shadowHost(root){if(!("host"in root))return null;const host=root.host;return isElementNode(host)?host:null}function isElementNode(value){return Boolean(value&&typeof value==="object"&&"nodeType"in value&&value.nodeType===1&&"namespaceURI"in value)}function isHtmlElementNode(value){return isElementNode(value)&&value.namespaceURI==="http://www.w3.org/1999/xhtml"}function isSequentialFocusTarget(value){return isElementNode(value)&&(value.namespaceURI==="http://www.w3.org/1999/xhtml"||value.namespaceURI==="http://www.w3.org/2000/svg")}function isParentNode(node){return"children"in node}function isSearchableRoot(node){return"querySelectorAll"in node}function*composedFocusScopes(anchor){let referenceNode=anchor;let rootNode=anchor.getRootNode();while(isSearchableRoot(rootNode)){yield{root:rootNode,anchor:referenceNode};if(!(rootNode instanceof ShadowRoot))return;referenceNode=rootNode.host;rootNode=referenceNode.getRootNode()}}function isOptionGetter(value){return typeof value==="function"}function readOption(value){return isOptionGetter(value)?value():value}var trapStack=[];var FOCUSABLE_SELECTOR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","summary",'[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'].join(", ");function noop(){}function isHiddenByTree(element){if(element.hidden)return true;if(element.matches('[inert], [aria-hidden="true"]'))return true;const ancestor=element.closest('[hidden], [inert], [aria-hidden="true"]');return ancestor!==null&&ancestor!==element}function isFocusableCandidate(element){if(isHiddenByTree(element))return false;if(element.hasAttribute("disabled"))return false;if(element.hasAttribute("tabindex")&&element.tabIndex<0)return false;return true}var NATIVELY_FOCUSABLE_TAGS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","SUMMARY"]);function isProgrammaticallyFocusable(element){if(isHiddenByTree(element))return false;if(element.hasAttribute("disabled"))return false;if(element.hasAttribute("tabindex"))return true;if(NATIVELY_FOCUSABLE_TAGS.has(element.tagName))return true;if(element.tagName==="A"&&element.hasAttribute("href"))return true;const contentEditable=element.getAttribute("contenteditable");if(contentEditable!==null&&contentEditable!=="false")return true;return false}function getTabbableElements(root){return Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR)).filter((element)=>root.contains(element)&&isFocusableCandidate(element))}function resolveScopedTarget(root,target){const resolved=readOption(target??null);if(!resolved)return null;if(typeof resolved==="string"){let match=null;try{match=root.querySelector(resolved)}catch{return null}return match&&root.contains(match)?match:null}return resolved instanceof HTMLElement&&root.contains(resolved)?resolved:null}function getFallbackTarget(root,fallbackFocus){const resolved=resolveScopedTarget(root,fallbackFocus);return resolved&&isProgrammaticallyFocusable(resolved)?resolved:null}function getRestoreFallbackTarget(restoreFallback){const resolved=readOption(restoreFallback);if(!resolved)return null;if(typeof resolved==="string"){if(typeof document==="undefined")return null;let match;try{match=document.querySelector(resolved)}catch{return null}return match&&isProgrammaticallyFocusable(match)?match:null}return resolved instanceof HTMLElement&&isProgrammaticallyFocusable(resolved)?resolved:null}function tryFocus(element){element.focus();return document.activeElement===element}function ensureRootFocusable(root){if(root.hasAttribute("tabindex")){return()=>{}}root.setAttribute("tabindex","-1");return()=>{root.removeAttribute("tabindex")}}function pushTrap(instance){const existingIndex=trapStack.findIndex((entry)=>entry.id===instance.id);if(existingIndex!==-1){trapStack.splice(existingIndex,1)}trapStack.push(instance)}function removeTrap(id){const index=trapStack.findIndex((entry)=>entry.id===id);if(index!==-1){trapStack.splice(index,1)}}function isTopTrap(id){return trapStack.at(-1)?.id===id}function createFocusTrap(options={}){const trapId=Symbol("focus-trap");return(node)=>{const isActive=()=>readOption(options.active??true);const restoreFocus=options.restoreFocus??true;const initialFocus=options.initialFocus??null;const fallbackFocus=options.fallbackFocus??null;const restoreFallback=options.restoreFallback??null;const preferRestoreFallback=options.preferRestoreFallback??false;const manageInitialFocus=options.manageInitialFocus??true;let activated=false;let activationGeneration=0;let capturedFocus=null;let restoreRootFocusability=noop;function focusTrapTarget(){const preferred=resolveScopedTarget(node,initialFocus);if(preferred&&isProgrammaticallyFocusable(preferred)&&tryFocus(preferred)){return}const tabbable=getTabbableElements(node);if(tabbable.length>0&&tabbable[0]&&tryFocus(tabbable[0])){return}const fallbackTarget=getFallbackTarget(node,fallbackFocus);if(fallbackTarget&&tryFocus(fallbackTarget)){return}restoreRootFocusability=ensureRootFocusable(node);node.focus()}function activate(){if(activated)return;activated=true;const generation=++activationGeneration;capturedFocus=document.activeElement instanceof HTMLElement&&document.activeElement!==document.body?document.activeElement:null;pushTrap({id:trapId,node});if(!manageInitialFocus)return;queueMicrotask(()=>{if(!activated||generation!==activationGeneration||!isActive())return;focusTrapTarget()})}function deactivate(){if(!activated)return;activated=false;restoreRootFocusability();restoreRootFocusability=noop;removeTrap(trapId);if(restoreFocus){const candidates=readOption(preferRestoreFallback??false)?[getRestoreFallbackTarget(restoreFallback),capturedFocus]:[capturedFocus,getRestoreFallbackTarget(restoreFallback)];for(const candidate of candidates){if(restoreFocusTo(candidate)&&document.activeElement===candidate)break}}capturedFocus=null}function handleKeydown(event){if(!isActive()||!isTopTrap(trapId)||event.key!=="Tab")return;const tabbable=getTabbableElements(node);if(tabbable.length===0){const fallbackTarget=getFallbackTarget(node,fallbackFocus);event.preventDefault();if(!fallbackTarget||!tryFocus(fallbackTarget)){restoreRootFocusability=ensureRootFocusable(node);node.focus()}return}const first=tabbable[0];const last=tabbable[tabbable.length-1];const activeElement=document.activeElement;if(event.shiftKey&&activeElement===first){event.preventDefault();last?.focus()}else if(!event.shiftKey&&activeElement===last){event.preventDefault();first?.focus()}}node.addEventListener("keydown",handleKeydown);$.user_effect(()=>{if(!isActive())return;activate();return()=>{deactivate()}});return()=>{node.removeEventListener("keydown",handleKeydown);deactivate()}}}var rest_excludes=new Set(["$$slots","$$events","$$legacy","active","restoreFocus","initialFocus","fallbackFocus","restoreFallback","preferRestoreFallback","class","children"]);var root=$2.from_html(`<div><!></div>`);function Focus_trap($$anchor,$$props){$2.push($$props,true);let active=$2.prop($$props,"active",3,true),restoreFocus=$2.prop($$props,"restoreFocus",3,true),initialFocus=$2.prop($$props,"initialFocus",3,null),fallbackFocus=$2.prop($$props,"fallbackFocus",3,null),restoreFallback=$2.prop($$props,"restoreFallback",3,null),preferRestoreFallback=$2.prop($$props,"preferRestoreFallback",3,false),rest=$2.rest_props($$props,rest_excludes);var div=root();$2.attribute_effect(div,($0)=>({class:$0,...rest}),[()=>classNames($$props.class)]);var node=$2.child(div);$2.snippet(node,()=>$$props.children);$2.reset(div);$2.attach(div,()=>createFocusTrap({active:()=>active(),restoreFocus:restoreFocus(),initialFocus:()=>initialFocus(),fallbackFocus:()=>fallbackFocus(),restoreFallback:()=>restoreFallback(),preferRestoreFallback:()=>preferRestoreFallback()}));$2.append($$anchor,div);$2.pop()}var escapeStack=[];function pushEscapeHandler(handler){escapeStack.push(handler);if(escapeStack.length===1&&typeof window!=="undefined"){window.addEventListener("keydown",onEscapeKeydown,{capture:true})}let released=false;return()=>{if(released)return;released=true;const index=escapeStack.lastIndexOf(handler);if(index!==-1)escapeStack.splice(index,1);if(escapeStack.length===0&&typeof window!=="undefined"){window.removeEventListener("keydown",onEscapeKeydown,{capture:true})}}}function onEscapeKeydown(event){if(event.key!=="Escape")return;const handler=escapeStack.at(-1);if(!handler)return;handler(event)}var scrollLockCount=0;var originalBodyOverflow=null;function lockBodyScroll(){if(typeof document==="undefined")return()=>{};if(scrollLockCount===0){originalBodyOverflow=document.body.style.overflow;document.body.style.overflow="hidden"}scrollLockCount+=1;let released=false;return()=>{if(released)return;released=true;scrollLockCount=Math.max(0,scrollLockCount-1);if(scrollLockCount===0){document.body.style.overflow=originalBodyOverflow??"";originalBodyOverflow=null}}}function captureFocus(){if(typeof document==="undefined")return null;const active=document.activeElement;if(active&&active!==document.body&&active instanceof HTMLElement){return active}return null}function createBodyScrollLock(){return()=>{const release=lockBodyScroll();return release}}function isInsideEventPath(event,element){const path=event.composedPath();return path.some((entry)=>entry instanceof Node&&element.contains(entry))}function createClickOutside(options){const{handler,enabled=true,eventType="click",capture=true,ignoreRefs}=options;return(node)=>{function handleEvent(event){const isEnabled=typeof enabled==="function"?enabled():enabled;if(!isEnabled)return;if(event.type==="touchstart"&&!event.cancelable)return;const target=event.target;if(!(target instanceof Node)){handler();return}if(isInsideEventPath(event,node))return;if(ignoreRefs){for(const ref of ignoreRefs){const element=ref();if(element&&isInsideEventPath(event,element))return}}handler()}document.addEventListener(eventType,handleEvent,capture);return()=>{document.removeEventListener(eventType,handleEvent,capture)}}}function overflowFade(){return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute("data-cinder-overflows");return}const update=()=>{const overflows=node.scrollHeight-node.clientHeight>1;const atBottom=node.scrollTop+node.clientHeight>=node.scrollHeight-1;node.toggleAttribute("data-cinder-overflows",overflows&&!atBottom)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});node.addEventListener("scroll",scheduleUpdate,{passive:true});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect();node.removeEventListener("scroll",scheduleUpdate)}}}var OVERFLOW_SHADOW_ATTRIBUTE={inline:"data-cinder-overflows-inline",block:"data-cinder-overflows-block"};function overflowShadow(axis){const attributeName=OVERFLOW_SHADOW_ATTRIBUTE[axis];return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute(attributeName);return}const update=()=>{const overflows=axis==="inline"?node.scrollWidth-node.clientWidth>1:node.scrollHeight-node.clientHeight>1;node.toggleAttribute(attributeName,overflows)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect()}}}var OVERFLOW_FADE_START_ATTRIBUTE={block:"data-cinder-overflows-start",inline:"data-cinder-overflows-inline-start"};var OVERFLOW_FADE_END_ATTRIBUTE={block:"data-cinder-overflows",inline:"data-cinder-overflows-inline-end"};function overflowFadeEdges(axis){const startAttribute=OVERFLOW_FADE_START_ATTRIBUTE[axis];const endAttribute=OVERFLOW_FADE_END_ATTRIBUTE[axis];return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute(startAttribute);node.removeAttribute(endAttribute);return}const update=()=>{const scrollPosition=axis==="block"?node.scrollTop:node.scrollLeft;const contentExtent=axis==="block"?node.scrollHeight:node.scrollWidth;const viewportExtent=axis==="block"?node.clientHeight:node.clientWidth;const overflows=contentExtent-viewportExtent>1;const atStart=scrollPosition<=1;const atEnd=scrollPosition+viewportExtent>=contentExtent-1;node.toggleAttribute(startAttribute,overflows&&!atStart);node.toggleAttribute(endAttribute,overflows&&!atEnd)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});node.addEventListener("scroll",scheduleUpdate,{passive:true});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect();node.removeEventListener("scroll",scheduleUpdate)}}}var focus_trap_default=Focus_trap;import"@lostgradient/cinder/alert-dialog/styles";import"svelte/internal/disclose-version";import*as $7 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $3 from"svelte/internal/client";var true_default=true;function devWarn(message,...args){if(!true_default)return;console.warn(message,...args)}var rest_excludes2=new Set(["$$slots","$$events","$$legacy","variant","size","fullWidth","loading","iconOnly","leadingIcon","trailingIcon","children","label","class","href","onclick","aria-disabled","aria-busy","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-haspopup"]);var root2=$3.from_html(`<span class="cinder-button__icon" aria-hidden="true"><!></span>`);var root_1=$3.from_html(`<span class="cinder-sr-only"> </span>`);var root_2=$3.from_html(`<!> <!>`,1);var root_3=$3.from_html(`<!> <!> <!>`,1);var root_4=$3.from_html(`<a><!></a>`);var root_5=$3.from_html(`<button><!></button>`);function Button($$anchor,$$props){$3.push($$props,true);const buttonContent=($$anchor2)=>{var fragment=root_3();var node=$3.first_child(fragment);{var consequent=($$anchor3)=>{var span=root2();var node_1=$3.child(span);$3.snippet(node_1,()=>$$props.leadingIcon);$3.reset(span);$3.append($$anchor3,span)};$3.if(node,($$render)=>{if($$props.leadingIcon)$$render(consequent)})}var node_2=$3.sibling(node,2);{var consequent_3=($$anchor3)=>{var fragment_1=root_2();var node_3=$3.first_child(fragment_1);{var consequent_1=($$anchor4)=>{var span_1=root_1();var text2=$3.child(span_1,true);$3.reset(span_1);$3.template_effect(()=>$3.set_text(text2,$$props.label));$3.append($$anchor4,span_1)};$3.if(node_3,($$render)=>{if(!$3.get(resolvedAriaLabel)&&!$3.get(resolvedAriaLabelledBy)&&$$props.label)$$render(consequent_1)})}var node_4=$3.sibling(node_3,2);{var consequent_2=($$anchor4)=>{var span_2=root2();var node_5=$3.child(span_2);$3.snippet(node_5,()=>$$props.children);$3.reset(span_2);$3.append($$anchor4,span_2)};$3.if(node_4,($$render)=>{if($$props.children)$$render(consequent_2)})}$3.append($$anchor3,fragment_1)};var consequent_4=($$anchor3)=>{var fragment_2=$3.comment();var node_6=$3.first_child(fragment_2);$3.snippet(node_6,()=>$$props.children);$3.append($$anchor3,fragment_2)};var alternate=($$anchor3)=>{var text_1=$3.text();$3.template_effect(()=>$3.set_text(text_1,$$props.label));$3.append($$anchor3,text_1)};$3.if(node_2,($$render)=>{if(iconOnly())$$render(consequent_3);else if($$props.children)$$render(consequent_4,1);else $$render(alternate,-1)})}var node_7=$3.sibling(node_2,2);{var consequent_5=($$anchor3)=>{var span_3=root2();var node_8=$3.child(span_3);$3.snippet(node_8,()=>$$props.trailingIcon);$3.reset(span_3);$3.append($$anchor3,span_3)};$3.if(node_7,($$render)=>{if($$props.trailingIcon)$$render(consequent_5)})}$3.append($$anchor2,fragment)};const variant=$3.prop($$props,"variant",3,"secondary"),size=$3.prop($$props,"size",3,"md"),fullWidth=$3.prop($$props,"fullWidth",3,false),loading=$3.prop($$props,"loading",3,false),iconOnly=$3.prop($$props,"iconOnly",3,false),rest=$3.rest_props($$props,rest_excludes2);const mergedClassName=$3.derived(()=>classNames("cinder-button",$$props.class));const dataAttributes=$3.derived(()=>({"data-cinder-variant":variant(),"data-cinder-size":size(),"data-cinder-full-width":fullWidth()?"":undefined,"data-cinder-loading":loading()?"":undefined,"data-cinder-icon-only":iconOnly()?"":undefined}));const resolvedAriaDisabled=$3.derived(()=>loading()?"true":$$props["aria-disabled"]);const resolvedAriaBusy=$3.derived(()=>loading()?"true":$$props["aria-busy"]);const resolvedAriaLabel=$3.derived(()=>typeof $$props["aria-label"]==="string"&&$$props["aria-label"].trim().length>0?$$props["aria-label"]:undefined);const resolvedAriaLabelledBy=$3.derived(()=>typeof $$props["aria-labelledby"]==="string"&&$$props["aria-labelledby"].trim().length>0?$$props["aria-labelledby"]:undefined);const anchorAttributes=$3.derived(()=>rest);const buttonAttributes=$3.derived(()=>rest);const anchorTabIndex=$3.derived(()=>$$props.tabindex);const buttonType=$3.derived(()=>$$props.type);const buttonDisabled=$3.derived(()=>$$props.disabled??false);function handleClick(event){if(loading()){event.preventDefault();return}if(typeof $$props.onclick==="function"){$$props.onclick(event)}}$3.user_effect(()=>{const hasLabel=typeof $$props.label==="string"&&$$props.label.trim().length>0;const hasChildren=Boolean($$props.children);const hasAriaLabel=$3.get(resolvedAriaLabel)!==undefined;const hasAriaLabelledBy=$3.get(resolvedAriaLabelledBy)!==undefined;if(!hasLabel&&!hasChildren&&!hasAriaLabel&&!hasAriaLabelledBy){devWarn("[cinder/Button] rendered without an accessible name — pass a non-empty `label`, `children`, `aria-label`, or `aria-labelledby`.")}if(iconOnly()&&!hasAriaLabel&&!hasAriaLabelledBy&&!hasLabel){devWarn("[cinder/Button] iconOnly=true requires aria-label, aria-labelledby, or a non-empty label.")}if(iconOnly()&&!$$props.leadingIcon&&!$$props.trailingIcon&&!$$props.children){devWarn("[cinder/Button] iconOnly=true requires a visible icon — pass leadingIcon, trailingIcon, or children.")}});var fragment_4=$3.comment();var node_9=$3.first_child(fragment_4);{var consequent_6=($$anchor2)=>{var a=root_4();$3.attribute_effect(a,()=>({...$3.get(anchorAttributes),href:loading()?undefined:$$props.href,tabindex:loading()?-1:$3.get(anchorTabIndex),class:$3.get(mergedClassName),...$3.get(dataAttributes),"aria-disabled":$3.get(resolvedAriaDisabled),"aria-busy":$3.get(resolvedAriaBusy),"aria-label":$3.get(resolvedAriaLabel),"aria-labelledby":$3.get(resolvedAriaLabelledBy),"aria-expanded":$$props["aria-expanded"],"aria-controls":$$props["aria-controls"],"aria-haspopup":$$props["aria-haspopup"],onclick:handleClick}));var node_10=$3.child(a);buttonContent(node_10);$3.reset(a);$3.append($$anchor2,a)};var alternate_1=($$anchor2)=>{var button=root_5();$3.attribute_effect(button,()=>({...$3.get(buttonAttributes),type:$3.get(buttonType)??"button",class:$3.get(mergedClassName),...$3.get(dataAttributes),disabled:$3.get(buttonDisabled)||loading(),"aria-disabled":$3.get(resolvedAriaDisabled),"aria-busy":$3.get(resolvedAriaBusy),"aria-label":$3.get(resolvedAriaLabel),"aria-labelledby":$3.get(resolvedAriaLabelledBy),"aria-expanded":$$props["aria-expanded"],"aria-controls":$$props["aria-controls"],"aria-haspopup":$$props["aria-haspopup"],onclick:handleClick}));var node_11=$3.child(button);buttonContent(node_11);$3.reset(button);$3.append($$anchor2,button)};$3.if(node_9,($$render)=>{if($$props.href!==undefined)$$render(consequent_6);else $$render(alternate_1,-1)})}$3.append($$anchor,fragment_4);$3.pop()}import"svelte/internal/disclose-version";import*as $6 from"svelte/internal/client";import{onDestroy}from"svelte";import{createContext}from"svelte";function optionalContext(getStrict){return()=>{try{return getStrict()}catch{return}}}var[getHostContextStrict,setHostContextRaw]=createContext();function setHostContext(value){setHostContextRaw(value)}function getHostContext(){return optionalContext(getHostContextStrict)()??{platform:"web",isDesktop:false}}import*as $4 from"svelte/internal/client";import{MediaQuery,SvelteMap}from"svelte/reactivity";function readRootPreference(root3){if(!root3)return"system";const preference=root3.dataset["reducedMotion"];return preference==="on"||preference==="off"||preference==="system"?preference:"system"}function synchronizeRootPreference(root3){const preference=readRootPreference(root3);if(!root3)return preference;if(preference==="system")delete root3.dataset["cinderReducedMotion"];else root3.dataset["cinderReducedMotion"]=String(preference==="on");return preference}var applicationRoot=typeof document==="undefined"?undefined:document.documentElement;var applicationPreferences=new SvelteMap([["current","system"]]);var ApplicationMutationObserver=applicationRoot?.ownerDocument.defaultView?.MutationObserver??globalThis.MutationObserver;if(applicationRoot&&ApplicationMutationObserver){new ApplicationMutationObserver(()=>{applicationPreferences.set("current",synchronizeRootPreference(applicationRoot))}).observe(applicationRoot,{attributes:true,attributeFilter:["data-reduced-motion"]});queueMicrotask(()=>{applicationPreferences.set("current",synchronizeRootPreference(applicationRoot))})}function getApplicationPreference(){return applicationPreferences.get("current")??"system"}function resolveReducedMotion(preference,systemPrefersReducedMotion){return preference==="on"||preference==="system"&&systemPrefersReducedMotion}function applyReducedMotionPreference(element,preference){if(element!==element.ownerDocument.documentElement){throw new Error("applyReducedMotionPreference must target document.documentElement")}applicationPreferences.set("current",preference);element.dataset["reducedMotion"]=preference;if(preference==="system"){delete element.dataset["cinderReducedMotion"];return}element.dataset["cinderReducedMotion"]=String(preference==="on")}function useReducedMotion(preference){if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return{current:resolveReducedMotion(preference??getApplicationPreference(),false)}}const query=new MediaQuery("(prefers-reduced-motion: reduce)",false);return{get current(){return resolveReducedMotion(preference??getApplicationPreference(),query.current)}}}import*as $5 from"svelte/internal/client";import{tick}from"svelte";function parseTimeValueList(value){return value.split(",").map((part)=>part.trim()).map((part)=>{if(part.endsWith("ms"))return Number.parseFloat(part);if(part.endsWith("s"))return Number.parseFloat(part)*1000;return 0}).filter((part)=>Number.isFinite(part))}function getRepeatedValue(values,index,fallback){if(values.length===0)return fallback;return values[index%values.length]??fallback}function getLongestTransitionTime(element){const style=window.getComputedStyle(element);const properties=style.transitionProperty.split(",").map((part)=>part.trim()).filter(Boolean);const durations=parseTimeValueList(style.transitionDuration);const delays=parseTimeValueList(style.transitionDelay);const count=properties.length;let longest=0;for(let index=0;index<count;index+=1){const property=getRepeatedValue(properties,index,"all");if(property==="none")continue;const duration=getRepeatedValue(durations,index,0);const delay=getRepeatedValue(delays,index,0);longest=Math.max(longest,duration+delay)}return longest}function getTrackedTransitionProperties(element){const style=window.getComputedStyle(element);const properties=style.transitionProperty.split(",").map((part)=>part.trim()).filter(Boolean);const durations=parseTimeValueList(style.transitionDuration);const delays=parseTimeValueList(style.transitionDelay);const count=Math.max(properties.length,durations.length,delays.length);const trackedProperties=new Set;for(let index=0;index<count;index+=1){const property=getRepeatedValue(properties,index,"all");const duration=getRepeatedValue(durations,index,0);const delay=getRepeatedValue(delays,index,0);if(duration+delay<=0)continue;if(property==="none")continue;if(property==="all")return null;trackedProperties.add(property)}return trackedProperties}function waitForTransitionCompletion({element,reducedMotion,onComplete,ignoreCancel=false,ignoreUnknownPropertyEvents=false}){let completed=false;let fallbackTimer;let cancelListenerFrame;const finish=()=>{if(completed)return;completed=true;element.removeEventListener("transitionend",handleTransitionEnd);if(!ignoreCancel)element.removeEventListener("transitioncancel",handleTransitionCancel);if(fallbackTimer){clearTimeout(fallbackTimer);fallbackTimer=undefined}if(cancelListenerFrame!==undefined){cancelAnimationFrame(cancelListenerFrame);cancelListenerFrame=undefined}onComplete()};const handleTransitionEnd=(event)=>{if(event.target instanceof Element&&event.target!==element)return;if(!pendingProperties){if(ignoreUnknownPropertyEvents)return;finish();return}pendingProperties.delete(event.propertyName);if(pendingProperties.size===0){finish()}};const handleTransitionCancel=(event)=>{if(event.target instanceof Element&&event.target!==element)return;finish()};const totalTransitionTime=reducedMotion?0:getLongestTransitionTime(element);const pendingProperties=reducedMotion?new Set:getTrackedTransitionProperties(element);if(totalTransitionTime<=0||pendingProperties?.size===0){queueMicrotask(finish);return finish}element.addEventListener("transitionend",handleTransitionEnd);if(!ignoreCancel){if(typeof requestAnimationFrame==="function"){cancelListenerFrame=requestAnimationFrame(()=>{cancelListenerFrame=requestAnimationFrame(()=>{cancelListenerFrame=undefined;if(completed)return;element.addEventListener("transitioncancel",handleTransitionCancel)})})}else{element.addEventListener("transitioncancel",handleTransitionCancel)}}fallbackTimer=setTimeout(finish,totalTransitionTime+50);return finish}function reportUnhandledExitCompleteError(error){if(typeof globalThis.reportError==="function"){globalThis.reportError(error);return}setTimeout(()=>{throw error},0)}class SlidingDialogState{#hydrated=$5.state(false);get hydrated(){return $5.get(this.#hydrated)}set hydrated(value){$5.set(this.#hydrated,value,true)}#renderPanel=$5.state(false);get renderPanel(){return $5.get(this.#renderPanel)}set renderPanel(value){$5.set(this.#renderPanel,value,true)}#isClosing=$5.state(false);get isClosing(){return $5.get(this.#isClosing)}set isClosing(value){$5.set(this.#isClosing,value,true)}#options;#closeGeneration=$5.state(0);#capturedFocus=null;#releaseScrollLock=null;#releaseEscape=null;#cancelPendingClose=null;#suppressedNativeCloseEvents=0;#disposed=false;#lastCompletedGeneration=null;#pendingNativeCloseGenerations=[];constructor(options){this.#options=options;this.renderPanel=options.getOpen()}markHydrated(){this.hydrated=true}syncOpenState(){const dialogElement=this.#options.getDialogElement();if(!dialogElement)return;if(this.#options.getOpen()){const wasClosingOrClosed=this.isClosing||!dialogElement.open;if(wasClosingOrClosed){$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1)}if(this.isClosing){this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.isClosing=false;this.#options.onOpen?.()}if(!this.renderPanel){this.renderPanel=true}if(!dialogElement.open){this.#capturedFocus=captureFocus();dialogElement.showModal();this.#acquireScrollLock();this.#acquireEscapeMarker();this.#options.onOpen?.()}return}if(dialogElement.open){this.beginClosing()}else{this.renderPanel=false}}beginClosing(){const dialogElement=this.#options.getDialogElement();if(!dialogElement?.open||this.isClosing)return;const panelElement=this.#options.getPanelElement();if(!panelElement){this.#finishClosing($5.get(this.#closeGeneration));return}this.isClosing=true;const generation=$5.update_pre(this.#closeGeneration);this.#cancelPendingClose?.();this.#cancelPendingClose=waitForTransitionCompletion({element:panelElement,reducedMotion:this.#options.getReducedMotion(),onComplete:()=>this.#finishClosing(generation)})}handleClose(){if(this.#suppressedNativeCloseEvents>0){this.#suppressedNativeCloseEvents-=1;return}const expectedGeneration=this.#pendingNativeCloseGenerations.shift();if(expectedGeneration!==undefined){if(expectedGeneration!==$5.get(this.#closeGeneration)){return}}else{const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){return}}if(expectedGeneration===undefined){if(this.isClosing){$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1);this.#cancelPendingClose?.();this.#cancelPendingClose=null}}this.#completeCloseOnce(expectedGeneration??$5.get(this.#closeGeneration))}requestClose(){if(!this.#options.getOpen()&&(this.isClosing||!this.#options.getDialogElement()?.open)){return}this.#options.setOpen(false);this.beginClosing()}handleBackdropClick(event){if(event.target===this.#options.getDialogElement()){this.requestClose()}}handleNativeCancel(event){event.preventDefault();this.requestClose()}destroy(){this.#disposed=true;this.#cancelPendingClose?.();this.#cancelPendingClose=null;const wasOpen=this.#releaseScrollLock!==null||this.#releaseEscape!==null;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;if(wasOpen){this.#returnFocus()}}releaseModalState(options={}){this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.#pendingNativeCloseGenerations=[];$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1);this.isClosing=false;this.renderPanel=false;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){this.#suppressedNativeCloseEvents+=1;dialogElement.close()}if(options.restoreFocus)this.#returnFocus();else this.#capturedFocus=null}#finishClosing(generation){if(generation!==$5.get(this.#closeGeneration))return;this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.isClosing=false;if(this.#options.getOpen()){this.renderPanel=true;return}this.renderPanel=false;const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){this.#pendingNativeCloseGenerations.push(generation);dialogElement.close();return}if(dialogElement)return;this.#completeCloseOnce(generation)}#completeCloseOnce(generation){if(this.#lastCompletedGeneration===generation)return;this.#lastCompletedGeneration=generation;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;this.#options.setOpen(false);this.#returnFocus();this.isClosing=false;this.renderPanel=false;const closedGeneration=generation;tick().then(()=>{if(this.#disposed||closedGeneration!==$5.get(this.#closeGeneration)||this.#options.getOpen()||this.renderPanel){return}try{this.#options.onClosed?.()}catch(error){reportUnhandledExitCompleteError(error)}})}#acquireScrollLock(){if(this.#releaseScrollLock)return;this.#releaseScrollLock=lockBodyScroll()}#acquireEscapeMarker(){if(this.#releaseEscape)return;this.#releaseEscape=pushEscapeHandler(()=>{})}#returnFocus(){const candidates=[this.#options.getTriggerRef(),this.#capturedFocus];this.#capturedFocus=null;for(const candidate of candidates){if(restoreFocusTo(candidate))break}}}function createSlidingDialogState(options){return new SlidingDialogState(options)}function focusDialogBodyUnlessAutofocused(options){const applyInitialFocusPolicy=()=>{const dialogElement=options.getDialogElement();if(!options.getOpen()||!dialogElement?.open)return;const rootNode=dialogElement.getRootNode();const activeElementInRoot=()=>rootNode instanceof Document||rootNode instanceof ShadowRoot?rootNode.activeElement:document.activeElement;const autofocusTarget=dialogElement.querySelector("[autofocus]")??Array.from(dialogElement.querySelectorAll("*")).find((element)=>element.autofocus)??null;if(autofocusTarget){const active=activeElementInRoot();const focusInsideDialog=active instanceof HTMLElement&&dialogElement.contains(active);if(!focusInsideDialog){autofocusTarget.focus();if(activeElementInRoot()===autofocusTarget)return}else{return}}options.getBodyElement()?.focus()};tick().then(applyInitialFocusPolicy)}var root3=$6.from_html(`<div class="cinder-modal__drag-strip" aria-hidden="true"></div>`);var root_12=$6.from_html(`<div class="cinder-modal__header"><h2 class="cinder-modal__title"> </h2></div>`);var root_22=$6.from_html(`<div class="cinder-modal__footer"><!></div>`);var root_32=$6.from_html(`<button type="button" class="cinder-modal__close" aria-label="Close dialog"><svg class="cinder-modal__close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg></button>`);var root_42=$6.from_html(`<div class="cinder-modal__panel"><!> <!> <div class="cinder-modal__body cinder-_scroll-fade" tabindex="-1"><!></div> <!> <!></div>`);var root_52=$6.from_html(`<dialog><!></dialog>`);function Modal($$anchor,$$props){const titleId=$6.props_id();$6.push($$props,true);function isNonEmptyString(value){return typeof value==="string"&&value.trim()!==""}let open=$6.prop($$props,"open",15,false),chrome=$6.prop($$props,"chrome",3,"default"),role=$6.prop($$props,"role",3,"dialog"),dismissOnBackdropClick=$6.prop($$props,"dismissOnBackdropClick",3,true),dismissOnEscape=$6.prop($$props,"dismissOnEscape",3,true),closeButtonVisible=$6.prop($$props,"closeButtonVisible",3,true),triggerRef=$6.prop($$props,"triggerRef",3,null);const host=getHostContext();const isChromeless=$6.derived(()=>chrome()==="none");let dialogElement=$6.state(undefined);let panelElement=$6.state(undefined);let bodyElement=$6.state(undefined);let mounted=$6.state(false);const reducedMotion=useReducedMotion();const bodyOverflowFade=overflowFade();const dialogState=createSlidingDialogState({getOpen:()=>open(),setOpen:(nextOpen)=>{open(nextOpen)},getDialogElement:()=>$6.get(dialogElement),getPanelElement:()=>$6.get(panelElement),getReducedMotion:()=>reducedMotion.current,getTriggerRef:()=>triggerRef(),onOpen:()=>focusDialogBodyUnlessAutofocused({getOpen:()=>open(),getDialogElement:()=>$6.get(dialogElement),getBodyElement:()=>$6.get(bodyElement)}),onClosed:()=>$$props.onExitComplete?.()});$6.user_effect(()=>{$6.set(mounted,true)});$6.user_effect(()=>{if(role()==="alertdialog"&&(dismissOnBackdropClick()!==false||dismissOnEscape()!==false||closeButtonVisible()!==false)){devWarn('[cinder/Modal] role="alertdialog" requires dismissOnBackdropClick={false}, dismissOnEscape={false}, and closeButtonVisible={false}. '+"Without these, Escape or backdrop click can bypass the mandatory acknowledgement. "+"Use <AlertDialog> instead, or pass all three companion props explicitly.")}});$6.user_effect(()=>{if(!$6.get(isChromeless)&&!isNonEmptyString($$props.title)){devWarn('[cinder/Modal] rendered with chrome="default" but no non-empty `title`. '+"The visible heading also supplies the accessible name — without it the dialog has no name for assistive technology.")}if($6.get(isChromeless)&&!isNonEmptyString($$props["aria-label"])){devWarn('[cinder/Modal] rendered with chrome="none" but no non-empty `aria-label`. '+"The chromeless chrome renders no header, so `aria-label` is the only source of the dialog's accessible name — without it the dialog has no name for assistive technology.")}});$6.user_effect(()=>{dialogState.syncOpenState()});function dismiss(){dialogState.requestClose();$$props.onDismiss?.()}onDestroy(()=>{dialogState.destroy();$6.get(dialogElement)?.remove()});function handleBackdropClick(event){if(!dismissOnBackdropClick())return;if(event.target===$6.get(dialogElement)){dismiss();return}if(!$6.get(isChromeless))return;if(event.target===$6.get(panelElement)||event.target===$6.get(bodyElement)){dismiss();return}const targetElement=event.target;if(targetElement instanceof Element&&targetElement.hasAttribute("data-cinder-modal-backdrop")){dismiss()}}function handleNativeCancel(event){event.preventDefault();if(!dismissOnEscape())return;dismiss()}var fragment=$6.comment();var node=$6.first_child(fragment);{var consequent_5=($$anchor2)=>{var dialog=root_52();var event_handler=()=>dialogState.handleClose();$6.attribute_effect(dialog,($0,$1)=>({class:$0,role:role(),"aria-modal":"true","data-cinder-chrome":$6.get(isChromeless)?"none":undefined,...$6.get(isChromeless)?{"aria-label":$$props["aria-label"]}:{"aria-labelledby":titleId},...$1,"data-cinder-closing":dialogState.isClosing?"":undefined,onclose:event_handler,onclick:handleBackdropClick,oncancel:handleNativeCancel}),[()=>classNames("cinder-modal",$$props.class),()=>isNonEmptyString($$props.describedById)?{"aria-describedby":$$props.describedById}:{}]);var node_1=$6.child(dialog);{var consequent_4=($$anchor3)=>{var div=root_42();var node_2=$6.child(div);{var consequent=($$anchor4)=>{var div_1=root3();$6.append($$anchor4,div_1)};$6.if(node_2,($$render)=>{if(host.isDesktop&&!$6.get(isChromeless))$$render(consequent)})}var node_3=$6.sibling(node_2,2);{var consequent_1=($$anchor4)=>{var div_2=root_12();var h2=$6.child(div_2);var text2=$6.child(h2,true);$6.reset(h2);$6.reset(div_2);$6.template_effect(()=>{$6.set_attribute(h2,"id",titleId);$6.set_text(text2,$$props.title)});$6.append($$anchor4,div_2)};$6.if(node_3,($$render)=>{if(!$6.get(isChromeless))$$render(consequent_1)})}var div_3=$6.sibling(node_3,2);var node_4=$6.child(div_3);$6.snippet(node_4,()=>$$props.children);$6.reset(div_3);$6.bind_this(div_3,($$value)=>$6.set(bodyElement,$$value),()=>$6.get(bodyElement));$6.attach(div_3,()=>bodyOverflowFade);var node_5=$6.sibling(div_3,2);{var consequent_2=($$anchor4)=>{var div_4=root_22();var node_6=$6.child(div_4);$6.snippet(node_6,()=>$$props.footer);$6.reset(div_4);$6.template_effect(()=>$6.set_attribute(div_4,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined));$6.append($$anchor4,div_4)};$6.if(node_5,($$render)=>{if($$props.footer)$$render(consequent_2)})}var node_7=$6.sibling(node_5,2);{var consequent_3=($$anchor4)=>{var button=root_32();$6.delegated("click",button,dismiss);$6.append($$anchor4,button)};$6.if(node_7,($$render)=>{if(closeButtonVisible())$$render(consequent_3)})}$6.reset(div);$6.bind_this(div,($$value)=>$6.set(panelElement,$$value),()=>$6.get(panelElement));$6.attach(div,()=>createFocusTrap({active:()=>open()&&!dialogState.isClosing,restoreFocus:false,manageInitialFocus:false}));$6.template_effect(()=>{$6.set_attribute(div,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined);$6.set_attribute(div,"data-cinder-closing",dialogState.isClosing?"":undefined);div.inert=dialogState.isClosing;$6.set_attribute(div_3,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined)});$6.append($$anchor3,div)};$6.if(node_1,($$render)=>{if(dialogState.renderPanel)$$render(consequent_4)})}$6.reset(dialog);$6.bind_this(dialog,($$value)=>$6.set(dialogElement,$$value),()=>$6.get(dialogElement));$6.append($$anchor2,dialog)};$6.if(node,($$render)=>{if($6.get(mounted))$$render(consequent_5)})}$6.append($$anchor,fragment);$6.pop()}$6.delegate(["click"]);var root4=$7.from_html(`<!> <!>`,1);var root_13=$7.from_html(`<p class="cinder-alert-dialog__description"> </p>`);function Alert_dialog($$anchor,$$props){const descriptionId=$7.props_id();$7.push($$props,true);let open=$7.prop($$props,"open",15,false),acknowledgeLabel=$7.prop($$props,"acknowledgeLabel",3,"OK"),destructive=$7.prop($$props,"destructive",3,false),triggerRef=$7.prop($$props,"triggerRef",3,null);function handleAcknowledge(){open(false);$$props.onAcknowledge()}function handleCancel(){open(false);$$props.onCancel?.()}const acknowledgeAutofocus=$7.derived(()=>!(destructive()&&$$props.cancelLabel));const cancelAutofocus=$7.derived(()=>Boolean(destructive()&&$$props.cancelLabel));{const footer=($$anchor2)=>{var fragment_1=root4();var node=$7.first_child(fragment_1);{var consequent=($$anchor3)=>{Button($$anchor3,{variant:"secondary",get autofocus(){return $7.get(cancelAutofocus)},onclick:handleCancel,children:($$anchor4,$$slotProps)=>{$7.next();var text3=$7.text();$7.template_effect(()=>$7.set_text(text3,$$props.cancelLabel));$7.append($$anchor4,text3)},$$slots:{default:true}})};$7.if(node,($$render)=>{if($$props.cancelLabel)$$render(consequent)})}var node_1=$7.sibling(node,2);{let $02=$7.derived(()=>destructive()?"danger":"primary");Button(node_1,{get variant(){return $7.get($02)},get autofocus(){return $7.get(acknowledgeAutofocus)},onclick:handleAcknowledge,children:($$anchor3,$$slotProps)=>{$7.next();var text_1=$7.text();$7.template_effect(()=>$7.set_text(text_1,acknowledgeLabel()));$7.append($$anchor3,text_1)},$$slots:{default:true}})}$7.append($$anchor2,fragment_1)};let $0=$7.derived(()=>classNames("cinder-alert-dialog",$$props.class));Modal($$anchor,{get title(){return $$props.title},get triggerRef(){return triggerRef()},role:"alertdialog",dismissOnBackdropClick:false,dismissOnEscape:false,closeButtonVisible:false,get describedById(){return descriptionId},get class(){return $7.get($0)},get open(){return open()},set open($$value){open($$value)},footer,children:($$anchor2,$$slotProps)=>{var p=root_13();var text_2=$7.child(p,true);$7.reset(p);$7.template_effect(()=>{$7.set_attribute(p,"id",descriptionId);$7.set_text(text_2,$$props.description)});$7.append($$anchor2,p)},$$slots:{footer:true,default:true}})}$7.pop()}var alert_dialog_default=Alert_dialog;export{Alert_dialog as AlertDialog,alert_dialog_default as default};
|
|
1
|
+
var __create=Object.create;var __getProtoOf=Object.getPrototypeOf;var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node;var __toESMCache_esm;var __toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap;var cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};const to=isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:true})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true,configurable:true,set:__exportSetter.bind(all,name)})};var __esm=(fn,res)=>()=>(fn&&(res=fn(fn=0)),res);var __require=((x)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(x,{get:(a,b)=>(typeof require!=="undefined"?require:a)[b]}):x)(function(x){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});import"svelte/internal/disclose-version";import*as $2 from"svelte/internal/client";function classNames(...parts){return parts.filter((part)=>typeof part==="string"&&part.length>0).join(" ")}import*as $ from"svelte/internal/client";function restoreFocusTo(target){if(!target)return false;if(typeof document==="undefined")return false;if(!target.isConnected)return false;if(target.ownerDocument!==document)return false;try{target.focus()}catch{return false}return true}var sequentialFocusCandidateSelector=["a[href]","area[href]","button",'input:not([type="hidden"])',"select","textarea","summary","frame","iframe","audio[controls]","video[controls]","embed","object","[contenteditable]","[tabindex]"].join(", ");function getSequentialFocusTargets(root,range){if(!root)return[];const composedElements=collectComposedElements(root);const relativeIndex=range?composedElements.indexOf(range.relativeTo):-1;if(range&&relativeIndex===-1)return[];const tierReference=range?.tierReference??range?.relativeTo;const positionOf=range?new Map(composedElements.map((element,index)=>[element,index])):null;const candidates=composedElements.filter(isSequentialFocusTarget).filter((element)=>!range||isSequentialFocusTarget(tierReference)&&isSequentiallyAfterReference(element,tierReference,range.direction,(positionOf?.get(element)??-1)-relativeIndex)).filter((element)=>element.matches(sequentialFocusCandidateSelector)).filter(isSequentialCandidate);const radios=[];for(const candidate of candidates){if(!isRadio(candidate))continue;const rootNode=candidate.getRootNode();const name=candidate.getAttribute("name")??"";if(name==="")continue;const form=getFormOwner(candidate);const group=radios.find((entry)=>entry.root===rootNode&&entry.form===form&&entry.name===name);if(!group){const members=isParentNode(rootNode)?collectComposedElements(rootNode).filter(isSequentialFocusTarget).filter(isRadio).filter((radio)=>radio.getRootNode()===rootNode&&radio.getAttribute("name")===name&&getFormOwner(radio)===form&&isSequentialCandidate(radio)):[candidate];radios.push({root:rootNode,form,name,members})}}const inRangeCandidates=new Set(candidates);const radioRepresentatives=new Set(radios.flatMap(({members})=>{const checked=members.find((radio)=>("checked"in radio)&&radio.checked);if(checked)return[checked];const inRangeMembers=range?members.filter((member)=>inRangeCandidates.has(member)):members;const fallback=range?.direction==="before"?inRangeMembers.at(-1):inRangeMembers[0];return fallback?[fallback]:[]}));const groupedRadios=new Set(radios.flatMap(({members})=>members));return candidates.filter((candidate)=>!isRadio(candidate)||!groupedRadios.has(candidate)||radioRepresentatives.has(candidate)).sort((left,right)=>{const leftTabIndex=sequentialTabIndexValue(left);const rightTabIndex=sequentialTabIndexValue(right);if(leftTabIndex===rightTabIndex)return 0;if(leftTabIndex===0)return 1;if(rightTabIndex===0)return-1;return leftTabIndex-rightTabIndex})}function collectComposedElements(root){const elements=[];const visited=new Set;const visit=(element,fromSlot=false)=>{if(visited.has(element))return;if(!fromSlot&&element.assignedSlot)return;visited.add(element);elements.push(element);if(isSlotElement(element)){if(element.assignedNodes({flatten:false}).length>0){for(const child of element.assignedElements({flatten:true}))visit(child,true);return}}const childRoot=element.shadowRoot??element;for(const child of Array.from(childRoot.children))visit(child)};for(const child of Array.from(root.children))visit(child);return elements}function isSlotElement(element){return element.localName==="slot"&&typeof Reflect.get(element,"assignedElements")==="function"&&typeof Reflect.get(element,"assignedNodes")==="function"}function isSequentialCandidate(candidate){const explicitTabIndexValue=getExplicitTabIndexValue(candidate);if(candidate.matches('input[type="hidden"]'))return false;if(getTabIndexValue(candidate)<0||candidate.matches(":disabled")||closestComposed(candidate,"[hidden], [inert]")!==null||!isRendered(candidate))return false;if(candidate.matches("summary")&&explicitTabIndexValue===null)return isFirstDetailsSummary(candidate)&&!isInsideClosedDetails(candidate);if(isInsideClosedDetails(candidate))return false;return true}function hasNativeSequentialDefault(element){return element.matches('button, input:not([type="hidden"]), a[href], area[href], select, textarea, summary, frame, iframe')||element.matches("audio[controls], video[controls], embed[src]")||element.matches("object")&&(element.getAttribute("data")?.trim().length??0)>0||isHtmlElementNode(element)&&isEditingHost(element)}function isRadio(element){return isHtmlElementNode(element)&&element.localName==="input"&&element.getAttribute("type")?.toLowerCase()==="radio"}function getFormOwner(element){const formValue="form"in element?Reflect.get(element,"form"):null;return isHtmlElementNode(formValue)?formValue:null}function sequentialTabIndexValue(element){return Math.max(0,getTabIndexValue(element))}function isSequentiallyAfterReference(element,reference,direction,relativePosition){const referenceTabIndex=getTabIndexValue(reference);const elementTabIndex=getTabIndexValue(element);const referenceIsPositive=referenceTabIndex>0;const elementIsPositive=elementTabIndex>0;if(direction==="after"){if(referenceIsPositive){if(!elementIsPositive)return true;if(elementTabIndex!==referenceTabIndex)return elementTabIndex>referenceTabIndex;return relativePosition>0}if(elementIsPositive)return false;return relativePosition>0}if(referenceIsPositive){if(!elementIsPositive)return false;if(elementTabIndex!==referenceTabIndex)return elementTabIndex<referenceTabIndex;return relativePosition<0}if(elementIsPositive)return true;return relativePosition<0}function getTabIndexValue(element){return getExplicitTabIndexValue(element)??(hasNativeSequentialDefault(element)?0:-1)}function findSequentialEntryTarget(candidates,referenceTabIndex,direction){if(direction==="after"){if(referenceTabIndex>0){return candidates.find((candidate)=>getTabIndexValue(candidate)>=referenceTabIndex)??null}return candidates.find((candidate)=>getTabIndexValue(candidate)===0)??null}if(referenceTabIndex===0)return candidates.at(-1)??null;return[...candidates].reverse().find((candidate)=>{const candidateTabIndex=getTabIndexValue(candidate);return candidateTabIndex>0&&candidateTabIndex<=referenceTabIndex})??null}function getExplicitTabIndexValue(element){const rawValue=element.getAttribute("tabindex");if(rawValue!==null){const match=/^[\t\n\f\r ]*([+-]?\d+)/.exec(rawValue);if(match?.[1]){const parsedValue=Number(match[1]);return Number.isInteger(parsedValue)&&parsedValue>=-2147483648&&parsedValue<=2147483647?parsedValue:-1}}return null}function isEditingHost(element){return hasContentEditableState(element)&&!hasContentEditableState(element.parentElement)}function hasContentEditableState(element){for(let current=element;current;current=current.parentElement){const value=current.getAttribute("contenteditable")?.toLowerCase();if(value===""||value==="true"||value==="plaintext-only")return true;if(value==="false")return false}return false}function isFirstDetailsSummary(element){const details=element.parentElement;return details?.tagName==="DETAILS"&&Array.from(details.children).find((child)=>child.tagName==="SUMMARY")===element}function isInsideClosedDetails(element){let current=composedParentElement(element);while(current){const summary=Array.from(current.children).find((child)=>child.tagName==="SUMMARY");if(current.tagName==="DETAILS"&&!current.hasAttribute("open")&&!(summary&&composedContains(summary,element)))return true;current=composedParentElement(current)}return false}function composedContains(ancestor,descendant){for(let current=descendant;current;current=composedParentElement(current)){if(current===ancestor)return true}return false}function closestComposed(element,selector){let candidate=element;while(candidate){if(candidate.matches(selector))return candidate;candidate=composedParentElement(candidate)}return null}function isRendered(element){if(typeof getComputedStyle!=="function")return true;let candidate=element;while(candidate){const style=getComputedStyle(candidate);if(style.display==="none"||style.visibility==="hidden"||style.visibility==="collapse")return false;candidate=composedParentElement(candidate)}return true}function composedParentElement(element){return assignedSlotFor(element)??element.parentElement??shadowHost(element.getRootNode())}function assignedSlotFor(element){if(isElementNode(element.assignedSlot))return element.assignedSlot;const shadowRoot=element.parentElement?.shadowRoot;if(!shadowRoot)return null;for(const slot of shadowRoot.querySelectorAll("slot")){if(isSlotElement(slot)&&slot.assignedElements({flatten:true}).includes(element)){return slot}}return null}function shadowHost(root){if(!("host"in root))return null;const host=root.host;return isElementNode(host)?host:null}function isElementNode(value){return Boolean(value&&typeof value==="object"&&"nodeType"in value&&value.nodeType===1&&"namespaceURI"in value)}function isHtmlElementNode(value){return isElementNode(value)&&value.namespaceURI==="http://www.w3.org/1999/xhtml"}function isSequentialFocusTarget(value){return isElementNode(value)&&(value.namespaceURI==="http://www.w3.org/1999/xhtml"||value.namespaceURI==="http://www.w3.org/2000/svg")}function isParentNode(node){return"children"in node}function isSearchableRoot(node){return"querySelectorAll"in node}function*composedFocusScopes(anchor){let referenceNode=anchor;let rootNode=anchor.getRootNode();while(isSearchableRoot(rootNode)){yield{root:rootNode,anchor:referenceNode};if(!(rootNode instanceof ShadowRoot))return;referenceNode=rootNode.host;rootNode=referenceNode.getRootNode()}}function isOptionGetter(value){return typeof value==="function"}function readOption(value){return isOptionGetter(value)?value():value}var trapStack=[];var FOCUSABLE_SELECTOR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","summary",'[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'].join(", ");function noop(){}function isHiddenByTree(element){if(element.hidden)return true;if(element.matches('[inert], [aria-hidden="true"]'))return true;const ancestor=element.closest('[hidden], [inert], [aria-hidden="true"]');return ancestor!==null&&ancestor!==element}function isFocusableCandidate(element){if(isHiddenByTree(element))return false;if(element.hasAttribute("disabled"))return false;if(element.hasAttribute("tabindex")&&element.tabIndex<0)return false;return true}var NATIVELY_FOCUSABLE_TAGS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","SUMMARY"]);function isProgrammaticallyFocusable(element){if(isHiddenByTree(element))return false;if(element.hasAttribute("disabled"))return false;if(element.hasAttribute("tabindex"))return true;if(NATIVELY_FOCUSABLE_TAGS.has(element.tagName))return true;if(element.tagName==="A"&&element.hasAttribute("href"))return true;const contentEditable=element.getAttribute("contenteditable");if(contentEditable!==null&&contentEditable!=="false")return true;return false}function getTabbableElements(root){return Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR)).filter((element)=>root.contains(element)&&isFocusableCandidate(element))}function resolveScopedTarget(root,target){const resolved=readOption(target??null);if(!resolved)return null;if(typeof resolved==="string"){let match=null;try{match=root.querySelector(resolved)}catch{return null}return match&&root.contains(match)?match:null}return resolved instanceof HTMLElement&&root.contains(resolved)?resolved:null}function getFallbackTarget(root,fallbackFocus){const resolved=resolveScopedTarget(root,fallbackFocus);return resolved&&isProgrammaticallyFocusable(resolved)?resolved:null}function getRestoreFallbackTarget(restoreFallback){const resolved=readOption(restoreFallback);if(!resolved)return null;if(typeof resolved==="string"){if(typeof document==="undefined")return null;let match;try{match=document.querySelector(resolved)}catch{return null}return match&&isProgrammaticallyFocusable(match)?match:null}return resolved instanceof HTMLElement&&isProgrammaticallyFocusable(resolved)?resolved:null}function tryFocus(element){element.focus();return document.activeElement===element}function ensureRootFocusable(root){if(root.hasAttribute("tabindex")){return()=>{}}root.setAttribute("tabindex","-1");return()=>{root.removeAttribute("tabindex")}}function pushTrap(instance){const existingIndex=trapStack.findIndex((entry)=>entry.id===instance.id);if(existingIndex!==-1){trapStack.splice(existingIndex,1)}trapStack.push(instance)}function removeTrap(id){const index=trapStack.findIndex((entry)=>entry.id===id);if(index!==-1){trapStack.splice(index,1)}}function isTopTrap(id){return trapStack.at(-1)?.id===id}function createFocusTrap(options={}){const trapId=Symbol("focus-trap");return(node)=>{const isActive=()=>readOption(options.active??true);const restoreFocus=options.restoreFocus??true;const initialFocus=options.initialFocus??null;const fallbackFocus=options.fallbackFocus??null;const restoreFallback=options.restoreFallback??null;const preferRestoreFallback=options.preferRestoreFallback??false;const manageInitialFocus=options.manageInitialFocus??true;let activated=false;let activationGeneration=0;let capturedFocus=null;let restoreRootFocusability=noop;function focusTrapTarget(){const preferred=resolveScopedTarget(node,initialFocus);if(preferred&&isProgrammaticallyFocusable(preferred)&&tryFocus(preferred)){return}const tabbable=getTabbableElements(node);if(tabbable.length>0&&tabbable[0]&&tryFocus(tabbable[0])){return}const fallbackTarget=getFallbackTarget(node,fallbackFocus);if(fallbackTarget&&tryFocus(fallbackTarget)){return}restoreRootFocusability=ensureRootFocusable(node);node.focus()}function activate(){if(activated)return;activated=true;const generation=++activationGeneration;capturedFocus=document.activeElement instanceof HTMLElement&&document.activeElement!==document.body?document.activeElement:null;pushTrap({id:trapId,node});if(!manageInitialFocus)return;queueMicrotask(()=>{if(!activated||generation!==activationGeneration||!isActive())return;focusTrapTarget()})}function deactivate(){if(!activated)return;activated=false;restoreRootFocusability();restoreRootFocusability=noop;removeTrap(trapId);if(restoreFocus){const candidates=readOption(preferRestoreFallback??false)?[getRestoreFallbackTarget(restoreFallback),capturedFocus]:[capturedFocus,getRestoreFallbackTarget(restoreFallback)];for(const candidate of candidates){if(restoreFocusTo(candidate)&&document.activeElement===candidate)break}}capturedFocus=null}function handleKeydown(event){if(!isActive()||!isTopTrap(trapId)||event.key!=="Tab")return;const tabbable=getTabbableElements(node);if(tabbable.length===0){const fallbackTarget=getFallbackTarget(node,fallbackFocus);event.preventDefault();if(!fallbackTarget||!tryFocus(fallbackTarget)){restoreRootFocusability=ensureRootFocusable(node);node.focus()}return}const first=tabbable[0];const last=tabbable[tabbable.length-1];const activeElement=document.activeElement;if(event.shiftKey&&activeElement===first){event.preventDefault();last?.focus()}else if(!event.shiftKey&&activeElement===last){event.preventDefault();first?.focus()}}node.addEventListener("keydown",handleKeydown);$.user_effect(()=>{if(!isActive())return;activate();return()=>{deactivate()}});return()=>{node.removeEventListener("keydown",handleKeydown);deactivate()}}}var rest_excludes=new Set(["$$slots","$$events","$$legacy","active","restoreFocus","initialFocus","fallbackFocus","restoreFallback","preferRestoreFallback","class","children"]);var root=$2.from_html(`<div><!></div>`);function Focus_trap($$anchor,$$props){$2.push($$props,true);let active=$2.prop($$props,"active",3,true),restoreFocus=$2.prop($$props,"restoreFocus",3,true),initialFocus=$2.prop($$props,"initialFocus",3,null),fallbackFocus=$2.prop($$props,"fallbackFocus",3,null),restoreFallback=$2.prop($$props,"restoreFallback",3,null),preferRestoreFallback=$2.prop($$props,"preferRestoreFallback",3,false),rest=$2.rest_props($$props,rest_excludes);var div=root();$2.attribute_effect(div,($0)=>({class:$0,...rest}),[()=>classNames($$props.class)]);var node=$2.child(div);$2.snippet(node,()=>$$props.children);$2.reset(div);$2.attach(div,()=>createFocusTrap({active:()=>active(),restoreFocus:restoreFocus(),initialFocus:()=>initialFocus(),fallbackFocus:()=>fallbackFocus(),restoreFallback:()=>restoreFallback(),preferRestoreFallback:()=>preferRestoreFallback()}));$2.append($$anchor,div);$2.pop()}import{flushSync}from"svelte";var escapeStack=[];function pushEscapeHandler(handler){escapeStack.push(handler);if(escapeStack.length===1&&typeof window!=="undefined"){window.addEventListener("keydown",onEscapeKeydown,{capture:true})}let released=false;return()=>{if(released)return;released=true;const index=escapeStack.lastIndexOf(handler);if(index!==-1)escapeStack.splice(index,1);if(escapeStack.length===0&&typeof window!=="undefined"){window.removeEventListener("keydown",onEscapeKeydown,{capture:true})}}}function onEscapeKeydown(event){if(event.key!=="Escape")return;const handler=escapeStack.at(-1);if(!handler)return;flushSync(()=>{handler(event)})}var scrollLockCount=0;var originalBodyOverflow=null;function lockBodyScroll(){if(typeof document==="undefined")return()=>{};if(scrollLockCount===0){originalBodyOverflow=document.body.style.overflow;document.body.style.overflow="hidden"}scrollLockCount+=1;let released=false;return()=>{if(released)return;released=true;scrollLockCount=Math.max(0,scrollLockCount-1);if(scrollLockCount===0){document.body.style.overflow=originalBodyOverflow??"";originalBodyOverflow=null}}}function captureFocus(){if(typeof document==="undefined")return null;const active=document.activeElement;if(active&&active!==document.body&&active instanceof HTMLElement){return active}return null}function createBodyScrollLock(){return()=>{const release=lockBodyScroll();return release}}function isInsideEventPath(event,element){const path=event.composedPath();return path.some((entry)=>entry instanceof Node&&element.contains(entry))}function createClickOutside(options){const{handler,enabled=true,eventType="click",capture=true,ignoreRefs}=options;return(node)=>{function handleEvent(event){const isEnabled=typeof enabled==="function"?enabled():enabled;if(!isEnabled)return;if(event.type==="touchstart"&&!event.cancelable)return;const target=event.target;if(!(target instanceof Node)){handler();return}if(isInsideEventPath(event,node))return;if(ignoreRefs){for(const ref of ignoreRefs){const element=ref();if(element&&isInsideEventPath(event,element))return}}handler()}document.addEventListener(eventType,handleEvent,capture);return()=>{document.removeEventListener(eventType,handleEvent,capture)}}}function overflowFade(){return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute("data-cinder-overflows");return}const update=()=>{const overflows=node.scrollHeight-node.clientHeight>1;const atBottom=node.scrollTop+node.clientHeight>=node.scrollHeight-1;node.toggleAttribute("data-cinder-overflows",overflows&&!atBottom)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});node.addEventListener("scroll",scheduleUpdate,{passive:true});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect();node.removeEventListener("scroll",scheduleUpdate)}}}var OVERFLOW_SHADOW_ATTRIBUTE={inline:"data-cinder-overflows-inline",block:"data-cinder-overflows-block"};function overflowShadow(axis){const attributeName=OVERFLOW_SHADOW_ATTRIBUTE[axis];return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute(attributeName);return}const update=()=>{const overflows=axis==="inline"?node.scrollWidth-node.clientWidth>1:node.scrollHeight-node.clientHeight>1;node.toggleAttribute(attributeName,overflows)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect()}}}var OVERFLOW_FADE_START_ATTRIBUTE={block:"data-cinder-overflows-start",inline:"data-cinder-overflows-inline-start"};var OVERFLOW_FADE_END_ATTRIBUTE={block:"data-cinder-overflows",inline:"data-cinder-overflows-inline-end"};function overflowFadeEdges(axis){const startAttribute=OVERFLOW_FADE_START_ATTRIBUTE[axis];const endAttribute=OVERFLOW_FADE_END_ATTRIBUTE[axis];return(node)=>{if(typeof ResizeObserver==="undefined"){node.removeAttribute(startAttribute);node.removeAttribute(endAttribute);return}const update=()=>{const scrollPosition=axis==="block"?node.scrollTop:node.scrollLeft;const contentExtent=axis==="block"?node.scrollHeight:node.scrollWidth;const viewportExtent=axis==="block"?node.clientHeight:node.clientWidth;const overflows=contentExtent-viewportExtent>1;const atStart=scrollPosition<=1;const atEnd=scrollPosition+viewportExtent>=contentExtent-1;node.toggleAttribute(startAttribute,overflows&&!atStart);node.toggleAttribute(endAttribute,overflows&&!atEnd)};const requestFrame=typeof requestAnimationFrame==="function"?requestAnimationFrame:(callback)=>window.setTimeout(()=>callback(performance.now()));const cancelFrame=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:(handle)=>window.clearTimeout(handle);let frame=0;const scheduleUpdate=()=>{if(frame)return;frame=requestFrame(()=>{frame=0;update()})};const resizeObserver=new ResizeObserver(scheduleUpdate);resizeObserver.observe(node);const mutationObserver=typeof MutationObserver==="undefined"?null:new MutationObserver(scheduleUpdate);mutationObserver?.observe(node,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["hidden","class","style","aria-hidden","src"]});node.addEventListener("scroll",scheduleUpdate,{passive:true});update();return()=>{if(frame)cancelFrame(frame);resizeObserver.disconnect();mutationObserver?.disconnect();node.removeEventListener("scroll",scheduleUpdate)}}}var focus_trap_default=Focus_trap;import"@lostgradient/cinder/alert-dialog/styles";import"svelte/internal/disclose-version";import*as $7 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $3 from"svelte/internal/client";var true_default=true;function devWarn(message,...args){if(!true_default)return;console.warn(message,...args)}var rest_excludes2=new Set(["$$slots","$$events","$$legacy","variant","size","fullWidth","loading","iconOnly","leadingIcon","trailingIcon","children","label","class","href","onclick","aria-disabled","aria-busy","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-haspopup"]);var root2=$3.from_html(`<span class="cinder-button__icon" aria-hidden="true"><!></span>`);var root_1=$3.from_html(`<span class="cinder-sr-only"> </span>`);var root_2=$3.from_html(`<!> <!>`,1);var root_3=$3.from_html(`<!> <!> <!>`,1);var root_4=$3.from_html(`<a><!></a>`);var root_5=$3.from_html(`<button><!></button>`);function Button($$anchor,$$props){$3.push($$props,true);const buttonContent=($$anchor2)=>{var fragment=root_3();var node=$3.first_child(fragment);{var consequent=($$anchor3)=>{var span=root2();var node_1=$3.child(span);$3.snippet(node_1,()=>$$props.leadingIcon);$3.reset(span);$3.append($$anchor3,span)};$3.if(node,($$render)=>{if($$props.leadingIcon)$$render(consequent)})}var node_2=$3.sibling(node,2);{var consequent_3=($$anchor3)=>{var fragment_1=root_2();var node_3=$3.first_child(fragment_1);{var consequent_1=($$anchor4)=>{var span_1=root_1();var text2=$3.child(span_1,true);$3.reset(span_1);$3.template_effect(()=>$3.set_text(text2,$$props.label));$3.append($$anchor4,span_1)};$3.if(node_3,($$render)=>{if(!$3.get(resolvedAriaLabel)&&!$3.get(resolvedAriaLabelledBy)&&$$props.label)$$render(consequent_1)})}var node_4=$3.sibling(node_3,2);{var consequent_2=($$anchor4)=>{var span_2=root2();var node_5=$3.child(span_2);$3.snippet(node_5,()=>$$props.children);$3.reset(span_2);$3.append($$anchor4,span_2)};$3.if(node_4,($$render)=>{if($$props.children)$$render(consequent_2)})}$3.append($$anchor3,fragment_1)};var consequent_4=($$anchor3)=>{var fragment_2=$3.comment();var node_6=$3.first_child(fragment_2);$3.snippet(node_6,()=>$$props.children);$3.append($$anchor3,fragment_2)};var alternate=($$anchor3)=>{var text_1=$3.text();$3.template_effect(()=>$3.set_text(text_1,$$props.label));$3.append($$anchor3,text_1)};$3.if(node_2,($$render)=>{if(iconOnly())$$render(consequent_3);else if($$props.children)$$render(consequent_4,1);else $$render(alternate,-1)})}var node_7=$3.sibling(node_2,2);{var consequent_5=($$anchor3)=>{var span_3=root2();var node_8=$3.child(span_3);$3.snippet(node_8,()=>$$props.trailingIcon);$3.reset(span_3);$3.append($$anchor3,span_3)};$3.if(node_7,($$render)=>{if($$props.trailingIcon)$$render(consequent_5)})}$3.append($$anchor2,fragment)};const variant=$3.prop($$props,"variant",3,"secondary"),size=$3.prop($$props,"size",3,"md"),fullWidth=$3.prop($$props,"fullWidth",3,false),loading=$3.prop($$props,"loading",3,false),iconOnly=$3.prop($$props,"iconOnly",3,false),rest=$3.rest_props($$props,rest_excludes2);const mergedClassName=$3.derived(()=>classNames("cinder-button",$$props.class));const dataAttributes=$3.derived(()=>({"data-cinder-variant":variant(),"data-cinder-size":size(),"data-cinder-full-width":fullWidth()?"":undefined,"data-cinder-loading":loading()?"":undefined,"data-cinder-icon-only":iconOnly()?"":undefined}));const resolvedAriaDisabled=$3.derived(()=>loading()?"true":$$props["aria-disabled"]);const resolvedAriaBusy=$3.derived(()=>loading()?"true":$$props["aria-busy"]);const resolvedAriaLabel=$3.derived(()=>typeof $$props["aria-label"]==="string"&&$$props["aria-label"].trim().length>0?$$props["aria-label"]:undefined);const resolvedAriaLabelledBy=$3.derived(()=>typeof $$props["aria-labelledby"]==="string"&&$$props["aria-labelledby"].trim().length>0?$$props["aria-labelledby"]:undefined);const anchorAttributes=$3.derived(()=>rest);const buttonAttributes=$3.derived(()=>rest);const anchorTabIndex=$3.derived(()=>$$props.tabindex);const buttonType=$3.derived(()=>$$props.type);const buttonDisabled=$3.derived(()=>$$props.disabled??false);function handleClick(event){if(loading()){event.preventDefault();return}if(typeof $$props.onclick==="function"){$$props.onclick(event)}}$3.user_effect(()=>{const hasLabel=typeof $$props.label==="string"&&$$props.label.trim().length>0;const hasChildren=Boolean($$props.children);const hasAriaLabel=$3.get(resolvedAriaLabel)!==undefined;const hasAriaLabelledBy=$3.get(resolvedAriaLabelledBy)!==undefined;if(!hasLabel&&!hasChildren&&!hasAriaLabel&&!hasAriaLabelledBy){devWarn("[cinder/Button] rendered without an accessible name — pass a non-empty `label`, `children`, `aria-label`, or `aria-labelledby`.")}if(iconOnly()&&!hasAriaLabel&&!hasAriaLabelledBy&&!hasLabel){devWarn("[cinder/Button] iconOnly=true requires aria-label, aria-labelledby, or a non-empty label.")}if(iconOnly()&&!$$props.leadingIcon&&!$$props.trailingIcon&&!$$props.children){devWarn("[cinder/Button] iconOnly=true requires a visible icon — pass leadingIcon, trailingIcon, or children.")}});var fragment_4=$3.comment();var node_9=$3.first_child(fragment_4);{var consequent_6=($$anchor2)=>{var a=root_4();$3.attribute_effect(a,()=>({...$3.get(anchorAttributes),href:loading()?undefined:$$props.href,tabindex:loading()?-1:$3.get(anchorTabIndex),class:$3.get(mergedClassName),...$3.get(dataAttributes),"aria-disabled":$3.get(resolvedAriaDisabled),"aria-busy":$3.get(resolvedAriaBusy),"aria-label":$3.get(resolvedAriaLabel),"aria-labelledby":$3.get(resolvedAriaLabelledBy),"aria-expanded":$$props["aria-expanded"],"aria-controls":$$props["aria-controls"],"aria-haspopup":$$props["aria-haspopup"],onclick:handleClick}));var node_10=$3.child(a);buttonContent(node_10);$3.reset(a);$3.append($$anchor2,a)};var alternate_1=($$anchor2)=>{var button=root_5();$3.attribute_effect(button,()=>({...$3.get(buttonAttributes),type:$3.get(buttonType)??"button",class:$3.get(mergedClassName),...$3.get(dataAttributes),disabled:$3.get(buttonDisabled)||loading(),"aria-disabled":$3.get(resolvedAriaDisabled),"aria-busy":$3.get(resolvedAriaBusy),"aria-label":$3.get(resolvedAriaLabel),"aria-labelledby":$3.get(resolvedAriaLabelledBy),"aria-expanded":$$props["aria-expanded"],"aria-controls":$$props["aria-controls"],"aria-haspopup":$$props["aria-haspopup"],onclick:handleClick}));var node_11=$3.child(button);buttonContent(node_11);$3.reset(button);$3.append($$anchor2,button)};$3.if(node_9,($$render)=>{if($$props.href!==undefined)$$render(consequent_6);else $$render(alternate_1,-1)})}$3.append($$anchor,fragment_4);$3.pop()}import"svelte/internal/disclose-version";import*as $6 from"svelte/internal/client";import{onDestroy}from"svelte";import{createContext}from"svelte";function optionalContext(getStrict){return()=>{try{return getStrict()}catch{return}}}var[getHostContextStrict,setHostContextRaw]=createContext();function setHostContext(value){setHostContextRaw(value)}function getHostContext(){return optionalContext(getHostContextStrict)()??{platform:"web",isDesktop:false}}import*as $4 from"svelte/internal/client";import{MediaQuery,SvelteMap}from"svelte/reactivity";function readRootPreference(root3){if(!root3)return"system";const preference=root3.dataset["reducedMotion"];return preference==="on"||preference==="off"||preference==="system"?preference:"system"}function synchronizeRootPreference(root3){const preference=readRootPreference(root3);if(!root3)return preference;if(preference==="system")delete root3.dataset["cinderReducedMotion"];else root3.dataset["cinderReducedMotion"]=String(preference==="on");return preference}var applicationRoot=typeof document==="undefined"?undefined:document.documentElement;var applicationPreferences=new SvelteMap([["current","system"]]);var ApplicationMutationObserver=applicationRoot?.ownerDocument.defaultView?.MutationObserver??globalThis.MutationObserver;if(applicationRoot&&ApplicationMutationObserver){new ApplicationMutationObserver(()=>{applicationPreferences.set("current",synchronizeRootPreference(applicationRoot))}).observe(applicationRoot,{attributes:true,attributeFilter:["data-reduced-motion"]});queueMicrotask(()=>{applicationPreferences.set("current",synchronizeRootPreference(applicationRoot))})}function getApplicationPreference(){return applicationPreferences.get("current")??"system"}function resolveReducedMotion(preference,systemPrefersReducedMotion){return preference==="on"||preference==="system"&&systemPrefersReducedMotion}function applyReducedMotionPreference(element,preference){if(element!==element.ownerDocument.documentElement){throw new Error("applyReducedMotionPreference must target document.documentElement")}applicationPreferences.set("current",preference);element.dataset["reducedMotion"]=preference;if(preference==="system"){delete element.dataset["cinderReducedMotion"];return}element.dataset["cinderReducedMotion"]=String(preference==="on")}function useReducedMotion(preference){if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return{current:resolveReducedMotion(preference??getApplicationPreference(),false)}}const query=new MediaQuery("(prefers-reduced-motion: reduce)",false);return{get current(){return resolveReducedMotion(preference??getApplicationPreference(),query.current)}}}import*as $5 from"svelte/internal/client";import{tick}from"svelte";function parseTimeValueList(value){return value.split(",").map((part)=>part.trim()).map((part)=>{if(part.endsWith("ms"))return Number.parseFloat(part);if(part.endsWith("s"))return Number.parseFloat(part)*1000;return 0}).filter((part)=>Number.isFinite(part))}function getRepeatedValue(values,index,fallback){if(values.length===0)return fallback;return values[index%values.length]??fallback}function getLongestTransitionTime(element){const style=window.getComputedStyle(element);const properties=style.transitionProperty.split(",").map((part)=>part.trim()).filter(Boolean);const durations=parseTimeValueList(style.transitionDuration);const delays=parseTimeValueList(style.transitionDelay);const count=properties.length;let longest=0;for(let index=0;index<count;index+=1){const property=getRepeatedValue(properties,index,"all");if(property==="none")continue;const duration=getRepeatedValue(durations,index,0);const delay=getRepeatedValue(delays,index,0);longest=Math.max(longest,duration+delay)}return longest}function getTrackedTransitionProperties(element){const style=window.getComputedStyle(element);const properties=style.transitionProperty.split(",").map((part)=>part.trim()).filter(Boolean);const durations=parseTimeValueList(style.transitionDuration);const delays=parseTimeValueList(style.transitionDelay);const count=Math.max(properties.length,durations.length,delays.length);const trackedProperties=new Set;for(let index=0;index<count;index+=1){const property=getRepeatedValue(properties,index,"all");const duration=getRepeatedValue(durations,index,0);const delay=getRepeatedValue(delays,index,0);if(duration+delay<=0)continue;if(property==="none")continue;if(property==="all")return null;trackedProperties.add(property)}return trackedProperties}function waitForTransitionCompletion({element,reducedMotion,onComplete,ignoreCancel=false,ignoreUnknownPropertyEvents=false}){let completed=false;let fallbackTimer;let cancelListenerFrame;const finish=()=>{if(completed)return;completed=true;element.removeEventListener("transitionend",handleTransitionEnd);if(!ignoreCancel)element.removeEventListener("transitioncancel",handleTransitionCancel);if(fallbackTimer){clearTimeout(fallbackTimer);fallbackTimer=undefined}if(cancelListenerFrame!==undefined){cancelAnimationFrame(cancelListenerFrame);cancelListenerFrame=undefined}onComplete()};const handleTransitionEnd=(event)=>{if(event.target instanceof Element&&event.target!==element)return;if(!pendingProperties){if(ignoreUnknownPropertyEvents)return;finish();return}pendingProperties.delete(event.propertyName);if(pendingProperties.size===0){finish()}};const handleTransitionCancel=(event)=>{if(event.target instanceof Element&&event.target!==element)return;finish()};const totalTransitionTime=reducedMotion?0:getLongestTransitionTime(element);const pendingProperties=reducedMotion?new Set:getTrackedTransitionProperties(element);if(totalTransitionTime<=0||pendingProperties?.size===0){queueMicrotask(finish);return finish}element.addEventListener("transitionend",handleTransitionEnd);if(!ignoreCancel){if(typeof requestAnimationFrame==="function"){cancelListenerFrame=requestAnimationFrame(()=>{cancelListenerFrame=requestAnimationFrame(()=>{cancelListenerFrame=undefined;if(completed)return;element.addEventListener("transitioncancel",handleTransitionCancel)})})}else{element.addEventListener("transitioncancel",handleTransitionCancel)}}fallbackTimer=setTimeout(finish,totalTransitionTime+50);return finish}function reportUnhandledExitCompleteError(error){if(typeof globalThis.reportError==="function"){globalThis.reportError(error);return}setTimeout(()=>{throw error},0)}class SlidingDialogState{#hydrated=$5.state(false);get hydrated(){return $5.get(this.#hydrated)}set hydrated(value){$5.set(this.#hydrated,value,true)}#renderPanel=$5.state(false);get renderPanel(){return $5.get(this.#renderPanel)}set renderPanel(value){$5.set(this.#renderPanel,value,true)}#isClosing=$5.state(false);get isClosing(){return $5.get(this.#isClosing)}set isClosing(value){$5.set(this.#isClosing,value,true)}#options;#closeGeneration=$5.state(0);#capturedFocus=null;#releaseScrollLock=null;#releaseEscape=null;#cancelPendingClose=null;#suppressedNativeCloseEvents=0;#disposed=false;#lastCompletedGeneration=null;#pendingNativeCloseGenerations=[];constructor(options){this.#options=options;this.renderPanel=options.getOpen()}markHydrated(){this.hydrated=true}syncOpenState(){const dialogElement=this.#options.getDialogElement();if(!dialogElement)return;if(this.#options.getOpen()){const wasClosingOrClosed=this.isClosing||!dialogElement.open;if(wasClosingOrClosed){$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1)}if(this.isClosing){this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.isClosing=false;this.#options.onOpen?.()}if(!this.renderPanel){this.renderPanel=true}if(!dialogElement.open){this.#capturedFocus=captureFocus();dialogElement.showModal();this.#acquireScrollLock();this.#acquireEscapeMarker();this.#options.onOpen?.()}return}if(dialogElement.open){this.beginClosing()}else{this.renderPanel=false}}beginClosing(){const dialogElement=this.#options.getDialogElement();if(!dialogElement?.open||this.isClosing)return;const panelElement=this.#options.getPanelElement();if(!panelElement){this.#finishClosing($5.get(this.#closeGeneration));return}this.isClosing=true;const generation=$5.update_pre(this.#closeGeneration);this.#cancelPendingClose?.();this.#cancelPendingClose=waitForTransitionCompletion({element:panelElement,reducedMotion:this.#options.getReducedMotion(),onComplete:()=>this.#finishClosing(generation)})}handleClose(){if(this.#suppressedNativeCloseEvents>0){this.#suppressedNativeCloseEvents-=1;return}const expectedGeneration=this.#pendingNativeCloseGenerations.shift();if(expectedGeneration!==undefined){if(expectedGeneration!==$5.get(this.#closeGeneration)){return}}else{const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){return}}if(expectedGeneration===undefined){if(this.isClosing){$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1);this.#cancelPendingClose?.();this.#cancelPendingClose=null}}this.#completeCloseOnce(expectedGeneration??$5.get(this.#closeGeneration))}requestClose(){if(!this.#options.getOpen()&&(this.isClosing||!this.#options.getDialogElement()?.open)){return}this.#options.setOpen(false);this.beginClosing()}handleBackdropClick(event){if(event.target===this.#options.getDialogElement()){this.requestClose()}}handleNativeCancel(event){event.preventDefault();this.requestClose()}destroy(){this.#disposed=true;this.#cancelPendingClose?.();this.#cancelPendingClose=null;const wasOpen=this.#releaseScrollLock!==null||this.#releaseEscape!==null;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;if(wasOpen){this.#returnFocus()}}releaseModalState(options={}){this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.#pendingNativeCloseGenerations=[];$5.set(this.#closeGeneration,$5.get(this.#closeGeneration)+1);this.isClosing=false;this.renderPanel=false;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){this.#suppressedNativeCloseEvents+=1;dialogElement.close()}if(options.restoreFocus)this.#returnFocus();else this.#capturedFocus=null}#finishClosing(generation){if(generation!==$5.get(this.#closeGeneration))return;this.#cancelPendingClose?.();this.#cancelPendingClose=null;this.isClosing=false;if(this.#options.getOpen()){this.renderPanel=true;return}this.renderPanel=false;const dialogElement=this.#options.getDialogElement();if(dialogElement?.open){this.#pendingNativeCloseGenerations.push(generation);dialogElement.close();return}if(dialogElement)return;this.#completeCloseOnce(generation)}#completeCloseOnce(generation){if(this.#lastCompletedGeneration===generation)return;this.#lastCompletedGeneration=generation;this.#releaseScrollLock?.();this.#releaseScrollLock=null;this.#releaseEscape?.();this.#releaseEscape=null;this.#options.setOpen(false);this.#returnFocus();this.isClosing=false;this.renderPanel=false;const closedGeneration=generation;tick().then(()=>{if(this.#disposed||closedGeneration!==$5.get(this.#closeGeneration)||this.#options.getOpen()||this.renderPanel){return}try{this.#options.onClosed?.()}catch(error){reportUnhandledExitCompleteError(error)}})}#acquireScrollLock(){if(this.#releaseScrollLock)return;this.#releaseScrollLock=lockBodyScroll()}#acquireEscapeMarker(){if(this.#releaseEscape)return;this.#releaseEscape=pushEscapeHandler(()=>{})}#returnFocus(){const candidates=[this.#options.getTriggerRef(),this.#capturedFocus];this.#capturedFocus=null;for(const candidate of candidates){if(restoreFocusTo(candidate))break}}}function createSlidingDialogState(options){return new SlidingDialogState(options)}function focusDialogBodyUnlessAutofocused(options){const applyInitialFocusPolicy=()=>{const dialogElement=options.getDialogElement();if(!options.getOpen()||!dialogElement?.open)return;const rootNode=dialogElement.getRootNode();const activeElementInRoot=()=>rootNode instanceof Document||rootNode instanceof ShadowRoot?rootNode.activeElement:document.activeElement;const autofocusTarget=dialogElement.querySelector("[autofocus]")??Array.from(dialogElement.querySelectorAll("*")).find((element)=>element.autofocus)??null;if(autofocusTarget){const active=activeElementInRoot();const focusInsideDialog=active instanceof HTMLElement&&dialogElement.contains(active);if(!focusInsideDialog){autofocusTarget.focus();if(activeElementInRoot()===autofocusTarget)return}else{return}}options.getBodyElement()?.focus()};tick().then(applyInitialFocusPolicy)}var root3=$6.from_html(`<div class="cinder-modal__drag-strip" aria-hidden="true"></div>`);var root_12=$6.from_html(`<div class="cinder-modal__header"><h2 class="cinder-modal__title"> </h2></div>`);var root_22=$6.from_html(`<div class="cinder-modal__footer"><!></div>`);var root_32=$6.from_html(`<button type="button" class="cinder-modal__close" aria-label="Close dialog"><svg class="cinder-modal__close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg></button>`);var root_42=$6.from_html(`<div class="cinder-modal__panel"><!> <!> <div class="cinder-modal__body cinder-_scroll-fade" tabindex="-1"><!></div> <!> <!></div>`);var root_52=$6.from_html(`<dialog><!></dialog>`);function Modal($$anchor,$$props){const titleId=$6.props_id();$6.push($$props,true);function isNonEmptyString(value){return typeof value==="string"&&value.trim()!==""}let open=$6.prop($$props,"open",15,false),chrome=$6.prop($$props,"chrome",3,"default"),role=$6.prop($$props,"role",3,"dialog"),dismissOnBackdropClick=$6.prop($$props,"dismissOnBackdropClick",3,true),dismissOnEscape=$6.prop($$props,"dismissOnEscape",3,true),closeButtonVisible=$6.prop($$props,"closeButtonVisible",3,true),triggerRef=$6.prop($$props,"triggerRef",3,null);const host=getHostContext();const isChromeless=$6.derived(()=>chrome()==="none");let dialogElement=$6.state(undefined);let panelElement=$6.state(undefined);let bodyElement=$6.state(undefined);let mounted=$6.state(false);const reducedMotion=useReducedMotion();const bodyOverflowFade=overflowFade();const dialogState=createSlidingDialogState({getOpen:()=>open(),setOpen:(nextOpen)=>{open(nextOpen)},getDialogElement:()=>$6.get(dialogElement),getPanelElement:()=>$6.get(panelElement),getReducedMotion:()=>reducedMotion.current,getTriggerRef:()=>triggerRef(),onOpen:()=>focusDialogBodyUnlessAutofocused({getOpen:()=>open(),getDialogElement:()=>$6.get(dialogElement),getBodyElement:()=>$6.get(bodyElement)}),onClosed:()=>$$props.onExitComplete?.()});$6.user_effect(()=>{$6.set(mounted,true)});$6.user_effect(()=>{if(role()==="alertdialog"&&(dismissOnBackdropClick()!==false||dismissOnEscape()!==false||closeButtonVisible()!==false)){devWarn('[cinder/Modal] role="alertdialog" requires dismissOnBackdropClick={false}, dismissOnEscape={false}, and closeButtonVisible={false}. '+"Without these, Escape or backdrop click can bypass the mandatory acknowledgement. "+"Use <AlertDialog> instead, or pass all three companion props explicitly.")}});$6.user_effect(()=>{if(!$6.get(isChromeless)&&!isNonEmptyString($$props.title)){devWarn('[cinder/Modal] rendered with chrome="default" but no non-empty `title`. '+"The visible heading also supplies the accessible name — without it the dialog has no name for assistive technology.")}if($6.get(isChromeless)&&!isNonEmptyString($$props["aria-label"])){devWarn('[cinder/Modal] rendered with chrome="none" but no non-empty `aria-label`. '+"The chromeless chrome renders no header, so `aria-label` is the only source of the dialog's accessible name — without it the dialog has no name for assistive technology.")}});$6.user_effect(()=>{dialogState.syncOpenState()});function dismiss(){dialogState.requestClose();$$props.onDismiss?.()}onDestroy(()=>{dialogState.destroy();$6.get(dialogElement)?.remove()});function handleBackdropClick(event){if(!dismissOnBackdropClick())return;if(event.target===$6.get(dialogElement)){dismiss();return}if(!$6.get(isChromeless))return;if(event.target===$6.get(panelElement)||event.target===$6.get(bodyElement)){dismiss();return}const targetElement=event.target;if(targetElement instanceof Element&&targetElement.hasAttribute("data-cinder-modal-backdrop")){dismiss()}}function handleNativeCancel(event){event.preventDefault();if(!dismissOnEscape())return;dismiss()}var fragment=$6.comment();var node=$6.first_child(fragment);{var consequent_5=($$anchor2)=>{var dialog=root_52();var event_handler=()=>dialogState.handleClose();$6.attribute_effect(dialog,($0,$1)=>({class:$0,role:role(),"aria-modal":"true","data-cinder-chrome":$6.get(isChromeless)?"none":undefined,...$6.get(isChromeless)?{"aria-label":$$props["aria-label"]}:{"aria-labelledby":titleId},...$1,"data-cinder-closing":dialogState.isClosing?"":undefined,onclose:event_handler,onclick:handleBackdropClick,oncancel:handleNativeCancel}),[()=>classNames("cinder-modal",$$props.class),()=>isNonEmptyString($$props.describedById)?{"aria-describedby":$$props.describedById}:{}]);var node_1=$6.child(dialog);{var consequent_4=($$anchor3)=>{var div=root_42();var node_2=$6.child(div);{var consequent=($$anchor4)=>{var div_1=root3();$6.append($$anchor4,div_1)};$6.if(node_2,($$render)=>{if(host.isDesktop&&!$6.get(isChromeless))$$render(consequent)})}var node_3=$6.sibling(node_2,2);{var consequent_1=($$anchor4)=>{var div_2=root_12();var h2=$6.child(div_2);var text2=$6.child(h2,true);$6.reset(h2);$6.reset(div_2);$6.template_effect(()=>{$6.set_attribute(h2,"id",titleId);$6.set_text(text2,$$props.title)});$6.append($$anchor4,div_2)};$6.if(node_3,($$render)=>{if(!$6.get(isChromeless))$$render(consequent_1)})}var div_3=$6.sibling(node_3,2);var node_4=$6.child(div_3);$6.snippet(node_4,()=>$$props.children);$6.reset(div_3);$6.bind_this(div_3,($$value)=>$6.set(bodyElement,$$value),()=>$6.get(bodyElement));$6.attach(div_3,()=>bodyOverflowFade);var node_5=$6.sibling(div_3,2);{var consequent_2=($$anchor4)=>{var div_4=root_22();var node_6=$6.child(div_4);$6.snippet(node_6,()=>$$props.footer);$6.reset(div_4);$6.template_effect(()=>$6.set_attribute(div_4,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined));$6.append($$anchor4,div_4)};$6.if(node_5,($$render)=>{if($$props.footer)$$render(consequent_2)})}var node_7=$6.sibling(node_5,2);{var consequent_3=($$anchor4)=>{var button=root_32();$6.delegated("click",button,dismiss);$6.append($$anchor4,button)};$6.if(node_7,($$render)=>{if(closeButtonVisible())$$render(consequent_3)})}$6.reset(div);$6.bind_this(div,($$value)=>$6.set(panelElement,$$value),()=>$6.get(panelElement));$6.attach(div,()=>createFocusTrap({active:()=>open()&&!dialogState.isClosing,restoreFocus:false,manageInitialFocus:false}));$6.template_effect(()=>{$6.set_attribute(div,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined);$6.set_attribute(div,"data-cinder-closing",dialogState.isClosing?"":undefined);div.inert=dialogState.isClosing;$6.set_attribute(div_3,"data-cinder-chrome",$6.get(isChromeless)?"none":undefined)});$6.append($$anchor3,div)};$6.if(node_1,($$render)=>{if(dialogState.renderPanel)$$render(consequent_4)})}$6.reset(dialog);$6.bind_this(dialog,($$value)=>$6.set(dialogElement,$$value),()=>$6.get(dialogElement));$6.append($$anchor2,dialog)};$6.if(node,($$render)=>{if($6.get(mounted))$$render(consequent_5)})}$6.append($$anchor,fragment);$6.pop()}$6.delegate(["click"]);var root4=$7.from_html(`<!> <!>`,1);var root_13=$7.from_html(`<p class="cinder-alert-dialog__description"> </p>`);function Alert_dialog($$anchor,$$props){const descriptionId=$7.props_id();$7.push($$props,true);let open=$7.prop($$props,"open",15,false),acknowledgeLabel=$7.prop($$props,"acknowledgeLabel",3,"OK"),destructive=$7.prop($$props,"destructive",3,false),triggerRef=$7.prop($$props,"triggerRef",3,null);function handleAcknowledge(){open(false);$$props.onAcknowledge()}function handleCancel(){open(false);$$props.onCancel?.()}const acknowledgeAutofocus=$7.derived(()=>!(destructive()&&$$props.cancelLabel));const cancelAutofocus=$7.derived(()=>Boolean(destructive()&&$$props.cancelLabel));{const footer=($$anchor2)=>{var fragment_1=root4();var node=$7.first_child(fragment_1);{var consequent=($$anchor3)=>{Button($$anchor3,{variant:"secondary",get autofocus(){return $7.get(cancelAutofocus)},onclick:handleCancel,children:($$anchor4,$$slotProps)=>{$7.next();var text3=$7.text();$7.template_effect(()=>$7.set_text(text3,$$props.cancelLabel));$7.append($$anchor4,text3)},$$slots:{default:true}})};$7.if(node,($$render)=>{if($$props.cancelLabel)$$render(consequent)})}var node_1=$7.sibling(node,2);{let $02=$7.derived(()=>destructive()?"danger":"primary");Button(node_1,{get variant(){return $7.get($02)},get autofocus(){return $7.get(acknowledgeAutofocus)},onclick:handleAcknowledge,children:($$anchor3,$$slotProps)=>{$7.next();var text_1=$7.text();$7.template_effect(()=>$7.set_text(text_1,acknowledgeLabel()));$7.append($$anchor3,text_1)},$$slots:{default:true}})}$7.append($$anchor2,fragment_1)};let $0=$7.derived(()=>classNames("cinder-alert-dialog",$$props.class));Modal($$anchor,{get title(){return $$props.title},get triggerRef(){return triggerRef()},role:"alertdialog",dismissOnBackdropClick:false,dismissOnEscape:false,closeButtonVisible:false,get describedById(){return descriptionId},get class(){return $7.get($0)},get open(){return open()},set open($$value){open($$value)},footer,children:($$anchor2,$$slotProps)=>{var p=root_13();var text_2=$7.child(p,true);$7.reset(p);$7.template_effect(()=>{$7.set_attribute(p,"id",descriptionId);$7.set_text(text_2,$$props.description)});$7.append($$anchor2,p)},$$slots:{footer:true,default:true}})}$7.pop()}var alert_dialog_default=Alert_dialog;export{Alert_dialog as AlertDialog,alert_dialog_default as default};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=EF2A522636B9F1EE64756E2164756E21
|