@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
|
@@ -38,6 +38,14 @@ const hasTrailing = $derived(!!trailing || isNativeDateInput);
|
|
|
38
38
|
const hasGroupWrapper = $derived(!!leading || hasTrailing);
|
|
39
39
|
const isInvalid = $derived(resolvedAriaInvalid === 'true');
|
|
40
40
|
const groupModifiers = $derived(classNames(leading && 'cinder-input-group--leading', hasTrailing && 'cinder-input-group--trailing', rendersNativeDateIcon && 'cinder-input-group--native-date', resolvedDisabled && 'cinder-input-group--disabled', isInvalid && 'cinder-input-group--invalid'));
|
|
41
|
+
// One class string for the control wrapper in both of its states. The
|
|
42
|
+
// wrapper itself is always rendered — via `controlClass` on FormFieldFrame's
|
|
43
|
+
// own `.cinder-form-field__control` div (see the `{#if context}` block
|
|
44
|
+
// below), so the two states differ only by class, never by a wrapper
|
|
45
|
+
// switching in or out.
|
|
46
|
+
const hostClass = $derived(hasGroupWrapper
|
|
47
|
+
? classNames('cinder-input-group', groupClassName, groupModifiers)
|
|
48
|
+
: 'cinder-input-host');
|
|
41
49
|
let inputNode = $state();
|
|
42
50
|
let resetSyncTimeout;
|
|
43
51
|
function syncValueAfterFormReset() {
|
|
@@ -112,51 +120,6 @@ function handleInput(event) {
|
|
|
112
120
|
/>
|
|
113
121
|
{/snippet}
|
|
114
122
|
|
|
115
|
-
{#snippet control()}
|
|
116
|
-
{#if hasGroupWrapper}
|
|
117
|
-
<div
|
|
118
|
-
class={classNames('cinder-input-group', groupClassName, groupModifiers)}
|
|
119
|
-
data-leading={leading ? '' : undefined}
|
|
120
|
-
data-trailing={hasTrailing ? '' : undefined}
|
|
121
|
-
data-native-date={rendersNativeDateIcon ? '' : undefined}
|
|
122
|
-
data-disabled={resolvedDisabled ? '' : undefined}
|
|
123
|
-
data-invalid={isInvalid ? '' : undefined}
|
|
124
|
-
data-cinder-full-width
|
|
125
|
-
>
|
|
126
|
-
{#if leading}
|
|
127
|
-
<span
|
|
128
|
-
class={classNames(
|
|
129
|
-
'cinder-input-group__leading',
|
|
130
|
-
!leadingInteractive && 'cinder-_truncate',
|
|
131
|
-
)}
|
|
132
|
-
aria-hidden={leadingInteractive ? undefined : 'true'}>{@render leading()}</span
|
|
133
|
-
>
|
|
134
|
-
{/if}
|
|
135
|
-
|
|
136
|
-
{@render inputElement()}
|
|
137
|
-
|
|
138
|
-
{#if trailing}
|
|
139
|
-
<span
|
|
140
|
-
class={classNames(
|
|
141
|
-
'cinder-input-group__trailing',
|
|
142
|
-
!trailingInteractive && 'cinder-_truncate',
|
|
143
|
-
)}
|
|
144
|
-
aria-hidden={trailingInteractive ? undefined : 'true'}>{@render trailing()}</span
|
|
145
|
-
>
|
|
146
|
-
{:else if rendersNativeDateIcon}
|
|
147
|
-
<span
|
|
148
|
-
class="cinder-input-group__trailing cinder-input-group__date-icon cinder-_truncate"
|
|
149
|
-
aria-hidden="true"
|
|
150
|
-
>
|
|
151
|
-
{@render calendarIcon()}
|
|
152
|
-
</span>
|
|
153
|
-
{/if}
|
|
154
|
-
</div>
|
|
155
|
-
{:else}
|
|
156
|
-
{@render inputElement()}
|
|
157
|
-
{/if}
|
|
158
|
-
{/snippet}
|
|
159
|
-
|
|
160
123
|
{#snippet leadingAdornment()}
|
|
161
124
|
{#if leading}
|
|
162
125
|
<span
|
|
@@ -180,37 +143,39 @@ function handleInput(event) {
|
|
|
180
143
|
{/snippet}
|
|
181
144
|
|
|
182
145
|
{#if context}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
{
|
|
213
|
-
|
|
146
|
+
<!-- Always render the nested frame here, even when label/description/error
|
|
147
|
+
are all unset — collapsing what used to be a second `{#if}` arm switch
|
|
148
|
+
between this frame and rendering the control snippet bare. Switching
|
|
149
|
+
arms as those props became truthy destroyed and recreated the native
|
|
150
|
+
<input> (same failure mode CIN-500 fixed one level up, for the
|
|
151
|
+
leading/trailing wrapper). label/description/error are simply
|
|
152
|
+
absent/undefined on the frame when unset, so there is exactly one code
|
|
153
|
+
path for the context-truthy case. See CIN-511. -->
|
|
154
|
+
<FormFieldFrame
|
|
155
|
+
{id}
|
|
156
|
+
label={context.labelId ? undefined : label}
|
|
157
|
+
{labelVisible}
|
|
158
|
+
{description}
|
|
159
|
+
{error}
|
|
160
|
+
required={resolvedRequired}
|
|
161
|
+
disabled={resolvedDisabled}
|
|
162
|
+
class="cinder-input-field"
|
|
163
|
+
data-cinder-variant={variant}
|
|
164
|
+
fullWidth
|
|
165
|
+
descriptionClass="cinder-input-field__description"
|
|
166
|
+
errorClass="cinder-input-field__error"
|
|
167
|
+
descriptionId={field.ownDescriptionId}
|
|
168
|
+
errorId={field.ownErrorId}
|
|
169
|
+
control={inputElement}
|
|
170
|
+
controlClass={hostClass}
|
|
171
|
+
controlLeading={!!leading}
|
|
172
|
+
controlTrailing={hasTrailing}
|
|
173
|
+
controlNativeDate={rendersNativeDateIcon}
|
|
174
|
+
controlDisabled={resolvedDisabled}
|
|
175
|
+
controlInvalid={isInvalid}
|
|
176
|
+
before={leadingAdornment}
|
|
177
|
+
after={trailingAdornment}
|
|
178
|
+
/>
|
|
214
179
|
{:else}
|
|
215
180
|
<FormFieldFrame
|
|
216
181
|
{id}
|
|
@@ -226,15 +191,13 @@ function handleInput(event) {
|
|
|
226
191
|
descriptionClass="cinder-input-field__description"
|
|
227
192
|
errorClass="cinder-input-field__error"
|
|
228
193
|
control={inputElement}
|
|
229
|
-
controlClass={
|
|
230
|
-
? classNames('cinder-input-group', groupClassName, groupModifiers)
|
|
231
|
-
: undefined}
|
|
194
|
+
controlClass={hostClass}
|
|
232
195
|
controlLeading={!!leading}
|
|
233
196
|
controlTrailing={hasTrailing}
|
|
234
197
|
controlNativeDate={rendersNativeDateIcon}
|
|
235
198
|
controlDisabled={resolvedDisabled}
|
|
236
199
|
controlInvalid={isInvalid}
|
|
237
|
-
before={
|
|
238
|
-
after={
|
|
200
|
+
before={leadingAdornment}
|
|
201
|
+
after={trailingAdornment}
|
|
239
202
|
/>
|
|
240
203
|
{/if}
|
|
@@ -7,16 +7,6 @@
|
|
|
7
7
|
@import '../button/button.css';
|
|
8
8
|
@layer cinder.components {
|
|
9
9
|
.cinder-kanban-board {
|
|
10
|
-
--cinder-kanban-column-width: 18rem;
|
|
11
|
-
--cinder-kanban-column-gap: var(--cinder-space-4);
|
|
12
|
-
--cinder-kanban-column-background: var(--cinder-surface-raised);
|
|
13
|
-
--cinder-kanban-card-background: var(--cinder-surface);
|
|
14
|
-
--cinder-kanban-board-scroll-edge: color-mix(
|
|
15
|
-
in oklch,
|
|
16
|
-
var(--cinder-text-default),
|
|
17
|
-
transparent 88%
|
|
18
|
-
);
|
|
19
|
-
|
|
20
10
|
display: block;
|
|
21
11
|
overflow-x: auto;
|
|
22
12
|
padding-block-end: var(--cinder-space-2);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-marquee {
|
|
4
|
-
--cinder-marquee-duration: 24s;
|
|
5
|
-
--cinder-marquee-gap: 1.5rem;
|
|
6
4
|
--_cinder-marquee-play-state: running;
|
|
7
5
|
display: block;
|
|
8
6
|
position: relative;
|
|
@@ -419,7 +419,18 @@ function handleTriggerKeydown(event, index) {
|
|
|
419
419
|
// Only consume Escape when a menu or submenu is actually open. On a closed
|
|
420
420
|
// menubar item, swallowing Escape (preventDefault + a no-op closeAll) would
|
|
421
421
|
// block an enclosing overlay or page-level Escape handler from ever running.
|
|
422
|
-
|
|
422
|
+
//
|
|
423
|
+
// `defaultPrevented` guard (CIN-428 hazard): DropdownMenu's own
|
|
424
|
+
// escape-stack registration runs at the window capture phase, before this
|
|
425
|
+
// bubble-phase trigger listener ever sees the key. In the normal case it
|
|
426
|
+
// already preventDefault()s + stopPropagation()s, so this branch never
|
|
427
|
+
// even runs for that keystroke — this guard is defense-in-depth for any
|
|
428
|
+
// path where the event still reaches here with defaultPrevented already
|
|
429
|
+
// true, so this doesn't run a redundant/conflicting closeAll() on top of
|
|
430
|
+
// whatever the stack handler already did.
|
|
431
|
+
if (event.key === 'Escape' &&
|
|
432
|
+
!event.defaultPrevented &&
|
|
433
|
+
(openMenuIndex !== null || openSubmenuKey !== null)) {
|
|
423
434
|
event.preventDefault();
|
|
424
435
|
closeAll();
|
|
425
436
|
return;
|
|
@@ -19,32 +19,6 @@
|
|
|
19
19
|
* The panel below remains the clipping boundary for ordinary content. */
|
|
20
20
|
max-height: calc(100dvh - var(--cinder-space-8));
|
|
21
21
|
overflow: visible;
|
|
22
|
-
|
|
23
|
-
/* Supported override point for the `::backdrop` color. This declaration
|
|
24
|
-
* exists ONLY so the variables generator collects
|
|
25
|
-
* `--cinder-modal-backdrop` into modal.variables.json/README — it is a
|
|
26
|
-
* plain reference to a DIFFERENT variable (`--cinder-overlay-backdrop`),
|
|
27
|
-
* never to itself. A self-referencing form
|
|
28
|
-
* (`--cinder-modal-backdrop: var(--cinder-modal-backdrop, fallback)`)
|
|
29
|
-
* is a CSS custom-property dependency CYCLE per spec: cycle detection
|
|
30
|
-
* happens before fallback substitution, so the fallback argument does
|
|
31
|
-
* NOT rescue it — the property computes to its guaranteed-invalid
|
|
32
|
-
* value, breaking the backdrop for every Modal with no override at all.
|
|
33
|
-
* (An earlier revision of this file made exactly that mistake; see the
|
|
34
|
-
* `::backdrop` rule below for where the real fallback logic lives now.)
|
|
35
|
-
*
|
|
36
|
-
* This declaration does not, by itself, reach `::backdrop`'s computed
|
|
37
|
-
* value — `::backdrop` does not reliably inherit custom properties from
|
|
38
|
-
* its originating element across engines — so it neither helps nor
|
|
39
|
-
* defeats a consumer override; it exists purely for the generator. A
|
|
40
|
-
* consumer override must target BOTH the `class` selector AND that same
|
|
41
|
-
* class's `::backdrop` pseudo-element directly — declare
|
|
42
|
-
* `--cinder-modal-backdrop` on `.my-modal` AND separately on
|
|
43
|
-
* `.my-modal::backdrop` (see `ImageLightbox`'s
|
|
44
|
-
* `:global(.lightbox-modal)` / `:global(.lightbox-modal::backdrop)`
|
|
45
|
-
* pair for the real pattern) — rather than reaching into
|
|
46
|
-
* `.cinder-modal::backdrop` with `:global()`. */
|
|
47
|
-
--cinder-modal-backdrop: var(--cinder-overlay-backdrop);
|
|
48
22
|
}
|
|
49
23
|
|
|
50
24
|
/* Chromeless / full-bleed mode (`chrome="none"`): suppresses max-width so the
|
|
@@ -212,6 +212,13 @@ function clearSelection(event) {
|
|
|
212
212
|
triggerElement?.focus();
|
|
213
213
|
}
|
|
214
214
|
function handleListNavigationKeydown(event) {
|
|
215
|
+
// Fallback-guard, matching Combobox's pattern (CIN-428): in a real
|
|
216
|
+
// browser the capture-phase escape-stack handler (registered via
|
|
217
|
+
// `commandList.bindDismissal` below) runs first and already
|
|
218
|
+
// preventDefault()s + stopPropagation()s — this bails rather than
|
|
219
|
+
// redundantly re-closing an already-closed menu.
|
|
220
|
+
if (event.key === 'Escape' && event.defaultPrevented)
|
|
221
|
+
return;
|
|
215
222
|
commandList.handleKeydown({
|
|
216
223
|
event,
|
|
217
224
|
onEnter: (itemId) => {
|
|
@@ -3,10 +3,11 @@ export {};
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
6
|
-
import { onDestroy } from 'svelte';
|
|
6
|
+
import { flushSync, onDestroy } from 'svelte';
|
|
7
7
|
import { BROWSER as browser } from 'esm-env';
|
|
8
8
|
import { createAnchoredOverlay } from '../../_internal/anchored-overlay.svelte.ts';
|
|
9
9
|
import { createAnchoredOverlayExitState } from '../../_internal/anchored-overlay-exit.svelte.ts';
|
|
10
|
+
import { pushEscapeHandler } from '../../_internal/overlay.ts';
|
|
10
11
|
import { classNames } from '../../utilities/class-names.ts';
|
|
11
12
|
import { getSequentialFocusTargets, getTabIndexValue } from '../../utilities/focus.ts';
|
|
12
13
|
import { useReducedMotion } from '../../utilities/use-reduced-motion.svelte.ts';
|
|
@@ -399,6 +400,69 @@ function focusMenuToggle() {
|
|
|
399
400
|
const focusTarget = findFocusTargetBeforeNavigationItems(navigationBarElement, toggleElement, false);
|
|
400
401
|
focusTarget?.focus();
|
|
401
402
|
}
|
|
403
|
+
// Escape ownership (CIN-428). The escape-stack registration is the single
|
|
404
|
+
// Escape dispatch path, firing whenever the mobile panel is open
|
|
405
|
+
// regardless of focus location — so a dispatch that originates outside the
|
|
406
|
+
// bar's own DOM tree (`pressing Escape outside the navbar still closes the
|
|
407
|
+
// mobile menu`) still closes it, swallowing the key uniformly like every
|
|
408
|
+
// other escape-stack overlay.
|
|
409
|
+
//
|
|
410
|
+
// Escape dispatched *inside* the bar's tree is different: this handler
|
|
411
|
+
// runs at the window capture phase, which is necessarily reached before
|
|
412
|
+
// the event arrives at its actual target — before a nested control (a
|
|
413
|
+
// search field, a disclosure) or the consumer's own composed `<nav
|
|
414
|
+
// onkeydown>` ever sees it. Closing unconditionally here would make it
|
|
415
|
+
// impossible for either to call `preventDefault()` and cancel the close,
|
|
416
|
+
// contradicting the cooperative Escape contract in
|
|
417
|
+
// navigation-bar.a11y.md's "Cooperative Escape semantics" section. So for
|
|
418
|
+
// an in-tree target, stash the event and let it keep propagating — the
|
|
419
|
+
// decision happens in `handleKeyDown` below (the bar's own bubble-phase
|
|
420
|
+
// listener on `<nav>`), which runs *after* the target's own handler and
|
|
421
|
+
// the composed consumer handler, once `event.defaultPrevented` reflects
|
|
422
|
+
// their answer. Identity comparison against `pendingEscapeEvent` makes a
|
|
423
|
+
// stale stash harmless (it's only ever consulted for the exact event that
|
|
424
|
+
// set it).
|
|
425
|
+
let pendingEscapeEvent = null;
|
|
426
|
+
function closeMobilePanel(event) {
|
|
427
|
+
event?.preventDefault();
|
|
428
|
+
// Once the panel actually accepts the dismissal — whether immediately,
|
|
429
|
+
// for a dispatch outside the bar's tree, or after the deferred in-tree
|
|
430
|
+
// decision in `handleKeyDown` below — stop the key from leaking past
|
|
431
|
+
// here to unrelated ancestor keydown handlers (review findings from
|
|
432
|
+
// both Copilot and Codex). This still preserves the cooperative path
|
|
433
|
+
// above: propagation is only cut off once the close is decided, never
|
|
434
|
+
// before a nested control or the composed consumer handler got a look.
|
|
435
|
+
event?.stopPropagation();
|
|
436
|
+
mobileMenuOpen = false;
|
|
437
|
+
focusMenuToggle();
|
|
438
|
+
}
|
|
439
|
+
function dismissMobilePanel(event) {
|
|
440
|
+
const target = event?.target;
|
|
441
|
+
// The open mobile panel is portaled to `document.body` by default (no
|
|
442
|
+
// enclosing top layer to anchor to — see `itemsPortalScope` above), so a
|
|
443
|
+
// target inside it is no longer a DOM descendant of `navigationBarElement`
|
|
444
|
+
// once open. Check `itemsRegionElement` too: portaling re-parents that
|
|
445
|
+
// wrapper but never changes its own descendants, so this still correctly
|
|
446
|
+
// recognizes "inside the bar" regardless of where the wrapper currently
|
|
447
|
+
// sits. The original portaled-target event never reaches `handleKeyDown`
|
|
448
|
+
// directly (it isn't a DOM ancestor anymore), but `bridgePortaledEvents`
|
|
449
|
+
// below re-dispatches a bridged copy at `navigationBarElement` — which
|
|
450
|
+
// re-enters this same handler with a *new* event object, re-stashing
|
|
451
|
+
// `pendingEscapeEvent` to the one `handleKeyDown` will actually see.
|
|
452
|
+
if (event &&
|
|
453
|
+
target instanceof Node &&
|
|
454
|
+
(navigationBarElement?.contains(target) || itemsRegionElement?.contains(target))) {
|
|
455
|
+
pendingEscapeEvent = event;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
closeMobilePanel(event);
|
|
459
|
+
}
|
|
460
|
+
$effect(() => {
|
|
461
|
+
if (!isCollapsible || !mobilePanelOpen)
|
|
462
|
+
return;
|
|
463
|
+
const releaseEscape = pushEscapeHandler(dismissMobilePanel);
|
|
464
|
+
return releaseEscape;
|
|
465
|
+
});
|
|
402
466
|
function getFocusTargetBeforeItems(navigationItem = null) {
|
|
403
467
|
return findFocusTargetBeforeNavigationItems(navigationBarElement, toggleElement, menuTogglePlacement === 'before-brand', navigationItem);
|
|
404
468
|
}
|
|
@@ -527,15 +591,27 @@ function handleKeyDown(event) {
|
|
|
527
591
|
if (consumerOnKeyDown) {
|
|
528
592
|
consumerOnKeyDown(withNavigationCurrentTarget(event));
|
|
529
593
|
}
|
|
594
|
+
// Resolve an Escape stashed by `dismissMobilePanel` above (CIN-428): by
|
|
595
|
+
// the time this bubble-phase listener on `<nav>` runs, any nested
|
|
596
|
+
// control's own keydown handler (fired at the target phase, before
|
|
597
|
+
// bubbling reaches here) and the consumer handler just above have both
|
|
598
|
+
// had their chance to call `preventDefault()`.
|
|
599
|
+
if (event.key === 'Escape' && pendingEscapeEvent === event) {
|
|
600
|
+
pendingEscapeEvent = null;
|
|
601
|
+
// `handleKeyDown` runs as a plain, un-flushed consequence of the DOM's
|
|
602
|
+
// own bubble-phase dispatch to <nav> (see overlay.ts's `onEscapeKeydown`
|
|
603
|
+
// for the same reasoning) — flush explicitly so a second Escape
|
|
604
|
+
// dispatched immediately afterward observes this close (and this
|
|
605
|
+
// handler's stack release) synchronously, matching the guarantee the
|
|
606
|
+
// shared escape stack gives every other overlay.
|
|
607
|
+
if (!event.defaultPrevented)
|
|
608
|
+
flushSync(() => closeMobilePanel(event));
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
530
611
|
if (event.defaultPrevented)
|
|
531
612
|
return;
|
|
532
613
|
if (bridgeBrandTabToPortaledPanel(event))
|
|
533
614
|
return;
|
|
534
|
-
if (event.key === 'Escape' && isCollapsible && isMobileLayout && mobileMenuOpen) {
|
|
535
|
-
mobileMenuOpen = false;
|
|
536
|
-
focusMenuToggle();
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
615
|
const navigationItem = getEventNavigationItem(event);
|
|
540
616
|
if (event.key === 'Tab' &&
|
|
541
617
|
event.target instanceof HTMLElement &&
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-selectable-row {
|
|
4
|
-
--cinder-selectable-row-padding-block: var(--cinder-space-3);
|
|
5
|
-
--cinder-selectable-row-padding-inline: var(--cinder-space-4);
|
|
6
|
-
--cinder-selectable-row-column-gap: var(--cinder-space-2);
|
|
7
|
-
--cinder-selectable-row-content-gap: var(--cinder-space-1);
|
|
8
|
-
--cinder-selectable-row-leading-gap: var(--cinder-space-3);
|
|
9
|
-
--cinder-selectable-row-trailing-actions-gap: var(--cinder-space-2);
|
|
10
4
|
display: grid;
|
|
11
5
|
min-inline-size: 0;
|
|
12
6
|
align-items: center;
|
|
@@ -6,6 +6,7 @@ export {};
|
|
|
6
6
|
import { onDestroy, tick } from 'svelte';
|
|
7
7
|
import { createAnchoredOverlay } from '../../_internal/anchored-overlay.svelte.ts';
|
|
8
8
|
import { createAnchoredOverlayExitState } from '../../_internal/anchored-overlay-exit.svelte.ts';
|
|
9
|
+
import { pushEscapeHandler } from '../../_internal/overlay.ts';
|
|
9
10
|
import { createClickOutside } from '../../utilities/attachments.ts';
|
|
10
11
|
import { classNames } from '../../utilities/class-names.ts';
|
|
11
12
|
import { useReducedMotion } from '../../utilities/use-reduced-motion.svelte.ts';
|
|
@@ -249,17 +250,30 @@ function handleSubmit() {
|
|
|
249
250
|
commentBody = '';
|
|
250
251
|
restoreFocus();
|
|
251
252
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
253
|
+
// Escape ownership (CIN-428). The shared internal function below holds the
|
|
254
|
+
// dismiss logic — expanded-restore/cancel first stage, else close — and
|
|
255
|
+
// the escape-stack registration further down is the ONLY caller: this is
|
|
256
|
+
// no longer duplicated as a local `onkeydown` branch, so it fires
|
|
257
|
+
// regardless of where focus sits while the popover is open, not just
|
|
258
|
+
// while focus is inside its own DOM tree.
|
|
259
|
+
function dismissEscape(event) {
|
|
260
|
+
// Uniform swallow-at-the-top (CIN-428): both stages consume the key.
|
|
261
|
+
event?.preventDefault();
|
|
262
|
+
event?.stopPropagation();
|
|
263
|
+
if (expanded) {
|
|
264
|
+
handleCancel();
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
closePopover();
|
|
262
268
|
}
|
|
269
|
+
}
|
|
270
|
+
$effect(() => {
|
|
271
|
+
if (!isPositionedOpen)
|
|
272
|
+
return;
|
|
273
|
+
const releaseEscape = pushEscapeHandler(dismissEscape);
|
|
274
|
+
return releaseEscape;
|
|
275
|
+
});
|
|
276
|
+
function handleKeydown(event) {
|
|
263
277
|
if ((event.key === 'Enter' || event.key === ' ') && !expanded && !event.defaultPrevented) {
|
|
264
278
|
event.preventDefault();
|
|
265
279
|
handleExpand();
|
|
@@ -83,6 +83,9 @@ const valueFieldAttachment = (element) => {
|
|
|
83
83
|
// the actions render OUTSIDE the field instead, as a normal full-width
|
|
84
84
|
// sibling row (the pre-existing layout this redesign started from).
|
|
85
85
|
const hasLabelSnippetAction = $derived(!!actions?.some((action) => !!action.labelSnippet));
|
|
86
|
+
function valueFieldAddon(row) {
|
|
87
|
+
return hasLabelSnippetAction ? {} : { trailing: row, trailingInteractive: true };
|
|
88
|
+
}
|
|
86
89
|
// Track which action is in the "copied" state by its key.
|
|
87
90
|
let copiedKey = $state(null);
|
|
88
91
|
let resetTimer;
|
|
@@ -314,52 +317,29 @@ const resolvedActions = $derived(actions ?? defaultActions);
|
|
|
314
317
|
is present, `Input`'s trailing slot is too narrow for rich content
|
|
315
318
|
(`max-inline-size: 40%`), so the actions render OUTSIDE the field as
|
|
316
319
|
a normal full-width row instead of being clipped inside it. -->
|
|
317
|
-
<!--
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
`
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
320
|
+
<!-- One `Input` call site. `Input` keeps its native element when an addon
|
|
321
|
+
appears or disappears (CIN-500), so moving the actions between the trailing
|
|
322
|
+
addon and the sibling row is a prop update on the same instance, and a parent
|
|
323
|
+
reactively changing `actions` across the `labelSnippet` boundary no longer
|
|
324
|
+
drops the user's focus and selection in the value field. The addon is built by
|
|
325
|
+
`valueFieldAddon`, whose return type is already narrowed to the `InputProps`
|
|
326
|
+
leading/trailing union; a conditional spread written inline would widen
|
|
327
|
+
`trailing` to optional first and fail `exactOptionalPropertyTypes`. -->
|
|
328
|
+
<Input
|
|
329
|
+
id={valueFieldId}
|
|
330
|
+
{value}
|
|
331
|
+
readonly
|
|
332
|
+
variant="code"
|
|
333
|
+
class="cinder-share-card__value"
|
|
334
|
+
title={value}
|
|
335
|
+
aria-label={valueRegionLabel}
|
|
336
|
+
inputAttachment={valueFieldAttachment}
|
|
337
|
+
oncopy={handleFieldCopy}
|
|
338
|
+
onfocus={(event) => event.currentTarget.select()}
|
|
339
|
+
{...valueFieldAddon(actionsRow)}
|
|
340
|
+
/>
|
|
334
341
|
{#if hasLabelSnippetAction}
|
|
335
|
-
<Input
|
|
336
|
-
id={valueFieldId}
|
|
337
|
-
{value}
|
|
338
|
-
readonly
|
|
339
|
-
variant="code"
|
|
340
|
-
class="cinder-share-card__value"
|
|
341
|
-
title={value}
|
|
342
|
-
aria-label={valueRegionLabel}
|
|
343
|
-
inputAttachment={valueFieldAttachment}
|
|
344
|
-
oncopy={handleFieldCopy}
|
|
345
|
-
onfocus={(event) => event.currentTarget.select()}
|
|
346
|
-
/>
|
|
347
342
|
{@render actionsRow()}
|
|
348
|
-
{:else}
|
|
349
|
-
<Input
|
|
350
|
-
id={valueFieldId}
|
|
351
|
-
{value}
|
|
352
|
-
readonly
|
|
353
|
-
variant="code"
|
|
354
|
-
class="cinder-share-card__value"
|
|
355
|
-
title={value}
|
|
356
|
-
aria-label={valueRegionLabel}
|
|
357
|
-
inputAttachment={valueFieldAttachment}
|
|
358
|
-
oncopy={handleFieldCopy}
|
|
359
|
-
onfocus={(event) => event.currentTarget.select()}
|
|
360
|
-
trailing={actionsRow}
|
|
361
|
-
trailingInteractive
|
|
362
|
-
/>
|
|
363
343
|
{/if}
|
|
364
344
|
</div>
|
|
365
345
|
|
|
@@ -5,6 +5,7 @@ export {};
|
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { untrack } from 'svelte';
|
|
7
7
|
import { createAnchoredOverlay } from '../../_internal/anchored-overlay.svelte.ts';
|
|
8
|
+
import { pushEscapeHandler } from '../../_internal/overlay.ts';
|
|
8
9
|
import { classNames } from '../../utilities/class-names.ts';
|
|
9
10
|
import { handleRovingKeydown } from '../../utilities/roving-tabindex.ts';
|
|
10
11
|
import { useReducedMotion } from '../../utilities/use-reduced-motion.svelte.ts';
|
|
@@ -209,12 +210,29 @@ function handleTriggerKeydown(event) {
|
|
|
209
210
|
open = true;
|
|
210
211
|
queueMicrotask(() => getEnabledActionButtons()[0]?.focus());
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
// Escape ownership (CIN-428). The local Escape branch (previously here,
|
|
214
|
+
// only reachable while focus was inside the portalled actions panel) is
|
|
215
|
+
// deleted — the escape-stack registration below is the single Escape
|
|
216
|
+
// dispatch path, firing whenever the speed dial is open regardless of
|
|
217
|
+
// focus location.
|
|
218
|
+
function dismissSpeedDial(event) {
|
|
219
|
+
event?.preventDefault();
|
|
220
|
+
event?.stopPropagation();
|
|
221
|
+
close({ focusTrigger: true });
|
|
222
|
+
}
|
|
223
|
+
$effect(() => {
|
|
224
|
+
// A consumer can set `hidden` on an already-open dial (or supply
|
|
225
|
+
// `open={true}` together with `hidden={true}`): the control and its
|
|
226
|
+
// actions go `aria-hidden`/`inert` but `open` itself doesn't flip. Gate
|
|
227
|
+
// on `!hidden` too, consistent with the other `hidden`-gated effects
|
|
228
|
+
// above, so this invisible dial doesn't sit on top of the escape stack
|
|
229
|
+
// and swallow Escape meant for whatever overlay is actually visible.
|
|
230
|
+
if (!open || hidden)
|
|
216
231
|
return;
|
|
217
|
-
|
|
232
|
+
const releaseEscape = pushEscapeHandler(dismissSpeedDial);
|
|
233
|
+
return releaseEscape;
|
|
234
|
+
});
|
|
235
|
+
function handleActionsKeydown(event) {
|
|
218
236
|
const target = event.target instanceof HTMLButtonElement ? event.target : null;
|
|
219
237
|
if (!target)
|
|
220
238
|
return;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
2
|
@layer cinder.components {
|
|
3
3
|
.cinder-statistic {
|
|
4
|
-
--cinder-statistic-row-gap: var(--cinder-space-1, 0.25rem);
|
|
5
|
-
--cinder-statistic-column-gap: var(--cinder-space-3, 0.75rem);
|
|
6
|
-
--cinder-statistic-label-font-size: var(--cinder-text-sm);
|
|
7
|
-
--cinder-statistic-value-font-size: var(--cinder-text-4xl);
|
|
8
|
-
--cinder-statistic-value-font-weight: var(--cinder-font-semibold);
|
|
9
|
-
--cinder-statistic-value-line-height: 1.1;
|
|
10
|
-
--cinder-statistic-change-gap: var(--cinder-space-1, 0.25rem);
|
|
11
|
-
--cinder-statistic-change-font-size: var(--cinder-text-sm);
|
|
12
4
|
display: grid;
|
|
13
5
|
grid-template-columns: 1fr;
|
|
14
6
|
grid-template-rows: auto auto auto;
|