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.
Files changed (211) hide show
  1. package/dist/components/Accordion/Accordion.module.css +121 -124
  2. package/dist/components/ActionRow/ActionRow.module.css +25 -24
  3. package/dist/components/Alert/Alert.module.css +74 -76
  4. package/dist/components/Avatar/Avatar.module.css +66 -66
  5. package/dist/components/Badge/Badge.module.css +50 -48
  6. package/dist/components/Breadcrumbs/Breadcrumbs.module.css +32 -33
  7. package/dist/components/Button/Button.d.ts +2 -2
  8. package/dist/components/Button/Button.js +1 -1
  9. package/dist/components/Button/Button.module.css +150 -152
  10. package/dist/components/Card/Card.module.css +37 -39
  11. package/dist/components/Chart/Chart.module.css +213 -245
  12. package/dist/components/Chart/behaviors/DraggablePuck.d.ts +36 -0
  13. package/dist/components/Chart/behaviors/DraggablePuck.js +94 -0
  14. package/dist/components/Chart/behaviors/Markers.js +6 -4
  15. package/dist/components/Chart/behaviors/SelectionUpdate.js +2 -4
  16. package/dist/components/Chart/behaviors/index.d.ts +1 -1
  17. package/dist/components/Chart/behaviors/index.js +1 -1
  18. package/dist/components/Chart/engine/CoordinateSystem.d.ts +59 -0
  19. package/dist/components/Chart/engine/CoordinateSystem.js +126 -0
  20. package/dist/components/Chart/engine/Engine.d.ts +102 -0
  21. package/dist/components/Chart/engine/Engine.js +226 -0
  22. package/dist/components/Chart/engine/Scheduler.d.ts +59 -0
  23. package/dist/components/Chart/engine/Scheduler.js +139 -0
  24. package/dist/components/Chart/engine/SpatialMap.d.ts +114 -0
  25. package/dist/components/Chart/engine/SpatialMap.js +270 -0
  26. package/dist/components/Chart/engine/index.d.ts +13 -0
  27. package/dist/components/Chart/engine/index.js +9 -0
  28. package/dist/components/Chart/engine/types.d.ts +137 -0
  29. package/dist/components/Chart/engine/types.js +47 -0
  30. package/dist/components/Chart/hooks/useEngine.d.ts +43 -0
  31. package/dist/components/Chart/hooks/useEngine.js +128 -0
  32. package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.d.ts +17 -19
  33. package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.js +38 -51
  34. package/dist/components/Chart/sensors/DragSensor/DragSensor.d.ts +38 -0
  35. package/dist/components/Chart/sensors/DragSensor/DragSensor.js +105 -0
  36. package/dist/components/Chart/sensors/DragSensor/index.d.ts +2 -0
  37. package/dist/components/Chart/sensors/DragSensor/index.js +1 -0
  38. package/dist/components/Chart/sensors/{KeyboardSensor.d.ts → KeyboardSensor/KeyboardSensor.d.ts} +1 -1
  39. package/dist/components/Chart/sensors/KeyboardSensor/KeyboardSensor.js +86 -0
  40. package/dist/components/Chart/sensors/KeyboardSensor/index.d.ts +1 -0
  41. package/dist/components/Chart/sensors/KeyboardSensor/index.js +1 -0
  42. package/dist/components/Chart/sensors/{SelectionSensor.d.ts → SelectionSensor/SelectionSensor.d.ts} +2 -2
  43. package/dist/components/Chart/sensors/SelectionSensor/SelectionSensor.js +39 -0
  44. package/dist/components/Chart/sensors/SelectionSensor/index.d.ts +1 -0
  45. package/dist/components/Chart/sensors/SelectionSensor/index.js +1 -0
  46. package/dist/components/Chart/sensors/SensorManager/SensorManager.js +36 -41
  47. package/dist/components/Chart/sensors/index.d.ts +1 -0
  48. package/dist/components/Chart/sensors/index.js +3 -2
  49. package/dist/components/Chart/sensors/utils/search.d.ts +1 -1
  50. package/dist/components/Chart/sensors/utils/search.js +25 -4
  51. package/dist/components/Chart/state/store/chart.store.js +18 -0
  52. package/dist/components/Chart/state/store/slices/series.slice.d.ts +1 -0
  53. package/dist/components/Chart/state/store/slices/series.slice.js +3 -2
  54. package/dist/components/Chart/subcomponents/Axis/Axis.module.css +32 -33
  55. package/dist/components/Chart/subcomponents/BarSeries/BarSeries.js +6 -1
  56. package/dist/components/Chart/subcomponents/BarSeries/BarSeries.module.css +11 -9
  57. package/dist/components/Chart/subcomponents/Cursor/Cursor.js +8 -1
  58. package/dist/components/Chart/subcomponents/Cursor/Cursor.module.css +14 -13
  59. package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.js +4 -0
  60. package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.module.css +5 -3
  61. package/dist/components/Chart/subcomponents/Footer/Footer.module.css +5 -3
  62. package/dist/components/Chart/subcomponents/Grid/Grid.module.css +12 -11
  63. package/dist/components/Chart/subcomponents/Header/Header.module.css +8 -7
  64. package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.d.ts +4 -4
  65. package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.js +39 -76
  66. package/dist/components/Chart/subcomponents/Legend/Legend.module.css +30 -32
  67. package/dist/components/Chart/subcomponents/LineSeries/LineSeries.js +9 -3
  68. package/dist/components/Chart/subcomponents/LineSeries/LineSeries.module.css +21 -21
  69. package/dist/components/Chart/subcomponents/Root/Root.js +113 -7
  70. package/dist/components/Chart/subcomponents/Root/Root.module.css +70 -82
  71. package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.js +6 -1
  72. package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.module.css +7 -5
  73. package/dist/components/Chart/subcomponents/Series/Series.module.css +118 -128
  74. package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.module.css +10 -8
  75. package/dist/components/Chart/subcomponents/Tooltip/Tooltip.js +2 -3
  76. package/dist/components/Chart/subcomponents/Tooltip/Tooltip.module.css +52 -67
  77. package/dist/components/Chart/types/context.d.ts +9 -0
  78. package/dist/components/Chart/types/events.d.ts +5 -7
  79. package/dist/components/Chart/types/interaction.d.ts +24 -2
  80. package/dist/components/Chart/types/interaction.js +1 -0
  81. package/dist/components/Checkbox/Checkbox.module.css +57 -59
  82. package/dist/components/Chip/Chip.module.css +105 -115
  83. package/dist/components/Combobox/Combobox.d.ts +2 -1
  84. package/dist/components/Combobox/Combobox.js +2 -2
  85. package/dist/components/Combobox/Combobox.module.css +233 -210
  86. package/dist/components/CopyButton/CopyButton.module.css +84 -90
  87. package/dist/components/Drawer/Drawer.module.css +126 -145
  88. package/dist/components/Dropdown/Dropdown.d.ts +3 -1
  89. package/dist/components/Dropdown/Dropdown.js +3 -3
  90. package/dist/components/Dropdown/Dropdown.module.css +52 -32
  91. package/dist/components/FileUpload/FileUpload.js +24 -0
  92. package/dist/components/FileUpload/FileUpload.module.css +295 -313
  93. package/dist/components/Form/Form.module.css +35 -39
  94. package/dist/components/Image/Image.module.css +53 -54
  95. package/dist/components/Input/Input.d.ts +4 -2
  96. package/dist/components/Input/Input.js +2 -2
  97. package/dist/components/Input/Input.module.css +135 -119
  98. package/dist/components/Label/Label.module.css +17 -15
  99. package/dist/components/Layout/Layout.module.css +95 -111
  100. package/dist/components/Link/Link.module.css +67 -65
  101. package/dist/components/Modal/Modal.module.css +112 -132
  102. package/dist/components/Page/Page.module.css +21 -21
  103. package/dist/components/Pagination/Pagination.module.css +56 -56
  104. package/dist/components/Popover/Popover.module.css +17 -16
  105. package/dist/components/ProgressBar/ProgressBar.module.css +36 -37
  106. package/dist/components/RadioGroup/RadioGroup.module.css +74 -77
  107. package/dist/components/Select/Select.d.ts +2 -1
  108. package/dist/components/Select/Select.js +2 -2
  109. package/dist/components/Select/Select.module.css +133 -98
  110. package/dist/components/Sheet/Sheet.module.css +134 -154
  111. package/dist/components/Sidebar/Sidebar.module.css +72 -74
  112. package/dist/components/Sidebar/subcomponents/Footer/Footer.module.css +7 -5
  113. package/dist/components/Sidebar/subcomponents/Group/Group.module.css +80 -85
  114. package/dist/components/Sidebar/subcomponents/Header/Header.module.css +12 -10
  115. package/dist/components/Sidebar/subcomponents/Item/Item.module.css +54 -55
  116. package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.module.css +38 -38
  117. package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.module.css +5 -3
  118. package/dist/components/Sidebar/subcomponents/Nav/Nav.module.css +13 -11
  119. package/dist/components/Sidebar/subcomponents/Rail/Rail.module.css +62 -63
  120. package/dist/components/Sidebar/subcomponents/Section/Section.module.css +86 -91
  121. package/dist/components/Skeleton/Skeleton.module.css +28 -26
  122. package/dist/components/Slat/Slat.module.css +93 -94
  123. package/dist/components/Slider/Slider.module.css +116 -121
  124. package/dist/components/Spinner/Spinner.module.css +28 -27
  125. package/dist/components/SplitButton/SplitButton.d.ts +3 -1
  126. package/dist/components/SplitButton/SplitButton.js +2 -2
  127. package/dist/components/SplitButton/SplitButton.module.css +104 -87
  128. package/dist/components/Switch/Switch.module.css +64 -63
  129. package/dist/components/Table/FilterBuilder/FilterBuilder.module.css +36 -36
  130. package/dist/components/Table/FilterBuilder/FilterConditionRow.js +1 -1
  131. package/dist/components/Table/FilterBuilder/FilterConditionRow.module.css +21 -22
  132. package/dist/components/Table/FilterBuilder/FilterGroup.js +4 -4
  133. package/dist/components/Table/FilterBuilder/FilterGroup.module.css +355 -389
  134. package/dist/components/Table/FilterBuilder/FilterSheet.module.css +68 -71
  135. package/dist/components/Table/Table.d.ts +4 -2
  136. package/dist/components/Table/Table.js +50 -13
  137. package/dist/components/Table/Table.module.css +210 -188
  138. package/dist/components/Table/TableHeaderFilter.js +1 -1
  139. package/dist/components/Table/TableHeaderFilter.module.css +51 -57
  140. package/dist/components/Tabs/Tabs.module.css +79 -80
  141. package/dist/components/Text/Text.module.css +108 -131
  142. package/dist/components/Textarea/Textarea.d.ts +3 -1
  143. package/dist/components/Textarea/Textarea.js +2 -2
  144. package/dist/components/Textarea/Textarea.module.css +114 -94
  145. package/dist/components/Toast/Toast.module.css +82 -82
  146. package/dist/components/Tooltip/Tooltip.module.css +17 -16
  147. package/dist/styles/globals.css +1677 -1691
  148. package/dist/styles/palettes.d.ts +0 -5
  149. package/dist/styles/palettes.js +0 -8
  150. package/dist/styles/themes/definitions.d.ts +0 -8
  151. package/dist/styles/themes/definitions.js +117 -5
  152. package/dist/styles/types.d.ts +2 -0
  153. package/dist/styles/types.js +1 -0
  154. package/dist/tsconfig.build.tsbuildinfo +1 -1
  155. package/package.json +4 -4
  156. package/.agent/skills/doom/a2ui/a2ui-examples.md +0 -289
  157. package/.agent/skills/doom/a2ui/a2ui-principles.md +0 -49
  158. package/.agent/skills/doom/a2ui/a2ui-protocol.md +0 -191
  159. package/.agent/skills/doom/components/a2ui.md +0 -46
  160. package/.agent/skills/doom/components/accordion.md +0 -44
  161. package/.agent/skills/doom/components/actionrow.md +0 -33
  162. package/.agent/skills/doom/components/alert.md +0 -35
  163. package/.agent/skills/doom/components/avatar.md +0 -36
  164. package/.agent/skills/doom/components/badge.md +0 -29
  165. package/.agent/skills/doom/components/breadcrumbs.md +0 -33
  166. package/.agent/skills/doom/components/button.md +0 -43
  167. package/.agent/skills/doom/components/card.md +0 -41
  168. package/.agent/skills/doom/components/chart.md +0 -106
  169. package/.agent/skills/doom/components/checkbox.md +0 -38
  170. package/.agent/skills/doom/components/chip.md +0 -35
  171. package/.agent/skills/doom/components/combobox.md +0 -50
  172. package/.agent/skills/doom/components/copybutton.md +0 -41
  173. package/.agent/skills/doom/components/drawer.md +0 -69
  174. package/.agent/skills/doom/components/dropdown.md +0 -33
  175. package/.agent/skills/doom/components/fileupload.md +0 -49
  176. package/.agent/skills/doom/components/form.md +0 -55
  177. package/.agent/skills/doom/components/icon.md +0 -47
  178. package/.agent/skills/doom/components/image.md +0 -48
  179. package/.agent/skills/doom/components/input.md +0 -54
  180. package/.agent/skills/doom/components/label.md +0 -32
  181. package/.agent/skills/doom/components/layout.md +0 -92
  182. package/.agent/skills/doom/components/link.md +0 -39
  183. package/.agent/skills/doom/components/modal.md +0 -71
  184. package/.agent/skills/doom/components/page.md +0 -41
  185. package/.agent/skills/doom/components/pagination.md +0 -32
  186. package/.agent/skills/doom/components/popover.md +0 -45
  187. package/.agent/skills/doom/components/progressbar.md +0 -37
  188. package/.agent/skills/doom/components/radiogroup.md +0 -45
  189. package/.agent/skills/doom/components/select.md +0 -43
  190. package/.agent/skills/doom/components/sheet.md +0 -71
  191. package/.agent/skills/doom/components/sidebar.md +0 -92
  192. package/.agent/skills/doom/components/skeleton.md +0 -35
  193. package/.agent/skills/doom/components/slat.md +0 -46
  194. package/.agent/skills/doom/components/slider.md +0 -51
  195. package/.agent/skills/doom/components/spinner.md +0 -34
  196. package/.agent/skills/doom/components/splitbutton.md +0 -35
  197. package/.agent/skills/doom/components/switch.md +0 -40
  198. package/.agent/skills/doom/components/table.md +0 -82
  199. package/.agent/skills/doom/components/tabs.md +0 -65
  200. package/.agent/skills/doom/components/text.md +0 -42
  201. package/.agent/skills/doom/components/textarea.md +0 -46
  202. package/.agent/skills/doom/components/toast.md +0 -59
  203. package/.agent/skills/doom/components/tooltip.md +0 -35
  204. package/.agent/skills/doom/index.md +0 -167
  205. package/.agent/skills/doom/styles/aesthetic.md +0 -151
  206. package/.agent/skills/doom/styles/css-variables.md +0 -80
  207. package/.agent/skills/doom/styles/mixins.md +0 -97
  208. package/.agent/skills/doom/styles/tokens.md +0 -129
  209. package/.agent/skills/doom/styles/utilities.md +0 -84
  210. package/dist/components/Chart/sensors/KeyboardSensor.js +0 -82
  211. package/dist/components/Chart/sensors/SelectionSensor.js +0 -41
@@ -1,246 +1,214 @@
1
- .chart {
2
- width: 100%;
3
- height: 100%;
4
- position: relative;
5
- overflow: visible;
6
- }
7
- .chart :global .domain {
8
- stroke: var(--card-border);
9
- stroke-width: var(--border-width);
10
- }
11
- .chart :global .domain.hideDomain {
12
- stroke: none;
13
- }
14
- .chart :global .tick line {
15
- stroke: var(--card-border);
16
- stroke-width: var(--border-width);
17
- opacity: 1;
18
- }
19
- .chart :global .tick text {
20
- fill: var(--foreground);
21
- font-size: var(--text-xs);
22
- font-weight: var(--font-bold);
23
- text-transform: uppercase;
24
- }
25
-
26
- .grid :global(.tick) line {
27
- stroke: var(--muted);
28
- stroke-opacity: 0.5;
29
- }
30
- .grid path {
31
- display: none;
32
- }
33
-
34
- .path {
35
- fill: none;
36
- stroke: var(--primary);
37
- stroke-width: calc(var(--border-width) * 1.5);
38
- stroke-linecap: round;
39
- stroke-linejoin: round;
40
- }
41
-
42
- .area {
43
- fill: var(--primary);
44
- stroke: none;
45
- }
46
-
47
- .bar {
48
- fill: var(--primary);
49
- stroke: var(--card-border);
50
- stroke-width: var(--border-width);
51
- stroke-linejoin: round;
52
- transition: opacity 0.2s;
53
- }
54
- .bar:hover {
55
- cursor: crosshair;
56
- filter: brightness(1.1);
57
- }
58
-
59
- .cursorLine {
60
- stroke: var(--muted-foreground);
61
- stroke-width: var(--border-width);
62
- stroke-dasharray: 4 4;
63
- opacity: 0;
64
- pointer-events: none;
65
- }
66
-
67
- .cursorPoint {
68
- fill: var(--primary);
69
- stroke: var(--border-strong);
70
- stroke-width: var(--border-width);
71
- pointer-events: none;
72
- }
73
-
74
- .dot {
75
- fill: var(--primary);
76
- stroke: var(--border-strong);
77
- stroke-width: var(--border-width);
78
- transition: r 0.2s;
79
- z-index: var(--z-overlay);
80
- }
81
- .dot:hover {
82
- r: 8;
83
- stroke-width: calc(var(--border-width) * 1.5);
84
- }
85
-
86
- .chartContainer {
87
- position: relative;
88
- background-color: var(--card-bg);
89
- border: var(--border-width) solid var(--card-border);
90
- border-radius: var(--radius);
91
- box-shadow: var(--shadow-hard);
92
- padding: var(--spacing-6);
93
- overflow: visible;
94
- display: flex;
95
- flex-direction: column;
96
- }
97
- .chartContainer.flat {
98
- box-shadow: none;
99
- }
100
- .chartContainer.frameless {
101
- background-color: transparent;
102
- border: none;
103
- box-shadow: none;
104
- padding: 0;
105
- }
106
- .chartContainer.solid {
107
- /* ROOT CONTEXT (The Field) */
108
- background-color: var(--solid-bg);
109
- color: var(--solid-fg);
110
- /* Root Variables */
111
- --background: var(--solid-bg);
112
- --foreground: var(--solid-fg);
113
- --muted-foreground: color-mix(in srgb, var(--solid-fg) 70%, transparent);
114
- /*
115
- * Standardized Brand Surface Logic
116
- * Decouples Modals (Surface) from Buttons (Action)
117
- */
118
- --surface-brand: var(--solid-bg);
119
- --surface-brand-foreground: var(--solid-fg);
120
- /* SEMANTICS (True Semantic Colors) */
121
- --success: var(--solid-success);
122
- --success-foreground: var(--solid-fg);
123
- --error: var(--solid-error);
124
- --error-foreground: var(--solid-fg);
125
- --warning: var(--solid-warning);
126
- --warning-foreground: var(--solid-fg);
127
- /* SURFACE COLORS */
128
- --on-surface: var(--solid-bg);
129
- --on-surface-muted: var(--solid-bg);
130
- /* COMPONENT TOKENS */
131
- --card-bg: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
132
- --card-border: var(--solid-fg);
133
- --card-foreground: var(--solid-fg);
134
- /* POPOVER TOKENS */
135
- --popover: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
136
- --popover-foreground: var(--solid-bg);
137
- /* INPUT TOKENS */
138
- --input: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
139
- --border-strong: var(--solid-fg);
140
- /* BUTTON TOKENS */
141
- --primary: var(--solid-fg);
142
- --primary-foreground: var(--solid-bg);
143
- /* SECONDARY TOKENS */
144
- --secondary: color-mix(in srgb, var(--solid-bg) 90%, transparent);
145
- --secondary-foreground: var(--solid-fg);
146
- /* MUTED TOKENS */
147
- --muted: color-mix(in srgb, var(--solid-fg) 20%, transparent);
148
- border-color: var(--border-strong);
149
- }
150
- .chartContainer.solid :global(.tick) text {
151
- fill: var(--solid-fg);
152
- }
153
- .chartContainer.solid :global(.domain),
154
- .chartContainer.solid :global(.tick) line {
155
- stroke: var(--solid-fg);
156
- }
157
- .chartContainer.solid .tooltipCard {
158
- background-color: var(--solid-bg);
159
- border-color: var(--solid-fg);
160
- }
161
- .chartContainer.mobile {
162
- padding: var(--spacing-2);
163
- }
164
-
165
- .responsiveWrapper {
166
- width: 100%;
167
- flex: 1;
168
- height: 100%;
169
- min-height: 0;
170
- position: relative;
171
- overflow: visible;
172
- }
173
-
174
- .tooltipWrapper {
175
- position: absolute;
176
- top: 0;
177
- left: 0;
178
- pointer-events: none;
179
- z-index: var(--z-tooltip);
180
- will-change: transform;
181
- }
182
-
183
- .tooltipCard {
184
- padding: var(--spacing-3) var(--spacing-4);
185
- font-size: var(--text-xs);
186
- white-space: nowrap;
187
- }
188
-
189
- .tooltipLabel {
190
- color: var(--muted-foreground);
191
- text-transform: uppercase;
192
- font-size: var(--text-2xs);
193
- letter-spacing: 0.05em;
194
- margin-bottom: var(--spacing-1);
195
- }
196
-
197
- .axisLabel {
198
- fill: var(--foreground);
199
- font-size: var(--text-xs);
200
- font-weight: var(--font-bold);
201
- text-transform: uppercase;
202
- text-anchor: middle;
203
- }
204
-
205
- .chartHeader {
206
- padding-right: 0;
207
- }
208
-
209
- .subtitle {
210
- color: var(--muted-foreground);
211
- margin: 0;
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
- activeData = targets[0]; // Wrapper { element, data }
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);
@@ -1,6 +1,6 @@
1
1
  export * from "./Cursor";
2
- export * from "./Cursor";
3
2
  export * from "./Dim";
3
+ export * from "./DraggablePuck";
4
4
  export * from "./Markers";
5
5
  export * from "./SelectionUpdate";
6
6
  export * from "./Tooltip";
@@ -1,6 +1,6 @@
1
1
  export * from "./Cursor.js";
2
- export * from "./Cursor.js";
3
2
  export * from "./Dim.js";
3
+ export * from "./DraggablePuck.js";
4
4
  export * from "./Markers.js";
5
5
  export * from "./SelectionUpdate.js";
6
6
  export * from "./Tooltip.js";