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,35 +0,0 @@
|
|
|
1
|
-
# Alert Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Alert } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ------------- | --------------------------------------------- | -------- | --------------------------------- |
|
|
13
|
-
| `variant` | `"info" \| "success" \| "warning" \| "error"` | `"info"` | Visual style |
|
|
14
|
-
| `title` | `string` | required | Alert heading |
|
|
15
|
-
| `description` | `ReactNode` | — | Additional content |
|
|
16
|
-
| `icon` | `ReactNode` | — | Custom icon (defaults by variant) |
|
|
17
|
-
|
|
18
|
-
## Usage
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
<Alert
|
|
22
|
-
variant="error"
|
|
23
|
-
title="Invalid credentials"
|
|
24
|
-
description="Please check your email and password."
|
|
25
|
-
/>
|
|
26
|
-
|
|
27
|
-
<Alert variant="success" title="Changes saved!" />
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Guidelines
|
|
31
|
-
|
|
32
|
-
- Use `error` for form validation, API errors.
|
|
33
|
-
- Use `success` for confirmations.
|
|
34
|
-
- Use `warning` for cautions/deprecations.
|
|
35
|
-
- Use `info` for general notices.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Avatar Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Avatar } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ---------- | ------------------------------ | ---------- | --------------------------- |
|
|
13
|
-
| `src` | `string` | — | Image URL |
|
|
14
|
-
| `alt` | `string` | `"Avatar"` | Alt text |
|
|
15
|
-
| `fallback` | `ReactNode` | required | Fallback (initials or icon) |
|
|
16
|
-
| `size` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` | Avatar size |
|
|
17
|
-
| `shape` | `"circle" \| "square"` | `"square"` | Shape |
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<Avatar
|
|
23
|
-
src="/avatars/user.jpg"
|
|
24
|
-
fallback="JD"
|
|
25
|
-
size="lg"
|
|
26
|
-
shape="circle"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<Avatar fallback={<User size={20} />} />
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Guidelines
|
|
33
|
-
|
|
34
|
-
- Always provide a `fallback` for when image fails to load.
|
|
35
|
-
- String fallbacks are auto-truncated to 2 characters.
|
|
36
|
-
- Use `shape="circle"` for user profiles.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Badge Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Badge } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ---------- | ---------------------------------------------------------------------------- | ----------- | ------------- |
|
|
13
|
-
| `variant` | `"primary" \| "success" \| "warning" \| "error" \| "secondary" \| "outline"` | `"primary"` | Visual style |
|
|
14
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Badge size |
|
|
15
|
-
| `children` | `ReactNode` | required | Badge content |
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
<Badge variant="success">Active</Badge>
|
|
21
|
-
<Badge variant="error" size="sm">Overdue</Badge>
|
|
22
|
-
<Badge variant="outline">Draft</Badge>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Guidelines
|
|
26
|
-
|
|
27
|
-
- Use for status indicators, counts, or labels.
|
|
28
|
-
- Keep content short (1-2 words max).
|
|
29
|
-
- Use semantic colors: `success` for positive, `error` for negative, etc.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Breadcrumbs Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Breadcrumbs, BreadcrumbItem } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
### BreadcrumbItem
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Description |
|
|
14
|
-
| ----------- | ----------- | -------------------- |
|
|
15
|
-
| `href` | `string` | Link destination |
|
|
16
|
-
| `isCurrent` | `boolean` | Mark as current page |
|
|
17
|
-
| `children` | `ReactNode` | Link text |
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<Breadcrumbs>
|
|
23
|
-
<BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
24
|
-
<BreadcrumbItem href="/products">Products</BreadcrumbItem>
|
|
25
|
-
<BreadcrumbItem isCurrent>Widget Pro</BreadcrumbItem>
|
|
26
|
-
</Breadcrumbs>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Guidelines
|
|
30
|
-
|
|
31
|
-
- Last item should have `isCurrent` (no link, shows as text).
|
|
32
|
-
- Separators are automatically rendered between items.
|
|
33
|
-
- Use for navigation hierarchy in multi-level pages.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Button Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Button } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ---------- | --------------------------------------------------------------------------- | ----------- | ------------------------------------- |
|
|
13
|
-
| `variant` | `"primary" \| "secondary" \| "ghost" \| "outline" \| "success" \| "danger"` | `"primary"` | Visual style |
|
|
14
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Button size |
|
|
15
|
-
| `loading` | `boolean` | `false` | Show loading spinner, disables button |
|
|
16
|
-
| `disabled` | `boolean` | `false` | Disable the button |
|
|
17
|
-
|
|
18
|
-
Plus all standard `<button>` HTML attributes.
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<Button variant="primary" onClick={handleClick}>
|
|
24
|
-
Submit
|
|
25
|
-
</Button>
|
|
26
|
-
|
|
27
|
-
<Button loading variant="danger">
|
|
28
|
-
Deleting...
|
|
29
|
-
</Button>
|
|
30
|
-
|
|
31
|
-
<Button variant="ghost" size="sm">
|
|
32
|
-
Cancel
|
|
33
|
-
</Button>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Guidelines
|
|
37
|
-
|
|
38
|
-
- Use `primary` for main actions (submit, save, confirm).
|
|
39
|
-
- Use `secondary` for less prominent actions.
|
|
40
|
-
- Use `ghost` for tertiary/cancel actions.
|
|
41
|
-
- Use `danger` for destructive actions (delete, remove).
|
|
42
|
-
- Use `success` sparingly for positive confirmations.
|
|
43
|
-
- Always use `loading` prop instead of manually disabling + adding spinner.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Card Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Card } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ----------- | ------------- | -------- | ---------------------- |
|
|
13
|
-
| `as` | `ElementType` | `"div"` | HTML element to render |
|
|
14
|
-
| `children` | `ReactNode` | required | Card content |
|
|
15
|
-
| `className` | `string` | — | Additional classes |
|
|
16
|
-
|
|
17
|
-
Plus all standard HTML attributes for the rendered element.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<Card>
|
|
23
|
-
<Text variant="h4">Card Title</Text>
|
|
24
|
-
<Text>Card content goes here.</Text>
|
|
25
|
-
</Card>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Styling
|
|
29
|
-
|
|
30
|
-
Card provides:
|
|
31
|
-
|
|
32
|
-
- Background: `var(--card-bg)`
|
|
33
|
-
- Border: `var(--border-width) solid var(--card-border)`
|
|
34
|
-
- Shadow: `var(--shadow-hard)`
|
|
35
|
-
- Padding: Inherited from component (add your own)
|
|
36
|
-
|
|
37
|
-
## Guidelines
|
|
38
|
-
|
|
39
|
-
- Card is a generic container—use it to group related content.
|
|
40
|
-
- Cards do not have built-in padding; add your own with Layout components or SCSS.
|
|
41
|
-
- Use `as="article"` or `as="section"` for semantic HTML when appropriate.
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Chart Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Chart } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| --------------- | ---------------------------- | ----------- | ----------------------------------- |
|
|
13
|
-
| `data` | `T[]` | required | Data array |
|
|
14
|
-
| `x` | `(d: T) => string \| number` | required | Accessor function for X-axis values |
|
|
15
|
-
| `y` | `(d: T) => number` | required | Accessor function for Y-axis values |
|
|
16
|
-
| `type` | `"line" \| "area" \| "bar"` | — | Chart type (shorthand API) |
|
|
17
|
-
| `title` | `string \| ReactNode` | — | Chart title |
|
|
18
|
-
| `subtitle` | `string` | — | Chart subtitle |
|
|
19
|
-
| `withLegend` | `boolean` | — | Show legend |
|
|
20
|
-
| `withFrame` | `boolean` | `true` | Render card frame around chart |
|
|
21
|
-
| `variant` | `"default" \| "solid"` | `"default"` | Visual variant |
|
|
22
|
-
| `flat` | `boolean` | `false` | Remove shadow |
|
|
23
|
-
| `d3Config` | `ChartConfig` | — | D3 configuration options |
|
|
24
|
-
| `render` | `(ctx: DrawContext) => void` | — | Custom D3 render function |
|
|
25
|
-
| `renderTooltip` | `(data: T) => ReactNode` | — | Custom tooltip renderer |
|
|
26
|
-
| `onValueChange` | `(data: T \| null) => void` | — | Callback when hovered value changes |
|
|
27
|
-
| `style` | `CSSProperties` | — | Inline styles |
|
|
28
|
-
| `className` | `string` | — | CSS class name |
|
|
29
|
-
|
|
30
|
-
## D3 Config
|
|
31
|
-
|
|
32
|
-
```tsx
|
|
33
|
-
const d3Config = {
|
|
34
|
-
margin: { top: 20, right: 20, bottom: 40, left: 50 },
|
|
35
|
-
grid: true,
|
|
36
|
-
withGradient: true,
|
|
37
|
-
showDots: true,
|
|
38
|
-
hideYAxisDomain: true,
|
|
39
|
-
xAxisLabel: "Month",
|
|
40
|
-
yAxisLabel: "Revenue (USD)",
|
|
41
|
-
curve: d3Shape.curveMonotoneX, // requires import from d3-shape
|
|
42
|
-
animate: true,
|
|
43
|
-
};
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Usage
|
|
47
|
-
|
|
48
|
-
### Shorthand API
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
const data = [
|
|
52
|
-
{ month: "Jan", revenue: 4500 },
|
|
53
|
-
{ month: "Feb", revenue: 5200 },
|
|
54
|
-
{ month: "Mar", revenue: 4900 },
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
<Chart
|
|
58
|
-
type="area"
|
|
59
|
-
data={data}
|
|
60
|
-
x={(d) => d.month}
|
|
61
|
-
y={(d) => d.revenue}
|
|
62
|
-
title="Monthly Revenue"
|
|
63
|
-
withLegend
|
|
64
|
-
d3Config={{ grid: true, withGradient: true }}
|
|
65
|
-
/>;
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Composition API
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
<Chart.Root
|
|
72
|
-
data={data}
|
|
73
|
-
x={(d) => d.label}
|
|
74
|
-
y={(d) => d.value}
|
|
75
|
-
d3Config={{ grid: true, showDots: true }}
|
|
76
|
-
>
|
|
77
|
-
<Chart.Header title="Sales" subtitle="Last 12 months">
|
|
78
|
-
<Chart.Legend />
|
|
79
|
-
</Chart.Header>
|
|
80
|
-
<Chart.Plot type="area" color="var(--primary)" />
|
|
81
|
-
<Chart.Footer>Custom footer content</Chart.Footer>
|
|
82
|
-
</Chart.Root>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Custom D3 Render
|
|
86
|
-
|
|
87
|
-
```tsx
|
|
88
|
-
<Chart
|
|
89
|
-
data={pieData}
|
|
90
|
-
x={(d) => d.label}
|
|
91
|
-
y={(d) => d.value}
|
|
92
|
-
d3Config={{ showAxes: false, grid: false }}
|
|
93
|
-
render={(ctx) => {
|
|
94
|
-
// Full D3 access via ctx.g (SVG group)
|
|
95
|
-
// ctx.data, ctx.xScale, ctx.yScale available
|
|
96
|
-
}}
|
|
97
|
-
/>
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Guidelines
|
|
101
|
-
|
|
102
|
-
- Use shorthand API for simple line/area/bar charts.
|
|
103
|
-
- Use composition API for custom layouts with headers/footers.
|
|
104
|
-
- Use `render` prop for fully custom D3 visualizations (pie, treemap, etc.).
|
|
105
|
-
- Built on D3.js with full access to scales and selections.
|
|
106
|
-
- Supports touch interactions and responsive sizing.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Checkbox Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Checkbox } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ---------------- | ------------- | ------- | -------------------------- |
|
|
13
|
-
| `label` | `string` | — | Label text |
|
|
14
|
-
| `error` | `boolean` | — | Error state |
|
|
15
|
-
| `checked` | `boolean` | — | Controlled checked state |
|
|
16
|
-
| `defaultChecked` | `boolean` | — | Uncontrolled initial state |
|
|
17
|
-
| `disabled` | `boolean` | — | Disabled state |
|
|
18
|
-
| `onChange` | `(e) => void` | — | Change handler |
|
|
19
|
-
|
|
20
|
-
Plus all standard `<input type="checkbox">` attributes.
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
<Checkbox label="I agree to the terms" />
|
|
26
|
-
|
|
27
|
-
<Checkbox
|
|
28
|
-
label="Subscribe to newsletter"
|
|
29
|
-
checked={subscribed}
|
|
30
|
-
onChange={(e) => setSubscribed(e.target.checked)}
|
|
31
|
-
/>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Guidelines
|
|
35
|
-
|
|
36
|
-
- Use `label` prop for accessibility (auto-binds label to input).
|
|
37
|
-
- Use for binary choices or multi-select lists.
|
|
38
|
-
- Use `RadioGroup` for single-select from multiple options.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Chip Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Chip } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ----------- | ------------------------------------------------------------- | ----------- | --------------------------------- |
|
|
13
|
-
| `variant` | `"default" \| "primary" \| "success" \| "warning" \| "error"` | `"default"` | Visual style |
|
|
14
|
-
| `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | Chip size |
|
|
15
|
-
| `onDismiss` | `() => void` | — | Shows X button, called on dismiss |
|
|
16
|
-
| `onClick` | `() => void` | — | Makes chip clickable |
|
|
17
|
-
| `disabled` | `boolean` | `false` | Disabled state |
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<Chip>Default</Chip>
|
|
23
|
-
|
|
24
|
-
<Chip variant="primary" onDismiss={() => removeFilter()}>
|
|
25
|
-
Filter: Active
|
|
26
|
-
</Chip>
|
|
27
|
-
|
|
28
|
-
<Chip onClick={() => toggleTag()}>Clickable Tag</Chip>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Guidelines
|
|
32
|
-
|
|
33
|
-
- Use for tags, filters, or selectable items.
|
|
34
|
-
- `onDismiss` adds a dismiss button (X) on the right.
|
|
35
|
-
- `onClick` makes the entire chip interactive.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Combobox Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Combobox } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ------------- | ------------------------------------ | ------------- | --------------------------------- |
|
|
13
|
-
| `options` | `{ value: string, label: string }[]` | required | Available options |
|
|
14
|
-
| `value` | `string \| string[]` | — | Selected value(s) |
|
|
15
|
-
| `onChange` | `(value) => void` | required | Change handler |
|
|
16
|
-
| `placeholder` | `string` | `"Select..."` | Placeholder text |
|
|
17
|
-
| `multiple` | `boolean` | `false` | Allow multiple selection |
|
|
18
|
-
| `searchable` | `boolean` | `true` | Enable search/filter |
|
|
19
|
-
| `size` | `"sm" \| "md"` | `"md"` | Trigger size |
|
|
20
|
-
| `disabled` | `boolean` | `false` | Disabled state |
|
|
21
|
-
| `inline` | `boolean` | `false` | Render dropdown only (no trigger) |
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
<Combobox
|
|
27
|
-
options={[
|
|
28
|
-
{ value: "red", label: "Red" },
|
|
29
|
-
{ value: "blue", label: "Blue" },
|
|
30
|
-
]}
|
|
31
|
-
value={color}
|
|
32
|
-
onChange={setColor}
|
|
33
|
-
placeholder="Select color"
|
|
34
|
-
/>
|
|
35
|
-
|
|
36
|
-
// Multi-select
|
|
37
|
-
<Combobox
|
|
38
|
-
multiple
|
|
39
|
-
options={tags}
|
|
40
|
-
value={selectedTags}
|
|
41
|
-
onChange={setSelectedTags}
|
|
42
|
-
/>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Guidelines
|
|
46
|
-
|
|
47
|
-
- Use for large option lists (virtualized for performance).
|
|
48
|
-
- Use `multiple` for tag/filter selection.
|
|
49
|
-
- Press Enter in search to select all filtered results (multi-select).
|
|
50
|
-
- "All" option automatically manages select/deselect all.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# CopyButton Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { CopyButton } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ------------ | -------------- | ------------- | ------------------------ |
|
|
13
|
-
| `value` | `string` | **required** | Text to copy |
|
|
14
|
-
| `variant` | Button variant | `"secondary"` | Visual style |
|
|
15
|
-
| `size` | Button size | `"md"` | Button size |
|
|
16
|
-
| `copiedText` | `string` | `"Copied!"` | Text shown after copy |
|
|
17
|
-
| `resetDelay` | `number` | `2000` | Ms before reset to orig. |
|
|
18
|
-
|
|
19
|
-
Plus all standard `<button>` HTML attributes.
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
<CopyButton value={textToCopy}>Copy</CopyButton>
|
|
25
|
-
|
|
26
|
-
<CopyButton value={code} variant="ghost" size="sm">
|
|
27
|
-
Copy Code
|
|
28
|
-
</CopyButton>
|
|
29
|
-
|
|
30
|
-
<CopyButton copiedText="Done!" value={referenceDoc}>
|
|
31
|
-
Copy Reference
|
|
32
|
-
</CopyButton>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Behavior
|
|
36
|
-
|
|
37
|
-
- **Tactile Pop Animation**: Press effect on click, springy scale-in for success state
|
|
38
|
-
- Text changes to `copiedText` (default: "Copied!")
|
|
39
|
-
- Button width preserved (doesn't jump)
|
|
40
|
-
- Auto-resets after `resetDelay` ms (default 2s)
|
|
41
|
-
- Variant stays the same (no jarring color change)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Drawer Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Drawer } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ---------- | ---------------------- | ----------- | ------------------- |
|
|
13
|
-
| `isOpen` | `boolean` | required | Controls visibility |
|
|
14
|
-
| `onClose` | `() => void` | required | Close callback |
|
|
15
|
-
| `title` | `ReactNode` | — | Header title |
|
|
16
|
-
| `side` | `"left" \| "right"` | `"right"` | Slide direction |
|
|
17
|
-
| `children` | `ReactNode` | required | Drawer content |
|
|
18
|
-
| `footer` | `ReactNode` | — | Footer content |
|
|
19
|
-
| `variant` | `"default" \| "solid"` | `"default"` | Visual style |
|
|
20
|
-
|
|
21
|
-
## Usage Patterns
|
|
22
|
-
|
|
23
|
-
### Shorthand API (simple drawers)
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
<Drawer
|
|
27
|
-
isOpen={isOpen}
|
|
28
|
-
onClose={() => setIsOpen(false)}
|
|
29
|
-
title="Settings"
|
|
30
|
-
footer={<Button onClick={save}>Save</Button>}
|
|
31
|
-
>
|
|
32
|
-
<Stack gap={4}>{/* Settings form */}</Stack>
|
|
33
|
-
</Drawer>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Composition API (custom layouts)
|
|
37
|
-
|
|
38
|
-
```tsx
|
|
39
|
-
<Drawer isOpen={isOpen} onClose={onClose} side="right">
|
|
40
|
-
<Drawer.Header>
|
|
41
|
-
<Text variant="h3">Custom Title</Text>
|
|
42
|
-
</Drawer.Header>
|
|
43
|
-
<Drawer.Body>
|
|
44
|
-
<Stack gap={4}>{/* Custom content */}</Stack>
|
|
45
|
-
</Drawer.Body>
|
|
46
|
-
<Drawer.Footer>
|
|
47
|
-
<Button variant="ghost" onClick={onClose}>
|
|
48
|
-
Cancel
|
|
49
|
-
</Button>
|
|
50
|
-
<Button onClick={handleSave}>Save</Button>
|
|
51
|
-
</Drawer.Footer>
|
|
52
|
-
</Drawer>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Sub-components
|
|
56
|
-
|
|
57
|
-
| Component | Description |
|
|
58
|
-
| --------------- | ------------------------ |
|
|
59
|
-
| `Drawer.Header` | Header with close button |
|
|
60
|
-
| `Drawer.Body` | Scrollable content area |
|
|
61
|
-
| `Drawer.Footer` | Action buttons area |
|
|
62
|
-
|
|
63
|
-
## Guidelines
|
|
64
|
-
|
|
65
|
-
- Use for side panels, settings, or detail views.
|
|
66
|
-
- `side="left"` for navigation drawers, `side="right"` for actions/details.
|
|
67
|
-
- Closes on Escape key and overlay click.
|
|
68
|
-
- Use `variant="solid"` for high-emphasis content.
|
|
69
|
-
- Use composition API when you need custom header content (icons, badges, etc.).
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Dropdown Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Dropdown } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| -------------- | ------------------------------------------ | ----------- | ------------ |
|
|
13
|
-
| `triggerLabel` | `string` | required | Button text |
|
|
14
|
-
| `items` | `{ label: string, onClick: () => void }[]` | required | Menu items |
|
|
15
|
-
| `variant` | `"primary" \| "secondary"` | `"primary"` | Button style |
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
<Dropdown
|
|
21
|
-
triggerLabel="Actions"
|
|
22
|
-
items={[
|
|
23
|
-
{ label: "Edit", onClick: handleEdit },
|
|
24
|
-
{ label: "Delete", onClick: handleDelete },
|
|
25
|
-
]}
|
|
26
|
-
/>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Guidelines
|
|
30
|
-
|
|
31
|
-
- Use for action menus or overflow menus.
|
|
32
|
-
- For split primary/secondary actions, use `SplitButton` instead.
|
|
33
|
-
- Menu closes automatically after item click.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# FileUpload Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { FileUpload } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| -------------- | ------------------------- | ------- | --------------------------------------- |
|
|
13
|
-
| `label` | `string` | — | Upload area label |
|
|
14
|
-
| `helperText` | `string` | — | Helper text |
|
|
15
|
-
| `accept` | `string` | — | Accepted file types (e.g., `"image/*"`) |
|
|
16
|
-
| `maxSize` | `number` | — | Max file size in bytes |
|
|
17
|
-
| `multiple` | `boolean` | `false` | Allow multiple files |
|
|
18
|
-
| `defaultFiles` | `File[]` | `[]` | Initial files |
|
|
19
|
-
| `disabled` | `boolean` | `false` | Disabled state |
|
|
20
|
-
| `error` | `boolean` | `false` | Error state |
|
|
21
|
-
| `errorMessage` | `string` | — | Error message |
|
|
22
|
-
| `required` | `boolean` | `false` | Required field |
|
|
23
|
-
| `showPreview` | `boolean` | `false` | Show image thumbnails |
|
|
24
|
-
| `onChange` | `(files: File[]) => void` | — | Change callback |
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
<FileUpload
|
|
30
|
-
label="Upload Documents"
|
|
31
|
-
accept=".pdf,.doc,.docx"
|
|
32
|
-
maxSize={5 * 1024 * 1024} // 5MB
|
|
33
|
-
multiple
|
|
34
|
-
onChange={setFiles}
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<FileUpload
|
|
38
|
-
label="Profile Photo"
|
|
39
|
-
accept="image/*"
|
|
40
|
-
showPreview
|
|
41
|
-
/>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Guidelines
|
|
45
|
-
|
|
46
|
-
- Supports drag-and-drop and click-to-browse.
|
|
47
|
-
- `showPreview` displays image thumbnails for image files.
|
|
48
|
-
- Files can be removed individually via the X button.
|
|
49
|
-
- File size validation with clear error messages.
|