rei-kit 3.1.0 → 3.2.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.
package/dist/index.d.ts CHANGED
@@ -46,88 +46,511 @@ export { useVisualViewport } from './composables/use-visual-viewport';
46
46
  export { useToast } from './composables/use-toast';
47
47
  export type { Toast, ToastAction, ToastOptions, ToastTone } from './composables/use-toast';
48
48
  export type { VisualViewportRect } from './composables/use-visual-viewport';
49
- /** The person, in the corner where the account lives. */
49
+ /**
50
+ * The person, in the corner where the account lives.
51
+ *
52
+ * @example
53
+ * ```vue
54
+ * <BaseAvatar name="Aiko Tanaka" fallback="initials" size="lg" />
55
+ * ```
56
+ */
50
57
  export { default as BaseAvatar } from './components/BaseAvatar.vue';
51
- /** A message the reader has to take in before carrying on. */
58
+ /**
59
+ * A message the reader has to take in before carrying on.
60
+ *
61
+ * @example
62
+ * ```vue
63
+ * <BaseAlert tone="warning">
64
+ * <template #title>Unsaved changes</template>
65
+ * Leave now and the last edit is lost.
66
+ * </BaseAlert>
67
+ * ```
68
+ */
52
69
  export { default as BaseAlert } from './components/BaseAlert.vue';
53
- /** A small standing label: a level, a state, a count. */
70
+ /**
71
+ * A small standing label: a level, a state, a count.
72
+ *
73
+ * @example
74
+ * ```vue
75
+ * <BaseBadge tone="success">Paid</BaseBadge>
76
+ * ```
77
+ *
78
+ * @see {@link BaseChip} — the near-neighbour this is mistaken for
79
+ */
54
80
  export { default as BaseBadge } from './components/BaseBadge.vue';
55
- /** The kit's button, and — when asked — its link. */
81
+ /**
82
+ * The kit's button, and — when asked — its link.
83
+ *
84
+ * @example
85
+ * ```vue
86
+ * <div class="flex flex-wrap gap-2">
87
+ * <BaseButton @click="save">Save</BaseButton>
88
+ * <BaseButton variant="secondary">Cancel</BaseButton>
89
+ * <BaseButton variant="danger" :loading="deleting">Delete</BaseButton>
90
+ * <BaseButton as="a" href="/docs" variant="ghost">Read the docs</BaseButton>
91
+ * </div>
92
+ * ```
93
+ *
94
+ * @see {@link BaseLink} — the near-neighbour this is mistaken for
95
+ */
56
96
  export { default as BaseButton } from './components/BaseButton.vue';
57
- /** A text field with its label, hint and error already wired to it. */
97
+ /**
98
+ * A text field with its label, hint and error already wired to it.
99
+ *
100
+ * @example
101
+ * ```vue
102
+ * <BaseInput v-model="email" label="Email" type="email" hint="We never share it." />
103
+ *
104
+ * <!-- A unit attached to the field. It is `aria-hidden` because the label
105
+ * already says what the number is; a mark that is the only place the
106
+ * unit appears belongs in the label instead. -->
107
+ * <BaseInput v-model="weight" label="Weight in kilograms" type="number">
108
+ * <template #suffix><span aria-hidden="true">kg</span></template>
109
+ * </BaseInput>
110
+ * ```
111
+ *
112
+ * @see {@link PasswordInput} — the near-neighbour this is mistaken for
113
+ */
58
114
  export { default as BaseInput } from './components/BaseInput.vue';
59
- /** A list of actions behind one control. */
115
+ /**
116
+ * A list of actions behind one control.
117
+ *
118
+ * @example
119
+ * ```vue
120
+ * <BaseMenu label="Account">
121
+ * <template #trigger>
122
+ * <BaseAvatar name="Aiko Tanaka" fallback="initials" />
123
+ * </template>
124
+ *
125
+ * <a href="/profile" role="menuitem">Profile</a>
126
+ * <button type="button" role="menuitem" @click="signOut">Sign out</button>
127
+ * </BaseMenu>
128
+ * ```
129
+ *
130
+ * @see {@link BaseModal}, {@link BasePopover}, {@link CommandMenu}, {@link MegaMenu}, {@link NavLinks} — the near-neighbours this is mistaken for
131
+ */
60
132
  export { default as BaseMenu } from './components/BaseMenu.vue';
61
- /** Pins the sheet to the area the keyboard has left visible. */
133
+ /**
134
+ * Pins the sheet to the area the keyboard has left visible.
135
+ *
136
+ * @example
137
+ * ```vue
138
+ * <BaseButton @click="open = true">New entry</BaseButton>
139
+ *
140
+ * <BaseSheet v-model="open" title="New entry" close-label="Close">
141
+ * <p>Anything that belongs to a thumb.</p>
142
+ * </BaseSheet>
143
+ * ```
144
+ *
145
+ * @see {@link BaseDrawer}, {@link BaseModal} — the near-neighbours this is mistaken for
146
+ */
62
147
  export { default as BaseSheet } from './components/BaseSheet.vue';
63
- /** A surface with a border, and optionally a head and a foot. */
148
+ /**
149
+ * A surface with a border, and optionally a head and a foot.
150
+ *
151
+ * @example
152
+ * ```vue
153
+ * <BaseCard>
154
+ * <template #head>This month</template>
155
+ * Spent less than last month.
156
+ * <template #foot>Updated today</template>
157
+ * </BaseCard>
158
+ * ```
159
+ */
64
160
  export { default as BaseCard } from './components/BaseCard.vue';
65
- /** A field you type into to narrow a list, then choose from it. */
161
+ /**
162
+ * A field you type into to narrow a list, then choose from it.
163
+ *
164
+ * @example
165
+ * ```vue
166
+ * <BaseCombobox
167
+ * v-model="country"
168
+ * label="Country"
169
+ * :options="countries"
170
+ * placeholder="Start typing"
171
+ * empty-label="No country matches"
172
+ * />
173
+ *
174
+ * <BaseCombobox
175
+ * v-model="recipients"
176
+ * mode="multiple"
177
+ * label="Recipients"
178
+ * :options="countries"
179
+ * :remove-label="(name) => `Remove ${name}`"
180
+ * placeholder="Add someone"
181
+ * empty-label="Nobody matches"
182
+ * />
183
+ *
184
+ * <BaseCombobox
185
+ * label="City"
186
+ * :options="results"
187
+ * :loading="loading"
188
+ * loading-label="Searching…"
189
+ * filter="none"
190
+ * placeholder="Type at least two letters"
191
+ * empty-label="No city matches"
192
+ * @search="search"
193
+ * />
194
+ * ```
195
+ *
196
+ * @see {@link BaseSelect}, {@link TagsInput}, {@link TransferList} — the near-neighbours this is mistaken for
197
+ */
66
198
  export { default as BaseCombobox } from './components/BaseCombobox.vue';
67
199
  export type { ComboboxOption } from './components/BaseCombobox.vue';
68
- /** A single checkbox, with its label beside it. */
200
+ /**
201
+ * A single checkbox, with its label beside it.
202
+ *
203
+ * @example
204
+ * ```vue
205
+ * <BaseCheckbox v-model="remember" label="Remember me" />
206
+ * ```
207
+ *
208
+ * @see {@link BaseSwitch} — the near-neighbour this is mistaken for
209
+ */
69
210
  export { default as BaseCheckbox } from './components/BaseCheckbox.vue';
70
- /** A set of radios, and the reason there is no `BaseRadio`. */
211
+ /**
212
+ * A set of radios, and the reason there is no `BaseRadio`.
213
+ *
214
+ * @example
215
+ * ```vue
216
+ * <BaseRadioGroup v-model="plan" legend="Plan" :options="plans" />
217
+ * ```
218
+ *
219
+ * @see {@link BaseListbox}, {@link BaseSelect} — the near-neighbours this is mistaken for
220
+ */
71
221
  export { default as BaseRadioGroup } from './components/BaseRadioGroup.vue';
72
- /** A native `<select>`, wearing the kit's field. */
222
+ /**
223
+ * A native `<select>`, wearing the kit's field.
224
+ *
225
+ * @example
226
+ * ```vue
227
+ * <BaseSelect v-model="currency" label="Currency" :options="options" placeholder="Choose one" />
228
+ * ```
229
+ *
230
+ * @see {@link BaseCombobox}, {@link BaseListbox}, {@link BaseRadioGroup} — the near-neighbours this is mistaken for
231
+ */
73
232
  export { default as BaseSelect } from './components/BaseSelect.vue';
74
- /** A value picked from a range, where roughly right is the point. */
233
+ /**
234
+ * A value picked from a range, where roughly right is the point.
235
+ *
236
+ * @example
237
+ * ```vue
238
+ * <BaseSlider v-model="goal" label="Daily goal" :min="5" :max="60" :step="5" show-value />
239
+ * ```
240
+ *
241
+ * @see {@link NumberInput}, {@link SliderField} — the near-neighbours this is mistaken for
242
+ */
75
243
  export { default as BaseSlider } from './components/BaseSlider.vue';
76
244
  /**
77
245
  * A slider and a number field on one value: drag to find it, type to land
78
246
  * on it. See `SliderField.vue` for why both carry the same name.
247
+ *
248
+ * @example
249
+ * ```vue
250
+ * <SliderField
251
+ * v-model="opacity"
252
+ * label="Opacity"
253
+ * :min="0"
254
+ * :max="100"
255
+ * :step="5"
256
+ * decrement-label="Less opaque"
257
+ * increment-label="More opaque"
258
+ * :format="(value) => `${value}%`"
259
+ * hint="Drag for roughly right, type for exactly right."
260
+ * />
261
+ * ```
262
+ *
263
+ * @see {@link BaseSlider}, {@link NumberInput} — the near-neighbours this is mistaken for
79
264
  */
80
265
  export { default as SliderField } from './components/SliderField.vue';
81
- /** Work in progress, with no idea how much is left. */
266
+ /**
267
+ * Work in progress, with no idea how much is left.
268
+ *
269
+ * @example
270
+ * ```vue
271
+ * <BaseSpinner label="Loading entries" />
272
+ * ```
273
+ *
274
+ * @see {@link ProgressBar} — the near-neighbour this is mistaken for
275
+ */
82
276
  export { default as BaseSpinner } from './components/BaseSpinner.vue';
83
- /** A setting that takes effect the moment it is touched. */
277
+ /**
278
+ * A setting that takes effect the moment it is touched.
279
+ *
280
+ * @example
281
+ * ```vue
282
+ * <BaseSwitch v-model="reminders" label="Daily reminder" hint="Every evening at 21:00" />
283
+ * ```
284
+ *
285
+ * @see {@link BaseCheckbox} — the near-neighbour this is mistaken for
286
+ */
84
287
  export { default as BaseSwitch } from './components/BaseSwitch.vue';
85
- /** Rows of data, with the parts a hand-written `<table>` leaves out. */
288
+ /**
289
+ * Rows of data, with the parts a hand-written `<table>` leaves out.
290
+ *
291
+ * @example
292
+ * ```vue
293
+ * <BaseTable :columns="columns" :rows="rows" caption="Recent payments" row-key="id">
294
+ * <template #amount="{ value }">{{ value }} ₺</template>
295
+ * </BaseTable>
296
+ * ```
297
+ *
298
+ * @see {@link DataTable} — the near-neighbour this is mistaken for
299
+ */
86
300
  export { default as BaseTable } from './components/BaseTable.vue';
87
301
  export type { Column } from './components/BaseTable.vue';
88
- /** A multi-line field. */
302
+ /**
303
+ * A multi-line field.
304
+ *
305
+ * @example
306
+ * ```vue
307
+ * <BaseTextarea v-model="note" label="Note" :rows="4" />
308
+ * ```
309
+ */
89
310
  export { default as BaseTextarea } from './components/BaseTextarea.vue';
90
- /** A list with nothing in it yet, said kindly. */
311
+ /**
312
+ * A list with nothing in it yet, said kindly.
313
+ *
314
+ * @example
315
+ * ```vue
316
+ * <EmptyState title="No entries yet" description="Your first one takes ten seconds.">
317
+ * <template #action>
318
+ * <BaseButton>Write one</BaseButton>
319
+ * </template>
320
+ * </EmptyState>
321
+ * ```
322
+ */
91
323
  export { default as EmptyState } from './components/EmptyState.vue';
92
- /** A label, a hint, an error, and the wiring between them. */
324
+ /**
325
+ * A label, a hint, an error, and the wiring between them.
326
+ *
327
+ * @example
328
+ * ```vue
329
+ * <FormField label="Username" hint="Letters and numbers only" :error="error">
330
+ * <template #default="{ id, describedBy, invalid }">
331
+ * <input
332
+ * :id="id"
333
+ * v-model="name"
334
+ * class="control rounded-card px-3 py-2"
335
+ * :aria-describedby="describedBy"
336
+ * :aria-invalid="invalid"
337
+ * />
338
+ * </template>
339
+ * </FormField>
340
+ * ```
341
+ */
93
342
  export { default as FormField } from './components/FormField.vue';
94
- /** Keeps one broken screen from taking the whole app down. */
343
+ /**
344
+ * Keeps one broken screen from taking the whole app down.
345
+ *
346
+ * @example
347
+ * ```vue
348
+ * <ErrorBoundary @error="report">
349
+ * <RouterView />
350
+ *
351
+ * <template #fallback="{ reset }">
352
+ * <p>That part of the page failed.</p>
353
+ * <BaseButton @click="reset">Try again</BaseButton>
354
+ * </template>
355
+ * </ErrorBoundary>
356
+ * ```
357
+ */
95
358
  export { default as ErrorBoundary } from './components/ErrorBoundary.vue';
96
- /** One measure, centred, with the page's gutters. */
359
+ /**
360
+ * One measure, centred, with the page's gutters.
361
+ *
362
+ * @example
363
+ * ```vue
364
+ * <PageContainer width="reading" as="article">
365
+ * <h1>A long read</h1>
366
+ * <p>Set at about 68 characters a line.</p>
367
+ * </PageContainer>
368
+ * ```
369
+ */
97
370
  export { default as PageContainer } from './components/PageContainer.vue';
98
- /** The bar at the top of a screen: a title with room either side of it. */
371
+ /**
372
+ * The bar at the top of a screen: a title with room either side of it.
373
+ *
374
+ * @example
375
+ * ```vue
376
+ * <PageHeader title="Settings">
377
+ * <template #right>
378
+ * <BaseButton size="sm" variant="ghost">Done</BaseButton>
379
+ * </template>
380
+ * </PageHeader>
381
+ * ```
382
+ */
99
383
  export { default as PageHeader } from './components/PageHeader.vue';
100
- /** How far through something somebody is. */
384
+ /**
385
+ * How far through something somebody is.
386
+ *
387
+ * @example
388
+ * ```vue
389
+ * <ProgressBar :value="18" :max="28" label="Course progress" />
390
+ * ```
391
+ *
392
+ * @see {@link BaseSpinner} — the near-neighbour this is mistaken for
393
+ */
101
394
  export { default as ProgressBar } from './components/ProgressBar.vue';
102
- /** One plan in a pricing table. */
395
+ /**
396
+ * One plan in a pricing table.
397
+ *
398
+ * @example
399
+ * ```vue
400
+ * <PriceCard
401
+ * name="Pro"
402
+ * price="₺49"
403
+ * period="/ month"
404
+ * :features="['Unlimited entries', 'Export', 'Sync']"
405
+ * recommended
406
+ * badge="Popular"
407
+ * >
408
+ * <template #action>
409
+ * <BaseButton block>Choose Pro</BaseButton>
410
+ * </template>
411
+ * </PriceCard>
412
+ * ```
413
+ */
103
414
  export { default as PriceCard } from './components/PriceCard.vue';
104
- /** A pill heading for a group of things. */
415
+ /**
416
+ * A pill heading for a group of things.
417
+ *
418
+ * @example
419
+ * ```vue
420
+ * <SectionHeading :tone="income" label="Income" :count="3" />
421
+ * ```
422
+ */
105
423
  export { default as SectionHeading } from './components/SectionHeading.vue';
106
- /** A row of mutually exclusive choices. */
424
+ /**
425
+ * A row of mutually exclusive choices.
426
+ *
427
+ * @example
428
+ * ```vue
429
+ * <SegmentedControl v-model="range" :options="ranges" />
430
+ * ```
431
+ *
432
+ * @see {@link ToggleGroup} — the near-neighbour this is mistaken for
433
+ */
107
434
  export { default as SegmentedControl } from './components/SegmentedControl.vue';
108
- /** A titled run of settings rows. */
435
+ /**
436
+ * A titled run of settings rows.
437
+ *
438
+ * @example
439
+ * ```vue
440
+ * <SettingsGroup title="Notifications">
441
+ * <SettingsRow label="Daily reminder">
442
+ * <BaseSwitch v-model="reminders" label="Daily reminder" label-hidden />
443
+ * </SettingsRow>
444
+ * </SettingsGroup>
445
+ * ```
446
+ */
109
447
  export { default as SettingsGroup } from './components/SettingsGroup.vue';
110
- /** One line in a settings card. */
448
+ /**
449
+ * One line in a settings card.
450
+ *
451
+ * @example
452
+ * ```vue
453
+ * <SettingsGroup title="Account">
454
+ * <SettingsRow
455
+ * label="Language"
456
+ * description="English"
457
+ * :icon="Languages"
458
+ * interactive
459
+ * @click="openLanguages"
460
+ * />
461
+ * </SettingsGroup>
462
+ * ```
463
+ */
111
464
  export { default as SettingsRow } from './components/SettingsRow.vue';
112
- /** A length starts with a digit, a dot, or opens a CSS function. */
465
+ /**
466
+ * A length starts with a digit, a dot, or opens a CSS function.
467
+ *
468
+ * @example
469
+ * ```vue
470
+ * <SkeletonList :rows="4" label="Loading entries" />
471
+ * ```
472
+ *
473
+ * @see {@link BaseSkeleton} — the near-neighbour this is mistaken for
474
+ */
113
475
  export { default as SkeletonList } from './components/SkeletonList.vue';
114
- /** One number, with what it means and which way it is going. */
476
+ /**
477
+ * One number, with what it means and which way it is going.
478
+ *
479
+ * @example
480
+ * ```vue
481
+ * <StatCard value="¥48,200" label="This month" trend="down" />
482
+ * ```
483
+ */
115
484
  export { default as StatCard } from './components/StatCard.vue';
116
- /** Where the toasts land. One of these, at the app root. */
485
+ /**
486
+ * Where the toasts land. One of these, at the app root.
487
+ *
488
+ * @example
489
+ * ```vue
490
+ * <!-- Once, near the root of the app. -->
491
+ * <ToastHost close-label="Close" />
492
+ *
493
+ * <BaseButton @click="toast.success('Saved')">Save</BaseButton>
494
+ * ```
495
+ */
117
496
  export { default as ToastHost } from './components/ToastHost.vue';
118
- /** A small coloured dot, optionally labelled. */
497
+ /**
498
+ * A small coloured dot, optionally labelled.
499
+ *
500
+ * @example
501
+ * ```vue
502
+ * <ToneDot fill="bg-positive" label="Income" />
503
+ * ```
504
+ */
119
505
  export { default as ToneDot } from './components/ToneDot.vue';
120
506
  export type { Tone } from './components/SectionHeading.vue';
121
- /** A flat language switcher for screens with no Settings behind them. */
507
+ /**
508
+ * A flat language switcher for screens with no Settings behind them.
509
+ *
510
+ * @example
511
+ * ```vue
512
+ * <LocaleLinks v-model="locale" :locales="['en', 'tr']" :labels="{ en: 'English', tr: 'Türkçe' }" />
513
+ * ```
514
+ */
122
515
  export { default as LocaleLinks } from './components/LocaleLinks.vue';
123
- /** Sign in with Google, in Google's own clothes. */
516
+ /**
517
+ * Sign in with Google, in Google's own clothes.
518
+ *
519
+ * @example
520
+ * ```vue
521
+ * <GoogleButton label="Continue with Google" @click="signInWithGoogle" />
522
+ * ```
523
+ */
124
524
  export { default as GoogleButton } from './components/GoogleButton.vue';
125
- /** The floating bottom bar. */
525
+ /**
526
+ * The floating bottom bar.
527
+ *
528
+ * @example
529
+ * ```vue
530
+ * <TabBar :items="tabs" :active="active" label="Main" />
531
+ * ```
532
+ *
533
+ * @see {@link BaseTabs}, {@link NavLinks} — the near-neighbours this is mistaken for
534
+ */
126
535
  export { default as TabBar } from './components/TabBar.vue';
127
536
  export type { TabItem } from './components/TabBar.vue';
128
537
  /**
129
538
  * `ActivityGrid`, a year at a glance — a real table, so the DOM order is
130
539
  * the picture's order, and one tab stop rather than three hundred odd.
540
+ *
541
+ * @example
542
+ * ```vue
543
+ * <ActivityGrid
544
+ * :days="days"
545
+ * label="Your year"
546
+ * :level-for="levelFor"
547
+ * :day-label="dayLabel"
548
+ * :is-selectable="isSelectable"
549
+ * @select="toast.info($event)"
550
+ * />
551
+ * ```
552
+ *
553
+ * @see {@link BaseCalendar} — the near-neighbour this is mistaken for
131
554
  */
132
555
  export { default as ActivityGrid } from './components/ActivityGrid.vue';
133
556
  /**
@@ -135,31 +558,130 @@ export { default as ActivityGrid } from './components/ActivityGrid.vue';
135
558
  * vocabulary — `StatCard`, `ProgressBar`, `ActivityGrid` — creates a need
136
559
  * for and did not answer. Both are the data as text with a picture beside
137
560
  * it, rather than a picture with a sentence describing it.
561
+ *
562
+ * @example
563
+ * ```vue
564
+ * <BarChart
565
+ * :series="SIZES"
566
+ * label="Bundle size, ten components"
567
+ * :value-label="(kb) => `${kb.toFixed(1)} KB`"
568
+ * :fill="(item) => (item.key === 'rei' ? 'bg-positive' : 'bg-muted')"
569
+ * />
570
+ * ```
571
+ *
572
+ * @see {@link DonutChart} — the near-neighbour this is mistaken for
138
573
  */
139
574
  export { default as BarChart } from './components/BarChart.vue';
140
- /** Parts of a whole. */
575
+ /**
576
+ * Parts of a whole.
577
+ *
578
+ * @example
579
+ * ```vue
580
+ * <DonutChart
581
+ * :slices="PARTS"
582
+ * label="What the stylesheet is made of"
583
+ * :value-label="(kb) => `${kb.toFixed(1)} KB`"
584
+ * :fill="(_, index) => TONES[index % TONES.length]!"
585
+ * />
586
+ * ```
587
+ *
588
+ * @see {@link BarChart} — the near-neighbour this is mistaken for
589
+ */
141
590
  export { default as DonutChart } from './components/DonutChart.vue';
142
591
  /**
143
592
  * `ScrollArea`, a scrolling box with the two things a hand-written one
144
593
  * leaves out: a fade at whichever edge has more content past it, and a
145
594
  * focus stop — but only when nothing inside it can take focus.
595
+ *
596
+ * @example
597
+ * ```vue
598
+ * <!-- Nothing inside takes focus, so this becomes a named focus stop on its
599
+ * own and the far end stays reachable with a keyboard. -->
600
+ * <ScrollArea axis="x" scrollbar="hidden" label="The year so far" class="max-w-sm">
601
+ * <p class="flex gap-3 whitespace-nowrap">
602
+ * <span v-for="month in MONTHS" :key="month" class="text-ink-soft text-sm">{{ month }}</span>
603
+ * </p>
604
+ * </ScrollArea>
605
+ * ```
146
606
  */
147
607
  export { default as ScrollArea } from './components/ScrollArea.vue';
148
608
  /**
149
609
  * `VirtualList`, a long list where only the rows near the viewport exist —
150
610
  * and every one of them states its place in the whole, which is the half
151
611
  * that is usually dropped.
612
+ *
613
+ * @example
614
+ * ```vue
615
+ * <VirtualList
616
+ * :items="ROWS"
617
+ * :row-height="36"
618
+ * label="Five thousand rows"
619
+ * class="border-hair max-h-56 rounded-xl border"
620
+ * >
621
+ * <template #default="{ item }">
622
+ * <span class="text-ink flex h-full items-center px-3 text-sm">{{ item.name }}</span>
623
+ * </template>
624
+ * </VirtualList>
625
+ * ```
152
626
  */
153
627
  export { default as VirtualList } from './components/VirtualList.vue';
154
628
  /**
155
629
  * `AnnounceHost` and `useAnnounce`, for saying something to a reader when
156
630
  * nothing on screen has changed enough to say it: a filter that narrowed a
157
631
  * list, a route that changed, a draft that saved itself.
632
+ *
633
+ * @example
634
+ * ```vue
635
+ * <div class="flex items-center gap-3">
636
+ * <!-- Rendered once per app. Nothing here is ever visible. -->
637
+ * <AnnounceHost />
638
+ *
639
+ * <BaseButton variant="secondary" @click="filter">Filter</BaseButton>
640
+ * <span class="text-ink-soft text-sm">{{ count }} results</span>
641
+ * </div>
642
+ * ```
158
643
  */
159
644
  export { default as AnnounceHost } from './components/AnnounceHost.vue';
160
645
  /**
161
646
  * `ErrorSummary`, the answer to "did that work?" at the top of a rejected
162
647
  * form — and a way from there into each field in one press.
648
+ *
649
+ * @example
650
+ * ```vue
651
+ * <form class="flex flex-col gap-3" novalidate @submit.prevent="submit">
652
+ * <!-- Takes focus itself the first time the form is rejected, so the
653
+ * reader is not left on a button that appeared to do nothing. -->
654
+ * <ErrorSummary
655
+ * :errors="errors"
656
+ * title="There are fields to fix"
657
+ * :label-for="(field) => LABELS[field] ?? field"
658
+ * :field-id="fieldId"
659
+ * :fields="['email', 'password']"
660
+ * />
661
+ *
662
+ * <!-- The same function on both sides: the summary builds the href from it
663
+ * and each field takes its id from it, so the link lands on the field. -->
664
+ * <BaseInput
665
+ * v-model="email"
666
+ * label="Email"
667
+ * type="email"
668
+ * autocomplete="email"
669
+ * :error="errors['email']"
670
+ * :field-id="fieldId('email')"
671
+ * />
672
+ *
673
+ * <PasswordInput
674
+ * v-model="password"
675
+ * label="Password"
676
+ * toggle-label="Show password"
677
+ * autocomplete="new-password"
678
+ * :error="errors['password']"
679
+ * :field-id="fieldId('password')"
680
+ * />
681
+ *
682
+ * <BaseButton type="submit" class="self-start">Sign up</BaseButton>
683
+ * </form>
684
+ * ```
163
685
  */
164
686
  export { default as ErrorSummary } from './components/ErrorSummary.vue';
165
687
  export { useAnnounce, announce } from './composables/use-announce';
@@ -182,78 +704,413 @@ export type { AnnounceOptions } from './composables/use-announce';
182
704
  /**
183
705
  * The people on a thing, overlapped: who is in a conversation, who shares
184
706
  * a list.
707
+ *
708
+ * @example
709
+ * ```vue
710
+ * <AvatarStack :people="people" :max="3" label="Shared with 5 people" />
711
+ * ```
185
712
  */
186
713
  export { default as AvatarStack } from './components/AvatarStack.vue';
187
- /** A month of days, for choosing one or a stretch of them. */
714
+ /**
715
+ * A month of days, for choosing one or a stretch of them.
716
+ *
717
+ * @example
718
+ * ```vue
719
+ * <BaseCalendar
720
+ * v-model="day"
721
+ * previous-label="Previous month"
722
+ * next-label="Next month"
723
+ * :min="todayKey()"
724
+ * />
725
+ * ```
726
+ *
727
+ * @see {@link ActivityGrid}, {@link BaseDatePicker} — the near-neighbours this is mistaken for
728
+ */
188
729
  export { default as BaseCalendar } from './components/BaseCalendar.vue';
189
730
  /**
190
731
  * A short label with, when it is one of a set someone assembled, a way to
191
732
  * take it off: a filter, a recipient, a tag.
733
+ *
734
+ * @example
735
+ * ```vue
736
+ * <div class="flex flex-wrap gap-2">
737
+ * <BaseChip
738
+ * v-for="tag in tags"
739
+ * :key="tag"
740
+ * :label="tag"
741
+ * :remove-label="`Remove ${tag}`"
742
+ * @remove="remove(tag)"
743
+ * />
744
+ * </div>
745
+ * ```
746
+ *
747
+ * @see {@link BaseBadge} — the near-neighbour this is mistaken for
192
748
  */
193
749
  export { default as BaseChip } from './components/BaseChip.vue';
194
- /** A keyboard key, or a chord of them: `⌘ K`, `Ctrl Shift P`. */
750
+ /**
751
+ * A keyboard key, or a chord of them: `⌘ K`, `Ctrl Shift P`.
752
+ *
753
+ * @example
754
+ * ```vue
755
+ * <p>Press <BaseKbd :keys="['⌘', 'K']" joiner="+" /> to search.</p>
756
+ * ```
757
+ */
195
758
  export { default as BaseKbd } from './components/BaseKbd.vue';
196
- /** A list you choose from, open on the page. */
759
+ /**
760
+ * A list you choose from, open on the page.
761
+ *
762
+ * @example
763
+ * ```vue
764
+ * <BaseListbox v-model="chosen" mode="multiple" :options="people" label="People with access" />
765
+ * ```
766
+ *
767
+ * @see {@link BaseRadioGroup}, {@link BaseSelect}, {@link TransferList} — the near-neighbours this is mistaken for
768
+ */
197
769
  export { default as BaseListbox } from './components/BaseListbox.vue';
198
770
  export type { ListboxOption } from './components/BaseListbox.vue';
199
- /** A link in a sentence — the one thing a button is not. */
771
+ /**
772
+ * A link in a sentence — the one thing a button is not.
773
+ *
774
+ * @example
775
+ * ```vue
776
+ * <p>
777
+ * Read the <BaseLink to="/docs">documentation</BaseLink>, or the
778
+ * <BaseLink href="https://vuejs.org" external>Vue guide</BaseLink>.
779
+ * </p>
780
+ * ```
781
+ *
782
+ * @see {@link BaseButton} — the near-neighbour this is mistaken for
783
+ */
200
784
  export { default as BaseLink } from './components/BaseLink.vue';
201
- /** A score out of five, given or shown. */
785
+ /**
786
+ * A score out of five, given or shown.
787
+ *
788
+ * @example
789
+ * ```vue
790
+ * <BaseRating
791
+ * v-model="score"
792
+ * label="Your rating"
793
+ * :value-label="(value, max) => `${value} out of ${max}`"
794
+ * />
795
+ * ```
796
+ */
202
797
  export { default as BaseRating } from './components/BaseRating.vue';
203
- /** A line between things — with, when it helps, a word on it. */
798
+ /**
799
+ * A line between things — with, when it helps, a word on it.
800
+ *
801
+ * @example
802
+ * ```vue
803
+ * <p>Signed in already?</p>
804
+ * <BaseSeparator label="or" />
805
+ * <p>Create an account.</p>
806
+ * ```
807
+ */
204
808
  export { default as BaseSeparator } from './components/BaseSeparator.vue';
205
- /** One grey box standing in for content that has not arrived. */
809
+ /**
810
+ * One grey box standing in for content that has not arrived.
811
+ *
812
+ * @example
813
+ * ```vue
814
+ * <div class="flex items-center gap-3" aria-busy="true">
815
+ * <BaseSkeleton shape="circle" height="2.5rem" />
816
+ * <div class="flex-1">
817
+ * <BaseSkeleton shape="text" width="40%" height="0.75rem" />
818
+ * <BaseSkeleton class="mt-2" shape="text" width="70%" height="0.75rem" />
819
+ * </div>
820
+ * </div>
821
+ * ```
822
+ *
823
+ * @see {@link SkeletonList} — the near-neighbour this is mistaken for
824
+ */
206
825
  export { default as BaseSkeleton } from './components/BaseSkeleton.vue';
207
- /** A colour, as a hex value. */
826
+ /**
827
+ * A colour, as a hex value.
828
+ *
829
+ * @example
830
+ * ```vue
831
+ * <ColorPicker
832
+ * v-model="brand"
833
+ * label="Brand colour"
834
+ * hex-label="Hex value"
835
+ * :swatches="swatches"
836
+ * hint="Used for buttons, links and the active state."
837
+ * />
838
+ * ```
839
+ */
208
840
  export { default as ColorPicker } from './components/ColorPicker.vue';
209
841
  export type { ColorSwatch } from './components/ColorPicker.vue';
210
842
  /**
211
843
  * `CodeBlock`, a sample as written — no highlighting and no `v-html`, and
212
844
  * focusable when it scrolls, or the end of a long line is unreachable.
845
+ *
846
+ * @example
847
+ * ```vue
848
+ * <CodeBlock
849
+ * :code="INSTALL"
850
+ * label="Installing the package"
851
+ * language="bash"
852
+ * copy-label="Copy the snippet"
853
+ * copied-label="Copied"
854
+ * />
855
+ * ```
213
856
  */
214
857
  export { default as CodeBlock } from './components/CodeBlock.vue';
215
- /** Copies a piece of text, and says that it did. */
858
+ /**
859
+ * Copies a piece of text, and says that it did.
860
+ *
861
+ * @example
862
+ * ```vue
863
+ * <CopyButton
864
+ * text="pnpm add rei-kit"
865
+ * copy-label="Copy the command"
866
+ * copied-label="Copied"
867
+ * error-label="Could not copy"
868
+ * with-text
869
+ * />
870
+ * ```
871
+ */
216
872
  export { default as CopyButton } from './components/CopyButton.vue';
217
873
  /**
218
874
  * Pairs of "what it is" and "what it says": the summary at the top of a
219
875
  * detail page, the facts under an invoice.
876
+ *
877
+ * @example
878
+ * ```vue
879
+ * <DescriptionList :items="items" layout="inline">
880
+ * <template #status><BaseBadge tone="success">Paid</BaseBadge></template>
881
+ * </DescriptionList>
882
+ * ```
220
883
  */
221
884
  export { default as DescriptionList } from './components/DescriptionList.vue';
222
885
  export type { DescriptionItem } from './components/DescriptionList.vue';
223
- /** Files, dropped on or chosen from a real file input. */
886
+ /**
887
+ * Files, dropped on or chosen from a real file input.
888
+ *
889
+ * @example
890
+ * ```vue
891
+ * <FileDrop
892
+ * v-model="files"
893
+ * label="Drop a receipt here"
894
+ * hint="PDF or an image, up to 5 MB"
895
+ * browse-label="Browse"
896
+ * remove-label="Remove"
897
+ * too-large-label="That file is over 5 MB"
898
+ * accept="image/*,.pdf"
899
+ * :max-size="5 * 1024 * 1024"
900
+ * multiple
901
+ * />
902
+ * ```
903
+ */
224
904
  export { default as FileDrop } from './components/FileDrop.vue';
225
- /** A field that holds several short values: recipients, labels, skills. */
905
+ /**
906
+ * A field that holds several short values: recipients, labels, skills.
907
+ *
908
+ * @example
909
+ * ```vue
910
+ * <TagsInput
911
+ * v-model="tags"
912
+ * label="Tags"
913
+ * placeholder="Type and press Enter"
914
+ * :remove-label="(tag) => `Remove ${tag}`"
915
+ * :max="5"
916
+ * />
917
+ * ```
918
+ *
919
+ * @see {@link BaseCombobox}, {@link TransferList} — the near-neighbours this is mistaken for
920
+ */
226
921
  export { default as TagsInput } from './components/TagsInput.vue';
227
- /** A time of day, chosen from two columns. */
922
+ /**
923
+ * A time of day, chosen from two columns.
924
+ *
925
+ * @example
926
+ * ```vue
927
+ * <TimePicker
928
+ * v-model="at"
929
+ * label="Reminder"
930
+ * hours-label="Hour"
931
+ * minutes-label="Minute"
932
+ * placeholder="Choose a time"
933
+ * :step="15"
934
+ * min="07:00"
935
+ * max="22:00"
936
+ * hint="Stored as HH:mm, shown in your own clock."
937
+ * />
938
+ * ```
939
+ *
940
+ * @see {@link BaseDatePicker} — the near-neighbour this is mistaken for
941
+ */
228
942
  export { default as TimePicker } from './components/TimePicker.vue';
229
- /** What happened, in order, on a rail. */
943
+ /**
944
+ * What happened, in order, on a rail.
945
+ *
946
+ * @example
947
+ * ```vue
948
+ * <BaseTimeline :events="notes" label="Notes on this habit">
949
+ * <template #default="{ event }">
950
+ * <BaseCard as="blockquote" padding="sm" class="text-ink text-sm leading-relaxed">
951
+ * {{ event.body }}
952
+ * </BaseCard>
953
+ * </template>
954
+ * </BaseTimeline>
955
+ * ```
956
+ *
957
+ * @see {@link BaseStepper} — the near-neighbour this is mistaken for
958
+ */
230
959
  export { default as BaseTimeline } from './components/BaseTimeline.vue';
231
960
  export type { TimelineEvent } from './components/BaseTimeline.vue';
232
961
  export type { DateRange } from './components/BaseCalendar.vue';
233
- /** A date, or a stretch of dates, chosen from a calendar in a popover. */
962
+ /**
963
+ * A date, or a stretch of dates, chosen from a calendar in a popover.
964
+ *
965
+ * @example
966
+ * ```vue
967
+ * <BaseDatePicker
968
+ * v-model="span"
969
+ * mode="range"
970
+ * label="Report period"
971
+ * placeholder="Choose a period"
972
+ * clear-label="Clear the period"
973
+ * :presets="presets"
974
+ * previous-label="Previous month"
975
+ * next-label="Next month"
976
+ * />
977
+ * ```
978
+ *
979
+ * @see {@link BaseCalendar}, {@link TimePicker} — the near-neighbours this is mistaken for
980
+ */
234
981
  export { default as BaseDatePicker } from './components/BaseDatePicker.vue';
235
982
  export type { DatePreset } from './components/BaseDatePicker.vue';
236
- /** "Are you sure?", asked beside the button that asked it. */
983
+ /**
984
+ * "Are you sure?", asked beside the button that asked it.
985
+ *
986
+ * @example
987
+ * ```vue
988
+ * <BasePopconfirm
989
+ * message="This entry will be deleted."
990
+ * confirm-label="Delete"
991
+ * cancel-label="Cancel"
992
+ * @confirm="remove"
993
+ * >
994
+ * <template #trigger="{ props }">
995
+ * <BaseButton variant="danger" size="sm" v-bind="props">Delete</BaseButton>
996
+ * </template>
997
+ * </BasePopconfirm>
998
+ * ```
999
+ *
1000
+ * @see {@link ResponsiveDialog} — the near-neighbour this is mistaken for
1001
+ */
237
1002
  export { default as BasePopconfirm } from './components/BasePopconfirm.vue';
238
1003
  /**
239
1004
  * A panel of anything — a form, a picker, a few settings — anchored to the
240
1005
  * control that opened it.
1006
+ *
1007
+ * @example
1008
+ * ```vue
1009
+ * <BasePopover label="Filters">
1010
+ * <template #trigger="{ props }">
1011
+ * <BaseButton variant="secondary" v-bind="props">Filters</BaseButton>
1012
+ * </template>
1013
+ *
1014
+ * <template #default="{ close }">
1015
+ * <BaseSwitch v-model="unpaid" label="Only unpaid" />
1016
+ * <BaseButton class="mt-3" size="sm" block @click="close">Done</BaseButton>
1017
+ * </template>
1018
+ * </BasePopover>
1019
+ * ```
1020
+ *
1021
+ * @see {@link BaseMenu}, {@link BaseModal} — the near-neighbours this is mistaken for
241
1022
  */
242
1023
  export { default as BasePopover } from './components/BasePopover.vue';
243
1024
  export type { PopoverTriggerProps } from './components/BasePopover.vue';
244
- /** A row of buttons that stay pressed — one at a time, or several at once. */
1025
+ /**
1026
+ * A row of buttons that stay pressed — one at a time, or several at once.
1027
+ *
1028
+ * @example
1029
+ * ```vue
1030
+ * <ToggleGroup v-model="marks" mode="multiple" :options="marksOptions" label="Text style" />
1031
+ * ```
1032
+ *
1033
+ * @see {@link SegmentedControl} — the near-neighbour this is mistaken for
1034
+ */
245
1035
  export { default as ToggleGroup } from './components/ToggleGroup.vue';
246
- /** A number, typed or stepped — a quantity, a price, a count of minutes. */
1036
+ /**
1037
+ * A number, typed or stepped — a quantity, a price, a count of minutes.
1038
+ *
1039
+ * @example
1040
+ * ```vue
1041
+ * <NumberInput
1042
+ * v-model="guests"
1043
+ * label="Guests"
1044
+ * :min="1"
1045
+ * :max="12"
1046
+ * decrement-label="Fewer guests"
1047
+ * increment-label="More guests"
1048
+ * />
1049
+ * ```
1050
+ *
1051
+ * @see {@link BaseSlider}, {@link SliderField} — the near-neighbours this is mistaken for
1052
+ */
247
1053
  export { default as NumberInput } from './components/NumberInput.vue';
248
- /** A short code typed one character per box — a sign-in code, a PIN. */
1054
+ /**
1055
+ * A short code typed one character per box — a sign-in code, a PIN.
1056
+ *
1057
+ * @example
1058
+ * ```vue
1059
+ * <PinInput
1060
+ * v-model="code"
1061
+ * label="Verification code"
1062
+ * :cell-label="(n, total) => `Digit ${n} of ${total}`"
1063
+ * @complete="verify"
1064
+ * />
1065
+ * ```
1066
+ */
249
1067
  export { default as PinInput } from './components/PinInput.vue';
250
- /** A password field you can look at. */
1068
+ /**
1069
+ * A password field you can look at.
1070
+ *
1071
+ * @example
1072
+ * ```vue
1073
+ * <PasswordInput
1074
+ * v-model="password"
1075
+ * label="Password"
1076
+ * toggle-label="Show password"
1077
+ * hint="At least 12 characters."
1078
+ * autocomplete="new-password"
1079
+ * />
1080
+ * ```
1081
+ *
1082
+ * @see {@link BaseInput} — the near-neighbour this is mistaken for
1083
+ */
251
1084
  export { default as PasswordInput } from './components/PasswordInput.vue';
252
- /** Progress as a ring — for a small space, a card's corner, a goal. */
1085
+ /**
1086
+ * Progress as a ring — for a small space, a card's corner, a goal.
1087
+ *
1088
+ * @example
1089
+ * ```vue
1090
+ * <div class="flex items-center gap-4">
1091
+ * <CircularProgress :value="72" label="Upload" show-value size="lg" />
1092
+ * <CircularProgress label="Loading" />
1093
+ * </div>
1094
+ * ```
1095
+ */
253
1096
  export { default as CircularProgress } from './components/CircularProgress.vue';
254
1097
  /**
255
1098
  * Where someone is in a process of several steps — a sign-up, a checkout,
256
1099
  * a form split into pages.
1100
+ *
1101
+ * @example
1102
+ * ```vue
1103
+ * <BaseStepper
1104
+ * v-model="step"
1105
+ * :steps="steps"
1106
+ * label="Sign-up"
1107
+ * interactive
1108
+ * :state-labels="{ complete: 'done', error: 'needs attention' }"
1109
+ * />
1110
+ * <BaseButton class="mt-4" @click="step = 'payment'">Next</BaseButton>
1111
+ * ```
1112
+ *
1113
+ * @see {@link BaseTimeline} — the near-neighbour this is mistaken for
257
1114
  */
258
1115
  export { default as BaseStepper } from './components/BaseStepper.vue';
259
1116
  export type { StepperStep } from './components/BaseStepper.vue';