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,83 +1,71 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
.chartContainer.mobile {
|
|
73
|
-
padding: var(--spacing-2);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.responsiveWrapper {
|
|
77
|
-
width: 100%;
|
|
78
|
-
flex: 1;
|
|
79
|
-
height: 100%;
|
|
80
|
-
min-height: 0;
|
|
81
|
-
position: relative;
|
|
82
|
-
overflow: visible;
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.chartContainer {
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(--card-bg);
|
|
5
|
+
border: var(--surface-border-width) solid var(--card-border);
|
|
6
|
+
border-radius: var(--radius-md);
|
|
7
|
+
box-shadow: var(--shadow-md);
|
|
8
|
+
padding: var(--space-6);
|
|
9
|
+
overflow: visible;
|
|
10
|
+
user-select: none;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
.chartContainer.flat {
|
|
15
|
+
box-shadow: none;
|
|
16
|
+
}
|
|
17
|
+
.chartContainer.frameless {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
border: none;
|
|
20
|
+
box-shadow: none;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
.chartContainer.solid {
|
|
24
|
+
background-color: var(--solid-bg);
|
|
25
|
+
color: var(--solid-fg);
|
|
26
|
+
--background: var(--solid-bg);
|
|
27
|
+
--foreground: var(--solid-fg);
|
|
28
|
+
--muted-foreground: color-mix(in srgb, var(--solid-fg) 70%, transparent);
|
|
29
|
+
--surface-brand: var(--solid-bg);
|
|
30
|
+
--surface-brand-foreground: var(--solid-fg);
|
|
31
|
+
--success: var(--solid-success);
|
|
32
|
+
--success-foreground: var(--solid-fg);
|
|
33
|
+
--error: var(--solid-error);
|
|
34
|
+
--error-foreground: var(--solid-fg);
|
|
35
|
+
--warning: var(--solid-warning);
|
|
36
|
+
--warning-foreground: var(--solid-fg);
|
|
37
|
+
--on-surface: var(--solid-bg);
|
|
38
|
+
--on-surface-muted: var(--solid-bg);
|
|
39
|
+
--card-bg: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
40
|
+
--card-border: var(--solid-fg);
|
|
41
|
+
--card-foreground: var(--solid-fg);
|
|
42
|
+
--popover: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
43
|
+
--popover-foreground: var(--solid-bg);
|
|
44
|
+
--input: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
45
|
+
--border-strong: var(--solid-fg);
|
|
46
|
+
--primary: var(--solid-fg);
|
|
47
|
+
--primary-foreground: var(--solid-bg);
|
|
48
|
+
--secondary: color-mix(in srgb, var(--solid-bg) 90%, transparent);
|
|
49
|
+
--secondary-foreground: var(--solid-fg);
|
|
50
|
+
--muted: color-mix(in srgb, var(--solid-fg) 20%, transparent);
|
|
51
|
+
border-color: var(--border-strong);
|
|
52
|
+
}
|
|
53
|
+
.chartContainer.solid :global(.tick) text {
|
|
54
|
+
fill: var(--solid-fg);
|
|
55
|
+
}
|
|
56
|
+
.chartContainer.solid :global(.domain),
|
|
57
|
+
.chartContainer.solid :global(.tick) line {
|
|
58
|
+
stroke: var(--solid-fg);
|
|
59
|
+
}
|
|
60
|
+
.chartContainer.mobile {
|
|
61
|
+
padding: var(--space-2);
|
|
62
|
+
}
|
|
63
|
+
.responsiveWrapper {
|
|
64
|
+
width: 100%;
|
|
65
|
+
flex: 1;
|
|
66
|
+
height: 100%;
|
|
67
|
+
min-height: 0;
|
|
68
|
+
position: relative;
|
|
69
|
+
overflow: visible;
|
|
70
|
+
}
|
|
83
71
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useEffect, useId, useMemo } from "react";
|
|
4
4
|
import { useChartContext } from "../../context.js";
|
|
5
|
+
import { CHART_DATA_ATTRS } from "../../engine/index.js";
|
|
5
6
|
import { registerSeries, unregisterSeries, } from "../../state/store/chart.store.js";
|
|
6
7
|
import { resolveAccessor } from "../../utils/accessors.js";
|
|
7
8
|
import { SeriesPoint } from "../SeriesPoint/SeriesPoint.js";
|
|
@@ -35,6 +36,7 @@ const ScatterSeriesComponent = ({ data: localData, x: localX, y: localY, size: l
|
|
|
35
36
|
}
|
|
36
37
|
registerSeries(chartStore, seriesId, [
|
|
37
38
|
{
|
|
39
|
+
id: seriesId,
|
|
38
40
|
label: label || "Scatter Series",
|
|
39
41
|
color: strokeColor,
|
|
40
42
|
x: xAccessor,
|
|
@@ -71,7 +73,10 @@ const ScatterSeriesComponent = ({ data: localData, x: localX, y: localY, size: l
|
|
|
71
73
|
if (rScale && sizeAccessor) {
|
|
72
74
|
radius = rScale(sizeAccessor(d));
|
|
73
75
|
}
|
|
74
|
-
return (_jsx(SeriesPoint, { color: strokeColor,
|
|
76
|
+
return (_jsx(SeriesPoint, { color: strokeColor, datum: d, hoverRadius: radius + 4, radius: radius, x: cx, y: cy, [CHART_DATA_ATTRS.TYPE]: "scatter",
|
|
77
|
+
[CHART_DATA_ATTRS.SERIES_ID]: seriesId,
|
|
78
|
+
[CHART_DATA_ATTRS.INDEX]: i,
|
|
79
|
+
[CHART_DATA_ATTRS.DRAGGABLE]: false }, i));
|
|
75
80
|
}) }));
|
|
76
81
|
};
|
|
77
82
|
export const ScatterSeries = React.memo(ScatterSeriesComponent);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.dot {
|
|
3
|
+
fill: var(--background);
|
|
4
|
+
stroke: var(--primary);
|
|
5
|
+
stroke-width: calc(var(--surface-border-width) * 1.5);
|
|
6
|
+
transition: r 0.2s ease, fill 0.2s;
|
|
7
|
+
}
|
|
6
8
|
}
|
|
@@ -1,129 +1,119 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.grid :global(.tick) line {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
.grid path {
|
|
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
|
-
letter-spacing: 0.05em;
|
|
120
|
-
margin-bottom: var(--spacing-1);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.axisLabel {
|
|
124
|
-
fill: var(--foreground);
|
|
125
|
-
font-size: var(--text-xs);
|
|
126
|
-
font-weight: var(--font-bold);
|
|
127
|
-
text-transform: uppercase;
|
|
128
|
-
text-anchor: middle;
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.chart {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
overflow: visible;
|
|
9
|
+
pointer-events: auto;
|
|
10
|
+
}
|
|
11
|
+
.chart :global .domain {
|
|
12
|
+
stroke: var(--card-border);
|
|
13
|
+
stroke-width: var(--surface-border-width);
|
|
14
|
+
}
|
|
15
|
+
.chart :global .domain.hideDomain {
|
|
16
|
+
stroke: none;
|
|
17
|
+
}
|
|
18
|
+
.chart :global .tick line {
|
|
19
|
+
stroke: var(--card-border);
|
|
20
|
+
stroke-width: var(--surface-border-width);
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
.chart :global .tick text {
|
|
24
|
+
fill: var(--foreground);
|
|
25
|
+
font-size: var(--text-xs);
|
|
26
|
+
font-weight: var(--font-bold);
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
}
|
|
29
|
+
.grid :global(.tick) line {
|
|
30
|
+
stroke: var(--muted);
|
|
31
|
+
stroke-opacity: 0.5;
|
|
32
|
+
}
|
|
33
|
+
.grid path {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
.path {
|
|
37
|
+
fill: none;
|
|
38
|
+
stroke: var(--primary);
|
|
39
|
+
stroke-width: calc(var(--surface-border-width) * 1.5);
|
|
40
|
+
stroke-linecap: round;
|
|
41
|
+
stroke-linejoin: round;
|
|
42
|
+
}
|
|
43
|
+
.area {
|
|
44
|
+
fill: var(--primary);
|
|
45
|
+
stroke: none;
|
|
46
|
+
}
|
|
47
|
+
.bar {
|
|
48
|
+
fill: var(--primary);
|
|
49
|
+
stroke: var(--card-border);
|
|
50
|
+
stroke-width: var(--surface-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
|
+
.cursorLine {
|
|
59
|
+
stroke: var(--muted-foreground);
|
|
60
|
+
stroke-width: var(--surface-border-width);
|
|
61
|
+
stroke-dasharray: 4 4;
|
|
62
|
+
opacity: 0;
|
|
63
|
+
transition: opacity 0.1s ease-out;
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
}
|
|
66
|
+
.cursorPoint {
|
|
67
|
+
fill: var(--primary);
|
|
68
|
+
stroke: var(--border-strong);
|
|
69
|
+
stroke-width: var(--surface-border-width);
|
|
70
|
+
transition: opacity 0.1s ease-out;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
73
|
+
.dot {
|
|
74
|
+
fill: var(--primary);
|
|
75
|
+
stroke: var(--border-strong);
|
|
76
|
+
stroke-width: var(--surface-border-width);
|
|
77
|
+
transition: r 0.2s;
|
|
78
|
+
z-index: var(--z-overlay);
|
|
79
|
+
}
|
|
80
|
+
.dot:hover {
|
|
81
|
+
r: 8;
|
|
82
|
+
stroke-width: calc(var(--surface-border-width) * 1.5);
|
|
83
|
+
}
|
|
84
|
+
.responsiveWrapper {
|
|
85
|
+
width: 100%;
|
|
86
|
+
flex: 1;
|
|
87
|
+
height: 100%;
|
|
88
|
+
min-height: 300px;
|
|
89
|
+
position: relative;
|
|
90
|
+
overflow: visible;
|
|
91
|
+
}
|
|
92
|
+
.tooltipWrapper {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
pointer-events: none;
|
|
97
|
+
z-index: var(--z-tooltip);
|
|
98
|
+
will-change: transform;
|
|
99
|
+
}
|
|
100
|
+
.tooltipCard {
|
|
101
|
+
padding: var(--space-3) var(--space-4);
|
|
102
|
+
font-size: var(--text-xs);
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
}
|
|
105
|
+
.tooltipLabel {
|
|
106
|
+
color: var(--muted-foreground);
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
font-size: var(--text-2xs);
|
|
109
|
+
letter-spacing: 0.05em;
|
|
110
|
+
margin-bottom: var(--space-1);
|
|
111
|
+
}
|
|
112
|
+
.axisLabel {
|
|
113
|
+
fill: var(--foreground);
|
|
114
|
+
font-size: var(--text-xs);
|
|
115
|
+
font-weight: var(--font-bold);
|
|
116
|
+
text-transform: uppercase;
|
|
117
|
+
text-anchor: middle;
|
|
118
|
+
}
|
|
129
119
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.point {
|
|
3
|
+
fill: var(--primary);
|
|
4
|
+
stroke: var(--card-border);
|
|
5
|
+
stroke-width: 2;
|
|
6
|
+
transition: r 0.15s ease, stroke-width 0.15s ease, opacity 0.2s;
|
|
7
|
+
z-index: var(--z-overlay);
|
|
8
|
+
/* Ensure it sits above lines */
|
|
9
|
+
position: relative;
|
|
10
|
+
}
|
|
9
11
|
}
|
|
@@ -7,7 +7,7 @@ import { Text } from "../../../Text/Text.js";
|
|
|
7
7
|
import { useChartContext } from "../../context.js";
|
|
8
8
|
import { resolveAccessor } from "../../types/index.js";
|
|
9
9
|
import { InteractionChannel } from "../../types/interaction.js";
|
|
10
|
-
import { Reposition, TOOLTIP_GAP_X, TOOLTIP_GAP_Y,
|
|
10
|
+
import { Reposition, TOOLTIP_GAP_X, TOOLTIP_GAP_Y, } from "../../utils/Reposition/index.js";
|
|
11
11
|
import styles from "./Tooltip.module.css";
|
|
12
12
|
/**
|
|
13
13
|
* The Tooltip component is a pure reactor that renders the chart's tooltip.
|
|
@@ -31,7 +31,7 @@ export function Tooltip({ containerRef, }) {
|
|
|
31
31
|
const position = hover === null || hover === void 0 ? void 0 : hover.pointer;
|
|
32
32
|
const [layout, setLayout] = useState({ x: 0, y: 0, visible: false });
|
|
33
33
|
useLayoutEffect(() => {
|
|
34
|
-
var _a, _b
|
|
34
|
+
var _a, _b;
|
|
35
35
|
if (!tooltipRef.current || !target || !position) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -42,7 +42,6 @@ export function Tooltip({ containerRef, }) {
|
|
|
42
42
|
})
|
|
43
43
|
.gap({ x: TOOLTIP_GAP_X, y: TOOLTIP_GAP_Y })
|
|
44
44
|
.align({ vertical: "center" })
|
|
45
|
-
.touchOffset(TOUCH_OFFSET_Y, (_c = position.isTouch) !== null && _c !== void 0 ? _c : false)
|
|
46
45
|
.edgeDetect({ container: containerRef })
|
|
47
46
|
.resolve();
|
|
48
47
|
setLayout({ x, y, visible: true });
|
|
@@ -1,68 +1,53 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.solid {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.tooltipCard {
|
|
55
|
-
padding: var(--spacing-3) var(--spacing-4);
|
|
56
|
-
font-size: var(--text-xs);
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
border-radius: var(--radius);
|
|
59
|
-
box-shadow: var(--shadow-hard);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.tooltipLabel {
|
|
63
|
-
color: var(--muted-foreground);
|
|
64
|
-
text-transform: uppercase;
|
|
65
|
-
font-size: var(--text-2xs);
|
|
66
|
-
letter-spacing: 0.05em;
|
|
67
|
-
margin-bottom: var(--spacing-1);
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.tooltipWrapper {
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
z-index: var(--z-tooltip);
|
|
8
|
+
will-change: transform;
|
|
9
|
+
}
|
|
10
|
+
.solid {
|
|
11
|
+
background-color: var(--solid-bg);
|
|
12
|
+
color: var(--solid-fg);
|
|
13
|
+
--background: var(--solid-bg);
|
|
14
|
+
--foreground: var(--solid-fg);
|
|
15
|
+
--muted-foreground: color-mix(in srgb, var(--solid-fg) 70%, transparent);
|
|
16
|
+
--surface-brand: var(--solid-bg);
|
|
17
|
+
--surface-brand-foreground: var(--solid-fg);
|
|
18
|
+
--success: var(--solid-success);
|
|
19
|
+
--success-foreground: var(--solid-fg);
|
|
20
|
+
--error: var(--solid-error);
|
|
21
|
+
--error-foreground: var(--solid-fg);
|
|
22
|
+
--warning: var(--solid-warning);
|
|
23
|
+
--warning-foreground: var(--solid-fg);
|
|
24
|
+
--on-surface: var(--solid-bg);
|
|
25
|
+
--on-surface-muted: var(--solid-bg);
|
|
26
|
+
--card-bg: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
27
|
+
--card-border: var(--solid-fg);
|
|
28
|
+
--card-foreground: var(--solid-fg);
|
|
29
|
+
--popover: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
30
|
+
--popover-foreground: var(--solid-bg);
|
|
31
|
+
--input: color-mix(in srgb, var(--solid-fg) 95%, var(--solid-bg) 5%);
|
|
32
|
+
--border-strong: var(--solid-fg);
|
|
33
|
+
--primary: var(--solid-fg);
|
|
34
|
+
--primary-foreground: var(--solid-bg);
|
|
35
|
+
--secondary: color-mix(in srgb, var(--solid-bg) 90%, transparent);
|
|
36
|
+
--secondary-foreground: var(--solid-fg);
|
|
37
|
+
--muted: color-mix(in srgb, var(--solid-fg) 20%, transparent);
|
|
38
|
+
}
|
|
39
|
+
.tooltipCard {
|
|
40
|
+
padding: var(--space-3) var(--space-4);
|
|
41
|
+
font-size: var(--text-xs);
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
border-radius: var(--radius-md);
|
|
44
|
+
box-shadow: var(--shadow-md);
|
|
45
|
+
}
|
|
46
|
+
.tooltipLabel {
|
|
47
|
+
color: var(--muted-foreground);
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
font-size: var(--text-2xs);
|
|
50
|
+
letter-spacing: 0.05em;
|
|
51
|
+
margin-bottom: var(--space-1);
|
|
52
|
+
}
|
|
68
53
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Engine } from "../engine";
|
|
1
2
|
import { Store } from "../state/store/chart.store";
|
|
2
3
|
import { Accessor, Config, SeriesType } from "./index";
|
|
3
4
|
import { XScale, YScale } from "./scales";
|
|
@@ -23,6 +24,13 @@ export interface RenderFrame<T = unknown> {
|
|
|
23
24
|
element: Element;
|
|
24
25
|
data: T;
|
|
25
26
|
} | null;
|
|
27
|
+
seriesId: string;
|
|
28
|
+
chartDataAttrs: {
|
|
29
|
+
TYPE: string;
|
|
30
|
+
SERIES_ID: string;
|
|
31
|
+
INDEX: string;
|
|
32
|
+
DRAGGABLE: string;
|
|
33
|
+
};
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Main context value for the Chart system.
|
|
@@ -30,6 +38,7 @@ export interface RenderFrame<T = unknown> {
|
|
|
30
38
|
*/
|
|
31
39
|
export interface ContextValue<T = unknown> {
|
|
32
40
|
chartStore: Store;
|
|
41
|
+
engine: Engine<T>;
|
|
33
42
|
config: Config;
|
|
34
43
|
isMobile: boolean;
|
|
35
44
|
colorPalette: string[];
|