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,46 +0,0 @@
|
|
|
1
|
-
# Textarea Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Textarea } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ------------ | --------- | ------- | ----------------------------------- |
|
|
13
|
-
| `label` | `string` | — | Label text |
|
|
14
|
-
| `error` | `string` | — | Error message |
|
|
15
|
-
| `helperText` | `string` | — | Helper text below textarea |
|
|
16
|
-
| `showCount` | `boolean` | — | Show character count |
|
|
17
|
-
| `maxLength` | `number` | — | Max characters (auto-enables count) |
|
|
18
|
-
|
|
19
|
-
Plus all standard `<textarea>` attributes.
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
<Textarea
|
|
25
|
-
label="Description"
|
|
26
|
-
placeholder="Enter description..."
|
|
27
|
-
rows={4}
|
|
28
|
-
/>
|
|
29
|
-
|
|
30
|
-
<Textarea
|
|
31
|
-
label="Bio"
|
|
32
|
-
maxLength={500}
|
|
33
|
-
helperText="Brief description of yourself"
|
|
34
|
-
/>
|
|
35
|
-
|
|
36
|
-
<Textarea
|
|
37
|
-
label="Notes"
|
|
38
|
-
error="This field is required"
|
|
39
|
-
/>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Guidelines
|
|
43
|
-
|
|
44
|
-
- Same API pattern as `Input` component.
|
|
45
|
-
- Use `maxLength` for character limits (auto-shows counter).
|
|
46
|
-
- Use `rows` to control initial height.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Toast Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { ToastProvider, useToast } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Setup
|
|
10
|
-
|
|
11
|
-
Wrap your app with `ToastProvider`:
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
<ToastProvider>
|
|
15
|
-
<App />
|
|
16
|
-
</ToastProvider>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Hook
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
const { toast, toastSuccess, toastError, toastWarning, toastInfo } = useToast();
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
function MyComponent() {
|
|
29
|
-
const { toastSuccess, toastError } = useToast();
|
|
30
|
-
|
|
31
|
-
const handleSave = async () => {
|
|
32
|
-
try {
|
|
33
|
-
await save();
|
|
34
|
-
toastSuccess("Changes saved!");
|
|
35
|
-
} catch (error) {
|
|
36
|
-
toastError("Failed to save changes");
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return <Button onClick={handleSave}>Save</Button>;
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Methods
|
|
45
|
-
|
|
46
|
-
| Method | Description |
|
|
47
|
-
| ----------------------- | -------------------------------- |
|
|
48
|
-
| `toast(message, type?)` | Generic toast with optional type |
|
|
49
|
-
| `toastSuccess(message)` | Green success toast |
|
|
50
|
-
| `toastError(message)` | Red error toast |
|
|
51
|
-
| `toastWarning(message)` | Yellow warning toast |
|
|
52
|
-
| `toastInfo(message)` | Blue info toast |
|
|
53
|
-
|
|
54
|
-
## Guidelines
|
|
55
|
-
|
|
56
|
-
- Auto-dismisses after 5 seconds.
|
|
57
|
-
- Can be manually dismissed via X button.
|
|
58
|
-
- Toasts stack from bottom-right.
|
|
59
|
-
- Use for non-blocking notifications.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Tooltip Component
|
|
2
|
-
|
|
3
|
-
## Import
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import { Tooltip } from "doom-design-system";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
| ----------- | ------------------- | -------- | ---------------- |
|
|
13
|
-
| `content` | `string` | required | Tooltip text |
|
|
14
|
-
| `children` | `ReactNode` | required | Trigger element |
|
|
15
|
-
| `delay` | `number` | `200` | Show delay in ms |
|
|
16
|
-
| `placement` | `"top" \| "bottom"` | `"top"` | Position |
|
|
17
|
-
|
|
18
|
-
## Usage
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
<Tooltip content="Save your changes">
|
|
22
|
-
<Button>Save</Button>
|
|
23
|
-
</Tooltip>
|
|
24
|
-
|
|
25
|
-
<Tooltip content="This action cannot be undone" placement="bottom">
|
|
26
|
-
<Button variant="danger">Delete</Button>
|
|
27
|
-
</Tooltip>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Guidelines
|
|
31
|
-
|
|
32
|
-
- Use for brief explanatory text on hover/focus.
|
|
33
|
-
- Keep content short (1 sentence max).
|
|
34
|
-
- Shows on hover and focus for accessibility.
|
|
35
|
-
- Use `delay` to prevent tooltip flicker on quick hovers.
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
# Doom Design System Skills
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
Wrap your app with `DesignSystemProvider`:
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
import { DesignSystemProvider } from "doom-design-system";
|
|
9
|
-
|
|
10
|
-
export default function RootLayout({ children }) {
|
|
11
|
-
return (
|
|
12
|
-
<html lang="en">
|
|
13
|
-
<DesignSystemProvider
|
|
14
|
-
initialTheme="default"
|
|
15
|
-
withBody
|
|
16
|
-
fontClassName={font.className}
|
|
17
|
-
>
|
|
18
|
-
{children}
|
|
19
|
-
</DesignSystemProvider>
|
|
20
|
-
</html>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Props
|
|
26
|
-
|
|
27
|
-
| Prop | Type | Default | Description |
|
|
28
|
-
| --------------- | ------------------------------------------------- | ----------- | ----------------------------------- |
|
|
29
|
-
| `initialTheme` | `"default" \| "doom" \| "captain" \| "vigilante"` | `"default"` | Theme to apply |
|
|
30
|
-
| `withBody` | `boolean` | `false` | Render as `<body>` element |
|
|
31
|
-
| `fontClassName` | `string` | `""` | Font class (e.g., from `next/font`) |
|
|
32
|
-
| `className` | `string` | `""` | Additional classes |
|
|
33
|
-
|
|
34
|
-
## Core Principles
|
|
35
|
-
|
|
36
|
-
1. **Neubrutalist aesthetic**: Bold 2px borders, hard shadows, high contrast.
|
|
37
|
-
2. **CSS Variables**: All colors/spacing via CSS variables—never hardcode hex values.
|
|
38
|
-
3. **Server Components ready**: Use `'use client'` only where needed.
|
|
39
|
-
4. **Accessibility**: WCAG 2.1 AAA color contrast target.
|
|
40
|
-
|
|
41
|
-
## Themes
|
|
42
|
-
|
|
43
|
-
| Key | Name | Primary Color |
|
|
44
|
-
| ----------- | ----------- | ------------------ |
|
|
45
|
-
| `default` | Default | Purple |
|
|
46
|
-
| `doom` | DOOMSDAY | Green (dark mode) |
|
|
47
|
-
| `captain` | THE CAPTAIN | Blue |
|
|
48
|
-
| `vigilante` | DARK KNIGHT | Yellow (dark mode) |
|
|
49
|
-
|
|
50
|
-
## Import Pattern
|
|
51
|
-
|
|
52
|
-
```tsx
|
|
53
|
-
import { Button, Card, Text, Modal } from "doom-design-system";
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
All components are tree-shakeable.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Hooks
|
|
61
|
-
|
|
62
|
-
### useTheme
|
|
63
|
-
|
|
64
|
-
Access and change the current theme programmatically.
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
import { useTheme } from "doom-design-system";
|
|
68
|
-
|
|
69
|
-
function ThemeSwitcher() {
|
|
70
|
-
const { theme, setTheme, availableThemes } = useTheme();
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<Select
|
|
74
|
-
value={theme}
|
|
75
|
-
onChange={(e) => setTheme(e.target.value)}
|
|
76
|
-
options={Object.keys(availableThemes).map((key) => ({
|
|
77
|
-
value: key,
|
|
78
|
-
label: availableThemes[key].name,
|
|
79
|
-
}))}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
| Return Value | Type | Description |
|
|
86
|
-
| ----------------- | ------------------------------- | ----------------- |
|
|
87
|
-
| `theme` | `ThemeKey` | Current theme key |
|
|
88
|
-
| `setTheme` | `(theme: ThemeKey) => void` | Change theme |
|
|
89
|
-
| `availableThemes` | `Record<ThemeKey, ThemeConfig>` | All theme configs |
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Styles
|
|
94
|
-
|
|
95
|
-
- [aesthetic.md](styles/aesthetic.md) — **READ FIRST!** Visual philosophy and design principles
|
|
96
|
-
- [tokens.md](styles/tokens.md) — Design tokens (palette, typography, spacing, z-index, motion)
|
|
97
|
-
- [css-variables.md](styles/css-variables.md) — Theme-aware CSS custom properties
|
|
98
|
-
- [mixins.md](styles/mixins.md) — SCSS mixins for interactivity, theming, shadows
|
|
99
|
-
- [utilities.md](styles/utilities.md) — Utility classes for layout, spacing, typography
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Components
|
|
104
|
-
|
|
105
|
-
### Layout
|
|
106
|
-
|
|
107
|
-
- [layout.md](components/layout.md) — Flex, Stack, Grid, Container, Switcher
|
|
108
|
-
- [page.md](components/page.md) — Page container
|
|
109
|
-
|
|
110
|
-
### Navigation
|
|
111
|
-
|
|
112
|
-
- [breadcrumbs.md](components/breadcrumbs.md) — Navigation hierarchy
|
|
113
|
-
- [link.md](components/link.md) — Anchor links
|
|
114
|
-
- [pagination.md](components/pagination.md) — Page navigation
|
|
115
|
-
- [sidebar.md](components/sidebar.md) — Multi-mode side navigation
|
|
116
|
-
- [tabs.md](components/tabs.md) — Tab navigation
|
|
117
|
-
|
|
118
|
-
### Forms
|
|
119
|
-
|
|
120
|
-
- [button.md](components/button.md) — Buttons
|
|
121
|
-
- [checkbox.md](components/checkbox.md) — Checkboxes
|
|
122
|
-
- [combobox.md](components/combobox.md) — Searchable dropdown
|
|
123
|
-
- [fileupload.md](components/fileupload.md) — File input with drag-drop
|
|
124
|
-
- [form.md](components/form.md) — Form containers
|
|
125
|
-
- [input.md](components/input.md) — Text inputs
|
|
126
|
-
- [label.md](components/label.md) — Form labels
|
|
127
|
-
- [radiogroup.md](components/radiogroup.md) — Radio buttons
|
|
128
|
-
- [select.md](components/select.md) — Dropdown select
|
|
129
|
-
- [slider.md](components/slider.md) — Range inputs
|
|
130
|
-
- [switch.md](components/switch.md) — Toggle switches
|
|
131
|
-
- [textarea.md](components/textarea.md) — Multi-line inputs
|
|
132
|
-
|
|
133
|
-
### Data Display
|
|
134
|
-
|
|
135
|
-
- [avatar.md](components/avatar.md) — User avatars
|
|
136
|
-
- [badge.md](components/badge.md) — Status indicators
|
|
137
|
-
- [card.md](components/card.md) — Content containers
|
|
138
|
-
- [chart.md](components/chart.md) — Data visualization (D3.js)
|
|
139
|
-
- [chip.md](components/chip.md) — Tags and filters
|
|
140
|
-
- [image.md](components/image.md) — Enhanced images
|
|
141
|
-
- [progressbar.md](components/progressbar.md) — Progress indicators
|
|
142
|
-
- [skeleton.md](components/skeleton.md) — Loading placeholders
|
|
143
|
-
- [slat.md](components/slat.md) — List items
|
|
144
|
-
- [table.md](components/table.md) — Data tables (TanStack)
|
|
145
|
-
- [text.md](components/text.md) — Typography
|
|
146
|
-
|
|
147
|
-
### Feedback
|
|
148
|
-
|
|
149
|
-
- [alert.md](components/alert.md) — Status messages
|
|
150
|
-
- [spinner.md](components/spinner.md) — Loading spinners
|
|
151
|
-
- [toast.md](components/toast.md) — Notification toasts
|
|
152
|
-
- [tooltip.md](components/tooltip.md) — Hover tooltips
|
|
153
|
-
|
|
154
|
-
### Overlays
|
|
155
|
-
|
|
156
|
-
- [drawer.md](components/drawer.md) — Side panels
|
|
157
|
-
- [dropdown.md](components/dropdown.md) — Action menus
|
|
158
|
-
- [modal.md](components/modal.md) — Dialog overlays
|
|
159
|
-
- [popover.md](components/popover.md) — Positioned overlays
|
|
160
|
-
- [sheet.md](components/sheet.md) — Bottom sheets
|
|
161
|
-
|
|
162
|
-
### Other
|
|
163
|
-
|
|
164
|
-
- [accordion.md](components/accordion.md) — Expandable content
|
|
165
|
-
- [actionrow.md](components/actionrow.md) — Settings/navigation rows
|
|
166
|
-
- [icon.md](components/icon.md) — Lucide icons
|
|
167
|
-
- [splitbutton.md](components/splitbutton.md) — Split action buttons
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
# Aesthetic Guide
|
|
2
|
-
|
|
3
|
-
This guide defines the visual principles of the Doom Design System.
|
|
4
|
-
|
|
5
|
-
## Core Style: Neubrutalism
|
|
6
|
-
|
|
7
|
-
- **Bold borders** — 2px solid, always
|
|
8
|
-
- **Hard shadows** — No blur, offset only
|
|
9
|
-
- **High contrast** — Meets WCAG AAA
|
|
10
|
-
- **Geometric** — 4px border-radius, clean lines
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Rules
|
|
15
|
-
|
|
16
|
-
### 1. Borders
|
|
17
|
-
|
|
18
|
-
Every interactive element has a 2px solid border.
|
|
19
|
-
|
|
20
|
-
```scss
|
|
21
|
-
// ✅ Correct
|
|
22
|
-
border: var(--border-width) solid var(--card-border);
|
|
23
|
-
|
|
24
|
-
// ❌ Wrong
|
|
25
|
-
border: 1px solid #ccc;
|
|
26
|
-
border: none;
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 2. Shadows
|
|
30
|
-
|
|
31
|
-
Hard offset shadows only. No blur.
|
|
32
|
-
|
|
33
|
-
```scss
|
|
34
|
-
// ✅ Correct
|
|
35
|
-
box-shadow: var(--shadow-hard);
|
|
36
|
-
|
|
37
|
-
// ❌ Wrong
|
|
38
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 3. Hover States
|
|
42
|
-
|
|
43
|
-
Elements lift on hover. Shadow compensates.
|
|
44
|
-
|
|
45
|
-
```scss
|
|
46
|
-
// ✅ Correct
|
|
47
|
-
&:hover {
|
|
48
|
-
transform: translate(-2px, -2px);
|
|
49
|
-
box-shadow: var(--shadow-hover);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ❌ Wrong
|
|
53
|
-
&:hover {
|
|
54
|
-
opacity: 0.8;
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### 4. Colors
|
|
59
|
-
|
|
60
|
-
Use CSS variables. Never hardcode hex values.
|
|
61
|
-
|
|
62
|
-
```tsx
|
|
63
|
-
// ✅ Correct
|
|
64
|
-
style={{ background: "var(--card-bg)" }}
|
|
65
|
-
|
|
66
|
-
// ❌ Wrong
|
|
67
|
-
style={{ background: "#ffffff" }}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### 5. Typography
|
|
71
|
-
|
|
72
|
-
Headings are bold and uppercase.
|
|
73
|
-
|
|
74
|
-
```scss
|
|
75
|
-
font-family: var(--font-heading);
|
|
76
|
-
font-weight: var(--heading-weight); // 800
|
|
77
|
-
text-transform: var(--heading-transform); // uppercase
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Color Usage
|
|
83
|
-
|
|
84
|
-
| Purpose | Variable |
|
|
85
|
-
| --------------- | ----------- |
|
|
86
|
-
| Primary actions | `--primary` |
|
|
87
|
-
| Success | `--success` |
|
|
88
|
-
| Errors | `--error` |
|
|
89
|
-
| Warnings | `--warning` |
|
|
90
|
-
| Muted text | `--muted` |
|
|
91
|
-
|
|
92
|
-
Use color sparingly. Most UI should be black/white/gray with one accent.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Spacing
|
|
97
|
-
|
|
98
|
-
Use the scale via layout components:
|
|
99
|
-
|
|
100
|
-
```tsx
|
|
101
|
-
// ✅ Correct
|
|
102
|
-
<Stack gap={4}>...</Stack>
|
|
103
|
-
|
|
104
|
-
// ❌ Wrong
|
|
105
|
-
<div style={{ marginBottom: "16px" }}>...</div>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
| Token | Size |
|
|
109
|
-
| -------------- | ------- |
|
|
110
|
-
| `--spacing-xs` | 0.25rem |
|
|
111
|
-
| `--spacing-sm` | 0.5rem |
|
|
112
|
-
| `--spacing-md` | 1rem |
|
|
113
|
-
| `--spacing-lg` | 1.5rem |
|
|
114
|
-
| `--spacing-xl` | 2rem |
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Animation
|
|
119
|
-
|
|
120
|
-
Keep it fast: 150-250ms. Use `transform` for motion.
|
|
121
|
-
|
|
122
|
-
```scss
|
|
123
|
-
transition: all var(--duration-fast) var(--ease-in-out);
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Avoid
|
|
129
|
-
|
|
130
|
-
- Rounded pills (except badges/chips)
|
|
131
|
-
- Gradients
|
|
132
|
-
- Soft shadows
|
|
133
|
-
- Thin fonts (< 400 weight)
|
|
134
|
-
- Icon-only buttons without labels
|
|
135
|
-
- Custom styles that bypass tokens
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Template
|
|
140
|
-
|
|
141
|
-
```scss
|
|
142
|
-
@use "styles/mixins" as m;
|
|
143
|
-
|
|
144
|
-
.component {
|
|
145
|
-
@include m.base-interactive; // border, shadow, transition
|
|
146
|
-
background: var(--card-bg);
|
|
147
|
-
|
|
148
|
-
@include m.brutalist-hover; // lift + shadow grow
|
|
149
|
-
@include m.focus; // focus-visible ring
|
|
150
|
-
}
|
|
151
|
-
```
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# CSS Variables
|
|
2
|
-
|
|
3
|
-
Theme-aware CSS variables defined in `styles/themes/definitions.ts`.
|
|
4
|
-
|
|
5
|
-
## Color Variables
|
|
6
|
-
|
|
7
|
-
| Variable | Description |
|
|
8
|
-
| ------------------------ | ------------------------- |
|
|
9
|
-
| `--primary` | Brand/action color |
|
|
10
|
-
| `--primary-foreground` | Text on primary |
|
|
11
|
-
| `--primary-hover` | Hover state for primary |
|
|
12
|
-
| `--secondary` | Secondary actions |
|
|
13
|
-
| `--secondary-foreground` | Text on secondary |
|
|
14
|
-
| `--background` | Page background |
|
|
15
|
-
| `--foreground` | Default text color |
|
|
16
|
-
| `--card-bg` | Card/component background |
|
|
17
|
-
| `--card-border` | Card border color |
|
|
18
|
-
| `--border-strong` | Strong/emphasized borders |
|
|
19
|
-
| `--muted` | Muted/disabled elements |
|
|
20
|
-
| `--muted-foreground` | Muted text |
|
|
21
|
-
| `--success` | Success state |
|
|
22
|
-
| `--success-foreground` | Text on success |
|
|
23
|
-
| `--error` | Error state |
|
|
24
|
-
| `--error-foreground` | Text on error |
|
|
25
|
-
| `--warning` | Warning state |
|
|
26
|
-
| `--warning-foreground` | Text on warning |
|
|
27
|
-
| `--accent` | Accent color |
|
|
28
|
-
|
|
29
|
-
## Surface Variables
|
|
30
|
-
|
|
31
|
-
| Variable | Description |
|
|
32
|
-
| ---------------------------- | ----------------------- |
|
|
33
|
-
| `--surface-brand` | Branded surface bg |
|
|
34
|
-
| `--surface-brand-foreground` | Text on branded surface |
|
|
35
|
-
| `--surface-accent` | Accent surface bg |
|
|
36
|
-
| `--on-surface` | Text on any surface |
|
|
37
|
-
| `--on-surface-muted` | Muted text on surface |
|
|
38
|
-
|
|
39
|
-
## Shadow Variables
|
|
40
|
-
|
|
41
|
-
| Variable | Description |
|
|
42
|
-
| ------------------ | --------------------------- |
|
|
43
|
-
| `--shadow-base` | Base shadow color |
|
|
44
|
-
| `--shadow-primary` | Shadow for primary elements |
|
|
45
|
-
| `--shadow-error` | Shadow for error states |
|
|
46
|
-
| `--shadow-hard` | Standard hard shadow |
|
|
47
|
-
| `--shadow-hover` | Hover state shadow |
|
|
48
|
-
| `--shadow-sm` | Small shadow |
|
|
49
|
-
| `--shadow-lg` | Large shadow |
|
|
50
|
-
|
|
51
|
-
## Solid Variant Tokens
|
|
52
|
-
|
|
53
|
-
Used by `variant="solid"` on Modal, Sheet, Drawer, etc.
|
|
54
|
-
|
|
55
|
-
| Variable | Description |
|
|
56
|
-
| ------------ | ------------------------ |
|
|
57
|
-
| `--solid-bg` | Solid variant background |
|
|
58
|
-
| `--solid-fg` | Solid variant text |
|
|
59
|
-
|
|
60
|
-
## Theme Values
|
|
61
|
-
|
|
62
|
-
| Theme | `--primary` | `--background` | Mode |
|
|
63
|
-
| ----------- | ----------- | -------------- | ----- |
|
|
64
|
-
| `default` | Purple 500 | Indigo 100 | Light |
|
|
65
|
-
| `doom` | Green 600 | Slate 950 | Dark |
|
|
66
|
-
| `captain` | Blue 500 | Slate 50 | Light |
|
|
67
|
-
| `vigilante` | Yellow 600 | Gray 950 | Dark |
|
|
68
|
-
|
|
69
|
-
## Usage in SCSS
|
|
70
|
-
|
|
71
|
-
```scss
|
|
72
|
-
.myComponent {
|
|
73
|
-
background: var(--card-bg);
|
|
74
|
-
border: var(--border-width) solid var(--card-border);
|
|
75
|
-
color: var(--foreground);
|
|
76
|
-
box-shadow: var(--shadow-hard);
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Never hardcode hex values**—always use CSS variables for theme compatibility.
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# SCSS Mixins
|
|
2
|
-
|
|
3
|
-
Available in `styles/_mixins.scss`. Import with `@use "../../styles/mixins" as m;`.
|
|
4
|
-
|
|
5
|
-
## Interactive Element Mixins
|
|
6
|
-
|
|
7
|
-
### `base-interactive`
|
|
8
|
-
|
|
9
|
-
Base styles for clickable elements (border, shadow, transition).
|
|
10
|
-
|
|
11
|
-
```scss
|
|
12
|
-
.myButton {
|
|
13
|
-
@include m.base-interactive;
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### `focus`
|
|
18
|
-
|
|
19
|
-
Focus states with keyboard navigation support (`focus-visible`).
|
|
20
|
-
|
|
21
|
-
```scss
|
|
22
|
-
.myInput {
|
|
23
|
-
@include m.focus;
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### `error`
|
|
28
|
-
|
|
29
|
-
Error state styling (red border + error shadow).
|
|
30
|
-
|
|
31
|
-
```scss
|
|
32
|
-
.myInput {
|
|
33
|
-
&.hasError {
|
|
34
|
-
@include m.error;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### `brutalist-hover($lift, $shadow-color)`
|
|
40
|
-
|
|
41
|
-
Hover effect with lift and shadow grow.
|
|
42
|
-
|
|
43
|
-
```scss
|
|
44
|
-
.myCard {
|
|
45
|
-
@include m.brutalist-hover(2px, var(--shadow-base));
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### `disabled-state`
|
|
50
|
-
|
|
51
|
-
Disabled styling with hatched pattern overlay.
|
|
52
|
-
|
|
53
|
-
```scss
|
|
54
|
-
.myButton:disabled {
|
|
55
|
-
@include m.disabled-state;
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Theme Mixins
|
|
60
|
-
|
|
61
|
-
### `invert-theme`
|
|
62
|
-
|
|
63
|
-
Inverts theme for content on primary-colored backgrounds.
|
|
64
|
-
|
|
65
|
-
### `solid-variant`
|
|
66
|
-
|
|
67
|
-
Applies solid variant styling (used by Modal, Sheet, Drawer with `variant="solid"`).
|
|
68
|
-
|
|
69
|
-
## Shadow Mixins
|
|
70
|
-
|
|
71
|
-
### `brutalist-shadow($direction, $size, $color)`
|
|
72
|
-
|
|
73
|
-
Directional hard shadows.
|
|
74
|
-
|
|
75
|
-
```scss
|
|
76
|
-
.myElement {
|
|
77
|
-
@include m.brutalist-shadow("left", 8px, var(--shadow-base));
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Directions: `standard`, `top`, `bottom`, `left`, `right`
|
|
82
|
-
|
|
83
|
-
## Responsive
|
|
84
|
-
|
|
85
|
-
### `mq($breakpoint, $type)`
|
|
86
|
-
|
|
87
|
-
Media query helper.
|
|
88
|
-
|
|
89
|
-
```scss
|
|
90
|
-
.myElement {
|
|
91
|
-
@include m.mq("md") {
|
|
92
|
-
flex-direction: row;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Breakpoints: `xxs` (360px), `xs` (480px), `sm` (640px), `md` (768px), `lg` (1024px), `xl` (1280px)
|