@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,209 @@
|
|
|
1
|
+
import type { ChartTarget } from './chart-utilities.ts';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_CHART_FOCUS_RING_STROKE_PADDING = 8;
|
|
4
|
+
|
|
5
|
+
const DEFAULT_POINT_FOCUS_RING_RADIUS = 10;
|
|
6
|
+
const MINIMUM_FOCUS_RING_SIZE = 2;
|
|
7
|
+
const MINIMUM_BAR_FOCUS_RING_SIZE = 12;
|
|
8
|
+
const FOCUS_RING_DOT_RADIUS = 2.5;
|
|
9
|
+
|
|
10
|
+
export type ChartFocusRingConnectorGeometry = {
|
|
11
|
+
x1: number;
|
|
12
|
+
y1: number;
|
|
13
|
+
x2: number;
|
|
14
|
+
y2: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ChartFocusRingDotGeometry = {
|
|
18
|
+
cx: number;
|
|
19
|
+
cy: number;
|
|
20
|
+
radius: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ChartPointFocusRingGeometry =
|
|
24
|
+
| {
|
|
25
|
+
kind: 'point';
|
|
26
|
+
cx: number;
|
|
27
|
+
cy: number;
|
|
28
|
+
radius: number;
|
|
29
|
+
targetX: number;
|
|
30
|
+
targetY: number;
|
|
31
|
+
offsetX: number;
|
|
32
|
+
offsetY: number;
|
|
33
|
+
offsetDistance: number;
|
|
34
|
+
connector?: ChartFocusRingConnectorGeometry;
|
|
35
|
+
dot?: ChartFocusRingDotGeometry;
|
|
36
|
+
}
|
|
37
|
+
| ChartPlotFrameFocusRingGeometry;
|
|
38
|
+
|
|
39
|
+
export type ChartBarFocusRingGeometry =
|
|
40
|
+
| {
|
|
41
|
+
kind: 'bar';
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
radius: number;
|
|
47
|
+
}
|
|
48
|
+
| ChartPlotFrameFocusRingGeometry;
|
|
49
|
+
|
|
50
|
+
export type ChartPlotFrameFocusRingGeometry = {
|
|
51
|
+
kind: 'plot-frame';
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
radius: number;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export function createPointFocusRingGeometry(options: {
|
|
60
|
+
target: Pick<ChartTarget, 'x' | 'y'>;
|
|
61
|
+
plotWidth: number;
|
|
62
|
+
plotHeight: number;
|
|
63
|
+
strokePadding?: number;
|
|
64
|
+
radius?: number;
|
|
65
|
+
}): ChartPointFocusRingGeometry | null {
|
|
66
|
+
const {
|
|
67
|
+
target,
|
|
68
|
+
plotWidth,
|
|
69
|
+
plotHeight,
|
|
70
|
+
strokePadding = DEFAULT_CHART_FOCUS_RING_STROKE_PADDING,
|
|
71
|
+
radius = DEFAULT_POINT_FOCUS_RING_RADIUS,
|
|
72
|
+
} = options;
|
|
73
|
+
|
|
74
|
+
if (plotWidth <= 0 || plotHeight <= 0) return null;
|
|
75
|
+
|
|
76
|
+
const drawableWidth = plotWidth - strokePadding * 2;
|
|
77
|
+
const drawableHeight = plotHeight - strokePadding * 2;
|
|
78
|
+
const largestDrawableRadius = Math.min(drawableWidth, drawableHeight) / 2;
|
|
79
|
+
|
|
80
|
+
if (
|
|
81
|
+
largestDrawableRadius < MINIMUM_FOCUS_RING_SIZE ||
|
|
82
|
+
drawableWidth < FOCUS_RING_DOT_RADIUS * 2 ||
|
|
83
|
+
drawableHeight < FOCUS_RING_DOT_RADIUS * 2
|
|
84
|
+
) {
|
|
85
|
+
return createPlotFrameFocusRingGeometry(plotWidth, plotHeight, strokePadding);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const resolvedRadius = Math.min(Math.max(radius, MINIMUM_FOCUS_RING_SIZE), largestDrawableRadius);
|
|
89
|
+
const minimumCenterX = strokePadding + resolvedRadius;
|
|
90
|
+
const maximumCenterX = plotWidth - strokePadding - resolvedRadius;
|
|
91
|
+
const minimumCenterY = strokePadding + resolvedRadius;
|
|
92
|
+
const maximumCenterY = plotHeight - strokePadding - resolvedRadius;
|
|
93
|
+
|
|
94
|
+
const cx = clamp(target.x, minimumCenterX, maximumCenterX);
|
|
95
|
+
const cy = clamp(target.y, minimumCenterY, maximumCenterY);
|
|
96
|
+
const dotInset = strokePadding + FOCUS_RING_DOT_RADIUS;
|
|
97
|
+
let targetX = clamp(target.x, dotInset, plotWidth - dotInset);
|
|
98
|
+
let targetY = clamp(target.y, dotInset, plotHeight - dotInset);
|
|
99
|
+
const initialOffsetX = targetX - cx;
|
|
100
|
+
const initialOffsetY = targetY - cy;
|
|
101
|
+
const initialOffsetDistance = Math.hypot(initialOffsetX, initialOffsetY);
|
|
102
|
+
|
|
103
|
+
if (initialOffsetDistance > resolvedRadius) {
|
|
104
|
+
const scale = resolvedRadius / initialOffsetDistance;
|
|
105
|
+
targetX = cx + initialOffsetX * scale;
|
|
106
|
+
targetY = cy + initialOffsetY * scale;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const offsetX = targetX - cx;
|
|
110
|
+
const offsetY = targetY - cy;
|
|
111
|
+
const offsetDistance = Math.hypot(offsetX, offsetY);
|
|
112
|
+
|
|
113
|
+
const geometry = {
|
|
114
|
+
kind: 'point' as const,
|
|
115
|
+
cx,
|
|
116
|
+
cy,
|
|
117
|
+
radius: resolvedRadius,
|
|
118
|
+
targetX,
|
|
119
|
+
targetY,
|
|
120
|
+
offsetX,
|
|
121
|
+
offsetY,
|
|
122
|
+
offsetDistance,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
if (offsetDistance <= 0) return geometry;
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
...geometry,
|
|
129
|
+
connector: {
|
|
130
|
+
x1: targetX,
|
|
131
|
+
y1: targetY,
|
|
132
|
+
x2: cx,
|
|
133
|
+
y2: cy,
|
|
134
|
+
},
|
|
135
|
+
dot: {
|
|
136
|
+
cx: targetX,
|
|
137
|
+
cy: targetY,
|
|
138
|
+
radius: FOCUS_RING_DOT_RADIUS,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function createBarFocusRingGeometry(options: {
|
|
144
|
+
target: Pick<ChartTarget, 'x' | 'y' | 'width' | 'height'>;
|
|
145
|
+
plotWidth: number;
|
|
146
|
+
plotHeight: number;
|
|
147
|
+
strokePadding?: number;
|
|
148
|
+
minimumWidth?: number;
|
|
149
|
+
minimumHeight?: number;
|
|
150
|
+
}): ChartBarFocusRingGeometry | null {
|
|
151
|
+
const {
|
|
152
|
+
target,
|
|
153
|
+
plotWidth,
|
|
154
|
+
plotHeight,
|
|
155
|
+
strokePadding = DEFAULT_CHART_FOCUS_RING_STROKE_PADDING,
|
|
156
|
+
minimumWidth = MINIMUM_BAR_FOCUS_RING_SIZE,
|
|
157
|
+
minimumHeight = MINIMUM_BAR_FOCUS_RING_SIZE,
|
|
158
|
+
} = options;
|
|
159
|
+
|
|
160
|
+
if (plotWidth <= 0 || plotHeight <= 0) return null;
|
|
161
|
+
|
|
162
|
+
const requestedWidth = Math.max(target.width ?? 0, minimumWidth);
|
|
163
|
+
const requestedHeight = Math.max(target.height ?? 0, minimumHeight);
|
|
164
|
+
const drawableWidth = plotWidth - strokePadding * 2;
|
|
165
|
+
const drawableHeight = plotHeight - strokePadding * 2;
|
|
166
|
+
|
|
167
|
+
if (drawableWidth < MINIMUM_FOCUS_RING_SIZE || drawableHeight < MINIMUM_FOCUS_RING_SIZE) {
|
|
168
|
+
return createPlotFrameFocusRingGeometry(plotWidth, plotHeight, strokePadding);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const width = Math.min(requestedWidth, drawableWidth);
|
|
172
|
+
const height = Math.min(requestedHeight, drawableHeight);
|
|
173
|
+
const x = clamp(target.x - width / 2, strokePadding, plotWidth - width - strokePadding);
|
|
174
|
+
const y = clamp(target.y - height / 2, strokePadding, plotHeight - height - strokePadding);
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
kind: 'bar',
|
|
178
|
+
x,
|
|
179
|
+
y,
|
|
180
|
+
width,
|
|
181
|
+
height,
|
|
182
|
+
radius: Math.min(4, width / 2, height / 2),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function createPlotFrameFocusRingGeometry(
|
|
187
|
+
plotWidth: number,
|
|
188
|
+
plotHeight: number,
|
|
189
|
+
strokePadding: number,
|
|
190
|
+
): ChartPlotFrameFocusRingGeometry {
|
|
191
|
+
const inset = Math.min(
|
|
192
|
+
strokePadding,
|
|
193
|
+
Math.max(0, plotWidth - MINIMUM_FOCUS_RING_SIZE) / 2,
|
|
194
|
+
Math.max(0, plotHeight - MINIMUM_FOCUS_RING_SIZE) / 2,
|
|
195
|
+
);
|
|
196
|
+
return {
|
|
197
|
+
kind: 'plot-frame',
|
|
198
|
+
x: inset,
|
|
199
|
+
y: inset,
|
|
200
|
+
width: Math.max(0, plotWidth - inset * 2),
|
|
201
|
+
height: Math.max(0, plotHeight - inset * 2),
|
|
202
|
+
radius: 0,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function clamp(value: number, minimum: number, maximum: number): number {
|
|
207
|
+
if (maximum < minimum) return (minimum + maximum) / 2;
|
|
208
|
+
return Math.min(Math.max(value, minimum), maximum);
|
|
209
|
+
}
|
|
@@ -122,6 +122,7 @@ export type BarChartModel = {
|
|
|
122
122
|
categories: NormalizedXValue[];
|
|
123
123
|
yTicks: number[];
|
|
124
124
|
categoryTicks: Array<{
|
|
125
|
+
categoryKey: string;
|
|
125
126
|
label: string;
|
|
126
127
|
x: number;
|
|
127
128
|
y: number;
|
|
@@ -140,6 +141,7 @@ export type BarChartModel = {
|
|
|
140
141
|
hidden: boolean;
|
|
141
142
|
}>;
|
|
142
143
|
tableRows: Array<{
|
|
144
|
+
categoryKey: string;
|
|
143
145
|
categoryLabel: string;
|
|
144
146
|
values: Array<{ seriesId: string; seriesLabel: string; valueLabel: string }>;
|
|
145
147
|
}>;
|
|
@@ -616,6 +618,7 @@ export function createBarModel(options: {
|
|
|
616
618
|
const categoryTicks = sortedCategories.map((category, index) => {
|
|
617
619
|
const categoryPosition = categoryScale(category.key) ?? 0;
|
|
618
620
|
return {
|
|
621
|
+
categoryKey: category.key,
|
|
619
622
|
label: formatXValue(category, orientation === 'vertical' ? xAxis : yAxis, { index }),
|
|
620
623
|
x: orientation === 'vertical' ? categoryPosition + categoryScale.bandwidth() / 2 : -8,
|
|
621
624
|
y:
|
|
@@ -707,6 +710,7 @@ export function createBarModel(options: {
|
|
|
707
710
|
});
|
|
708
711
|
if (rowValues.length > 0) {
|
|
709
712
|
tableRows.push({
|
|
713
|
+
categoryKey: category.key,
|
|
710
714
|
categoryLabel: formatXValue(category, orientation === 'vertical' ? xAxis : yAxis, {
|
|
711
715
|
index: tableRows.length,
|
|
712
716
|
}),
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared heatmap math for grid-style charts (MatrixChart, Spectrogram).
|
|
3
|
+
*
|
|
4
|
+
* Both render a grid of cells coloured by magnitude. The normalization,
|
|
5
|
+
* degenerate-domain handling, diverging zero-centering, and NaN/Infinity
|
|
6
|
+
* filtering are identical, so they live here rather than drifting between the
|
|
7
|
+
* two component implementations.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type HeatmapColorScale = 'sequential' | 'diverging';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Keep only finite numbers. `NaN`, `Infinity`, `-Infinity`, `null`, and
|
|
14
|
+
* `undefined` are dropped — invalid values must render as "missing" cells, not
|
|
15
|
+
* poison `Math.min`/`Math.max`, normalization, or `color-mix(... NaN%)`.
|
|
16
|
+
*/
|
|
17
|
+
export function finiteNumbers(values: ReadonlyArray<number | null | undefined>): number[] {
|
|
18
|
+
const result: number[] = [];
|
|
19
|
+
for (const value of values) {
|
|
20
|
+
if (typeof value === 'number' && Number.isFinite(value)) result.push(value);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A finite number, or `null` for anything non-finite (the "missing cell" sentinel). */
|
|
26
|
+
export function toFiniteOrNull(value: unknown): number | null {
|
|
27
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type HeatmapDomain = {
|
|
31
|
+
readonly min: number;
|
|
32
|
+
readonly max: number;
|
|
33
|
+
/** Empty when there are no finite values to scale. */
|
|
34
|
+
readonly isEmpty: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Compute the [min, max] domain over the finite values only.
|
|
39
|
+
*
|
|
40
|
+
* A single pass — NOT `Math.min(...finite)` — so a dense heatmap or a
|
|
41
|
+
* multi-thousand-bin spectrogram can't overflow the call stack / argument limit
|
|
42
|
+
* by spreading a huge array into the `Math` functions.
|
|
43
|
+
*/
|
|
44
|
+
export function heatmapDomain(values: ReadonlyArray<number | null | undefined>): HeatmapDomain {
|
|
45
|
+
let min = Infinity;
|
|
46
|
+
let max = -Infinity;
|
|
47
|
+
let count = 0;
|
|
48
|
+
for (const value of values) {
|
|
49
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
50
|
+
if (value < min) min = value;
|
|
51
|
+
if (value > max) max = value;
|
|
52
|
+
count += 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (count === 0) return { min: 0, max: 1, isEmpty: true };
|
|
56
|
+
return { min, max, isEmpty: false };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Compute the [min, max] domain over a sequence of rows (e.g. spectrogram
|
|
61
|
+
* frames) WITHOUT first flattening them into one big array. A single nested pass
|
|
62
|
+
* over the original arrays, so a large frames × bins grid never materializes a
|
|
63
|
+
* full flattened copy just to find its colour domain.
|
|
64
|
+
*/
|
|
65
|
+
export function heatmapDomainOfRows(
|
|
66
|
+
rows: ReadonlyArray<ReadonlyArray<number | null | undefined>>,
|
|
67
|
+
): HeatmapDomain {
|
|
68
|
+
let min = Infinity;
|
|
69
|
+
let max = -Infinity;
|
|
70
|
+
let count = 0;
|
|
71
|
+
for (const row of rows) {
|
|
72
|
+
for (const value of row) {
|
|
73
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
74
|
+
if (value < min) min = value;
|
|
75
|
+
if (value > max) max = value;
|
|
76
|
+
count += 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (count === 0) return { min: 0, max: 1, isEmpty: true };
|
|
81
|
+
return { min, max, isEmpty: false };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Normalize `value` into `[0, 1]` against the domain.
|
|
86
|
+
*
|
|
87
|
+
* - Sequential: linear from `min`→0 to `max`→1. A degenerate domain
|
|
88
|
+
* (`min === max`) maps everything to the midpoint `0.5` (a single colour).
|
|
89
|
+
* - Diverging: zero-centred. The scale is symmetric around 0 using the larger
|
|
90
|
+
* absolute bound, so `0` always maps to `0.5` (neutral) regardless of how
|
|
91
|
+
* lopsided the data is. E.g. domain `[-10, 30]` → 0 maps to 0.5, not blue.
|
|
92
|
+
*/
|
|
93
|
+
export function normalizeHeatmapValue(
|
|
94
|
+
value: number,
|
|
95
|
+
domain: HeatmapDomain,
|
|
96
|
+
scale: HeatmapColorScale = 'sequential',
|
|
97
|
+
): number {
|
|
98
|
+
if (!Number.isFinite(value)) return 0.5;
|
|
99
|
+
|
|
100
|
+
if (scale === 'diverging') {
|
|
101
|
+
const bound = Math.max(Math.abs(domain.min), Math.abs(domain.max));
|
|
102
|
+
if (bound === 0) return 0.5;
|
|
103
|
+
// Map [-bound, +bound] → [0, 1] with 0 at 0.5.
|
|
104
|
+
return clamp01(0.5 + value / (2 * bound));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const range = domain.max - domain.min;
|
|
108
|
+
if (range === 0) return 0.5;
|
|
109
|
+
return clamp01((value - domain.min) / range);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function clamp01(value: number): number {
|
|
113
|
+
if (value < 0) return 0;
|
|
114
|
+
if (value > 1) return 1;
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* CSS `color-mix` fill for a heatmap cell. `null` (missing) returns the inset
|
|
120
|
+
* surface. Sequential mixes the primary series colour; diverging mixes a cool
|
|
121
|
+
* colour below the midpoint and a warm colour above it, both fading to the inset
|
|
122
|
+
* surface at the neutral midpoint.
|
|
123
|
+
*/
|
|
124
|
+
export function heatmapCellFill(
|
|
125
|
+
value: number | null,
|
|
126
|
+
domain: HeatmapDomain,
|
|
127
|
+
scale: HeatmapColorScale = 'sequential',
|
|
128
|
+
): string {
|
|
129
|
+
if (value === null) return 'var(--cinder-surface-inset)';
|
|
130
|
+
const normalized = normalizeHeatmapValue(value, domain, scale);
|
|
131
|
+
|
|
132
|
+
if (scale === 'diverging') {
|
|
133
|
+
if (normalized < 0.5) {
|
|
134
|
+
const ratio = (0.5 - normalized) * 2;
|
|
135
|
+
return `color-mix(in oklch, var(--cinder-chart-series-5) ${Math.round(ratio * 100)}%, var(--cinder-surface-inset))`;
|
|
136
|
+
}
|
|
137
|
+
const ratio = (normalized - 0.5) * 2;
|
|
138
|
+
return `color-mix(in oklch, var(--cinder-chart-series-3) ${Math.round(ratio * 100)}%, var(--cinder-surface-inset))`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return `color-mix(in oklch, var(--cinder-chart-series-1) ${Math.round(normalized * 100)}%, var(--cinder-surface-inset))`;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Choose a readable label colour for a cell: a light colour over high-intensity
|
|
146
|
+
* (dark) fills, a dark colour over low-intensity (light) fills.
|
|
147
|
+
*/
|
|
148
|
+
export function heatmapLabelFill(
|
|
149
|
+
value: number | null,
|
|
150
|
+
domain: HeatmapDomain,
|
|
151
|
+
scale: HeatmapColorScale = 'sequential',
|
|
152
|
+
): string {
|
|
153
|
+
if (value === null) return 'var(--cinder-text-muted)';
|
|
154
|
+
const intensity =
|
|
155
|
+
scale === 'diverging'
|
|
156
|
+
? Math.abs(normalizeHeatmapValue(value, domain, scale) - 0.5) * 2
|
|
157
|
+
: normalizeHeatmapValue(value, domain, scale);
|
|
158
|
+
return intensity > 0.5 ? 'var(--cinder-surface)' : 'var(--cinder-text)';
|
|
159
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"id": "basic",
|
|
8
8
|
"title": "Basic accordion",
|
|
9
9
|
"description": "Single-select: opening one item closes the others. Uses the Accordion namespace API.",
|
|
10
|
+
"featured": true,
|
|
10
11
|
"code": "<script lang=\"ts\">\n import { Accordion } from '@lostgradient/cinder/accordion';\n let expandedIds = $state<string[]>([]);\n</script>\n\n<Accordion bind:expandedIds>\n <Accordion.Item id=\"item-1\" title=\"What is Cinder?\">\n Cinder is a Svelte 5 design system built for composability and accessibility.\n </Accordion.Item>\n <Accordion.Item id=\"item-2\" title=\"How do I install it?\">\n Run <code>bun add @lostgradient/cinder</code> and import components from\n <code>@lostgradient/cinder</code> or via subpath imports.\n </Accordion.Item>\n <Accordion.Item id=\"item-3\" title=\"Does it support SSR?\">\n Yes — every component is SSR-safe and renders meaningful HTML before hydration.\n </Accordion.Item>\n</Accordion>\n"
|
|
11
12
|
},
|
|
12
13
|
{
|
|
@@ -16,11 +16,11 @@ A status message that communicates contextual feedback and can optionally be dis
|
|
|
16
16
|
|
|
17
17
|
<!-- generated:props:start -->
|
|
18
18
|
|
|
19
|
-
| Prop | Type
|
|
20
|
-
| ------------- |
|
|
21
|
-
| `class` | `string`
|
|
22
|
-
| `dismissible` | `boolean`
|
|
23
|
-
| `variant` | `"info"` \| `"success"` \| `"warning"` \| `"error"` | no | `"info"` | Visual style.
|
|
19
|
+
| Prop | Type | Required | Default | Description |
|
|
20
|
+
| ------------- | ----------------------------------------------------------------- | -------- | -------- | ---------------------------------------------------------------------------------- |
|
|
21
|
+
| `class` | `string` | no | — | Custom class merged with `.cinder-alert`. |
|
|
22
|
+
| `dismissible` | `boolean` | no | `false` | Allow the alert to be dismissed. |
|
|
23
|
+
| `variant` | `"info"` \| `"success"` \| `"warning"` \| `"error"` \| `"danger"` | no | `"info"` | Visual style. `danger` is an accepted alias for `error` — both render identically. |
|
|
24
24
|
|
|
25
25
|
<!-- generated:props:end -->
|
|
26
26
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
5
|
"variant": {
|
|
6
|
-
"enum": ["info", "success", "warning", "error"],
|
|
7
|
-
"description": "Visual style.",
|
|
6
|
+
"enum": ["info", "success", "warning", "error", "danger"],
|
|
7
|
+
"description": "Visual style. `danger` is an accepted alias for `error` — both render identically.",
|
|
8
8
|
"default": "info"
|
|
9
9
|
},
|
|
10
10
|
"dismissible": {
|
|
@@ -5,8 +5,9 @@ const schema = {
|
|
|
5
5
|
type: 'object',
|
|
6
6
|
properties: {
|
|
7
7
|
variant: {
|
|
8
|
-
enum: ['info', 'success', 'warning', 'error'],
|
|
9
|
-
description:
|
|
8
|
+
enum: ['info', 'success', 'warning', 'error', 'danger'],
|
|
9
|
+
description:
|
|
10
|
+
'Visual style. `danger` is an accepted alias for `error` — both render identically.',
|
|
10
11
|
default: 'info',
|
|
11
12
|
},
|
|
12
13
|
dismissible: {
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
...rest
|
|
36
36
|
}: AlertProps = $props();
|
|
37
37
|
|
|
38
|
+
// `danger` is a consumer-friendly alias for `error` — normalize before stamping the
|
|
39
|
+
// data attribute so the CSS rules only need to handle `error`.
|
|
40
|
+
const resolvedVariant = $derived(variant === 'danger' ? 'error' : variant);
|
|
41
|
+
|
|
38
42
|
let visible = $state(true);
|
|
39
43
|
let rootElement: HTMLDivElement | undefined = $state();
|
|
40
44
|
|
|
@@ -114,7 +118,7 @@
|
|
|
114
118
|
bind:this={rootElement}
|
|
115
119
|
{...restWithoutForbidden}
|
|
116
120
|
class={classNames('cinder-alert', 'cinder-_status-surface', className)}
|
|
117
|
-
data-cinder-variant={
|
|
121
|
+
data-cinder-variant={resolvedVariant}
|
|
118
122
|
role="alert"
|
|
119
123
|
>
|
|
120
124
|
{#if icon}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/** `danger` is an accepted alias for `error` — both render identically. */
|
|
5
|
+
export type AlertVariant = 'info' | 'success' | 'warning' | 'error' | 'danger';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Props for the {@link Alert} component — a live-region notification card.
|
|
@@ -36,7 +37,7 @@ export type AlertProps = Omit<
|
|
|
36
37
|
*/
|
|
37
38
|
export interface AlertSchemaProps {
|
|
38
39
|
/**
|
|
39
|
-
* Visual style.
|
|
40
|
+
* Visual style. `danger` is an accepted alias for `error` — both render identically.
|
|
40
41
|
* @default "info"
|
|
41
42
|
*/
|
|
42
43
|
variant?: AlertVariant;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# AreaChart
|
|
2
|
+
|
|
3
|
+
Filled SVG area chart for showing magnitude and cumulative trends across an ordered x domain.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { AreaChart } from '@lostgradient/cinder/area-chart';
|
|
10
|
+
</script>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Guidance
|
|
14
|
+
|
|
15
|
+
### Use When
|
|
16
|
+
|
|
17
|
+
- Showing magnitude under a trend line.
|
|
18
|
+
- Comparing cumulative or stacked contribution over an ordered domain.
|
|
19
|
+
|
|
20
|
+
### Avoid When
|
|
21
|
+
|
|
22
|
+
- Exact point comparison matters more than area magnitude — use line-chart instead.
|
|
23
|
+
- Comparing discrete category totals — use bar-chart instead.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
<!-- generated:props:start -->
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Required | Default | Description |
|
|
30
|
+
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ----------- |
|
|
31
|
+
| `class` | `string` | no | — | |
|
|
32
|
+
| `dataTableCaption` | `string` | no | — | |
|
|
33
|
+
| `dataTableVisibility` | `"screen-reader-only"` \| `"visible"` \| `"hidden"` | no | — | |
|
|
34
|
+
| `description` | `string` | no | — | |
|
|
35
|
+
| `height` | `number` | no | — | |
|
|
36
|
+
| `hiddenSeriesIds` | `string`[] | no | — | |
|
|
37
|
+
| `label` | `string` | yes | — | |
|
|
38
|
+
| `legendPosition` | `"top"` \| `"bottom"` \| `"none"` | no | — | |
|
|
39
|
+
| `loading` | `boolean` | no | — | |
|
|
40
|
+
| `maximumInteractivePoints` | `number` | no | — | |
|
|
41
|
+
| `mode` | `"single"` \| `"stacked"` | no | — | |
|
|
42
|
+
| `series` | ({ color?: `string`; data: ({ x: `string` \| `number`; y?: `number` \| `null` })[]; id: `string`; label: `string` })[] | yes | — | |
|
|
43
|
+
| `xAxis` | { label?: `string`; tickCount?: `number` } | no | — | |
|
|
44
|
+
| `yAxis` | { label?: `string`; tickCount?: `number` } | no | — | |
|
|
45
|
+
|
|
46
|
+
<!-- generated:props:end -->
|
|
47
|
+
|
|
48
|
+
## CSS Variables
|
|
49
|
+
|
|
50
|
+
<!-- generated:variables:start -->
|
|
51
|
+
|
|
52
|
+
This component does not declare any local CSS variables.
|
|
53
|
+
|
|
54
|
+
<!-- generated:variables:end -->
|
|
55
|
+
|
|
56
|
+
## Subcomponents
|
|
57
|
+
|
|
58
|
+
<!-- generated:subcomponents:start -->
|
|
59
|
+
|
|
60
|
+
None.
|
|
61
|
+
|
|
62
|
+
<!-- generated:subcomponents:end -->
|
|
@@ -81,14 +81,64 @@
|
|
|
81
81
|
pointer-events: none;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
.cinder-area-chart__focus-target:focus-visible:not([data-cinder-focus-ring-active='true']) {
|
|
85
|
+
fill: transparent;
|
|
86
|
+
stroke: var(--cinder-ring-color);
|
|
87
|
+
stroke-width: var(--cinder-ring-width);
|
|
88
|
+
vector-effect: non-scaling-stroke;
|
|
89
|
+
filter: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cinder-area-chart__focus-ring-layer {
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.cinder-area-chart__focus-ring,
|
|
97
|
+
.cinder-area-chart__focus-ring-halo,
|
|
98
|
+
.cinder-area-chart__focus-ring-connector,
|
|
99
|
+
.cinder-area-chart__focus-ring-dot {
|
|
100
|
+
fill: none;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
vector-effect: non-scaling-stroke;
|
|
103
|
+
stroke-linecap: round;
|
|
104
|
+
stroke-linejoin: round;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.cinder-area-chart__focus-ring {
|
|
108
|
+
stroke: var(--cinder-ring-color);
|
|
90
109
|
stroke-width: var(--cinder-ring-width);
|
|
91
|
-
filter:
|
|
110
|
+
filter: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cinder-area-chart__focus-ring-halo {
|
|
114
|
+
stroke: var(--cinder-ring-offset-color);
|
|
115
|
+
stroke-width: calc(
|
|
116
|
+
var(--cinder-ring-width) + var(--cinder-ring-offset) + var(--cinder-ring-offset)
|
|
117
|
+
);
|
|
118
|
+
filter: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media (forced-colors: active) {
|
|
122
|
+
.cinder-area-chart__focus-ring-halo {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.cinder-area-chart__focus-ring,
|
|
127
|
+
.cinder-area-chart__focus-ring-connector,
|
|
128
|
+
.cinder-area-chart__focus-ring-dot {
|
|
129
|
+
fill: none;
|
|
130
|
+
stroke: ButtonText;
|
|
131
|
+
stroke-width: var(--cinder-ring-width);
|
|
132
|
+
filter: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.cinder-area-chart__focus-target:focus-visible:not([data-cinder-focus-ring-active='true']) {
|
|
136
|
+
fill: transparent;
|
|
137
|
+
stroke: ButtonText;
|
|
138
|
+
stroke-width: var(--cinder-ring-width);
|
|
139
|
+
vector-effect: non-scaling-stroke;
|
|
140
|
+
filter: none;
|
|
141
|
+
}
|
|
92
142
|
}
|
|
93
143
|
|
|
94
144
|
.cinder-area-chart__tick-label {
|