@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
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
.cinder-secret-value-field__toggle:focus-visible,
|
|
109
109
|
.cinder-secret-value-field__copy:focus-visible {
|
|
110
110
|
outline: var(--cinder-ring-width) solid transparent;
|
|
111
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
112
|
+
together read as one heavier shape than either was designed to be. */
|
|
113
|
+
border-color: transparent;
|
|
111
114
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
112
115
|
}
|
|
113
116
|
|
|
@@ -119,7 +122,14 @@
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
|
|
122
|
-
/* Copy confirmed state
|
|
125
|
+
/* Copy confirmed state.
|
|
126
|
+
*
|
|
127
|
+
* Stays on the FILL token, unlike CopyButton's equivalent rule which moved to
|
|
128
|
+
* --cinder-color-success-fg. The divergence is deliberate: this button is
|
|
129
|
+
* always icon-only (the trigger's sole child is an aria-hidden <Check>, with
|
|
130
|
+
* the accessible name on aria-label), so `color:` here paints an SVG stroke
|
|
131
|
+
* held to the 3:1 non-text floor rather than ink held to 4.5:1. CopyButton has
|
|
132
|
+
* a text-bearing mode and therefore needs the -fg ramp. */
|
|
123
133
|
.cinder-secret-value-field__copy[data-cinder-copied] {
|
|
124
134
|
color: var(--cinder-success);
|
|
125
135
|
border-color: var(--cinder-success);
|
|
@@ -92,7 +92,17 @@
|
|
|
92
92
|
justify-content: center;
|
|
93
93
|
gap: var(--cinder-space-1);
|
|
94
94
|
border: 0;
|
|
95
|
-
|
|
95
|
+
/* Concentric with the attached container: it is `--cinder-radius-md` and insets
|
|
96
|
+
its options by exactly its 1px padding, so the option's radius has to be that
|
|
97
|
+
same token minus that same inset. It used to be derived from
|
|
98
|
+
`--cinder-radius-sm` — an unrelated step on the scale — which put a 5px curve
|
|
99
|
+
inside an 8px one at a 1px inset where 7px was required. Two curves with
|
|
100
|
+
different centers read as off-axis, which is what "all of the different
|
|
101
|
+
rounded corners look really bad" was describing. Deriving from the
|
|
102
|
+
container's own token means it cannot drift again when the scale moves.
|
|
103
|
+
The detached variant overrides this below: it has no padding and no border,
|
|
104
|
+
so its options are not nested inside anything and take the full radius. */
|
|
105
|
+
border-radius: calc(var(--cinder-radius-md) - 1px);
|
|
96
106
|
background: transparent;
|
|
97
107
|
color: var(--cinder-text-muted);
|
|
98
108
|
cursor: pointer;
|
|
@@ -429,7 +439,7 @@
|
|
|
429
439
|
inset-block-end: 0;
|
|
430
440
|
block-size: 2px;
|
|
431
441
|
background: var(--cinder-accent);
|
|
432
|
-
border-radius: var(--cinder-radius-full
|
|
442
|
+
border-radius: var(--cinder-radius-full);
|
|
433
443
|
}
|
|
434
444
|
|
|
435
445
|
/* Vertical tablist indicator: inline-start edge, spanning the block axis. */
|
|
@@ -71,6 +71,9 @@
|
|
|
71
71
|
|
|
72
72
|
.cinder-select:focus-visible {
|
|
73
73
|
outline: var(--cinder-ring-width) solid transparent;
|
|
74
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
75
|
+
together read as one heavier shape than either was designed to be. */
|
|
76
|
+
border-color: transparent;
|
|
74
77
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
75
78
|
}
|
|
76
79
|
|
|
@@ -180,7 +183,7 @@
|
|
|
180
183
|
.cinder-select-field__error {
|
|
181
184
|
font-size: var(--cinder-text-xs);
|
|
182
185
|
line-height: var(--cinder-leading-normal);
|
|
183
|
-
color: var(--cinder-danger);
|
|
186
|
+
color: var(--cinder-color-danger-fg);
|
|
184
187
|
margin: 0;
|
|
185
188
|
}
|
|
186
189
|
|
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
.cinder-selection-popover__textarea:focus-visible {
|
|
95
95
|
outline: var(--cinder-ring-width) solid transparent;
|
|
96
96
|
outline-offset: var(--cinder-ring-offset);
|
|
97
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
98
|
+
together read as one heavier shape than either was designed to be. */
|
|
99
|
+
border-color: transparent;
|
|
97
100
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
98
101
|
}
|
|
99
102
|
|
|
@@ -19,6 +19,37 @@ let restoreFocusElement = null;
|
|
|
19
19
|
let wasOpen = false;
|
|
20
20
|
let closeRequested = false;
|
|
21
21
|
let isRestoringFocus = false;
|
|
22
|
+
// A count, not a boolean: a multi-pointer gesture (two-finger touch, pen +
|
|
23
|
+
// touch, etc.) can have more than one pointer down at once. Releasing one
|
|
24
|
+
// must not re-arm scroll-dismissal while another is still held.
|
|
25
|
+
let activePointerCount = 0;
|
|
26
|
+
const pointerIsDown = () => activePointerCount > 0;
|
|
27
|
+
// Tracks pointer button state for the component's FULL mounted lifetime —
|
|
28
|
+
// not just while open. A drag-select gesture that opens this popover (via
|
|
29
|
+
// the consumer's selectionchange handler, per selection-popover.examples.json)
|
|
30
|
+
// starts with a pointerdown that happens BEFORE the popover is open/enabled,
|
|
31
|
+
// so movement-dismissal's own gate (in createVirtualKeyboardDismissal, keyed
|
|
32
|
+
// off this getter) needs pointer state that was already being tracked when
|
|
33
|
+
// that pointerdown fired, not state that only starts listening once the
|
|
34
|
+
// popover opens. See createVirtualKeyboardDismissal's isPointerDown option.
|
|
35
|
+
$effect(() => {
|
|
36
|
+
const markPointerDown = () => {
|
|
37
|
+
activePointerCount += 1;
|
|
38
|
+
};
|
|
39
|
+
const markPointerUp = () => {
|
|
40
|
+
activePointerCount = Math.max(0, activePointerCount - 1);
|
|
41
|
+
};
|
|
42
|
+
const pointerTrackingOptions = { capture: true, passive: true };
|
|
43
|
+
window.addEventListener('pointerdown', markPointerDown, pointerTrackingOptions);
|
|
44
|
+
window.addEventListener('pointerup', markPointerUp, pointerTrackingOptions);
|
|
45
|
+
window.addEventListener('pointercancel', markPointerUp, pointerTrackingOptions);
|
|
46
|
+
return () => {
|
|
47
|
+
window.removeEventListener('pointerdown', markPointerDown, pointerTrackingOptions);
|
|
48
|
+
window.removeEventListener('pointerup', markPointerUp, pointerTrackingOptions);
|
|
49
|
+
window.removeEventListener('pointercancel', markPointerUp, pointerTrackingOptions);
|
|
50
|
+
activePointerCount = 0;
|
|
51
|
+
};
|
|
52
|
+
});
|
|
22
53
|
const virtualAnchor = $derived.by(() => {
|
|
23
54
|
if (!position)
|
|
24
55
|
return null;
|
|
@@ -160,6 +191,7 @@ createVirtualKeyboardDismissal({
|
|
|
160
191
|
composerForm: () => composerFormElement,
|
|
161
192
|
composerOwnsKeyboard: () => expanded || commentBody.trim().length > 0,
|
|
162
193
|
isRestoringFocus: () => isRestoringFocus,
|
|
194
|
+
isPointerDown: pointerIsDown,
|
|
163
195
|
onDismiss: (preventScroll) => requestClose(preventScroll),
|
|
164
196
|
onFocusMovedOutside: () => {
|
|
165
197
|
restoreFocusElement = null;
|
|
@@ -158,6 +158,17 @@ export function createVirtualKeyboardDismissal(options) {
|
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
+
// A scroll/resize produced by the SAME held-down pointer gesture that
|
|
162
|
+
// is (or just did) open the popover — e.g. the browser's native
|
|
163
|
+
// autoscroll-while-selecting kicking in as a drag-select nears the
|
|
164
|
+
// viewport edge — is not "the user moved on"; it's the gesture that
|
|
165
|
+
// anchors the popover still in progress. Ignore movement events while
|
|
166
|
+
// any pointer button is held; the dismiss re-arms the instant it's
|
|
167
|
+
// released. Checked last (not as an early return) so the viewport/
|
|
168
|
+
// keyboard-transition bookkeeping above still runs while the pointer
|
|
169
|
+
// is down — only the final act of dismissing is suppressed.
|
|
170
|
+
if (options.isPointerDown())
|
|
171
|
+
return;
|
|
161
172
|
closeForMovement();
|
|
162
173
|
};
|
|
163
174
|
const dismissVisualViewport = (event) => {
|
|
@@ -182,6 +193,11 @@ export function createVirtualKeyboardDismissal(options) {
|
|
|
182
193
|
(composerHasFocus || virtualKeyboardTransition.ownedByComposer)) {
|
|
183
194
|
return;
|
|
184
195
|
}
|
|
196
|
+
// See the matching guard at the end of `dismiss` above — checked last
|
|
197
|
+
// so the keyboard-transition bookkeeping above still runs while a
|
|
198
|
+
// pointer is held; only the final dismissal is suppressed.
|
|
199
|
+
if (options.isPointerDown())
|
|
200
|
+
return;
|
|
185
201
|
closeForMovement();
|
|
186
202
|
};
|
|
187
203
|
// A cancel/submit that only returns focus to the pre-open owner (or drops
|
|
@@ -25,11 +25,28 @@
|
|
|
25
25
|
.cinder-sheet::backdrop {
|
|
26
26
|
background-color: var(--cinder-overlay-backdrop);
|
|
27
27
|
backdrop-filter: blur(var(--cinder-overlay-blur));
|
|
28
|
-
transition:
|
|
28
|
+
transition:
|
|
29
|
+
background-color var(--cinder-duration-normal) var(--cinder-ease-standard),
|
|
30
|
+
backdrop-filter var(--cinder-duration-normal) var(--cinder-ease-standard);
|
|
31
|
+
/* `::backdrop` is added to/removed from the top layer as a discrete step
|
|
32
|
+
(like `display`), so `@starting-style` below needs `allow-discrete` to
|
|
33
|
+
actually engage on insertion instead of silently no-op'ing. */
|
|
34
|
+
transition-behavior: allow-discrete;
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
.cinder-sheet[data-cinder-closing]::backdrop {
|
|
32
38
|
background-color: transparent;
|
|
39
|
+
backdrop-filter: blur(0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Without this, the backdrop had no FROM state to transition from on open —
|
|
43
|
+
it fades out on close (via the rule above) but snapped to full opacity
|
|
44
|
+
instantly on open, which read as an asymmetric "eases out, pops in". */
|
|
45
|
+
@starting-style {
|
|
46
|
+
.cinder-sheet::backdrop {
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
backdrop-filter: blur(0);
|
|
49
|
+
}
|
|
33
50
|
}
|
|
34
51
|
|
|
35
52
|
.cinder-sheet__panel {
|
|
@@ -144,6 +161,8 @@
|
|
|
144
161
|
}
|
|
145
162
|
|
|
146
163
|
.cinder-sheet__body {
|
|
164
|
+
--_cinder-scroll-fade-color: var(--cinder-surface);
|
|
165
|
+
|
|
147
166
|
flex: 1;
|
|
148
167
|
min-block-size: 0;
|
|
149
168
|
overflow-y: auto;
|
|
@@ -153,17 +172,6 @@
|
|
|
153
172
|
scrollbar-gutter: stable;
|
|
154
173
|
}
|
|
155
174
|
|
|
156
|
-
.cinder-sheet__body[data-cinder-overflows]::after {
|
|
157
|
-
content: '';
|
|
158
|
-
position: sticky;
|
|
159
|
-
inset-block-end: 0;
|
|
160
|
-
display: block;
|
|
161
|
-
height: 1.5rem;
|
|
162
|
-
margin-block-start: -1.5rem;
|
|
163
|
-
background: linear-gradient(to bottom, transparent, var(--cinder-surface));
|
|
164
|
-
pointer-events: none;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
175
|
/* Suppress the focus ring only for programmatic (mouse / open-effect) focus —
|
|
168
176
|
* if the body container ever becomes keyboard-reachable, indication is preserved. */
|
|
169
177
|
.cinder-sheet__body:focus:not(:focus-visible) {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
opacity: 0.4;
|
|
51
51
|
outline: 2px dashed var(--cinder-border-muted);
|
|
52
52
|
outline-offset: -1px;
|
|
53
|
-
border-radius: var(--cinder-radius-md
|
|
53
|
+
border-radius: var(--cinder-radius-md);
|
|
54
54
|
box-shadow: none;
|
|
55
55
|
background: transparent;
|
|
56
56
|
}
|
|
@@ -60,15 +60,20 @@
|
|
|
60
60
|
visibility: hidden;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
/*
|
|
64
|
+
* `.cinder-sortable-item--shifting` marks every row displaced by an active
|
|
65
|
+
* drag (all rows except the lifted one, while a drag is in progress) — a
|
|
66
|
+
* state hook for consumer overrides. It intentionally carries no transition
|
|
67
|
+
* of its own here: neighboring rows are relocated by Svelte's keyed `#each`
|
|
68
|
+
* physically moving DOM nodes on every reorder, which is an instant reflow,
|
|
69
|
+
* not an animatable property change. Animating that motion requires a
|
|
70
|
+
* FLIP-style effect (capture the pre-reorder rect, invert, then transition
|
|
71
|
+
* back to identity) — a distinct feature with its own edge-case matrix
|
|
72
|
+
* (keyboard moves, drop/cancel settling, cross-column KanbanBoard moves),
|
|
73
|
+
* tracked separately rather than folded into this class.
|
|
74
|
+
*/
|
|
66
75
|
|
|
67
76
|
@media (prefers-reduced-motion: reduce) {
|
|
68
|
-
.cinder-sortable-item--shifting {
|
|
69
|
-
transition: none;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
77
|
.cinder-sortable-item--lifted {
|
|
73
78
|
transform: none;
|
|
74
79
|
box-shadow: var(--cinder-shadow-lg);
|
|
@@ -147,7 +152,7 @@
|
|
|
147
152
|
z-index: var(--cinder-z-drag-preview);
|
|
148
153
|
pointer-events: none;
|
|
149
154
|
box-shadow: var(--cinder-shadow-md);
|
|
150
|
-
border-radius: var(--cinder-radius-md
|
|
155
|
+
border-radius: var(--cinder-radius-md);
|
|
151
156
|
/* Subtle rotation and scale to distinguish preview from the placeholder. */
|
|
152
157
|
transform: rotate(2deg) scale(1.02);
|
|
153
158
|
transform-origin: center top;
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.cinder-statistic__change[data-cinder-direction='up'] {
|
|
67
|
-
color: var(--cinder-success);
|
|
67
|
+
color: var(--cinder-color-success-fg);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.cinder-statistic__change[data-cinder-direction='down'] {
|
|
71
|
-
color: var(--cinder-danger);
|
|
71
|
+
color: var(--cinder-color-danger-fg);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.cinder-statistic__change[data-cinder-direction='neutral'] {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
padding: var(--cinder-statistic-group-card-padding, var(--cinder-space-4, 1rem));
|
|
58
58
|
background: var(--cinder-surface-raised);
|
|
59
59
|
border: 1px solid var(--cinder-border);
|
|
60
|
-
border-radius: var(--cinder-radius-md
|
|
60
|
+
border-radius: var(--cinder-radius-md);
|
|
61
61
|
box-shadow: var(--cinder-shadow-sm);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
.cinder-statistic-group[data-cinder-variant='shared-borders'] {
|
|
70
70
|
--cinder-statistic-group-gap: 1px;
|
|
71
71
|
border: 1px solid var(--cinder-border);
|
|
72
|
-
border-radius: var(--cinder-radius-md
|
|
72
|
+
border-radius: var(--cinder-radius-md);
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
background: var(--cinder-border);
|
|
75
75
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.cinder-status-dot[data-cinder-state='connected'] {
|
|
36
|
-
color: var(--cinder-success);
|
|
36
|
+
color: var(--cinder-color-success-fg);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.cinder-status-dot[data-cinder-state='connecting'] {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.cinder-status-dot[data-cinder-state='error'] {
|
|
48
|
-
color: var(--cinder-danger);
|
|
48
|
+
color: var(--cinder-color-danger-fg);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.cinder-status-dot__indicator {
|
|
@@ -30,6 +30,21 @@
|
|
|
30
30
|
overflow-x: auto;
|
|
31
31
|
overscroll-behavior-inline: contain;
|
|
32
32
|
-webkit-overflow-scrolling: touch;
|
|
33
|
+
/* Same inset-shadow horizontal-scroll affordance as data-grid's
|
|
34
|
+
* `--_cinder-data-grid-overflow-shadow` (data-grid.css) — proven,
|
|
35
|
+
* mask-free, and safe alongside the sticky header below (the shadow is
|
|
36
|
+
* decoration on the scroll container's own box, so it stays pinned at
|
|
37
|
+
* the true edges rather than scrolling with content). Driven by
|
|
38
|
+
* `overflowShadow('inline')` (utilities/attachments.ts), which is NOT
|
|
39
|
+
* scroll-position-aware: both edges show whenever content overflows at
|
|
40
|
+
* all, matching data-grid's own behavior exactly. */
|
|
41
|
+
box-shadow: var(--_cinder-table-scroll-shadow, none);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.cinder-table-scroll[data-cinder-overflows-inline] {
|
|
45
|
+
--_cinder-table-scroll-shadow:
|
|
46
|
+
inset 1rem 0 1rem -1rem color-mix(in srgb, var(--cinder-text) 28%, transparent),
|
|
47
|
+
inset -1rem 0 1rem -1rem color-mix(in srgb, var(--cinder-text) 28%, transparent);
|
|
33
48
|
}
|
|
34
49
|
|
|
35
50
|
.cinder-table-scroll .cinder-table {
|
|
@@ -6,6 +6,7 @@ export {};
|
|
|
6
6
|
import { setTableContext } from './table.context.ts';
|
|
7
7
|
import { classNames } from '../../utilities/class-names.ts';
|
|
8
8
|
import { useResizeObserver } from '../../utilities/use-resize-observer.svelte.ts';
|
|
9
|
+
import { overflowShadow } from '../../utilities/attachments.ts';
|
|
9
10
|
let { sort = $bindable(), caption, stickyHeader = false, density = 'comfortable', selectable = false, scrollable = false, scrollContainerProps, class: className, children, ...rest } = $props();
|
|
10
11
|
const wrapperClassName = $derived(scrollContainerProps?.class);
|
|
11
12
|
const wrapperAriaLabelledBy = $derived(normalizeOptionalAttribute(scrollContainerProps?.['aria-labelledby']));
|
|
@@ -97,6 +98,7 @@ setTableContext({
|
|
|
97
98
|
aria-label={wrapperAriaLabel}
|
|
98
99
|
aria-labelledby={wrapperAriaLabelledBy}
|
|
99
100
|
tabindex={wrapperTabindex}
|
|
101
|
+
{@attach overflowShadow('inline')}
|
|
100
102
|
>
|
|
101
103
|
{@render table()}
|
|
102
104
|
</div>
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
|
|
80
80
|
.cinder-textarea:focus-visible {
|
|
81
81
|
outline: var(--cinder-ring-width) solid transparent;
|
|
82
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
83
|
+
together read as one heavier shape than either was designed to be. */
|
|
84
|
+
border-color: transparent;
|
|
82
85
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
83
86
|
}
|
|
84
87
|
|
|
@@ -142,7 +145,7 @@
|
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
.cinder-textarea-error {
|
|
145
|
-
color: var(--cinder-danger);
|
|
148
|
+
color: var(--cinder-color-danger-fg);
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
.cinder-textarea-count {
|
|
@@ -53,6 +53,9 @@
|
|
|
53
53
|
|
|
54
54
|
.cinder-time-field__timezone:focus-visible {
|
|
55
55
|
outline: var(--cinder-ring-width) solid transparent;
|
|
56
|
+
/* Ring replaces the border while focused rather than stacking on it — the two
|
|
57
|
+
together read as one heavier shape than either was designed to be. */
|
|
58
|
+
border-color: transparent;
|
|
56
59
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
57
60
|
}
|
|
58
61
|
|
|
@@ -77,6 +80,6 @@
|
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
.cinder-time-field__error {
|
|
80
|
-
color: var(--cinder-danger);
|
|
83
|
+
color: var(--cinder-color-danger-fg);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
@@ -27,8 +27,12 @@
|
|
|
27
27
|
{
|
|
28
28
|
"name": "children",
|
|
29
29
|
"reason": "function-or-snippet",
|
|
30
|
-
"
|
|
31
|
-
|
|
30
|
+
"description": "The trigger element the tooltip wraps and anchors to. Required unless\n`triggerRef` supplies the anchor instead."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "triggerRef",
|
|
34
|
+
"reason": "unknown-shape",
|
|
35
|
+
"description": "Explicit anchor element, for when the tooltip cannot wrap its trigger.\n\nThe default form renders a wrapper around `children` and resolves the\nanchor from it, which puts the `role=\"tooltip\"` panel inside whatever\nstructure the trigger sits in. That is wrong wherever the surrounding\nmarkup constrains its children — `AvatarGroup` wraps each avatar in a\n`role=\"listitem\"`, so an in-tree panel lands inside a list item.\n\nWith `triggerRef`, the Tooltip renders ONLY the panel and anchors it to the\nsupplied element, so the consumer places the panel wherever it belongs.\n`children` is then unnecessary — the trigger is already in the consumer's\nown markup. Mirrors `PopoverProps.triggerRef`."
|
|
32
36
|
}
|
|
33
37
|
]
|
|
34
38
|
}
|
|
@@ -29,8 +29,14 @@ const schema = {
|
|
|
29
29
|
{
|
|
30
30
|
name: 'children',
|
|
31
31
|
reason: 'function-or-snippet',
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
description:
|
|
33
|
+
'The trigger element the tooltip wraps and anchors to. Required unless\n`triggerRef` supplies the anchor instead.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'triggerRef',
|
|
37
|
+
reason: 'unknown-shape',
|
|
38
|
+
description:
|
|
39
|
+
'Explicit anchor element, for when the tooltip cannot wrap its trigger.\n\nThe default form renders a wrapper around `children` and resolves the\nanchor from it, which puts the `role="tooltip"` panel inside whatever\nstructure the trigger sits in. That is wrong wherever the surrounding\nmarkup constrains its children — `AvatarGroup` wraps each avatar in a\n`role="listitem"`, so an in-tree panel lands inside a list item.\n\nWith `triggerRef`, the Tooltip renders ONLY the panel and anchors it to the\nsupplied element, so the consumer places the panel wherever it belongs.\n`children` is then unnecessary — the trigger is already in the consumer\'s\nown markup. Mirrors `PopoverProps.triggerRef`.',
|
|
34
40
|
},
|
|
35
41
|
],
|
|
36
42
|
},
|
|
@@ -8,7 +8,29 @@ import { createAnchoredOverlay } from '../../_internal/anchored-overlay.svelte.t
|
|
|
8
8
|
import { pushEscapeHandler } from '../../_internal/overlay.ts';
|
|
9
9
|
import { classNames } from '../../utilities/class-names.ts';
|
|
10
10
|
import { createPortalAttachment } from '../portal/index.ts';
|
|
11
|
-
let { text, placement = 'top', describe = true, class: className, children, } = $props();
|
|
11
|
+
let { text, placement = 'top', describe = true, class: className, triggerRef = null, children, } = $props();
|
|
12
|
+
/**
|
|
13
|
+
* Anchor-by-reference mode: the consumer owns the trigger's placement, so the
|
|
14
|
+
* Tooltip renders only its panel. See {@link TooltipProps.triggerRef}.
|
|
15
|
+
*/
|
|
16
|
+
const isDetached = $derived(triggerRef != null);
|
|
17
|
+
/*
|
|
18
|
+
* OVERLAY-POLICY.md's SSR rule is a HARD CONSTRAINT: overlays render nothing
|
|
19
|
+
* on the server, whatever their initial state. Tooltip did not satisfy it —
|
|
20
|
+
* the panel was always in the template — and an earlier revision of this
|
|
21
|
+
* branch wrote itself a "documented exception" in tooltip.a11y.md instead,
|
|
22
|
+
* on the belief that the panel had to exist server-side as the
|
|
23
|
+
* `aria-describedby` target.
|
|
24
|
+
*
|
|
25
|
+
* It does not. `syncAriaDescribedBy` runs from an attachment (wrapping mode)
|
|
26
|
+
* and an `$effect` (detached mode), both client-only, so the server renders
|
|
27
|
+
* no `aria-describedby` either. Reference and target appear together after
|
|
28
|
+
* hydration, and gating the panel leaves nothing dangling.
|
|
29
|
+
*/
|
|
30
|
+
let hydrated = $state(false);
|
|
31
|
+
$effect(() => {
|
|
32
|
+
hydrated = true;
|
|
33
|
+
});
|
|
12
34
|
const tooltipId = $props.id();
|
|
13
35
|
const FOCUSABLE_SELECTOR = [
|
|
14
36
|
'button:not([disabled])',
|
|
@@ -120,6 +142,31 @@ function syncAriaDescribedBy(focusable) {
|
|
|
120
142
|
}
|
|
121
143
|
};
|
|
122
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Detached mode's equivalent of `attachWrapper`: bind the same show/hide and
|
|
147
|
+
* `aria-describedby` behavior to an element this component does not render.
|
|
148
|
+
* Keyed on the element identity so a re-render with a new ref rebinds.
|
|
149
|
+
*/
|
|
150
|
+
$effect(() => {
|
|
151
|
+
const trigger = triggerRef;
|
|
152
|
+
if (trigger == null)
|
|
153
|
+
return;
|
|
154
|
+
anchorElement = trigger;
|
|
155
|
+
const teardownAriaDescribedBy = describe ? syncAriaDescribedBy(trigger) : undefined;
|
|
156
|
+
trigger.addEventListener('mouseenter', handleMouseEnter);
|
|
157
|
+
trigger.addEventListener('mouseleave', handleMouseLeave);
|
|
158
|
+
trigger.addEventListener('focusin', handleFocusIn);
|
|
159
|
+
trigger.addEventListener('focusout', handleFocusOut);
|
|
160
|
+
return () => {
|
|
161
|
+
teardownAriaDescribedBy?.();
|
|
162
|
+
trigger.removeEventListener('mouseenter', handleMouseEnter);
|
|
163
|
+
trigger.removeEventListener('mouseleave', handleMouseLeave);
|
|
164
|
+
trigger.removeEventListener('focusin', handleFocusIn);
|
|
165
|
+
trigger.removeEventListener('focusout', handleFocusOut);
|
|
166
|
+
if (anchorElement === trigger)
|
|
167
|
+
anchorElement = null;
|
|
168
|
+
};
|
|
169
|
+
});
|
|
123
170
|
const attachWrapper = (element) => {
|
|
124
171
|
wrapperElement = element;
|
|
125
172
|
const focusable = resolveAnchorElement(element);
|
|
@@ -134,6 +181,32 @@ const attachWrapper = (element) => {
|
|
|
134
181
|
};
|
|
135
182
|
};
|
|
136
183
|
const tooltipPortalAttachment = createPortalAttachment({
|
|
184
|
+
/*
|
|
185
|
+
* Gate the portal on visibility, so a Tooltip that is not showing leaves
|
|
186
|
+
* nothing behind in `document.body`.
|
|
187
|
+
*
|
|
188
|
+
* Without this the panel was portaled on mount and stayed there for the
|
|
189
|
+
* lifetime of the component — one detached `[role="tooltip"]` per Tooltip
|
|
190
|
+
* instance accumulating in `document.body`. Every sibling overlay already
|
|
191
|
+
* gates: Popover and HoverCard via
|
|
192
|
+
* `{#if mounted && open && anchorElement}`, Portal/SpeedDial/NavigationBar/
|
|
193
|
+
* DropdownMenu via an explicit `disabled` getter.
|
|
194
|
+
*
|
|
195
|
+
* `disabled` rather than wrapping the node in `{#if visible}`: the disabled
|
|
196
|
+
* path calls `restoreInline()`, which returns the panel to its original
|
|
197
|
+
* position inside the wrapper instead of unmounting it — so the
|
|
198
|
+
* `aria-describedby` target keeps resolving while the tooltip is hidden.
|
|
199
|
+
* Conditional rendering would break that association.
|
|
200
|
+
*
|
|
201
|
+
* This closes the CLIENT leak; the `hydrated` gate on the panel above is
|
|
202
|
+
* what satisfies the SSR half of the policy.
|
|
203
|
+
*
|
|
204
|
+
* Gated on `visible`, NOT on `isTooltipExposed`: the latter also requires
|
|
205
|
+
* `positionReady`, and position is computed against the portaled node — so
|
|
206
|
+
* gating on it would deadlock a tooltip that can never be positioned
|
|
207
|
+
* because it was never portaled.
|
|
208
|
+
*/
|
|
209
|
+
disabled: () => !visible,
|
|
137
210
|
target: () => document.body,
|
|
138
211
|
source: () => anchorElement ?? wrapperElement ?? null,
|
|
139
212
|
inheritAttributes: true,
|
|
@@ -161,29 +234,57 @@ $effect(() => {
|
|
|
161
234
|
span below and the consumer's trigger child. role="presentation" keeps this
|
|
162
235
|
wrapper out of the accessibility tree.
|
|
163
236
|
-->
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
237
|
+
<!--
|
|
238
|
+
Two forms. By default the Tooltip renders a presentational wrapper around its
|
|
239
|
+
trigger and anchors to it. With `triggerRef` the consumer owns the trigger, so
|
|
240
|
+
only the panel renders — which is how a Tooltip can be used somewhere its
|
|
241
|
+
panel must not appear in the trigger's own subtree (a `role="listitem"`, a
|
|
242
|
+
table cell). See `TooltipProps.triggerRef`.
|
|
243
|
+
-->
|
|
244
|
+
{#if isDetached}
|
|
245
|
+
{#if hydrated}
|
|
246
|
+
<!-- The panel is the component ROOT here, so it takes `class` — in the
|
|
247
|
+
wrapping form below that lands on the wrapper instead. -->
|
|
248
|
+
<span
|
|
249
|
+
id={tooltipId}
|
|
250
|
+
bind:this={tooltipElement}
|
|
251
|
+
role="tooltip"
|
|
252
|
+
class={classNames('cinder-tooltip', className)}
|
|
253
|
+
aria-hidden={!isTooltipExposed}
|
|
254
|
+
data-cinder-placement={visible ? anchoredOverlay.resolvedPlacement : placement}
|
|
255
|
+
data-cinder-position-ready={anchoredOverlay.positionReady}
|
|
256
|
+
style={anchoredOverlay.positionStyle}
|
|
257
|
+
{@attach tooltipPortalAttachment}
|
|
258
|
+
>
|
|
259
|
+
{text}
|
|
260
|
+
</span>
|
|
261
|
+
{/if}
|
|
262
|
+
{:else}
|
|
176
263
|
<span
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
264
|
+
class={classNames('cinder-tooltip-wrapper', className)}
|
|
265
|
+
role="presentation"
|
|
266
|
+
onmouseenter={handleMouseEnter}
|
|
267
|
+
onmouseleave={handleMouseLeave}
|
|
268
|
+
onfocusin={handleFocusIn}
|
|
269
|
+
onfocusout={handleFocusOut}
|
|
182
270
|
data-cinder-placement={visible ? anchoredOverlay.resolvedPlacement : placement}
|
|
183
|
-
|
|
184
|
-
style={anchoredOverlay.positionStyle}
|
|
185
|
-
{@attach tooltipPortalAttachment}
|
|
271
|
+
{@attach attachWrapper}
|
|
186
272
|
>
|
|
187
|
-
{
|
|
273
|
+
{@render children?.()}
|
|
274
|
+
{#if hydrated}
|
|
275
|
+
<span
|
|
276
|
+
id={tooltipId}
|
|
277
|
+
bind:this={tooltipElement}
|
|
278
|
+
role="tooltip"
|
|
279
|
+
class="cinder-tooltip"
|
|
280
|
+
aria-hidden={!isTooltipExposed}
|
|
281
|
+
data-cinder-placement={visible ? anchoredOverlay.resolvedPlacement : placement}
|
|
282
|
+
data-cinder-position-ready={anchoredOverlay.positionReady}
|
|
283
|
+
style={anchoredOverlay.positionStyle}
|
|
284
|
+
{@attach tooltipPortalAttachment}
|
|
285
|
+
>
|
|
286
|
+
{text}
|
|
287
|
+
</span>
|
|
288
|
+
{/if}
|
|
188
289
|
</span>
|
|
189
|
-
|
|
290
|
+
{/if}
|
|
@@ -9,6 +9,24 @@ export type TooltipProps = {
|
|
|
9
9
|
describe?: boolean;
|
|
10
10
|
/** Additional class names merged with the component's root class. */
|
|
11
11
|
class?: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Explicit anchor element, for when the tooltip cannot wrap its trigger.
|
|
14
|
+
*
|
|
15
|
+
* The default form renders a wrapper around `children` and resolves the
|
|
16
|
+
* anchor from it, which puts the `role="tooltip"` panel inside whatever
|
|
17
|
+
* structure the trigger sits in. That is wrong wherever the surrounding
|
|
18
|
+
* markup constrains its children — `AvatarGroup` wraps each avatar in a
|
|
19
|
+
* `role="listitem"`, so an in-tree panel lands inside a list item.
|
|
20
|
+
*
|
|
21
|
+
* With `triggerRef`, the Tooltip renders ONLY the panel and anchors it to the
|
|
22
|
+
* supplied element, so the consumer places the panel wherever it belongs.
|
|
23
|
+
* `children` is then unnecessary — the trigger is already in the consumer's
|
|
24
|
+
* own markup. Mirrors `PopoverProps.triggerRef`.
|
|
25
|
+
*/
|
|
26
|
+
triggerRef?: HTMLElement | null;
|
|
27
|
+
/**
|
|
28
|
+
* The trigger element the tooltip wraps and anchors to. Required unless
|
|
29
|
+
* `triggerRef` supplies the anchor instead.
|
|
30
|
+
*/
|
|
31
|
+
children?: Snippet;
|
|
14
32
|
};
|