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,4 +1,5 @@
|
|
|
1
1
|
import { Selection } from "d3-selection";
|
|
2
|
+
import { EngineEvent } from "../engine";
|
|
2
3
|
import { ContextValue } from "./context";
|
|
3
4
|
import { Interaction } from "./interaction";
|
|
4
5
|
/**
|
|
@@ -43,23 +44,20 @@ export interface BehaviorContext<T = any> {
|
|
|
43
44
|
*/
|
|
44
45
|
export type Behavior<T = any> = (context: BehaviorContext<T>) => Cleanup | void;
|
|
45
46
|
/**
|
|
46
|
-
* SensorContext provides the
|
|
47
|
+
* SensorContext provides the environment for sensors to interact with the chart state.
|
|
48
|
+
* Refactored for Hyper-Engine: Reduced API surface.
|
|
47
49
|
*/
|
|
48
50
|
export interface SensorContext<T = unknown> {
|
|
49
|
-
on: (type: EventType, listener: EventListener) => void;
|
|
50
|
-
off: (type: EventType, listener: EventListener) => void;
|
|
51
51
|
getChartContext: () => ContextValue<T>;
|
|
52
52
|
getInteraction: (name: string) => Interaction | null;
|
|
53
53
|
upsertInteraction: (name: string, interaction: Interaction) => void;
|
|
54
54
|
removeInteraction: (name: string) => void;
|
|
55
|
-
emit: (event: ChartEvent) => void;
|
|
56
|
-
pointerPosition: Coordinates | null;
|
|
57
|
-
isWithinPlot: boolean;
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* A Sensor is a function that detects user intent and updates the interaction store.
|
|
58
|
+
* Sensors receive processed EngineEvents and no longer subscribe to events themselves.
|
|
61
59
|
*/
|
|
62
|
-
export type Sensor<T = unknown> = (context: SensorContext<T>) =>
|
|
60
|
+
export type Sensor<T = unknown> = (event: EngineEvent<T>, context: SensorContext<T>) => void;
|
|
63
61
|
export interface EventContextValue {
|
|
64
62
|
on: (type: EventType, listener: EventListener) => void;
|
|
65
63
|
off: (type: EventType, listener: EventListener) => void;
|
|
@@ -11,7 +11,8 @@ export declare enum InteractionChannel {
|
|
|
11
11
|
SELECTION = "selection",
|
|
12
12
|
CROSSHAIR = "crosshair",
|
|
13
13
|
TOOLTIP_CONFIG = "tooltip-config",
|
|
14
|
-
CURSOR_CONFIG = "cursor-config"
|
|
14
|
+
CURSOR_CONFIG = "cursor-config",
|
|
15
|
+
DRAG = "drag"
|
|
15
16
|
}
|
|
16
17
|
export declare enum InteractionType {
|
|
17
18
|
HOVER = "hover",
|
|
@@ -47,4 +48,25 @@ export interface SelectionInteraction<T = any> {
|
|
|
47
48
|
selection: T[];
|
|
48
49
|
mode: "continuous" | "discrete";
|
|
49
50
|
}
|
|
50
|
-
export
|
|
51
|
+
export interface DragInteraction<T = any> {
|
|
52
|
+
/** The data point being dragged */
|
|
53
|
+
target: InteractionTarget<T>;
|
|
54
|
+
/** Current pixel position during drag */
|
|
55
|
+
currentPosition: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
/** Starting pixel position when drag began */
|
|
60
|
+
startPosition: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
64
|
+
/** Current value in data domain (inverted from pixel) */
|
|
65
|
+
currentValue: {
|
|
66
|
+
x: any;
|
|
67
|
+
y: any;
|
|
68
|
+
};
|
|
69
|
+
/** Whether the drag is currently active */
|
|
70
|
+
isDragging: boolean;
|
|
71
|
+
}
|
|
72
|
+
export type Interaction = HoverInteraction | SelectionInteraction | DragInteraction;
|
|
@@ -12,6 +12,7 @@ export var InteractionChannel;
|
|
|
12
12
|
InteractionChannel["CROSSHAIR"] = "crosshair";
|
|
13
13
|
InteractionChannel["TOOLTIP_CONFIG"] = "tooltip-config";
|
|
14
14
|
InteractionChannel["CURSOR_CONFIG"] = "cursor-config";
|
|
15
|
+
InteractionChannel["DRAG"] = "drag";
|
|
15
16
|
})(InteractionChannel || (InteractionChannel = {}));
|
|
16
17
|
export var InteractionType;
|
|
17
18
|
(function (InteractionType) {
|
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.checkboxInput {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
.checkboxInput:focus-visible + .checkboxDisplay:focus-visible
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
.checkboxInput:focus-visible + .checkboxDisplay:focus {
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
.checkboxInput:focus-visible + .checkboxDisplay {
|
|
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
|
-
cursor: pointer;
|
|
59
|
-
margin-left: var(--spacing-1);
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.checkboxWrapper {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: var(--space-2);
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
.checkboxWrapper.disabled {
|
|
10
|
+
cursor: not-allowed;
|
|
11
|
+
opacity: 0.6;
|
|
12
|
+
}
|
|
13
|
+
.checkboxInput {
|
|
14
|
+
position: absolute;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
width: 0;
|
|
17
|
+
height: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
}
|
|
20
|
+
.checkboxInput:focus-visible + .checkboxDisplay:focus-visible {
|
|
21
|
+
outline: none;
|
|
22
|
+
transform: translate(calc(-1 * var(--space-0\.5)), calc(-1 * var(--space-0\.5)));
|
|
23
|
+
box-shadow: var(--shadow-offset-xl) var(--shadow-primary);
|
|
24
|
+
border-color: var(--primary);
|
|
25
|
+
}
|
|
26
|
+
.checkboxInput:focus-visible + .checkboxDisplay:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.checkboxInput:focus-visible + .checkboxDisplay {
|
|
30
|
+
outline: var(--surface-border-width) solid var(--primary);
|
|
31
|
+
}
|
|
32
|
+
.checkboxDisplay {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
width: var(--toggle-size);
|
|
37
|
+
height: var(--toggle-size);
|
|
38
|
+
background-color: var(--card-bg);
|
|
39
|
+
color: transparent;
|
|
40
|
+
border: var(--surface-border-width) solid var(--muted-foreground);
|
|
41
|
+
border-radius: var(--radius-md);
|
|
42
|
+
transition: all var(--duration-fast) var(--ease-in-out);
|
|
43
|
+
}
|
|
44
|
+
.checkboxInput:checked + .checkboxDisplay {
|
|
45
|
+
background-color: var(--primary);
|
|
46
|
+
border-color: var(--card-border);
|
|
47
|
+
color: var(--primary-foreground);
|
|
48
|
+
}
|
|
49
|
+
.icon {
|
|
50
|
+
width: 80%;
|
|
51
|
+
height: 80%;
|
|
52
|
+
stroke-width: 3.5px;
|
|
53
|
+
}
|
|
54
|
+
.labelOverride {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
margin-left: var(--space-1);
|
|
57
|
+
}
|
|
60
58
|
}
|
|
@@ -1,116 +1,106 @@
|
|
|
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
|
-
.xs {
|
|
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
|
-
opacity: 0.7;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
transition: opacity 0.1s ease;
|
|
109
|
-
}
|
|
110
|
-
.dismissButton:hover {
|
|
111
|
-
opacity: 1;
|
|
112
|
-
}
|
|
113
|
-
.dismissButton:focus-visible {
|
|
114
|
-
outline: 1px solid currentColor;
|
|
115
|
-
outline-offset: var(--spacing-half);
|
|
1
|
+
@layer doom.components {
|
|
2
|
+
.chip {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: var(--space-1);
|
|
6
|
+
font-family: var(--font-family);
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
letter-spacing: 0.05em;
|
|
10
|
+
border: var(--surface-border-width) solid var(--card-border);
|
|
11
|
+
border-radius: var(--radius-md);
|
|
12
|
+
background: var(--surface-accent);
|
|
13
|
+
color: var(--foreground);
|
|
14
|
+
transition: all 0.1s ease;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
user-select: none;
|
|
19
|
+
}
|
|
20
|
+
.chip.clickable {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
.chip.interactive:hover:not(.disabled) {
|
|
24
|
+
filter: brightness(1.1);
|
|
25
|
+
}
|
|
26
|
+
.chip.interactive:focus-visible {
|
|
27
|
+
outline: none;
|
|
28
|
+
transform: translate(calc(-1 * var(--space-0\.5)), calc(-1 * var(--space-0\.5)));
|
|
29
|
+
box-shadow: var(--shadow-offset-xl) var(--shadow-primary);
|
|
30
|
+
border-color: var(--primary);
|
|
31
|
+
}
|
|
32
|
+
.chip.interactive:focus {
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
.chip.disabled {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
.xs {
|
|
40
|
+
padding: var(--space-0\.5) var(--space-1);
|
|
41
|
+
font-size: var(--text-2xs);
|
|
42
|
+
}
|
|
43
|
+
.sm {
|
|
44
|
+
padding: var(--space-1) var(--space-2);
|
|
45
|
+
font-size: var(--text-xs);
|
|
46
|
+
}
|
|
47
|
+
.md {
|
|
48
|
+
padding: var(--space-1) var(--space-3);
|
|
49
|
+
font-size: var(--text-xs);
|
|
50
|
+
}
|
|
51
|
+
.lg {
|
|
52
|
+
padding: var(--space-2) var(--space-4);
|
|
53
|
+
font-size: var(--text-sm);
|
|
54
|
+
}
|
|
55
|
+
.xl {
|
|
56
|
+
padding: var(--space-2) var(--space-6);
|
|
57
|
+
font-size: var(--text-base);
|
|
58
|
+
}
|
|
59
|
+
.default {
|
|
60
|
+
background: var(--surface-accent);
|
|
61
|
+
border-color: var(--card-border);
|
|
62
|
+
color: var(--foreground);
|
|
63
|
+
}
|
|
64
|
+
.primary {
|
|
65
|
+
background: var(--primary);
|
|
66
|
+
color: var(--primary-foreground);
|
|
67
|
+
}
|
|
68
|
+
.success {
|
|
69
|
+
background: var(--success);
|
|
70
|
+
color: var(--success-foreground);
|
|
71
|
+
}
|
|
72
|
+
.warning {
|
|
73
|
+
background: var(--warning);
|
|
74
|
+
color: var(--warning-foreground);
|
|
75
|
+
}
|
|
76
|
+
.error {
|
|
77
|
+
background: var(--error);
|
|
78
|
+
color: var(--error-foreground);
|
|
79
|
+
}
|
|
80
|
+
.content {
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: var(--space-1);
|
|
84
|
+
}
|
|
85
|
+
.dismissButton {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
padding: 0;
|
|
90
|
+
margin-left: var(--space-0\.5);
|
|
91
|
+
background: transparent;
|
|
92
|
+
border: none;
|
|
93
|
+
border-radius: var(--radius-md);
|
|
94
|
+
color: currentColor;
|
|
95
|
+
opacity: 0.7;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: opacity 0.1s ease;
|
|
98
|
+
}
|
|
99
|
+
.dismissButton:hover {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
.dismissButton:focus-visible {
|
|
103
|
+
outline: 1px solid currentColor;
|
|
104
|
+
outline-offset: var(--space-0\.5);
|
|
105
|
+
}
|
|
116
106
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ControlSize } from "../../styles/types";
|
|
1
2
|
export interface ComboboxOption {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
@@ -9,7 +10,7 @@ interface ComboboxProps {
|
|
|
9
10
|
placeholder?: string;
|
|
10
11
|
multiple?: boolean;
|
|
11
12
|
searchable?: boolean;
|
|
12
|
-
size?:
|
|
13
|
+
size?: ControlSize;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
className?: string;
|
|
15
16
|
inline?: boolean;
|
|
@@ -178,7 +178,7 @@ export function Combobox({ options, value, onChange, placeholder = "Select...",
|
|
|
178
178
|
}, [selectedValues, options, placeholder]);
|
|
179
179
|
const hasValue = selectedValues.length > 0;
|
|
180
180
|
const allSelected = multiple && selectedValues.length === options.length;
|
|
181
|
-
const dropdownContent = (_jsxs(Card.Root, { className: clsx(styles.dropdown, inline && styles.inlineDropdown), onClick: (e) => e.stopPropagation(), children: [searchable && (_jsxs("div", { className: styles.searchWrapper, children: [_jsx(Search, { className: styles.searchIcon, size:
|
|
181
|
+
const dropdownContent = (_jsxs(Card.Root, { className: clsx(styles.dropdown, inline && styles.inlineDropdown), onClick: (e) => e.stopPropagation(), children: [searchable && (_jsxs("div", { className: styles.searchWrapper, children: [_jsx(Search, { className: styles.searchIcon, size: 20 }), _jsx("input", { ref: inputRef, className: styles.searchInput, placeholder: "Search...", type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onKeyDown: handleSearchKeyDown })] })), multiple && options.length > 0 && (_jsx("div", { className: styles.stickyOption, children: _jsxs("button", { className: clsx(styles.option, allSelected && styles.selected), id: selectAllId, type: "button", onClick: (e) => {
|
|
182
182
|
e.stopPropagation();
|
|
183
183
|
handleSelectAll();
|
|
184
184
|
}, onKeyDown: (e) => handleOptionKeyDown(e, -1), children: [_jsx("div", { style: { pointerEvents: "none" }, children: _jsx(Checkbox, { readOnly: true, checked: allSelected }) }), _jsx(Text, { as: "span", className: styles.optionLabel, children: "All" })] }) })), _jsx("div", { ref: optionsListRef, className: styles.optionsList, children: filteredOptions.length === 0 ? (_jsx("div", { className: styles.noResults, children: _jsx(Text, { className: styles.noResultsText, children: "No results" }) })) : (_jsx("div", { style: {
|
|
@@ -205,7 +205,7 @@ export function Combobox({ options, value, onChange, placeholder = "Select...",
|
|
|
205
205
|
if (e.key === "Enter") {
|
|
206
206
|
handleClear(e);
|
|
207
207
|
}
|
|
208
|
-
}, children: _jsx(X, { size: 12 }) })), _jsx(ChevronDown, { className: styles.chevron, size:
|
|
208
|
+
}, children: _jsx(X, { size: 12 }) })), _jsx(ChevronDown, { className: styles.chevron, size: 20 })] })] }), onClose: () => {
|
|
209
209
|
setIsOpen(false);
|
|
210
210
|
setSearchQuery("");
|
|
211
211
|
} }));
|