@lostgradient/cinder 0.20.0 → 0.21.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 +162 -0
- package/components.json +1 -1
- package/dist/components/alert-dialog/index.js +481 -162
- package/dist/components/approval-card/approval-card.css +3 -0
- package/dist/components/approval-card/index.js +402 -119
- package/dist/components/area-chart/index.js +252 -1
- package/dist/components/autocomplete/index.js +124 -40
- package/dist/components/avatar-group/index.js +185 -81
- package/dist/components/bar-chart/index.js +252 -1
- package/dist/components/button/button.css +13 -3
- package/dist/components/calendar/calendar.css +3 -0
- package/dist/components/carousel/carousel.css +40 -6
- package/dist/components/carousel/carousel.schema.js +43 -2
- package/dist/components/carousel/carousel.svelte.d.ts +25 -4
- package/dist/components/carousel/carousel.types.d.ts +43 -2
- package/dist/components/carousel/carousel.variables.js +7 -2
- package/dist/components/carousel/index.d.ts +1 -1
- package/dist/components/carousel/index.js +2018 -351
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/components/chip/chip.css +3 -0
- package/dist/components/code-block/code-block.css +35 -2
- package/dist/components/code-block/code-block.schema.js +9 -1
- package/dist/components/code-block/code-block.types.d.ts +8 -0
- package/dist/components/code-block/index.js +263 -4
- package/dist/components/color-field/color-field.css +1 -1
- package/dist/components/color-picker/color-picker.css +1 -1
- package/dist/components/combobox/combobox.css +4 -1
- package/dist/components/combobox/index.js +124 -40
- package/dist/components/command-menu/index.js +20 -17
- package/dist/components/confirm-dialog/index.js +497 -178
- package/dist/components/connection-indicator/connection-indicator.css +3 -2
- package/dist/components/context-menu/index.js +124 -40
- package/dist/components/copy-button/copy-button.css +4 -1
- package/dist/components/data-grid/data-grid.css +3 -0
- package/dist/components/data-table/index.js +252 -1
- package/dist/components/date-picker/date-picker.css +1 -1
- package/dist/components/date-picker/index.js +124 -40
- package/dist/components/date-range-field/date-range-field.css +7 -1
- package/dist/components/date-range-field/index.js +124 -40
- package/dist/components/diff-statistics/diff-statistics.css +2 -2
- package/dist/components/drawer/drawer.css +20 -12
- package/dist/components/drawer/index.js +106 -25
- package/dist/components/dropdown/dropdown.css +1 -1
- package/dist/components/dropdown/index.js +124 -40
- package/dist/components/dropdown-menu/index.js +20 -17
- package/dist/components/event-stream-viewer/event-stream-viewer.css +29 -4
- package/dist/components/event-stream-viewer/event-stream-viewer.variables.js +5 -2
- package/dist/components/event-timeline/event-timeline.css +3 -0
- package/dist/components/event-timeline/index.js +124 -40
- package/dist/components/focus-trap/index.js +105 -24
- package/dist/components/form-field/form-field.css +1 -1
- package/dist/components/hover-card/hover-card.css +45 -1
- package/dist/components/hover-card/index.js +144 -19
- package/dist/components/inline-loading/inline-loading.css +2 -2
- package/dist/components/input/input.css +1 -1
- package/dist/components/invocation-rule-builder/index.js +124 -40
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +18 -0
- package/dist/components/json-editor/json-editor.css +4 -1
- package/dist/components/json-schema-editor/index.js +152 -68
- package/dist/components/json-viewer/json-viewer.css +5 -2
- package/dist/components/kanban-board/index.js +2 -2
- package/dist/components/kanban-board/kanban-board.css +1 -1
- package/dist/components/line-chart/index.js +252 -1
- package/dist/components/marquee/marquee.css +3 -0
- package/dist/components/matrix-chart/index.js +252 -1
- package/dist/components/menu-bar/index.js +20 -17
- package/dist/components/menu-bar/menu-bar.css +3 -0
- package/dist/components/meter/index.js +13 -3
- package/dist/components/modal/index.js +447 -130
- package/dist/components/modal/modal.css +56 -24
- package/dist/components/multi-select/index.js +3553 -467
- package/dist/components/multi-select/multi-select.css +4 -10
- package/dist/components/navigation-bar/index.js +20 -17
- package/dist/components/navigation-item/navigation-item.css +3 -0
- package/dist/components/pagination/pagination.css +3 -0
- package/dist/components/permission-matrix/index.js +252 -1
- package/dist/components/permission-matrix/permission-matrix.css +15 -0
- package/dist/components/phone-input/phone-input.css +1 -1
- package/dist/components/pin-input/pin-input.css +10 -2
- package/dist/components/popover/index.js +124 -40
- package/dist/components/qr-code/qr-code.css +1 -1
- package/dist/components/radio-group/radio-group.css +1 -1
- package/dist/components/rating/rating.css +1 -1
- package/dist/components/schema-form/schema-form.css +1 -1
- package/dist/components/scroll-area/index.js +526 -22
- package/dist/components/scroll-area/scroll-area.css +30 -0
- package/dist/components/scroll-area/scroll-area.schema.js +9 -1
- package/dist/components/scroll-area/scroll-area.types.d.ts +17 -0
- package/dist/components/secret-value-field/secret-value-field.css +11 -1
- package/dist/components/segmented-control/segmented-control.css +12 -2
- package/dist/components/select/select.css +4 -1
- package/dist/components/selection-popover/index.js +149 -40
- package/dist/components/selection-popover/selection-popover.css +3 -0
- package/dist/components/selection-popover/virtual-keyboard-dismissal.svelte.d.ts +14 -0
- package/dist/components/sheet/index.js +106 -25
- package/dist/components/sheet/sheet.css +20 -12
- package/dist/components/sidebar/index.js +106 -25
- package/dist/components/sortable-list/index.js +2 -2
- package/dist/components/sortable-list/sortable-list.css +14 -9
- package/dist/components/speed-dial/index.js +20 -17
- package/dist/components/statistic/statistic.css +2 -2
- package/dist/components/statistic-group/statistic-group.css +2 -2
- package/dist/components/status-dot/status-dot.css +2 -2
- package/dist/components/table/index.js +252 -1
- package/dist/components/table/table.css +15 -0
- package/dist/components/tag-input/tag-input.css +1 -1
- package/dist/components/team-section/index.js +193 -89
- package/dist/components/textarea/textarea.css +4 -1
- package/dist/components/time-field/time-field.css +4 -1
- package/dist/components/tooltip/index.js +130 -46
- package/dist/components/tooltip/tooltip.schema.js +7 -3
- package/dist/components/tooltip/tooltip.types.d.ts +20 -2
- package/dist/components/transfer-list/index.js +253 -1
- package/dist/components/transfer-list/transfer-list.css +18 -0
- package/dist/index.js +22861 -22220
- package/dist/server/components/alert-dialog/index.js +7 -4
- package/dist/server/components/approval-card/index.js +9 -8
- package/dist/server/components/area-chart/index.js +6 -4
- package/dist/server/components/autocomplete/index.js +7 -7
- package/dist/server/components/avatar-group/index.js +7 -7
- package/dist/server/components/bar-chart/index.js +6 -4
- package/dist/server/components/carousel/index.js +6 -2
- package/dist/server/components/code-block/index.js +5 -3
- package/dist/server/components/combobox/index.js +8 -8
- package/dist/server/components/command-menu/index.js +5 -5
- package/dist/server/components/confirm-dialog/index.js +7 -4
- package/dist/server/components/context-menu/index.js +7 -7
- package/dist/server/components/data-table/index.js +5 -3
- package/dist/server/components/date-picker/index.js +8 -8
- package/dist/server/components/date-range-field/index.js +8 -8
- package/dist/server/components/drawer/index.js +4 -4
- package/dist/server/components/dropdown/index.js +7 -7
- package/dist/server/components/dropdown-menu/index.js +6 -6
- package/dist/server/components/event-timeline/index.js +6 -6
- package/dist/server/components/focus-trap/index.js +3 -3
- package/dist/server/components/hover-card/index.js +7 -6
- package/dist/server/components/invocation-rule-builder/index.js +8 -8
- package/dist/server/components/json-schema-editor/index.js +6 -6
- package/dist/server/components/kanban-board/index.js +2 -2
- package/dist/server/components/line-chart/index.js +6 -4
- package/dist/server/components/matrix-chart/index.js +6 -4
- package/dist/server/components/menu-bar/index.js +6 -6
- package/dist/server/components/meter/index.js +1 -1
- package/dist/server/components/modal/index.js +7 -4
- package/dist/server/components/multi-select/index.js +9 -2
- package/dist/server/components/navigation-bar/index.js +5 -5
- package/dist/server/components/permission-matrix/index.js +4 -2
- package/dist/server/components/popover/index.js +7 -7
- package/dist/server/components/portal/index.js +3 -3
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/scroll-area/index.js +8 -2
- package/dist/server/components/selection-popover/index.js +6 -6
- package/dist/server/components/sheet/index.js +3 -3
- package/dist/server/components/sidebar/index.js +5 -5
- package/dist/server/components/sortable-list/index.js +2 -2
- package/dist/server/components/speed-dial/index.js +6 -6
- package/dist/server/components/speed-dial-action/index.js +4 -4
- package/dist/server/components/table/index.js +5 -3
- package/dist/server/components/team-section/index.js +7 -7
- package/dist/server/components/toast-region/index.js +3 -3
- package/dist/server/components/tooltip/index.js +6 -6
- package/dist/server/components/transfer-list/index.js +4 -2
- package/dist/server/index.js +69 -68
- package/dist/server/{index.server-dvd8t7ds.js → index.server-01bz4wmw.js} +1 -1
- package/dist/server/{index.server-gbj2zt1q.js → index.server-03ndc3td.js} +1 -1
- package/dist/server/{index.server-1qr1qkjb.js → index.server-0p1z1kbs.js} +1 -1
- package/dist/server/{index.server-b36zkjsr.js → index.server-1cnz5ax1.js} +30 -6
- package/dist/server/{index.server-xtx9sey2.js → index.server-2bw5fqwh.js} +1 -1
- package/dist/server/{index.server-v3t6v21s.js → index.server-2eb8pcev.js} +1 -1
- package/dist/server/{index.server-2n185esx.js → index.server-2h45p8kd.js} +2 -2
- package/dist/server/{index.server-3gm8s994.js → index.server-2k0cnsm4.js} +30 -2
- package/dist/server/{index.server-jwrnsnxk.js → index.server-2qydtmtp.js} +1 -1
- package/dist/server/{index.server-4bdnshs1.js → index.server-3e8n2sry.js} +2 -2
- package/dist/server/{index.server-dpyw7nad.js → index.server-4sr9f5r0.js} +1 -1
- package/dist/server/{index.server-rxvbt0y3.js → index.server-4w0rydct.js} +1 -1
- package/dist/server/{index.server-znrr9zve.js → index.server-6184qc69.js} +1 -1
- package/dist/server/{index.server-mw3z3nfz.js → index.server-64dvhh7s.js} +8 -2
- package/dist/server/{index.server-w9tnnse5.js → index.server-6771g0q4.js} +4 -4
- package/dist/server/{index.server-jxy33axv.js → index.server-6e5cj9hs.js} +1 -1
- package/dist/server/{index.server-gp0jh4cx.js → index.server-6z6s8qz8.js} +1 -1
- package/dist/server/{index.server-jj0tkfqp.js → index.server-72d0qgdy.js} +3 -3
- package/dist/server/{index.server-x93qnzqm.js → index.server-77p0jy71.js} +1 -1
- package/dist/server/{index.server-cepvcyxn.js → index.server-7kez94sz.js} +17 -6
- package/dist/server/{index.server-rd908evp.js → index.server-7sxx7645.js} +2 -2
- package/dist/server/{index.server-1br18a82.js → index.server-8t53gqe7.js} +3 -3
- package/dist/server/{index.server-jnp8yqgj.js → index.server-8w95jmf1.js} +1 -1
- package/dist/server/{index.server-g8j7wnpa.js → index.server-9emgn750.js} +1 -1
- package/dist/server/{index.server-zt8d7yer.js → index.server-9n2bc545.js} +1 -1
- package/dist/server/{index.server-bprjmaxb.js → index.server-a5w1wy5w.js} +1 -1
- package/dist/server/{index.server-t6dkkfxk.js → index.server-a5zsgn3k.js} +1 -1
- package/dist/server/{index.server-nsqx19rk.js → index.server-a8gpnzgg.js} +6 -6
- package/dist/server/{index.server-edx404az.js → index.server-ayhcc6z5.js} +1 -1
- package/dist/server/{index.server-z53avp9h.js → index.server-b7pq5xpd.js} +1 -1
- package/dist/server/{index.server-aerjcjgw.js → index.server-cptwpqbr.js} +1 -1
- package/dist/server/{index.server-85dr75be.js → index.server-d70brw24.js} +1 -1
- package/dist/server/{index.server-wsbwydct.js → index.server-fd3az8g2.js} +3 -3
- package/dist/server/{index.server-429t1qje.js → index.server-fka21791.js} +2 -2
- package/dist/server/{index.server-vb58jd7c.js → index.server-grq89cv5.js} +1 -1
- package/dist/server/{index.server-74g52t91.js → index.server-hxjkfdp2.js} +1 -1
- package/dist/server/{index.server-r5y5t888.js → index.server-j4akck2w.js} +1 -1
- package/dist/server/{index.server-sqtgjjc3.js → index.server-j57zek3p.js} +1 -1
- package/dist/server/index.server-ja3fmd29.js +211 -0
- package/dist/server/{index.server-66amt15s.js → index.server-kszs0qx5.js} +25 -2
- package/dist/server/{index.server-f02vwrw5.js → index.server-nbq0tmx1.js} +26 -16
- package/dist/server/{index.server-ktwnf9vg.js → index.server-nbspp00m.js} +1 -1
- package/dist/server/{index.server-xanhe43k.js → index.server-pee1wa4g.js} +1 -1
- package/dist/server/{index.server-dqt9we67.js → index.server-q7r53g7z.js} +1 -1
- package/dist/server/{index.server-1xq7j9dj.js → index.server-scdk1we9.js} +6 -6
- package/dist/server/{index.server-rgcepyhr.js → index.server-sfbna82r.js} +1 -1
- package/dist/server/{index.server-dpe08kr7.js → index.server-sgjc9gkq.js} +1 -1
- package/dist/server/{index.server-wm3t5yw7.js → index.server-sxkkaj8b.js} +13 -3
- package/dist/server/{index.server-r147w5z4.js → index.server-td8rx9dz.js} +1 -1
- package/dist/server/{index.server-3g76h7z7.js → index.server-th1tsad4.js} +62 -26
- package/dist/server/{index.server-ak9pqjfw.js → index.server-tpny5pjk.js} +224 -91
- package/dist/server/{index.server-8wb8g3w1.js → index.server-tvj0x3qy.js} +1 -1
- package/dist/server/{index.server-vqb9m9hq.js → index.server-w2jwyz17.js} +2 -2
- package/dist/server/{index.server-29sg0ywf.js → index.server-w5f4ex0f.js} +9 -6
- package/dist/server/{index.server-5p5r6t6n.js → index.server-w8phxx00.js} +1 -1
- package/dist/server/{index.server-tj2erfba.js → index.server-x6hbm4je.js} +2 -2
- package/dist/server/{index.server-7r9d6g1c.js → index.server-xqbes4jd.js} +6 -6
- package/dist/server/{index.server-j15z5xn7.js → index.server-xsh52hjt.js} +1 -1
- package/dist/server/{index.server-k1625sfw.js → index.server-y8m06g9p.js} +1 -1
- package/dist/server/{index.server-32p6dz3e.js → index.server-ybb5ery2.js} +1 -1
- package/dist/server/{index.server-1p7b8y48.js → index.server-yhjecwfj.js} +6 -6
- package/dist/server/{index.server-4nh4arvs.js → index.server-zfxb12hm.js} +30 -48
- package/dist/utilities/attachments.d.ts +63 -1
- package/dist/utilities/drag-scroll-physics.d.ts +48 -0
- package/dist/utilities/use-drag-scroll.svelte.d.ts +26 -0
- package/dist/utilities/use-drag-scroll.types.d.ts +15 -0
- package/dist/utilities/use-fine-pointer.svelte.d.ts +12 -0
- package/dist/utilities/use-fine-pointer.types.d.ts +4 -0
- package/package.json +2 -2
- package/src/_internal/anchored-overlay.svelte.ts +48 -26
- package/src/components/_sortable-item.svelte +21 -2
- package/src/components/approval-card/approval-card.css +3 -0
- package/src/components/avatar-group/avatar-group.svelte +46 -17
- package/src/components/button/button.css +13 -3
- package/src/components/calendar/calendar.css +3 -0
- package/src/components/carousel/carousel.css +40 -6
- package/src/components/carousel/carousel.examples.json +6 -0
- package/src/components/carousel/carousel.schema.json +42 -1
- package/src/components/carousel/carousel.schema.ts +49 -1
- package/src/components/carousel/carousel.svelte +311 -136
- package/src/components/carousel/carousel.types.ts +47 -2
- package/src/components/carousel/carousel.variables.json +6 -1
- package/src/components/carousel/carousel.variables.ts +6 -1
- package/src/components/carousel/index.ts +1 -0
- package/src/components/checkbox/checkbox.css +1 -1
- package/src/components/checkbox-group/checkbox-group.css +1 -1
- package/src/components/chip/chip.css +3 -0
- package/src/components/code-block/code-block.css +35 -2
- package/src/components/code-block/code-block.schema.json +4 -0
- package/src/components/code-block/code-block.schema.ts +5 -0
- package/src/components/code-block/code-block.svelte +12 -2
- package/src/components/code-block/code-block.types.ts +8 -0
- package/src/components/color-field/color-field.css +1 -1
- package/src/components/color-picker/color-picker.css +1 -1
- package/src/components/combobox/combobox.css +4 -1
- package/src/components/connection-indicator/connection-indicator.css +3 -2
- package/src/components/copy-button/copy-button.css +4 -1
- package/src/components/data-grid/data-grid.css +3 -0
- package/src/components/date-picker/date-picker.css +1 -1
- package/src/components/date-range-field/date-range-field.css +7 -1
- package/src/components/diff-statistics/diff-statistics.css +2 -2
- package/src/components/drawer/drawer.css +20 -12
- package/src/components/drawer/drawer.svelte +5 -1
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/event-stream-viewer/event-stream-viewer.css +29 -4
- package/src/components/event-stream-viewer/event-stream-viewer.variables.json +1 -1
- package/src/components/event-stream-viewer/event-stream-viewer.variables.ts +4 -1
- package/src/components/event-timeline/event-timeline.css +3 -0
- package/src/components/form-field/form-field.css +1 -1
- package/src/components/hover-card/hover-card.css +45 -1
- package/src/components/hover-card/hover-card.svelte +64 -2
- package/src/components/inline-loading/inline-loading.css +2 -2
- package/src/components/input/input.css +1 -1
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +18 -0
- package/src/components/json-editor/json-editor.css +4 -1
- package/src/components/json-viewer/json-viewer.css +5 -2
- package/src/components/kanban-board/kanban-board.css +1 -1
- package/src/components/marquee/marquee.css +3 -0
- package/src/components/menu-bar/menu-bar.css +3 -0
- package/src/components/meter/meter.svelte +19 -4
- package/src/components/meter/meter.types.ts +4 -0
- package/src/components/modal/modal.css +56 -24
- package/src/components/modal/modal.svelte +59 -99
- package/src/components/multi-select/multi-select.css +4 -10
- package/src/components/multi-select/multi-select.svelte +43 -0
- package/src/components/navigation-item/navigation-item.css +3 -0
- package/src/components/pagination/pagination.css +3 -0
- package/src/components/permission-matrix/permission-matrix.css +15 -0
- package/src/components/permission-matrix/permission-matrix.svelte +6 -1
- package/src/components/phone-input/phone-input.css +1 -1
- package/src/components/pin-input/pin-input.css +10 -2
- package/src/components/qr-code/qr-code.css +1 -1
- package/src/components/radio-group/radio-group.css +1 -1
- package/src/components/rating/rating.css +1 -1
- package/src/components/schema-form/schema-form.css +1 -1
- package/src/components/scroll-area/scroll-area.css +30 -0
- package/src/components/scroll-area/scroll-area.schema.json +8 -0
- package/src/components/scroll-area/scroll-area.schema.ts +10 -0
- package/src/components/scroll-area/scroll-area.svelte +44 -2
- package/src/components/scroll-area/scroll-area.types.ts +17 -0
- package/src/components/secret-value-field/secret-value-field.css +11 -1
- package/src/components/segmented-control/segmented-control.css +12 -2
- package/src/components/select/select.css +4 -1
- package/src/components/selection-popover/selection-popover.css +3 -0
- package/src/components/selection-popover/selection-popover.svelte +32 -0
- package/src/components/selection-popover/virtual-keyboard-dismissal.svelte.ts +16 -0
- package/src/components/sheet/sheet.css +20 -12
- package/src/components/sheet/sheet.svelte +1 -1
- package/src/components/sortable-list/sortable-list.css +14 -9
- package/src/components/statistic/statistic.css +2 -2
- package/src/components/statistic-group/statistic-group.css +2 -2
- package/src/components/status-dot/status-dot.css +2 -2
- package/src/components/table/table.css +15 -0
- package/src/components/table/table.svelte +2 -0
- package/src/components/tag-input/tag-input.css +1 -1
- package/src/components/textarea/textarea.css +4 -1
- package/src/components/time-field/time-field.css +4 -1
- package/src/components/tooltip/tooltip.schema.json +6 -2
- package/src/components/tooltip/tooltip.schema.ts +8 -2
- package/src/components/tooltip/tooltip.svelte +124 -23
- package/src/components/tooltip/tooltip.types.ts +20 -2
- package/src/components/transfer-list/transfer-list.css +18 -0
- package/src/components/transfer-list/transfer-list.svelte +3 -0
- package/src/styles/components/_control-item.css +3 -0
- package/src/styles/components/_field-label.css +1 -1
- package/src/styles/components/_input-frame.css +3 -0
- package/src/styles/components/_scroll-fade.css +317 -0
- package/src/styles/components/_status-surface.css +21 -1
- package/src/styles/components.css +5 -0
- package/src/styles/index.css +1 -0
- package/src/styles/tokens-base.css +207 -69
- package/src/styles/utilities.css +10 -1
- package/src/utilities/attachments.ts +202 -26
- package/src/utilities/drag-scroll-physics.ts +82 -0
- package/src/utilities/use-drag-scroll.svelte.ts +186 -0
- package/src/utilities/use-drag-scroll.types.ts +17 -0
- package/src/utilities/use-fine-pointer.svelte.ts +23 -0
- package/src/utilities/use-fine-pointer.types.ts +4 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createClickOutside
|
|
3
|
-
} from "./index.server-3g76h7z7.js";
|
|
4
1
|
import {
|
|
5
2
|
createAnchoredOverlay
|
|
6
|
-
} from "./index.server-
|
|
3
|
+
} from "./index.server-grq89cv5.js";
|
|
7
4
|
import {
|
|
8
5
|
createInheritedPortalStyle,
|
|
9
6
|
createPortalAttachment,
|
|
10
7
|
findNearestOpenTopLayer
|
|
11
|
-
} from "./index.server-
|
|
8
|
+
} from "./index.server-6771g0q4.js";
|
|
9
|
+
import {
|
|
10
|
+
createClickOutside
|
|
11
|
+
} from "./index.server-th1tsad4.js";
|
|
12
12
|
import {
|
|
13
13
|
classNames
|
|
14
14
|
} from "./index.server-z7nvkz8v.js";
|
|
@@ -158,4 +158,4 @@ function Popover($$renderer, $$props) {
|
|
|
158
158
|
|
|
159
159
|
export { Popover };
|
|
160
160
|
|
|
161
|
-
//# debugId=
|
|
161
|
+
//# debugId=B45C8BAEC112B62564756E2164756E21
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./index.server-
|
|
2
|
+
createSlidingDialogState
|
|
3
|
+
} from "./index.server-1g3bqz6w.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./index.server-
|
|
5
|
+
overflowFade
|
|
6
|
+
} from "./index.server-th1tsad4.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "./index.server-mc6vc1pm.js";
|
|
8
|
+
useReducedMotion
|
|
9
|
+
} from "./index.server-8hdvr9bt.js";
|
|
11
10
|
import {
|
|
12
11
|
classNames
|
|
13
12
|
} from "./index.server-z7nvkz8v.js";
|
|
@@ -33,51 +32,33 @@ function Modal($$renderer, $$props) {
|
|
|
33
32
|
onDismiss
|
|
34
33
|
} = $$props;
|
|
35
34
|
let dialogElement = undefined;
|
|
35
|
+
let panelElement = undefined;
|
|
36
36
|
let bodyElement = undefined;
|
|
37
37
|
let mounted = false;
|
|
38
|
-
|
|
39
|
-
let releaseBodyScrollLock = null;
|
|
40
|
-
let releaseEscapeHandler = null;
|
|
41
|
-
function acquireLock() {
|
|
42
|
-
if (releaseBodyScrollLock !== null)
|
|
43
|
-
return;
|
|
44
|
-
releaseBodyScrollLock = lockBodyScroll();
|
|
45
|
-
}
|
|
46
|
-
function releaseLock() {
|
|
47
|
-
releaseBodyScrollLock?.();
|
|
48
|
-
releaseBodyScrollLock = null;
|
|
49
|
-
}
|
|
50
|
-
function acquireEscapeHandler() {
|
|
51
|
-
if (releaseEscapeHandler !== null)
|
|
52
|
-
return;
|
|
53
|
-
releaseEscapeHandler = pushEscapeHandler(() => {});
|
|
54
|
-
}
|
|
55
|
-
function releaseEscape() {
|
|
56
|
-
releaseEscapeHandler?.();
|
|
57
|
-
releaseEscapeHandler = null;
|
|
58
|
-
}
|
|
38
|
+
const reducedMotion = useReducedMotion();
|
|
59
39
|
const bodyOverflowFade = overflowFade();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
const dialogState = createSlidingDialogState({
|
|
41
|
+
getOpen: () => open,
|
|
42
|
+
setOpen: (nextOpen) => {
|
|
43
|
+
open = nextOpen;
|
|
44
|
+
},
|
|
45
|
+
getDialogElement: () => dialogElement,
|
|
46
|
+
getPanelElement: () => panelElement,
|
|
47
|
+
getReducedMotion: () => reducedMotion.current,
|
|
48
|
+
getTriggerRef: () => triggerRef,
|
|
49
|
+
onOpen: () => {
|
|
50
|
+
const hasExplicitAutofocus = dialogElement?.querySelector("[autofocus]") !== null || Array.from(dialogElement?.querySelectorAll("*") ?? []).some((el) => el.autofocus === true);
|
|
51
|
+
if (!hasExplicitAutofocus && bodyElement) {
|
|
52
|
+
bodyElement.focus();
|
|
53
|
+
}
|
|
65
54
|
}
|
|
66
|
-
|
|
67
|
-
}
|
|
55
|
+
});
|
|
68
56
|
function dismiss() {
|
|
69
|
-
|
|
57
|
+
dialogState.requestClose();
|
|
70
58
|
onDismiss?.();
|
|
71
59
|
}
|
|
72
|
-
function handleClose() {
|
|
73
|
-
open = false;
|
|
74
|
-
releaseLock();
|
|
75
|
-
releaseEscape();
|
|
76
|
-
returnFocus();
|
|
77
|
-
}
|
|
78
60
|
onDestroy(() => {
|
|
79
|
-
|
|
80
|
-
releaseEscape();
|
|
61
|
+
dialogState.destroy();
|
|
81
62
|
});
|
|
82
63
|
function handleBackdropClick(event) {
|
|
83
64
|
if (dismissOnBackdropClick && event.target === dialogElement) {
|
|
@@ -97,11 +78,12 @@ function Modal($$renderer, $$props) {
|
|
|
97
78
|
role,
|
|
98
79
|
"aria-modal": "true",
|
|
99
80
|
"aria-labelledby": titleId,
|
|
100
|
-
...describedById ? { "aria-describedby": describedById } : {}
|
|
81
|
+
...describedById ? { "aria-describedby": describedById } : {},
|
|
82
|
+
"data-cinder-closing": dialogState.isClosing ? "" : undefined
|
|
101
83
|
})}>`);
|
|
102
|
-
if (
|
|
84
|
+
if (dialogState.renderPanel) {
|
|
103
85
|
$$renderer2.push("<!--[0-->");
|
|
104
|
-
$$renderer2.push(`<div class="cinder-modal__panel"><div class="cinder-modal__header"><h2${$.attr("id", titleId)} class="cinder-modal__title">${$.escape(title)}</h2></div> <div class="cinder-modal__body" tabindex="-1">`);
|
|
86
|
+
$$renderer2.push(`<div class="cinder-modal__panel"${$.attr("data-cinder-closing", dialogState.isClosing ? "" : undefined)}${$.attr("inert", dialogState.isClosing, true)}><div class="cinder-modal__header"><h2${$.attr("id", titleId)} class="cinder-modal__title">${$.escape(title)}</h2></div> <div class="cinder-modal__body cinder-_scroll-fade" tabindex="-1">`);
|
|
105
87
|
children($$renderer2);
|
|
106
88
|
$$renderer2.push(`<!----></div> `);
|
|
107
89
|
if (footer) {
|
|
@@ -134,4 +116,4 @@ function Modal($$renderer, $$props) {
|
|
|
134
116
|
|
|
135
117
|
export { Modal };
|
|
136
118
|
|
|
137
|
-
//# debugId=
|
|
119
|
+
//# debugId=6352127081B5560564756E2164756E21
|
|
@@ -67,6 +67,68 @@ export type ClickOutsideOptions = {
|
|
|
67
67
|
export declare function createClickOutside(options: ClickOutsideOptions): Attachment<HTMLElement>;
|
|
68
68
|
/**
|
|
69
69
|
* Marks scroll containers that have more content below the visible area.
|
|
70
|
-
* Intended for overlay bodies that show a bottom
|
|
70
|
+
* Intended for overlay bodies that show a bottom fade (opaque overlay, never
|
|
71
|
+
* a mask — see `_scroll-fade.css`) while scrollable.
|
|
72
|
+
*
|
|
73
|
+
* Only `node` itself is observed with `ResizeObserver` — it catches the
|
|
74
|
+
* container's own box changing (viewport resize, a sidebar collapsing, a
|
|
75
|
+
* layout pass). Because `node` scrolls (`overflow-y: auto` with a fixed/flex
|
|
76
|
+
* height), content growing or shrinking INSIDE it does not resize `node`'s
|
|
77
|
+
* own box, so that case is covered separately by a `MutationObserver` that
|
|
78
|
+
* schedules a re-measure directly on any child/text/relevant-attribute
|
|
79
|
+
* change. Re-measuring `scrollHeight`/`clientHeight` is a cheap property
|
|
80
|
+
* read, so the mutation callback does not need an observer of its own.
|
|
81
|
+
*
|
|
82
|
+
* This replaces an earlier version that additionally registered a
|
|
83
|
+
* `ResizeObserver` on every descendant (`node.querySelectorAll('*')`,
|
|
84
|
+
* re-synced on every mutation) to catch a size change that occurs without a
|
|
85
|
+
* DOM mutation. That is fine for a handful of nodes in a Modal body, but
|
|
86
|
+
* registers thousands of observers on a long scroll surface such as a chat
|
|
87
|
+
* timeline. Dropping that exhaustive case for a large, real perf win is a
|
|
88
|
+
* deliberate trade-off — the common version of it, an `<img src>` swap (a
|
|
89
|
+
* lazy-load library resolving an attachment thumbnail, for example), IS
|
|
90
|
+
* still covered: `src` is in the `attributeFilter` below, so it schedules a
|
|
91
|
+
* re-measure like any other tracked mutation. What remains uncovered is
|
|
92
|
+
* narrower — a genuinely mutation-less size change, such as a `<canvas>`
|
|
93
|
+
* redraw or a webfont finishing load and reflowing existing text — which is
|
|
94
|
+
* rare enough that every path this attachment is actually exercised through
|
|
95
|
+
* (content added/removed, text/attribute changes, scrolling, container
|
|
96
|
+
* resize) is still covered.
|
|
71
97
|
*/
|
|
72
98
|
export declare function overflowFade(): Attachment<HTMLElement>;
|
|
99
|
+
/** Which scroll axis {@link overflowShadow} measures and reports. */
|
|
100
|
+
export type OverflowShadowAxis = 'inline' | 'block';
|
|
101
|
+
/**
|
|
102
|
+
* Marks scroll containers that have MORE content than fits on the given
|
|
103
|
+
* axis, in EITHER direction — unlike {@link overflowFade}, this is not
|
|
104
|
+
* scroll-position-aware (no `scroll` listener, no "am I at the end"
|
|
105
|
+
* suppression). It backs the data-grid `--_cinder-data-grid-overflow-shadow`
|
|
106
|
+
* inset-shadow affordance (see `data-grid.css`), which paints BOTH edges
|
|
107
|
+
* whenever content overflows, regardless of current scroll position — the
|
|
108
|
+
* inset shadow is decoration on the scroll container's own (non-scrolling)
|
|
109
|
+
* box, so it stays pinned at the true edges as content scrolls underneath.
|
|
110
|
+
*
|
|
111
|
+
* `node`'s own box is observed with `ResizeObserver` (container resize), and
|
|
112
|
+
* content changes are caught by a `MutationObserver` that schedules a
|
|
113
|
+
* re-measure directly — the same lean design as `overflowFade`, see its doc
|
|
114
|
+
* comment for the full rationale.
|
|
115
|
+
*/
|
|
116
|
+
export declare function overflowShadow(axis: OverflowShadowAxis): Attachment<HTMLElement>;
|
|
117
|
+
/** Which scroll axis {@link overflowFadeEdges} measures and reports. */
|
|
118
|
+
export type OverflowFadeEdgesAxis = 'block' | 'inline';
|
|
119
|
+
/**
|
|
120
|
+
* Marks a scroll container that has more content on EITHER side of the given
|
|
121
|
+
* axis — the fallback driver for a both-edges `_scroll-fade.css` recipe
|
|
122
|
+
* (`.cinder-_scroll-fade` + `.cinder-_scroll-fade-start` for block, or the
|
|
123
|
+
* `-inline-start`/`-inline-end` pair for inline). Unlike {@link overflowFade}
|
|
124
|
+
* (single, block-end-only edge), this reports each edge independently based
|
|
125
|
+
* on real scroll position: the start edge fades in once scrolled away from
|
|
126
|
+
* the very start, and the end edge fades out once scrolled to the very end —
|
|
127
|
+
* so a container that is fully scrolled to one edge never shows a fade
|
|
128
|
+
* toward content that is not there.
|
|
129
|
+
*
|
|
130
|
+
* Shares the same lean container-ResizeObserver + content-MutationObserver +
|
|
131
|
+
* passive-scroll-listener design as {@link overflowFade}; see its doc
|
|
132
|
+
* comment for the full perf rationale.
|
|
133
|
+
*/
|
|
134
|
+
export declare function overflowFadeEdges(axis: OverflowFadeEdgesAxis): Attachment<HTMLElement>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure inertia/snap math for pointer-drag scrolling (Carousel, ScrollArea).
|
|
3
|
+
* No DOM access — see `use-drag-scroll.svelte.ts` for the attachment that
|
|
4
|
+
* drives a real scroll position with these functions.
|
|
5
|
+
*/
|
|
6
|
+
/** Per-frame velocity decay factor for released momentum. Closer to 1 coasts longer. */
|
|
7
|
+
export declare const DRAG_FRICTION = 0.95;
|
|
8
|
+
/**
|
|
9
|
+
* Damping constant (per second) for smoothing the virtual scroll position
|
|
10
|
+
* toward its target. High enough that the visible position tracks the
|
|
11
|
+
* target closely every frame — this is a responsive follow, not an easing
|
|
12
|
+
* animation; `DRAG_FRICTION` alone supplies the coast/glide feel.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DRAG_DAMPING = 20;
|
|
15
|
+
/** Below this per-frame speed, released momentum reads as fully stopped. */
|
|
16
|
+
export declare const DRAG_SETTLE_VELOCITY_EPSILON = 0.01;
|
|
17
|
+
/**
|
|
18
|
+
* Exponentially smooths `current` toward `target`, scaled by elapsed time so
|
|
19
|
+
* the motion is frame-rate independent.
|
|
20
|
+
*/
|
|
21
|
+
export declare function damp(current: number, target: number, dampingConstant: number, deltaTimeMs: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Predicts the resting position of an object at `current` moving at
|
|
24
|
+
* `velocity`, decaying geometrically at `friction` per frame. `friction`
|
|
25
|
+
* must be in `[0, 1)` — outside that range the projection cannot converge,
|
|
26
|
+
* so `current` is returned unchanged.
|
|
27
|
+
*/
|
|
28
|
+
export declare function project(current: number, velocity: number, friction: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* The inverse of `project`: the initial velocity needed for a `friction`-decaying
|
|
31
|
+
* trajectory to travel exactly `distance` before coming to rest. Used to snap a
|
|
32
|
+
* released drag onto a specific point by feeding the result back through the
|
|
33
|
+
* same damping physics that already governs the coast.
|
|
34
|
+
*/
|
|
35
|
+
export declare function dragSnap(distance: number, friction: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Picks the snap position nearest `position` from `snapPositions`. Returns
|
|
38
|
+
* `null` when `snapPositions` is empty.
|
|
39
|
+
*/
|
|
40
|
+
export declare function snapSelect(position: number, snapPositions: readonly number[]): number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a release at `distance` from the nearest snap point should snap at
|
|
43
|
+
* all. `'mandatory'` always snaps (matches CSS `scroll-snap-type: x mandatory`,
|
|
44
|
+
* the default everywhere this engine attaches). `'proximity'` only snaps
|
|
45
|
+
* within a third of the snapport — far enough from a snap point reads as an
|
|
46
|
+
* intentional stop between slides, not toward one.
|
|
47
|
+
*/
|
|
48
|
+
export declare function shouldSnap(distance: number, snapportSize: number, mode?: 'mandatory' | 'proximity'): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fine-pointer (mouse) drag-to-scroll for a native scroll container along a
|
|
3
|
+
* single axis, in the house attachment style of `useResizeObserver`:
|
|
4
|
+
* `(node) => cleanup`. Owns pointer capture, a rAF-driven momentum ticker,
|
|
5
|
+
* and the `scroll-snap-type` swap that lets the physics run without the
|
|
6
|
+
* browser's native snapping fighting it.
|
|
7
|
+
*
|
|
8
|
+
* Touch and pen are untouched — they already pan the native scroller, and
|
|
9
|
+
* layering this engine under them would double-handle the gesture; a
|
|
10
|
+
* hardware-level `pointerType === 'mouse'` check enforces that. The `enabled`
|
|
11
|
+
* option is the caller's responsibility for everything else this shouldn't
|
|
12
|
+
* run under — a `(hover: hover) and (pointer: fine)` `MediaQuery` (never a
|
|
13
|
+
* bare `matchMedia` call) and `!prefersReducedMotion`, since momentum and
|
|
14
|
+
* rubber-band are exactly the inertial motion that preference is about.
|
|
15
|
+
*
|
|
16
|
+
* Snap points are supplied by the caller (`getSnapPositions`) rather than
|
|
17
|
+
* inferred from DOM shape, so this stays reusable across consumers with
|
|
18
|
+
* different child structures (Carousel's slides, ScrollArea's arbitrary
|
|
19
|
+
* content). Omit it for a non-snapping scroller — momentum still applies,
|
|
20
|
+
* it just coasts to a natural stop instead of snapping.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDragScroll(options?: import('./use-drag-scroll.types.ts').UseDragScrollOptions & {
|
|
23
|
+
/** Which axis to drag-scroll along. Default `'x'`. */
|
|
24
|
+
axis?: 'x' | 'y';
|
|
25
|
+
getSnapPositions?: () => readonly number[];
|
|
26
|
+
}): import('./use-drag-scroll.types.ts').DragScrollAttachment;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Attachment } from 'svelte/attachments';
|
|
2
|
+
export type UseDragScrollOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Getter for whether the drag engine may attach. Defaults to `() => true`.
|
|
5
|
+
* Callers gate this on a fine-pointer media query and
|
|
6
|
+
* `prefers-reduced-motion` — momentum and rubber-band are exactly the
|
|
7
|
+
* inertial motion that preference is about.
|
|
8
|
+
*/
|
|
9
|
+
enabled?: () => boolean;
|
|
10
|
+
/** `'mandatory'` (default) always snaps on release; `'proximity'` only within a third of the snapport. */
|
|
11
|
+
snapMode?: 'mandatory' | 'proximity';
|
|
12
|
+
/** Called once the virtual scroll position settles after a released drag. */
|
|
13
|
+
onSettle?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export type DragScrollAttachment = Attachment<HTMLElement>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive `(hover: hover) and (pointer: fine)` watcher backed by Svelte's
|
|
3
|
+
* `MediaQuery` — never a bare `matchMedia` call (`check-no-inline-match-media.ts`).
|
|
4
|
+
* `true` when the primary input is a mouse with hover support, so a fine-pointer
|
|
5
|
+
* enhancement (e.g. `useDragScroll`) may attach. Touch and pen devices, and any
|
|
6
|
+
* device without hover, read `false` — they already pan native scrollers directly.
|
|
7
|
+
*
|
|
8
|
+
* SSR-safe: on the server, `svelte/reactivity` resolves to a stub that returns
|
|
9
|
+
* `false`. As a defensive backstop for a client build loaded without a DOM, this
|
|
10
|
+
* also returns `false` when `window.matchMedia` is unavailable.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFinePointer(): import('./use-fine-pointer.types.ts').UseFinePointer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lostgradient/cinder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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",
|
|
@@ -6236,7 +6236,7 @@
|
|
|
6236
6236
|
],
|
|
6237
6237
|
"dependencies": {
|
|
6238
6238
|
"@floating-ui/dom": "1.7.6",
|
|
6239
|
-
"@lostgradient/markdown": "^0.
|
|
6239
|
+
"@lostgradient/markdown": "^0.2.0",
|
|
6240
6240
|
"@shikijs/engine-oniguruma": "^3.21.0",
|
|
6241
6241
|
"@shikijs/types": "^3.21.0",
|
|
6242
6242
|
"@tanstack/virtual-core": "^3.17.1",
|
|
@@ -2,15 +2,6 @@ const DEFAULT_PLACEMENT = 'bottom-start';
|
|
|
2
2
|
const DEFAULT_OFFSET = 8;
|
|
3
3
|
const DEFAULT_SHIFT_PADDING = 8;
|
|
4
4
|
const DEFAULT_ARROW_PADDING = 6;
|
|
5
|
-
function getPlacementSide(placement) {
|
|
6
|
-
if (placement.startsWith('top'))
|
|
7
|
-
return 'top';
|
|
8
|
-
if (placement.startsWith('right'))
|
|
9
|
-
return 'right';
|
|
10
|
-
if (placement.startsWith('left'))
|
|
11
|
-
return 'left';
|
|
12
|
-
return 'bottom';
|
|
13
|
-
}
|
|
14
5
|
export function getAnchoredOverlayWidthStyle(widthMode, anchorRect) {
|
|
15
6
|
if (widthMode === 'none')
|
|
16
7
|
return '';
|
|
@@ -41,21 +32,19 @@ export function applyAnchoredOverlayMaxBlockSize(panel, availableHeight, maximum
|
|
|
41
32
|
export function isAnchoredOverlayWriteCurrent(positioningGeneration, latestGeneration, cancelled) {
|
|
42
33
|
return !cancelled && positioningGeneration === latestGeneration;
|
|
43
34
|
}
|
|
44
|
-
|
|
35
|
+
// Emits only the Floating UI-computed CROSS-axis offset (`left` for a
|
|
36
|
+
// top/bottom placement, `top` for a left/right placement). The STATIC-axis
|
|
37
|
+
// offset — how far the arrow sits from the panel's near edge — is
|
|
38
|
+
// placement- and shape-dependent (Popover's 8px CSS-triangle needs a
|
|
39
|
+
// different inset than HoverCard's 10px rotated-square diamond) and must be
|
|
40
|
+
// owned by each consumer's own per-placement CSS
|
|
41
|
+
// (`[data-cinder-placement^='...']`), not hardcoded here. An inline
|
|
42
|
+
// static-side value would beat that CSS on specificity and silently override
|
|
43
|
+
// it for every consumer, correct or not.
|
|
44
|
+
function getArrowStyle(data) {
|
|
45
45
|
if (!data)
|
|
46
46
|
return '';
|
|
47
|
-
|
|
48
|
-
const staticSide = {
|
|
49
|
-
top: 'bottom',
|
|
50
|
-
right: 'left',
|
|
51
|
-
bottom: 'top',
|
|
52
|
-
left: 'right',
|
|
53
|
-
}[side];
|
|
54
|
-
return [
|
|
55
|
-
data.x != null ? `left: ${data.x}px;` : '',
|
|
56
|
-
data.y != null ? `top: ${data.y}px;` : '',
|
|
57
|
-
staticSide ? `${staticSide}: -4px;` : '',
|
|
58
|
-
]
|
|
47
|
+
return [data.x != null ? `left: ${data.x}px;` : '', data.y != null ? `top: ${data.y}px;` : '']
|
|
59
48
|
.filter(Boolean)
|
|
60
49
|
.join(' ');
|
|
61
50
|
}
|
|
@@ -68,12 +57,47 @@ function reportAnchoredOverlaySetupError(error) {
|
|
|
68
57
|
throw error;
|
|
69
58
|
}, 0);
|
|
70
59
|
}
|
|
60
|
+
// Module-level (singleton) cache for the `@floating-ui/dom` dynamic import. Every anchored
|
|
61
|
+
// overlay on the page (ContextMenu, DropdownMenu, MenuBar, Popover, HoverCard, MultiSelect,
|
|
62
|
+
// Combobox, SelectionPopover, ...) shares this single in-flight/resolved promise, so the
|
|
63
|
+
// module is fetched at most once regardless of how many overlays exist or open.
|
|
64
|
+
//
|
|
65
|
+
// `load` is passed in by the caller (rather than this helper calling the dynamic import
|
|
66
|
+
// itself) so that every literal `import('@floating-ui/dom')` call site stays textually inside an
|
|
67
|
+
// `$effect` body. Svelte's server compilation strips `$effect` callback bodies entirely (they
|
|
68
|
+
// never run during SSR), which is what keeps `@floating-ui/dom` out of the SSR bundle — see the
|
|
69
|
+
// `'server compilation omits Floating UI runtime imports'` test. A module-scope function whose
|
|
70
|
+
// own body called `import('@floating-ui/dom')` would NOT be stripped for SSR.
|
|
71
|
+
let floatingUiModulePromise;
|
|
72
|
+
function cacheFloatingUiModule(load) {
|
|
73
|
+
floatingUiModulePromise ??= load().catch((error) => {
|
|
74
|
+
// Don't let a transient failure (offline, blocked request) permanently poison every
|
|
75
|
+
// future open — clear the cache so the next attempt retries the import.
|
|
76
|
+
floatingUiModulePromise = undefined;
|
|
77
|
+
throw error;
|
|
78
|
+
});
|
|
79
|
+
return floatingUiModulePromise;
|
|
80
|
+
}
|
|
71
81
|
export function createAnchoredOverlay(options) {
|
|
72
82
|
let positionReady = $state(false);
|
|
73
83
|
let positionStyle = $state('');
|
|
74
84
|
let availableHeightStyle = $state('');
|
|
75
85
|
let resolvedPlacement = $state(options.placement?.() ?? DEFAULT_PLACEMENT);
|
|
76
86
|
let arrowStyle = $state('');
|
|
87
|
+
// Speculatively prefetch `@floating-ui/dom` as soon as the anchor/panel elements exist,
|
|
88
|
+
// instead of waiting for `open()` to become true. By the time a user actually opens the
|
|
89
|
+
// overlay, the module has very likely already finished loading in the background, so the
|
|
90
|
+
// first `computePosition` call below doesn't pay the import cost synchronously.
|
|
91
|
+
$effect(() => {
|
|
92
|
+
const anchor = options.anchor();
|
|
93
|
+
const panel = options.panel();
|
|
94
|
+
if (!anchor || !panel)
|
|
95
|
+
return;
|
|
96
|
+
cacheFloatingUiModule(() => import('@floating-ui/dom')).catch(() => {
|
|
97
|
+
// Prefetch failures are non-fatal: the open-gated effect below awaits the same cache
|
|
98
|
+
// and will retry the import when the overlay actually opens.
|
|
99
|
+
});
|
|
100
|
+
});
|
|
77
101
|
$effect(() => {
|
|
78
102
|
if (!options.open()) {
|
|
79
103
|
positionReady = false;
|
|
@@ -109,7 +133,7 @@ export function createAnchoredOverlay(options) {
|
|
|
109
133
|
let stopAutoUpdate;
|
|
110
134
|
let boundaryResizeObserver;
|
|
111
135
|
void (async () => {
|
|
112
|
-
const { arrow: arrowMiddleware, autoUpdate, computePosition, flip, offset: offsetMiddleware, size: sizeMiddleware, shift, } = await import('@floating-ui/dom');
|
|
136
|
+
const { arrow: arrowMiddleware, autoUpdate, computePosition, flip, offset: offsetMiddleware, size: sizeMiddleware, shift, } = await cacheFloatingUiModule(() => import('@floating-ui/dom'));
|
|
113
137
|
if (cancelled)
|
|
114
138
|
return;
|
|
115
139
|
const updatePosition = async () => {
|
|
@@ -174,9 +198,7 @@ export function createAnchoredOverlay(options) {
|
|
|
174
198
|
.filter(Boolean)
|
|
175
199
|
.join(' ');
|
|
176
200
|
resolvedPlacement = result.placement;
|
|
177
|
-
arrowStyle = arrowVisible
|
|
178
|
-
? getArrowStyle(result.placement, result.middlewareData.arrow)
|
|
179
|
-
: '';
|
|
201
|
+
arrowStyle = arrowVisible ? getArrowStyle(result.middlewareData.arrow) : '';
|
|
180
202
|
positionReady = true;
|
|
181
203
|
};
|
|
182
204
|
stopAutoUpdate = autoUpdate(anchor, panel, updatePosition);
|
|
@@ -241,8 +241,27 @@ function recomputeTarget() {
|
|
|
241
241
|
}
|
|
242
242
|
if (!listEl)
|
|
243
243
|
return;
|
|
244
|
-
//
|
|
245
|
-
|
|
244
|
+
// Direct children only, filtered by attribute rather than a `:scope > selector`
|
|
245
|
+
// querySelectorAll call. Both approaches are equivalent in every real browser —
|
|
246
|
+
// this is a happy-dom testability fix, not a behavior change. happy-dom's
|
|
247
|
+
// querySelectorAll does not implement the `:scope` combinator (verified:
|
|
248
|
+
// `ul.querySelectorAll(':scope > [data-sortable-row]')` returns 0 matches where
|
|
249
|
+
// `ul.querySelectorAll('[data-sortable-row]')` returns the expected count; real
|
|
250
|
+
// Chromium returns the same count for both). No prior test in this file caught
|
|
251
|
+
// this — they stubbed pointer capture but never getBoundingClientRect, and
|
|
252
|
+
// asserted only on the preview portal / class state, never on resulting order,
|
|
253
|
+
// so they could not have exercised — or caught a failure in — this targeting
|
|
254
|
+
// path either way. `.children` filtered by attribute produces the same
|
|
255
|
+
// direct-children result in both real browsers and happy-dom, so it is the
|
|
256
|
+
// version to keep testable.
|
|
257
|
+
const rows = Array.from(listEl.children).filter((el) => el instanceof HTMLElement && el.hasAttribute('data-sortable-row'));
|
|
258
|
+
// Live measurement is intentional, not a bug: each recompute reads the CURRENT
|
|
259
|
+
// (possibly already-reordered-by-the-previous-move) layout of every non-lifted
|
|
260
|
+
// row. That is correct — the placeholder physically occupies the gap at the
|
|
261
|
+
// current drop target, so measuring live rects against the live pointer
|
|
262
|
+
// position is what lets a single drag session walk through every position in
|
|
263
|
+
// the list, one rAF-throttled frame at a time. Snapshotting rects once at lift
|
|
264
|
+
// time would go stale the moment the first move reflows the list.
|
|
246
265
|
// data-row-id → dataset.rowId via DOM camelCase conversion
|
|
247
266
|
const nonLifted = rows.filter((r) => r.dataset['rowId'] !== String(rowId));
|
|
248
267
|
const midpoints = nonLifted.map((r) => {
|
|
@@ -258,6 +258,9 @@
|
|
|
258
258
|
|
|
259
259
|
.cinder-approval-card__textarea:focus-visible {
|
|
260
260
|
outline: var(--cinder-ring-width) solid transparent;
|
|
261
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
262
|
+
together read as one heavier shape than either was designed to be. */
|
|
263
|
+
border-color: transparent;
|
|
261
264
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
262
265
|
}
|
|
263
266
|
|
|
@@ -14,6 +14,22 @@ let { avatars = [], maxVisible = defaultMaxVisible, overlap = '0.75rem', zOrder
|
|
|
14
14
|
// silently clobber it after the spread. An empty or whitespace-only
|
|
15
15
|
// `aria-label` is treated as absent (rendering `aria-label=""` would suppress
|
|
16
16
|
// the accessible-name computation per ARIA §4.3.2 without naming the region),
|
|
17
|
+
/*
|
|
18
|
+
* Trigger elements, keyed like the `{#each}`, so each named avatar's Tooltip
|
|
19
|
+
* can anchor to its own trigger from OUTSIDE the list.
|
|
20
|
+
*
|
|
21
|
+
* The Tooltip used to wrap the trigger, which put its `role="tooltip"` panel
|
|
22
|
+
* inside the `role="listitem"` — the panel is a sibling of the trigger within
|
|
23
|
+
* the Tooltip's wrapper, so it lands wherever the Tooltip is placed. That was
|
|
24
|
+
* invisible while the panel was always portaled to `document.body`, and
|
|
25
|
+
* surfaced the moment the portal became visibility-gated. Anchoring by
|
|
26
|
+
* reference keeps the list's children to list items only.
|
|
27
|
+
*
|
|
28
|
+
* Both empty states are real and mean different things: `undefined` is a key
|
|
29
|
+
* that was never populated, and `null` is what `bind:this` writes back when
|
|
30
|
+
* its element unmounts (verified against this Svelte version, not assumed).
|
|
31
|
+
*/
|
|
32
|
+
const triggerElements = $state({});
|
|
17
33
|
// so it falls back to `label` rather than producing a nameless `role="list"`.
|
|
18
34
|
const accessibleName = $derived(typeof consumerAriaLabel === 'string' && consumerAriaLabel.trim().length > 0
|
|
19
35
|
? consumerAriaLabel
|
|
@@ -91,8 +107,7 @@ function avatarSourceProps(src) {
|
|
|
91
107
|
style={`--cinder-avatar-group-index: ${item.stackIndex}`}
|
|
92
108
|
>
|
|
93
109
|
{#if item.trimmedName}
|
|
94
|
-
|
|
95
|
-
<!-- role="img" is the honest semantic: a NAMED composite image, not an
|
|
110
|
+
<!-- role="img" is the honest semantic: a NAMED composite image, not an
|
|
96
111
|
action control. The trigger only reveals a name tooltip on focus/
|
|
97
112
|
hover — it has no onclick/Enter/Space activation, so role="button"
|
|
98
113
|
would be a false affordance (announces "button" but does nothing →
|
|
@@ -102,21 +117,21 @@ function avatarSourceProps(src) {
|
|
|
102
117
|
keyboard users the same name-disclosure pointer users get on hover.
|
|
103
118
|
The inner <Avatar> uses alt="" so its image doesn't double-name the
|
|
104
119
|
composite. -->
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</
|
|
120
|
+
<span
|
|
121
|
+
class="cinder-avatar-group__trigger"
|
|
122
|
+
role="img"
|
|
123
|
+
tabindex="0"
|
|
124
|
+
aria-label={item.trimmedName}
|
|
125
|
+
bind:this={triggerElements[item.key]}
|
|
126
|
+
>
|
|
127
|
+
<Avatar
|
|
128
|
+
{...avatarSourceProps(item.avatar.src)}
|
|
129
|
+
name={item.trimmedName}
|
|
130
|
+
alt=""
|
|
131
|
+
{size}
|
|
132
|
+
{shape}
|
|
133
|
+
/>
|
|
134
|
+
</span>
|
|
120
135
|
{:else}
|
|
121
136
|
<span class="cinder-avatar-group__trigger">
|
|
122
137
|
<Avatar {...avatarSourceProps(item.avatar.src)} name="" alt="" {size} {shape} />
|
|
@@ -136,3 +151,17 @@ function avatarSourceProps(src) {
|
|
|
136
151
|
</span>
|
|
137
152
|
{/if}
|
|
138
153
|
</div>
|
|
154
|
+
|
|
155
|
+
<!--
|
|
156
|
+
Tooltips live OUTSIDE the `role="list"` element, anchored to their triggers by
|
|
157
|
+
reference. Inside, their panels would be descendants of a `role="listitem"`.
|
|
158
|
+
-->
|
|
159
|
+
{#each visibleAvatars as item (item.key)}
|
|
160
|
+
{#if item.trimmedName && triggerElements[item.key]}
|
|
161
|
+
<Tooltip
|
|
162
|
+
text={item.trimmedName}
|
|
163
|
+
describe={false}
|
|
164
|
+
triggerRef={triggerElements[item.key] ?? null}
|
|
165
|
+
/>
|
|
166
|
+
{/if}
|
|
167
|
+
{/each}
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
.cinder-button[data-cinder-variant='ghost-danger'] {
|
|
250
250
|
--_cinder-button-ring: var(--cinder-danger);
|
|
251
251
|
background: transparent;
|
|
252
|
-
color: var(--cinder-danger);
|
|
252
|
+
color: var(--cinder-color-danger-fg);
|
|
253
253
|
border-color: transparent;
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
|
|
276
276
|
.cinder-button[data-cinder-variant='ghost-danger'][data-cinder-loading] {
|
|
277
277
|
background: transparent;
|
|
278
|
-
color: var(--cinder-danger);
|
|
278
|
+
color: var(--cinder-color-danger-fg);
|
|
279
279
|
border-color: transparent;
|
|
280
280
|
}
|
|
281
281
|
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
[data-cinder-loading]
|
|
291
291
|
) {
|
|
292
292
|
background: transparent;
|
|
293
|
-
color: var(--cinder-danger);
|
|
293
|
+
color: var(--cinder-color-danger-fg);
|
|
294
294
|
border-color: transparent;
|
|
295
295
|
opacity: 0.6;
|
|
296
296
|
}
|
|
@@ -467,6 +467,16 @@
|
|
|
467
467
|
color: var(--cinder-danger-contrast);
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
471
|
+
* together read as one heavier shape than either was designed to be. The
|
|
472
|
+
* variants that paint an opaque resting border (secondary, and the icon-only
|
|
473
|
+
* ghost pair) all carry the same (0,2,0) specificity as `:focus-visible`, so
|
|
474
|
+
* this has to sit AFTER them in source order to win the cascade. Keep it below
|
|
475
|
+
* the `:active` block for the same reason. */
|
|
476
|
+
.cinder-button:focus-visible:not(:disabled):not([aria-disabled='true']) {
|
|
477
|
+
border-color: transparent;
|
|
478
|
+
}
|
|
479
|
+
|
|
470
480
|
@media (forced-colors: active) {
|
|
471
481
|
.cinder-button[data-cinder-icon-only][data-cinder-variant='ghost'] {
|
|
472
482
|
background: ButtonFace;
|