division-ds 0.3.0 → 0.4.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/AGENTS.md +2 -2
- package/package.json +1 -1
- package/public/docs/components/accordion.md +1 -1
- package/public/docs/components/ai-label.md +1 -1
- package/public/docs/components/alert-dialog.md +1 -1
- package/public/docs/components/alert.md +1 -1
- package/public/docs/components/approval-request.md +1 -1
- package/public/docs/components/auth-form.md +1 -1
- package/public/docs/components/avatar-group.md +1 -1
- package/public/docs/components/avatar.md +1 -1
- package/public/docs/components/badge.md +1 -1
- package/public/docs/components/breadcrumbs.md +1 -1
- package/public/docs/components/button.md +1 -1
- package/public/docs/components/card.md +1 -1
- package/public/docs/components/carousel.md +1 -1
- package/public/docs/components/cart.md +1 -1
- package/public/docs/components/chart-panel.md +58 -43
- package/public/docs/components/chat-message.md +1 -1
- package/public/docs/components/chat-thread.md +1 -1
- package/public/docs/components/checkbox.md +1 -1
- package/public/docs/components/checkout-form.md +1 -1
- package/public/docs/components/code-block.md +106 -0
- package/public/docs/components/command-palette.md +1 -1
- package/public/docs/components/data-table.md +1 -1
- package/public/docs/components/date-picker.md +3 -3
- package/public/docs/components/date-presets.md +1 -1
- package/public/docs/components/date-range-picker.md +3 -3
- package/public/docs/components/description-list.md +1 -1
- package/public/docs/components/dialog.md +1 -1
- package/public/docs/components/divider.md +1 -1
- package/public/docs/components/dropdown-menu.md +2 -1
- package/public/docs/components/empty-state.md +1 -1
- package/public/docs/components/footer.md +1 -1
- package/public/docs/components/form-field.md +2 -2
- package/public/docs/components/icon-button.md +1 -1
- package/public/docs/components/input.md +1 -1
- package/public/docs/components/kanban-board.md +1 -1
- package/public/docs/components/kbd.md +25 -4
- package/public/docs/components/link.md +1 -1
- package/public/docs/components/list-item.md +1 -1
- package/public/docs/components/loading-animation.md +1 -1
- package/public/docs/components/multi-select.md +5 -5
- package/public/docs/components/navbar.md +55 -4
- package/public/docs/components/newsletter-form.md +1 -1
- package/public/docs/components/page-header.md +1 -1
- package/public/docs/components/pagination.md +1 -1
- package/public/docs/components/panel.md +139 -0
- package/public/docs/components/product-card.md +1 -1
- package/public/docs/components/progress.md +2 -2
- package/public/docs/components/prompt-input.md +1 -1
- package/public/docs/components/quantity-stepper.md +2 -2
- package/public/docs/components/radio.md +1 -1
- package/public/docs/components/rating.md +1 -1
- package/public/docs/components/score-ring.md +1 -1
- package/public/docs/components/search.md +1 -1
- package/public/docs/components/section-heading.md +1 -1
- package/public/docs/components/segmented-control.md +1 -1
- package/public/docs/components/select.md +2 -2
- package/public/docs/components/sheet.md +1 -1
- package/public/docs/components/sidebar.md +1 -1
- package/public/docs/components/skeleton.md +1 -1
- package/public/docs/components/slider.md +1 -1
- package/public/docs/components/sparkline.md +1 -1
- package/public/docs/components/spinner.md +1 -1
- package/public/docs/components/stat.md +1 -1
- package/public/docs/components/status-tracker.md +1 -1
- package/public/docs/components/stepper.md +1 -1
- package/public/docs/components/switch.md +1 -1
- package/public/docs/components/tabs.md +1 -1
- package/public/docs/components/tag.md +1 -1
- package/public/docs/components/textarea.md +1 -1
- package/public/docs/components/time-field.md +5 -5
- package/public/docs/components/timeline.md +1 -1
- package/public/docs/components/toast.md +1 -1
- package/public/docs/components/tool-call.md +1 -1
- package/public/docs/components/tooltip.md +1 -1
- package/public/manifest/components.json +516 -92
- package/public/manifest/tokens.json +10 -7
- package/scripts/lib/agent-docs.mjs +1 -1
- package/scripts/lib/props-validator.mjs +36 -2
- package/skills/division-ds/SKILL.md +1 -1
- package/division-ds-0.3.0.tgz +0 -0
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Division DS: instructions for coding agents
|
|
2
2
|
|
|
3
|
-
A React 19 + Tailwind 4 + Radix design system:
|
|
3
|
+
A React 19 + Tailwind 4 + Radix design system: 74 components, tokens in three layers, light and
|
|
4
4
|
dark themes, WCAG 2.2 AA. This file is the entry point. It is short on purpose; everything it
|
|
5
5
|
points to is generated from the code, so it is current.
|
|
6
6
|
|
|
@@ -51,7 +51,7 @@ installs these rules into that project's `AGENTS.md`, `GEMINI.md` and Cursor rul
|
|
|
51
51
|
`.claude/skills/` (Claude Code).
|
|
52
52
|
|
|
53
53
|
An agent that supports MCP can have the docs and the same checks as tools instead:
|
|
54
|
-
`claude mcp add division-ds -- npx -y division-ds@0.3.
|
|
54
|
+
`claude mcp add division-ds -- npx -y division-ds@0.3.1 mcp` (`list_components`, `get_component`,
|
|
55
55
|
`search`, `get_tokens`, `validate_code`, `check_contrast`, `get_add_command`,
|
|
56
56
|
`get_review_checklist`).
|
|
57
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "division-ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Checks a project that uses Division DS components (raw colours, invented tokens, touching buttons, unknown props), and serves the docs and the same checks to agents over MCP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Victor Ilioiu",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from 'src/components/molecules/accordion/Accordion'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { AiLabel } from 'src/components/atoms/ai-label/AiLabel'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogFooter, AlertDialogTrigger } from 'src/components/organisms/alert-dialog/AlertDialog'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Alert } from 'src/components/molecules/alert/Alert'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { ApprovalRequest } from 'src/components/molecules/approval-request/ApprovalRequest'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Requires
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { AuthForm } from 'src/components/organisms/auth-form/AuthForm'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { AvatarGroup } from 'src/components/molecules/avatar-group/AvatarGroup'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Requires
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Avatar, avatarVariants, initialsFrom } from 'src/components/atoms/avatar/Avatar'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Badge, badgeVariants } from 'src/components/atoms/badge/Badge'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Breadcrumbs, collapseCrumbs } from 'src/components/molecules/breadcrumbs/Breadcrumbs'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Button, buttonVariants } from 'src/components/atoms/button/Button'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Card, CardActions, CardBody, CardDescription, CardFooter, CardHeader, CardMedia, CardTitle, cardLinkClass } from 'src/components/molecules/card/Card'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Carousel } from 'src/components/organisms/carousel/Carousel'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Cart } from 'src/components/organisms/cart/Cart'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { ChartPanel } from 'src/components/organisms/chart-panel/ChartPanel'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -59,20 +59,26 @@ Each is compiled and rendered on the docs page. Imports are omitted; see above.
|
|
|
59
59
|
type Week = { week: string; online: number; store: number }
|
|
60
60
|
|
|
61
61
|
const WEEKS: Week[] = [
|
|
62
|
-
{ week: 'W1', online:
|
|
63
|
-
{ week: 'W2', online:
|
|
64
|
-
{ week: 'W3', online:
|
|
65
|
-
{ week: 'W4', online:
|
|
66
|
-
{ week: 'W5', online:
|
|
67
|
-
{ week: 'W6', online:
|
|
68
|
-
{ week: 'W7', online:
|
|
69
|
-
{ week: 'W8', online:
|
|
62
|
+
{ week: 'W1', online: 118, store: 150 },
|
|
63
|
+
{ week: 'W2', online: 149, store: 172 },
|
|
64
|
+
{ week: 'W3', online: 168, store: 158 },
|
|
65
|
+
{ week: 'W4', online: 141, store: 131 },
|
|
66
|
+
{ week: 'W5', online: 126, store: 128 },
|
|
67
|
+
{ week: 'W6', online: 174, store: 150 },
|
|
68
|
+
{ week: 'W7', online: 231, store: 141 },
|
|
69
|
+
{ week: 'W8', online: 183, store: 122 },
|
|
70
|
+
{ week: 'W9', online: 139, store: 149 },
|
|
71
|
+
{ week: 'W10', online: 162, store: 185 },
|
|
72
|
+
{ week: 'W11', online: 196, store: 163 },
|
|
73
|
+
{ week: 'W12', online: 170, store: 140 },
|
|
70
74
|
]
|
|
71
75
|
|
|
72
76
|
<ChartPanel<Week>
|
|
73
77
|
title="Weekly orders"
|
|
74
|
-
summary="Online orders
|
|
78
|
+
summary="Online orders peaked three times in twelve weeks, highest at 231 in week 7; in-store orders peaked highest at 185 in week 10."
|
|
75
79
|
kind="line"
|
|
80
|
+
area
|
|
81
|
+
curve="smooth"
|
|
76
82
|
data={WEEKS}
|
|
77
83
|
xKey="week"
|
|
78
84
|
xLabel="Week"
|
|
@@ -116,17 +122,17 @@ type Day = { day: string; visits: number; orders: number }
|
|
|
116
122
|
|
|
117
123
|
const DAYS: Day[] = [
|
|
118
124
|
{ day: 'Mon', visits: 1840, orders: 61 },
|
|
119
|
-
{ day: 'Tue', visits:
|
|
120
|
-
{ day: 'Wed', visits:
|
|
121
|
-
{ day: 'Thu', visits:
|
|
122
|
-
{ day: 'Fri', visits:
|
|
125
|
+
{ day: 'Tue', visits: 2960, orders: 104 },
|
|
126
|
+
{ day: 'Wed', visits: 2210, orders: 74 },
|
|
127
|
+
{ day: 'Thu', visits: 1720, orders: 55 },
|
|
128
|
+
{ day: 'Fri', visits: 2650, orders: 92 },
|
|
123
129
|
{ day: 'Sat', visits: 3890, orders: 141 },
|
|
124
|
-
{ day: 'Sun', visits:
|
|
130
|
+
{ day: 'Sun', visits: 3120, orders: 118 },
|
|
125
131
|
]
|
|
126
132
|
|
|
127
133
|
<ChartPanel<Day>
|
|
128
134
|
title="Visits this week"
|
|
129
|
-
summary="Visits
|
|
135
|
+
summary="Visits peaked on Tuesday at 2,960, fell to a Thursday low of 1,720, then peaked higher on Saturday at 3,890."
|
|
130
136
|
kind="line"
|
|
131
137
|
area
|
|
132
138
|
curve="smooth"
|
|
@@ -134,7 +140,7 @@ const DAYS: Day[] = [
|
|
|
134
140
|
xKey="day"
|
|
135
141
|
xLabel="Day"
|
|
136
142
|
series={[{ key: 'visits', label: 'Visits' }]}
|
|
137
|
-
headline="
|
|
143
|
+
headline="18,390"
|
|
138
144
|
headingLevel={4}
|
|
139
145
|
/>
|
|
140
146
|
```
|
|
@@ -145,19 +151,23 @@ const DAYS: Day[] = [
|
|
|
145
151
|
type Week = { week: string; online: number; store: number }
|
|
146
152
|
|
|
147
153
|
const WEEKS: Week[] = [
|
|
148
|
-
{ week: 'W1', online:
|
|
149
|
-
{ week: 'W2', online:
|
|
150
|
-
{ week: 'W3', online:
|
|
151
|
-
{ week: 'W4', online:
|
|
152
|
-
{ week: 'W5', online:
|
|
153
|
-
{ week: 'W6', online:
|
|
154
|
-
{ week: 'W7', online:
|
|
155
|
-
{ week: 'W8', online:
|
|
154
|
+
{ week: 'W1', online: 118, store: 150 },
|
|
155
|
+
{ week: 'W2', online: 149, store: 172 },
|
|
156
|
+
{ week: 'W3', online: 168, store: 158 },
|
|
157
|
+
{ week: 'W4', online: 141, store: 131 },
|
|
158
|
+
{ week: 'W5', online: 126, store: 128 },
|
|
159
|
+
{ week: 'W6', online: 174, store: 150 },
|
|
160
|
+
{ week: 'W7', online: 231, store: 141 },
|
|
161
|
+
{ week: 'W8', online: 183, store: 122 },
|
|
162
|
+
{ week: 'W9', online: 139, store: 149 },
|
|
163
|
+
{ week: 'W10', online: 162, store: 185 },
|
|
164
|
+
{ week: 'W11', online: 196, store: 163 },
|
|
165
|
+
{ week: 'W12', online: 170, store: 140 },
|
|
156
166
|
]
|
|
157
167
|
|
|
158
168
|
<ChartPanel<Week>
|
|
159
169
|
title="Weekly orders, gridless"
|
|
160
|
-
summary="Online orders
|
|
170
|
+
summary="Online orders peaked three times in twelve weeks, highest at 231 in week 7; in-store orders peaked highest at 185 in week 10."
|
|
161
171
|
kind="line"
|
|
162
172
|
area
|
|
163
173
|
curve="smooth"
|
|
@@ -206,30 +216,34 @@ type Week = { week: string; online: number; store: number }
|
|
|
206
216
|
type Day = { day: string; visits: number; orders: number }
|
|
207
217
|
|
|
208
218
|
const WEEKS: Week[] = [
|
|
209
|
-
{ week: 'W1', online:
|
|
210
|
-
{ week: 'W2', online:
|
|
211
|
-
{ week: 'W3', online:
|
|
212
|
-
{ week: 'W4', online:
|
|
213
|
-
{ week: 'W5', online:
|
|
214
|
-
{ week: 'W6', online:
|
|
215
|
-
{ week: 'W7', online:
|
|
216
|
-
{ week: 'W8', online:
|
|
219
|
+
{ week: 'W1', online: 118, store: 150 },
|
|
220
|
+
{ week: 'W2', online: 149, store: 172 },
|
|
221
|
+
{ week: 'W3', online: 168, store: 158 },
|
|
222
|
+
{ week: 'W4', online: 141, store: 131 },
|
|
223
|
+
{ week: 'W5', online: 126, store: 128 },
|
|
224
|
+
{ week: 'W6', online: 174, store: 150 },
|
|
225
|
+
{ week: 'W7', online: 231, store: 141 },
|
|
226
|
+
{ week: 'W8', online: 183, store: 122 },
|
|
227
|
+
{ week: 'W9', online: 139, store: 149 },
|
|
228
|
+
{ week: 'W10', online: 162, store: 185 },
|
|
229
|
+
{ week: 'W11', online: 196, store: 163 },
|
|
230
|
+
{ week: 'W12', online: 170, store: 140 },
|
|
217
231
|
]
|
|
218
232
|
|
|
219
233
|
const DAYS: Day[] = [
|
|
220
234
|
{ day: 'Mon', visits: 1840, orders: 61 },
|
|
221
|
-
{ day: 'Tue', visits:
|
|
222
|
-
{ day: 'Wed', visits:
|
|
223
|
-
{ day: 'Thu', visits:
|
|
224
|
-
{ day: 'Fri', visits:
|
|
235
|
+
{ day: 'Tue', visits: 2960, orders: 104 },
|
|
236
|
+
{ day: 'Wed', visits: 2210, orders: 74 },
|
|
237
|
+
{ day: 'Thu', visits: 1720, orders: 55 },
|
|
238
|
+
{ day: 'Fri', visits: 2650, orders: 92 },
|
|
225
239
|
{ day: 'Sat', visits: 3890, orders: 141 },
|
|
226
|
-
{ day: 'Sun', visits:
|
|
240
|
+
{ day: 'Sun', visits: 3120, orders: 118 },
|
|
227
241
|
]
|
|
228
242
|
|
|
229
243
|
<ChartPanel<Day>
|
|
230
244
|
title="Visits"
|
|
231
|
-
headline="
|
|
232
|
-
summary="
|
|
245
|
+
headline="18,390"
|
|
246
|
+
summary="Two peaks: Tuesday, then a higher Saturday."
|
|
233
247
|
kind="line"
|
|
234
248
|
area
|
|
235
249
|
curve="smooth"
|
|
@@ -254,9 +268,10 @@ const DAYS: Day[] = [
|
|
|
254
268
|
/>
|
|
255
269
|
<ChartPanel<Week>
|
|
256
270
|
title="Online orders"
|
|
257
|
-
headline="
|
|
258
|
-
summary="
|
|
271
|
+
headline="170"
|
|
272
|
+
summary="Three peaks in twelve weeks; the highest, 231, in week 7."
|
|
259
273
|
kind="line"
|
|
274
|
+
area
|
|
260
275
|
curve="smooth"
|
|
261
276
|
size="sm"
|
|
262
277
|
data={WEEKS}
|
|
@@ -15,7 +15,7 @@ import { ChatMessage } from 'src/components/molecules/chat-message/ChatMessage'
|
|
|
15
15
|
import { ResponseFeedback } from 'src/components/molecules/chat-message/ResponseFeedback'
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
18
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
19
19
|
|
|
20
20
|
## Requires
|
|
21
21
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { ChatThread } from 'src/components/organisms/chat-thread/ChatThread'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Requires
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Checkbox } from 'src/components/atoms/checkbox/Checkbox'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { CheckoutForm, DELIVERY_OPTIONS } from 'src/components/organisms/checkout-form/CheckoutForm'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# CodeBlock
|
|
2
|
+
|
|
3
|
+
> Code or a command in a panel, with a title bar that names the file or language and a button that copies the text. Long lines scroll sideways inside it, and code longer than one line gets line numbers.
|
|
4
|
+
|
|
5
|
+
- **Best for:** Showing code or a command someone will read or copy: an install step, a config file, an example.
|
|
6
|
+
- **Not for:** A word of code inside a sentence: use a code element. A key to press: use Kbd.
|
|
7
|
+
- Molecule. Source: `src/components/molecules/code-block/CodeBlock.tsx`
|
|
8
|
+
- Rendered docs page: `/components/code-block`
|
|
9
|
+
|
|
10
|
+
## Import
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { CodeBlock } from 'src/components/molecules/code-block/CodeBlock'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
|
+
|
|
18
|
+
## Requires
|
|
19
|
+
|
|
20
|
+
- The app’s one Toaster at the root: the copy is confirmed with a toast.
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| `code` | `string` | | The text shown and copied, exactly. |
|
|
27
|
+
| `label` | `string` | | What the code is, in a few words ("the theme CSS"). Names the region and the copy button ("Copy the theme CSS"). |
|
|
28
|
+
| `title` | `string` | | Shown in the title bar: a file name ("index.css") or a language ("bash"). |
|
|
29
|
+
| `language` | `'css' \| 'text'` | `'text'` | css colours comments, at-rules, selectors and property names; text is plain. |
|
|
30
|
+
| `lineNumbers` | `boolean` | | Line numbers in a gutter. Unset, they show when the code has more than one line. |
|
|
31
|
+
| `copyable` | `boolean` | `true` | The copy button. Turn it off for code nobody should paste, such as a wrong example. |
|
|
32
|
+
| `wrap` | `boolean` | `false` | Wraps long lines instead of scrolling them sideways. For prose, such as a prompt; leave code unwrapped. |
|
|
33
|
+
| `className` | `string` | | Merged onto the frame. Use it for width (max-w-3xl) and spacing. |
|
|
34
|
+
| `ref` | `Ref<HTMLDivElement>` | | Passed through to the frame. |
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
Each is compiled and rendered on the docs page. Imports are omitted; see above.
|
|
39
|
+
|
|
40
|
+
### A command
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<CodeBlock title="bash" label="the check command" code="npx division-ds check src" className="max-w-3xl" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### A file, with CSS colours and line numbers
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<CodeBlock
|
|
50
|
+
title="index.css"
|
|
51
|
+
language="css"
|
|
52
|
+
label="the theme CSS"
|
|
53
|
+
className="max-w-3xl"
|
|
54
|
+
code={'@import "./division-ds/styles/division-ds.css";\n\n/* Square corners */\n:root {\n --shape-bevel: 0;\n --shape-radius: 4px;\n}\n'}
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Not copyable, for code nobody should paste
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
<CodeBlock title="Wrong" label="a bare pre" copyable={false} code={'<pre>{command}</pre>'} className="max-w-3xl" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Keyboard
|
|
65
|
+
|
|
66
|
+
| Keys | Result |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `Tab` | Moves to the copy button, then to the code region. |
|
|
69
|
+
| `←` `→` | In the focused code region: scrolls a long line sideways. |
|
|
70
|
+
| `Enter` | On the copy button: copies the code. |
|
|
71
|
+
|
|
72
|
+
## Do
|
|
73
|
+
|
|
74
|
+
- Write a label that says what the code is, so the copy button reads "Copy the install command".
|
|
75
|
+
- Give it a title: the file name it belongs in, or the language.
|
|
76
|
+
- Set a max width with className; long lines scroll inside it, so it never widens the page.
|
|
77
|
+
|
|
78
|
+
## Don't
|
|
79
|
+
|
|
80
|
+
- Don’t put several unrelated commands in one block. One block per thing to copy.
|
|
81
|
+
- Don’t set copyable on an example of what not to write.
|
|
82
|
+
- Don’t wrap it in another bordered panel; it brings its own frame.
|
|
83
|
+
|
|
84
|
+
## Common mistakes
|
|
85
|
+
|
|
86
|
+
Wrong:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<pre className="font-mono text-sm">{command}</pre>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Right:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
<CodeBlock code={command} label="the install command" title="bash" />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
A bare pre has no copy button, no name, and cannot be scrolled with a keyboard when a line runs past the edge.
|
|
99
|
+
|
|
100
|
+
## Anatomy
|
|
101
|
+
|
|
102
|
+
- **Frame**: A thin border around a surface.base fill. The syntax colours are measured for contrast on surface.base.
|
|
103
|
+
- **Title bar**: The title on the left, in 12px uppercase mono, and the copy button on the right, above a thin line.
|
|
104
|
+
- **Code region**: A pre with role region, named by the title and the label, focusable so a keyboard can scroll it. Up to 32rem tall, then it scrolls.
|
|
105
|
+
- **Line numbers**: A gutter in text.muted, hidden from screen readers and from text selection.
|
|
106
|
+
- **Copy button**: An IconButton named "Copy" plus the label. After copying, its icon turns into a tick for a moment and a toast confirms it.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { CommandPalette, filterCommands, groupCommands } from 'src/components/organisms/command-palette/CommandPalette'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { DataTable, sortRows } from 'src/components/organisms/data-table/DataTable'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -16,13 +16,13 @@ import { DateField } from 'src/components/molecules/date-picker/DateField'
|
|
|
16
16
|
import { DatePicker } from 'src/components/molecules/date-picker/DatePicker'
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
19
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
20
20
|
|
|
21
21
|
## Props
|
|
22
22
|
|
|
23
23
|
| Prop | Type | Default | Description |
|
|
24
24
|
|---|---|---|---|
|
|
25
|
-
| `label` | `string` | |
|
|
25
|
+
| `label` | `string` | | Names the field. Leave it out inside a FormField, which sets it from its own label. Outside one it is required, and `division-ds check` flags a missing one. |
|
|
26
26
|
| `value` | `string ('YYYY-MM-DD' \| '')` | | Controlled value (your page holds it). |
|
|
27
27
|
| `defaultValue` | `string` | `''` | Starting value when the picker holds the value itself. |
|
|
28
28
|
| `onValueChange` | `(value: string) => void` | | Fires with a whole, real date, or '' when the field is emptied. A half-typed date does not fire. |
|
|
@@ -78,7 +78,7 @@ Each is compiled and rendered on the docs page. Imports are omitted; see above.
|
|
|
78
78
|
```tsx
|
|
79
79
|
<div className="w-full max-w-xs">
|
|
80
80
|
<FormField label="Trip date" help="Type it, or open the calendar.">
|
|
81
|
-
<DatePicker
|
|
81
|
+
<DatePicker />
|
|
82
82
|
</FormField>
|
|
83
83
|
</div>
|
|
84
84
|
```
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { DatePresets, defaultPresets } from 'src/components/molecules/date-presets/DatePresets'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
import { DateRangePicker, EMPTY_RANGE, useDateRangePicker } from 'src/components/molecules/date-range-picker/DateRangePicker'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
20
20
|
| Prop | Type | Default | Description |
|
|
21
21
|
|---|---|---|---|
|
|
22
|
-
| `label` | `string` | |
|
|
22
|
+
| `label` | `string` | | Names the field. Leave it out inside a FormField, which sets it from its own label. Outside one it is required, and `division-ds check` flags a missing one. |
|
|
23
23
|
| `value` | `{ start: string; end: string }` | | Controlled range. Each end is 'YYYY-MM-DD' or ''. |
|
|
24
24
|
| `defaultValue` | `{ start: string; end: string }` | `{ start: '', end: '' }` | Starting range when the picker holds it itself. |
|
|
25
25
|
| `onValueChange` | `(range: DateRange) => void` | | Fires when either end changes. Days picked in the calendar always arrive in order. |
|
|
@@ -76,7 +76,7 @@ Each is compiled and rendered on the docs page. Imports are omitted; see above.
|
|
|
76
76
|
```tsx
|
|
77
77
|
<div className="w-full max-w-sm">
|
|
78
78
|
<FormField label="Report period" help="Pick a preset, or two days.">
|
|
79
|
-
<DateRangePicker
|
|
79
|
+
<DateRangePicker aside={<DatePresets />} />
|
|
80
80
|
</FormField>
|
|
81
81
|
</div>
|
|
82
82
|
```
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { DescriptionList } from 'src/components/molecules/description-list/DescriptionList'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogTrigger } from 'src/components/organisms/dialog/Dialog'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Divider } from 'src/components/atoms/divider/Divider'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file.
|
|
16
|
+
Paths are from the Division DS repository root. Installed with shadcn they start `src/division-ds/` instead of `src/` (`src/division-ds/components/...`); import them relative to your file. An install has no index barrels: import each component from its own file, never from `components/molecules`.
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|