@humanonlyweb/ui 0.1.0 → 0.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.
Files changed (48) hide show
  1. package/dist/components/breadcrumbs/Breadcrumbs.js +59 -0
  2. package/dist/components/breadcrumbs/Breadcrumbs.vue.d.ts +14 -0
  3. package/dist/components/checkbox-group/CheckboxGroup.js +89 -0
  4. package/dist/components/checkbox-group/CheckboxGroup.vue.d.ts +43 -0
  5. package/dist/components/fieldset/Fieldset.js +59 -0
  6. package/dist/components/fieldset/Fieldset.vue.d.ts +29 -0
  7. package/dist/components/pagination/Pagination.js +128 -0
  8. package/dist/components/pagination/Pagination.vue.d.ts +24 -0
  9. package/dist/components/password-input/PasswordInput.js +151 -0
  10. package/dist/components/password-input/PasswordInput.vue.d.ts +32 -0
  11. package/dist/components/progress/Progress.js +52 -0
  12. package/dist/components/progress/Progress.vue.d.ts +17 -0
  13. package/dist/components/segmented/Segmented.js +5 -5
  14. package/dist/components/tabs/Tabs.js +29 -25
  15. package/dist/components/tag-input/TagInput.js +186 -0
  16. package/dist/components/tag-input/TagInput.vue.d.ts +36 -0
  17. package/dist/components/toggle/Toggle.js +42 -0
  18. package/dist/components/toggle/Toggle.vue.d.ts +30 -0
  19. package/dist/components/toggle-group/ToggleGroup.js +98 -0
  20. package/dist/components/toggle-group/ToggleGroup.vue.d.ts +41 -0
  21. package/dist/components/visually-hidden/VisuallyHidden.js +16 -0
  22. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +19 -0
  23. package/dist/docs/README.md +10 -0
  24. package/dist/docs/changelog.md +12 -1
  25. package/dist/docs/components/breadcrumbs.md +81 -0
  26. package/dist/docs/components/checkbox-group.md +118 -0
  27. package/dist/docs/components/fieldset.md +65 -0
  28. package/dist/docs/components/pagination.md +62 -0
  29. package/dist/docs/components/password-input.md +55 -0
  30. package/dist/docs/components/progress.md +56 -0
  31. package/dist/docs/components/tag-input.md +88 -0
  32. package/dist/docs/components/toggle-group.md +125 -0
  33. package/dist/docs/components/toggle.md +81 -0
  34. package/dist/docs/components/visually-hidden.md +53 -0
  35. package/dist/docs/forms.md +1 -1
  36. package/dist/docs/installation.md +0 -2
  37. package/dist/docs/localisation.md +2 -0
  38. package/dist/docs/styling.md +16 -0
  39. package/dist/index.d.ts +44 -28
  40. package/dist/index.js +41 -27
  41. package/dist/nuxt/module.d.ts +1 -1
  42. package/dist/nuxt/module.js +11 -1
  43. package/dist/package.js +1 -1
  44. package/dist/styles/core.css +26 -0
  45. package/dist/translations.d.ts +15 -1
  46. package/dist/translations.js +7 -0
  47. package/dist/types.d.ts +8 -0
  48. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ # Toggle Group
2
+
3
+ > A set of toggles, single or multiple.
4
+
5
+ ## Examples
6
+
7
+ ### Basic
8
+
9
+ With `multiple`, each toggle is independent and the model is an array of the pressed values, kept in `options` order.
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ const styles = ref<string[]>(["bold"]);
14
+ const options = [
15
+ { label: "Bold", value: "bold" },
16
+ { label: "Italic", value: "italic" },
17
+ { label: "Underline", value: "underline" },
18
+ ];
19
+ </script>
20
+
21
+ <template>
22
+ <div class="demo-stack">
23
+ <UiToggleGroup v-model="styles" :options="options" multiple label="Text style" />
24
+ <p class="demo-note">Pressed: {{ styles.join(", ") || "none" }}</p>
25
+ </div>
26
+ </template>
27
+ ```
28
+
29
+ ### Single
30
+
31
+ Without `multiple`, at most one option is pressed. Pressing the pressed option again keeps it pressed.
32
+
33
+ ```vue
34
+ <script setup lang="ts">
35
+ const alignment = ref("left");
36
+ const options = [
37
+ { label: "Left", value: "left" },
38
+ { label: "Center", value: "center" },
39
+ { label: "Right", value: "right" },
40
+ ];
41
+ </script>
42
+
43
+ <template>
44
+ <UiToggleGroup v-model="alignment" :options="options" label="Alignment" />
45
+ </template>
46
+ ```
47
+
48
+ ### Disabled
49
+
50
+ `disabled` disables every toggle; `option.disabled` disables just one.
51
+
52
+ ```vue
53
+ <script setup lang="ts">
54
+ const alignment = ref("center");
55
+ const options = [
56
+ { label: "Left", value: "left" },
57
+ { label: "Center", value: "center" },
58
+ { label: "Right", value: "right" },
59
+ ];
60
+ const someDisabled = [
61
+ { label: "Left", value: "left" },
62
+ { label: "Center", value: "center", disabled: true },
63
+ { label: "Right", value: "right" },
64
+ ];
65
+ </script>
66
+
67
+ <template>
68
+ <div class="demo-stack">
69
+ <UiToggleGroup v-model="alignment" :options="options" label="Alignment" disabled />
70
+ <UiToggleGroup v-model="alignment" :options="someDisabled" label="Alignment, one unavailable" />
71
+ </div>
72
+ </template>
73
+ ```
74
+
75
+ ## API
76
+
77
+ | Prop | Type | Default | Description |
78
+ | --- | --- | --- | --- |
79
+ | `options` | `SelectOption<T>[]` | `[]` | Toggles to render, in order. |
80
+ | `label` | `string` | — | Accessible name for the group. |
81
+ | `multiple` | `boolean` | `false` | Allow several options pressed at once; the model is then an array. |
82
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout hook, exposed as `data-orientation`. |
83
+ | `disabled` | `boolean` | `false` | Disables every toggle. |
84
+ | `name` | `string` | — | Form field name: submits the pressed value with a native form, via hidden inputs. |
85
+ | `modelValue` | `T \| T[]` | — | The pressed value; with `multiple`, an array of pressed values. |
86
+
87
+ | Event | Payload | Description |
88
+ | --- | --- | --- |
89
+ | `update:modelValue` | `[value: T \| T[] \| undefined]` | `v-model:modelValue` update. |
90
+
91
+ | Slot | Props | Description |
92
+ | --- | --- | --- |
93
+ | `option` | `{ option: SelectOption<T>; pressed: boolean; }` | Toggle content, replacing the label, e.g. an icon. |
94
+
95
+ Types:
96
+
97
+ ```ts
98
+ export interface SelectOption<T extends SelectValue = SelectValue> {
99
+ label: string;
100
+ value: T;
101
+ disabled?: boolean;
102
+ }
103
+
104
+ export type SelectValue = string | number;
105
+ ```
106
+
107
+ ## Styling
108
+
109
+ `orientation` is a layout hook, exposed as `data-orientation`.
110
+
111
+ - Parts (`[data-part="…"]`): `toggle-group`, `toggle`
112
+ - State attributes: `data-orientation`, `data-field-name`, `data-toggle-group-disabled`, `data-toggle-pressed`
113
+
114
+ ## Keyboard
115
+
116
+ | Keys | Action |
117
+ | ----------------- | ------------------------- |
118
+ | `Tab` | Move between the toggles |
119
+ | `Space` / `Enter` | Toggle the focused option |
120
+
121
+ ## Accessibility
122
+
123
+ - The toggles sit in a `role="group"` named by `label`.
124
+ - Each option is a native `<button>` with `aria-pressed`, so its state is announced with its name.
125
+ - With `multiple`, the toggles are independent; without it, pressing one releases the others.
@@ -0,0 +1,81 @@
1
+ # Toggle
2
+
3
+ > A button that stays pressed.
4
+
5
+ ## Examples
6
+
7
+ ### Basic
8
+
9
+ `v-model` is the pressed state; `aria-pressed` keeps assistive tech in sync.
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ const bold = ref(false);
14
+ const muted = ref(true);
15
+ </script>
16
+
17
+ <template>
18
+ <div class="demo-stack">
19
+ <div class="demo-row">
20
+ <UiToggle v-model="bold">
21
+ <Icon name="bold" :size="14" />
22
+ <span>Bold</span>
23
+ </UiToggle>
24
+ <UiToggle v-model="muted">Mute</UiToggle>
25
+ </div>
26
+ <p class="demo-note">
27
+ Bold: {{ bold ? "pressed" : "not pressed" }} · Mute: {{ muted ? "pressed" : "not pressed" }}
28
+ </p>
29
+ </div>
30
+ </template>
31
+ ```
32
+
33
+ ### Disabled
34
+
35
+ A disabled toggle is a native disabled button: it can't be clicked, pressed or focused.
36
+
37
+ ```vue
38
+ <script setup lang="ts">
39
+ const bold = ref(false);
40
+ const italic = ref(true);
41
+ </script>
42
+
43
+ <template>
44
+ <div class="demo-row">
45
+ <UiToggle v-model="bold" disabled>Bold</UiToggle>
46
+ <UiToggle v-model="italic" disabled>Italic</UiToggle>
47
+ </div>
48
+ </template>
49
+ ```
50
+
51
+ ## API
52
+
53
+ | Prop | Type | Default | Description |
54
+ | --- | --- | --- | --- |
55
+ | `disabled` | `boolean` | `false` | Disables the toggle. |
56
+ | `label` | `string` | — | Accessible name when the content is only an icon; otherwise the slot content names it. |
57
+ | `modelValue` | `boolean` | `false` | Whether the button is pressed. |
58
+
59
+ | Event | Payload | Description |
60
+ | --- | --- | --- |
61
+ | `update:modelValue` | `[value: boolean]` | `v-model:modelValue` update. |
62
+
63
+ | Slot | Props | Description |
64
+ | --- | --- | --- |
65
+ | `default` | — | The button content. |
66
+
67
+ ## Styling
68
+
69
+ - Parts (`[data-part="…"]`): `toggle`
70
+ - State attributes: `data-toggle-pressed`
71
+
72
+ ## Keyboard
73
+
74
+ | Keys | Action |
75
+ | ----------------- | --------- |
76
+ | `Space` / `Enter` | Toggle it |
77
+
78
+ ## Accessibility
79
+
80
+ - It's a native `<button>` with `aria-pressed`, so it's focusable and announces its state.
81
+ - The slot content names the button; give an icon-only toggle a `label`.
@@ -0,0 +1,53 @@
1
+ # Visually Hidden
2
+
3
+ > Text for assistive technology only.
4
+
5
+ ## Examples
6
+
7
+ ### Basic
8
+
9
+ Screen readers announce the hidden text, so a list of "Read more" links stays distinct.
10
+
11
+ ```vue
12
+ <template>
13
+ <div class="demo-stack">
14
+ <ul class="demo-list">
15
+ <li>
16
+ <span>Spring budget</span>
17
+ <a href="#">Read more<UiVisuallyHidden> about the spring budget</UiVisuallyHidden></a>
18
+ </li>
19
+ <li>
20
+ <span>Autumn forecast</span>
21
+ <a href="#">Read more<UiVisuallyHidden> about the autumn forecast</UiVisuallyHidden></a>
22
+ </li>
23
+ <li>
24
+ <span>Winter plan</span>
25
+ <a href="#">Read more<UiVisuallyHidden> about the winter plan</UiVisuallyHidden></a>
26
+ </li>
27
+ </ul>
28
+ <p class="demo-note">
29
+ The "about the …" text is read by screen readers, but isn't drawn on screen.
30
+ </p>
31
+ </div>
32
+ </template>
33
+ ```
34
+
35
+ ## API
36
+
37
+ | Prop | Type | Default | Description |
38
+ | --- | --- | --- | --- |
39
+ | `as` | `string` | `"span"` | Element to render, e.g. "div". |
40
+
41
+ | Slot | Props | Description |
42
+ | --- | --- | --- |
43
+ | `default` | — | The text to keep for assistive technology. |
44
+
45
+ ## Styling
46
+
47
+ - Parts (`[data-part="…"]`): `visually-hidden`
48
+
49
+ ## Accessibility
50
+
51
+ - The content stays in the accessibility tree, out of the layout.
52
+ - It isn't `display: none`, so screen readers still announce it.
53
+ - Focusable content inside stays in the keyboard tab order.
@@ -169,7 +169,7 @@ const { form, errors, submit, processing } = useForm({
169
169
 
170
170
  ## Plain HTML forms
171
171
 
172
- A field with a `name` is sent when a regular `<form>` submits, just like a native input. A multiple Select or Combobox sends one value per pick; a Switch that's off sends nothing.
172
+ A field with a `name` is sent when a regular `<form>` submits, just like a native input. A multiple Select, Combobox, TagInput or CheckboxGroup sends one value per pick; a Switch that's off sends nothing.
173
173
 
174
174
  ```vue-html
175
175
  <form method="post" action="/settings">
@@ -4,8 +4,6 @@
4
4
 
5
5
  ## Install
6
6
 
7
- Not on npm yet, so this command won't work. It will once the package is published.
8
-
9
7
  ```bash
10
8
  bun add @humanonlyweb/ui
11
9
  ```
@@ -14,6 +14,8 @@ app.use(
14
14
  translations: {
15
15
  close: "Fermer",
16
16
  characterCount: (count, max) => `${count} sur ${max} caractères`,
17
+ showPassword: "Afficher le mot de passe",
18
+ page: (page) => `Page ${page}`,
17
19
  keys: { command: "Commande" },
18
20
  },
19
21
  }),
@@ -64,3 +64,19 @@ Overlays are native popovers, so animate them in with `@starting-style`:
64
64
  - **Accordion:** transition `grid-template-rows` on `accordion-panel`.
65
65
  - **Tabs, Segmented:** transition the indicator under `[data-tabs-animate]` / `[data-segmented-animate]`.
66
66
  - **Toasts:** `ui-toast-enter-from`, `ui-toast-leave-to` and `ui-toast-move`.
67
+
68
+ ### Accordion panels
69
+
70
+ A closed panel is `hidden="until-found"`. Supporting browsers keep the element rendered (`content-visibility: hidden`), so the `grid-template-rows` transition runs from `0fr` when it opens; no `@starting-style` is needed.
71
+
72
+ Browsers without support for that attribute value hide the panel with `display: none`, where a first open can't transition. If you support those (Safari before 26.2, for example), add a starting value:
73
+
74
+ ```css
75
+ [data-part="accordion-panel"][data-accordion-open] {
76
+ @starting-style {
77
+ grid-template-rows: 0fr;
78
+ }
79
+ }
80
+ ```
81
+
82
+ That also animates an initially open panel in on load, so only add it for those browsers.
package/dist/index.d.ts CHANGED
@@ -1,35 +1,45 @@
1
1
  import _default from "./components/accordion/Accordion.vue.js";
2
2
  import _default$1 from "./components/accordion/AccordionItem.vue.js";
3
- import { AvatarItem, AvatarSize, ButtonSize, ButtonType, ButtonVariant, LinkTarget, LinkTo, MenuEntry, MenuItem, MenuSeparator, Platform, SelectOption, SelectValue, TableColumn, TableSort, Toast, ToastAction, ToastTone } from "./types.js";
3
+ import { AvatarItem, AvatarSize, BreadcrumbItem, ButtonSize, ButtonType, ButtonVariant, LinkTarget, LinkTo, MenuEntry, MenuItem, MenuSeparator, Platform, SelectOption, SelectValue, TableColumn, TableSort, Toast, ToastAction, ToastTone } from "./types.js";
4
4
  import _default$2 from "./components/avatar/Avatar.vue.js";
5
5
  import _default$3 from "./components/avatar/AvatarGroup.vue.js";
6
- import _default$4 from "./components/button/Button.vue.js";
7
- import _default$10 from "./components/button/IconButton.vue.js";
8
- import _default$5 from "./components/checkbox/Checkbox.vue.js";
6
+ import _default$4 from "./components/breadcrumbs/Breadcrumbs.vue.js";
7
+ import _default$5 from "./components/button/Button.vue.js";
8
+ import _default$13 from "./components/button/IconButton.vue.js";
9
+ import _default$6 from "./components/checkbox/Checkbox.vue.js";
10
+ import _default$7 from "./components/checkbox-group/CheckboxGroup.vue.js";
9
11
  import { ComboboxFilter, useCombobox } from "./composables/use-combobox.js";
10
- import _default$6 from "./components/combobox/Combobox.vue.js";
11
- import _default$7 from "./components/dialog/ConfirmDialog.vue.js";
12
- import _default$8 from "./components/context-menu/ContextMenu.vue.js";
13
- import _default$9 from "./components/dialog/Dialog.vue.js";
14
- import _default$11 from "./components/input/Input.vue.js";
15
- import _default$12 from "./components/kbd/Kbd.vue.js";
16
- import _default$13 from "./components/menu/Menu.vue.js";
17
- import _default$14 from "./components/otp-input/OtpInput.vue.js";
18
- import _default$15 from "./components/popover/Popover.vue.js";
19
- import _default$16 from "./components/radio-group/RadioGroup.vue.js";
20
- import _default$17 from "./components/segmented/Segmented.vue.js";
21
- import _default$18 from "./components/select/Select.vue.js";
22
- import _default$19 from "./components/slider/Slider.vue.js";
23
- import _default$20 from "./components/spin-button/SpinButton.vue.js";
24
- import _default$21 from "./components/split-button/SplitButton.vue.js";
25
- import _default$22 from "./components/switch/Switch.vue.js";
26
- import _default$23 from "./components/table/Table.vue.js";
27
- import _default$24 from "./components/tabs/Tabs.vue.js";
28
- import _default$25 from "./components/textarea/Textarea.vue.js";
29
- import _default$26 from "./components/toast/ToastItem.vue.js";
30
- import _default$27 from "./components/toast/ToastViewport.vue.js";
31
- import _default$28 from "./components/toolbar/Toolbar.vue.js";
32
- import _default$29 from "./components/tooltip/Tooltip.vue.js";
12
+ import _default$8 from "./components/combobox/Combobox.vue.js";
13
+ import _default$9 from "./components/dialog/ConfirmDialog.vue.js";
14
+ import _default$10 from "./components/context-menu/ContextMenu.vue.js";
15
+ import _default$11 from "./components/dialog/Dialog.vue.js";
16
+ import _default$12 from "./components/fieldset/Fieldset.vue.js";
17
+ import _default$14 from "./components/input/Input.vue.js";
18
+ import _default$15 from "./components/kbd/Kbd.vue.js";
19
+ import _default$16 from "./components/menu/Menu.vue.js";
20
+ import _default$17 from "./components/otp-input/OtpInput.vue.js";
21
+ import _default$18 from "./components/pagination/Pagination.vue.js";
22
+ import _default$19 from "./components/password-input/PasswordInput.vue.js";
23
+ import _default$20 from "./components/popover/Popover.vue.js";
24
+ import _default$21 from "./components/progress/Progress.vue.js";
25
+ import _default$22 from "./components/radio-group/RadioGroup.vue.js";
26
+ import _default$23 from "./components/segmented/Segmented.vue.js";
27
+ import _default$24 from "./components/select/Select.vue.js";
28
+ import _default$25 from "./components/slider/Slider.vue.js";
29
+ import _default$26 from "./components/spin-button/SpinButton.vue.js";
30
+ import _default$27 from "./components/split-button/SplitButton.vue.js";
31
+ import _default$28 from "./components/switch/Switch.vue.js";
32
+ import _default$29 from "./components/table/Table.vue.js";
33
+ import _default$30 from "./components/tabs/Tabs.vue.js";
34
+ import _default$31 from "./components/tag-input/TagInput.vue.js";
35
+ import _default$32 from "./components/textarea/Textarea.vue.js";
36
+ import _default$33 from "./components/toast/ToastItem.vue.js";
37
+ import _default$34 from "./components/toast/ToastViewport.vue.js";
38
+ import _default$35 from "./components/toggle/Toggle.vue.js";
39
+ import _default$36 from "./components/toggle-group/ToggleGroup.vue.js";
40
+ import _default$37 from "./components/toolbar/Toolbar.vue.js";
41
+ import _default$38 from "./components/tooltip/Tooltip.vue.js";
42
+ import _default$39 from "./components/visually-hidden/VisuallyHidden.vue.js";
33
43
  import { UiTranslations, UiTranslationsInput, defaultTranslations } from "./translations.js";
34
44
  import { UI_CONFIG_KEY, UiConfig, UiOptions, createUi, useTranslations, useUiConfig } from "./config.js";
35
45
  import { ACCORDION_KEY, AccordionContext, useAccordionItem } from "./composables/use-accordion.js";
@@ -43,4 +53,10 @@ import { useRovingSelection } from "./composables/use-roving-selection.js";
43
53
  import { useSelect } from "./composables/use-select.js";
44
54
  import { useSlideIndicator } from "./composables/use-slide-indicator.js";
45
55
  import { TOASTER_KEY, ToastOptions, Toaster, createToaster, useToast } from "./composables/use-toast.js";
46
- export { ACCORDION_KEY, _default as Accordion, type AccordionContext, _default$1 as AccordionItem, _default$2 as Avatar, _default$3 as AvatarGroup, type AvatarItem, type AvatarSize, _default$4 as Button, type ButtonSize, type ButtonType, type ButtonVariant, _default$5 as Checkbox, _default$6 as Combobox, type ComboboxFilter, _default$7 as ConfirmDialog, _default$8 as ContextMenu, _default$9 as Dialog, type FieldSource, type FormErrors, type FormValues, _default$10 as IconButton, _default$11 as Input, _default$12 as Kbd, type KeyCap, type LinkTarget, type LinkTo, _default$13 as Menu, type MenuEntry, type MenuItem, type MenuSeparator, _default$14 as OtpInput, type Platform, _default$15 as Popover, _default$16 as RadioGroup, _default$17 as Segmented, _default$18 as Select, type SelectOption, type SelectValue, _default$19 as Slider, _default$20 as SpinButton, _default$21 as SplitButton, type StandardSchemaV1, _default$22 as Switch, TOASTER_KEY, _default$23 as Table, type TableColumn, type TableSort, _default$24 as Tabs, _default$25 as Textarea, type Toast, type ToastAction, _default$26 as ToastItem, type ToastOptions, type ToastTone, _default$27 as ToastViewport, type Toaster, _default$28 as Toolbar, _default$29 as Tooltip, UI_CONFIG_KEY, type UiConfig, type UiOptions, type UiTranslations, type UiTranslationsInput, type UseFormOptions, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
56
+ //#region src/index.d.ts
57
+ declare module "vue" {
58
+ /** Installs the props `v-model` and `v-show` contribute during server rendering. */
59
+ function initDirectivesForSSR(): void;
60
+ }
61
+ //#endregion
62
+ export { ACCORDION_KEY, _default as Accordion, type AccordionContext, _default$1 as AccordionItem, _default$2 as Avatar, _default$3 as AvatarGroup, type AvatarItem, type AvatarSize, type BreadcrumbItem, _default$4 as Breadcrumbs, _default$5 as Button, type ButtonSize, type ButtonType, type ButtonVariant, _default$6 as Checkbox, _default$7 as CheckboxGroup, _default$8 as Combobox, type ComboboxFilter, _default$9 as ConfirmDialog, _default$10 as ContextMenu, _default$11 as Dialog, type FieldSource, _default$12 as Fieldset, type FormErrors, type FormValues, _default$13 as IconButton, _default$14 as Input, _default$15 as Kbd, type KeyCap, type LinkTarget, type LinkTo, _default$16 as Menu, type MenuEntry, type MenuItem, type MenuSeparator, _default$17 as OtpInput, _default$18 as Pagination, _default$19 as PasswordInput, type Platform, _default$20 as Popover, _default$21 as Progress, _default$22 as RadioGroup, _default$23 as Segmented, _default$24 as Select, type SelectOption, type SelectValue, _default$25 as Slider, _default$26 as SpinButton, _default$27 as SplitButton, type StandardSchemaV1, _default$28 as Switch, TOASTER_KEY, _default$29 as Table, type TableColumn, type TableSort, _default$30 as Tabs, _default$31 as TagInput, _default$32 as Textarea, type Toast, type ToastAction, _default$33 as ToastItem, type ToastOptions, type ToastTone, _default$34 as ToastViewport, type Toaster, _default$35 as Toggle, _default$36 as ToggleGroup, _default$37 as Toolbar, _default$38 as Tooltip, UI_CONFIG_KEY, type UiConfig, type UiOptions, type UiTranslations, type UiTranslationsInput, type UseFormOptions, _default$39 as VisuallyHidden, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
package/dist/index.js CHANGED
@@ -6,39 +6,53 @@ import { TOASTER_KEY, createToaster, useToast } from "./composables/use-toast.js
6
6
  import { defaultTranslations } from "./translations.js";
7
7
  import { UI_CONFIG_KEY, createUi, useTranslations, useUiConfig } from "./config.js";
8
8
  import _sfc_main$3 from "./components/avatar/AvatarGroup.js";
9
- import _sfc_main$4 from "./components/button/Button.js";
10
- import _sfc_main$10 from "./components/button/IconButton.js";
9
+ import _sfc_main$4 from "./components/breadcrumbs/Breadcrumbs.js";
10
+ import _sfc_main$5 from "./components/button/Button.js";
11
+ import _sfc_main$13 from "./components/button/IconButton.js";
11
12
  import { useField } from "./composables/use-field.js";
12
- import _sfc_main$5 from "./components/checkbox/Checkbox.js";
13
+ import _sfc_main$6 from "./components/checkbox/Checkbox.js";
14
+ import _sfc_main$12 from "./components/fieldset/Fieldset.js";
15
+ import _sfc_main$7 from "./components/checkbox-group/CheckboxGroup.js";
13
16
  import { useCombobox } from "./composables/use-combobox.js";
14
17
  import { firstFocusable, useAnchor, usePopoverState } from "./composables/use-popover.js";
15
- import _sfc_main$6 from "./components/combobox/Combobox.js";
16
- import _sfc_main$9 from "./components/dialog/Dialog.js";
17
- import _sfc_main$7 from "./components/dialog/ConfirmDialog.js";
18
+ import _sfc_main$8 from "./components/combobox/Combobox.js";
19
+ import _sfc_main$11 from "./components/dialog/Dialog.js";
20
+ import _sfc_main$9 from "./components/dialog/ConfirmDialog.js";
18
21
  import { isMenuSeparator, useMenu } from "./composables/use-menu.js";
19
- import _sfc_main$8 from "./components/context-menu/ContextMenu.js";
20
- import _sfc_main$11 from "./components/input/Input.js";
22
+ import _sfc_main$10 from "./components/context-menu/ContextMenu.js";
23
+ import _sfc_main$14 from "./components/input/Input.js";
21
24
  import { parseChord, platformFrom, usePlatform } from "./composables/use-platform.js";
22
- import _sfc_main$12 from "./components/kbd/Kbd.js";
23
- import _sfc_main$13 from "./components/menu/Menu.js";
24
- import _sfc_main$14 from "./components/otp-input/OtpInput.js";
25
- import _sfc_main$15 from "./components/popover/Popover.js";
25
+ import _sfc_main$15 from "./components/kbd/Kbd.js";
26
+ import _sfc_main$16 from "./components/menu/Menu.js";
27
+ import _sfc_main$17 from "./components/otp-input/OtpInput.js";
28
+ import _sfc_main$18 from "./components/pagination/Pagination.js";
29
+ import _sfc_main$19 from "./components/password-input/PasswordInput.js";
30
+ import _sfc_main$20 from "./components/popover/Popover.js";
31
+ import _sfc_main$21 from "./components/progress/Progress.js";
26
32
  import { useRovingSelection } from "./composables/use-roving-selection.js";
27
- import _sfc_main$16 from "./components/radio-group/RadioGroup.js";
33
+ import _sfc_main$22 from "./components/radio-group/RadioGroup.js";
28
34
  import { useSlideIndicator } from "./composables/use-slide-indicator.js";
29
- import _sfc_main$17 from "./components/segmented/Segmented.js";
35
+ import _sfc_main$23 from "./components/segmented/Segmented.js";
30
36
  import { useSelect } from "./composables/use-select.js";
31
- import _sfc_main$18 from "./components/select/Select.js";
32
- import _sfc_main$19 from "./components/slider/Slider.js";
33
- import _sfc_main$20 from "./components/spin-button/SpinButton.js";
34
- import _sfc_main$21 from "./components/split-button/SplitButton.js";
35
- import _sfc_main$22 from "./components/switch/Switch.js";
36
- import _sfc_main$23 from "./components/table/Table.js";
37
- import _sfc_main$24 from "./components/tabs/Tabs.js";
38
- import _sfc_main$25 from "./components/textarea/Textarea.js";
39
- import _sfc_main$26 from "./components/toast/ToastItem.js";
40
- import _sfc_main$27 from "./components/toast/ToastViewport.js";
41
- import _sfc_main$28 from "./components/toolbar/Toolbar.js";
42
- import _sfc_main$29 from "./components/tooltip/Tooltip.js";
37
+ import _sfc_main$24 from "./components/select/Select.js";
38
+ import _sfc_main$25 from "./components/slider/Slider.js";
39
+ import _sfc_main$26 from "./components/spin-button/SpinButton.js";
40
+ import _sfc_main$27 from "./components/split-button/SplitButton.js";
41
+ import _sfc_main$28 from "./components/switch/Switch.js";
42
+ import _sfc_main$29 from "./components/table/Table.js";
43
+ import _sfc_main$30 from "./components/tabs/Tabs.js";
44
+ import _sfc_main$31 from "./components/tag-input/TagInput.js";
45
+ import _sfc_main$32 from "./components/textarea/Textarea.js";
46
+ import _sfc_main$33 from "./components/toast/ToastItem.js";
47
+ import _sfc_main$34 from "./components/toast/ToastViewport.js";
48
+ import _sfc_main$35 from "./components/toggle/Toggle.js";
49
+ import _sfc_main$36 from "./components/toggle-group/ToggleGroup.js";
50
+ import _sfc_main$37 from "./components/toolbar/Toolbar.js";
51
+ import _sfc_main$38 from "./components/tooltip/Tooltip.js";
52
+ import _sfc_main$39 from "./components/visually-hidden/VisuallyHidden.js";
43
53
  import { useForm } from "./composables/use-form.js";
44
- export { ACCORDION_KEY, _sfc_main as Accordion, _sfc_main$1 as AccordionItem, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Button, _sfc_main$5 as Checkbox, _sfc_main$6 as Combobox, _sfc_main$7 as ConfirmDialog, _sfc_main$8 as ContextMenu, _sfc_main$9 as Dialog, _sfc_main$10 as IconButton, _sfc_main$11 as Input, _sfc_main$12 as Kbd, _sfc_main$13 as Menu, _sfc_main$14 as OtpInput, _sfc_main$15 as Popover, _sfc_main$16 as RadioGroup, _sfc_main$17 as Segmented, _sfc_main$18 as Select, _sfc_main$19 as Slider, _sfc_main$20 as SpinButton, _sfc_main$21 as SplitButton, _sfc_main$22 as Switch, TOASTER_KEY, _sfc_main$23 as Table, _sfc_main$24 as Tabs, _sfc_main$25 as Textarea, _sfc_main$26 as ToastItem, _sfc_main$27 as ToastViewport, _sfc_main$28 as Toolbar, _sfc_main$29 as Tooltip, UI_CONFIG_KEY, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
54
+ import { initDirectivesForSSR } from "vue";
55
+ //#region src/index.ts
56
+ initDirectivesForSSR();
57
+ //#endregion
58
+ export { ACCORDION_KEY, _sfc_main as Accordion, _sfc_main$1 as AccordionItem, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Breadcrumbs, _sfc_main$5 as Button, _sfc_main$6 as Checkbox, _sfc_main$7 as CheckboxGroup, _sfc_main$8 as Combobox, _sfc_main$9 as ConfirmDialog, _sfc_main$10 as ContextMenu, _sfc_main$11 as Dialog, _sfc_main$12 as Fieldset, _sfc_main$13 as IconButton, _sfc_main$14 as Input, _sfc_main$15 as Kbd, _sfc_main$16 as Menu, _sfc_main$17 as OtpInput, _sfc_main$18 as Pagination, _sfc_main$19 as PasswordInput, _sfc_main$20 as Popover, _sfc_main$21 as Progress, _sfc_main$22 as RadioGroup, _sfc_main$23 as Segmented, _sfc_main$24 as Select, _sfc_main$25 as Slider, _sfc_main$26 as SpinButton, _sfc_main$27 as SplitButton, _sfc_main$28 as Switch, TOASTER_KEY, _sfc_main$29 as Table, _sfc_main$30 as Tabs, _sfc_main$31 as TagInput, _sfc_main$32 as Textarea, _sfc_main$33 as ToastItem, _sfc_main$34 as ToastViewport, _sfc_main$35 as Toggle, _sfc_main$36 as ToggleGroup, _sfc_main$37 as Toolbar, _sfc_main$38 as Tooltip, UI_CONFIG_KEY, _sfc_main$39 as VisuallyHidden, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
@@ -1,6 +1,6 @@
1
1
  //#region src/nuxt/module.d.ts
2
2
  /** Auto-registered as `<{prefix}{name}>`. A test keeps it in step with `src/index.ts`. */
3
- export declare const COMPONENTS: readonly ["Accordion", "AccordionItem", "Avatar", "AvatarGroup", "Button", "Checkbox", "Combobox", "ConfirmDialog", "ContextMenu", "Dialog", "IconButton", "Input", "Kbd", "Menu", "OtpInput", "Popover", "RadioGroup", "Segmented", "Select", "Slider", "SpinButton", "SplitButton", "Switch", "Table", "Tabs", "Textarea", "ToastItem", "ToastViewport", "Toolbar", "Tooltip"];
3
+ export declare const COMPONENTS: readonly ["Accordion", "AccordionItem", "Avatar", "AvatarGroup", "Breadcrumbs", "Button", "Checkbox", "CheckboxGroup", "Combobox", "ConfirmDialog", "ContextMenu", "Dialog", "Fieldset", "IconButton", "Input", "Kbd", "Menu", "OtpInput", "Pagination", "PasswordInput", "Popover", "Progress", "RadioGroup", "Segmented", "Select", "Slider", "SpinButton", "SplitButton", "Switch", "Table", "Tabs", "TagInput", "Textarea", "ToastItem", "ToastViewport", "Toggle", "ToggleGroup", "Toolbar", "Tooltip", "VisuallyHidden"];
4
4
  export declare const COMPOSABLES: readonly ["useField", "useForm", "useToast"];
5
5
  export interface ModuleOptions {
6
6
  /** Auto-imported component prefix: `Ui` gives `<UiButton>`. */
@@ -8,18 +8,24 @@ const COMPONENTS = [
8
8
  "AccordionItem",
9
9
  "Avatar",
10
10
  "AvatarGroup",
11
+ "Breadcrumbs",
11
12
  "Button",
12
13
  "Checkbox",
14
+ "CheckboxGroup",
13
15
  "Combobox",
14
16
  "ConfirmDialog",
15
17
  "ContextMenu",
16
18
  "Dialog",
19
+ "Fieldset",
17
20
  "IconButton",
18
21
  "Input",
19
22
  "Kbd",
20
23
  "Menu",
21
24
  "OtpInput",
25
+ "Pagination",
26
+ "PasswordInput",
22
27
  "Popover",
28
+ "Progress",
23
29
  "RadioGroup",
24
30
  "Segmented",
25
31
  "Select",
@@ -29,11 +35,15 @@ const COMPONENTS = [
29
35
  "Switch",
30
36
  "Table",
31
37
  "Tabs",
38
+ "TagInput",
32
39
  "Textarea",
33
40
  "ToastItem",
34
41
  "ToastViewport",
42
+ "Toggle",
43
+ "ToggleGroup",
35
44
  "Toolbar",
36
- "Tooltip"
45
+ "Tooltip",
46
+ "VisuallyHidden"
37
47
  ];
38
48
  const COMPOSABLES = [
39
49
  "useField",
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.1.0";
2
+ var version = "0.2.1";
3
3
  //#endregion
4
4
  export { version };
@@ -281,4 +281,30 @@
281
281
  [data-part="otp-input"]::selection {
282
282
  background: transparent;
283
283
  }
284
+
285
+ /* Fieldset: reset the browser's frame, so the legend styles like a label. */
286
+ [data-part="fieldset"] {
287
+ min-inline-size: 0;
288
+ margin: 0;
289
+ padding: 0;
290
+ border: 0;
291
+ }
292
+
293
+ [data-part="fieldset-legend"] {
294
+ padding: 0;
295
+ }
296
+
297
+ /* Visually hidden: in the accessibility tree, out of the layout. Not `display: none`,
298
+ so screen readers still read it. */
299
+ [data-part="visually-hidden"] {
300
+ position: absolute;
301
+ width: 1px;
302
+ height: 1px;
303
+ margin: -1px;
304
+ padding: 0;
305
+ overflow: hidden;
306
+ clip-path: inset(50%);
307
+ white-space: nowrap;
308
+ border: 0;
309
+ }
284
310
  }
@@ -27,7 +27,7 @@ export interface UiTranslations {
27
27
  characterCount: (count: number, max: number) => string;
28
28
  /** Select with several picked: what follows the first label. */
29
29
  moreSelected: (count: number) => string;
30
- /** Combobox chip's remove button. */
30
+ /** Combobox or TagInput chip's remove button. */
31
31
  removeItem: (label: string) => string;
32
32
  /** Combobox with `multiple`: what's picked, part of the input's description. */
33
33
  selectedItems: (labels: string[]) => string;
@@ -46,6 +46,20 @@ export interface UiTranslations {
46
46
  rangeEnd: string;
47
47
  /** AvatarGroup's "+N" chip, when `overflow-label` isn't set. */
48
48
  moreAvatars: (count: number) => string;
49
+ /** Pagination's nav landmark name, when `label` isn't set. */
50
+ pagination: string;
51
+ /** Pagination's previous-page button. */
52
+ previousPage: string;
53
+ /** Pagination's next-page button. */
54
+ nextPage: string;
55
+ /** A pagination page button's name, e.g. "Page 3". */
56
+ page: (page: number) => string;
57
+ /** PasswordInput's reveal button, while the password is concealed. */
58
+ showPassword: string;
59
+ /** PasswordInput's reveal button, while the password is shown. */
60
+ hidePassword: string;
61
+ /** Breadcrumbs' nav landmark name, when `label` isn't set. */
62
+ breadcrumbs: string;
49
63
  /** Spoken names of Kbd's special keys. */
50
64
  keys: {
51
65
  command: string;
@@ -22,6 +22,13 @@ const defaultTranslations = {
22
22
  rangeStart: "Minimum",
23
23
  rangeEnd: "Maximum",
24
24
  moreAvatars: (count) => `${count} more`,
25
+ pagination: "Pagination",
26
+ previousPage: "Previous page",
27
+ nextPage: "Next page",
28
+ page: (page) => `Page ${page}`,
29
+ showPassword: "Show password",
30
+ hidePassword: "Hide password",
31
+ breadcrumbs: "Breadcrumbs",
25
32
  keys: {
26
33
  command: "Command",
27
34
  control: "Control",
package/dist/types.d.ts CHANGED
@@ -36,6 +36,14 @@ export type ButtonType = "button" | "submit" | "reset";
36
36
  export type LinkTarget = "_blank" | "_self" | "_parent" | "_top";
37
37
  /** Whatever the app's router link accepts (`RouteLocationRaw` for vue-router). */
38
38
  export type LinkTo = string | Record<string, unknown>;
39
+ export interface BreadcrumbItem {
40
+ /** Text of the crumb. */
41
+ label: string;
42
+ /** Route for the configured router link (`createUi({ link })`), rendered instead of an anchor. */
43
+ to?: LinkTo;
44
+ /** Plain URL, for crumbs without a router location. */
45
+ href?: string;
46
+ }
39
47
  export type ToastTone = "success" | "danger" | "info";
40
48
  export interface Toast {
41
49
  id: number;