@nocoo/basalt 2.0.0-rc.1
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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/charts/area.d.ts +8 -0
- package/dist/charts/area.js +55 -0
- package/dist/charts/area.js.map +1 -0
- package/dist/charts/bar.d.ts +9 -0
- package/dist/charts/bar.js +42 -0
- package/dist/charts/bar.js.map +1 -0
- package/dist/charts/bullet.d.ts +8 -0
- package/dist/charts/bullet.js +50 -0
- package/dist/charts/bullet.js.map +1 -0
- package/dist/charts/chart-colors.d.ts +1 -0
- package/dist/charts/chart-colors.js +3 -0
- package/dist/charts/charts.d.ts +6 -0
- package/dist/charts/charts.js +15 -0
- package/dist/charts/charts.js.map +1 -0
- package/dist/charts/config.d.ts +117 -0
- package/dist/charts/config.js +117 -0
- package/dist/charts/config.js.map +1 -0
- package/dist/charts/custom-chart.d.ts +6 -0
- package/dist/charts/custom-chart.js +15 -0
- package/dist/charts/custom-chart.js.map +1 -0
- package/dist/charts/date-navigation.d.ts +22 -0
- package/dist/charts/date-navigation.js +122 -0
- package/dist/charts/date-navigation.js.map +1 -0
- package/dist/charts/donut.d.ts +8 -0
- package/dist/charts/donut.js +36 -0
- package/dist/charts/donut.js.map +1 -0
- package/dist/charts/frame.d.ts +9 -0
- package/dist/charts/frame.js +22 -0
- package/dist/charts/frame.js.map +1 -0
- package/dist/charts/funnel.d.ts +7 -0
- package/dist/charts/funnel.js +35 -0
- package/dist/charts/funnel.js.map +1 -0
- package/dist/charts/gauge.d.ts +8 -0
- package/dist/charts/gauge.js +46 -0
- package/dist/charts/gauge.js.map +1 -0
- package/dist/charts/grouped-bar.d.ts +7 -0
- package/dist/charts/grouped-bar.js +42 -0
- package/dist/charts/grouped-bar.js.map +1 -0
- package/dist/charts/heatmap-calendar.d.ts +27 -0
- package/dist/charts/heatmap-calendar.js +200 -0
- package/dist/charts/heatmap-calendar.js.map +1 -0
- package/dist/charts/item-list.d.ts +9 -0
- package/dist/charts/item-list.js +22 -0
- package/dist/charts/item-list.js.map +1 -0
- package/dist/charts/line.d.ts +9 -0
- package/dist/charts/line.js +58 -0
- package/dist/charts/line.js.map +1 -0
- package/dist/charts/palette.d.ts +33 -0
- package/dist/charts/palette.js +44 -0
- package/dist/charts/palette.js.map +1 -0
- package/dist/charts/radar.d.ts +6 -0
- package/dist/charts/radar.js +37 -0
- package/dist/charts/radar.js.map +1 -0
- package/dist/charts/sample.d.ts +42 -0
- package/dist/charts/sample.js +124 -0
- package/dist/charts/sample.js.map +1 -0
- package/dist/charts/sankey.d.ts +6 -0
- package/dist/charts/sankey.js +51 -0
- package/dist/charts/sankey.js.map +1 -0
- package/dist/charts/slot-bar.d.ts +15 -0
- package/dist/charts/slot-bar.js +80 -0
- package/dist/charts/slot-bar.js.map +1 -0
- package/dist/charts/sparkline.d.ts +6 -0
- package/dist/charts/sparkline.js +29 -0
- package/dist/charts/sparkline.js.map +1 -0
- package/dist/charts/stacked-bar.d.ts +7 -0
- package/dist/charts/stacked-bar.js +51 -0
- package/dist/charts/stacked-bar.js.map +1 -0
- package/dist/charts/stat-card.d.ts +21 -0
- package/dist/charts/stat-card.js +66 -0
- package/dist/charts/stat-card.js.map +1 -0
- package/dist/charts/timeline.d.ts +17 -0
- package/dist/charts/timeline.js +79 -0
- package/dist/charts/timeline.js.map +1 -0
- package/dist/charts/timeseries.d.ts +6 -0
- package/dist/charts/timeseries.js +15 -0
- package/dist/charts/timeseries.js.map +1 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +21 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +25 -0
- package/dist/components/alert-dialog.js +61 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/app-header.d.ts +10 -0
- package/dist/components/app-header.js +35 -0
- package/dist/components/app-header.js.map +1 -0
- package/dist/components/app-shell.d.ts +4 -0
- package/dist/components/app-shell.js +29 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.d.ts +47 -0
- package/dist/components/autocomplete.js +28 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +28 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.js +37 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/banner.d.ts +22 -0
- package/dist/components/banner.js +88 -0
- package/dist/components/banner.js.map +1 -0
- package/dist/components/basalt-mark.d.ts +8 -0
- package/dist/components/basalt-mark.js +17 -0
- package/dist/components/basalt-mark.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +9 -0
- package/dist/components/breadcrumbs.js +38 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.js +73 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/checkbox.d.ts +86 -0
- package/dist/components/checkbox.js +107 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/clipboard-text.d.ts +5 -0
- package/dist/components/clipboard-text.js +33 -0
- package/dist/components/clipboard-text.js.map +1 -0
- package/dist/components/code.d.ts +26 -0
- package/dist/components/code.js +45 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/collapsible.d.ts +33 -0
- package/dist/components/collapsible.js +38 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +47 -0
- package/dist/components/combobox.js +28 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command-palette.d.ts +83 -0
- package/dist/components/command-palette.js +90 -0
- package/dist/components/command-palette.js.map +1 -0
- package/dist/components/confirm-dialog.d.ts +52 -0
- package/dist/components/confirm-dialog.js +61 -0
- package/dist/components/confirm-dialog.js.map +1 -0
- package/dist/components/context-menu.d.ts +7 -0
- package/dist/components/context-menu.js +23 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +76 -0
- package/dist/components/data-table.js +230 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +90 -0
- package/dist/components/date-picker.js +452 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +37 -0
- package/dist/components/dialog.js +67 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +38 -0
- package/dist/components/dropdown-menu.js +24 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +6 -0
- package/dist/components/empty.js +28 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +39 -0
- package/dist/components/field.js +52 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/flow.d.ts +24 -0
- package/dist/components/flow.js +56 -0
- package/dist/components/flow.js.map +1 -0
- package/dist/components/grid.d.ts +15 -0
- package/dist/components/grid.js +24 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/hover-card.d.ts +5 -0
- package/dist/components/hover-card.js +18 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-area.d.ts +19 -0
- package/dist/components/input-area.js +27 -0
- package/dist/components/input-area.js.map +1 -0
- package/dist/components/input-group.d.ts +70 -0
- package/dist/components/input-group.js +78 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +19 -0
- package/dist/components/input.js +28 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +20 -0
- package/dist/components/label.js +34 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layer-card.d.ts +69 -0
- package/dist/components/layer-card.js +104 -0
- package/dist/components/layer-card.js.map +1 -0
- package/dist/components/link.d.ts +8 -0
- package/dist/components/link.js +18 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/loader.d.ts +4 -0
- package/dist/components/loader.js +66 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/loading-screen.d.ts +5 -0
- package/dist/components/loading-screen.js +24 -0
- package/dist/components/loading-screen.js.map +1 -0
- package/dist/components/menu-bar.d.ts +8 -0
- package/dist/components/menu-bar.js +42 -0
- package/dist/components/menu-bar.js.map +1 -0
- package/dist/components/meter.d.ts +8 -0
- package/dist/components/meter.js +26 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +6 -0
- package/dist/components/navigation-menu.js +16 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/overlay.d.ts +16 -0
- package/dist/components/overlay.js +14 -0
- package/dist/components/overlay.js.map +1 -0
- package/dist/components/page-header.d.ts +19 -0
- package/dist/components/page-header.js +43 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +35 -0
- package/dist/components/pagination.js +68 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +38 -0
- package/dist/components/popover.js +65 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/radio.d.ts +108 -0
- package/dist/components/radio.js +80 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/scroll-area.d.ts +15 -0
- package/dist/components/scroll-area.js +49 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/segment-control.d.ts +35 -0
- package/dist/components/segment-control.js +46 -0
- package/dist/components/segment-control.js.map +1 -0
- package/dist/components/select.d.ts +99 -0
- package/dist/components/select.js +51 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/sensitive-input.d.ts +23 -0
- package/dist/components/sensitive-input.js +43 -0
- package/dist/components/sensitive-input.js.map +1 -0
- package/dist/components/separator.d.ts +26 -0
- package/dist/components/separator.js +18 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +26 -0
- package/dist/components/sheet.js +49 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +101 -0
- package/dist/components/sidebar.js +260 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton-line.d.ts +6 -0
- package/dist/components/skeleton-line.js +22 -0
- package/dist/components/skeleton-line.js.map +1 -0
- package/dist/components/slider.d.ts +3 -0
- package/dist/components/slider.js +21 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/stat-strip.d.ts +19 -0
- package/dist/components/stat-strip.js +27 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/switch.d.ts +85 -0
- package/dist/components/switch.js +94 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table-of-contents.d.ts +33 -0
- package/dist/components/table-of-contents.js +37 -0
- package/dist/components/table-of-contents.js.map +1 -0
- package/dist/components/table-pager.d.ts +26 -0
- package/dist/components/table-pager.js +35 -0
- package/dist/components/table-pager.js.map +1 -0
- package/dist/components/table.d.ts +45 -0
- package/dist/components/table.js +32 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +65 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text.d.ts +32 -0
- package/dist/components/text.js +46 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/theme-toggle.d.ts +7 -0
- package/dist/components/theme-toggle.js +28 -0
- package/dist/components/theme-toggle.js.map +1 -0
- package/dist/components/toast.d.ts +27 -0
- package/dist/components/toast.js +78 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.d.ts +4 -0
- package/dist/components/toggle-group.js +48 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +37 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/toolbar.d.ts +58 -0
- package/dist/components/toolbar.js +76 -0
- package/dist/components/toolbar.js.map +1 -0
- package/dist/components/tooltip.d.ts +13 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typeahead-field.d.ts +24 -0
- package/dist/components/typeahead-field.js +177 -0
- package/dist/components/typeahead-field.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +35 -0
- package/dist/providers/link.d.ts +12 -0
- package/dist/providers/link.js +18 -0
- package/dist/providers/link.js.map +1 -0
- package/dist/providers/theme.d.ts +11 -0
- package/dist/providers/theme.js +43 -0
- package/dist/providers/theme.js.map +1 -0
- package/dist/styles/standalone.css +2233 -0
- package/dist/styles/tailwind.css +103 -0
- package/dist/styles/tokens.css +277 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/control-surface.d.ts +2 -0
- package/dist/utils/control-surface.js +11 -0
- package/dist/utils/control-surface.js.map +1 -0
- package/dist/utils/selection-indicator.d.ts +24 -0
- package/dist/utils/selection-indicator.js +108 -0
- package/dist/utils/selection-indicator.js.map +1 -0
- package/package.json +107 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import "./tokens.css";
|
|
2
|
+
|
|
3
|
+
@theme inline {
|
|
4
|
+
--color-basalt-background: hsl(var(--basalt-background));
|
|
5
|
+
--color-basalt-foreground: hsl(var(--basalt-foreground));
|
|
6
|
+
--color-basalt-card: hsl(var(--basalt-card));
|
|
7
|
+
--color-basalt-card-foreground: hsl(var(--basalt-card-foreground));
|
|
8
|
+
--color-basalt-secondary: hsl(var(--basalt-secondary));
|
|
9
|
+
--color-basalt-secondary-foreground: hsl(var(--basalt-secondary-foreground));
|
|
10
|
+
--color-basalt-popover: hsl(var(--basalt-popover));
|
|
11
|
+
--color-basalt-popover-foreground: hsl(var(--basalt-popover-foreground));
|
|
12
|
+
--color-basalt-bright: hsl(var(--basalt-bright));
|
|
13
|
+
--color-basalt-primary: hsl(var(--basalt-primary));
|
|
14
|
+
--color-basalt-primary-foreground: hsl(var(--basalt-primary-foreground));
|
|
15
|
+
--color-basalt-muted: hsl(var(--basalt-muted));
|
|
16
|
+
--color-basalt-muted-foreground: hsl(var(--basalt-muted-foreground));
|
|
17
|
+
--color-basalt-accent: hsl(var(--basalt-accent));
|
|
18
|
+
--color-basalt-accent-foreground: hsl(var(--basalt-accent-foreground));
|
|
19
|
+
--color-basalt-destructive: hsl(var(--basalt-destructive));
|
|
20
|
+
--color-basalt-destructive-foreground: hsl(var(--basalt-destructive-foreground));
|
|
21
|
+
--color-basalt-info: hsl(var(--basalt-info));
|
|
22
|
+
--color-basalt-info-tint: hsl(var(--basalt-info-tint));
|
|
23
|
+
--color-basalt-warning: hsl(var(--basalt-warning));
|
|
24
|
+
--color-basalt-warning-tint: hsl(var(--basalt-warning-tint));
|
|
25
|
+
--color-basalt-danger: hsl(var(--basalt-danger));
|
|
26
|
+
--color-basalt-danger-tint: hsl(var(--basalt-danger-tint));
|
|
27
|
+
--color-basalt-border: hsl(var(--basalt-border));
|
|
28
|
+
--color-basalt-input: hsl(var(--basalt-input));
|
|
29
|
+
--color-basalt-ring: hsl(var(--basalt-ring));
|
|
30
|
+
--color-basalt-chart-1: hsl(var(--basalt-chart-1));
|
|
31
|
+
--color-basalt-chart-2: hsl(var(--basalt-chart-2));
|
|
32
|
+
--color-basalt-chart-3: hsl(var(--basalt-chart-3));
|
|
33
|
+
--color-basalt-chart-4: hsl(var(--basalt-chart-4));
|
|
34
|
+
--color-basalt-chart-5: hsl(var(--basalt-chart-5));
|
|
35
|
+
--color-basalt-chart-6: hsl(var(--basalt-chart-6));
|
|
36
|
+
--color-basalt-chart-7: hsl(var(--basalt-chart-7));
|
|
37
|
+
--color-basalt-chart-8: hsl(var(--basalt-chart-8));
|
|
38
|
+
--color-basalt-chart-9: hsl(var(--basalt-chart-9));
|
|
39
|
+
--color-basalt-chart-10: hsl(var(--basalt-chart-10));
|
|
40
|
+
--color-basalt-chart-11: hsl(var(--basalt-chart-11));
|
|
41
|
+
--color-basalt-chart-12: hsl(var(--basalt-chart-12));
|
|
42
|
+
--color-basalt-chart-13: hsl(var(--basalt-chart-13));
|
|
43
|
+
--color-basalt-chart-14: hsl(var(--basalt-chart-14));
|
|
44
|
+
--color-basalt-chart-15: hsl(var(--basalt-chart-15));
|
|
45
|
+
--color-basalt-chart-16: hsl(var(--basalt-chart-16));
|
|
46
|
+
--color-basalt-chart-17: hsl(var(--basalt-chart-17));
|
|
47
|
+
--color-basalt-chart-18: hsl(var(--basalt-chart-18));
|
|
48
|
+
--color-basalt-chart-19: hsl(var(--basalt-chart-19));
|
|
49
|
+
--color-basalt-chart-20: hsl(var(--basalt-chart-20));
|
|
50
|
+
--color-basalt-chart-21: hsl(var(--basalt-chart-21));
|
|
51
|
+
--color-basalt-chart-22: hsl(var(--basalt-chart-22));
|
|
52
|
+
--color-basalt-chart-23: hsl(var(--basalt-chart-23));
|
|
53
|
+
--color-basalt-chart-24: hsl(var(--basalt-chart-24));
|
|
54
|
+
--color-basalt-chart-axis: hsl(var(--basalt-chart-axis));
|
|
55
|
+
--color-basalt-chart-muted: hsl(var(--basalt-chart-muted));
|
|
56
|
+
--color-basalt-heatmap-green-1: hsl(var(--basalt-heatmap-green-1));
|
|
57
|
+
--color-basalt-heatmap-green-2: hsl(var(--basalt-heatmap-green-2));
|
|
58
|
+
--color-basalt-heatmap-green-3: hsl(var(--basalt-heatmap-green-3));
|
|
59
|
+
--color-basalt-heatmap-green-4: hsl(var(--basalt-heatmap-green-4));
|
|
60
|
+
--color-basalt-heatmap-red-1: hsl(var(--basalt-heatmap-red-1));
|
|
61
|
+
--color-basalt-heatmap-red-2: hsl(var(--basalt-heatmap-red-2));
|
|
62
|
+
--color-basalt-heatmap-red-3: hsl(var(--basalt-heatmap-red-3));
|
|
63
|
+
--color-basalt-heatmap-red-4: hsl(var(--basalt-heatmap-red-4));
|
|
64
|
+
--color-basalt-heatmap-blue-1: hsl(var(--basalt-heatmap-blue-1));
|
|
65
|
+
--color-basalt-heatmap-blue-2: hsl(var(--basalt-heatmap-blue-2));
|
|
66
|
+
--color-basalt-heatmap-blue-3: hsl(var(--basalt-heatmap-blue-3));
|
|
67
|
+
--color-basalt-heatmap-blue-4: hsl(var(--basalt-heatmap-blue-4));
|
|
68
|
+
--color-basalt-heatmap-orange-1: hsl(var(--basalt-heatmap-orange-1));
|
|
69
|
+
--color-basalt-heatmap-orange-2: hsl(var(--basalt-heatmap-orange-2));
|
|
70
|
+
--color-basalt-heatmap-orange-3: hsl(var(--basalt-heatmap-orange-3));
|
|
71
|
+
--color-basalt-heatmap-orange-4: hsl(var(--basalt-heatmap-orange-4));
|
|
72
|
+
--radius-basalt-lg: var(--basalt-radius);
|
|
73
|
+
--radius-basalt-md: calc(var(--basalt-radius) - 2px);
|
|
74
|
+
--radius-basalt-sm: calc(var(--basalt-radius) - 4px);
|
|
75
|
+
--radius-basalt-island: var(--basalt-radius-island);
|
|
76
|
+
--radius-basalt-card: var(--basalt-radius-card);
|
|
77
|
+
--radius-basalt-widget: var(--basalt-radius-widget);
|
|
78
|
+
--font-basalt-sans: var(--basalt-font-sans);
|
|
79
|
+
--font-basalt-display: var(--basalt-font-display);
|
|
80
|
+
--animate-basalt-accordion-down: basalt-accordion-down 0.2s ease-out;
|
|
81
|
+
--animate-basalt-accordion-up: basalt-accordion-up 0.2s ease-out;
|
|
82
|
+
--animate-basalt-spin: basalt-spin 1s linear infinite;
|
|
83
|
+
--animate-basalt-loader: basalt-loader-spin 1.4s linear infinite;
|
|
84
|
+
--animate-pulse: basalt-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
85
|
+
--animate-basalt-overlay-in: basalt-overlay-in 200ms ease-out;
|
|
86
|
+
--animate-basalt-overlay-out: basalt-overlay-out 150ms ease-in forwards;
|
|
87
|
+
--animate-basalt-dialog-in: basalt-dialog-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
88
|
+
--animate-basalt-dialog-out: basalt-dialog-out 140ms cubic-bezier(0.4, 0, 1, 1) forwards;
|
|
89
|
+
--animate-basalt-collapsible-down: basalt-collapsible-down 150ms ease-out;
|
|
90
|
+
--animate-basalt-collapsible-up: basalt-collapsible-up 100ms ease-in;
|
|
91
|
+
--animate-basalt-shimmer: basalt-shimmer 1.5s ease-in-out infinite;
|
|
92
|
+
--animate-basalt-tab-in: basalt-tab-in 180ms ease-out;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.basalt-chart .recharts-wrapper :focus,
|
|
96
|
+
.basalt-chart .recharts-wrapper :focus-visible,
|
|
97
|
+
.basalt-chart .recharts-surface :focus,
|
|
98
|
+
.basalt-chart .recharts-surface :focus-visible,
|
|
99
|
+
.basalt-chart .recharts-sector:focus,
|
|
100
|
+
.basalt-chart .recharts-rectangle:focus,
|
|
101
|
+
.basalt-chart .recharts-layer:focus {
|
|
102
|
+
outline: none;
|
|
103
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
.light,
|
|
3
|
+
[data-mode="light"] {
|
|
4
|
+
--basalt-background: 220 14% 94%;
|
|
5
|
+
--basalt-foreground: 0 0% 12%;
|
|
6
|
+
--basalt-card: 220 14% 97%;
|
|
7
|
+
--basalt-card-foreground: 0 0% 12%;
|
|
8
|
+
--basalt-secondary: 220 14% 99%;
|
|
9
|
+
--basalt-secondary-foreground: 0 0% 12%;
|
|
10
|
+
--basalt-popover: 0 0% 100%;
|
|
11
|
+
--basalt-popover-foreground: 0 0% 12%;
|
|
12
|
+
--basalt-bright: 0 0% 100%;
|
|
13
|
+
--basalt-primary: 217 91% 60%;
|
|
14
|
+
--basalt-primary-foreground: 0 0% 100%;
|
|
15
|
+
--basalt-muted: 220 14% 92%;
|
|
16
|
+
--basalt-muted-foreground: 0 0% 45%;
|
|
17
|
+
--basalt-accent: 220 14% 92%;
|
|
18
|
+
--basalt-accent-foreground: 0 0% 12%;
|
|
19
|
+
--basalt-destructive: 0 72% 51%;
|
|
20
|
+
--basalt-destructive-foreground: 0 0% 100%;
|
|
21
|
+
--basalt-info: 221 72% 38%;
|
|
22
|
+
--basalt-info-tint: 217 80% 95%;
|
|
23
|
+
--basalt-warning: 28 72% 36%;
|
|
24
|
+
--basalt-warning-tint: 40 86% 95%;
|
|
25
|
+
--basalt-danger: 0 70% 40%;
|
|
26
|
+
--basalt-danger-tint: 0 78% 96%;
|
|
27
|
+
--basalt-border: 220 13% 88%;
|
|
28
|
+
--basalt-input: 220 13% 88%;
|
|
29
|
+
--basalt-ring: 217 91% 60%;
|
|
30
|
+
--basalt-radius: 0.75rem;
|
|
31
|
+
--basalt-radius-island: 20px;
|
|
32
|
+
--basalt-radius-card: 14px;
|
|
33
|
+
--basalt-radius-widget: 10px;
|
|
34
|
+
--basalt-font-sans: "Inter", system-ui, -apple-system, sans-serif;
|
|
35
|
+
--basalt-font-display: "DM Sans", system-ui, sans-serif;
|
|
36
|
+
--basalt-chart-1: 217 91% 60%;
|
|
37
|
+
--basalt-chart-2: 200 90% 55%;
|
|
38
|
+
--basalt-chart-3: 186 80% 45%;
|
|
39
|
+
--basalt-chart-4: 166 72% 44%;
|
|
40
|
+
--basalt-chart-5: 142 71% 45%;
|
|
41
|
+
--basalt-chart-6: 84 65% 46%;
|
|
42
|
+
--basalt-chart-7: 45 93% 47%;
|
|
43
|
+
--basalt-chart-8: 30 90% 55%;
|
|
44
|
+
--basalt-chart-9: 15 85% 52%;
|
|
45
|
+
--basalt-chart-10: 0 72% 51%;
|
|
46
|
+
--basalt-chart-11: 340 82% 55%;
|
|
47
|
+
--basalt-chart-12: 320 70% 55%;
|
|
48
|
+
--basalt-chart-13: 290 65% 55%;
|
|
49
|
+
--basalt-chart-14: 270 70% 60%;
|
|
50
|
+
--basalt-chart-15: 250 65% 58%;
|
|
51
|
+
--basalt-chart-16: 230 70% 56%;
|
|
52
|
+
--basalt-chart-17: 210 55% 50%;
|
|
53
|
+
--basalt-chart-18: 195 45% 55%;
|
|
54
|
+
--basalt-chart-19: 160 50% 50%;
|
|
55
|
+
--basalt-chart-20: 100 50% 48%;
|
|
56
|
+
--basalt-chart-21: 60 65% 45%;
|
|
57
|
+
--basalt-chart-22: 22 80% 50%;
|
|
58
|
+
--basalt-chart-23: 350 65% 50%;
|
|
59
|
+
--basalt-chart-24: 0 0% 25%;
|
|
60
|
+
--basalt-chart-axis: 0 0% 40%;
|
|
61
|
+
--basalt-chart-muted: 0 0% 70%;
|
|
62
|
+
--basalt-heatmap-green-1: 142 50% 85%;
|
|
63
|
+
--basalt-heatmap-green-2: 142 55% 65%;
|
|
64
|
+
--basalt-heatmap-green-3: 142 60% 45%;
|
|
65
|
+
--basalt-heatmap-green-4: 142 65% 30%;
|
|
66
|
+
--basalt-heatmap-red-1: 0 55% 85%;
|
|
67
|
+
--basalt-heatmap-red-2: 0 60% 65%;
|
|
68
|
+
--basalt-heatmap-red-3: 0 65% 48%;
|
|
69
|
+
--basalt-heatmap-red-4: 0 65% 35%;
|
|
70
|
+
--basalt-heatmap-blue-1: 217 50% 85%;
|
|
71
|
+
--basalt-heatmap-blue-2: 217 55% 65%;
|
|
72
|
+
--basalt-heatmap-blue-3: 217 60% 48%;
|
|
73
|
+
--basalt-heatmap-blue-4: 217 65% 35%;
|
|
74
|
+
--basalt-heatmap-orange-1: 30 55% 85%;
|
|
75
|
+
--basalt-heatmap-orange-2: 30 60% 65%;
|
|
76
|
+
--basalt-heatmap-orange-3: 30 65% 48%;
|
|
77
|
+
--basalt-heatmap-orange-4: 30 65% 35%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dark,
|
|
81
|
+
[data-mode="dark"] {
|
|
82
|
+
--basalt-background: 0 0% 9%;
|
|
83
|
+
--basalt-foreground: 0 0% 93%;
|
|
84
|
+
--basalt-card: 0 0% 10.6%;
|
|
85
|
+
--basalt-card-foreground: 0 0% 93%;
|
|
86
|
+
--basalt-secondary: 0 0% 12.2%;
|
|
87
|
+
--basalt-secondary-foreground: 0 0% 93%;
|
|
88
|
+
--basalt-popover: 0 0% 10.6%;
|
|
89
|
+
--basalt-popover-foreground: 0 0% 93%;
|
|
90
|
+
--basalt-bright: 0 0% 14%;
|
|
91
|
+
--basalt-primary: 217 91% 60%;
|
|
92
|
+
--basalt-primary-foreground: 0 0% 100%;
|
|
93
|
+
--basalt-muted: 0 0% 12.2%;
|
|
94
|
+
--basalt-muted-foreground: 0 0% 48%;
|
|
95
|
+
--basalt-accent: 0 0% 14%;
|
|
96
|
+
--basalt-accent-foreground: 0 0% 93%;
|
|
97
|
+
--basalt-destructive: 0 72% 51%;
|
|
98
|
+
--basalt-destructive-foreground: 0 0% 100%;
|
|
99
|
+
--basalt-info: 217 80% 72%;
|
|
100
|
+
--basalt-info-tint: 217 40% 16%;
|
|
101
|
+
--basalt-warning: 32 80% 68%;
|
|
102
|
+
--basalt-warning-tint: 32 35% 16%;
|
|
103
|
+
--basalt-danger: 0 75% 70%;
|
|
104
|
+
--basalt-danger-tint: 0 40% 16%;
|
|
105
|
+
--basalt-border: 0 0% 16%;
|
|
106
|
+
--basalt-input: 0 0% 18%;
|
|
107
|
+
--basalt-ring: 217 91% 60%;
|
|
108
|
+
--basalt-chart-1: 217 91% 65%;
|
|
109
|
+
--basalt-chart-2: 200 90% 60%;
|
|
110
|
+
--basalt-chart-3: 186 80% 50%;
|
|
111
|
+
--basalt-chart-4: 166 72% 50%;
|
|
112
|
+
--basalt-chart-5: 142 71% 50%;
|
|
113
|
+
--basalt-chart-6: 84 65% 52%;
|
|
114
|
+
--basalt-chart-7: 45 93% 52%;
|
|
115
|
+
--basalt-chart-8: 30 90% 60%;
|
|
116
|
+
--basalt-chart-9: 15 85% 57%;
|
|
117
|
+
--basalt-chart-10: 0 72% 56%;
|
|
118
|
+
--basalt-chart-11: 340 82% 60%;
|
|
119
|
+
--basalt-chart-12: 320 70% 60%;
|
|
120
|
+
--basalt-chart-13: 290 65% 60%;
|
|
121
|
+
--basalt-chart-14: 270 70% 65%;
|
|
122
|
+
--basalt-chart-15: 250 65% 63%;
|
|
123
|
+
--basalt-chart-16: 230 70% 61%;
|
|
124
|
+
--basalt-chart-17: 210 55% 56%;
|
|
125
|
+
--basalt-chart-18: 195 45% 60%;
|
|
126
|
+
--basalt-chart-19: 160 50% 55%;
|
|
127
|
+
--basalt-chart-20: 100 50% 53%;
|
|
128
|
+
--basalt-chart-21: 60 65% 50%;
|
|
129
|
+
--basalt-chart-22: 22 80% 55%;
|
|
130
|
+
--basalt-chart-23: 350 65% 55%;
|
|
131
|
+
--basalt-chart-24: 0 0% 65%;
|
|
132
|
+
--basalt-chart-axis: 0 0% 50%;
|
|
133
|
+
--basalt-chart-muted: 0 0% 35%;
|
|
134
|
+
--basalt-heatmap-green-1: 142 45% 25%;
|
|
135
|
+
--basalt-heatmap-green-2: 142 50% 35%;
|
|
136
|
+
--basalt-heatmap-green-3: 142 55% 45%;
|
|
137
|
+
--basalt-heatmap-green-4: 142 60% 58%;
|
|
138
|
+
--basalt-heatmap-red-1: 0 45% 25%;
|
|
139
|
+
--basalt-heatmap-red-2: 0 55% 35%;
|
|
140
|
+
--basalt-heatmap-red-3: 0 60% 45%;
|
|
141
|
+
--basalt-heatmap-red-4: 0 65% 55%;
|
|
142
|
+
--basalt-heatmap-blue-1: 217 45% 25%;
|
|
143
|
+
--basalt-heatmap-blue-2: 217 50% 35%;
|
|
144
|
+
--basalt-heatmap-blue-3: 217 55% 45%;
|
|
145
|
+
--basalt-heatmap-blue-4: 217 60% 55%;
|
|
146
|
+
--basalt-heatmap-orange-1: 30 45% 25%;
|
|
147
|
+
--basalt-heatmap-orange-2: 30 55% 35%;
|
|
148
|
+
--basalt-heatmap-orange-3: 30 60% 45%;
|
|
149
|
+
--basalt-heatmap-orange-4: 30 65% 55%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@keyframes basalt-accordion-down {
|
|
153
|
+
from {
|
|
154
|
+
height: 0;
|
|
155
|
+
}
|
|
156
|
+
to {
|
|
157
|
+
height: var(--radix-accordion-content-height);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@keyframes basalt-accordion-up {
|
|
162
|
+
from {
|
|
163
|
+
height: var(--radix-accordion-content-height);
|
|
164
|
+
}
|
|
165
|
+
to {
|
|
166
|
+
height: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes basalt-spin {
|
|
171
|
+
to {
|
|
172
|
+
transform: rotate(360deg);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@keyframes basalt-loader-spin {
|
|
177
|
+
0% {
|
|
178
|
+
transform: rotate(0deg);
|
|
179
|
+
}
|
|
180
|
+
12% {
|
|
181
|
+
transform: rotate(18deg);
|
|
182
|
+
}
|
|
183
|
+
55% {
|
|
184
|
+
transform: rotate(300deg);
|
|
185
|
+
}
|
|
186
|
+
100% {
|
|
187
|
+
transform: rotate(360deg);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@keyframes basalt-pulse {
|
|
192
|
+
50% {
|
|
193
|
+
opacity: 0.5;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@keyframes basalt-overlay-in {
|
|
198
|
+
from {
|
|
199
|
+
opacity: 0;
|
|
200
|
+
}
|
|
201
|
+
to {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@keyframes basalt-overlay-out {
|
|
207
|
+
from {
|
|
208
|
+
opacity: 1;
|
|
209
|
+
}
|
|
210
|
+
to {
|
|
211
|
+
opacity: 0;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@keyframes basalt-dialog-in {
|
|
216
|
+
from {
|
|
217
|
+
opacity: 0;
|
|
218
|
+
scale: 0.92;
|
|
219
|
+
}
|
|
220
|
+
to {
|
|
221
|
+
opacity: 1;
|
|
222
|
+
scale: 1;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@keyframes basalt-dialog-out {
|
|
227
|
+
from {
|
|
228
|
+
opacity: 1;
|
|
229
|
+
scale: 1;
|
|
230
|
+
}
|
|
231
|
+
to {
|
|
232
|
+
opacity: 0;
|
|
233
|
+
scale: 0.92;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@keyframes basalt-collapsible-down {
|
|
238
|
+
from {
|
|
239
|
+
height: 0;
|
|
240
|
+
opacity: 0;
|
|
241
|
+
}
|
|
242
|
+
to {
|
|
243
|
+
height: var(--radix-collapsible-content-height);
|
|
244
|
+
opacity: 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@keyframes basalt-collapsible-up {
|
|
249
|
+
from {
|
|
250
|
+
height: var(--radix-collapsible-content-height);
|
|
251
|
+
opacity: 1;
|
|
252
|
+
}
|
|
253
|
+
to {
|
|
254
|
+
height: 0;
|
|
255
|
+
opacity: 0;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@keyframes basalt-shimmer {
|
|
260
|
+
from {
|
|
261
|
+
transform: translateX(-100%);
|
|
262
|
+
}
|
|
263
|
+
to {
|
|
264
|
+
transform: translateX(100%);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@keyframes basalt-tab-in {
|
|
269
|
+
from {
|
|
270
|
+
opacity: 0;
|
|
271
|
+
transform: translateY(4px);
|
|
272
|
+
}
|
|
273
|
+
to {
|
|
274
|
+
opacity: 1;
|
|
275
|
+
transform: translateY(0);
|
|
276
|
+
}
|
|
277
|
+
}
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","names":[],"sources":["../../src/utils/cn.ts"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n"],"mappings":";;;;AAGA,SAAgB,EAAG,GAAG,GAAsB;CAC3C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "./cn.js";
|
|
3
|
+
//#region src/utils/control-surface.ts
|
|
4
|
+
var t = "rounded-basalt-md border border-basalt-border bg-basalt-secondary text-sm";
|
|
5
|
+
function n(n) {
|
|
6
|
+
return e(t, n);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as CONTROL_SURFACE_CLASS, n as controlSurfaceClass };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=control-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-surface.js","names":[],"sources":["../../src/utils/control-surface.ts"],"sourcesContent":["import { cn } from \"./cn\";\n\nexport const CONTROL_SURFACE_CLASS =\n\t\"rounded-basalt-md border border-basalt-border bg-basalt-secondary text-sm\";\n\nexport function controlSurfaceClass(className?: string) {\n\treturn cn(CONTROL_SURFACE_CLASS, className);\n}\n"],"mappings":";;;AAEA,IAAa,IACZ;AAED,SAAgB,EAAoB,GAAoB;CACvD,OAAO,EAAG,GAAuB,CAAS;AAC3C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const SELECTION_INDICATOR_MOTION_CLASS = "transition-[left,width,top,height] duration-200 ease-out";
|
|
3
|
+
export type SelectionGeometry = {
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
top: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export type SelectionIndicatorState = SelectionGeometry & {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
animated: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function assignRef<T>(ref: React.Ref<T> | undefined, value: T | null): void;
|
|
14
|
+
export declare function measureSelectionItem(item: HTMLElement): SelectionGeometry;
|
|
15
|
+
export declare function useSelectionIndicator({ itemSelector, enabled, mapGeometry, ref, }: {
|
|
16
|
+
itemSelector: string;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
mapGeometry?: (item: HTMLElement, root: HTMLElement) => SelectionGeometry;
|
|
19
|
+
ref?: React.Ref<HTMLElement | null>;
|
|
20
|
+
}): {
|
|
21
|
+
ref: (node: HTMLElement | null) => void;
|
|
22
|
+
state: SelectionIndicatorState;
|
|
23
|
+
motionClassName: string | undefined;
|
|
24
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
//#region src/utils/selection-indicator.ts
|
|
4
|
+
var t = "transition-[left,width,top,height] duration-200 ease-out", n = {
|
|
5
|
+
left: 0,
|
|
6
|
+
width: 0,
|
|
7
|
+
top: 0,
|
|
8
|
+
height: 0
|
|
9
|
+
};
|
|
10
|
+
function r(e, t) {
|
|
11
|
+
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
12
|
+
}
|
|
13
|
+
function i(e) {
|
|
14
|
+
return {
|
|
15
|
+
left: e.offsetLeft,
|
|
16
|
+
width: e.offsetWidth,
|
|
17
|
+
top: e.offsetTop,
|
|
18
|
+
height: e.offsetHeight
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function a() {
|
|
22
|
+
return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
23
|
+
}
|
|
24
|
+
function o(e) {
|
|
25
|
+
let t = [e];
|
|
26
|
+
for (let n of e.children) n instanceof HTMLElement && n.getAttribute("aria-hidden") !== "true" && t.push(n);
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
function s({ itemSelector: s, enabled: c = !0, mapGeometry: l = i, ref: u }) {
|
|
30
|
+
let d = e.useRef(null), f = e.useMemo(() => (e) => {
|
|
31
|
+
d.current = e, r(u, e);
|
|
32
|
+
}, [u]), [p, m] = e.useState({
|
|
33
|
+
...n,
|
|
34
|
+
visible: !1,
|
|
35
|
+
animated: !1
|
|
36
|
+
}), [h, g] = e.useState(a);
|
|
37
|
+
e.useEffect(() => {
|
|
38
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => g(e.matches);
|
|
39
|
+
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
40
|
+
}, []);
|
|
41
|
+
let _ = e.useCallback(() => {
|
|
42
|
+
let e = d.current;
|
|
43
|
+
if (!e || !c) {
|
|
44
|
+
m((e) => ({
|
|
45
|
+
...e,
|
|
46
|
+
...n,
|
|
47
|
+
visible: !1,
|
|
48
|
+
animated: !1
|
|
49
|
+
}));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let t = e.querySelector(s);
|
|
53
|
+
if (!t) {
|
|
54
|
+
m((e) => ({
|
|
55
|
+
...e,
|
|
56
|
+
width: 0,
|
|
57
|
+
height: 0,
|
|
58
|
+
visible: !1,
|
|
59
|
+
animated: !1
|
|
60
|
+
}));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let r = l(t, e);
|
|
64
|
+
m((e) => ({
|
|
65
|
+
...r,
|
|
66
|
+
visible: !0,
|
|
67
|
+
animated: e.visible && !h
|
|
68
|
+
}));
|
|
69
|
+
}, [
|
|
70
|
+
c,
|
|
71
|
+
s,
|
|
72
|
+
l,
|
|
73
|
+
h
|
|
74
|
+
]);
|
|
75
|
+
return e.useLayoutEffect(() => {
|
|
76
|
+
let e = d.current;
|
|
77
|
+
if (!e || !c) return;
|
|
78
|
+
let t = 0, n = new ResizeObserver(() => {
|
|
79
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(_);
|
|
80
|
+
}), r = () => {
|
|
81
|
+
n.disconnect();
|
|
82
|
+
for (let t of o(e)) n.observe(t);
|
|
83
|
+
};
|
|
84
|
+
r(), _();
|
|
85
|
+
let i = new MutationObserver(() => {
|
|
86
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
87
|
+
r(), _();
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
return i.observe(e, {
|
|
91
|
+
attributes: !0,
|
|
92
|
+
subtree: !0,
|
|
93
|
+
childList: !0,
|
|
94
|
+
characterData: !0,
|
|
95
|
+
attributeFilter: ["data-state"]
|
|
96
|
+
}), () => {
|
|
97
|
+
cancelAnimationFrame(t), i.disconnect(), n.disconnect();
|
|
98
|
+
};
|
|
99
|
+
}, [c, _]), {
|
|
100
|
+
ref: f,
|
|
101
|
+
state: p,
|
|
102
|
+
motionClassName: p.animated && !h ? t : void 0
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { t as SELECTION_INDICATOR_MOTION_CLASS, r as assignRef, i as measureSelectionItem, s as useSelectionIndicator };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=selection-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-indicator.js","names":[],"sources":["../../src/utils/selection-indicator.ts"],"sourcesContent":["import * as React from \"react\";\n\nexport const SELECTION_INDICATOR_MOTION_CLASS =\n\t\"transition-[left,width,top,height] duration-200 ease-out\";\n\nexport type SelectionGeometry = {\n\tleft: number;\n\twidth: number;\n\ttop: number;\n\theight: number;\n};\n\nexport type SelectionIndicatorState = SelectionGeometry & {\n\tvisible: boolean;\n\tanimated: boolean;\n};\n\nconst EMPTY: SelectionGeometry = { left: 0, width: 0, top: 0, height: 0 };\n\nexport function assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n\tif (typeof ref === \"function\") {\n\t\tref(value);\n\t} else if (ref) {\n\t\t(ref as React.MutableRefObject<T | null>).current = value;\n\t}\n}\n\nexport function measureSelectionItem(item: HTMLElement): SelectionGeometry {\n\treturn {\n\t\tleft: item.offsetLeft,\n\t\twidth: item.offsetWidth,\n\t\ttop: item.offsetTop,\n\t\theight: item.offsetHeight,\n\t};\n}\n\nfunction prefersReducedMotion() {\n\treturn (\n\t\ttypeof window !== \"undefined\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n\t);\n}\n\nfunction selectionTargets(root: HTMLElement) {\n\tconst targets: HTMLElement[] = [root];\n\tfor (const node of root.children) {\n\t\tif (node instanceof HTMLElement && node.getAttribute(\"aria-hidden\") !== \"true\") {\n\t\t\ttargets.push(node);\n\t\t}\n\t}\n\treturn targets;\n}\n\nexport function useSelectionIndicator({\n\titemSelector,\n\tenabled = true,\n\tmapGeometry = measureSelectionItem,\n\tref,\n}: {\n\titemSelector: string;\n\tenabled?: boolean;\n\tmapGeometry?: (item: HTMLElement, root: HTMLElement) => SelectionGeometry;\n\tref?: React.Ref<HTMLElement | null>;\n}) {\n\tconst rootRef = React.useRef<HTMLElement | null>(null);\n\tconst composedRef = React.useMemo(() => {\n\t\treturn (node: HTMLElement | null) => {\n\t\t\trootRef.current = node;\n\t\t\tassignRef(ref, node);\n\t\t};\n\t}, [ref]);\n\tconst [state, setState] = React.useState<SelectionIndicatorState>({\n\t\t...EMPTY,\n\t\tvisible: false,\n\t\tanimated: false,\n\t});\n\tconst [reduced, setReduced] = React.useState(prefersReducedMotion);\n\n\tReact.useEffect(() => {\n\t\tconst media = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n\t\tconst onChange = () => setReduced(media.matches);\n\t\tonChange();\n\t\tmedia.addEventListener(\"change\", onChange);\n\t\treturn () => media.removeEventListener(\"change\", onChange);\n\t}, []);\n\n\tconst sync = React.useCallback(() => {\n\t\tconst root = rootRef.current;\n\t\tif (!root || !enabled) {\n\t\t\tsetState((current) => ({ ...current, ...EMPTY, visible: false, animated: false }));\n\t\t\treturn;\n\t\t}\n\t\tconst item = root.querySelector<HTMLElement>(itemSelector);\n\t\tif (!item) {\n\t\t\tsetState((current) => ({ ...current, width: 0, height: 0, visible: false, animated: false }));\n\t\t\treturn;\n\t\t}\n\t\tconst geometry = mapGeometry(item, root);\n\t\tsetState((current) => ({\n\t\t\t...geometry,\n\t\t\tvisible: true,\n\t\t\tanimated: current.visible && !reduced,\n\t\t}));\n\t}, [enabled, itemSelector, mapGeometry, reduced]);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst root = rootRef.current;\n\t\tif (!root || !enabled) {\n\t\t\treturn;\n\t\t}\n\t\tlet frame = 0;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tframe = requestAnimationFrame(sync);\n\t\t});\n\t\tconst observe = () => {\n\t\t\tro.disconnect();\n\t\t\tfor (const node of selectionTargets(root)) {\n\t\t\t\tro.observe(node);\n\t\t\t}\n\t\t};\n\t\tobserve();\n\t\tsync();\n\t\tconst mo = new MutationObserver(() => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tframe = requestAnimationFrame(() => {\n\t\t\t\tobserve();\n\t\t\t\tsync();\n\t\t\t});\n\t\t});\n\t\tmo.observe(root, {\n\t\t\tattributes: true,\n\t\t\tsubtree: true,\n\t\t\tchildList: true,\n\t\t\tcharacterData: true,\n\t\t\tattributeFilter: [\"data-state\"],\n\t\t});\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tmo.disconnect();\n\t\t\tro.disconnect();\n\t\t};\n\t}, [enabled, sync]);\n\n\treturn {\n\t\tref: composedRef,\n\t\tstate,\n\t\tmotionClassName: state.animated && !reduced ? SELECTION_INDICATOR_MOTION_CLASS : undefined,\n\t};\n}\n"],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nocoo/basalt",
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/nocoo/basalt.git",
|
|
9
|
+
"directory": "packages/basalt"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "bun run build:css && vite build && tsc -p tsconfig.build.json && bun scripts/rewrite-declarations.ts && bun scripts/verify-dist.ts && bun scripts/root-boundary.ts && node scripts/verify-runtime.mjs",
|
|
21
|
+
"build:css": "bun ../../scripts/build-basalt-standalone.ts",
|
|
22
|
+
"pack:check": "bun scripts/verify-pack.ts",
|
|
23
|
+
"prepublishOnly": "bun run --cwd ../.. package:prepublish",
|
|
24
|
+
"publint": "publint --strict --pack npm",
|
|
25
|
+
"types:check": "tsc -p type-tests/tsconfig.bundler.json --noEmit && tsc -p type-tests/tsconfig.nodenext.json --noEmit"
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"*.css"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./components/*": {
|
|
36
|
+
"types": "./dist/components/*.d.ts",
|
|
37
|
+
"import": "./dist/components/*.js"
|
|
38
|
+
},
|
|
39
|
+
"./providers/*": {
|
|
40
|
+
"types": "./dist/providers/*.d.ts",
|
|
41
|
+
"import": "./dist/providers/*.js"
|
|
42
|
+
},
|
|
43
|
+
"./charts/*": {
|
|
44
|
+
"types": "./dist/charts/*.d.ts",
|
|
45
|
+
"import": "./dist/charts/*.js"
|
|
46
|
+
},
|
|
47
|
+
"./styles": "./dist/styles/tailwind.css",
|
|
48
|
+
"./styles/tailwind": "./dist/styles/tailwind.css",
|
|
49
|
+
"./styles/standalone": "./dist/styles/standalone.css"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@radix-ui/react-accordion": "1.2.20",
|
|
53
|
+
"@radix-ui/react-alert-dialog": "1.1.23",
|
|
54
|
+
"@radix-ui/react-avatar": "1.2.6",
|
|
55
|
+
"@radix-ui/react-checkbox": "1.3.11",
|
|
56
|
+
"@radix-ui/react-collapsible": "1.1.20",
|
|
57
|
+
"@radix-ui/react-context-menu": "2.3.7",
|
|
58
|
+
"@radix-ui/react-dialog": "1.1.23",
|
|
59
|
+
"@radix-ui/react-dropdown-menu": "2.1.24",
|
|
60
|
+
"@radix-ui/react-hover-card": "1.1.23",
|
|
61
|
+
"@radix-ui/react-label": "2.1.15",
|
|
62
|
+
"@radix-ui/react-menubar": "1.1.24",
|
|
63
|
+
"@radix-ui/react-navigation-menu": "1.2.22",
|
|
64
|
+
"@radix-ui/react-popover": "1.1.23",
|
|
65
|
+
"@radix-ui/react-progress": "1.1.16",
|
|
66
|
+
"@radix-ui/react-radio-group": "1.4.7",
|
|
67
|
+
"@radix-ui/react-scroll-area": "1.2.18",
|
|
68
|
+
"@radix-ui/react-select": "2.3.7",
|
|
69
|
+
"@radix-ui/react-separator": "1.1.15",
|
|
70
|
+
"@radix-ui/react-slider": "1.4.7",
|
|
71
|
+
"@radix-ui/react-slot": "1.3.3",
|
|
72
|
+
"@radix-ui/react-switch": "1.3.7",
|
|
73
|
+
"@radix-ui/react-tabs": "1.1.21",
|
|
74
|
+
"@radix-ui/react-toast": "1.2.23",
|
|
75
|
+
"@radix-ui/react-toggle": "1.1.18",
|
|
76
|
+
"@radix-ui/react-toggle-group": "1.1.19",
|
|
77
|
+
"@radix-ui/react-tooltip": "1.2.16",
|
|
78
|
+
"class-variance-authority": "^0.7.1",
|
|
79
|
+
"clsx": "^2.1.1",
|
|
80
|
+
"cmdk": "^1.1.1",
|
|
81
|
+
"sonner": "2.0.8",
|
|
82
|
+
"tailwind-merge": "3.6.0"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"react": "^19",
|
|
86
|
+
"react-dom": "^19",
|
|
87
|
+
"lucide-react": "*",
|
|
88
|
+
"recharts": "^3",
|
|
89
|
+
"react-day-picker": "^10",
|
|
90
|
+
"@tanstack/react-table": "^9",
|
|
91
|
+
"tailwindcss": "^4"
|
|
92
|
+
},
|
|
93
|
+
"peerDependenciesMeta": {
|
|
94
|
+
"tailwindcss": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"recharts": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"react-day-picker": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"@tanstack/react-table": {
|
|
104
|
+
"optional": true
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|