doom-design-system 0.4.15 → 0.4.17
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/.agent/skills/doom/components/accordion.md +44 -0
- package/.agent/skills/doom/components/actionrow.md +33 -0
- package/.agent/skills/doom/components/alert.md +35 -0
- package/.agent/skills/doom/components/avatar.md +36 -0
- package/.agent/skills/doom/components/badge.md +29 -0
- package/.agent/skills/doom/components/breadcrumbs.md +33 -0
- package/.agent/skills/doom/components/button.md +43 -0
- package/.agent/skills/doom/components/card.md +41 -0
- package/.agent/skills/doom/components/chart.md +71 -0
- package/.agent/skills/doom/components/checkbox.md +38 -0
- package/.agent/skills/doom/components/chip.md +35 -0
- package/.agent/skills/doom/components/combobox.md +50 -0
- package/.agent/skills/doom/components/drawer.md +69 -0
- package/.agent/skills/doom/components/dropdown.md +33 -0
- package/.agent/skills/doom/components/fileupload.md +49 -0
- package/.agent/skills/doom/components/form.md +55 -0
- package/.agent/skills/doom/components/icon.md +47 -0
- package/.agent/skills/doom/components/image.md +48 -0
- package/.agent/skills/doom/components/input.md +54 -0
- package/.agent/skills/doom/components/label.md +32 -0
- package/.agent/skills/doom/components/layout.md +92 -0
- package/.agent/skills/doom/components/link.md +39 -0
- package/.agent/skills/doom/components/modal.md +71 -0
- package/.agent/skills/doom/components/page.md +41 -0
- package/.agent/skills/doom/components/pagination.md +32 -0
- package/.agent/skills/doom/components/popover.md +45 -0
- package/.agent/skills/doom/components/progressbar.md +37 -0
- package/.agent/skills/doom/components/radiogroup.md +45 -0
- package/.agent/skills/doom/components/select.md +43 -0
- package/.agent/skills/doom/components/sheet.md +71 -0
- package/.agent/skills/doom/components/skeleton.md +35 -0
- package/.agent/skills/doom/components/slat.md +46 -0
- package/.agent/skills/doom/components/slider.md +51 -0
- package/.agent/skills/doom/components/spinner.md +34 -0
- package/.agent/skills/doom/components/splitbutton.md +35 -0
- package/.agent/skills/doom/components/switch.md +40 -0
- package/.agent/skills/doom/components/table.md +82 -0
- package/.agent/skills/doom/components/tabs.md +65 -0
- package/.agent/skills/doom/components/text.md +42 -0
- package/.agent/skills/doom/components/textarea.md +46 -0
- package/.agent/skills/doom/components/toast.md +59 -0
- package/.agent/skills/doom/components/tooltip.md +35 -0
- package/.agent/skills/doom/index.md +166 -0
- package/.agent/skills/doom/styles/aesthetic.md +151 -0
- package/.agent/skills/doom/styles/css-variables.md +80 -0
- package/.agent/skills/doom/styles/mixins.md +97 -0
- package/.agent/skills/doom/styles/tokens.md +129 -0
- package/.agent/skills/doom/styles/utilities.md +84 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +4 -3
- package/dist/components/Chart/ChartContext.d.ts +2 -2
- package/dist/components/Chip/Chip.d.ts +12 -0
- package/dist/components/Chip/Chip.js +33 -0
- package/dist/components/Chip/Chip.module.css +113 -0
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/Chip/index.js +1 -0
- package/dist/components/Combobox/Combobox.d.ts +18 -0
- package/dist/components/Combobox/Combobox.js +212 -0
- package/dist/components/Combobox/Combobox.module.css +205 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/Combobox/index.js +1 -0
- package/dist/components/Combobox/useComboboxFilter.d.ts +6 -0
- package/dist/components/Combobox/useComboboxFilter.js +23 -0
- package/dist/components/Drawer/Drawer.d.ts +21 -2
- package/dist/components/Drawer/Drawer.js +24 -2
- package/dist/components/Input/Input.module.css +0 -1
- package/dist/components/Modal/Modal.d.ts +9 -4
- package/dist/components/Modal/Modal.js +10 -4
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +2 -3
- package/dist/components/Select/Select.module.css +16 -9
- package/dist/components/Sheet/Sheet.d.ts +21 -2
- package/dist/components/Sheet/Sheet.js +24 -2
- package/dist/components/Sheet/Sheet.module.css +5 -0
- package/dist/components/Table/FilterBuilder/FilterBuilder.d.ts +20 -0
- package/dist/components/Table/FilterBuilder/FilterBuilder.js +53 -0
- package/dist/components/Table/FilterBuilder/FilterBuilder.module.css +40 -0
- package/dist/components/Table/FilterBuilder/FilterConditionRow.d.ts +16 -0
- package/dist/components/Table/FilterBuilder/FilterConditionRow.js +30 -0
- package/dist/components/Table/FilterBuilder/FilterConditionRow.module.css +24 -0
- package/dist/components/Table/FilterBuilder/FilterGroup.d.ts +44 -0
- package/dist/components/Table/FilterBuilder/FilterGroup.js +117 -0
- package/dist/components/Table/FilterBuilder/FilterGroup.module.css +446 -0
- package/dist/components/Table/FilterBuilder/FilterSheet.module.css +72 -0
- package/dist/components/Table/FilterBuilder/FilterSheetNested.d.ts +11 -0
- package/dist/components/Table/FilterBuilder/FilterSheetNested.js +116 -0
- package/dist/components/Table/FilterBuilder/utils/tree-utils.d.ts +15 -0
- package/dist/components/Table/FilterBuilder/utils/tree-utils.js +122 -0
- package/dist/components/Table/FilterBuilder/utils/tree-utils.test.d.ts +1 -0
- package/dist/components/Table/FilterBuilder/utils/tree-utils.test.js +167 -0
- package/dist/components/Table/Table.d.ts +20 -4
- package/dist/components/Table/Table.js +138 -36
- package/dist/components/Table/Table.module.css +86 -0
- package/dist/components/Table/TableHeaderFilter.d.ts +10 -0
- package/dist/components/Table/TableHeaderFilter.js +91 -0
- package/dist/components/Table/TableHeaderFilter.module.css +58 -0
- package/dist/components/Table/utils/arrayFilter.d.ts +7 -0
- package/dist/components/Table/utils/arrayFilter.js +21 -0
- package/dist/components/Table/utils/arrayFilter.test.d.ts +1 -0
- package/dist/components/Table/utils/arrayFilter.test.js +32 -0
- package/dist/components/Table/utils/filterAst.d.ts +33 -0
- package/dist/components/Table/utils/filterAst.js +119 -0
- package/dist/components/Table/utils/filterAst.test.d.ts +1 -0
- package/dist/components/Table/utils/filterAst.test.js +110 -0
- package/dist/components/Text/Text.module.css +10 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Accordion Component
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Accordion, AccordionItem } from "doom-design-system";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
### Accordion
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| --------------- | ------------------------ | ---------- | -------------------------- |
|
|
15
|
+
| `type` | `"single" \| "multiple"` | `"single"` | Allow one or multiple open |
|
|
16
|
+
| `defaultValue` | `string \| string[]` | — | Initial open item(s) |
|
|
17
|
+
| `value` | `string \| string[]` | — | Controlled value |
|
|
18
|
+
| `onValueChange` | `(value) => void` | — | Change callback |
|
|
19
|
+
|
|
20
|
+
### AccordionItem
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Description |
|
|
23
|
+
| ---------- | ----------- | ----------------- |
|
|
24
|
+
| `value` | `string` | Unique identifier |
|
|
25
|
+
| `trigger` | `string` | Header text |
|
|
26
|
+
| `children` | `ReactNode` | Panel content |
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Accordion type="single" defaultValue="item-1">
|
|
32
|
+
<AccordionItem value="item-1" trigger="Section 1">
|
|
33
|
+
Content for section 1
|
|
34
|
+
</AccordionItem>
|
|
35
|
+
<AccordionItem value="item-2" trigger="Section 2">
|
|
36
|
+
Content for section 2
|
|
37
|
+
</AccordionItem>
|
|
38
|
+
</Accordion>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Guidelines
|
|
42
|
+
|
|
43
|
+
- Use `type="multiple"` for FAQ sections where users may want multiple open.
|
|
44
|
+
- Use `type="single"` (default) for navigation or settings panels.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ActionRow Component
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { ActionRow } from "doom-design-system";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Description |
|
|
12
|
+
| ------------- | ------------ | ----------------------- |
|
|
13
|
+
| `icon` | `ReactNode` | Icon on the left |
|
|
14
|
+
| `title` | `string` | Main label |
|
|
15
|
+
| `description` | `string` | Optional secondary text |
|
|
16
|
+
| `onClick` | `() => void` | Click handler |
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<ActionRow
|
|
22
|
+
icon={<Settings size={20} />}
|
|
23
|
+
title="Account Settings"
|
|
24
|
+
description="Manage your profile and preferences"
|
|
25
|
+
onClick={() => navigate("/settings")}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Guidelines
|
|
30
|
+
|
|
31
|
+
- Use for settings menus, navigation lists, or action items.
|
|
32
|
+
- Always provide an icon for visual consistency.
|
|
33
|
+
- Renders with a chevron indicator on the right.
|
|
@@ -0,0 +1,35 @@
|
|
|
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.
|
|
@@ -0,0 +1,36 @@
|
|
|
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.
|
|
@@ -0,0 +1,29 @@
|
|
|
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.
|
|
@@ -0,0 +1,33 @@
|
|
|
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.
|
|
@@ -0,0 +1,43 @@
|
|
|
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.
|
|
@@ -0,0 +1,41 @@
|
|
|
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.
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
| `config` | `ChartConfig` | required | Series configuration |
|
|
15
|
+
| `type` | `"line" \| "area" \| "bar"` | — | Chart type (shorthand API) |
|
|
16
|
+
| `xKey` | `string` | required | X-axis data key |
|
|
17
|
+
| `height` | `number` | `300` | Chart height |
|
|
18
|
+
| `title` | `string` | — | Chart title |
|
|
19
|
+
| `subtitle` | `string` | — | Chart subtitle |
|
|
20
|
+
| `withLegend` | `boolean` | — | Show legend |
|
|
21
|
+
| `render` | `(ctx) => ReactNode` | — | Custom render function |
|
|
22
|
+
| `renderTooltip` | `(ctx) => ReactNode` | — | Custom tooltip |
|
|
23
|
+
|
|
24
|
+
## Config
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
const config = {
|
|
28
|
+
revenue: {
|
|
29
|
+
label: "Revenue",
|
|
30
|
+
color: "var(--primary)",
|
|
31
|
+
},
|
|
32
|
+
profit: {
|
|
33
|
+
label: "Profit",
|
|
34
|
+
color: "var(--success)",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Shorthand API
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Chart
|
|
45
|
+
type="line"
|
|
46
|
+
data={data}
|
|
47
|
+
config={config}
|
|
48
|
+
xKey="month"
|
|
49
|
+
title="Monthly Revenue"
|
|
50
|
+
withLegend
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Composition API
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<Chart.Root data={data} config={config} xKey="month">
|
|
58
|
+
<Chart.Header title="Sales" subtitle="Last 12 months">
|
|
59
|
+
<Chart.Legend />
|
|
60
|
+
</Chart.Header>
|
|
61
|
+
<Chart.Plot type="area" />
|
|
62
|
+
<Chart.Footer>Custom footer</Chart.Footer>
|
|
63
|
+
</Chart.Root>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Guidelines
|
|
67
|
+
|
|
68
|
+
- Use shorthand API for simple charts.
|
|
69
|
+
- Use composition API for custom layouts.
|
|
70
|
+
- Built on D3.js; supports line, area, and bar charts.
|
|
71
|
+
- Supports gradients with `withGradient` prop on Plot.
|
|
@@ -0,0 +1,38 @@
|
|
|
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.
|
|
@@ -0,0 +1,35 @@
|
|
|
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.
|
|
@@ -0,0 +1,50 @@
|
|
|
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.
|
|
@@ -0,0 +1,69 @@
|
|
|
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.).
|
|
@@ -0,0 +1,33 @@
|
|
|
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.
|
|
@@ -0,0 +1,49 @@
|
|
|
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.
|