@tempoxyz/ds 0.3.14 → 0.3.15

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 (131) hide show
  1. package/dist/docs/AGENTS.md +73 -10
  2. package/dist/docs/{marketing/introduction/getting-started.md → marketing.md} +28 -20
  3. package/dist/docs/product/components/actions.md +2058 -0
  4. package/dist/docs/product/components/blockchain.md +3825 -0
  5. package/dist/docs/product/components/data-display.md +5901 -0
  6. package/dist/docs/product/components/feedback-and-status.md +4008 -0
  7. package/dist/docs/product/components/forms-and-inputs.md +10543 -0
  8. package/dist/docs/product/components/layout.md +3339 -0
  9. package/dist/docs/product/components/navigation.md +2914 -0
  10. package/dist/docs/product/components/overlays.md +4917 -0
  11. package/dist/docs/product/components.md +125 -125
  12. package/dist/docs/product/foundations.md +4596 -0
  13. package/dist/docs/product/patterns.md +10129 -0
  14. package/package.json +1 -1
  15. package/dist/docs/index.md +0 -145
  16. package/dist/docs/product/components/accordion.md +0 -489
  17. package/dist/docs/product/components/address-card.md +0 -147
  18. package/dist/docs/product/components/agent-logo.md +0 -194
  19. package/dist/docs/product/components/alert-dialog.md +0 -631
  20. package/dist/docs/product/components/alert.md +0 -448
  21. package/dist/docs/product/components/amount-input.md +0 -305
  22. package/dist/docs/product/components/amount.md +0 -794
  23. package/dist/docs/product/components/app-shell.md +0 -559
  24. package/dist/docs/product/components/asset-chip.md +0 -294
  25. package/dist/docs/product/components/autocomplete.md +0 -620
  26. package/dist/docs/product/components/avatar.md +0 -321
  27. package/dist/docs/product/components/badge.md +0 -339
  28. package/dist/docs/product/components/badged-logo.md +0 -116
  29. package/dist/docs/product/components/banner.md +0 -379
  30. package/dist/docs/product/components/bar-chart.md +0 -208
  31. package/dist/docs/product/components/breadcrumbs.md +0 -380
  32. package/dist/docs/product/components/button-group.md +0 -286
  33. package/dist/docs/product/components/button.md +0 -650
  34. package/dist/docs/product/components/calendar.md +0 -375
  35. package/dist/docs/product/components/callout.md +0 -96
  36. package/dist/docs/product/components/checkbox-group.md +0 -521
  37. package/dist/docs/product/components/checkbox.md +0 -467
  38. package/dist/docs/product/components/choice-group.md +0 -516
  39. package/dist/docs/product/components/choicebox.md +0 -641
  40. package/dist/docs/product/components/code.md +0 -100
  41. package/dist/docs/product/components/combobox.md +0 -939
  42. package/dist/docs/product/components/container.md +0 -257
  43. package/dist/docs/product/components/copy-button.md +0 -642
  44. package/dist/docs/product/components/date-picker.md +0 -514
  45. package/dist/docs/product/components/dialog.md +0 -1332
  46. package/dist/docs/product/components/drawer.md +0 -966
  47. package/dist/docs/product/components/empty.md +0 -340
  48. package/dist/docs/product/components/field.md +0 -570
  49. package/dist/docs/product/components/fieldset.md +0 -398
  50. package/dist/docs/product/components/frame.md +0 -434
  51. package/dist/docs/product/components/gauge.md +0 -299
  52. package/dist/docs/product/components/get-started-visual.md +0 -117
  53. package/dist/docs/product/components/grid.md +0 -288
  54. package/dist/docs/product/components/hero-visual.md +0 -155
  55. package/dist/docs/product/components/hex.md +0 -487
  56. package/dist/docs/product/components/icon-tile.md +0 -292
  57. package/dist/docs/product/components/identicon.md +0 -371
  58. package/dist/docs/product/components/inline.md +0 -233
  59. package/dist/docs/product/components/inset.md +0 -225
  60. package/dist/docs/product/components/kbd.md +0 -423
  61. package/dist/docs/product/components/list-group.md +0 -981
  62. package/dist/docs/product/components/loading-dots.md +0 -237
  63. package/dist/docs/product/components/menu.md +0 -934
  64. package/dist/docs/product/components/native-select.md +0 -204
  65. package/dist/docs/product/components/network-logo.md +0 -248
  66. package/dist/docs/product/components/number-field.md +0 -543
  67. package/dist/docs/product/components/otp-field.md +0 -616
  68. package/dist/docs/product/components/pagination.md +0 -516
  69. package/dist/docs/product/components/popover.md +0 -544
  70. package/dist/docs/product/components/progress.md +0 -388
  71. package/dist/docs/product/components/qr.md +0 -314
  72. package/dist/docs/product/components/radio-group.md +0 -528
  73. package/dist/docs/product/components/secret-value.md +0 -406
  74. package/dist/docs/product/components/select.md +0 -751
  75. package/dist/docs/product/components/separator.md +0 -379
  76. package/dist/docs/product/components/sidebar-menu.md +0 -922
  77. package/dist/docs/product/components/skeleton.md +0 -517
  78. package/dist/docs/product/components/slider.md +0 -539
  79. package/dist/docs/product/components/snippet.md +0 -424
  80. package/dist/docs/product/components/spinner.md +0 -216
  81. package/dist/docs/product/components/split-bar.md +0 -139
  82. package/dist/docs/product/components/split-button.md +0 -464
  83. package/dist/docs/product/components/stack.md +0 -299
  84. package/dist/docs/product/components/status-chip.md +0 -226
  85. package/dist/docs/product/components/status-indicator.md +0 -119
  86. package/dist/docs/product/components/status-row.md +0 -174
  87. package/dist/docs/product/components/stepper.md +0 -451
  88. package/dist/docs/product/components/success-hero.md +0 -157
  89. package/dist/docs/product/components/surface.md +0 -639
  90. package/dist/docs/product/components/switch.md +0 -472
  91. package/dist/docs/product/components/table.md +0 -968
  92. package/dist/docs/product/components/tabs.md +0 -627
  93. package/dist/docs/product/components/tempo-logo.md +0 -185
  94. package/dist/docs/product/components/text-input.md +0 -624
  95. package/dist/docs/product/components/textarea.md +0 -352
  96. package/dist/docs/product/components/toast.md +0 -535
  97. package/dist/docs/product/components/token-logo.md +0 -371
  98. package/dist/docs/product/components/token.md +0 -247
  99. package/dist/docs/product/components/tooltip.md +0 -490
  100. package/dist/docs/product/components/verification-code.md +0 -116
  101. package/dist/docs/product/components/visual.md +0 -249
  102. package/dist/docs/product/foundations/accessibility.md +0 -377
  103. package/dist/docs/product/foundations/agents.md +0 -159
  104. package/dist/docs/product/foundations/color.md +0 -522
  105. package/dist/docs/product/foundations/content/tone.md +0 -194
  106. package/dist/docs/product/foundations/content/voice.md +0 -194
  107. package/dist/docs/product/foundations/content/writing-style.md +0 -406
  108. package/dist/docs/product/foundations/iconography.md +0 -282
  109. package/dist/docs/product/foundations/intent.md +0 -360
  110. package/dist/docs/product/foundations/layout.md +0 -508
  111. package/dist/docs/product/foundations/linter.md +0 -523
  112. package/dist/docs/product/foundations/motion.md +0 -151
  113. package/dist/docs/product/foundations/radius-and-padding.md +0 -86
  114. package/dist/docs/product/foundations/typography.md +0 -331
  115. package/dist/docs/product/introduction/faq.md +0 -133
  116. package/dist/docs/product/introduction/getting-started.md +0 -377
  117. package/dist/docs/product/patterns/blockchain-values.md +0 -709
  118. package/dist/docs/product/patterns/dashboards.md +0 -638
  119. package/dist/docs/product/patterns/destructive-actions.md +0 -626
  120. package/dist/docs/product/patterns/empty-states.md +0 -612
  121. package/dist/docs/product/patterns/errors-and-validation.md +0 -808
  122. package/dist/docs/product/patterns/feedback-and-status.md +0 -518
  123. package/dist/docs/product/patterns/forms.md +0 -679
  124. package/dist/docs/product/patterns/loading.md +0 -630
  125. package/dist/docs/product/patterns/navigation.md +0 -397
  126. package/dist/docs/product/patterns/payments.md +0 -765
  127. package/dist/docs/product/patterns/responsive-layout.md +0 -997
  128. package/dist/docs/product/patterns/tables-and-lists.md +0 -1170
  129. package/dist/docs/product/products/tempo-console.md +0 -671
  130. package/dist/docs/product/products/tempo-performance.md +0 -435
  131. 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.