@tempoxyz/ds 0.3.14 → 0.3.16

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 (209) hide show
  1. package/dist/docs/AGENTS.md +75 -10
  2. package/dist/docs/arsenal.md +44 -0
  3. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +32 -24
  4. package/dist/docs/product/components/actions.md +2110 -0
  5. package/dist/docs/product/components/blockchain.md +3969 -0
  6. package/dist/docs/product/components/data-display.md +5901 -0
  7. package/dist/docs/product/components/feedback-and-status.md +4138 -0
  8. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  9. package/dist/docs/product/components/layout.md +3339 -0
  10. package/dist/docs/product/components/navigation.md +2914 -0
  11. package/dist/docs/product/components/overlays.md +4917 -0
  12. package/dist/docs/product/components.md +125 -125
  13. package/dist/docs/product/foundations.md +4597 -0
  14. package/dist/docs/product/patterns.md +10110 -0
  15. package/dist/marketing/index.js.zyzz.json +1 -1
  16. package/dist/marketing/vars.d.ts +618 -758
  17. package/dist/marketing/vars.d.ts.map +1 -1
  18. package/dist/marketing/vars.js +8 -5
  19. package/dist/marketing/vars.js.map +1 -1
  20. package/dist/marketing/vars.js.zyzz.json +1 -1
  21. package/dist/marketing/zyzz.config.d.ts +3042 -3757
  22. package/dist/marketing/zyzz.config.d.ts.map +1 -1
  23. package/dist/marketing/zyzz.config.js +1 -1
  24. package/dist/marketing/zyzz.config.js.map +1 -1
  25. package/dist/marketing/zyzz.config.js.zyzz.json +1 -1
  26. package/dist/mobile/components/Button.d.ts +115 -15
  27. package/dist/mobile/components/Button.d.ts.map +1 -1
  28. package/dist/mobile/components/Button.js +85 -14
  29. package/dist/mobile/components/Button.js.map +1 -1
  30. package/dist/mobile/components/IconButton.d.ts +129 -40
  31. package/dist/mobile/components/IconButton.d.ts.map +1 -1
  32. package/dist/mobile/components/IconButton.js +97 -28
  33. package/dist/mobile/components/IconButton.js.map +1 -1
  34. package/dist/mobile/components/TextInput.d.ts +132 -11
  35. package/dist/mobile/components/TextInput.d.ts.map +1 -1
  36. package/dist/mobile/components/TextInput.js +115 -14
  37. package/dist/mobile/components/TextInput.js.map +1 -1
  38. package/dist/mobile/index.d.ts +1 -0
  39. package/dist/mobile/index.d.ts.map +1 -1
  40. package/dist/mobile/index.js +1 -0
  41. package/dist/mobile/index.js.map +1 -1
  42. package/dist/mobile/vars.d.ts +103 -0
  43. package/dist/mobile/vars.d.ts.map +1 -1
  44. package/dist/mobile/vars.js +74 -0
  45. package/dist/mobile/vars.js.map +1 -1
  46. package/dist/mobile/zyzz.config.d.ts +408 -0
  47. package/dist/mobile/zyzz.config.d.ts.map +1 -1
  48. package/dist/web/components/AddressCard.js.zyzz.json +1 -1
  49. package/dist/web/components/Amount.css +1 -1
  50. package/dist/web/components/Amount.d.ts +9 -0
  51. package/dist/web/components/Amount.d.ts.map +1 -1
  52. package/dist/web/components/Amount.js +8 -5
  53. package/dist/web/components/Amount.js.map +1 -1
  54. package/dist/web/components/Amount.js.zyzz.json +1 -1
  55. package/dist/web/components/CopyButton.d.ts +6 -0
  56. package/dist/web/components/CopyButton.d.ts.map +1 -1
  57. package/dist/web/components/CopyButton.js +4 -1
  58. package/dist/web/components/CopyButton.js.map +1 -1
  59. package/dist/web/components/CopyButton.js.zyzz.json +1 -1
  60. package/dist/web/components/Hex.css +1 -1
  61. package/dist/web/components/Hex.d.ts +84 -3
  62. package/dist/web/components/Hex.d.ts.map +1 -1
  63. package/dist/web/components/Hex.js +20 -13
  64. package/dist/web/components/Hex.js.map +1 -1
  65. package/dist/web/components/Hex.js.zyzz.json +1 -1
  66. package/dist/web/components/Progress.css +1 -1
  67. package/dist/web/components/Progress.d.ts +12 -2
  68. package/dist/web/components/Progress.d.ts.map +1 -1
  69. package/dist/web/components/Progress.js +9 -5
  70. package/dist/web/components/Progress.js.map +1 -1
  71. package/dist/web/components/Progress.js.zyzz.json +1 -1
  72. package/dist/web/components/SecretValue.js.zyzz.json +1 -1
  73. package/dist/web/components/SidebarMenu.d.ts +4 -4
  74. package/dist/web/components/SidebarMenu.js +6 -6
  75. package/dist/web/components/SidebarMenu.js.map +1 -1
  76. package/dist/web/components/Snippet.js.zyzz.json +1 -1
  77. package/dist/web/index.js.zyzz.json +1 -1
  78. package/package.json +1 -1
  79. package/src/marketing/README.md +1 -1
  80. package/src/marketing/vars.ts +526 -604
  81. package/src/marketing/zyzz.config.ts +5 -4
  82. package/src/mobile/README.md +19 -6
  83. package/src/mobile/components/Button.tsx +94 -17
  84. package/src/mobile/components/IconButton.tsx +122 -30
  85. package/src/mobile/components/TextInput.tsx +139 -24
  86. package/src/mobile/index.ts +1 -0
  87. package/src/mobile/vars.ts +74 -0
  88. package/src/web/components/Amount.tsx +37 -3
  89. package/src/web/components/CopyButton.tsx +8 -0
  90. package/src/web/components/Hex.tsx +79 -13
  91. package/src/web/components/Progress.tsx +8 -2
  92. package/src/web/components/SidebarMenu.tsx +6 -6
  93. package/dist/docs/index.md +0 -145
  94. package/dist/docs/product/components/accordion.md +0 -489
  95. package/dist/docs/product/components/address-card.md +0 -147
  96. package/dist/docs/product/components/agent-logo.md +0 -194
  97. package/dist/docs/product/components/alert-dialog.md +0 -631
  98. package/dist/docs/product/components/alert.md +0 -448
  99. package/dist/docs/product/components/amount-input.md +0 -305
  100. package/dist/docs/product/components/amount.md +0 -794
  101. package/dist/docs/product/components/app-shell.md +0 -559
  102. package/dist/docs/product/components/asset-chip.md +0 -294
  103. package/dist/docs/product/components/autocomplete.md +0 -620
  104. package/dist/docs/product/components/avatar.md +0 -321
  105. package/dist/docs/product/components/badge.md +0 -339
  106. package/dist/docs/product/components/badged-logo.md +0 -116
  107. package/dist/docs/product/components/banner.md +0 -379
  108. package/dist/docs/product/components/bar-chart.md +0 -208
  109. package/dist/docs/product/components/breadcrumbs.md +0 -380
  110. package/dist/docs/product/components/button-group.md +0 -286
  111. package/dist/docs/product/components/button.md +0 -650
  112. package/dist/docs/product/components/calendar.md +0 -375
  113. package/dist/docs/product/components/callout.md +0 -96
  114. package/dist/docs/product/components/checkbox-group.md +0 -521
  115. package/dist/docs/product/components/checkbox.md +0 -467
  116. package/dist/docs/product/components/choice-group.md +0 -516
  117. package/dist/docs/product/components/choicebox.md +0 -641
  118. package/dist/docs/product/components/code.md +0 -100
  119. package/dist/docs/product/components/combobox.md +0 -939
  120. package/dist/docs/product/components/container.md +0 -257
  121. package/dist/docs/product/components/copy-button.md +0 -642
  122. package/dist/docs/product/components/date-picker.md +0 -514
  123. package/dist/docs/product/components/dialog.md +0 -1332
  124. package/dist/docs/product/components/drawer.md +0 -966
  125. package/dist/docs/product/components/empty.md +0 -340
  126. package/dist/docs/product/components/field.md +0 -570
  127. package/dist/docs/product/components/fieldset.md +0 -398
  128. package/dist/docs/product/components/frame.md +0 -434
  129. package/dist/docs/product/components/gauge.md +0 -299
  130. package/dist/docs/product/components/get-started-visual.md +0 -117
  131. package/dist/docs/product/components/grid.md +0 -288
  132. package/dist/docs/product/components/hero-visual.md +0 -155
  133. package/dist/docs/product/components/hex.md +0 -487
  134. package/dist/docs/product/components/icon-tile.md +0 -292
  135. package/dist/docs/product/components/identicon.md +0 -371
  136. package/dist/docs/product/components/inline.md +0 -233
  137. package/dist/docs/product/components/inset.md +0 -225
  138. package/dist/docs/product/components/kbd.md +0 -423
  139. package/dist/docs/product/components/list-group.md +0 -981
  140. package/dist/docs/product/components/loading-dots.md +0 -237
  141. package/dist/docs/product/components/menu.md +0 -934
  142. package/dist/docs/product/components/native-select.md +0 -204
  143. package/dist/docs/product/components/network-logo.md +0 -248
  144. package/dist/docs/product/components/number-field.md +0 -543
  145. package/dist/docs/product/components/otp-field.md +0 -616
  146. package/dist/docs/product/components/pagination.md +0 -516
  147. package/dist/docs/product/components/popover.md +0 -544
  148. package/dist/docs/product/components/progress.md +0 -388
  149. package/dist/docs/product/components/qr.md +0 -314
  150. package/dist/docs/product/components/radio-group.md +0 -528
  151. package/dist/docs/product/components/secret-value.md +0 -406
  152. package/dist/docs/product/components/select.md +0 -751
  153. package/dist/docs/product/components/separator.md +0 -379
  154. package/dist/docs/product/components/sidebar-menu.md +0 -922
  155. package/dist/docs/product/components/skeleton.md +0 -517
  156. package/dist/docs/product/components/slider.md +0 -539
  157. package/dist/docs/product/components/snippet.md +0 -424
  158. package/dist/docs/product/components/spinner.md +0 -216
  159. package/dist/docs/product/components/split-bar.md +0 -139
  160. package/dist/docs/product/components/split-button.md +0 -464
  161. package/dist/docs/product/components/stack.md +0 -299
  162. package/dist/docs/product/components/status-chip.md +0 -226
  163. package/dist/docs/product/components/status-indicator.md +0 -119
  164. package/dist/docs/product/components/status-row.md +0 -174
  165. package/dist/docs/product/components/stepper.md +0 -451
  166. package/dist/docs/product/components/success-hero.md +0 -157
  167. package/dist/docs/product/components/surface.md +0 -639
  168. package/dist/docs/product/components/switch.md +0 -472
  169. package/dist/docs/product/components/table.md +0 -968
  170. package/dist/docs/product/components/tabs.md +0 -627
  171. package/dist/docs/product/components/tempo-logo.md +0 -185
  172. package/dist/docs/product/components/text-input.md +0 -624
  173. package/dist/docs/product/components/textarea.md +0 -352
  174. package/dist/docs/product/components/toast.md +0 -535
  175. package/dist/docs/product/components/token-logo.md +0 -371
  176. package/dist/docs/product/components/token.md +0 -247
  177. package/dist/docs/product/components/tooltip.md +0 -490
  178. package/dist/docs/product/components/verification-code.md +0 -116
  179. package/dist/docs/product/components/visual.md +0 -249
  180. package/dist/docs/product/foundations/accessibility.md +0 -377
  181. package/dist/docs/product/foundations/agents.md +0 -159
  182. package/dist/docs/product/foundations/color.md +0 -522
  183. package/dist/docs/product/foundations/content/tone.md +0 -194
  184. package/dist/docs/product/foundations/content/voice.md +0 -194
  185. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  186. package/dist/docs/product/foundations/iconography.md +0 -282
  187. package/dist/docs/product/foundations/intent.md +0 -360
  188. package/dist/docs/product/foundations/layout.md +0 -508
  189. package/dist/docs/product/foundations/linter.md +0 -523
  190. package/dist/docs/product/foundations/motion.md +0 -151
  191. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  192. package/dist/docs/product/foundations/typography.md +0 -331
  193. package/dist/docs/product/introduction/faq.md +0 -133
  194. package/dist/docs/product/introduction/getting-started.md +0 -377
  195. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  196. package/dist/docs/product/patterns/dashboards.md +0 -638
  197. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  198. package/dist/docs/product/patterns/empty-states.md +0 -612
  199. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  200. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  201. package/dist/docs/product/patterns/forms.md +0 -679
  202. package/dist/docs/product/patterns/loading.md +0 -630
  203. package/dist/docs/product/patterns/navigation.md +0 -397
  204. package/dist/docs/product/patterns/payments.md +0 -765
  205. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  206. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  207. package/dist/docs/product/products/tempo-console.md +0 -671
  208. package/dist/docs/product/products/tempo-performance.md +0 -435
  209. package/dist/docs/product/products/tempo-wallet.md +0 -438
@@ -1,514 +0,0 @@
1
- # DatePicker
2
-
3
- Shows the selected date and opens a calendar in a popup.
4
-
5
- [View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/DatePicker.tsx)
6
-
7
- ## Overview
8
-
9
- A date picker is a button that shows the selected date and opens a calendar in a popup. It has no text entry.
10
-
11
- ## Examples
12
-
13
- ### Basic
14
-
15
- ```tsx
16
- import { DatePicker } from '@tempoxyz/ds'
17
-
18
- export function Demo() {
19
- return (
20
- <DatePicker.Root>
21
- <DatePicker.Trigger />
22
- <DatePicker.Popup>
23
- <DatePicker.Calendar />
24
- </DatePicker.Popup>
25
- </DatePicker.Root>
26
- )
27
- }
28
- ```
29
-
30
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/DatePicker/Basic.tsx)
31
-
32
- ### Variant
33
-
34
- Set `variant` on `DatePicker.Trigger` to `filled` (default) or `outlined`.
35
-
36
- ```tsx
37
- import { DatePicker, style } from '@tempoxyz/ds'
38
-
39
- export function Demo() {
40
- return (
41
- <div {...styles.row()}>
42
- {(['filled', 'outlined'] as const).map((variant) => (
43
- <DatePicker.Root key={variant}>
44
- <DatePicker.Trigger variant={variant} />
45
- <DatePicker.Popup>
46
- <DatePicker.Calendar />
47
- </DatePicker.Popup>
48
- </DatePicker.Root>
49
- ))}
50
- </div>
51
- )
52
- }
53
-
54
- namespace styles {
55
- export const row = style({
56
- alignItems: 'flex-start',
57
- display: 'flex',
58
- flexWrap: 'wrap',
59
- gap: '24',
60
- })
61
- }
62
- ```
63
-
64
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/DatePicker/Variant.tsx)
65
-
66
- ### Mode
67
-
68
- Set `mode="range"` on `DatePicker.Root` to select a range. It defaults to `single`.
69
-
70
- ```tsx
71
- import { DatePicker } from '@tempoxyz/ds'
72
-
73
- export function Demo() {
74
- return (
75
- <DatePicker.Root mode="range">
76
- <DatePicker.Trigger placeholder="Select range" />
77
- <DatePicker.Popup>
78
- <DatePicker.Calendar />
79
- </DatePicker.Popup>
80
- </DatePicker.Root>
81
- )
82
- }
83
- ```
84
-
85
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/DatePicker/Mode.tsx)
86
-
87
- ### Invalid
88
-
89
- Set `aria-invalid` on `DatePicker.Trigger` to mark it invalid.
90
-
91
- ```tsx
92
- import { DatePicker } from '@tempoxyz/ds'
93
-
94
- export function Demo() {
95
- return (
96
- <DatePicker.Root>
97
- <DatePicker.Trigger aria-invalid />
98
- <DatePicker.Popup>
99
- <DatePicker.Calendar />
100
- </DatePicker.Popup>
101
- </DatePicker.Root>
102
- )
103
- }
104
- ```
105
-
106
- [View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/DatePicker/Invalid.tsx)
107
-
108
- ## Anatomy
109
-
110
- Import the component and assemble its parts.
111
-
112
- ```tsx
113
- import { DatePicker } from '@tempoxyz/ds'
114
-
115
- <DatePicker.Root>
116
- <DatePicker.Trigger />
117
- <DatePicker.Popup>
118
- <DatePicker.Calendar />
119
- </DatePicker.Popup>
120
- </DatePicker.Root>
121
- ```
122
-
123
- ## Guidelines
124
-
125
- ### When to Use
126
-
127
- * Enter a date as one field in a form, such as the expiry date of an API key.
128
- * Enter a range with `mode="range"`, such as the period of a statement export.
129
-
130
- ### When Not to Use
131
-
132
- * Use [Calendar](calendar.md) when the grid stays visible, such as in a filter panel.
133
- * Use [TextInput](text-input.md) for memorable dates far from today, such as a date of birth.
134
- * Use [ChoiceGroup](choice-group.md) or [Select](select.md) for preset periods, such as 7D or Last 30 days.
135
-
136
- ### Label the Trigger
137
-
138
- The trigger shows only the date or the placeholder, and `Field.Label` doesn't link to it. Point its `aria-labelledby` at a visible label and at the trigger's own `id`.
139
-
140
- **Do:** Put a visible label above the trigger and reference it with `aria-labelledby`.
141
-
142
- ```tsx
143
- /**
144
- * Do example for "Label the Trigger" on the DatePicker page.
145
- * Put a visible label above the trigger and reference it with `aria-labelledby`.
146
- * @module
147
- */
148
- import { DatePicker, style } from '@tempoxyz/ds'
149
-
150
- /** Renders the static preview, which the guideline card shows inert. */
151
- export function Demo() {
152
- return (
153
- <div {...styles.field()}>
154
- <span id="guideline-expiry-label" {...styles.label()}>
155
- Key expires on
156
- </span>
157
- <DatePicker.Root defaultValue={new Date(2027, 0, 31)}>
158
- <DatePicker.Trigger
159
- aria-labelledby="guideline-expiry-label guideline-expiry"
160
- id="guideline-expiry"
161
- />
162
- <DatePicker.Popup>
163
- <DatePicker.Calendar />
164
- </DatePicker.Popup>
165
- </DatePicker.Root>
166
- </div>
167
- )
168
- }
169
-
170
- namespace styles {
171
- export const field = style({ display: 'grid', rowGap: '8', width: '100% !custom' })
172
-
173
- export const label = style({ color: 'content.primary', typography: 'body.b3Strong' })
174
- }
175
- ```
176
-
177
- **Don't:** Leave the trigger to explain itself with Select date.
178
-
179
- ```tsx
180
- /**
181
- * Don't example for "Label the Trigger" on the DatePicker page.
182
- * Don't leave the trigger to explain itself with Select date.
183
- * @module
184
- */
185
- import { DatePicker, style } from '@tempoxyz/ds'
186
-
187
- /** Renders the static preview, which the guideline card shows inert. */
188
- export function Demo() {
189
- return (
190
- <div {...styles.field()}>
191
- <DatePicker.Root>
192
- <DatePicker.Trigger />
193
- <DatePicker.Popup>
194
- <DatePicker.Calendar />
195
- </DatePicker.Popup>
196
- </DatePicker.Root>
197
- </div>
198
- )
199
- }
200
-
201
- namespace styles {
202
- export const field = style({ display: 'grid', width: '100% !custom' })
203
- }
204
- ```
205
-
206
- ### State Date Limits in Text
207
-
208
- Pass `min`, `max`, and `isDateDisabled` to `DatePicker.Root`, which passes them to `DatePicker.Calendar`. Describe the limit below the trigger, and point `aria-describedby` at it.
209
-
210
- **Do:** State the allowed range below the trigger, such as Choose a date within one year.
211
-
212
- ```tsx
213
- /**
214
- * Do example for "State Date Limits in Text" on the DatePicker page.
215
- * State the allowed range below the trigger, such as Choose a date within one year.
216
- * @module
217
- */
218
- import { DatePicker, style } from '@tempoxyz/ds'
219
-
220
- /** Renders the static preview, which the guideline card shows inert. */
221
- export function Demo() {
222
- return (
223
- <div {...styles.field()}>
224
- <span id="guideline-stated-limit-label" {...styles.label()}>
225
- Key expires on
226
- </span>
227
- <DatePicker.Root max={new Date(2027, 9, 21)} min={new Date(2026, 9, 21)}>
228
- <DatePicker.Trigger
229
- aria-labelledby="guideline-stated-limit-label guideline-stated-limit"
230
- aria-describedby="guideline-stated-limit-hint"
231
- id="guideline-stated-limit"
232
- />
233
- <DatePicker.Popup>
234
- <DatePicker.Calendar />
235
- </DatePicker.Popup>
236
- </DatePicker.Root>
237
- <span id="guideline-stated-limit-hint" {...styles.hint()}>
238
- Choose a date within one year.
239
- </span>
240
- </div>
241
- )
242
- }
243
-
244
- namespace styles {
245
- export const field = style({ display: 'grid', rowGap: '8', width: '100% !custom' })
246
-
247
- export const label = style({ color: 'content.primary', typography: 'body.b3Strong' })
248
-
249
- export const hint = style({ color: 'content.secondary', typography: 'body.b3' })
250
- }
251
- ```
252
-
253
- **Don't:** Leave people to find the limit by paging through the calendar.
254
-
255
- ```tsx
256
- /**
257
- * Don't example for "State Date Limits in Text" on the DatePicker page.
258
- * Don't leave people to find the limit by paging through the calendar.
259
- * @module
260
- */
261
- import { DatePicker, style } from '@tempoxyz/ds'
262
-
263
- /** Renders the static preview, which the guideline card shows inert. */
264
- export function Demo() {
265
- return (
266
- <div {...styles.field()}>
267
- <span id="guideline-unstated-limit-label" {...styles.label()}>
268
- Key expires on
269
- </span>
270
- <DatePicker.Root max={new Date(2027, 9, 21)} min={new Date(2026, 9, 21)}>
271
- <DatePicker.Trigger
272
- aria-labelledby="guideline-unstated-limit-label guideline-unstated-limit"
273
- id="guideline-unstated-limit"
274
- />
275
- <DatePicker.Popup>
276
- <DatePicker.Calendar />
277
- </DatePicker.Popup>
278
- </DatePicker.Root>
279
- </div>
280
- )
281
- }
282
-
283
- namespace styles {
284
- export const field = style({ display: 'grid', rowGap: '8', width: '100% !custom' })
285
-
286
- export const label = style({ color: 'content.primary', typography: 'body.b3Strong' })
287
- }
288
- ```
289
-
290
- ### Show Errors in Text
291
-
292
- Set `aria-invalid` on `DatePicker.Trigger` to fill it red. Put the error text below the trigger and point `aria-describedby` at it. `Field.Error` doesn't link to the trigger.
293
-
294
- **Do:** Pair the red fill with error text that names the fix.
295
-
296
- ```tsx
297
- /**
298
- * Do example for "Show Errors in Text" on the DatePicker page.
299
- * Pair the red fill with error text that names the fix.
300
- * @module
301
- */
302
- import { DatePicker, style } from '@tempoxyz/ds'
303
-
304
- /** Renders the static preview, which the guideline card shows inert. */
305
- export function Demo() {
306
- return (
307
- <div {...styles.field()}>
308
- <span id="guideline-error-text-label" {...styles.label()}>
309
- Key expires on
310
- </span>
311
- <DatePicker.Root defaultValue={new Date(2026, 9, 1)}>
312
- <DatePicker.Trigger
313
- aria-labelledby="guideline-error-text-label guideline-error-text"
314
- aria-describedby="guideline-error-text-error"
315
- aria-invalid
316
- id="guideline-error-text"
317
- />
318
- <DatePicker.Popup>
319
- <DatePicker.Calendar />
320
- </DatePicker.Popup>
321
- </DatePicker.Root>
322
- <span id="guideline-error-text-error" {...styles.error()}>
323
- Choose a date after today.
324
- </span>
325
- </div>
326
- )
327
- }
328
-
329
- namespace styles {
330
- export const field = style({ display: 'grid', rowGap: '8', width: '100% !custom' })
331
-
332
- export const label = style({ color: 'content.primary', typography: 'body.b3Strong' })
333
-
334
- export const error = style({ color: 'content.negative', typography: 'body.b3' })
335
- }
336
- ```
337
-
338
- **Don't:** Mark the trigger invalid without saying what is wrong.
339
-
340
- ```tsx
341
- /**
342
- * Don't example for "Show Errors in Text" on the DatePicker page.
343
- * Don't mark the trigger invalid without saying what is wrong.
344
- * @module
345
- */
346
- import { DatePicker, style } from '@tempoxyz/ds'
347
-
348
- /** Renders the static preview, which the guideline card shows inert. */
349
- export function Demo() {
350
- return (
351
- <div {...styles.field()}>
352
- <span id="guideline-error-ring-label" {...styles.label()}>
353
- Key expires on
354
- </span>
355
- <DatePicker.Root defaultValue={new Date(2026, 9, 1)}>
356
- <DatePicker.Trigger
357
- aria-labelledby="guideline-error-ring-label guideline-error-ring"
358
- aria-invalid
359
- id="guideline-error-ring"
360
- />
361
- <DatePicker.Popup>
362
- <DatePicker.Calendar />
363
- </DatePicker.Popup>
364
- </DatePicker.Root>
365
- </div>
366
- )
367
- }
368
-
369
- namespace styles {
370
- export const field = style({ display: 'grid', rowGap: '8', width: '100% !custom' })
371
-
372
- export const label = style({ color: 'content.primary', typography: 'body.b3Strong' })
373
- }
374
- ```
375
-
376
- ### Match the Fields Around It
377
-
378
- `DatePicker.Trigger` is as tall as a [TextInput](text-input.md), at 48px. Use the same variant as the fields beside it.
379
-
380
- **Do:** Give the trigger the variant of the inputs in the same row.
381
-
382
- ```tsx
383
- /**
384
- * Do example for "Match the Fields Around It" on the DatePicker page.
385
- * Give the trigger the variant of the inputs in the same row.
386
- * @module
387
- */
388
- import { DatePicker, style, TextInput } from '@tempoxyz/ds'
389
-
390
- /** Renders the static preview, which the guideline card shows inert. */
391
- export function Demo() {
392
- return (
393
- <div {...styles.row()}>
394
- <TextInput.Group {...styles.cell()}>
395
- <TextInput.Control aria-label="Key name" defaultValue="Checkout server" />
396
- </TextInput.Group>
397
- <DatePicker.Root defaultValue={new Date(2027, 0, 31)}>
398
- <DatePicker.Trigger aria-label="Key expires on" {...styles.cell()} />
399
- <DatePicker.Popup>
400
- <DatePicker.Calendar />
401
- </DatePicker.Popup>
402
- </DatePicker.Root>
403
- </div>
404
- )
405
- }
406
-
407
- namespace styles {
408
- export const cell = style({ flex: '1 !custom', minWidth: '0 !custom' })
409
-
410
- export const row = style({
411
- alignItems: 'center',
412
- display: 'flex',
413
- gap: '8',
414
- width: '100% !custom',
415
- })
416
- }
417
- ```
418
-
419
- **Don't:** Mix an `outlined` trigger with filled inputs.
420
-
421
- ```tsx
422
- /**
423
- * Don't example for "Match the Fields Around It" on the DatePicker page.
424
- * Don't mix an `outlined` trigger with filled inputs.
425
- * @module
426
- */
427
- import { DatePicker, style, TextInput } from '@tempoxyz/ds'
428
-
429
- /** Renders the static preview, which the guideline card shows inert. */
430
- export function Demo() {
431
- return (
432
- <div {...styles.row()}>
433
- <TextInput.Group {...styles.cell()}>
434
- <TextInput.Control aria-label="Key name" defaultValue="Checkout server" />
435
- </TextInput.Group>
436
- <DatePicker.Root defaultValue={new Date(2027, 0, 31)}>
437
- <DatePicker.Trigger aria-label="Key expires on" variant="outlined" {...styles.cell()} />
438
- <DatePicker.Popup>
439
- <DatePicker.Calendar />
440
- </DatePicker.Popup>
441
- </DatePicker.Root>
442
- </div>
443
- )
444
- }
445
-
446
- namespace styles {
447
- export const cell = style({ flex: '1 !custom', minWidth: '0 !custom' })
448
-
449
- export const row = style({
450
- alignItems: 'center',
451
- display: 'flex',
452
- gap: '8',
453
- width: '100% !custom',
454
- })
455
- }
456
- ```
457
-
458
- ## Content
459
-
460
- * **Label:** Name the date, such as Key expires on or Start date.
461
- * **Placeholder:** Keep Select date in single mode. In range mode, use Select dates.
462
- * **Value:** The trigger formats it with `Intl.DateTimeFormat` in the medium date style for `locale`, such as Jan 31, 2027, and a range as one span.
463
-
464
- ## Accessibility
465
-
466
- A date picker renders a button that opens a calendar in a popup dialog. It follows the [WAI-ARIA Authoring Practices date picker dialog example](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/), except that the popup is not modal.
467
-
468
- ### Semantics
469
-
470
- * **DatePicker.Trigger (button):** Announces that it opens a dialog, and whether the dialog is open.
471
- * **DatePicker.Popup (dialog):** Renders a `dialog` named "Choose date" unless you pass `aria-label`.
472
- * **DatePicker.Calendar (grid):** Uses the grid semantics described on [Calendar](calendar.md#accessibility).
473
- * **Target Size (48px):** The trigger is above the 24px WCAG 2.2 minimum.
474
-
475
- ### Keyboard
476
-
477
- * **Move Focus to the Trigger (Tab):** Moves focus to the trigger.
478
- * **Open the Popup (Enter or Space):** On the trigger, opens the popup and focuses a day.
479
- * **Move Through Dates (Arrow keys):** Home, End, Page Up, and Page Down also move, as on [Calendar](calendar.md#keyboard).
480
- * **Select a Day (Enter or Space):** On a day, selects it and closes the popup. In `range` mode, the popup closes after the end date.
481
- * **Move Within the Popup (Tab and Shift+Tab):** Move between the month buttons and the day grid.
482
- * **Close the Popup (Escape):** Closes the popup without a change, and returns focus to the trigger.
483
-
484
- ### Focus
485
-
486
- When the popup opens, focus moves to the selected day, or today. The popup doesn't trap focus, so Tab can leave it.
487
-
488
- ### Your Responsibilities
489
-
490
- * **Name the Trigger (aria-labelledby):** Point it at the visible label and the trigger, so the name includes the date.
491
- * **Name Each Popup (aria-label):** If a page has several pickers, name each popup, such as "Choose start date".
492
- * **Link the Error Text (aria-describedby):** Point it at the error text below the trigger.
493
-
494
- ## Related
495
-
496
- [Calendar](calendar.md)
497
-
498
- Use for an inline month grid.
499
-
500
- [TextInput](text-input.md)
501
-
502
- Use for typed and native dates.
503
-
504
- [Popover](popover.md)
505
-
506
- Use for other anchored popups.
507
-
508
- [Field](field.md)
509
-
510
- Use for labels and errors on other controls.
511
-
512
- [Forms](../patterns/forms.md)
513
-
514
- Covers placing a date among other fields.