@lostgradient/cinder 0.1.1 → 0.2.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 +62 -0
- package/README.md +163 -0
- package/components.json +390 -3
- package/dist/_internal/chart/chart-focus-ring.d.ts +57 -0
- package/dist/_internal/chart/chart-utilities.d.ts +2 -0
- package/dist/_internal/chart/heatmap-utilities.d.ts +60 -0
- package/dist/components/accordion/index.js +14 -1
- package/dist/components/alert/alert.schema.js +3 -3
- package/dist/components/alert/alert.types.d.ts +3 -2
- package/dist/components/alert/index.js +3 -2
- package/dist/components/alert-dialog/index.js +11 -2
- package/dist/components/area-chart/area-chart.css +57 -7
- package/dist/components/area-chart/index.js +283 -40
- package/dist/components/avatar-group/avatar-group.css +2 -3
- package/dist/components/badge/badge.css +17 -0
- package/dist/components/badge/badge.schema.js +6 -1
- package/dist/components/badge/badge.types.d.ts +7 -0
- package/dist/components/badge/index.js +4 -2
- package/dist/components/bar-chart/bar-chart.css +57 -7
- package/dist/components/bar-chart/index.js +233 -45
- package/dist/components/button/button.css +5 -3
- package/dist/components/button/index.js +11 -2
- package/dist/components/capability-gate/capability-gate.css +131 -0
- package/dist/components/capability-gate/capability-gate.schema.d.ts +3 -0
- package/dist/components/capability-gate/capability-gate.schema.js +128 -0
- package/dist/components/capability-gate/capability-gate.svelte.d.ts +19 -0
- package/dist/components/capability-gate/capability-gate.types.d.ts +70 -0
- package/dist/components/capability-gate/capability-gate.variables.d.ts +2 -0
- package/dist/components/capability-gate/capability-gate.variables.js +61 -0
- package/dist/components/capability-gate/index.d.ts +5 -0
- package/dist/components/capability-gate/index.js +285 -0
- package/dist/components/card/card.css +4 -0
- package/dist/components/card/card.schema.js +5 -1
- package/dist/components/card/card.svelte.d.ts +1 -1
- package/dist/components/card/card.types.d.ts +4 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +8 -4
- package/dist/components/chat/index.css +2 -2
- package/dist/components/chat/index.js +159 -81
- package/dist/components/choice-grid/choice-grid-context.d.ts +23 -0
- package/dist/components/choice-grid/choice-grid.css +27 -0
- package/dist/components/choice-grid/choice-grid.schema.d.ts +3 -0
- package/dist/components/choice-grid/choice-grid.schema.js +121 -0
- package/dist/components/choice-grid/choice-grid.svelte.d.ts +20 -0
- package/dist/components/choice-grid/choice-grid.types.d.ts +122 -0
- package/dist/components/choice-grid/choice-grid.variables.d.ts +2 -0
- package/dist/components/choice-grid/choice-grid.variables.js +61 -0
- package/dist/components/choice-grid/index.d.ts +13 -0
- package/dist/components/choice-grid/index.js +466 -0
- package/dist/components/choice-grid-item/choice-grid-item.css +139 -0
- package/dist/components/choice-grid-item/choice-grid-item.schema.d.ts +3 -0
- package/dist/components/choice-grid-item/choice-grid-item.schema.js +93 -0
- package/dist/components/choice-grid-item/choice-grid-item.svelte.d.ts +17 -0
- package/dist/components/choice-grid-item/choice-grid-item.types.d.ts +24 -0
- package/dist/components/choice-grid-item/choice-grid-item.variables.d.ts +2 -0
- package/dist/components/choice-grid-item/choice-grid-item.variables.js +61 -0
- package/dist/components/choice-grid-item/index.d.ts +5 -0
- package/dist/components/choice-grid-item/index.js +203 -0
- package/dist/components/color-field/color-field.css +6 -9
- package/dist/components/color-picker/color-picker.css +31 -24
- package/dist/components/color-swatch-picker/color-swatch-picker.css +6 -9
- package/dist/components/confirm-dialog/index.js +11 -2
- package/dist/components/context-menu/index.js +114 -43
- package/dist/components/context-menu-trigger/index.js +6 -4
- package/dist/components/data-table/data-table.css +30 -0
- package/dist/components/data-table/data-table.schema.d.ts +3 -0
- package/dist/components/data-table/data-table.schema.js +103 -0
- package/dist/components/data-table/data-table.svelte.d.ts +39 -0
- package/dist/components/data-table/data-table.types.d.ts +86 -0
- package/dist/components/data-table/data-table.variables.d.ts +2 -0
- package/dist/components/data-table/data-table.variables.js +61 -0
- package/dist/components/data-table/index.d.ts +5 -0
- package/dist/components/data-table/index.js +591 -0
- package/dist/components/diff-viewer/index.js +14 -3
- package/dist/components/dropdown/index.js +115 -46
- package/dist/components/dropdown-item/dropdown-item.schema.js +13 -1
- package/dist/components/dropdown-item/dropdown-item.svelte.d.ts +1 -1
- package/dist/components/dropdown-item/dropdown-item.types.d.ts +46 -2
- package/dist/components/dropdown-item/index.d.ts +1 -1
- package/dist/components/dropdown-item/index.js +97 -28
- package/dist/components/floating-action-button/floating-action-button.css +4 -2
- package/dist/components/json-schema-editor/index.js +29 -4
- package/dist/components/keyboard-shortcuts/index.d.ts +5 -0
- package/dist/components/keyboard-shortcuts/index.js +238 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.css +84 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.schema.d.ts +3 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.schema.js +87 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.svelte.d.ts +17 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.types.d.ts +42 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.variables.d.ts +2 -0
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.variables.js +61 -0
- package/dist/components/line-chart/index.js +283 -40
- package/dist/components/line-chart/line-chart.css +57 -8
- package/dist/components/markdown-editor/index.js +129 -51
- package/dist/components/matrix-chart/index.d.ts +5 -0
- package/dist/components/matrix-chart/index.js +1232 -0
- package/dist/components/matrix-chart/matrix-chart.css +50 -0
- package/dist/components/matrix-chart/matrix-chart.schema.d.ts +3 -0
- package/dist/components/matrix-chart/matrix-chart.schema.js +123 -0
- package/dist/components/matrix-chart/matrix-chart.svelte.d.ts +20 -0
- package/dist/components/matrix-chart/matrix-chart.types.d.ts +52 -0
- package/dist/components/matrix-chart/matrix-chart.variables.d.ts +2 -0
- package/dist/components/matrix-chart/matrix-chart.variables.js +61 -0
- package/dist/components/media-controls/index.d.ts +5 -0
- package/dist/components/media-controls/index.js +338 -0
- package/dist/components/media-controls/media-controls.css +112 -0
- package/dist/components/media-controls/media-controls.schema.d.ts +3 -0
- package/dist/components/media-controls/media-controls.schema.js +125 -0
- package/dist/components/media-controls/media-controls.svelte.d.ts +18 -0
- package/dist/components/media-controls/media-controls.types.d.ts +77 -0
- package/dist/components/media-controls/media-controls.variables.d.ts +2 -0
- package/dist/components/media-controls/media-controls.variables.js +61 -0
- package/dist/components/navigation-bar/navigation-bar.schema.js +5 -5
- package/dist/components/navigation-bar/navigation-bar.types.d.ts +2 -1
- package/dist/components/pricing-card/index.d.ts +5 -0
- package/dist/components/pricing-card/index.js +406 -0
- package/dist/components/pricing-card/pricing-card.css +173 -0
- package/dist/components/pricing-card/pricing-card.schema.d.ts +3 -0
- package/dist/components/pricing-card/pricing-card.schema.js +100 -0
- package/dist/components/pricing-card/pricing-card.svelte.d.ts +18 -0
- package/dist/components/pricing-card/pricing-card.types.d.ts +47 -0
- package/dist/components/pricing-card/pricing-card.variables.d.ts +2 -0
- package/dist/components/pricing-card/pricing-card.variables.js +61 -0
- package/dist/components/review-editor/index.js +212 -132
- package/dist/components/share-card/index.d.ts +5 -0
- package/dist/components/share-card/index.js +446 -0
- package/dist/components/share-card/share-card.css +115 -0
- package/dist/components/share-card/share-card.schema.d.ts +3 -0
- package/dist/components/share-card/share-card.schema.js +113 -0
- package/dist/components/share-card/share-card.svelte.d.ts +18 -0
- package/dist/components/share-card/share-card.types.d.ts +66 -0
- package/dist/components/share-card/share-card.variables.d.ts +2 -0
- package/dist/components/share-card/share-card.variables.js +61 -0
- package/dist/components/shortcut-hint/index.d.ts +5 -0
- package/dist/components/shortcut-hint/index.js +197 -0
- package/dist/components/shortcut-hint/shortcut-hint.css +26 -0
- package/dist/components/shortcut-hint/shortcut-hint.schema.d.ts +3 -0
- package/dist/components/shortcut-hint/shortcut-hint.schema.js +96 -0
- package/dist/components/shortcut-hint/shortcut-hint.svelte.d.ts +17 -0
- package/dist/components/shortcut-hint/shortcut-hint.types.d.ts +33 -0
- package/dist/components/shortcut-hint/shortcut-hint.variables.d.ts +2 -0
- package/dist/components/shortcut-hint/shortcut-hint.variables.js +61 -0
- package/dist/components/skip-link/index.d.ts +4 -0
- package/dist/components/skip-link/index.js +180 -0
- package/dist/components/skip-link/skip-link.schema.d.ts +3 -0
- package/dist/components/skip-link/skip-link.schema.js +76 -0
- package/dist/components/skip-link/skip-link.svelte.d.ts +19 -0
- package/dist/components/skip-link/skip-link.types.d.ts +38 -0
- package/dist/components/skip-link/skip-link.variables.d.ts +2 -0
- package/dist/components/skip-link/skip-link.variables.js +61 -0
- package/dist/components/spectrogram/index.d.ts +5 -0
- package/dist/components/spectrogram/index.js +1156 -0
- package/dist/components/spectrogram/spectrogram.css +43 -0
- package/dist/components/spectrogram/spectrogram.schema.d.ts +3 -0
- package/dist/components/spectrogram/spectrogram.schema.js +103 -0
- package/dist/components/spectrogram/spectrogram.svelte.d.ts +21 -0
- package/dist/components/spectrogram/spectrogram.types.d.ts +60 -0
- package/dist/components/spectrogram/spectrogram.variables.d.ts +2 -0
- package/dist/components/spectrogram/spectrogram.variables.js +61 -0
- package/dist/components/spectrum-chart/index.d.ts +5 -0
- package/dist/components/spectrum-chart/index.js +1056 -0
- package/dist/components/spectrum-chart/spectrum-chart.css +49 -0
- package/dist/components/spectrum-chart/spectrum-chart.schema.d.ts +3 -0
- package/dist/components/spectrum-chart/spectrum-chart.schema.js +97 -0
- package/dist/components/spectrum-chart/spectrum-chart.svelte.d.ts +21 -0
- package/dist/components/spectrum-chart/spectrum-chart.types.d.ts +41 -0
- package/dist/components/spectrum-chart/spectrum-chart.variables.d.ts +2 -0
- package/dist/components/spectrum-chart/spectrum-chart.variables.js +61 -0
- package/dist/components/status-dot/status-dot.css +8 -0
- package/dist/components/status-dot/status-dot.schema.js +3 -3
- package/dist/components/status-dot/status-dot.types.d.ts +5 -2
- package/dist/components/subscription-badge/index.d.ts +5 -0
- package/dist/components/subscription-badge/index.js +383 -0
- package/dist/components/subscription-badge/subscription-badge.css +18 -0
- package/dist/components/subscription-badge/subscription-badge.schema.d.ts +3 -0
- package/dist/components/subscription-badge/subscription-badge.schema.js +77 -0
- package/dist/components/subscription-badge/subscription-badge.svelte.d.ts +19 -0
- package/dist/components/subscription-badge/subscription-badge.types.d.ts +28 -0
- package/dist/components/subscription-badge/subscription-badge.variables.d.ts +2 -0
- package/dist/components/subscription-badge/subscription-badge.variables.js +61 -0
- package/dist/components/tab/index.js +14 -1
- package/dist/components/table/index.js +26 -17
- package/dist/components/table-cell/index.js +18 -9
- package/dist/components/table-cell/table-cell.schema.js +5 -1
- package/dist/components/table-cell/table-cell.types.d.ts +16 -1
- package/dist/components/tabs/index.js +14 -1
- package/dist/components/waveform/index.d.ts +5 -0
- package/dist/components/waveform/index.js +1075 -0
- package/dist/components/waveform/waveform.css +53 -0
- package/dist/components/waveform/waveform.schema.d.ts +3 -0
- package/dist/components/waveform/waveform.schema.js +98 -0
- package/dist/components/waveform/waveform.svelte.d.ts +20 -0
- package/dist/components/waveform/waveform.types.d.ts +42 -0
- package/dist/components/waveform/waveform.variables.d.ts +2 -0
- package/dist/components/waveform/waveform.variables.js +61 -0
- package/dist/index.d.ts +33 -2
- package/dist/index.js +144 -115
- package/dist/server/components/accordion/index.js +14 -1
- package/dist/server/components/alert/alert.schema.js +3 -3
- package/dist/server/components/alert/index.js +3 -2
- package/dist/server/components/alert-dialog/index.js +12 -3
- package/dist/server/components/area-chart/index.css +50 -3
- package/dist/server/components/area-chart/index.js +181 -2
- package/dist/server/components/avatar-group/index.css +1 -1
- package/dist/server/components/badge/badge.schema.js +6 -1
- package/dist/server/components/badge/index.css +4 -0
- package/dist/server/components/badge/index.js +3 -1
- package/dist/server/components/bar-chart/index.css +50 -3
- package/dist/server/components/bar-chart/index.js +166 -2
- package/dist/server/components/button/index.css +1 -1
- package/dist/server/components/button/index.js +12 -3
- package/dist/server/components/capability-gate/capability-gate.schema.js +110 -0
- package/dist/server/components/capability-gate/capability-gate.variables.js +43 -0
- package/dist/server/components/capability-gate/index.css +121 -0
- package/dist/server/components/capability-gate/index.js +168 -0
- package/dist/server/components/card/card.schema.js +5 -1
- package/dist/server/components/card/index.css +9 -1
- package/dist/server/components/card/index.js +3 -2
- package/dist/server/components/chat/index.css +2 -2
- package/dist/server/components/chat/index.js +78 -19
- package/dist/server/components/choice-grid/choice-grid.schema.js +103 -0
- package/dist/server/components/choice-grid/choice-grid.variables.js +43 -0
- package/dist/server/components/choice-grid/index.css +103 -0
- package/dist/server/components/choice-grid/index.js +383 -0
- package/dist/server/components/choice-grid-item/choice-grid-item.schema.js +75 -0
- package/dist/server/components/choice-grid-item/choice-grid-item.variables.js +43 -0
- package/dist/server/components/choice-grid-item/index.css +86 -0
- package/dist/server/components/choice-grid-item/index.js +139 -0
- package/dist/server/components/color-field/index.css +2 -4
- package/dist/server/components/color-picker/index.css +14 -10
- package/dist/server/components/color-swatch-picker/index.css +2 -4
- package/dist/server/components/confirm-dialog/index.js +12 -3
- package/dist/server/components/context-menu/index.js +72 -20
- package/dist/server/components/context-menu-trigger/index.js +6 -4
- package/dist/server/components/data-table/data-table.schema.js +85 -0
- package/dist/server/components/data-table/data-table.variables.js +43 -0
- package/dist/server/components/data-table/index.css +182 -0
- package/dist/server/components/data-table/index.js +469 -0
- package/dist/server/components/diff-viewer/index.js +14 -3
- package/dist/server/components/dropdown/index.js +67 -17
- package/dist/server/components/dropdown-item/dropdown-item.schema.js +13 -1
- package/dist/server/components/dropdown-item/index.js +67 -17
- package/dist/server/components/floating-action-button/index.css +1 -1
- package/dist/server/components/json-schema-editor/index.js +29 -4
- package/dist/server/components/keyboard-shortcuts/index.css +86 -0
- package/dist/server/components/keyboard-shortcuts/index.js +149 -0
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.schema.js +69 -0
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.variables.js +43 -0
- package/dist/server/components/line-chart/index.css +50 -3
- package/dist/server/components/line-chart/index.js +181 -2
- package/dist/server/components/markdown-editor/index.js +78 -19
- package/dist/server/components/matrix-chart/index.css +52 -0
- package/dist/server/components/matrix-chart/index.js +1026 -0
- package/dist/server/components/matrix-chart/matrix-chart.schema.js +105 -0
- package/dist/server/components/matrix-chart/matrix-chart.variables.js +43 -0
- package/dist/server/components/media-controls/index.css +109 -0
- package/dist/server/components/media-controls/index.js +192 -0
- package/dist/server/components/media-controls/media-controls.schema.js +107 -0
- package/dist/server/components/media-controls/media-controls.variables.js +43 -0
- package/dist/server/components/navigation-bar/navigation-bar.schema.js +5 -5
- package/dist/server/components/pricing-card/index.css +131 -0
- package/dist/server/components/pricing-card/index.js +258 -0
- package/dist/server/components/pricing-card/pricing-card.schema.js +82 -0
- package/dist/server/components/pricing-card/pricing-card.variables.js +43 -0
- package/dist/server/components/review-editor/index.css +2 -2
- package/dist/server/components/review-editor/index.js +80 -19
- package/dist/server/components/share-card/index.css +113 -0
- package/dist/server/components/share-card/index.js +270 -0
- package/dist/server/components/share-card/share-card.schema.js +95 -0
- package/dist/server/components/share-card/share-card.variables.js +43 -0
- package/dist/server/components/shortcut-hint/index.css +28 -0
- package/dist/server/components/shortcut-hint/index.js +134 -0
- package/dist/server/components/shortcut-hint/shortcut-hint.schema.js +78 -0
- package/dist/server/components/shortcut-hint/shortcut-hint.variables.js +43 -0
- package/dist/server/components/skip-link/index.js +141 -0
- package/dist/server/components/skip-link/skip-link.schema.js +58 -0
- package/dist/server/components/skip-link/skip-link.variables.js +43 -0
- package/dist/server/components/spectrogram/index.css +45 -0
- package/dist/server/components/spectrogram/index.js +970 -0
- package/dist/server/components/spectrogram/spectrogram.schema.js +85 -0
- package/dist/server/components/spectrogram/spectrogram.variables.js +43 -0
- package/dist/server/components/spectrum-chart/index.css +51 -0
- package/dist/server/components/spectrum-chart/index.js +871 -0
- package/dist/server/components/spectrum-chart/spectrum-chart.schema.js +79 -0
- package/dist/server/components/spectrum-chart/spectrum-chart.variables.js +43 -0
- package/dist/server/components/status-dot/index.css +8 -0
- package/dist/server/components/status-dot/status-dot.schema.js +3 -3
- package/dist/server/components/subscription-badge/index.css +2 -0
- package/dist/server/components/subscription-badge/index.js +339 -0
- package/dist/server/components/subscription-badge/subscription-badge.schema.js +59 -0
- package/dist/server/components/subscription-badge/subscription-badge.variables.js +43 -0
- package/dist/server/components/tab/index.js +14 -1
- package/dist/server/components/table/index.js +13 -8
- package/dist/server/components/table-cell/index.js +13 -8
- package/dist/server/components/table-cell/table-cell.schema.js +5 -1
- package/dist/server/components/tabs/index.js +14 -1
- package/dist/server/components/waveform/index.css +55 -0
- package/dist/server/components/waveform/index.js +907 -0
- package/dist/server/components/waveform/waveform.schema.js +80 -0
- package/dist/server/components/waveform/waveform.variables.js +43 -0
- package/dist/server/index.css +1137 -55
- package/dist/server/index.js +4225 -1750
- package/package.json +380 -2
- package/src/_internal/chart/chart-focus-ring.ts +209 -0
- package/src/_internal/chart/chart-utilities.ts +4 -0
- package/src/_internal/chart/heatmap-utilities.ts +159 -0
- package/src/components/accordion/accordion.examples.json +1 -0
- package/src/components/alert/README.md +5 -5
- package/src/components/alert/alert.schema.json +2 -2
- package/src/components/alert/alert.schema.ts +3 -2
- package/src/components/alert/alert.svelte +5 -1
- package/src/components/alert/alert.types.ts +3 -2
- package/src/components/area-chart/README.md +62 -0
- package/src/components/area-chart/area-chart.css +57 -7
- package/src/components/area-chart/area-chart.svelte +128 -10
- package/src/components/avatar-group/avatar-group.css +2 -3
- package/src/components/avatar-group/avatar-group.examples.json +1 -0
- package/src/components/backdrop/README.md +56 -0
- package/src/components/badge/README.md +6 -5
- package/src/components/badge/badge.css +17 -0
- package/src/components/badge/badge.schema.json +5 -0
- package/src/components/badge/badge.schema.ts +6 -0
- package/src/components/badge/badge.svelte +2 -0
- package/src/components/badge/badge.types.ts +7 -0
- package/src/components/bar-chart/README.md +65 -0
- package/src/components/bar-chart/bar-chart.css +57 -7
- package/src/components/bar-chart/bar-chart.svelte +94 -13
- package/src/components/button/button.css +5 -3
- package/src/components/button/button.examples.json +1 -0
- package/src/components/button/button.svelte +15 -0
- package/src/components/capability-gate/README.md +60 -0
- package/src/components/capability-gate/capability-gate.css +131 -0
- package/src/components/capability-gate/capability-gate.examples.json +19 -0
- package/src/components/capability-gate/capability-gate.schema.json +68 -0
- package/src/components/capability-gate/capability-gate.schema.ts +72 -0
- package/src/components/capability-gate/capability-gate.svelte +186 -0
- package/src/components/capability-gate/capability-gate.types.ts +83 -0
- package/src/components/capability-gate/capability-gate.variables.json +1 -0
- package/src/components/capability-gate/capability-gate.variables.ts +3 -0
- package/src/components/capability-gate/index.ts +10 -0
- package/src/components/card/README.md +1 -0
- package/src/components/card/card.css +4 -0
- package/src/components/card/card.examples.json +6 -0
- package/src/components/card/card.schema.json +4 -0
- package/src/components/card/card.schema.ts +5 -0
- package/src/components/card/card.svelte +9 -2
- package/src/components/card/card.types.ts +4 -0
- package/src/components/card/index.ts +1 -1
- package/src/components/chat/README.md +81 -0
- package/src/components/chat/container/chat-jump-controls.svelte +12 -9
- package/src/components/chat/input/chat-input.svelte +7 -8
- package/src/components/chat/message/chat-message.svelte +15 -20
- package/src/components/chat/message/tool-call-group.svelte +10 -4
- package/src/components/choice-grid/README.md +66 -0
- package/src/components/choice-grid/choice-grid-context.ts +30 -0
- package/src/components/choice-grid/choice-grid.css +27 -0
- package/src/components/choice-grid/choice-grid.examples.json +31 -0
- package/src/components/choice-grid/choice-grid.schema.json +61 -0
- package/src/components/choice-grid/choice-grid.schema.ts +70 -0
- package/src/components/choice-grid/choice-grid.svelte +272 -0
- package/src/components/choice-grid/choice-grid.types.ts +152 -0
- package/src/components/choice-grid/choice-grid.variables.json +1 -0
- package/src/components/choice-grid/choice-grid.variables.ts +3 -0
- package/src/components/choice-grid/index.ts +22 -0
- package/src/components/choice-grid-item/README.md +41 -0
- package/src/components/choice-grid-item/choice-grid-item.css +139 -0
- package/src/components/choice-grid-item/choice-grid-item.schema.json +32 -0
- package/src/components/choice-grid-item/choice-grid-item.schema.ts +38 -0
- package/src/components/choice-grid-item/choice-grid-item.svelte +139 -0
- package/src/components/choice-grid-item/choice-grid-item.types.ts +30 -0
- package/src/components/choice-grid-item/choice-grid-item.variables.json +1 -0
- package/src/components/choice-grid-item/choice-grid-item.variables.ts +3 -0
- package/src/components/choice-grid-item/index.ts +6 -0
- package/src/components/click-away-listener/README.md +50 -0
- package/src/components/color-field/color-field.css +6 -9
- package/src/components/color-picker/color-picker.css +31 -24
- package/src/components/color-swatch-picker/color-swatch-picker.css +6 -9
- package/src/components/command-menu/README.md +61 -0
- package/src/components/confirm-dialog/confirm-dialog.examples.json +6 -0
- package/src/components/context-menu/README.md +55 -0
- package/src/components/context-menu-trigger/README.md +50 -0
- package/src/components/context-menu-trigger/context-menu-trigger.svelte +5 -3
- package/src/components/data-table/README.md +67 -0
- package/src/components/data-table/data-table.css +30 -0
- package/src/components/data-table/data-table.examples.json +19 -0
- package/src/components/data-table/data-table.schema.json +43 -0
- package/src/components/data-table/data-table.schema.ts +50 -0
- package/src/components/data-table/data-table.svelte +106 -0
- package/src/components/data-table/data-table.types.ts +89 -0
- package/src/components/data-table/data-table.variables.json +1 -0
- package/src/components/data-table/data-table.variables.ts +3 -0
- package/src/components/data-table/index.ts +6 -0
- package/src/components/diff-viewer/README.md +59 -0
- package/src/components/diff-viewer/front-matter-header.svelte +20 -4
- package/src/components/dropdown-group/README.md +52 -0
- package/src/components/dropdown-item/README.md +10 -7
- package/src/components/dropdown-item/dropdown-item.schema.json +12 -0
- package/src/components/dropdown-item/dropdown-item.schema.ts +14 -0
- package/src/components/dropdown-item/dropdown-item.svelte +108 -25
- package/src/components/dropdown-item/dropdown-item.types.ts +58 -2
- package/src/components/dropdown-item/index.ts +6 -1
- package/src/components/floating-action-button/README.md +53 -0
- package/src/components/floating-action-button/floating-action-button.css +4 -2
- package/src/components/form-section/form-section.examples.json +6 -0
- package/src/components/hover-card/README.md +60 -0
- package/src/components/json-schema-editor/README.md +59 -0
- package/src/components/kanban-board/README.md +62 -0
- package/src/components/keyboard-shortcuts/README.md +51 -0
- package/src/components/keyboard-shortcuts/index.ts +10 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.css +84 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.examples.json +13 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.json +27 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.ts +31 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.svelte +91 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.types.ts +46 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.json +1 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.ts +3 -0
- package/src/components/line-chart/README.md +61 -0
- package/src/components/line-chart/line-chart.css +57 -8
- package/src/components/line-chart/line-chart.svelte +128 -10
- package/src/components/link/README.md +55 -0
- package/src/components/markdown-editor/README.md +70 -0
- package/src/components/markdown-editor/editor-toolbar/toolbar-button.svelte +9 -4
- package/src/components/markdown-editor/editor-toolbar/toolbar-dropdown.svelte +9 -4
- package/src/components/markdown-editor/prosemirror.css +4 -2
- package/src/components/matrix-chart/README.md +61 -0
- package/src/components/matrix-chart/index.ts +10 -0
- package/src/components/matrix-chart/matrix-chart.css +50 -0
- package/src/components/matrix-chart/matrix-chart.examples.json +19 -0
- package/src/components/matrix-chart/matrix-chart.schema.json +63 -0
- package/src/components/matrix-chart/matrix-chart.schema.ts +67 -0
- package/src/components/matrix-chart/matrix-chart.svelte +336 -0
- package/src/components/matrix-chart/matrix-chart.types.ts +56 -0
- package/src/components/matrix-chart/matrix-chart.variables.json +1 -0
- package/src/components/matrix-chart/matrix-chart.variables.ts +3 -0
- package/src/components/media-controls/README.md +60 -0
- package/src/components/media-controls/index.ts +6 -0
- package/src/components/media-controls/media-controls.css +112 -0
- package/src/components/media-controls/media-controls.examples.json +19 -0
- package/src/components/media-controls/media-controls.schema.json +65 -0
- package/src/components/media-controls/media-controls.schema.ts +69 -0
- package/src/components/media-controls/media-controls.svelte +238 -0
- package/src/components/media-controls/media-controls.types.ts +80 -0
- package/src/components/media-controls/media-controls.variables.json +1 -0
- package/src/components/media-controls/media-controls.variables.ts +3 -0
- package/src/components/menu-bar/README.md +53 -0
- package/src/components/navigation-bar/README.md +1 -1
- package/src/components/navigation-bar/navigation-bar.schema.json +4 -4
- package/src/components/navigation-bar/navigation-bar.schema.ts +4 -4
- package/src/components/navigation-bar/navigation-bar.types.ts +2 -1
- package/src/components/pricing-card/README.md +55 -0
- package/src/components/pricing-card/index.ts +6 -0
- package/src/components/pricing-card/pricing-card.css +173 -0
- package/src/components/pricing-card/pricing-card.examples.json +19 -0
- package/src/components/pricing-card/pricing-card.schema.json +40 -0
- package/src/components/pricing-card/pricing-card.schema.ts +44 -0
- package/src/components/pricing-card/pricing-card.svelte +70 -0
- package/src/components/pricing-card/pricing-card.types.ts +49 -0
- package/src/components/pricing-card/pricing-card.variables.json +1 -0
- package/src/components/pricing-card/pricing-card.variables.ts +3 -0
- package/src/components/review-editor/README.md +64 -0
- package/src/components/review-editor/comment-composer.svelte +8 -8
- package/src/components/review-editor/comment-list.svelte +10 -1
- package/src/components/search-field/search-field.examples.json +13 -0
- package/src/components/segment/README.md +55 -0
- package/src/components/share-card/README.md +58 -0
- package/src/components/share-card/index.ts +6 -0
- package/src/components/share-card/share-card.css +115 -0
- package/src/components/share-card/share-card.examples.json +19 -0
- package/src/components/share-card/share-card.schema.json +53 -0
- package/src/components/share-card/share-card.schema.ts +57 -0
- package/src/components/share-card/share-card.svelte +330 -0
- package/src/components/share-card/share-card.types.ts +69 -0
- package/src/components/share-card/share-card.variables.json +1 -0
- package/src/components/share-card/share-card.variables.ts +3 -0
- package/src/components/shortcut-hint/README.md +52 -0
- package/src/components/shortcut-hint/index.ts +6 -0
- package/src/components/shortcut-hint/shortcut-hint.css +26 -0
- package/src/components/shortcut-hint/shortcut-hint.examples.json +13 -0
- package/src/components/shortcut-hint/shortcut-hint.schema.json +36 -0
- package/src/components/shortcut-hint/shortcut-hint.schema.ts +40 -0
- package/src/components/shortcut-hint/shortcut-hint.svelte +62 -0
- package/src/components/shortcut-hint/shortcut-hint.types.ts +35 -0
- package/src/components/shortcut-hint/shortcut-hint.variables.json +1 -0
- package/src/components/shortcut-hint/shortcut-hint.variables.ts +3 -0
- package/src/components/side-navigation/side-navigation.examples.json +6 -0
- package/src/components/skip-link/README.md +50 -0
- package/src/components/skip-link/index.ts +5 -0
- package/src/components/skip-link/skip-link.examples.json +13 -0
- package/src/components/skip-link/skip-link.schema.json +16 -0
- package/src/components/skip-link/skip-link.schema.ts +20 -0
- package/src/components/skip-link/skip-link.svelte +86 -0
- package/src/components/skip-link/skip-link.types.ts +40 -0
- package/src/components/skip-link/skip-link.variables.json +1 -0
- package/src/components/skip-link/skip-link.variables.ts +3 -0
- package/src/components/spectrogram/README.md +58 -0
- package/src/components/spectrogram/index.ts +10 -0
- package/src/components/spectrogram/spectrogram.css +43 -0
- package/src/components/spectrogram/spectrogram.examples.json +13 -0
- package/src/components/spectrogram/spectrogram.schema.json +43 -0
- package/src/components/spectrogram/spectrogram.schema.ts +47 -0
- package/src/components/spectrogram/spectrogram.svelte +284 -0
- package/src/components/spectrogram/spectrogram.types.ts +63 -0
- package/src/components/spectrogram/spectrogram.variables.json +1 -0
- package/src/components/spectrogram/spectrogram.variables.ts +3 -0
- package/src/components/spectrum-chart/README.md +57 -0
- package/src/components/spectrum-chart/index.ts +10 -0
- package/src/components/spectrum-chart/spectrum-chart.css +49 -0
- package/src/components/spectrum-chart/spectrum-chart.examples.json +13 -0
- package/src/components/spectrum-chart/spectrum-chart.schema.json +37 -0
- package/src/components/spectrum-chart/spectrum-chart.schema.ts +41 -0
- package/src/components/spectrum-chart/spectrum-chart.svelte +247 -0
- package/src/components/spectrum-chart/spectrum-chart.types.ts +44 -0
- package/src/components/spectrum-chart/spectrum-chart.variables.json +1 -0
- package/src/components/spectrum-chart/spectrum-chart.variables.ts +3 -0
- package/src/components/status-dot/README.md +7 -7
- package/src/components/status-dot/status-dot.css +8 -0
- package/src/components/status-dot/status-dot.schema.json +2 -2
- package/src/components/status-dot/status-dot.schema.ts +3 -2
- package/src/components/status-dot/status-dot.types.ts +13 -2
- package/src/components/subscription-badge/README.md +50 -0
- package/src/components/subscription-badge/index.ts +6 -0
- package/src/components/subscription-badge/subscription-badge.css +18 -0
- package/src/components/subscription-badge/subscription-badge.examples.json +19 -0
- package/src/components/subscription-badge/subscription-badge.schema.json +16 -0
- package/src/components/subscription-badge/subscription-badge.schema.ts +21 -0
- package/src/components/subscription-badge/subscription-badge.svelte +69 -0
- package/src/components/subscription-badge/subscription-badge.types.ts +37 -0
- package/src/components/subscription-badge/subscription-badge.variables.json +1 -0
- package/src/components/subscription-badge/subscription-badge.variables.ts +3 -0
- package/src/components/table-cell/README.md +6 -5
- package/src/components/table-cell/table-cell.schema.json +4 -0
- package/src/components/table-cell/table-cell.schema.ts +5 -0
- package/src/components/table-cell/table-cell.svelte +9 -3
- package/src/components/table-cell/table-cell.types.ts +16 -1
- package/src/components/tag-input/README.md +75 -0
- package/src/components/typography/README.md +51 -0
- package/src/components/waveform/README.md +57 -0
- package/src/components/waveform/index.ts +6 -0
- package/src/components/waveform/waveform.css +53 -0
- package/src/components/waveform/waveform.examples.json +19 -0
- package/src/components/waveform/waveform.schema.json +38 -0
- package/src/components/waveform/waveform.schema.ts +42 -0
- package/src/components/waveform/waveform.svelte +286 -0
- package/src/components/waveform/waveform.types.ts +45 -0
- package/src/components/waveform/waveform.variables.json +1 -0
- package/src/components/waveform/waveform.variables.ts +3 -0
- package/src/index.ts +85 -2
- package/src/styles/components.css +13 -0
- package/src/styles/shell.css +3 -0
- package/src/styles/tokens-base.css +59 -22
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* @cinder
|
|
4
|
+
* @category data-display
|
|
5
|
+
* @status alpha
|
|
6
|
+
* @purpose Data-driven convenience wrapper over the compositional Table family that renders a full semantic table from a columns array and a rows array.
|
|
7
|
+
* @tag table
|
|
8
|
+
* @tag data
|
|
9
|
+
* @useWhen Rendering a structured dataset where columns and rows are known at runtime (e.g. API responses, config-driven dashboards).
|
|
10
|
+
* @useWhen You want correct scope=col / scope=row semantics and aria-sort wiring without writing Table.Header / Table.Body manually.
|
|
11
|
+
* @avoidWhen You need custom cell rendering, interactive cells, nested components, or column spanning — use the compositional Table family directly.
|
|
12
|
+
* @avoidWhen You need row selection — DataTable does not expose a selection prop; use Table with selectable instead.
|
|
13
|
+
* @related table, table-header, table-body, table-row, table-cell, table-header-cell
|
|
14
|
+
*/
|
|
15
|
+
export type { DataTableColumn, DataTableProps, DataTableRow } from './data-table.types.ts';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" generics="Row extends DataTableRow">
|
|
19
|
+
import TableBody from '../table-body/table-body.svelte';
|
|
20
|
+
import TableCell from '../table-cell/table-cell.svelte';
|
|
21
|
+
import TableHeaderCell from '../table-header-cell/table-header-cell.svelte';
|
|
22
|
+
import TableHeader from '../table-header/table-header.svelte';
|
|
23
|
+
import TableRow from '../table-row/table-row.svelte';
|
|
24
|
+
import TableRoot from '../table/table.svelte';
|
|
25
|
+
|
|
26
|
+
import { classNames } from '../../utilities/class-names.ts';
|
|
27
|
+
import type { DataTableColumn, DataTableProps, DataTableRow } from './data-table.types.ts';
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
columns,
|
|
31
|
+
rows,
|
|
32
|
+
caption,
|
|
33
|
+
sort = $bindable(),
|
|
34
|
+
stickyHeader = false,
|
|
35
|
+
density = 'comfortable',
|
|
36
|
+
scrollable = false,
|
|
37
|
+
class: className,
|
|
38
|
+
}: DataTableProps<Row> = $props();
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The key of the row-header column. Explicitly set via `column.rowHeader === true`,
|
|
42
|
+
* or falls back to the first column's key. Used to render `<th scope="row">` on
|
|
43
|
+
* the appropriate body cell.
|
|
44
|
+
*/
|
|
45
|
+
const rowHeaderKey = $derived(
|
|
46
|
+
(columns.find((column) => column.rowHeader === true) ?? columns[0])?.key,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Map a DataTableColumn's `align` value to the value accepted by TableHeaderCell
|
|
51
|
+
* and TableCell (`'left' | 'center' | 'right'`).
|
|
52
|
+
*/
|
|
53
|
+
function mapAlign(align: DataTableColumn['align']): 'left' | 'center' | 'right' | undefined {
|
|
54
|
+
if (align === 'start') return 'left';
|
|
55
|
+
if (align === 'end') return 'right';
|
|
56
|
+
if (align === 'center') return 'center';
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
{#snippet table()}
|
|
62
|
+
<TableRoot {...caption !== undefined ? { caption } : {}} {stickyHeader} {density} bind:sort>
|
|
63
|
+
<TableHeader>
|
|
64
|
+
<TableRow>
|
|
65
|
+
{#each columns as column (column.key)}
|
|
66
|
+
<TableHeaderCell
|
|
67
|
+
{...column.sortable ? { column: column.key } : {}}
|
|
68
|
+
sortable={column.sortable ?? false}
|
|
69
|
+
align={mapAlign(column.align) ?? 'left'}
|
|
70
|
+
>
|
|
71
|
+
{column.label}
|
|
72
|
+
</TableHeaderCell>
|
|
73
|
+
{/each}
|
|
74
|
+
</TableRow>
|
|
75
|
+
</TableHeader>
|
|
76
|
+
<TableBody>
|
|
77
|
+
<!-- Key by positional index, not the row-header value: row-header values
|
|
78
|
+
(names, labels, statuses) are display data and are NOT guaranteed
|
|
79
|
+
unique, so keying by them would corrupt row identity when two rows
|
|
80
|
+
share a value. DataTable does not reorder rows itself, so the index
|
|
81
|
+
is a stable identity for the consumer-owned ordering. -->
|
|
82
|
+
{#each rows as row, rowIndex (rowIndex)}
|
|
83
|
+
<TableRow>
|
|
84
|
+
{#each columns as column (column.key)}
|
|
85
|
+
<TableCell
|
|
86
|
+
as={column.key === rowHeaderKey ? 'th' : 'td'}
|
|
87
|
+
align={mapAlign(column.align) ?? 'left'}
|
|
88
|
+
>
|
|
89
|
+
{row[column.key]}
|
|
90
|
+
</TableCell>
|
|
91
|
+
{/each}
|
|
92
|
+
</TableRow>
|
|
93
|
+
{/each}
|
|
94
|
+
</TableBody>
|
|
95
|
+
</TableRoot>
|
|
96
|
+
{/snippet}
|
|
97
|
+
|
|
98
|
+
{#if scrollable}
|
|
99
|
+
<div class={classNames('cinder-data-table', 'cinder-table-scroll', className)}>
|
|
100
|
+
{@render table()}
|
|
101
|
+
</div>
|
|
102
|
+
{:else}
|
|
103
|
+
<div class={classNames('cinder-data-table', className)}>
|
|
104
|
+
{@render table()}
|
|
105
|
+
</div>
|
|
106
|
+
{/if}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { TableDensity, TableSort } from '../table/table.types.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A generic record type representing a single data row.
|
|
5
|
+
* Keys are strings; values may be anything renderable.
|
|
6
|
+
*/
|
|
7
|
+
export type DataTableRow = Record<string, unknown>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Column descriptor for a DataTable.
|
|
11
|
+
*
|
|
12
|
+
* @template Row - The row record type. Defaults to `DataTableRow`.
|
|
13
|
+
*/
|
|
14
|
+
export type DataTableColumn<Row extends DataTableRow = DataTableRow> = {
|
|
15
|
+
/**
|
|
16
|
+
* The key used to read the cell value from each row object.
|
|
17
|
+
* Should be a key of `Row` when Row is a typed record.
|
|
18
|
+
*/
|
|
19
|
+
key: keyof Row & string;
|
|
20
|
+
/** Human-readable column label rendered in the `<th scope="col">` header cell. */
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* When true, the header cell renders a sort button and reports `aria-sort`.
|
|
24
|
+
* Sort state is controlled by the consumer via the `sort` bindable — DataTable
|
|
25
|
+
* never reorders rows itself.
|
|
26
|
+
*/
|
|
27
|
+
sortable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Horizontal alignment for both the header and body cells of this column.
|
|
30
|
+
* - `'start'` maps to left-aligned text (default).
|
|
31
|
+
* - `'center'` maps to centered text.
|
|
32
|
+
* - `'end'` maps to right-aligned text with `font-variant-numeric: tabular-nums`.
|
|
33
|
+
*/
|
|
34
|
+
align?: 'start' | 'center' | 'end';
|
|
35
|
+
/**
|
|
36
|
+
* When true, the body cells in this column render as `<th scope="row">` instead
|
|
37
|
+
* of `<td>`, identifying this column as the row-header for assistive technology.
|
|
38
|
+
*
|
|
39
|
+
* At most one column should set `rowHeader: true`. If no column sets it, the
|
|
40
|
+
* first column automatically acts as the row header.
|
|
41
|
+
*/
|
|
42
|
+
rowHeader?: boolean;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Props for the DataTable component.
|
|
47
|
+
*
|
|
48
|
+
* DataTable is a data-driven convenience wrapper over the compositional Table family.
|
|
49
|
+
* It accepts an array of column descriptors and row records and renders the correct
|
|
50
|
+
* semantic table markup automatically. For full compositional control, use Table,
|
|
51
|
+
* Table.Header, Table.Body, Table.Row, Table.HeaderCell, and Table.Cell directly.
|
|
52
|
+
*
|
|
53
|
+
* @template Row - The row record type. Defaults to `DataTableRow`.
|
|
54
|
+
*/
|
|
55
|
+
export type DataTableProps<Row extends DataTableRow = DataTableRow> = {
|
|
56
|
+
/** Column descriptors defining the headers and cell rendering for each column. */
|
|
57
|
+
columns: DataTableColumn<Row>[];
|
|
58
|
+
/** Row data. Each entry is read via `column.key` for each column. */
|
|
59
|
+
rows: Row[];
|
|
60
|
+
/** Visual caption rendered as a `<caption>` element above the table. */
|
|
61
|
+
caption?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Bound sort state. When the user activates a sortable header cell, this prop
|
|
64
|
+
* is updated with the new `{ column, direction }`. The consumer is responsible
|
|
65
|
+
* for reordering `rows` in response — DataTable does not sort internally.
|
|
66
|
+
*
|
|
67
|
+
* Pass `undefined` initially when no column is sorted; the component will never
|
|
68
|
+
* write back `undefined` itself (sort always toggles to a column).
|
|
69
|
+
*/
|
|
70
|
+
sort?: TableSort | undefined;
|
|
71
|
+
/** When true, the header sticks to the top of the scrolling container. */
|
|
72
|
+
stickyHeader?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Vertical padding density for header and body cells.
|
|
75
|
+
* Defaults to `'comfortable'`.
|
|
76
|
+
*/
|
|
77
|
+
density?: TableDensity;
|
|
78
|
+
/**
|
|
79
|
+
* When true, wraps the table in a `.cinder-table-scroll` container that
|
|
80
|
+
* enables horizontal overflow scrolling on small viewports.
|
|
81
|
+
*/
|
|
82
|
+
scrollable?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Additional class names merged onto DataTable's root wrapper element (the
|
|
85
|
+
* `<div class="cinder-data-table">` that contains the table). To style the
|
|
86
|
+
* `<table>` itself, target `.cinder-data-table table` from this class.
|
|
87
|
+
*/
|
|
88
|
+
class?: string;
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# DiffViewer
|
|
2
|
+
|
|
3
|
+
Side-by-side or unified Markdown diff surface with hunk grouping, word-level inline changes, and size-based debounce gating.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { DiffViewer } from '@lostgradient/cinder/diff-viewer';
|
|
10
|
+
</script>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Guidance
|
|
14
|
+
|
|
15
|
+
### Use When
|
|
16
|
+
|
|
17
|
+
- Comparing two Markdown documents and wanting the bundled toolbar, view-mode toggle, front-matter handling, and large-payload safeguards.
|
|
18
|
+
- Building a review workflow that needs hunked, line-anchored Markdown diffs out of the box as a heavyweight suite.
|
|
19
|
+
|
|
20
|
+
### Avoid When
|
|
21
|
+
|
|
22
|
+
- Showing only a counts summary — use diff-statistics on its own for a lightweight presentation.
|
|
23
|
+
- Diffing non-Markdown source code where syntax-aware highlighting matters more than prose-aware rendering.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
<!-- generated:props:start -->
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Required | Default | Description |
|
|
30
|
+
| ----------------- | ---------------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `class` | `string` | no | — | Additional CSS classes |
|
|
32
|
+
| `current` | `string` | yes | — | The current/modified text |
|
|
33
|
+
| `normalizeInputs` | `boolean` | no | — | Whether to normalize markdown inputs before comparison. When true (default), both original and current are normalized to canonical form before diffing, preventing false positives from formatting differences. |
|
|
34
|
+
| `original` | `string` | yes | — | The original/baseline text |
|
|
35
|
+
| `readonly` | `boolean` | no | — | Whether the viewer is read-only (hides revert buttons) |
|
|
36
|
+
| `viewMode` | `"unified"` \| `"final"` \| `"original"` | no | — | Bindable: reactive access to current view mode. Parent components can bind to control or observe the view mode. |
|
|
37
|
+
| `hunks` | `(opaque)` | no | — | A prop whose shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
38
|
+
| `onrevertall` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
39
|
+
| `onreverthunk` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
40
|
+
| `toolbar` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
41
|
+
| `toolbarActions` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
42
|
+
|
|
43
|
+
<!-- generated:props:end -->
|
|
44
|
+
|
|
45
|
+
## CSS Variables
|
|
46
|
+
|
|
47
|
+
<!-- generated:variables:start -->
|
|
48
|
+
|
|
49
|
+
This component does not declare any local CSS variables.
|
|
50
|
+
|
|
51
|
+
<!-- generated:variables:end -->
|
|
52
|
+
|
|
53
|
+
## Subcomponents
|
|
54
|
+
|
|
55
|
+
<!-- generated:subcomponents:start -->
|
|
56
|
+
|
|
57
|
+
None.
|
|
58
|
+
|
|
59
|
+
<!-- generated:subcomponents:end -->
|
|
@@ -142,10 +142,26 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.front-matter-header:focus-visible {
|
|
145
|
-
outline:
|
|
146
|
-
box-shadow:
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
outline: var(--cinder-ring-width) solid transparent;
|
|
146
|
+
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.front-matter-header[data-variant='inline']:focus-visible {
|
|
150
|
+
outline: var(--cinder-ring-width) solid transparent;
|
|
151
|
+
box-shadow: inset 0 0 0 var(--cinder-ring-width)
|
|
152
|
+
var(--_cinder-front-matter-header-ring, var(--cinder-ring-color));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@media (forced-colors: active) {
|
|
156
|
+
.front-matter-header:focus-visible {
|
|
157
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
158
|
+
outline-offset: 3px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.front-matter-header[data-variant='inline']:focus-visible {
|
|
162
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
163
|
+
outline-offset: calc(var(--cinder-ring-width) * -1);
|
|
164
|
+
}
|
|
149
165
|
}
|
|
150
166
|
|
|
151
167
|
.front-matter-icon {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# DropdownGroup
|
|
2
|
+
|
|
3
|
+
Accessible group boundary that clusters related dropdown-item rows inside a dropdown-menu.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { DropdownGroup } from '@lostgradient/cinder/dropdown-group';
|
|
10
|
+
</script>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Guidance
|
|
14
|
+
|
|
15
|
+
### Use When
|
|
16
|
+
|
|
17
|
+
- Grouping related dropdown actions under one accessible heading.
|
|
18
|
+
- Pairing dropdown-label with a role='group' container inside dropdown-menu.
|
|
19
|
+
|
|
20
|
+
### Avoid When
|
|
21
|
+
|
|
22
|
+
- Rendering a clickable row — use dropdown-item.
|
|
23
|
+
- Separating sections without a group label — use dropdown-separator.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
<!-- generated:props:start -->
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Required | Default | Description |
|
|
30
|
+
| ------------ | ---------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `ariaLabel` | `string` | no | — | |
|
|
32
|
+
| `class` | `string` | no | — | Additional class names merged onto the group root. |
|
|
33
|
+
| `labelledBy` | `string` | no | — | |
|
|
34
|
+
| `children` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
35
|
+
|
|
36
|
+
<!-- generated:props:end -->
|
|
37
|
+
|
|
38
|
+
## CSS Variables
|
|
39
|
+
|
|
40
|
+
<!-- generated:variables:start -->
|
|
41
|
+
|
|
42
|
+
This component does not declare any local CSS variables.
|
|
43
|
+
|
|
44
|
+
<!-- generated:variables:end -->
|
|
45
|
+
|
|
46
|
+
## Subcomponents
|
|
47
|
+
|
|
48
|
+
<!-- generated:subcomponents:start -->
|
|
49
|
+
|
|
50
|
+
None.
|
|
51
|
+
|
|
52
|
+
<!-- generated:subcomponents:end -->
|
|
@@ -14,13 +14,16 @@ snippet. The flat `@lostgradient/cinder/dropdown-item` subpath remains exported
|
|
|
14
14
|
|
|
15
15
|
<!-- generated:props:start -->
|
|
16
16
|
|
|
17
|
-
| Prop | Type
|
|
18
|
-
| --------------- |
|
|
19
|
-
| `class` | `string`
|
|
20
|
-
| `closeOnSelect` | `boolean`
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
17
|
+
| Prop | Type | Required | Default | Description |
|
|
18
|
+
| --------------- | ------------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `class` | `string` | no | — | |
|
|
20
|
+
| `closeOnSelect` | `boolean` | no | — | |
|
|
21
|
+
| `disabled` | `boolean` | no | — | When true the item is inert: click is blocked and aria-disabled is set. |
|
|
22
|
+
| `href` | `string` | no | — | Destination URL. Any defined value — including an empty string — selects the anchor branch and renders an `<a>`. Omit `href` entirely to render a `<button>`. |
|
|
23
|
+
| `inset` | `boolean` | no | — | |
|
|
24
|
+
| `type` | `"button"` \| `"submit"` \| `"reset"` | no | — | Button type forwarded to the `<button>` element. Defaults to `"button"`. NOTE: `type="submit"` only submits a surrounding `<form>` when the menu stays inside that form's DOM subtree. DropdownMenu portals its panel to `document.body` on the non-popover fallback path, so a submit item is then NOT a form descendant and native submission is skipped. To submit a form from a portaled menu, set `form="<form-id>"` to associate the button with the form by id, or handle submission in `onclick`. |
|
|
25
|
+
| `variant` | `"default"` \| `"danger"` | no | — | |
|
|
26
|
+
| `children` | `(opaque)` | no | — | A function or snippet prop. Its shape is not captured by the JSON schema; see the component types for the exact signature. |
|
|
24
27
|
|
|
25
28
|
<!-- generated:props:end -->
|
|
26
29
|
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
},
|
|
14
14
|
"class": {
|
|
15
15
|
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"disabled": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "When true the item is inert: click is blocked and aria-disabled is set."
|
|
20
|
+
},
|
|
21
|
+
"href": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Destination URL. Any defined value — including an empty string — selects\nthe anchor branch and renders an `<a>`. Omit `href` entirely to render a\n`<button>`."
|
|
24
|
+
},
|
|
25
|
+
"type": {
|
|
26
|
+
"enum": ["button", "submit", "reset"],
|
|
27
|
+
"description": "Button type forwarded to the `<button>` element. Defaults to `\"button\"`.\n\nNOTE: `type=\"submit\"` only submits a surrounding `<form>` when the menu\nstays inside that form's DOM subtree. DropdownMenu portals its panel to\n`document.body` on the non-popover fallback path, so a submit item is then\nNOT a form descendant and native submission is skipped. To submit a form\nfrom a portaled menu, set `form=\"<form-id>\"` to associate the button with\nthe form by id, or handle submission in `onclick`."
|
|
16
28
|
}
|
|
17
29
|
},
|
|
18
30
|
"additionalProperties": false,
|
|
@@ -16,6 +16,20 @@ const schema = {
|
|
|
16
16
|
class: {
|
|
17
17
|
type: 'string',
|
|
18
18
|
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
description: 'When true the item is inert: click is blocked and aria-disabled is set.',
|
|
22
|
+
},
|
|
23
|
+
href: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description:
|
|
26
|
+
'Destination URL. Any defined value — including an empty string — selects\nthe anchor branch and renders an `<a>`. Omit `href` entirely to render a\n`<button>`.',
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
enum: ['button', 'submit', 'reset'],
|
|
30
|
+
description:
|
|
31
|
+
'Button type forwarded to the `<button>` element. Defaults to `"button"`.\n\nNOTE: `type="submit"` only submits a surrounding `<form>` when the menu\nstays inside that form\'s DOM subtree. DropdownMenu portals its panel to\n`document.body` on the non-popover fallback path, so a submit item is then\nNOT a form descendant and native submission is skipped. To submit a form\nfrom a portaled menu, set `form="<form-id>"` to associate the button with\nthe form by id, or handle submission in `onclick`.',
|
|
32
|
+
},
|
|
19
33
|
},
|
|
20
34
|
additionalProperties: false,
|
|
21
35
|
metadata: {
|
|
@@ -12,10 +12,17 @@
|
|
|
12
12
|
* @avoidWhen Grouping a static heading row above menu items — use dropdown-label.
|
|
13
13
|
* @related dropdown, dropdown-menu, dropdown-label, dropdown-separator
|
|
14
14
|
*/
|
|
15
|
-
export type {
|
|
15
|
+
export type {
|
|
16
|
+
DropdownItemAnchorProps,
|
|
17
|
+
DropdownItemButtonProps,
|
|
18
|
+
DropdownItemProps,
|
|
19
|
+
DropdownItemVariant,
|
|
20
|
+
} from './dropdown-item.types.ts';
|
|
16
21
|
</script>
|
|
17
22
|
|
|
18
23
|
<script lang="ts">
|
|
24
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
25
|
+
|
|
19
26
|
import type { DropdownItemProps } from './dropdown-item.types.ts';
|
|
20
27
|
|
|
21
28
|
import { classNames } from '../../utilities/class-names.ts';
|
|
@@ -28,27 +35,88 @@
|
|
|
28
35
|
closeOnSelect = true,
|
|
29
36
|
class: customClassName,
|
|
30
37
|
onclick,
|
|
38
|
+
onkeydown,
|
|
39
|
+
href,
|
|
31
40
|
children,
|
|
32
41
|
...rest
|
|
33
42
|
}: DropdownItemProps = $props();
|
|
34
43
|
|
|
35
44
|
const context = getDropdownContext();
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
const isLink = $derived(href !== undefined);
|
|
47
|
+
|
|
48
|
+
const sharedClass = $derived(
|
|
49
|
+
classNames(
|
|
50
|
+
'cinder-_option-row',
|
|
51
|
+
'cinder-dropdown-item',
|
|
52
|
+
inset && 'cinder-dropdown-item--inset',
|
|
53
|
+
customClassName,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
type ButtonClickHandler = (
|
|
38
58
|
event: MouseEvent & { currentTarget: EventTarget & HTMLButtonElement },
|
|
39
59
|
) => void;
|
|
40
60
|
|
|
61
|
+
type AnchorClickHandler = (
|
|
62
|
+
event: MouseEvent & { currentTarget: EventTarget & HTMLAnchorElement },
|
|
63
|
+
) => void;
|
|
64
|
+
|
|
41
65
|
function handleClick(
|
|
42
|
-
event: MouseEvent & { currentTarget: EventTarget & HTMLButtonElement },
|
|
66
|
+
event: MouseEvent & { currentTarget: EventTarget & (HTMLButtonElement | HTMLAnchorElement) },
|
|
43
67
|
): void {
|
|
44
|
-
if (disabled)
|
|
68
|
+
if (disabled) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
45
72
|
if (typeof onclick === 'function') {
|
|
46
|
-
|
|
73
|
+
if (isLink) {
|
|
74
|
+
(onclick as AnchorClickHandler)(
|
|
75
|
+
event as MouseEvent & { currentTarget: EventTarget & HTMLAnchorElement },
|
|
76
|
+
);
|
|
77
|
+
} else {
|
|
78
|
+
(onclick as ButtonClickHandler)(
|
|
79
|
+
event as MouseEvent & { currentTarget: EventTarget & HTMLButtonElement },
|
|
80
|
+
);
|
|
81
|
+
}
|
|
47
82
|
}
|
|
48
83
|
if (closeOnSelect) {
|
|
49
84
|
context.close();
|
|
50
85
|
}
|
|
51
86
|
}
|
|
87
|
+
|
|
88
|
+
type AnchorKeydownHandler = (
|
|
89
|
+
event: KeyboardEvent & { currentTarget: EventTarget & HTMLAnchorElement },
|
|
90
|
+
) => void;
|
|
91
|
+
|
|
92
|
+
// A native `<a>` activates on Enter but NOT Space, whereas a `<button>` (and
|
|
93
|
+
// the WAI-ARIA menuitem pattern) activates on both. Without this, Space on a
|
|
94
|
+
// link row would scroll the page instead of following the row — inconsistent
|
|
95
|
+
// with button rows. Translate Space into an activation click on the anchor,
|
|
96
|
+
// while still forwarding any consumer-provided onkeydown handler (which runs
|
|
97
|
+
// first and may preventDefault to opt out of Space-to-activate).
|
|
98
|
+
function handleAnchorKeydown(
|
|
99
|
+
event: KeyboardEvent & { currentTarget: EventTarget & HTMLAnchorElement },
|
|
100
|
+
): void {
|
|
101
|
+
if (typeof onkeydown === 'function') {
|
|
102
|
+
(onkeydown as AnchorKeydownHandler)(event);
|
|
103
|
+
}
|
|
104
|
+
if (event.defaultPrevented) return;
|
|
105
|
+
if (event.key !== ' ' && event.key !== 'Spacebar') return;
|
|
106
|
+
event.preventDefault(); // stop the page from scrolling
|
|
107
|
+
if (disabled) return;
|
|
108
|
+
event.currentTarget.click();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const anchorAttributes = rest as Omit<
|
|
112
|
+
HTMLAnchorAttributes,
|
|
113
|
+
'class' | 'href' | 'onclick' | 'onkeydown'
|
|
114
|
+
>;
|
|
115
|
+
const buttonAttributes = rest as Omit<
|
|
116
|
+
HTMLButtonAttributes,
|
|
117
|
+
'class' | 'type' | 'disabled' | 'onclick'
|
|
118
|
+
>;
|
|
119
|
+
const buttonType = $derived((rest as { type?: HTMLButtonAttributes['type'] }).type ?? 'button');
|
|
52
120
|
</script>
|
|
53
121
|
|
|
54
122
|
<!--
|
|
@@ -56,23 +124,38 @@
|
|
|
56
124
|
cannot override role="menuitem", tabindex (the roving-focus model), aria-disabled,
|
|
57
125
|
or the click handler — overriding any of those would break menu semantics.
|
|
58
126
|
-->
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
127
|
+
{#if isLink}
|
|
128
|
+
<a
|
|
129
|
+
{...anchorAttributes}
|
|
130
|
+
{href}
|
|
131
|
+
role="menuitem"
|
|
132
|
+
class={sharedClass}
|
|
133
|
+
data-cinder-variant={variant}
|
|
134
|
+
tabindex={-1}
|
|
135
|
+
data-disabled={disabled ? '' : undefined}
|
|
136
|
+
aria-disabled={disabled ? 'true' : undefined}
|
|
137
|
+
onclick={handleClick}
|
|
138
|
+
onkeydown={handleAnchorKeydown}
|
|
139
|
+
>
|
|
140
|
+
{#if children}
|
|
141
|
+
{@render children()}
|
|
142
|
+
{/if}
|
|
143
|
+
</a>
|
|
144
|
+
{:else}
|
|
145
|
+
<button
|
|
146
|
+
{...buttonAttributes}
|
|
147
|
+
type={buttonType}
|
|
148
|
+
role="menuitem"
|
|
149
|
+
class={sharedClass}
|
|
150
|
+
data-cinder-variant={variant}
|
|
151
|
+
tabindex={-1}
|
|
152
|
+
data-disabled={disabled ? '' : undefined}
|
|
153
|
+
aria-disabled={disabled ? 'true' : undefined}
|
|
154
|
+
onclick={handleClick}
|
|
155
|
+
{onkeydown}
|
|
156
|
+
>
|
|
157
|
+
{#if children}
|
|
158
|
+
{@render children()}
|
|
159
|
+
{/if}
|
|
160
|
+
</button>
|
|
161
|
+
{/if}
|