division-ds 0.2.0 → 0.3.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.
Files changed (95) hide show
  1. package/AGENTS.md +11 -5
  2. package/division-ds-0.3.0.tgz +0 -0
  3. package/package.json +1 -1
  4. package/public/docs/components/accordion.md +2 -0
  5. package/public/docs/components/ai-label.md +2 -0
  6. package/public/docs/components/alert-dialog.md +2 -0
  7. package/public/docs/components/alert.md +2 -0
  8. package/public/docs/components/approval-request.md +2 -0
  9. package/public/docs/components/auth-form.md +2 -0
  10. package/public/docs/components/avatar-group.md +2 -0
  11. package/public/docs/components/avatar.md +2 -0
  12. package/public/docs/components/badge.md +2 -0
  13. package/public/docs/components/breadcrumbs.md +2 -0
  14. package/public/docs/components/button.md +2 -0
  15. package/public/docs/components/card.md +2 -0
  16. package/public/docs/components/carousel.md +2 -0
  17. package/public/docs/components/cart.md +2 -0
  18. package/public/docs/components/chart-panel.md +2 -0
  19. package/public/docs/components/chat-message.md +3 -0
  20. package/public/docs/components/chat-thread.md +2 -0
  21. package/public/docs/components/checkbox.md +2 -0
  22. package/public/docs/components/checkout-form.md +2 -0
  23. package/public/docs/components/command-palette.md +6 -1
  24. package/public/docs/components/data-table.md +2 -0
  25. package/public/docs/components/date-picker.md +166 -0
  26. package/public/docs/components/date-presets.md +111 -0
  27. package/public/docs/components/date-range-picker.md +135 -0
  28. package/public/docs/components/description-list.md +2 -0
  29. package/public/docs/components/dialog.md +2 -0
  30. package/public/docs/components/divider.md +2 -0
  31. package/public/docs/components/dropdown-menu.md +2 -0
  32. package/public/docs/components/empty-state.md +2 -0
  33. package/public/docs/components/footer.md +2 -0
  34. package/public/docs/components/form-field.md +4 -1
  35. package/public/docs/components/icon-button.md +2 -0
  36. package/public/docs/components/input.md +2 -0
  37. package/public/docs/components/kanban-board.md +2 -0
  38. package/public/docs/components/kbd.md +2 -0
  39. package/public/docs/components/link.md +2 -0
  40. package/public/docs/components/list-item.md +3 -0
  41. package/public/docs/components/loading-animation.md +2 -0
  42. package/public/docs/components/multi-select.md +2 -0
  43. package/public/docs/components/navbar.md +2 -0
  44. package/public/docs/components/newsletter-form.md +2 -0
  45. package/public/docs/components/page-header.md +2 -0
  46. package/public/docs/components/pagination.md +2 -0
  47. package/public/docs/components/product-card.md +3 -0
  48. package/public/docs/components/progress.md +3 -1
  49. package/public/docs/components/prompt-input.md +2 -0
  50. package/public/docs/components/quantity-stepper.md +2 -0
  51. package/public/docs/components/radio.md +38 -1
  52. package/public/docs/components/rating.md +2 -0
  53. package/public/docs/components/score-ring.md +2 -0
  54. package/public/docs/components/search.md +2 -0
  55. package/public/docs/components/section-heading.md +2 -0
  56. package/public/docs/components/segmented-control.md +2 -0
  57. package/public/docs/components/select.md +3 -1
  58. package/public/docs/components/sheet.md +2 -0
  59. package/public/docs/components/sidebar.md +2 -0
  60. package/public/docs/components/skeleton.md +2 -0
  61. package/public/docs/components/slider.md +3 -1
  62. package/public/docs/components/sparkline.md +2 -0
  63. package/public/docs/components/spinner.md +4 -2
  64. package/public/docs/components/stat.md +2 -0
  65. package/public/docs/components/status-tracker.md +2 -0
  66. package/public/docs/components/stepper.md +2 -0
  67. package/public/docs/components/switch.md +4 -2
  68. package/public/docs/components/tabs.md +2 -0
  69. package/public/docs/components/tag.md +2 -0
  70. package/public/docs/components/textarea.md +2 -0
  71. package/public/docs/components/time-field.md +127 -0
  72. package/public/docs/components/timeline.md +2 -0
  73. package/public/docs/components/toast.md +2 -0
  74. package/public/docs/components/tool-call.md +2 -0
  75. package/public/docs/components/tooltip.md +2 -0
  76. package/public/manifest/components.json +947 -72
  77. package/public/manifest/tokens.json +36 -5
  78. package/scripts/division-ds.mjs +5 -5
  79. package/scripts/lib/agent-docs.mjs +49 -6
  80. package/scripts/lib/ai-copy.mjs +15 -1
  81. package/scripts/lib/check-text.mjs +13 -0
  82. package/scripts/lib/mcp-server.mjs +2 -1
  83. package/scripts/lib/mcp-tools.mjs +25 -12
  84. package/scripts/lib/props-validator.mjs +2 -1
  85. package/scripts/lib/search-score.mjs +24 -0
  86. package/scripts/lib/token-discipline.mjs +10 -3
  87. package/skills/division-ds/SKILL.md +2 -2
  88. package/skills/division-ds/commands/add.md +1 -1
  89. package/skills/division-ds/commands/build.md +1 -1
  90. package/skills/division-ds/commands/fix.md +1 -1
  91. package/skills/division-ds/commands/review.md +2 -2
  92. package/skills/division-ds/topics/ai.md +2 -1
  93. package/skills/division-ds/topics/forms.md +3 -0
  94. package/skills/division-ds/topics/layout.md +3 -1
  95. package/division-ds-0.2.0.tgz +0 -0
@@ -13,6 +13,8 @@
13
13
  import { StatusTracker, statusTrackerText } from 'src/components/molecules/status-tracker/StatusTracker'
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.
17
+
16
18
  ## Requires
17
19
 
18
20
  - The root TooltipProvider (AppShell and DemoLayout mount it).
@@ -13,6 +13,8 @@
13
13
  import { Stepper } from 'src/components/molecules/stepper/Stepper'
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.
17
+
16
18
  ## Props
17
19
 
18
20
  | Prop | Type | Default | Description |
@@ -13,6 +13,8 @@
13
13
  import { Switch } from 'src/components/atoms/switch/Switch'
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.
17
+
16
18
  ## Requires
17
19
 
18
20
  - Its own label. A Switch isn't a FormField child (FormField takes Input, Textarea, Select or QuantityStepper). Give it an id and put a <label htmlFor> beside it.
@@ -147,5 +149,5 @@ FormField passes its child an invalid prop, and Switch doesn't take one. A switc
147
149
  ## Anatomy
148
150
 
149
151
  - **Root**: role=switch, which tells screen readers (software that reads the page aloud) what it is. A 44×24 track.
150
- - **Thumb**: A 16px (pixel) square, 3px from the track edge in both states, travelling 22px. Its position is the state signal. It's text.primary when off and accent.signal.fill when on. Held down, it stretches 4px away from the edge it rests on: to the right when off, to the left when on, so it never leaves the track. Flipped, it speeds up across the track, gets a little longer in flight and a little shorter against the far edge, then goes back to its own shape. One give, no bounce.
151
- - **Track fill**: The control fill, on and off. When it's on, only the border turns to signal.fill. The track doesn't fill with the accent, so the thumb is the one thing that changes colour during a flip.
152
+ - **Thumb**: A 16px (pixel) square, 3px from the track edge in both states, travelling 22px. Its position is the state signal. It's text.primary when off and accent.signal.indicator when on. Held down, it stretches 4px away from the edge it rests on: to the right when off, to the left when on, so it never leaves the track. Flipped, it speeds up across the track, gets a little longer in flight and a little shorter against the far edge, then goes back to its own shape. One give, no bounce.
153
+ - **Track fill**: The control fill, on and off. When it's on, only the border turns to accent.signal.indicator. The track doesn't fill with the accent, so the thumb is the one thing that changes colour during a flip.
@@ -13,6 +13,8 @@
13
13
  import { Tabs, TabsContent, TabsList, TabsTrigger } from 'src/components/molecules/tabs/Tabs'
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.
17
+
16
18
  ## Props
17
19
 
18
20
  | Prop | Type | Default | Description |
@@ -13,6 +13,8 @@
13
13
  import { Tag } from 'src/components/atoms/tag/Tag'
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.
17
+
16
18
  ## Props
17
19
 
18
20
  | Prop | Type | Default | Description |
@@ -13,6 +13,8 @@
13
13
  import { Textarea, textareaVariants } from 'src/components/atoms/textarea/Textarea'
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.
17
+
16
18
  ## Requires
17
19
 
18
20
  - A <FormField> around it. On its own the control has no label. FormField supplies the label, the help text and the error, and links up their ids.
@@ -0,0 +1,127 @@
1
+ # TimeField
2
+
3
+ > A time of day, an add-on to the date pickers. Hours and minutes are segments you type into or step with the arrow keys, like DateField; the clock button opens a list of times every step minutes. With a 12-hour clock there is an AM/PM segment. The value is 'HH:MM' on a 24-hour clock whatever is shown. Put it next to a DatePicker for a date and a time.
4
+
5
+ - **Best for:** A pickup slot, a meeting start, a shift.
6
+ - **Not for:** A duration: Input with a unit.
7
+ - Molecule. Source: `src/components/molecules/time-field/TimeField.tsx`
8
+ - Rendered docs page: `/components/time-field`
9
+
10
+ ## Import
11
+
12
+ ```tsx
13
+ import { TimeField, hourCycleFor } from 'src/components/molecules/time-field/TimeField'
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.
17
+
18
+ ## Props
19
+
20
+ | Prop | Type | Default | Description |
21
+ |---|---|---|---|
22
+ | `label` | `string` | | Required. Names the field. Inside a FormField, FormField sets it. |
23
+ | `value` | `string ('HH:MM' \| '')` | | Controlled value, 24-hour. |
24
+ | `defaultValue` | `string` | `''` | Starting value when the field holds it itself. |
25
+ | `onValueChange` | `(value: string) => void` | | Fires with a whole time, or '' when emptied. |
26
+ | `hourCycle` | `12 \| 24` | | 12 adds an AM/PM segment. The value stays 24-hour. Defaults to the locale's clock. |
27
+ | `step` | `number` | `30` | Minutes between the times in the list. |
28
+ | `min` | `string` | | Earliest time, 'HH:MM'. Earlier times are left out of the list; typing one marks the field invalid. |
29
+ | `max` | `string` | | Latest time, 'HH:MM'. |
30
+ | `showSlots` | `boolean` | `true` | Shows the clock button and its list. |
31
+ | `locale` | `string` | | Decides the default clock. Defaults to the browser's. |
32
+ | `disabled` | `boolean` | `false` | Disables the field and the button. |
33
+ | `invalid` | `boolean` | | Marks the field invalid. FormField sets it. |
34
+ | `required` | `boolean` | | Marks the field required. FormField sets it. |
35
+ | `name` | `string` | | Submits the 'HH:MM' value with a form. |
36
+ | `id` | `string` | | The field's id. FormField sets it. |
37
+ | `aria-describedby` | `string` | | The ids of the help and error text. FormField sets it. |
38
+ | `className` | `string` | | Combined with the field's classes. |
39
+ | `ref` | `Ref<HTMLDivElement>` | | The field's group element. |
40
+ | `hourCycleFor()` | `(locale?: string) => 12 \| 24` | | The locale's own clock. |
41
+
42
+ ## Types and helpers
43
+
44
+ Exported beside the component, from the same file. Import a type with `import type { ... }`.
45
+
46
+ ```ts
47
+ /** 'HH:MM', 24-hour, or '' for no time. */
48
+ export type TimeValue = string
49
+ ```
50
+
51
+ ```ts
52
+ /** 12 or 24, from the locale's own clock. */
53
+ export function hourCycleFor(locale?: string): 12 | 24
54
+ ```
55
+
56
+ ## Examples
57
+
58
+ Each is compiled and rendered on the docs page. Imports are omitted; see above.
59
+
60
+ ### Default, 24-hour
61
+
62
+ ```tsx
63
+ <div className="w-36">
64
+ <TimeField label="Start time" hourCycle={24} />
65
+ </div>
66
+ ```
67
+
68
+ ### 12-hour, with AM and PM
69
+
70
+ ```tsx
71
+ <div className="w-40">
72
+ <TimeField label="Call time" hourCycle={12} defaultValue="14:30" />
73
+ </div>
74
+ ```
75
+
76
+ ### With a DatePicker: a date and a time
77
+
78
+ ```tsx
79
+ function DateAndTime() {
80
+ const [date, setDate] = useState('2026-11-14')
81
+ const [time, setTime] = useState('09:30')
82
+ return (
83
+ <div className="flex w-full max-w-md flex-col gap-3">
84
+ <div className="grid gap-3 sm:grid-cols-[1fr_9rem]">
85
+ <FormField label="Pickup date">
86
+ <DatePicker label="Pickup date" value={date} onValueChange={setDate} />
87
+ </FormField>
88
+ <FormField label="Pickup time">
89
+ <TimeField label="Pickup time" value={time} onValueChange={setTime} step={15} min="08:00" max="18:00" />
90
+ </FormField>
91
+ </div>
92
+ <span className="font-mono text-xs text-[var(--color-text-secondary)]">
93
+ {date && time ? `${date}T${time}` : 'Pick a date and a time'}
94
+ </span>
95
+ </div>
96
+ )
97
+ }
98
+
99
+ <DateAndTime />
100
+ ```
101
+
102
+ ## Keyboard
103
+
104
+ | Keys | Result |
105
+ |---|---|
106
+ | `0–9` | Types the hour or minute and moves on once it is full. |
107
+ | `A` `P` | On the AM/PM segment, sets AM or PM. |
108
+ | `↑` `↓` | In the field: one more or one less. In the list: the next or previous time. |
109
+ | `←` `→` | The previous or next segment. |
110
+ | `Page Up` `Page Down` | In the list: six times earlier or later. |
111
+ | `Enter` `Space` | In the list: picks the time and closes it. |
112
+ | `Esc` | Closes the list without a change. |
113
+
114
+ ## Do
115
+
116
+ - Set step to the real booking grid, such as 15 for 15-minute slots.
117
+ - Store the value with its date and the time zone it means, separately.
118
+
119
+ ## Don't
120
+
121
+ - Don't parse 'HH:MM' with new Date(): keep it a string until you combine it with a date and a zone.
122
+
123
+ ## Anatomy
124
+
125
+ - **Field**: A group named by the label: Hour, Minute and, on a 12-hour clock, AM or PM, each a spinbutton.
126
+ - **Clock button**: A ghost IconButton. Its name includes the time: "Choose time, 14:30".
127
+ - **Time list**: A listbox of times between min and max, every step minutes. It opens on the picked time, or the next slot after now.
@@ -13,6 +13,8 @@
13
13
  import { Timeline, TimelineGroup, TimelineItem } from 'src/components/molecules/timeline/Timeline'
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.
17
+
16
18
  ## Props
17
19
 
18
20
  | Prop | Type | Default | Description |
@@ -13,6 +13,8 @@
13
13
  import { Toaster, useToast } from 'src/components/molecules/toast/Toast'
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.
17
+
16
18
  ## Requires
17
19
 
18
20
  - One <Toaster> near the root of the app, wrapped around everything that calls useToast(). AppShell and the demo layout each mount one. Outside it, useToast() throws an error.
@@ -13,6 +13,8 @@
13
13
  import { ToolCall } from 'src/components/molecules/tool-call/ToolCall'
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.
17
+
16
18
  ## Props
17
19
 
18
20
  | Prop | Type | Default | Description |
@@ -13,6 +13,8 @@
13
13
  import { Tooltip, TooltipProvider } from 'src/components/atoms/tooltip/Tooltip'
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.
17
+
16
18
  ## Requires
17
19
 
18
20
  - One <TooltipProvider> near the root of the app. AppShell and the demo layout each mount one, so a screen doesn't add its own.