division-ds 0.2.1 → 0.3.1

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 (82) hide show
  1. package/AGENTS.md +4 -4
  2. package/package.json +1 -1
  3. package/public/docs/components/accordion.md +1 -1
  4. package/public/docs/components/ai-label.md +1 -1
  5. package/public/docs/components/alert-dialog.md +1 -1
  6. package/public/docs/components/alert.md +1 -1
  7. package/public/docs/components/approval-request.md +1 -1
  8. package/public/docs/components/auth-form.md +1 -1
  9. package/public/docs/components/avatar-group.md +1 -1
  10. package/public/docs/components/avatar.md +1 -1
  11. package/public/docs/components/badge.md +1 -1
  12. package/public/docs/components/breadcrumbs.md +1 -1
  13. package/public/docs/components/button.md +1 -1
  14. package/public/docs/components/card.md +1 -1
  15. package/public/docs/components/carousel.md +1 -1
  16. package/public/docs/components/cart.md +1 -1
  17. package/public/docs/components/chart-panel.md +1 -1
  18. package/public/docs/components/chat-message.md +1 -1
  19. package/public/docs/components/chat-thread.md +1 -1
  20. package/public/docs/components/checkbox.md +1 -1
  21. package/public/docs/components/checkout-form.md +1 -1
  22. package/public/docs/components/command-palette.md +5 -2
  23. package/public/docs/components/data-table.md +1 -1
  24. package/public/docs/components/date-picker.md +166 -0
  25. package/public/docs/components/date-presets.md +111 -0
  26. package/public/docs/components/date-range-picker.md +135 -0
  27. package/public/docs/components/description-list.md +1 -1
  28. package/public/docs/components/dialog.md +1 -1
  29. package/public/docs/components/divider.md +1 -1
  30. package/public/docs/components/dropdown-menu.md +1 -1
  31. package/public/docs/components/empty-state.md +1 -1
  32. package/public/docs/components/footer.md +1 -1
  33. package/public/docs/components/form-field.md +2 -2
  34. package/public/docs/components/icon-button.md +1 -1
  35. package/public/docs/components/input.md +1 -1
  36. package/public/docs/components/kanban-board.md +1 -1
  37. package/public/docs/components/kbd.md +1 -1
  38. package/public/docs/components/link.md +1 -1
  39. package/public/docs/components/list-item.md +1 -1
  40. package/public/docs/components/loading-animation.md +1 -1
  41. package/public/docs/components/multi-select.md +5 -5
  42. package/public/docs/components/navbar.md +1 -1
  43. package/public/docs/components/newsletter-form.md +1 -1
  44. package/public/docs/components/page-header.md +1 -1
  45. package/public/docs/components/pagination.md +1 -1
  46. package/public/docs/components/product-card.md +1 -1
  47. package/public/docs/components/progress.md +1 -1
  48. package/public/docs/components/prompt-input.md +1 -1
  49. package/public/docs/components/quantity-stepper.md +2 -2
  50. package/public/docs/components/radio.md +1 -1
  51. package/public/docs/components/rating.md +1 -1
  52. package/public/docs/components/score-ring.md +1 -1
  53. package/public/docs/components/search.md +1 -1
  54. package/public/docs/components/section-heading.md +1 -1
  55. package/public/docs/components/segmented-control.md +1 -1
  56. package/public/docs/components/select.md +2 -2
  57. package/public/docs/components/sheet.md +1 -1
  58. package/public/docs/components/sidebar.md +1 -1
  59. package/public/docs/components/skeleton.md +1 -1
  60. package/public/docs/components/slider.md +1 -1
  61. package/public/docs/components/sparkline.md +1 -1
  62. package/public/docs/components/spinner.md +1 -1
  63. package/public/docs/components/stat.md +1 -1
  64. package/public/docs/components/status-tracker.md +1 -1
  65. package/public/docs/components/stepper.md +1 -1
  66. package/public/docs/components/switch.md +1 -1
  67. package/public/docs/components/tabs.md +1 -1
  68. package/public/docs/components/tag.md +1 -1
  69. package/public/docs/components/textarea.md +1 -1
  70. package/public/docs/components/time-field.md +127 -0
  71. package/public/docs/components/timeline.md +1 -1
  72. package/public/docs/components/toast.md +1 -1
  73. package/public/docs/components/tool-call.md +1 -1
  74. package/public/docs/components/tooltip.md +1 -1
  75. package/public/manifest/components.json +1045 -86
  76. package/scripts/lib/agent-docs.mjs +22 -1
  77. package/scripts/lib/mcp-tools.mjs +2 -14
  78. package/scripts/lib/props-validator.mjs +36 -2
  79. package/scripts/lib/search-score.mjs +24 -0
  80. package/skills/division-ds/SKILL.md +2 -2
  81. package/skills/division-ds/topics/forms.md +1 -1
  82. package/division-ds-0.2.1.tgz +0 -0
@@ -13,7 +13,7 @@
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.
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 { 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.
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 { 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.
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
 
@@ -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. An install has no index barrels: import each component from its own file, never from `components/molecules`.
17
+
18
+ ## Props
19
+
20
+ | Prop | Type | Default | Description |
21
+ |---|---|---|---|
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
+ | `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. It only spaces the list: a typed time between steps (09:07) is kept as typed. Check it yourself if it must fall on a step. |
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 value={date} onValueChange={setDate} />
87
+ </FormField>
88
+ <FormField label="Pickup time">
89
+ <TimeField 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,7 +13,7 @@
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.
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 { 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.
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 { 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.
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 { 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.
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