@lostgradient/cinder 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -0
- package/components.json +13 -6
- package/dist/components/accordion-item/accordion-item.css +0 -10
- package/dist/components/action-row/action-row.css +0 -9
- package/dist/components/alert/alert.css +0 -1
- package/dist/components/alert-dialog/index.js +2 -2
- package/dist/components/approval-card/index.js +2 -2
- package/dist/components/area-chart/index.js +2 -2
- package/dist/components/autocomplete/index.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +0 -2
- package/dist/components/avatar-group/index.js +2 -2
- package/dist/components/backdrop/index.js +2 -2
- package/dist/components/bar-chart/index.js +2 -2
- package/dist/components/button/button.css +4 -4
- package/dist/components/button/button.variables.js +2 -2
- package/dist/components/card/card.css +0 -2
- package/dist/components/carousel/carousel.css +0 -5
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/code-block/code-block.css +0 -5
- 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/data-table.css +0 -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/feed-event/feed-event.css +0 -2
- package/dist/components/file-upload/file-upload.css +0 -5
- 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/kanban-board/kanban-board.css +0 -10
- package/dist/components/key-value-editor/index.css +1 -1
- package/dist/components/line-chart/index.js +2 -2
- package/dist/components/marquee/marquee.css +0 -2
- package/dist/components/matrix-chart/index.js +2 -2
- package/dist/components/menu-bar/index.js +3 -3
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/modal.css +0 -26
- 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/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/radio-group/index.js +2 -2
- 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/selectable-row/selectable-row.css +0 -6
- package/dist/components/selection-popover/index.js +2 -2
- package/dist/components/share-card/index.js +2 -2
- package/dist/components/side-navigation/side-navigation.css +0 -1
- package/dist/components/sidebar/index.js +2 -2
- package/dist/components/speed-dial/index.js +2 -2
- package/dist/components/statistic/statistic.css +0 -8
- package/dist/components/statistic-group/index.js +2 -2
- package/dist/components/statistic-group/statistic-group.css +116 -69
- package/dist/components/status-dot/status-dot.css +0 -3
- package/dist/components/table/index.js +2 -2
- package/dist/components/table-of-contents/table-of-contents.css +0 -4
- 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/toggle/toggle.variables.js +2 -2
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/transfer-list/index.js +2 -2
- package/dist/components/tree/tree.css +0 -3
- 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 -2
- 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/accordion-item/accordion-item.css +0 -10
- package/src/components/action-row/action-row.css +0 -9
- package/src/components/alert/alert.css +0 -1
- package/src/components/avatar-group/avatar-group.css +0 -2
- package/src/components/button/button.css +4 -4
- package/src/components/button/button.variables.json +31 -1
- package/src/components/button/button.variables.ts +31 -1
- package/src/components/card/card.css +0 -2
- package/src/components/carousel/carousel.css +0 -5
- package/src/components/code-block/code-block.css +0 -5
- 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/data-table/data-table.css +0 -2
- package/src/components/dropdown/dropdown.svelte +73 -18
- package/src/components/dropdown-menu/dropdown-menu.svelte +63 -7
- package/src/components/feed-event/feed-event.css +0 -2
- package/src/components/file-upload/file-upload.css +0 -5
- package/src/components/find-bar/find-bar.css +9 -1
- package/src/components/input/input.css +95 -6
- package/src/components/input/input.svelte +44 -81
- package/src/components/kanban-board/kanban-board.css +0 -10
- package/src/components/marquee/marquee.css +0 -2
- package/src/components/menu-bar/menu-bar.svelte +12 -1
- package/src/components/modal/modal.css +0 -26
- package/src/components/multi-select/multi-select.svelte +7 -0
- package/src/components/navigation-bar/navigation-bar.svelte +82 -6
- package/src/components/selectable-row/selectable-row.css +0 -6
- package/src/components/selection-popover/selection-popover.svelte +24 -10
- package/src/components/share-card/share-card.svelte +24 -44
- package/src/components/side-navigation/side-navigation.css +0 -1
- package/src/components/speed-dial/speed-dial.svelte +23 -5
- package/src/components/statistic/statistic.css +0 -8
- package/src/components/statistic-group/statistic-group.css +116 -69
- package/src/components/statistic-group/statistic-group.examples.json +6 -0
- package/src/components/statistic-group/statistic-group.svelte +13 -1
- package/src/components/status-dot/status-dot.css +0 -3
- package/src/components/table-of-contents/table-of-contents.css +0 -4
- package/src/components/time-field/time-field.css +9 -8
- package/src/components/toast-region/toast-region.svelte +9 -0
- package/src/components/toggle/toggle.variables.json +1 -1
- package/src/components/toggle/toggle.variables.ts +4 -1
- package/src/components/tree/tree.css +0 -3
- 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 -2
- 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 +57 -22
- package/src/tokens/cinder.resolver.json +8 -0
- package/src/tokens/index.json +1 -1
- package/src/tokens/registry.generated.json +30 -4
- package/src/tokens/registry.generated.ts +32 -4
- package/src/tokens/resolved/dark-reduced-motion.json +47 -17
- package/src/tokens/resolved/dark.json +47 -17
- package/src/tokens/resolved/light-reduced-motion.json +48 -18
- package/src/tokens/resolved/light.json +48 -18
- package/src/tokens/sets/components.tokens.json +1 -1
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lostgradient/cinder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "A Svelte 5 component library and design system focused on accessibility, theming, and per-component tree-shaking.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -6506,7 +6506,7 @@
|
|
|
6506
6506
|
],
|
|
6507
6507
|
"dependencies": {
|
|
6508
6508
|
"@floating-ui/dom": "1.7.6",
|
|
6509
|
-
"@lostgradient/markdown": "^0.
|
|
6509
|
+
"@lostgradient/markdown": "^0.5.0",
|
|
6510
6510
|
"@shikijs/engine-oniguruma": "^3.21.0",
|
|
6511
6511
|
"@shikijs/types": "^3.21.0",
|
|
6512
6512
|
"@tanstack/virtual-core": "^3.17.1",
|
|
@@ -66,8 +66,13 @@ const context = {
|
|
|
66
66
|
</label>
|
|
67
67
|
{/if}
|
|
68
68
|
|
|
69
|
+
<!-- `data-cinder-full-width` mirrors the frame's own marker onto the wrapper:
|
|
70
|
+
ancestors that detect a full-width control by direct child (access-gate.css's
|
|
71
|
+
`:has(> .cinder-form-field > [data-cinder-full-width])`) keep matching when
|
|
72
|
+
the control sits inside this wrapper instead of directly in the frame. -->
|
|
69
73
|
{#if needsControlWrapper}<div
|
|
70
74
|
class={classNames('cinder-form-field__control', controlClass)}
|
|
75
|
+
data-cinder-full-width={fullWidth ? '' : undefined}
|
|
71
76
|
data-leading={controlLeading ? '' : undefined}
|
|
72
77
|
data-trailing={controlTrailing ? '' : undefined}
|
|
73
78
|
data-native-date={controlNativeDate ? '' : undefined}
|
package/src/_internal/overlay.ts
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
/// <reference lib="dom" />
|
|
19
19
|
|
|
20
|
+
import { flushSync } from 'svelte';
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Z-index layer constants. Mirror the `--cinder-z-*` CSS custom properties.
|
|
22
24
|
* Components should prefer the CSS variables in stylesheets; these JS constants
|
|
@@ -132,7 +134,18 @@ function onEscapeKeydown(event: KeyboardEvent): void {
|
|
|
132
134
|
// the topmost handler's call, so we pass the event through and let it decide
|
|
133
135
|
// (a nested popup that owns Escape calls event.preventDefault(); a plain
|
|
134
136
|
// overlay that's fine letting native dialog ESC also fire does not).
|
|
135
|
-
|
|
137
|
+
//
|
|
138
|
+
// `handler` is invoked via a plain `window.addEventListener` callback, not
|
|
139
|
+
// one of Svelte's own event-delegated listeners, so state writes inside it
|
|
140
|
+
// (e.g. `open = false`) wouldn't otherwise flush to the DOM — or release
|
|
141
|
+
// this handler's own stack entry via its owning `$effect`'s cleanup — until
|
|
142
|
+
// the next microtask. `flushSync` forces that update (and this handler's
|
|
143
|
+
// release, if it closes synchronously) to land within this same keydown
|
|
144
|
+
// dispatch, so a second Escape immediately after reaches the next handler
|
|
145
|
+
// down the stack rather than the one that just closed.
|
|
146
|
+
flushSync(() => {
|
|
147
|
+
handler(event);
|
|
148
|
+
});
|
|
136
149
|
}
|
|
137
150
|
|
|
138
151
|
/**
|
|
@@ -66,7 +66,11 @@ export class CommandListState {
|
|
|
66
66
|
const releaseEscape = pushEscapeHandler((event) => {
|
|
67
67
|
if (!options.isOpen() || event?.key !== 'Escape')
|
|
68
68
|
return;
|
|
69
|
+
// Uniform swallow-at-the-top (CIN-428): consume with both
|
|
70
|
+
// preventDefault() and stopPropagation() so a lower escape-stack
|
|
71
|
+
// overlay never reacts to the same keystroke.
|
|
69
72
|
event.preventDefault();
|
|
73
|
+
event.stopPropagation();
|
|
70
74
|
options.onDismiss(true);
|
|
71
75
|
});
|
|
72
76
|
const handlePointerDown = (event) => {
|
|
@@ -5,16 +5,6 @@
|
|
|
5
5
|
* ======================================== */
|
|
6
6
|
|
|
7
7
|
.cinder-accordion-item {
|
|
8
|
-
--cinder-accordion-item-trigger-gap: var(--cinder-space-4);
|
|
9
|
-
--cinder-accordion-item-trigger-padding-block: var(--cinder-space-4);
|
|
10
|
-
--cinder-accordion-item-trigger-padding-inline: var(--cinder-space-5);
|
|
11
|
-
--cinder-accordion-item-trigger-font-size: var(--cinder-text-base);
|
|
12
|
-
--cinder-accordion-item-trigger-font-weight: var(--cinder-font-semibold);
|
|
13
|
-
--cinder-accordion-item-panel-inner-padding-block-start: var(--cinder-space-4);
|
|
14
|
-
--cinder-accordion-item-panel-inner-padding-block-end: var(--cinder-space-5);
|
|
15
|
-
--cinder-accordion-item-panel-inner-padding-inline: var(--cinder-space-5);
|
|
16
|
-
--cinder-accordion-item-panel-font-size: var(--cinder-text-base);
|
|
17
|
-
--cinder-accordion-item-panel-line-height: var(--cinder-leading-normal);
|
|
18
8
|
border-block-end: 1px solid var(--cinder-border-muted);
|
|
19
9
|
background: var(--cinder-surface);
|
|
20
10
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-action-row {
|
|
4
|
-
--cinder-action-row-padding-block: var(--cinder-space-3);
|
|
5
|
-
--cinder-action-row-padding-inline: var(--cinder-space-4);
|
|
6
|
-
--cinder-action-row-layout-column-gap: var(--cinder-space-3);
|
|
7
|
-
--cinder-action-row-layout-row-gap: var(--cinder-space-2);
|
|
8
|
-
--cinder-action-row-body-gap: var(--cinder-space-1);
|
|
9
|
-
--cinder-action-row-title-font-size: var(--cinder-text-sm);
|
|
10
|
-
--cinder-action-row-description-font-size: var(--cinder-text-sm);
|
|
11
|
-
--cinder-action-row-meta-font-size: var(--cinder-text-xs);
|
|
12
|
-
--cinder-action-row-trailing-gap: var(--cinder-space-2);
|
|
13
4
|
display: block;
|
|
14
5
|
inline-size: 100%;
|
|
15
6
|
padding: var(--cinder-action-row-padding-block, var(--cinder-space-3))
|
|
@@ -214,9 +214,9 @@
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
.cinder-button[data-cinder-variant='secondary'] {
|
|
217
|
-
background: var(--cinder-
|
|
218
|
-
color: var(--cinder-
|
|
219
|
-
border-color: var(--cinder-border);
|
|
217
|
+
background: var(--cinder-button-background);
|
|
218
|
+
color: var(--cinder-button-foreground);
|
|
219
|
+
border-color: var(--cinder-button-border);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
.cinder-button[data-cinder-variant='danger'] {
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
|
|
470
470
|
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
471
471
|
* together read as one heavier shape than either was designed to be. The
|
|
472
|
-
* variants that paint
|
|
472
|
+
* variants that paint a resting border (secondary, and the icon-only
|
|
473
473
|
* ghost pair) all carry the same (0,2,0) specificity as `:focus-visible`, so
|
|
474
474
|
* this has to sit AFTER them in source order to win the cascade. Keep it below
|
|
475
475
|
* the `:active` block for the same reason. */
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
[
|
|
1
|
+
[
|
|
2
|
+
"--cinder-button-background",
|
|
3
|
+
"--cinder-button-border",
|
|
4
|
+
"--cinder-button-font-size-lg",
|
|
5
|
+
"--cinder-button-font-size-md",
|
|
6
|
+
"--cinder-button-font-size-sm",
|
|
7
|
+
"--cinder-button-font-size-xl",
|
|
8
|
+
"--cinder-button-font-size-xs",
|
|
9
|
+
"--cinder-button-foreground",
|
|
10
|
+
"--cinder-button-height-lg",
|
|
11
|
+
"--cinder-button-height-md",
|
|
12
|
+
"--cinder-button-height-sm",
|
|
13
|
+
"--cinder-button-height-xl",
|
|
14
|
+
"--cinder-button-height-xs",
|
|
15
|
+
"--cinder-button-padding-x-lg",
|
|
16
|
+
"--cinder-button-padding-x-md",
|
|
17
|
+
"--cinder-button-padding-x-sm",
|
|
18
|
+
"--cinder-button-padding-x-xl",
|
|
19
|
+
"--cinder-button-padding-x-xs",
|
|
20
|
+
"--cinder-button-padding-y-lg",
|
|
21
|
+
"--cinder-button-padding-y-md",
|
|
22
|
+
"--cinder-button-padding-y-sm",
|
|
23
|
+
"--cinder-button-padding-y-xl",
|
|
24
|
+
"--cinder-button-padding-y-xs",
|
|
25
|
+
"--cinder-button-radius",
|
|
26
|
+
"--cinder-button-radius-lg",
|
|
27
|
+
"--cinder-button-radius-md",
|
|
28
|
+
"--cinder-button-radius-sm",
|
|
29
|
+
"--cinder-button-radius-xl",
|
|
30
|
+
"--cinder-button-radius-xs"
|
|
31
|
+
]
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
const variables: readonly string[] = [
|
|
1
|
+
const variables: readonly string[] = [
|
|
2
|
+
'--cinder-button-background',
|
|
3
|
+
'--cinder-button-border',
|
|
4
|
+
'--cinder-button-font-size-lg',
|
|
5
|
+
'--cinder-button-font-size-md',
|
|
6
|
+
'--cinder-button-font-size-sm',
|
|
7
|
+
'--cinder-button-font-size-xl',
|
|
8
|
+
'--cinder-button-font-size-xs',
|
|
9
|
+
'--cinder-button-foreground',
|
|
10
|
+
'--cinder-button-height-lg',
|
|
11
|
+
'--cinder-button-height-md',
|
|
12
|
+
'--cinder-button-height-sm',
|
|
13
|
+
'--cinder-button-height-xl',
|
|
14
|
+
'--cinder-button-height-xs',
|
|
15
|
+
'--cinder-button-padding-x-lg',
|
|
16
|
+
'--cinder-button-padding-x-md',
|
|
17
|
+
'--cinder-button-padding-x-sm',
|
|
18
|
+
'--cinder-button-padding-x-xl',
|
|
19
|
+
'--cinder-button-padding-x-xs',
|
|
20
|
+
'--cinder-button-padding-y-lg',
|
|
21
|
+
'--cinder-button-padding-y-md',
|
|
22
|
+
'--cinder-button-padding-y-sm',
|
|
23
|
+
'--cinder-button-padding-y-xl',
|
|
24
|
+
'--cinder-button-padding-y-xs',
|
|
25
|
+
'--cinder-button-radius',
|
|
26
|
+
'--cinder-button-radius-lg',
|
|
27
|
+
'--cinder-button-radius-md',
|
|
28
|
+
'--cinder-button-radius-sm',
|
|
29
|
+
'--cinder-button-radius-xl',
|
|
30
|
+
'--cinder-button-radius-xs',
|
|
31
|
+
];
|
|
2
32
|
|
|
3
33
|
export default variables;
|
|
@@ -255,8 +255,6 @@
|
|
|
255
255
|
|
|
256
256
|
@media (width < 640px) {
|
|
257
257
|
.cinder-card[data-cinder-edge-to-edge-mobile] {
|
|
258
|
-
--cinder-card-mobile-bleed: var(--cinder-space-4);
|
|
259
|
-
|
|
260
258
|
inline-size: calc(100% + (var(--cinder-card-mobile-bleed) * 2));
|
|
261
259
|
margin-inline: calc(var(--cinder-card-mobile-bleed) * -1);
|
|
262
260
|
border-inline: 0;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-carousel {
|
|
4
|
-
--cinder-carousel-slide-size: 100%;
|
|
5
|
-
--cinder-carousel-gap: var(--cinder-space-3);
|
|
6
|
-
--cinder-carousel-aspect-ratio: 16 / 9;
|
|
7
|
-
--cinder-carousel-dot-size: 2.75rem;
|
|
8
|
-
|
|
9
4
|
display: grid;
|
|
10
5
|
gap: var(--cinder-carousel-gap, var(--cinder-space-3));
|
|
11
6
|
}
|
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
* ======================================== */
|
|
10
10
|
|
|
11
11
|
.cinder-code-block {
|
|
12
|
-
--cinder-code-block-background: var(--_cinder-code-block-code-surface);
|
|
13
|
-
--cinder-code-block-font-size: var(--cinder-text-sm);
|
|
14
|
-
--cinder-code-block-height: auto;
|
|
15
|
-
--cinder-code-block-line-height: var(--cinder-leading-relaxed);
|
|
16
|
-
--cinder-code-block-padding: var(--cinder-space-4);
|
|
17
12
|
/* The light arm MUST stay pure white, and this is an accessibility constraint
|
|
18
13
|
* rather than a stylistic one — do not "simplify" it to a single token.
|
|
19
14
|
*
|
|
@@ -7,6 +7,7 @@ import { getCaretRect } from './caret-rect.svelte.ts';
|
|
|
7
7
|
import { computeGhostOverlayFontStyle, createInlineCompletionState, } from './command-menu-inline-completion.svelte.ts';
|
|
8
8
|
import { on } from 'svelte/events';
|
|
9
9
|
import { createAnchoredOverlay } from '../../_internal/anchored-overlay.svelte.ts';
|
|
10
|
+
import { pushEscapeHandler } from '../../_internal/overlay.ts';
|
|
10
11
|
import { isRightToLeftElement } from '../../_internal/text-direction.ts';
|
|
11
12
|
import { classNames } from '../../utilities/class-names.ts';
|
|
12
13
|
import { setCommandListContext } from '../_internal/command-list-context.ts';
|
|
@@ -268,16 +269,72 @@ function dismiss({ latch = false } = {}) {
|
|
|
268
269
|
function isModifiedKey(event) {
|
|
269
270
|
return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
|
|
270
271
|
}
|
|
272
|
+
// Escape ownership (CIN-427).
|
|
273
|
+
//
|
|
274
|
+
// Two-stage: first Escape dismisses inline ghost text without closing the
|
|
275
|
+
// menu; only a second Escape (ghost already hidden) falls through to
|
|
276
|
+
// dismiss the menu itself. This is the single place that logic lives —
|
|
277
|
+
// both the anchor's own keydown listener below AND the escape-stack
|
|
278
|
+
// registration further down call this same function, so there is exactly
|
|
279
|
+
// one implementation of the two-stage semantics regardless of where focus
|
|
280
|
+
// sits when Escape is pressed.
|
|
281
|
+
function handleEscape(event) {
|
|
282
|
+
if (!open)
|
|
283
|
+
return;
|
|
284
|
+
if (event && (event.isComposing || event.keyCode === 229))
|
|
285
|
+
return;
|
|
286
|
+
if (inlineCompletion.dismissGhostText()) {
|
|
287
|
+
event?.preventDefault();
|
|
288
|
+
event?.stopPropagation();
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
dismiss({ latch: true });
|
|
292
|
+
event?.preventDefault();
|
|
293
|
+
event?.stopPropagation();
|
|
294
|
+
}
|
|
295
|
+
// The stack handler is the top-most Escape consumer for the entire open
|
|
296
|
+
// session, including with focus OUTSIDE the anchor — unlike the old
|
|
297
|
+
// anchor-scoped-only keydown listener below, `pushEscapeHandler` receives
|
|
298
|
+
// every window keydown regardless of focus location. That is a deliberate
|
|
299
|
+
// behavior change: Escape now dismisses the menu even when focus has moved
|
|
300
|
+
// elsewhere on the page while it's open.
|
|
301
|
+
//
|
|
302
|
+
// Depend on `hasAnchor` (a boolean), not `anchor` itself: a host that
|
|
303
|
+
// replaces one non-null anchor with another (e.g. swapping which
|
|
304
|
+
// textarea/input owns the menu) while `open` stays true must NOT tear down
|
|
305
|
+
// and re-push this registration — doing so would move it above any
|
|
306
|
+
// overlay that opened in the meantime, so a later Escape would dismiss
|
|
307
|
+
// this (visually lower) menu first instead of that newer, higher overlay.
|
|
308
|
+
// Only an actual null<->non-null transition should change registration —
|
|
309
|
+
// matching the menu's own render condition, which cares about presence,
|
|
310
|
+
// not identity.
|
|
311
|
+
const hasAnchor = $derived(anchor != null);
|
|
312
|
+
$effect(() => {
|
|
313
|
+
// Matches the menu's own render condition (`mounted && open && anchor`,
|
|
314
|
+
// line ~487): when a host clears or unmounts `anchor` while `open` stays
|
|
315
|
+
// true, nothing renders, so this stack entry must not either — otherwise
|
|
316
|
+
// it silently swallows Escape for a menu that's no longer visible,
|
|
317
|
+
// blocking whatever overlay is actually on screen beneath it.
|
|
318
|
+
if (!open || !hasAnchor)
|
|
319
|
+
return;
|
|
320
|
+
const releaseEscape = pushEscapeHandler(handleEscape);
|
|
321
|
+
return releaseEscape;
|
|
322
|
+
});
|
|
271
323
|
function handleKeydown(event) {
|
|
272
324
|
if (!open)
|
|
273
325
|
return;
|
|
274
326
|
const isComposingEvent = event.isComposing || event.keyCode === 229;
|
|
275
|
-
// Escape
|
|
276
|
-
//
|
|
277
|
-
//
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
327
|
+
// Escape: fallback path. In a real browser the capture-phase
|
|
328
|
+
// escape-stack listener (installed by the $effect above) runs first,
|
|
329
|
+
// already ran the two-stage `handleEscape` logic, and called
|
|
330
|
+
// preventDefault()/stopPropagation() — so `event.defaultPrevented` is
|
|
331
|
+
// true here and this bails without re-running the logic. This branch
|
|
332
|
+
// only does real work when the stack listener never ran (SSR/no-window
|
|
333
|
+
// environments where `pushEscapeHandler` installed nothing).
|
|
334
|
+
if (!isComposingEvent && event.key === 'Escape') {
|
|
335
|
+
if (event.defaultPrevented)
|
|
336
|
+
return;
|
|
337
|
+
handleEscape(event);
|
|
281
338
|
return;
|
|
282
339
|
}
|
|
283
340
|
// ArrowRight at the field end and unmodified Tab accept the ghost
|
|
@@ -303,7 +360,6 @@ function handleKeydown(event) {
|
|
|
303
360
|
commandList.handleKeydown({
|
|
304
361
|
event,
|
|
305
362
|
onEnter: activateItemById,
|
|
306
|
-
onEscape: () => dismiss({ latch: true }),
|
|
307
363
|
ignoreModifiedNavigation: true,
|
|
308
364
|
});
|
|
309
365
|
}
|
|
@@ -15,10 +15,17 @@
|
|
|
15
15
|
border: none;
|
|
16
16
|
background: transparent;
|
|
17
17
|
color: var(--cinder-text-default);
|
|
18
|
-
/*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/* `overflow: visible`, not `hidden` — the panel (below) is the clipping
|
|
19
|
+
boundary, matching modal.css's `.cinder-modal`/`.cinder-modal__panel`
|
|
20
|
+
split (see OVERLAY-POLICY.md's "Portal root" section: "its content panel
|
|
21
|
+
remains the clipping boundary for ordinary modal content"). The panel
|
|
22
|
+
already clips its own children via its own `overflow: hidden` and
|
|
23
|
+
`border-radius`, so nothing bleeds past the rounded corners. Keeping
|
|
24
|
+
`overflow: hidden` here instead would clip the panel's own
|
|
25
|
+
enter/exit `translate` motion at the dialog's box — round 1 review
|
|
26
|
+
caught this exact regression once the enter/exit motion moved from the
|
|
27
|
+
dialog itself (this element) onto the panel. */
|
|
28
|
+
overflow: visible;
|
|
22
29
|
border-radius: var(--cinder-radius-lg);
|
|
23
30
|
/* Anchor near the top of the viewport — top-layer elements use fixed
|
|
24
31
|
positioning relative to the viewport. z-index is intentionally absent:
|
|
@@ -56,6 +63,17 @@
|
|
|
56
63
|
box-shadow:
|
|
57
64
|
0 4px 6px -1px color-mix(in oklch, var(--cinder-text-default) 8%, transparent),
|
|
58
65
|
0 10px 15px -3px color-mix(in oklch, var(--cinder-text-default) 12%, transparent);
|
|
66
|
+
/* Symmetric enter/exit motion — see "Reduced motion — panel enter/exit
|
|
67
|
+
transition" below for the exit half and the OVERLAY-POLICY.md citation.
|
|
68
|
+
No resting `translate` here (matching modal.css's panel): a non-`none`
|
|
69
|
+
transform value, even a no-op `0 0`, establishes a CSS containing
|
|
70
|
+
block, which would break `position: fixed` for any descendant portaled
|
|
71
|
+
surface for the whole time the palette is open. `none` transitions
|
|
72
|
+
to/from a real value fine. */
|
|
73
|
+
opacity: 1;
|
|
74
|
+
transition:
|
|
75
|
+
opacity var(--cinder-duration-normal) var(--cinder-ease-standard),
|
|
76
|
+
translate var(--cinder-duration-normal) var(--cinder-ease-spring);
|
|
59
77
|
}
|
|
60
78
|
|
|
61
79
|
/* ----------------------------------------
|
|
@@ -186,50 +204,36 @@
|
|
|
186
204
|
* duplicating rules. The import is placed outside the @layer block above. */
|
|
187
205
|
|
|
188
206
|
/* ----------------------------------------
|
|
189
|
-
*
|
|
190
|
-
* ----------------------------------------
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
207
|
+
* Panel enter/exit transition
|
|
208
|
+
* ----------------------------------------
|
|
209
|
+
* OVERLAY-POLICY.md, "Transition lifecycle" > "Awaiting completion vs.
|
|
210
|
+
* destroy-on-close": every overlay that animates in must animate out
|
|
211
|
+
* symmetrically and await transition completion before unmount. This
|
|
212
|
+
* replaces the former `animation`/`@keyframes` enter (and the
|
|
213
|
+
* `dialog.close()`-immediately exit asymmetry that named Command Palette in
|
|
214
|
+
* "Known deviations") with `transition`-driven styles the shared
|
|
215
|
+
* `waitForTransitionCompletion` helper can actually detect —
|
|
216
|
+
* `transitionend` never fires for a CSS `animation`. Transition properties
|
|
217
|
+
* are named explicitly (never `all`) per that section's "Only after that
|
|
218
|
+
* callback..." clause: with `all`, the helper cannot enumerate tracked
|
|
219
|
+
* properties and would resolve on whichever property's `transitionend`
|
|
220
|
+
* happens to fire first, even if others are still transitioning. Reduced
|
|
221
|
+
* motion needs no separate override here — `--cinder-duration-*` tokens
|
|
222
|
+
* already collapse to `0ms` under both the media query and the
|
|
223
|
+
* `data-cinder-reduced-motion`/`data-reduced-motion` attribute overrides
|
|
224
|
+
* (tokens-base.css), which is exactly what
|
|
225
|
+
* `waitForTransitionCompletion` reads to resolve immediately. */
|
|
226
|
+
|
|
227
|
+
.cinder-command-palette__panel[data-cinder-closing] {
|
|
228
|
+
opacity: 0;
|
|
229
|
+
translate: 0 -0.75rem;
|
|
230
|
+
pointer-events: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@starting-style {
|
|
234
|
+
.cinder-command-palette__panel {
|
|
194
235
|
opacity: 0;
|
|
195
236
|
translate: 0 -0.75rem;
|
|
196
237
|
}
|
|
197
|
-
to {
|
|
198
|
-
opacity: 1;
|
|
199
|
-
translate: 0 0;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
204
|
-
:root:not([data-cinder-reduced-motion='true']) .cinder-command-palette {
|
|
205
|
-
animation: cinder-command-palette-enter var(--cinder-duration-normal)
|
|
206
|
-
var(--cinder-ease-spring) forwards;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
:root:is([data-cinder-reduced-motion='false'], [data-reduced-motion='off'])
|
|
211
|
-
.cinder-command-palette {
|
|
212
|
-
animation: cinder-command-palette-enter var(--cinder-duration-normal) var(--cinder-ease-spring)
|
|
213
|
-
forwards;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
@keyframes cinder-command-palette-fade {
|
|
217
|
-
from {
|
|
218
|
-
opacity: 0;
|
|
219
|
-
}
|
|
220
|
-
to {
|
|
221
|
-
opacity: 1;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
@media (prefers-reduced-motion: reduce) {
|
|
226
|
-
:root:not([data-cinder-reduced-motion='false']):not([data-reduced-motion='off'])
|
|
227
|
-
.cinder-command-palette {
|
|
228
|
-
animation: cinder-command-palette-fade var(--cinder-duration-fast) linear forwards;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
:root[data-cinder-reduced-motion='true'] .cinder-command-palette {
|
|
233
|
-
animation: cinder-command-palette-fade var(--cinder-duration-fast) linear forwards !important;
|
|
234
238
|
}
|
|
235
239
|
}
|