doom-design-system 0.5.0 → 0.6.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/dist/components/Accordion/Accordion.module.css +121 -124
- package/dist/components/ActionRow/ActionRow.module.css +25 -24
- package/dist/components/Alert/Alert.module.css +74 -76
- package/dist/components/Avatar/Avatar.module.css +66 -66
- package/dist/components/Badge/Badge.module.css +50 -48
- package/dist/components/Breadcrumbs/Breadcrumbs.module.css +32 -33
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.module.css +150 -152
- package/dist/components/Card/Card.module.css +37 -39
- package/dist/components/Chart/Chart.module.css +213 -245
- package/dist/components/Chart/behaviors/DraggablePuck.d.ts +36 -0
- package/dist/components/Chart/behaviors/DraggablePuck.js +94 -0
- package/dist/components/Chart/behaviors/Markers.js +6 -4
- package/dist/components/Chart/behaviors/SelectionUpdate.js +2 -4
- package/dist/components/Chart/behaviors/index.d.ts +1 -1
- package/dist/components/Chart/behaviors/index.js +1 -1
- package/dist/components/Chart/engine/CoordinateSystem.d.ts +59 -0
- package/dist/components/Chart/engine/CoordinateSystem.js +126 -0
- package/dist/components/Chart/engine/Engine.d.ts +102 -0
- package/dist/components/Chart/engine/Engine.js +226 -0
- package/dist/components/Chart/engine/Scheduler.d.ts +59 -0
- package/dist/components/Chart/engine/Scheduler.js +139 -0
- package/dist/components/Chart/engine/SpatialMap.d.ts +114 -0
- package/dist/components/Chart/engine/SpatialMap.js +270 -0
- package/dist/components/Chart/engine/index.d.ts +13 -0
- package/dist/components/Chart/engine/index.js +9 -0
- package/dist/components/Chart/engine/types.d.ts +137 -0
- package/dist/components/Chart/engine/types.js +47 -0
- package/dist/components/Chart/hooks/useEngine.d.ts +43 -0
- package/dist/components/Chart/hooks/useEngine.js +128 -0
- package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.d.ts +17 -19
- package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.js +38 -51
- package/dist/components/Chart/sensors/DragSensor/DragSensor.d.ts +38 -0
- package/dist/components/Chart/sensors/DragSensor/DragSensor.js +105 -0
- package/dist/components/Chart/sensors/DragSensor/index.d.ts +2 -0
- package/dist/components/Chart/sensors/DragSensor/index.js +1 -0
- package/dist/components/Chart/sensors/{KeyboardSensor.d.ts → KeyboardSensor/KeyboardSensor.d.ts} +1 -1
- package/dist/components/Chart/sensors/KeyboardSensor/KeyboardSensor.js +86 -0
- package/dist/components/Chart/sensors/KeyboardSensor/index.d.ts +1 -0
- package/dist/components/Chart/sensors/KeyboardSensor/index.js +1 -0
- package/dist/components/Chart/sensors/{SelectionSensor.d.ts → SelectionSensor/SelectionSensor.d.ts} +2 -2
- package/dist/components/Chart/sensors/SelectionSensor/SelectionSensor.js +39 -0
- package/dist/components/Chart/sensors/SelectionSensor/index.d.ts +1 -0
- package/dist/components/Chart/sensors/SelectionSensor/index.js +1 -0
- package/dist/components/Chart/sensors/SensorManager/SensorManager.js +36 -41
- package/dist/components/Chart/sensors/index.d.ts +1 -0
- package/dist/components/Chart/sensors/index.js +3 -2
- package/dist/components/Chart/sensors/utils/search.d.ts +1 -1
- package/dist/components/Chart/sensors/utils/search.js +25 -4
- package/dist/components/Chart/state/store/chart.store.js +18 -0
- package/dist/components/Chart/state/store/slices/series.slice.d.ts +1 -0
- package/dist/components/Chart/state/store/slices/series.slice.js +3 -2
- package/dist/components/Chart/subcomponents/Axis/Axis.module.css +32 -33
- package/dist/components/Chart/subcomponents/BarSeries/BarSeries.js +6 -1
- package/dist/components/Chart/subcomponents/BarSeries/BarSeries.module.css +11 -9
- package/dist/components/Chart/subcomponents/Cursor/Cursor.js +8 -1
- package/dist/components/Chart/subcomponents/Cursor/Cursor.module.css +14 -13
- package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.js +4 -0
- package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.module.css +5 -3
- package/dist/components/Chart/subcomponents/Footer/Footer.module.css +5 -3
- package/dist/components/Chart/subcomponents/Grid/Grid.module.css +12 -11
- package/dist/components/Chart/subcomponents/Header/Header.module.css +8 -7
- package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.d.ts +4 -4
- package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.js +39 -76
- package/dist/components/Chart/subcomponents/Legend/Legend.module.css +30 -32
- package/dist/components/Chart/subcomponents/LineSeries/LineSeries.js +9 -3
- package/dist/components/Chart/subcomponents/LineSeries/LineSeries.module.css +21 -21
- package/dist/components/Chart/subcomponents/Root/Root.js +113 -7
- package/dist/components/Chart/subcomponents/Root/Root.module.css +70 -82
- package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.js +6 -1
- package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.module.css +7 -5
- package/dist/components/Chart/subcomponents/Series/Series.module.css +118 -128
- package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.module.css +10 -8
- package/dist/components/Chart/subcomponents/Tooltip/Tooltip.js +2 -3
- package/dist/components/Chart/subcomponents/Tooltip/Tooltip.module.css +52 -67
- package/dist/components/Chart/types/context.d.ts +9 -0
- package/dist/components/Chart/types/events.d.ts +5 -7
- package/dist/components/Chart/types/interaction.d.ts +24 -2
- package/dist/components/Chart/types/interaction.js +1 -0
- package/dist/components/Checkbox/Checkbox.module.css +57 -59
- package/dist/components/Chip/Chip.module.css +105 -115
- package/dist/components/Combobox/Combobox.d.ts +2 -1
- package/dist/components/Combobox/Combobox.js +2 -2
- package/dist/components/Combobox/Combobox.module.css +233 -210
- package/dist/components/CopyButton/CopyButton.module.css +84 -90
- package/dist/components/Drawer/Drawer.module.css +126 -145
- package/dist/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.js +3 -3
- package/dist/components/Dropdown/Dropdown.module.css +52 -32
- package/dist/components/FileUpload/FileUpload.js +24 -0
- package/dist/components/FileUpload/FileUpload.module.css +295 -313
- package/dist/components/Form/Form.module.css +35 -39
- package/dist/components/Image/Image.module.css +53 -54
- package/dist/components/Input/Input.d.ts +4 -2
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/Input.module.css +135 -119
- package/dist/components/Label/Label.module.css +17 -15
- package/dist/components/Layout/Layout.module.css +95 -111
- package/dist/components/Link/Link.module.css +67 -65
- package/dist/components/Modal/Modal.module.css +112 -132
- package/dist/components/Page/Page.module.css +21 -21
- package/dist/components/Pagination/Pagination.module.css +56 -56
- package/dist/components/Popover/Popover.module.css +17 -16
- package/dist/components/ProgressBar/ProgressBar.module.css +36 -37
- package/dist/components/RadioGroup/RadioGroup.module.css +74 -77
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.module.css +133 -98
- package/dist/components/Sheet/Sheet.module.css +134 -154
- package/dist/components/Sidebar/Sidebar.module.css +72 -74
- package/dist/components/Sidebar/subcomponents/Footer/Footer.module.css +7 -5
- package/dist/components/Sidebar/subcomponents/Group/Group.module.css +80 -85
- package/dist/components/Sidebar/subcomponents/Header/Header.module.css +12 -10
- package/dist/components/Sidebar/subcomponents/Item/Item.module.css +54 -55
- package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.module.css +38 -38
- package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.module.css +5 -3
- package/dist/components/Sidebar/subcomponents/Nav/Nav.module.css +13 -11
- package/dist/components/Sidebar/subcomponents/Rail/Rail.module.css +62 -63
- package/dist/components/Sidebar/subcomponents/Section/Section.module.css +86 -91
- package/dist/components/Skeleton/Skeleton.module.css +28 -26
- package/dist/components/Slat/Slat.module.css +93 -94
- package/dist/components/Slider/Slider.module.css +116 -121
- package/dist/components/Spinner/Spinner.module.css +28 -27
- package/dist/components/SplitButton/SplitButton.d.ts +3 -1
- package/dist/components/SplitButton/SplitButton.js +2 -2
- package/dist/components/SplitButton/SplitButton.module.css +104 -87
- package/dist/components/Switch/Switch.module.css +64 -63
- package/dist/components/Table/FilterBuilder/FilterBuilder.module.css +36 -36
- package/dist/components/Table/FilterBuilder/FilterConditionRow.js +1 -1
- package/dist/components/Table/FilterBuilder/FilterConditionRow.module.css +21 -22
- package/dist/components/Table/FilterBuilder/FilterGroup.js +4 -4
- package/dist/components/Table/FilterBuilder/FilterGroup.module.css +355 -389
- package/dist/components/Table/FilterBuilder/FilterSheet.module.css +68 -71
- package/dist/components/Table/Table.d.ts +4 -2
- package/dist/components/Table/Table.js +50 -13
- package/dist/components/Table/Table.module.css +210 -188
- package/dist/components/Table/TableHeaderFilter.js +1 -1
- package/dist/components/Table/TableHeaderFilter.module.css +51 -57
- package/dist/components/Tabs/Tabs.module.css +79 -80
- package/dist/components/Text/Text.module.css +108 -131
- package/dist/components/Textarea/Textarea.d.ts +3 -1
- package/dist/components/Textarea/Textarea.js +2 -2
- package/dist/components/Textarea/Textarea.module.css +114 -94
- package/dist/components/Toast/Toast.module.css +82 -82
- package/dist/components/Tooltip/Tooltip.module.css +17 -16
- package/dist/styles/globals.css +1677 -1691
- package/dist/styles/palettes.d.ts +0 -5
- package/dist/styles/palettes.js +0 -8
- package/dist/styles/themes/definitions.d.ts +0 -8
- package/dist/styles/themes/definitions.js +117 -5
- package/dist/styles/types.d.ts +2 -0
- package/dist/styles/types.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/.agent/skills/doom/a2ui/a2ui-examples.md +0 -289
- package/.agent/skills/doom/a2ui/a2ui-principles.md +0 -49
- package/.agent/skills/doom/a2ui/a2ui-protocol.md +0 -191
- package/.agent/skills/doom/components/a2ui.md +0 -46
- package/.agent/skills/doom/components/accordion.md +0 -44
- package/.agent/skills/doom/components/actionrow.md +0 -33
- package/.agent/skills/doom/components/alert.md +0 -35
- package/.agent/skills/doom/components/avatar.md +0 -36
- package/.agent/skills/doom/components/badge.md +0 -29
- package/.agent/skills/doom/components/breadcrumbs.md +0 -33
- package/.agent/skills/doom/components/button.md +0 -43
- package/.agent/skills/doom/components/card.md +0 -41
- package/.agent/skills/doom/components/chart.md +0 -106
- package/.agent/skills/doom/components/checkbox.md +0 -38
- package/.agent/skills/doom/components/chip.md +0 -35
- package/.agent/skills/doom/components/combobox.md +0 -50
- package/.agent/skills/doom/components/copybutton.md +0 -41
- package/.agent/skills/doom/components/drawer.md +0 -69
- package/.agent/skills/doom/components/dropdown.md +0 -33
- package/.agent/skills/doom/components/fileupload.md +0 -49
- package/.agent/skills/doom/components/form.md +0 -55
- package/.agent/skills/doom/components/icon.md +0 -47
- package/.agent/skills/doom/components/image.md +0 -48
- package/.agent/skills/doom/components/input.md +0 -54
- package/.agent/skills/doom/components/label.md +0 -32
- package/.agent/skills/doom/components/layout.md +0 -92
- package/.agent/skills/doom/components/link.md +0 -39
- package/.agent/skills/doom/components/modal.md +0 -71
- package/.agent/skills/doom/components/page.md +0 -41
- package/.agent/skills/doom/components/pagination.md +0 -32
- package/.agent/skills/doom/components/popover.md +0 -45
- package/.agent/skills/doom/components/progressbar.md +0 -37
- package/.agent/skills/doom/components/radiogroup.md +0 -45
- package/.agent/skills/doom/components/select.md +0 -43
- package/.agent/skills/doom/components/sheet.md +0 -71
- package/.agent/skills/doom/components/sidebar.md +0 -92
- package/.agent/skills/doom/components/skeleton.md +0 -35
- package/.agent/skills/doom/components/slat.md +0 -46
- package/.agent/skills/doom/components/slider.md +0 -51
- package/.agent/skills/doom/components/spinner.md +0 -34
- package/.agent/skills/doom/components/splitbutton.md +0 -35
- package/.agent/skills/doom/components/switch.md +0 -40
- package/.agent/skills/doom/components/table.md +0 -82
- package/.agent/skills/doom/components/tabs.md +0 -65
- package/.agent/skills/doom/components/text.md +0 -42
- package/.agent/skills/doom/components/textarea.md +0 -46
- package/.agent/skills/doom/components/toast.md +0 -59
- package/.agent/skills/doom/components/tooltip.md +0 -35
- package/.agent/skills/doom/index.md +0 -167
- package/.agent/skills/doom/styles/aesthetic.md +0 -151
- package/.agent/skills/doom/styles/css-variables.md +0 -80
- package/.agent/skills/doom/styles/mixins.md +0 -97
- package/.agent/skills/doom/styles/tokens.md +0 -129
- package/.agent/skills/doom/styles/utilities.md +0 -84
- package/dist/components/Chart/sensors/KeyboardSensor.js +0 -82
- package/dist/components/Chart/sensors/SelectionSensor.js +0 -41
|
@@ -1,246 +1,214 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.grid :global(.tick) line {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
.grid path {
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
.legend {
|
|
215
|
-
align-items: center;
|
|
216
|
-
justify-content: flex-start;
|
|
217
|
-
}
|
|
218
|
-
.legend.legendBottom {
|
|
219
|
-
justify-content: center;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.legendItem {
|
|
223
|
-
align-items: center;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.legendDot {
|
|
227
|
-
width: var(--spacing-4);
|
|
228
|
-
height: var(--spacing-2);
|
|
229
|
-
border-radius: var(--radius);
|
|
230
|
-
flex-shrink: 0;
|
|
231
|
-
border: var(--border-width) solid var(--border-strong);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.legendLabel {
|
|
235
|
-
color: var(--foreground);
|
|
236
|
-
margin: 0;
|
|
237
|
-
white-space: nowrap;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.legendVertical {
|
|
241
|
-
display: flex;
|
|
242
|
-
flex-direction: column;
|
|
243
|
-
align-self: center;
|
|
244
|
-
gap: var(--spacing-2);
|
|
245
|
-
padding: 0 var(--spacing-2);
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.chart {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
}
|
|
8
|
+
.chart :global .domain {
|
|
9
|
+
stroke: var(--card-border);
|
|
10
|
+
stroke-width: var(--surface-border-width);
|
|
11
|
+
}
|
|
12
|
+
.chart :global .domain.hideDomain {
|
|
13
|
+
stroke: none;
|
|
14
|
+
}
|
|
15
|
+
.chart :global .tick line {
|
|
16
|
+
stroke: var(--card-border);
|
|
17
|
+
stroke-width: var(--surface-border-width);
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
.chart :global .tick text {
|
|
21
|
+
fill: var(--foreground);
|
|
22
|
+
font-size: var(--text-xs);
|
|
23
|
+
font-weight: var(--font-bold);
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
}
|
|
26
|
+
.grid :global(.tick) line {
|
|
27
|
+
stroke: var(--muted);
|
|
28
|
+
stroke-opacity: 0.5;
|
|
29
|
+
}
|
|
30
|
+
.grid path {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
.path {
|
|
34
|
+
fill: none;
|
|
35
|
+
stroke: var(--primary);
|
|
36
|
+
stroke-width: calc(var(--surface-border-width) * 1.5);
|
|
37
|
+
stroke-linecap: round;
|
|
38
|
+
stroke-linejoin: round;
|
|
39
|
+
}
|
|
40
|
+
.area {
|
|
41
|
+
fill: var(--primary);
|
|
42
|
+
stroke: none;
|
|
43
|
+
}
|
|
44
|
+
.bar {
|
|
45
|
+
fill: var(--primary);
|
|
46
|
+
stroke: var(--card-border);
|
|
47
|
+
stroke-width: var(--surface-border-width);
|
|
48
|
+
stroke-linejoin: round;
|
|
49
|
+
transition: opacity 0.2s;
|
|
50
|
+
}
|
|
51
|
+
.bar:hover {
|
|
52
|
+
cursor: crosshair;
|
|
53
|
+
filter: brightness(1.1);
|
|
54
|
+
}
|
|
55
|
+
.cursorLine {
|
|
56
|
+
stroke: var(--muted-foreground);
|
|
57
|
+
stroke-width: var(--surface-border-width);
|
|
58
|
+
stroke-dasharray: 4 4;
|
|
59
|
+
opacity: 0;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
.cursorPoint {
|
|
63
|
+
fill: var(--primary);
|
|
64
|
+
stroke: var(--border-strong);
|
|
65
|
+
stroke-width: var(--surface-border-width);
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
.dot {
|
|
69
|
+
fill: var(--primary);
|
|
70
|
+
stroke: var(--border-strong);
|
|
71
|
+
stroke-width: var(--surface-border-width);
|
|
72
|
+
transition: r 0.2s;
|
|
73
|
+
z-index: var(--z-overlay);
|
|
74
|
+
}
|
|
75
|
+
.dot:hover {
|
|
76
|
+
r: 8;
|
|
77
|
+
stroke-width: calc(var(--surface-border-width) * 1.5);
|
|
78
|
+
}
|
|
79
|
+
.chartContainer {
|
|
80
|
+
position: relative;
|
|
81
|
+
background-color: var(--card-bg);
|
|
82
|
+
border: var(--surface-border-width) solid var(--card-border);
|
|
83
|
+
border-radius: var(--radius-md);
|
|
84
|
+
box-shadow: var(--shadow-md);
|
|
85
|
+
padding: var(--space-6);
|
|
86
|
+
overflow: visible;
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
}
|
|
90
|
+
.chartContainer.flat {
|
|
91
|
+
box-shadow: none;
|
|
92
|
+
}
|
|
93
|
+
.chartContainer.frameless {
|
|
94
|
+
background-color: transparent;
|
|
95
|
+
border: none;
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
padding: 0;
|
|
98
|
+
}
|
|
99
|
+
.chartContainer.solid {
|
|
100
|
+
background-color: var(--solid-bg);
|
|
101
|
+
color: var(--solid-fg);
|
|
102
|
+
--background: var(--solid-bg);
|
|
103
|
+
--foreground: var(--solid-fg);
|
|
104
|
+
--muted-foreground: color-mix(in srgb, var(--solid-fg) 70%, transparent);
|
|
105
|
+
--surface-brand: var(--solid-bg);
|
|
106
|
+
--surface-brand-foreground: var(--solid-fg);
|
|
107
|
+
--success: var(--solid-success);
|
|
108
|
+
--success-foreground: var(--solid-fg);
|
|
109
|
+
--error: var(--solid-error);
|
|
110
|
+
--error-foreground: var(--solid-fg);
|
|
111
|
+
--warning: var(--solid-warning);
|
|
112
|
+
--warning-foreground: var(--solid-fg);
|
|
113
|
+
--on-surface: var(--solid-bg);
|
|
114
|
+
--on-surface-muted: var(--solid-bg);
|
|
115
|
+
--card-bg: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
116
|
+
--card-border: var(--solid-fg);
|
|
117
|
+
--card-foreground: var(--solid-fg);
|
|
118
|
+
--popover: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
119
|
+
--popover-foreground: var(--solid-bg);
|
|
120
|
+
--input: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
121
|
+
--border-strong: var(--solid-fg);
|
|
122
|
+
--primary: var(--solid-fg);
|
|
123
|
+
--primary-foreground: var(--solid-bg);
|
|
124
|
+
--secondary: color-mix(in srgb, var(--solid-bg) 90%, transparent);
|
|
125
|
+
--secondary-foreground: var(--solid-fg);
|
|
126
|
+
--muted: color-mix(in srgb, var(--solid-fg) 20%, transparent);
|
|
127
|
+
border-color: var(--border-strong);
|
|
128
|
+
}
|
|
129
|
+
.chartContainer.solid :global(.tick) text {
|
|
130
|
+
fill: var(--solid-fg);
|
|
131
|
+
}
|
|
132
|
+
.chartContainer.solid :global(.domain),
|
|
133
|
+
.chartContainer.solid :global(.tick) line {
|
|
134
|
+
stroke: var(--solid-fg);
|
|
135
|
+
}
|
|
136
|
+
.chartContainer.solid .tooltipCard {
|
|
137
|
+
background-color: var(--solid-bg);
|
|
138
|
+
border-color: var(--solid-fg);
|
|
139
|
+
}
|
|
140
|
+
.chartContainer.mobile {
|
|
141
|
+
padding: var(--space-2);
|
|
142
|
+
}
|
|
143
|
+
.responsiveWrapper {
|
|
144
|
+
width: 100%;
|
|
145
|
+
flex: 1;
|
|
146
|
+
height: 100%;
|
|
147
|
+
min-height: 0;
|
|
148
|
+
position: relative;
|
|
149
|
+
overflow: visible;
|
|
150
|
+
}
|
|
151
|
+
.tooltipWrapper {
|
|
152
|
+
position: absolute;
|
|
153
|
+
top: 0;
|
|
154
|
+
left: 0;
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
z-index: var(--z-tooltip);
|
|
157
|
+
will-change: transform;
|
|
158
|
+
}
|
|
159
|
+
.tooltipCard {
|
|
160
|
+
padding: var(--space-3) var(--space-4);
|
|
161
|
+
font-size: var(--text-xs);
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
}
|
|
164
|
+
.tooltipLabel {
|
|
165
|
+
color: var(--muted-foreground);
|
|
166
|
+
text-transform: uppercase;
|
|
167
|
+
font-size: var(--text-2xs);
|
|
168
|
+
letter-spacing: 0.05em;
|
|
169
|
+
margin-bottom: var(--space-1);
|
|
170
|
+
}
|
|
171
|
+
.axisLabel {
|
|
172
|
+
fill: var(--foreground);
|
|
173
|
+
font-size: var(--text-xs);
|
|
174
|
+
font-weight: var(--font-bold);
|
|
175
|
+
text-transform: uppercase;
|
|
176
|
+
text-anchor: middle;
|
|
177
|
+
}
|
|
178
|
+
.chartHeader {
|
|
179
|
+
padding-right: 0;
|
|
180
|
+
}
|
|
181
|
+
.subtitle {
|
|
182
|
+
color: var(--muted-foreground);
|
|
183
|
+
margin: 0;
|
|
184
|
+
}
|
|
185
|
+
.legend {
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: flex-start;
|
|
188
|
+
}
|
|
189
|
+
.legend.legendBottom {
|
|
190
|
+
justify-content: center;
|
|
191
|
+
}
|
|
192
|
+
.legendItem {
|
|
193
|
+
align-items: center;
|
|
194
|
+
}
|
|
195
|
+
.legendDot {
|
|
196
|
+
width: var(--space-4);
|
|
197
|
+
height: var(--space-2);
|
|
198
|
+
border-radius: var(--radius-md);
|
|
199
|
+
flex-shrink: 0;
|
|
200
|
+
border: var(--surface-border-width) solid var(--border-strong);
|
|
201
|
+
}
|
|
202
|
+
.legendLabel {
|
|
203
|
+
color: var(--foreground);
|
|
204
|
+
margin: 0;
|
|
205
|
+
white-space: nowrap;
|
|
206
|
+
}
|
|
207
|
+
.legendVertical {
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
align-self: center;
|
|
211
|
+
gap: var(--space-2);
|
|
212
|
+
padding: 0 var(--space-2);
|
|
213
|
+
}
|
|
246
214
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Behavior } from "../types/events";
|
|
2
|
+
import { InteractionChannel } from "../types/interaction";
|
|
3
|
+
export interface DraggablePuckOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Interaction channel to listen to.
|
|
6
|
+
* @default InteractionChannel.DRAG
|
|
7
|
+
*/
|
|
8
|
+
on?: InteractionChannel | string;
|
|
9
|
+
/**
|
|
10
|
+
* Radius of the puck circle in pixels.
|
|
11
|
+
* @default 8
|
|
12
|
+
*/
|
|
13
|
+
radius?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Color of the puck. If not specified, uses the series color.
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to show a "ghost" at the original position during drag.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
showGhost?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* DraggablePuck renders a visual indicator at the drag position.
|
|
26
|
+
*
|
|
27
|
+
* It creates a "puck" circle that follows the cursor during drag operations,
|
|
28
|
+
* providing immediate visual feedback. Optionally shows a ghost at the
|
|
29
|
+
* original position.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* DraggablePuck({ radius: 10, showGhost: true })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const DraggablePuck: (options?: DraggablePuckOptions) => Behavior;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { InteractionChannel } from "../types/interaction.js";
|
|
2
|
+
/**
|
|
3
|
+
* DraggablePuck renders a visual indicator at the drag position.
|
|
4
|
+
*
|
|
5
|
+
* It creates a "puck" circle that follows the cursor during drag operations,
|
|
6
|
+
* providing immediate visual feedback. Optionally shows a ghost at the
|
|
7
|
+
* original position.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* DraggablePuck({ radius: 10, showGhost: true })
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const DraggablePuck = (options = {}) => {
|
|
15
|
+
const { on = InteractionChannel.DRAG, radius = 8, color, showGhost = true, } = options;
|
|
16
|
+
return ({ getChartContext, getInteraction }) => {
|
|
17
|
+
const ctx = getChartContext();
|
|
18
|
+
if (!ctx || !ctx.g) {
|
|
19
|
+
return () => { };
|
|
20
|
+
}
|
|
21
|
+
const { g } = ctx;
|
|
22
|
+
const layer = g.append("g").attr("class", "chart-drag-puck-layer");
|
|
23
|
+
// Ghost circle (original position)
|
|
24
|
+
const ghost = layer
|
|
25
|
+
.append("circle")
|
|
26
|
+
.attr("class", "drag-ghost")
|
|
27
|
+
.attr("r", radius)
|
|
28
|
+
.attr("fill", "none")
|
|
29
|
+
.attr("stroke", "var(--text-tertiary)")
|
|
30
|
+
.attr("stroke-width", 2)
|
|
31
|
+
.attr("stroke-dasharray", "4,2")
|
|
32
|
+
.style("opacity", 0)
|
|
33
|
+
.style("pointer-events", "none");
|
|
34
|
+
// Active puck circle (current drag position)
|
|
35
|
+
const puck = layer
|
|
36
|
+
.append("circle")
|
|
37
|
+
.attr("class", "drag-puck")
|
|
38
|
+
.attr("r", radius)
|
|
39
|
+
.attr("stroke", "var(--card-border)")
|
|
40
|
+
.attr("stroke-width", 2)
|
|
41
|
+
.style("opacity", 0)
|
|
42
|
+
.style("cursor", "grabbing")
|
|
43
|
+
.style("filter", "drop-shadow(0 2px 4px rgba(0,0,0,0.2))")
|
|
44
|
+
.style("pointer-events", "none");
|
|
45
|
+
// Connection line between ghost and puck
|
|
46
|
+
const line = layer
|
|
47
|
+
.append("line")
|
|
48
|
+
.attr("class", "drag-line")
|
|
49
|
+
.attr("stroke", "var(--text-tertiary)")
|
|
50
|
+
.attr("stroke-width", 1)
|
|
51
|
+
.attr("stroke-dasharray", "2,2")
|
|
52
|
+
.style("opacity", 0)
|
|
53
|
+
.style("pointer-events", "none");
|
|
54
|
+
const update = () => {
|
|
55
|
+
const interaction = getInteraction(on);
|
|
56
|
+
if (!interaction || !interaction.isDragging) {
|
|
57
|
+
puck.style("opacity", 0);
|
|
58
|
+
ghost.style("opacity", 0);
|
|
59
|
+
line.style("opacity", 0);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const { target, currentPosition, startPosition: _startPosition, } = interaction;
|
|
63
|
+
const puckColor = color || target.seriesColor || "var(--primary)";
|
|
64
|
+
// Update puck position (currentPosition is already plot-relative)
|
|
65
|
+
puck
|
|
66
|
+
.attr("cx", currentPosition.x)
|
|
67
|
+
.attr("cy", currentPosition.y)
|
|
68
|
+
.attr("fill", puckColor)
|
|
69
|
+
.style("opacity", 1);
|
|
70
|
+
if (showGhost) {
|
|
71
|
+
const { margin } = ctx.chartStore.getState().dimensions;
|
|
72
|
+
// Show ghost at original target position
|
|
73
|
+
ghost
|
|
74
|
+
.attr("cx", target.coordinate.x - margin.left)
|
|
75
|
+
.attr("cy", target.coordinate.y - margin.top)
|
|
76
|
+
.style("opacity", 0.5);
|
|
77
|
+
// Draw connecting line
|
|
78
|
+
line
|
|
79
|
+
.attr("x1", target.coordinate.x - margin.left)
|
|
80
|
+
.attr("y1", target.coordinate.y - margin.top)
|
|
81
|
+
.attr("x2", currentPosition.x)
|
|
82
|
+
.attr("y2", currentPosition.y)
|
|
83
|
+
.style("opacity", 0.5);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const unsubscribe = ctx.chartStore.subscribe(() => {
|
|
87
|
+
update();
|
|
88
|
+
});
|
|
89
|
+
return () => {
|
|
90
|
+
unsubscribe();
|
|
91
|
+
layer.remove();
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
@@ -26,6 +26,8 @@ export const Markers = (options = {}) => {
|
|
|
26
26
|
const update = () => {
|
|
27
27
|
const interaction = getInteraction(on);
|
|
28
28
|
const targets = (interaction === null || interaction === void 0 ? void 0 : interaction.targets) || [];
|
|
29
|
+
// Retrieve dimensions for margin correction
|
|
30
|
+
const { margin } = ctx.chartStore.getState().dimensions;
|
|
29
31
|
// Bind data to circles
|
|
30
32
|
const circles = layer
|
|
31
33
|
.selectAll("circle")
|
|
@@ -38,13 +40,13 @@ export const Markers = (options = {}) => {
|
|
|
38
40
|
.attr("fill", (d) => d.seriesColor || options.color || "currentColor")
|
|
39
41
|
.attr("stroke", "var(--card-border)")
|
|
40
42
|
.attr("stroke-width", 2)
|
|
41
|
-
.attr("cx", (d) => d.coordinate.x)
|
|
42
|
-
.attr("cy", (d) => d.coordinate.y)
|
|
43
|
+
.attr("cx", (d) => d.coordinate.x - margin.left)
|
|
44
|
+
.attr("cy", (d) => d.coordinate.y - margin.top)
|
|
43
45
|
.style("opacity", 1);
|
|
44
46
|
// Update
|
|
45
47
|
circles
|
|
46
|
-
.attr("cx", (d) => d.coordinate.x)
|
|
47
|
-
.attr("cy", (d) => d.coordinate.y)
|
|
48
|
+
.attr("cx", (d) => d.coordinate.x - margin.left)
|
|
49
|
+
.attr("cy", (d) => d.coordinate.y - margin.top)
|
|
48
50
|
.attr("fill", (d) => d.seriesColor || options.color || "currentColor");
|
|
49
51
|
// Exit
|
|
50
52
|
circles.exit().remove();
|
|
@@ -23,11 +23,9 @@ export const SelectionUpdate = (options = {}) => {
|
|
|
23
23
|
// Otherwise map targets (from HoverSensor) to data.
|
|
24
24
|
let activeData = interaction === null || interaction === void 0 ? void 0 : interaction.data; // Direct data payload from some sensors
|
|
25
25
|
if (!activeData && targets.length > 0) {
|
|
26
|
-
|
|
26
|
+
const candidate = targets[0];
|
|
27
|
+
activeData = (candidate === null || candidate === void 0 ? void 0 : candidate.data) !== undefined ? candidate.data : candidate;
|
|
27
28
|
}
|
|
28
|
-
// For the custom function, we might want the raw interaction or the processed data
|
|
29
|
-
// Let's pass the interaction payload or the 'primary' target data.
|
|
30
|
-
// The Story uses `fn: (selection, activeData) => ...` where activeData seems to be the target object.
|
|
31
29
|
const selectionSet = g.selectAll(selector);
|
|
32
30
|
if (fn) {
|
|
33
31
|
fn(selectionSet, activeData);
|