@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,286 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* @cinder
|
|
4
|
+
* @category data-display
|
|
5
|
+
* @status alpha
|
|
6
|
+
* @purpose Responsive SVG rendering of time-domain audio amplitude data as a waveform path or bar display.
|
|
7
|
+
* @tag chart
|
|
8
|
+
* @tag waveform
|
|
9
|
+
* @tag signal
|
|
10
|
+
* @tag audio
|
|
11
|
+
* @useWhen Visualizing pre-recorded or pre-processed audio amplitude samples in a static display.
|
|
12
|
+
* @useWhen Showing an audio waveform thumbnail or preview with mocked or pre-computed sample data.
|
|
13
|
+
* @avoidWhen Real-time live audio capture is needed — wire AudioContext / AnalyserNode yourself and feed samples as props.
|
|
14
|
+
* @avoidWhen Frequency-domain data — use spectrum-chart or spectrogram instead.
|
|
15
|
+
* @related spectrum-chart, spectrogram, bar-chart, line-chart
|
|
16
|
+
*/
|
|
17
|
+
export type { WaveformProps, WaveformSchemaProps } from './waveform.types.ts';
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { dataTableClass } from '../../_internal/chart/chart-utilities.ts';
|
|
22
|
+
import { classNames } from '../../utilities/class-names.ts';
|
|
23
|
+
import type { WaveformProps } from './waveform.types.ts';
|
|
24
|
+
|
|
25
|
+
let {
|
|
26
|
+
label,
|
|
27
|
+
description,
|
|
28
|
+
data,
|
|
29
|
+
renderMode = 'path',
|
|
30
|
+
height = 80,
|
|
31
|
+
loading = false,
|
|
32
|
+
dataTableVisibility = 'screen-reader-only',
|
|
33
|
+
dataTableCaption,
|
|
34
|
+
class: customClassName,
|
|
35
|
+
empty,
|
|
36
|
+
loadingContent,
|
|
37
|
+
id,
|
|
38
|
+
...rest
|
|
39
|
+
}: WaveformProps = $props();
|
|
40
|
+
|
|
41
|
+
const generatedId = $props.id();
|
|
42
|
+
const rootId = $derived(id ?? generatedId);
|
|
43
|
+
const descriptionId = $derived(description ? `${rootId}-description` : undefined);
|
|
44
|
+
|
|
45
|
+
let measuredWidth = $state(400);
|
|
46
|
+
let rootElement = $state<HTMLElement>();
|
|
47
|
+
|
|
48
|
+
$effect(() => {
|
|
49
|
+
const element = rootElement;
|
|
50
|
+
if (!element) return;
|
|
51
|
+
// Guard for SSR / test environments without ResizeObserver.
|
|
52
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
53
|
+
const rect = element.getBoundingClientRect();
|
|
54
|
+
if (rect.width > 0) measuredWidth = rect.width;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const observer = new ResizeObserver((entries) => {
|
|
58
|
+
const entry = entries[0];
|
|
59
|
+
// Ignore zero-width measurements (hidden / display:none) so the last good
|
|
60
|
+
// width is kept rather than collapsing the geometry, matching the fallback.
|
|
61
|
+
if (entry && entry.contentRect.width > 0) measuredWidth = entry.contentRect.width;
|
|
62
|
+
});
|
|
63
|
+
observer.observe(element);
|
|
64
|
+
return () => observer.disconnect();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const isEmpty = $derived(data.length === 0);
|
|
68
|
+
const midY = $derived(height / 2);
|
|
69
|
+
|
|
70
|
+
// Cap the number of rendered geometry points so a multi-million-sample buffer
|
|
71
|
+
// doesn't produce a megabyte-long path string or one <rect> per sample. We
|
|
72
|
+
// downsample with a min/max envelope per bucket so transients survive. The
|
|
73
|
+
// accessible table reports the ORIGINAL length and notes the sampling.
|
|
74
|
+
const MAX_RENDER_POINTS = 2000;
|
|
75
|
+
|
|
76
|
+
// Clamp a single sample to [-1, 1]; non-finite samples (NaN/Infinity) collapse
|
|
77
|
+
// to the baseline (0) rather than producing invalid SVG coordinates. Applied
|
|
78
|
+
// lazily per-sample so a multi-million-sample buffer is never copied wholesale
|
|
79
|
+
// — only the ~MAX_RENDER_POINTS values that actually render are materialized.
|
|
80
|
+
function clampSample(sample: number | undefined): number {
|
|
81
|
+
return sample !== undefined && Number.isFinite(sample) ? Math.max(-1, Math.min(1, sample)) : 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Envelope-downsampled samples for rendering: each bucket contributes its min
|
|
85
|
+
// and max so peaks aren't lost. The two extremes are emitted in their ORIGINAL
|
|
86
|
+
// temporal order (min-then-max only if the min occurred first) so the rendered
|
|
87
|
+
// path doesn't invert the local waveform shape. Clamping is folded into this
|
|
88
|
+
// pass so the full input buffer is never duplicated. When the data already
|
|
89
|
+
// fits, we still produce a fresh clamped array of just `length` points.
|
|
90
|
+
const renderSamples = $derived.by((): number[] => {
|
|
91
|
+
const length = data.length;
|
|
92
|
+
if (length <= MAX_RENDER_POINTS) return data.map(clampSample);
|
|
93
|
+
const bucketCount = Math.floor(MAX_RENDER_POINTS / 2);
|
|
94
|
+
const bucketSize = length / bucketCount;
|
|
95
|
+
const out: number[] = [];
|
|
96
|
+
for (let bucket = 0; bucket < bucketCount; bucket += 1) {
|
|
97
|
+
const start = Math.floor(bucket * bucketSize);
|
|
98
|
+
// The final bucket extends to the end so the very last sample is included.
|
|
99
|
+
const end =
|
|
100
|
+
bucket === bucketCount - 1
|
|
101
|
+
? length
|
|
102
|
+
: Math.min(length, Math.floor((bucket + 1) * bucketSize));
|
|
103
|
+
let min = clampSample(data[start]);
|
|
104
|
+
let max = min;
|
|
105
|
+
let minIndex = start;
|
|
106
|
+
let maxIndex = start;
|
|
107
|
+
for (let index = start; index < end; index += 1) {
|
|
108
|
+
const sample = clampSample(data[index]);
|
|
109
|
+
if (sample < min) {
|
|
110
|
+
min = sample;
|
|
111
|
+
minIndex = index;
|
|
112
|
+
}
|
|
113
|
+
if (sample > max) {
|
|
114
|
+
max = sample;
|
|
115
|
+
maxIndex = index;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (minIndex <= maxIndex) out.push(min, max);
|
|
119
|
+
else out.push(max, min);
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Build a centered waveform path
|
|
125
|
+
const waveformPath = $derived.by(() => {
|
|
126
|
+
const samples = renderSamples;
|
|
127
|
+
if (samples.length === 0) return '';
|
|
128
|
+
// A single sample has no horizontal extent — draw a short centered tick so
|
|
129
|
+
// it is visible rather than dividing by (length - 1) === 0 → NaN.
|
|
130
|
+
if (samples.length === 1) {
|
|
131
|
+
const x = measuredWidth / 2;
|
|
132
|
+
const y = midY - samples[0]! * midY;
|
|
133
|
+
return `M${(x - 1).toFixed(2)},${y.toFixed(2)}L${(x + 1).toFixed(2)},${y.toFixed(2)}`;
|
|
134
|
+
}
|
|
135
|
+
const points = samples.map((sample, index) => {
|
|
136
|
+
const x = (index / (samples.length - 1)) * measuredWidth;
|
|
137
|
+
const y = midY - sample * midY;
|
|
138
|
+
return { x, y };
|
|
139
|
+
});
|
|
140
|
+
const firstPoint = points[0]!;
|
|
141
|
+
const restPoints = points.slice(1);
|
|
142
|
+
return (
|
|
143
|
+
`M${firstPoint.x.toFixed(2)},${firstPoint.y.toFixed(2)}` +
|
|
144
|
+
restPoints.map((point) => `L${point.x.toFixed(2)},${point.y.toFixed(2)}`).join('')
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// Build bar segments for bars render mode
|
|
149
|
+
type WaveformBar = { x: number; y: number; height: number; width: number };
|
|
150
|
+
const waveformBars = $derived.by((): WaveformBar[] => {
|
|
151
|
+
const samples = renderSamples;
|
|
152
|
+
if (samples.length === 0) return [];
|
|
153
|
+
// x-STEP is the fractional slot width so bars always span exactly the
|
|
154
|
+
// viewport, even when there are more samples than pixels. The visible WIDTH
|
|
155
|
+
// is clamped to a 1px minimum independently (bars may visually overlap when
|
|
156
|
+
// the step is sub-pixel, which is the correct dense-waveform appearance).
|
|
157
|
+
const step = measuredWidth / samples.length;
|
|
158
|
+
const visualWidth = Math.max(1, step - 1);
|
|
159
|
+
return samples.map((sample, index) => {
|
|
160
|
+
const amplitude = Math.abs(sample);
|
|
161
|
+
// Zero amplitude renders zero height (just the baseline) — do NOT force a
|
|
162
|
+
// minimum 1px bar, which would make silence look like low-level signal.
|
|
163
|
+
const barHeight = amplitude * midY;
|
|
164
|
+
return {
|
|
165
|
+
x: index * step,
|
|
166
|
+
y: midY - barHeight,
|
|
167
|
+
height: barHeight * 2,
|
|
168
|
+
width: visualWidth,
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const hasDataTable = $derived(dataTableVisibility !== 'hidden');
|
|
174
|
+
|
|
175
|
+
// Stride the clamped/sanitized SOURCE samples for the accessible table, capped
|
|
176
|
+
// at 20 rows so the table stays readable. The caption reports the true length +
|
|
177
|
+
// sampling. Clamping is applied lazily at the stride points so the full buffer
|
|
178
|
+
// is never copied here either.
|
|
179
|
+
//
|
|
180
|
+
// Deliberate: the table strides the original `data` (the true signal), NOT the
|
|
181
|
+
// min/max envelope that `renderSamples` draws for buffers over the render cap.
|
|
182
|
+
// The envelope is a visual approximation that preserves peaks at the cost of
|
|
183
|
+
// exact per-sample values; the table is the faithful textual representation of
|
|
184
|
+
// the underlying signal, which is the more useful accessible equivalent. The
|
|
185
|
+
// two intentionally differ for long buffers — the table is not a row-for-row
|
|
186
|
+
// transcript of the rendered path.
|
|
187
|
+
const TABLE_SAMPLE_LIMIT = 20;
|
|
188
|
+
const isTableSampled = $derived(data.length > TABLE_SAMPLE_LIMIT);
|
|
189
|
+
const tableSamples = $derived.by(() => {
|
|
190
|
+
if (data.length === 0) return [];
|
|
191
|
+
const step = Math.max(1, Math.ceil(data.length / TABLE_SAMPLE_LIMIT));
|
|
192
|
+
const out: { index: number; value: number }[] = [];
|
|
193
|
+
for (let index = 0; index < data.length; index += step) {
|
|
194
|
+
out.push({ index, value: clampSample(data[index]) });
|
|
195
|
+
}
|
|
196
|
+
return out;
|
|
197
|
+
});
|
|
198
|
+
const tableCaption = $derived.by(() => {
|
|
199
|
+
const base = dataTableCaption ?? label;
|
|
200
|
+
if (!isTableSampled) return base;
|
|
201
|
+
return `${base} (${tableSamples.length} of ${data.length} samples shown)`;
|
|
202
|
+
});
|
|
203
|
+
</script>
|
|
204
|
+
|
|
205
|
+
<figure
|
|
206
|
+
{...rest}
|
|
207
|
+
bind:this={rootElement}
|
|
208
|
+
id={rootId}
|
|
209
|
+
class={classNames('cinder-waveform', customClassName)}
|
|
210
|
+
aria-label={label}
|
|
211
|
+
aria-describedby={descriptionId}
|
|
212
|
+
data-cinder-render-mode={renderMode}
|
|
213
|
+
>
|
|
214
|
+
{#if description}
|
|
215
|
+
<p id={descriptionId} class="cinder-waveform__description">{description}</p>
|
|
216
|
+
{/if}
|
|
217
|
+
<div
|
|
218
|
+
class="cinder-waveform__viewport"
|
|
219
|
+
style:height="{height}px"
|
|
220
|
+
data-cinder-loading={loading || undefined}
|
|
221
|
+
>
|
|
222
|
+
{#if loading}
|
|
223
|
+
<div class="cinder-waveform__state">
|
|
224
|
+
{#if loadingContent}{@render loadingContent()}{:else}Loading…{/if}
|
|
225
|
+
</div>
|
|
226
|
+
{:else if isEmpty}
|
|
227
|
+
<div class="cinder-waveform__state">
|
|
228
|
+
{#if empty}{@render empty()}{:else}No waveform data{/if}
|
|
229
|
+
</div>
|
|
230
|
+
{/if}
|
|
231
|
+
<svg
|
|
232
|
+
role="img"
|
|
233
|
+
viewBox={`0 0 ${measuredWidth} ${height}`}
|
|
234
|
+
aria-hidden={loading || isEmpty ? 'true' : undefined}
|
|
235
|
+
aria-labelledby={!loading && !isEmpty ? `${rootId}-svg-title` : undefined}
|
|
236
|
+
>
|
|
237
|
+
{#if !loading && !isEmpty}
|
|
238
|
+
<title id="{rootId}-svg-title">{label}</title>
|
|
239
|
+
{/if}
|
|
240
|
+
{#if !loading && !isEmpty}
|
|
241
|
+
<!-- Center baseline -->
|
|
242
|
+
<line
|
|
243
|
+
class="cinder-waveform__baseline"
|
|
244
|
+
x1="0"
|
|
245
|
+
x2={measuredWidth}
|
|
246
|
+
y1={midY}
|
|
247
|
+
y2={midY}
|
|
248
|
+
aria-hidden="true"
|
|
249
|
+
/>
|
|
250
|
+
{#if renderMode === 'bars'}
|
|
251
|
+
{#each waveformBars as bar, index (index)}
|
|
252
|
+
<rect
|
|
253
|
+
class="cinder-waveform__bar"
|
|
254
|
+
x={bar.x}
|
|
255
|
+
y={bar.y}
|
|
256
|
+
width={bar.width}
|
|
257
|
+
height={bar.height}
|
|
258
|
+
aria-hidden="true"
|
|
259
|
+
/>
|
|
260
|
+
{/each}
|
|
261
|
+
{:else}
|
|
262
|
+
<path class="cinder-waveform__path" d={waveformPath} aria-hidden="true" />
|
|
263
|
+
{/if}
|
|
264
|
+
{/if}
|
|
265
|
+
</svg>
|
|
266
|
+
</div>
|
|
267
|
+
{#if hasDataTable}
|
|
268
|
+
<table class={dataTableClass(dataTableVisibility)}>
|
|
269
|
+
<caption>{tableCaption}</caption>
|
|
270
|
+
<thead>
|
|
271
|
+
<tr>
|
|
272
|
+
<th scope="col">Sample index</th>
|
|
273
|
+
<th scope="col">Amplitude</th>
|
|
274
|
+
</tr>
|
|
275
|
+
</thead>
|
|
276
|
+
<tbody>
|
|
277
|
+
{#each tableSamples as sample (sample.index)}
|
|
278
|
+
<tr>
|
|
279
|
+
<td>{sample.index}</td>
|
|
280
|
+
<td>{sample.value.toFixed(4)}</td>
|
|
281
|
+
</tr>
|
|
282
|
+
{/each}
|
|
283
|
+
</tbody>
|
|
284
|
+
</table>
|
|
285
|
+
{/if}
|
|
286
|
+
</figure>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { ChartDataTableVisibility } from '../chart.types.ts';
|
|
4
|
+
|
|
5
|
+
export type WaveformRenderMode = 'path' | 'bars';
|
|
6
|
+
|
|
7
|
+
export type WaveformProps = Omit<HTMLAttributes<HTMLElement>, 'class'> & {
|
|
8
|
+
/** Accessible label for the waveform. Required for screen readers. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Optional description rendered below the label. */
|
|
11
|
+
description?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Time-domain amplitude samples. Each value should be in the range [-1, 1].
|
|
14
|
+
* Values outside this range are clamped.
|
|
15
|
+
*/
|
|
16
|
+
data: number[];
|
|
17
|
+
/** How to render the waveform: as a continuous path or vertical amplitude bars. Default `path`. */
|
|
18
|
+
renderMode?: WaveformRenderMode;
|
|
19
|
+
/** Pixel height of the chart. Default `80`. */
|
|
20
|
+
height?: number;
|
|
21
|
+
/** Whether the waveform is in a loading state. */
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/** Controls data table visibility. Default `screen-reader-only`. */
|
|
24
|
+
dataTableVisibility?: ChartDataTableVisibility;
|
|
25
|
+
/** Custom data table caption; falls back to `label`. */
|
|
26
|
+
dataTableCaption?: string;
|
|
27
|
+
/** Custom class applied to the root element. */
|
|
28
|
+
class?: string;
|
|
29
|
+
/** Snippet rendered when the chart has no data. */
|
|
30
|
+
empty?: Snippet;
|
|
31
|
+
/** Snippet rendered while loading. */
|
|
32
|
+
loadingContent?: Snippet;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type WaveformSchemaProps = {
|
|
36
|
+
label: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
data: number[];
|
|
39
|
+
renderMode?: WaveformRenderMode;
|
|
40
|
+
height?: number;
|
|
41
|
+
loading?: boolean;
|
|
42
|
+
dataTableVisibility?: ChartDataTableVisibility;
|
|
43
|
+
dataTableCaption?: string;
|
|
44
|
+
class?: string;
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
package/src/index.ts
CHANGED
|
@@ -89,11 +89,22 @@ export { default as Callout } from './components/callout/index.ts';
|
|
|
89
89
|
export type { CalloutProps, CalloutVariant } from './components/callout/index.ts';
|
|
90
90
|
|
|
91
91
|
export { default as Card } from './components/card/index.ts';
|
|
92
|
-
export type { CardProps, CardTone, CardVariant } from './components/card/index.ts';
|
|
92
|
+
export type { CardPadding, CardProps, CardTone, CardVariant } from './components/card/index.ts';
|
|
93
93
|
|
|
94
94
|
export { default as Chat } from './components/chat/index.ts';
|
|
95
95
|
export type { ChatProps } from './components/chat/index.ts';
|
|
96
96
|
|
|
97
|
+
export { default as ChoiceGrid } from './components/choice-grid/index.ts';
|
|
98
|
+
export type {
|
|
99
|
+
ChoiceGridColumns,
|
|
100
|
+
ChoiceGridContext,
|
|
101
|
+
ChoiceGridItemState,
|
|
102
|
+
ChoiceGridProps,
|
|
103
|
+
} from './components/choice-grid/index.ts';
|
|
104
|
+
|
|
105
|
+
export { default as ChoiceGridItem } from './components/choice-grid-item/index.ts';
|
|
106
|
+
export type { ChoiceGridItemProps } from './components/choice-grid-item/index.ts';
|
|
107
|
+
|
|
97
108
|
export { default as Chip } from './components/chip/index.ts';
|
|
98
109
|
export type {
|
|
99
110
|
ChipDensity,
|
|
@@ -180,6 +191,13 @@ export { copyToClipboard } from './utilities/clipboard.ts';
|
|
|
180
191
|
export { default as DataList } from './components/data-list/index.ts';
|
|
181
192
|
export type { DataListProps } from './components/data-list/index.ts';
|
|
182
193
|
|
|
194
|
+
export { default as DataTable } from './components/data-table/index.ts';
|
|
195
|
+
export type {
|
|
196
|
+
DataTableColumn,
|
|
197
|
+
DataTableProps,
|
|
198
|
+
DataTableRow,
|
|
199
|
+
} from './components/data-table/index.ts';
|
|
200
|
+
|
|
183
201
|
export { default as DescriptionList } from './components/description-list/index.ts';
|
|
184
202
|
export type {
|
|
185
203
|
DescriptionListItem,
|
|
@@ -215,7 +233,12 @@ export type {
|
|
|
215
233
|
} from './components/dropdown/index.ts';
|
|
216
234
|
|
|
217
235
|
export { default as DropdownItem } from './components/dropdown-item/index.ts';
|
|
218
|
-
export type {
|
|
236
|
+
export type {
|
|
237
|
+
DropdownItemAnchorProps,
|
|
238
|
+
DropdownItemButtonProps,
|
|
239
|
+
DropdownItemProps,
|
|
240
|
+
DropdownItemVariant,
|
|
241
|
+
} from './components/dropdown-item/index.ts';
|
|
219
242
|
|
|
220
243
|
export { default as DropdownGroup } from './components/dropdown-group/index.ts';
|
|
221
244
|
export type { DropdownGroupProps } from './components/dropdown-group/index.ts';
|
|
@@ -303,6 +326,13 @@ export type {
|
|
|
303
326
|
export { default as JsonViewer } from './components/json-viewer/index.ts';
|
|
304
327
|
export type { JsonViewerProps } from './components/json-viewer/index.ts';
|
|
305
328
|
|
|
329
|
+
export { default as CapabilityGate } from './components/capability-gate/index.ts';
|
|
330
|
+
export type {
|
|
331
|
+
CapabilityGateProps,
|
|
332
|
+
CapabilityGateState,
|
|
333
|
+
CapabilityGateVariant,
|
|
334
|
+
} from './components/capability-gate/index.ts';
|
|
335
|
+
|
|
306
336
|
export { default as KanbanBoard } from './components/kanban-board/index.ts';
|
|
307
337
|
export type {
|
|
308
338
|
KanbanBoardCardContext,
|
|
@@ -318,6 +348,13 @@ export type {
|
|
|
318
348
|
export { default as Kbd } from './components/kbd/index.ts';
|
|
319
349
|
export type { KbdProps } from './components/kbd/index.ts';
|
|
320
350
|
|
|
351
|
+
export { default as KeyboardShortcuts } from './components/keyboard-shortcuts/index.ts';
|
|
352
|
+
export type {
|
|
353
|
+
KeyboardShortcutEntry,
|
|
354
|
+
KeyboardShortcutGroup,
|
|
355
|
+
KeyboardShortcutsProps,
|
|
356
|
+
} from './components/keyboard-shortcuts/index.ts';
|
|
357
|
+
|
|
321
358
|
export { default as Label } from './components/label/index.ts';
|
|
322
359
|
export type { LabelProps } from './components/label/index.ts';
|
|
323
360
|
|
|
@@ -330,6 +367,9 @@ export type { LineChartProps, LineChartSchemaProps } from './components/line-cha
|
|
|
330
367
|
export { default as LoadMore } from './components/load-more/index.ts';
|
|
331
368
|
export type { LoadMoreProps } from './components/load-more/index.ts';
|
|
332
369
|
|
|
370
|
+
export { default as MediaControls } from './components/media-controls/index.ts';
|
|
371
|
+
export type { MediaControlsLayout, MediaControlsProps } from './components/media-controls/index.ts';
|
|
372
|
+
|
|
333
373
|
export { default as MarkdownEditor } from './components/markdown-editor/index.ts';
|
|
334
374
|
export type {
|
|
335
375
|
EditorHandle,
|
|
@@ -354,6 +394,10 @@ export type {
|
|
|
354
394
|
export { default as Message } from './components/message/index.ts';
|
|
355
395
|
export type { MessageProps, MessageRole } from './components/message/index.ts';
|
|
356
396
|
|
|
397
|
+
export { default as MatrixChart } from './components/matrix-chart/index.ts';
|
|
398
|
+
export type { MatrixChartProps, MatrixChartSchemaProps } from './components/matrix-chart/index.ts';
|
|
399
|
+
export type { MatrixColorScale } from './components/matrix-chart/matrix-chart.types.ts';
|
|
400
|
+
|
|
357
401
|
export { default as Modal } from './components/modal/index.ts';
|
|
358
402
|
export type { ModalProps } from './components/modal/index.ts';
|
|
359
403
|
|
|
@@ -391,6 +435,9 @@ export type { PinInputMode, PinInputProps } from './components/pin-input/index.t
|
|
|
391
435
|
export { default as Popover } from './components/popover/index.ts';
|
|
392
436
|
export type { PopoverPlacement, PopoverProps, PopoverRole } from './components/popover/index.ts';
|
|
393
437
|
|
|
438
|
+
export { default as PricingCard } from './components/pricing-card/index.ts';
|
|
439
|
+
export type { PricingCardProps } from './components/pricing-card/index.ts';
|
|
440
|
+
|
|
394
441
|
export { default as Progress } from './components/progress/index.ts';
|
|
395
442
|
export type { ProgressProps, ProgressSize, ProgressVariant } from './components/progress/index.ts';
|
|
396
443
|
|
|
@@ -476,9 +523,15 @@ export type {
|
|
|
476
523
|
SelectionPopoverProps,
|
|
477
524
|
} from './components/selection-popover/index.ts';
|
|
478
525
|
|
|
526
|
+
export { default as ShareCard } from './components/share-card/index.ts';
|
|
527
|
+
export type { ShareCardAction, ShareCardProps } from './components/share-card/index.ts';
|
|
528
|
+
|
|
479
529
|
export { default as Sheet } from './components/sheet/index.ts';
|
|
480
530
|
export type { SheetProps } from './components/sheet/index.ts';
|
|
481
531
|
|
|
532
|
+
export { default as ShortcutHint } from './components/shortcut-hint/index.ts';
|
|
533
|
+
export type { ShortcutHintProps } from './components/shortcut-hint/index.ts';
|
|
534
|
+
|
|
482
535
|
export { default as SideNavigation } from './components/side-navigation/index.ts';
|
|
483
536
|
export type { SideNavigationProps } from './components/side-navigation/index.ts';
|
|
484
537
|
|
|
@@ -502,6 +555,9 @@ export type {
|
|
|
502
555
|
export { default as Skeleton } from './components/skeleton/index.ts';
|
|
503
556
|
export type { SkeletonProps } from './components/skeleton/index.ts';
|
|
504
557
|
|
|
558
|
+
export { default as SkipLink } from './components/skip-link/index.ts';
|
|
559
|
+
export type { SkipLinkProps, SkipLinkSchemaProps } from './components/skip-link/index.ts';
|
|
560
|
+
|
|
505
561
|
export { default as Slider } from './components/slider/index.ts';
|
|
506
562
|
export type { SliderMode, SliderProps, SliderValue } from './components/slider/index.ts';
|
|
507
563
|
|
|
@@ -511,6 +567,20 @@ export type {
|
|
|
511
567
|
StackedListItemProps,
|
|
512
568
|
} from './components/stacked-list-item/index.ts';
|
|
513
569
|
|
|
570
|
+
export { default as Spectrogram } from './components/spectrogram/index.ts';
|
|
571
|
+
export type {
|
|
572
|
+
SpectrogramFrame,
|
|
573
|
+
SpectrogramProps,
|
|
574
|
+
SpectrogramSchemaProps,
|
|
575
|
+
} from './components/spectrogram/index.ts';
|
|
576
|
+
|
|
577
|
+
export { default as SpectrumChart } from './components/spectrum-chart/index.ts';
|
|
578
|
+
export type {
|
|
579
|
+
SpectrumBin,
|
|
580
|
+
SpectrumChartProps,
|
|
581
|
+
SpectrumChartSchemaProps,
|
|
582
|
+
} from './components/spectrum-chart/index.ts';
|
|
583
|
+
|
|
514
584
|
export { default as Spinner } from './components/spinner/index.ts';
|
|
515
585
|
export type { SpinnerProps, SpinnerSize } from './components/spinner/index.ts';
|
|
516
586
|
|
|
@@ -534,6 +604,12 @@ export type {
|
|
|
534
604
|
StatusDotStatus,
|
|
535
605
|
} from './components/status-dot/index.ts';
|
|
536
606
|
|
|
607
|
+
export { default as SubscriptionBadge } from './components/subscription-badge/index.ts';
|
|
608
|
+
export type {
|
|
609
|
+
SubscriptionBadgeProps,
|
|
610
|
+
SubscriptionState,
|
|
611
|
+
} from './components/subscription-badge/index.ts';
|
|
612
|
+
|
|
537
613
|
export { default as Surface } from './components/surface/index.ts';
|
|
538
614
|
export type { SurfaceProps, SurfaceTone } from './components/surface/index.ts';
|
|
539
615
|
|
|
@@ -655,3 +731,10 @@ export type {
|
|
|
655
731
|
VisuallyHiddenElement,
|
|
656
732
|
VisuallyHiddenProps,
|
|
657
733
|
} from './components/visually-hidden/index.ts';
|
|
734
|
+
|
|
735
|
+
export { default as Waveform } from './components/waveform/index.ts';
|
|
736
|
+
export type {
|
|
737
|
+
WaveformProps,
|
|
738
|
+
WaveformRenderMode,
|
|
739
|
+
WaveformSchemaProps,
|
|
740
|
+
} from './components/waveform/index.ts';
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
@import '../components/button-group/button-group.css';
|
|
27
27
|
@import '../components/callout/callout.css';
|
|
28
28
|
@import '../components/card/card.css';
|
|
29
|
+
@import '../components/capability-gate/capability-gate.css';
|
|
29
30
|
@import '../components/chip/chip.css';
|
|
31
|
+
@import '../components/choice-grid/choice-grid.css';
|
|
30
32
|
@import '../components/checkbox/checkbox.css';
|
|
31
33
|
@import '../components/checkbox-group/checkbox-group.css';
|
|
32
34
|
@import '../components/code-block/code-block.css';
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
@import '../components/context-menu/context-menu.css';
|
|
43
45
|
@import '../components/copy-button/copy-button.css';
|
|
44
46
|
@import '../components/data-list/data-list.css';
|
|
47
|
+
@import '../components/data-table/data-table.css';
|
|
45
48
|
@import '../components/description-list/description-list.css';
|
|
46
49
|
@import '../components/diff-statistics/diff-statistics.css';
|
|
47
50
|
@import '../components/divider/divider.css';
|
|
@@ -63,10 +66,13 @@
|
|
|
63
66
|
@import '../components/json-viewer/json-viewer.css';
|
|
64
67
|
@import '../components/kanban-board/kanban-board.css';
|
|
65
68
|
@import '../components/kbd/kbd.css';
|
|
69
|
+
@import '../components/keyboard-shortcuts/keyboard-shortcuts.css';
|
|
66
70
|
@import '../components/label/label.css';
|
|
67
71
|
@import '../components/line-chart/line-chart.css';
|
|
68
72
|
@import '../components/link/link.css';
|
|
73
|
+
@import '../components/matrix-chart/matrix-chart.css';
|
|
69
74
|
@import '../components/load-more/load-more.css';
|
|
75
|
+
@import '../components/media-controls/media-controls.css';
|
|
70
76
|
@import '../components/menu-bar/menu-bar.css';
|
|
71
77
|
@import '../components/message/message.css';
|
|
72
78
|
@import '../components/modal/modal.css';
|
|
@@ -77,6 +83,7 @@
|
|
|
77
83
|
@import '../components/phone-input/phone-input.css';
|
|
78
84
|
@import '../components/pin-input/pin-input.css';
|
|
79
85
|
@import '../components/popover/popover.css';
|
|
86
|
+
@import '../components/pricing-card/pricing-card.css';
|
|
80
87
|
@import '../components/progress/progress.css';
|
|
81
88
|
@import '../components/_radio/radio.css';
|
|
82
89
|
@import '../components/radio-group/radio-group.css';
|
|
@@ -85,13 +92,17 @@
|
|
|
85
92
|
@import '../components/review-editor/review-editor.css';
|
|
86
93
|
@import '../components/scroll-area/scroll-area.css';
|
|
87
94
|
@import '../components/search-field/search-field.css';
|
|
95
|
+
@import '../components/share-card/share-card.css';
|
|
88
96
|
@import '../components/section-heading/section-heading.css';
|
|
89
97
|
@import '../components/select/select.css';
|
|
90
98
|
@import '../components/segmented-control/segmented-control.css';
|
|
91
99
|
@import '../components/selection-popover/selection-popover.css';
|
|
100
|
+
@import '../components/spectrogram/spectrogram.css';
|
|
101
|
+
@import '../components/spectrum-chart/spectrum-chart.css';
|
|
92
102
|
@import '../components/side-navigation/side-navigation.css';
|
|
93
103
|
@import '../components/side-navigation-group/side-navigation-group.css';
|
|
94
104
|
@import '../components/sheet/sheet.css';
|
|
105
|
+
@import '../components/shortcut-hint/shortcut-hint.css';
|
|
95
106
|
@import '../components/sidebar/sidebar.css';
|
|
96
107
|
@import '../components/skeleton/skeleton.css';
|
|
97
108
|
@import '../components/slider/slider.css';
|
|
@@ -102,6 +113,7 @@
|
|
|
102
113
|
@import '../components/stat-group/stat-group.css';
|
|
103
114
|
@import '../components/status-dot/status-dot.css';
|
|
104
115
|
@import '../components/steps/steps.css';
|
|
116
|
+
@import '../components/subscription-badge/subscription-badge.css';
|
|
105
117
|
@import '../components/surface/surface.css';
|
|
106
118
|
@import '../components/tab/tab.css';
|
|
107
119
|
@import '../components/tab-list/tab-list.css';
|
|
@@ -124,6 +136,7 @@
|
|
|
124
136
|
@import '../components/tree/tree.css';
|
|
125
137
|
@import '../components/_tree-select-all/tree-select-all.css';
|
|
126
138
|
@import '../components/typography/typography.css';
|
|
139
|
+
@import '../components/waveform/waveform.css';
|
|
127
140
|
|
|
128
141
|
/* Shared internal partial — base chrome for Alert/Banner dismiss buttons.
|
|
129
142
|
* Imported last to preserve the original source order of the inline rule it
|
package/src/styles/shell.css
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
@import './index.css';
|
|
10
10
|
@import '../components/button/button.css';
|
|
11
|
+
@import '../components/color-picker/color-picker.css';
|
|
12
|
+
@import '../components/color-swatch-picker/color-swatch-picker.css';
|
|
11
13
|
@import '../components/input/input.css';
|
|
12
14
|
@import '../components/number-input/number-input.css';
|
|
15
|
+
@import '../components/popover/popover.css';
|
|
13
16
|
@import '../components/segmented-control/segmented-control.css';
|
|
14
17
|
@import '../components/side-navigation/side-navigation.css';
|
|
15
18
|
/* side-navigation.css intentionally carries no per-item styling — the row
|