@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.
- package/dist/components/breadcrumbs/Breadcrumbs.js +59 -0
- package/dist/components/breadcrumbs/Breadcrumbs.vue.d.ts +14 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +89 -0
- package/dist/components/checkbox-group/CheckboxGroup.vue.d.ts +43 -0
- package/dist/components/fieldset/Fieldset.js +59 -0
- package/dist/components/fieldset/Fieldset.vue.d.ts +29 -0
- package/dist/components/pagination/Pagination.js +128 -0
- package/dist/components/pagination/Pagination.vue.d.ts +24 -0
- package/dist/components/password-input/PasswordInput.js +151 -0
- package/dist/components/password-input/PasswordInput.vue.d.ts +32 -0
- package/dist/components/progress/Progress.js +52 -0
- package/dist/components/progress/Progress.vue.d.ts +17 -0
- package/dist/components/segmented/Segmented.js +5 -5
- package/dist/components/tabs/Tabs.js +29 -25
- package/dist/components/tag-input/TagInput.js +186 -0
- package/dist/components/tag-input/TagInput.vue.d.ts +36 -0
- package/dist/components/toggle/Toggle.js +42 -0
- package/dist/components/toggle/Toggle.vue.d.ts +30 -0
- package/dist/components/toggle-group/ToggleGroup.js +98 -0
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +41 -0
- package/dist/components/visually-hidden/VisuallyHidden.js +16 -0
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +19 -0
- package/dist/docs/README.md +10 -0
- package/dist/docs/changelog.md +12 -1
- package/dist/docs/components/breadcrumbs.md +81 -0
- package/dist/docs/components/checkbox-group.md +118 -0
- package/dist/docs/components/fieldset.md +65 -0
- package/dist/docs/components/pagination.md +62 -0
- package/dist/docs/components/password-input.md +55 -0
- package/dist/docs/components/progress.md +56 -0
- package/dist/docs/components/tag-input.md +88 -0
- package/dist/docs/components/toggle-group.md +125 -0
- package/dist/docs/components/toggle.md +81 -0
- package/dist/docs/components/visually-hidden.md +53 -0
- package/dist/docs/forms.md +1 -1
- package/dist/docs/installation.md +0 -2
- package/dist/docs/localisation.md +2 -0
- package/dist/docs/styling.md +16 -0
- package/dist/index.d.ts +44 -28
- package/dist/index.js +41 -27
- package/dist/nuxt/module.d.ts +1 -1
- package/dist/nuxt/module.js +11 -1
- package/dist/package.js +1 -1
- package/dist/styles/core.css +26 -0
- package/dist/translations.d.ts +15 -1
- package/dist/translations.js +7 -0
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/docs/README.md
CHANGED
|
@@ -17,18 +17,24 @@
|
|
|
17
17
|
- [Accordion](./components/accordion.md): Expandable sections.
|
|
18
18
|
- [Avatar](./components/avatar.md): A user image with an initials fallback.
|
|
19
19
|
- [Avatar Group](./components/avatar-group.md): Stacked avatars with an overflow count.
|
|
20
|
+
- [Breadcrumbs](./components/breadcrumbs.md): Where the current page sits in the hierarchy.
|
|
20
21
|
- [Button](./components/button.md): A button, or a link styled as one.
|
|
21
22
|
- [Checkbox](./components/checkbox.md): A checkbox, alone or in a group.
|
|
23
|
+
- [Checkbox Group](./components/checkbox-group.md): Several checkboxes bound to one array.
|
|
22
24
|
- [Combobox](./components/combobox.md): A text input that filters a list of options as you type.
|
|
23
25
|
- [Confirm Dialog](./components/confirm-dialog.md): Asks to confirm or cancel an action.
|
|
24
26
|
- [Context Menu](./components/context-menu.md): A menu opened at the pointer by right-click or long-press.
|
|
25
27
|
- [Dialog](./components/dialog.md): A modal dialog.
|
|
28
|
+
- [Fieldset](./components/fieldset.md): Groups related controls under one legend.
|
|
26
29
|
- [Icon Button](./components/icon-button.md): A button with only an icon.
|
|
27
30
|
- [Input](./components/input.md): A text input with label, hint and error.
|
|
28
31
|
- [Kbd](./components/kbd.md): A keyboard shortcut, shown with the user's platform keys.
|
|
29
32
|
- [Menu](./components/menu.md): A list of actions opened from a button.
|
|
30
33
|
- [OTP Input](./components/otp-input.md): A one-time code input, with a slot per character.
|
|
34
|
+
- [Pagination](./components/pagination.md): Move between pages of results.
|
|
35
|
+
- [Password Input](./components/password-input.md): A password field with a show/hide toggle.
|
|
31
36
|
- [Popover](./components/popover.md): A non-modal panel anchored to a trigger.
|
|
37
|
+
- [Progress](./components/progress.md): A bar showing how far a task has got.
|
|
32
38
|
- [Radio Group](./components/radio-group.md): A single choice from a list.
|
|
33
39
|
- [Segmented](./components/segmented.md): A single choice shown as a row of buttons.
|
|
34
40
|
- [Select](./components/select.md): A single or multiple choice from a dropdown.
|
|
@@ -38,7 +44,11 @@
|
|
|
38
44
|
- [Switch](./components/switch.md): An on/off toggle.
|
|
39
45
|
- [Table](./components/table.md): A data table with custom cells.
|
|
40
46
|
- [Tabs](./components/tabs.md): Panels switched by tabs.
|
|
47
|
+
- [Tag Input](./components/tag-input.md): Free-form tags typed as chips.
|
|
41
48
|
- [Textarea](./components/textarea.md): A multi-line input with an optional character limit.
|
|
42
49
|
- [Toast](./components/toast.md): Temporary notifications.
|
|
50
|
+
- [Toggle](./components/toggle.md): A button that stays pressed.
|
|
51
|
+
- [Toggle Group](./components/toggle-group.md): A set of toggles, single or multiple.
|
|
43
52
|
- [Toolbar](./components/toolbar.md): A row of controls with a single tab stop.
|
|
44
53
|
- [Tooltip](./components/tooltip.md): A short label shown on hover and focus.
|
|
54
|
+
- [Visually Hidden](./components/visually-hidden.md): Text for assistive technology only.
|
package/dist/docs/changelog.md
CHANGED
|
@@ -2,8 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
> What changed in each release.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 0.2.1 (2026-11-01)
|
|
6
6
|
|
|
7
|
+
- feat: add Toggle and ToggleGroup components with styling and demos
|
|
8
|
+
|
|
9
|
+
## 0.2.0 (2026-11-01)
|
|
10
|
+
|
|
11
|
+
- Bump version to 0.2.0 in package.json
|
|
12
|
+
|
|
13
|
+
## 0.1.1 (2026-11-01)
|
|
14
|
+
|
|
15
|
+
- Add tests for new components and enhance existing ones (#1)
|
|
16
|
+
- Bump version to 0.1.1 in package.json
|
|
17
|
+
- Enhance SSR support for Segmented and Tabs components; add hydration tests
|
|
7
18
|
- ci: update branch name formatting and paths-filter version deps: bump bun package manager to version 1.4.4
|
|
8
19
|
- Style: update checkbox and radio control background and border variables
|
|
9
20
|
- README: say modern browsers, drop the releasing section; add the docs preview launch config
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Breadcrumbs
|
|
2
|
+
|
|
3
|
+
> Where the current page sits in the hierarchy.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
Each crumb is a `to` router link, an `href`, or plain text for the current page. In Nuxt, the `to` crumbs render through `NuxtLink` (the module installs it as the configured link component); in a plain Vue app, pass `RouterLink` to `createUi({ link })`. Use `href` for plain or external URLs.
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const items = [
|
|
14
|
+
{ label: "Docs", to: "/" },
|
|
15
|
+
{ label: "Components", to: "/components/button" },
|
|
16
|
+
{ label: "Breadcrumbs" },
|
|
17
|
+
];
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="demo-stack">
|
|
22
|
+
<UiBreadcrumbs :items="items" />
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Separator
|
|
28
|
+
|
|
29
|
+
`separator` is the text between crumbs, hidden from assistive technology. Leave it empty to draw a separator in CSS instead.
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
const items = [
|
|
34
|
+
{ label: "Docs", to: "/" },
|
|
35
|
+
{ label: "Components", to: "/components/button" },
|
|
36
|
+
{ label: "Breadcrumbs" },
|
|
37
|
+
];
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div class="demo-stack">
|
|
42
|
+
<UiBreadcrumbs :items="items" separator="›" />
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
| --- | --- | --- | --- |
|
|
51
|
+
| `items` | `BreadcrumbItem[]` | `[]` | Crumbs, in order. The last one is the current page. |
|
|
52
|
+
| `label` | `string` | — | Accessible name for the navigation landmark, when the `breadcrumbs` translation isn't wanted. |
|
|
53
|
+
| `separator` | `string` | `"/"` | Text between crumbs, hidden from assistive technology. Leave it empty to style a separator with CSS instead. |
|
|
54
|
+
|
|
55
|
+
Types:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
export interface BreadcrumbItem {
|
|
59
|
+
/** Text of the crumb. */
|
|
60
|
+
label: string;
|
|
61
|
+
/** Route for the configured router link (`createUi({ link })`), rendered instead of an anchor. */
|
|
62
|
+
to?: LinkTo;
|
|
63
|
+
/** Plain URL, for crumbs without a router location. */
|
|
64
|
+
href?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Whatever the app's router link accepts (`RouteLocationRaw` for vue-router). */
|
|
68
|
+
export type LinkTo = string | Record<string, unknown>;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Styling
|
|
72
|
+
|
|
73
|
+
- Parts (`[data-part="…"]`): `breadcrumbs`, `breadcrumbs-list`, `breadcrumbs-item`, `breadcrumbs-separator`, `breadcrumbs-link`, `breadcrumbs-label`
|
|
74
|
+
- State attributes: `data-breadcrumbs-current`
|
|
75
|
+
|
|
76
|
+
## Accessibility
|
|
77
|
+
|
|
78
|
+
- The trail is a `<nav>` landmark, named by `label` or the `breadcrumbs` translation.
|
|
79
|
+
- The crumbs are an ordered list, so assistive technology can announce each crumb's position.
|
|
80
|
+
- The last crumb is the current page and has `aria-current="page"`.
|
|
81
|
+
- Separators are `aria-hidden`, so they aren't read out.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Checkbox Group
|
|
2
|
+
|
|
3
|
+
> Several checkboxes bound to one array.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
The array-model convenience over the group pattern documented on [Checkbox](/components/checkbox#group): one `v-model` for every checkbox.
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const toppings = ref<string[]>(["cheese"]);
|
|
14
|
+
const options = [
|
|
15
|
+
{ label: "Cheese", value: "cheese" },
|
|
16
|
+
{ label: "Olives", value: "olives" },
|
|
17
|
+
{ label: "Basil", value: "basil" },
|
|
18
|
+
];
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="demo-stack">
|
|
23
|
+
<UiCheckboxGroup
|
|
24
|
+
v-model="toppings"
|
|
25
|
+
:options="options"
|
|
26
|
+
label="Toppings"
|
|
27
|
+
hint="Pick any that apply."
|
|
28
|
+
/>
|
|
29
|
+
<p class="demo-note">Selected: {{ toppings.join(", ") || "none" }}</p>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Horizontal
|
|
35
|
+
|
|
36
|
+
`orientation` is a layout hook, exposed as `data-orientation`.
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
const extras = ref<string[]>([]);
|
|
41
|
+
const options = [
|
|
42
|
+
{ label: "Insurance", value: "insurance" },
|
|
43
|
+
{ label: "Gift wrap", value: "gift-wrap" },
|
|
44
|
+
{ label: "Priority", value: "priority" },
|
|
45
|
+
];
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<UiCheckboxGroup v-model="extras" :options="options" orientation="horizontal" label="Extras" />
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Error
|
|
54
|
+
|
|
55
|
+
A string `error` replaces the hint, and is announced as an alert when it appears.
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
const addons = ref<string[]>([]);
|
|
60
|
+
const options = [
|
|
61
|
+
{ label: "Insurance", value: "insurance" },
|
|
62
|
+
{ label: "Gift wrap", value: "gift-wrap" },
|
|
63
|
+
];
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<UiCheckboxGroup
|
|
68
|
+
v-model="addons"
|
|
69
|
+
:options="options"
|
|
70
|
+
label="Add-ons"
|
|
71
|
+
error="Pick at least one add-on."
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## API
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Description |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| `options` | `SelectOption<T>[]` | `[]` | Checkboxes to render, in order. |
|
|
81
|
+
| `label` | `string` | — | Visible group label, which names the fieldset. |
|
|
82
|
+
| `hint` | `string` | — | Help text under the legend, announced as the group's description. |
|
|
83
|
+
| `error` | `string \| boolean` | — | `true` marks the group invalid; a string also shows it as the message, replacing the hint. |
|
|
84
|
+
| `disabled` | `boolean` | `false` | Disables every checkbox. |
|
|
85
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"vertical"` | Layout hook, exposed as `data-orientation`. |
|
|
86
|
+
| `name` | `string` | — | Form field name: submits the checked values with a native form, via hidden inputs. |
|
|
87
|
+
| `modelValue` | `T[]` | — | The checked values. |
|
|
88
|
+
|
|
89
|
+
| Event | Payload | Description |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `update:modelValue` | `[value: T[] \| undefined]` | `v-model:modelValue` update. |
|
|
92
|
+
|
|
93
|
+
| Slot | Props | Description |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `option` | `{ option: SelectOption<T>; checked: boolean; }` | Checkbox content, replacing the box and label. |
|
|
96
|
+
|
|
97
|
+
Types:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
export interface SelectOption<T extends SelectValue = SelectValue> {
|
|
101
|
+
label: string;
|
|
102
|
+
value: T;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type SelectValue = string | number;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Styling
|
|
110
|
+
|
|
111
|
+
- Parts (`[data-part="…"]`): `checkbox-group`, `checkbox`, `checkbox-input`, `checkbox-control`, `checkbox-label`, `field-message`, `fieldset`, `fieldset-legend`
|
|
112
|
+
- State attributes: `data-orientation`, `data-field-name`, `data-checkbox-disabled`, `data-checkbox-error`, `data-field-tone`, `data-field-error`
|
|
113
|
+
|
|
114
|
+
## Accessibility
|
|
115
|
+
|
|
116
|
+
- The options sit in a `<fieldset>` with a `<legend>`, so the group's name is announced with each checkbox.
|
|
117
|
+
- Each option is a native `<input type="checkbox">`.
|
|
118
|
+
- `disabled` disables every checkbox; `option.disabled` disables just that one.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Fieldset
|
|
2
|
+
|
|
3
|
+
> Groups related controls under one legend.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const street = ref("");
|
|
12
|
+
const city = ref("");
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<UiFieldset class="demo-form" legend="Shipping address" hint="Where should we send it?">
|
|
17
|
+
<UiInput v-model="street" label="Street" />
|
|
18
|
+
<UiInput v-model="city" label="City" />
|
|
19
|
+
</UiFieldset>
|
|
20
|
+
</template>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Disabled
|
|
24
|
+
|
|
25
|
+
A disabled `<fieldset>` disables the native controls inside it.
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
const street = ref("12 Baker Street");
|
|
30
|
+
const city = ref("London");
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<UiFieldset class="demo-form" legend="Shipping address" disabled>
|
|
35
|
+
<UiInput v-model="street" label="Street" />
|
|
36
|
+
<UiInput v-model="city" label="City" />
|
|
37
|
+
</UiFieldset>
|
|
38
|
+
</template>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Description |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
|
+
| `legend` | `string` | — | Text inside the `<legend>`, naming the group. |
|
|
46
|
+
| `hint` | `string` | — | Help text under the legend, announced as the group's description. |
|
|
47
|
+
| `error` | `string \| boolean` | — | `true` marks the group invalid; a string also shows it as the message, replacing the hint. |
|
|
48
|
+
| `disabled` | `boolean` | `false` | Disables the group: native controls inside it too. |
|
|
49
|
+
| `id` | `string` | — | Id for the `<fieldset>`; generated with `useId()` when omitted. |
|
|
50
|
+
|
|
51
|
+
| Slot | Props | Description |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `default` | — | The grouped controls. |
|
|
54
|
+
| `legend` | `{}` | Legend content, replacing `legend`. |
|
|
55
|
+
|
|
56
|
+
## Styling
|
|
57
|
+
|
|
58
|
+
- Parts (`[data-part="…"]`): `fieldset`, `fieldset-legend`, `field-message`
|
|
59
|
+
- State attributes: `data-field-error`, `data-field-tone`
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
|
|
63
|
+
- It's a native `<fieldset>` with a `<legend>`, so assistive tech announces the group's name with every control inside it.
|
|
64
|
+
- `hint` and `error` are the fieldset's description: `aria-describedby` points at the message.
|
|
65
|
+
- Native `<fieldset disabled>` only disables native controls. Components built on buttons (e.g. a segmented control) need their own `disabled`.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
> Move between pages of results.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const page = ref(1);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="demo-stack">
|
|
16
|
+
<UiPagination v-model="page" :page-count="12" />
|
|
17
|
+
<p class="demo-note">Page {{ page }} of 12</p>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Compact
|
|
23
|
+
|
|
24
|
+
`sibling-count` is how many pages show either side of the current one. With `0`, only the first and last pages and the current one are listed.
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
const page = ref(9);
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="demo-stack">
|
|
33
|
+
<UiPagination v-model="page" :page-count="20" :sibling-count="0" />
|
|
34
|
+
<p class="demo-note">Page {{ page }} of 20</p>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| `pageCount` (required) | `number` | — | Number of pages, at least 1. |
|
|
44
|
+
| `siblingCount` | `number` | `1` | Pages shown either side of the current one. |
|
|
45
|
+
| `label` | `string` | — | Accessible name for the navigation landmark, when the `pagination` translation isn't wanted. |
|
|
46
|
+
| `disabled` | `boolean` | `false` | Disables every button. |
|
|
47
|
+
| `modelValue` | `number` | — | The current page, 1-based. |
|
|
48
|
+
|
|
49
|
+
| Event | Payload | Description |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `update:modelValue` | `[value: number \| undefined]` | `v-model:modelValue` update. |
|
|
52
|
+
|
|
53
|
+
## Styling
|
|
54
|
+
|
|
55
|
+
- Parts (`[data-part="…"]`): `pagination`, `pagination-list`, `pagination-item`, `pagination-previous`, `pagination-page`, `pagination-ellipsis`, `pagination-next`
|
|
56
|
+
- State attributes: `data-pagination-disabled`, `data-pagination-current`
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
|
|
60
|
+
- The whole control is a `<nav>` landmark, named by `label` or the `pagination` translation.
|
|
61
|
+
- The current page's button has `aria-current="page"`, and every page button is named “Page N”.
|
|
62
|
+
- Previous and next are real buttons, disabled at the first and last page.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Password Input
|
|
2
|
+
|
|
3
|
+
> A password field with a show/hide toggle.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const password = ref("");
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="demo-field">
|
|
16
|
+
<UiPasswordInput
|
|
17
|
+
v-model="password"
|
|
18
|
+
label="Password"
|
|
19
|
+
hint="At least 8 characters."
|
|
20
|
+
autocomplete="current-password"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| `label` | `string` | — | Visible label, linked to the control. |
|
|
31
|
+
| `hint` | `string` | — | Help text under the control, announced as its description. |
|
|
32
|
+
| `error` | `string \| boolean` | — | `true` marks the control invalid; a string also shows it as the message, replacing the hint. |
|
|
33
|
+
| `optional` | `boolean` | `false` | Appends the `optional` translation to the label. |
|
|
34
|
+
| `disabled` | `boolean` | `false` | Disables the control and its reveal button. |
|
|
35
|
+
| `autocomplete` | `string` | `"current-password"` | Value of the native `autocomplete` attribute, e.g. `new-password` on a sign-up form. |
|
|
36
|
+
| `id` | `string` | — | Id for the control; generated with `useId()` when omitted. |
|
|
37
|
+
| `modelValue` | `string` | — | The password. |
|
|
38
|
+
|
|
39
|
+
| Event | Payload | Description |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| `update:modelValue` | `[value: string \| undefined]` | `v-model:modelValue` update. |
|
|
42
|
+
|
|
43
|
+
## Styling
|
|
44
|
+
|
|
45
|
+
Password Input reuses Input's parts, so the same styles apply; only the reveal button is new.
|
|
46
|
+
|
|
47
|
+
- Parts (`[data-part="…"]`): `field`, `field-label`, `field-optional`, `input-control`, `input`, `password-toggle`, `field-message`
|
|
48
|
+
- State attributes: `data-field-error`, `data-field-tone`
|
|
49
|
+
|
|
50
|
+
## Accessibility
|
|
51
|
+
|
|
52
|
+
- The reveal button is a `type="button"` with `aria-pressed`, so it never submits the password by accident and its state is announced.
|
|
53
|
+
- Its name changes with the state: "Show password" while concealed, "Hide password" while revealed, both from the `translations` config.
|
|
54
|
+
- The label never changes between hidden and shown; the value stays in the field, and toggling never moves focus out of it.
|
|
55
|
+
- Revealing only switches the native input's `type`, so password managers and autofill keep working.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
> A bar showing how far a task has got.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<div class="demo-stack demo-field">
|
|
12
|
+
<UiProgress label="Uploading" :value="62" show-value />
|
|
13
|
+
<p class="demo-note">
|
|
14
|
+
The bar is 62% full; the percentage is repeated to the right, hidden from screen readers.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Indeterminate
|
|
21
|
+
|
|
22
|
+
With no `value` — or a non-finite one — the length of the task isn't known.
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<template>
|
|
26
|
+
<div class="demo-stack demo-field">
|
|
27
|
+
<UiProgress label="Loading" />
|
|
28
|
+
<p class="demo-note">
|
|
29
|
+
With no value it's indeterminate: it shows work is happening, not how much.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Default | Description |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `value` | `number` | — | Current value. Omit it, or pass a non-finite number, for an indeterminate bar. |
|
|
40
|
+
| `max` | `number` | `100` | The value at which the bar is full. |
|
|
41
|
+
| `label` | `string` | — | Accessible name, e.g. "Uploading". |
|
|
42
|
+
| `valueText` | `string` | — | Spoken and displayed text for the value, e.g. "3 of 5 files". Defaults to a percentage. |
|
|
43
|
+
| `showValue` | `boolean` | `false` | Shows the value next to the bar. |
|
|
44
|
+
|
|
45
|
+
## Styling
|
|
46
|
+
|
|
47
|
+
The indicator is placed with `--ui-progress`, a percentage from `0%` to `100%`. A root marked `data-progress-indeterminate` has no value to show.
|
|
48
|
+
|
|
49
|
+
- Parts (`[data-part="…"]`): `progress`, `progress-track`, `progress-indicator`, `progress-value`
|
|
50
|
+
- State attributes: `data-progress-indeterminate`
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
|
|
54
|
+
- The bar is a `role="progressbar"` with `aria-valuemin`, `aria-valuemax` and, when the value is known, `aria-valuenow`.
|
|
55
|
+
- `label` names the bar; `value-text` says the value in words, e.g. "3 of 5 files".
|
|
56
|
+
- An indeterminate bar has no `aria-valuenow`, so screen readers say it's working without a number.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Tag Input
|
|
2
|
+
|
|
3
|
+
> Free-form tags typed as chips.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Basic
|
|
8
|
+
|
|
9
|
+
Type a tag and press Enter or a comma; leaving the field adds it too.
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const topics = ref(["vue"]);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div class="demo-field">
|
|
18
|
+
<UiTagInput
|
|
19
|
+
v-model="topics"
|
|
20
|
+
label="Topics"
|
|
21
|
+
hint="Press Enter or type a comma to add a tag."
|
|
22
|
+
placeholder="Add a topic…"
|
|
23
|
+
/>
|
|
24
|
+
<p class="demo-note">Tags: {{ topics.join(", ") || "none" }}</p>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Max
|
|
30
|
+
|
|
31
|
+
`max` stops the list growing; the field stays usable so tags can still be removed.
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
const topics = ref(["vue", "css"]);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div class="demo-field">
|
|
40
|
+
<UiTagInput
|
|
41
|
+
v-model="topics"
|
|
42
|
+
label="Topics"
|
|
43
|
+
hint="Up to three topics."
|
|
44
|
+
placeholder="Add a topic…"
|
|
45
|
+
:max="3"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Default | Description |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| `label` | `string` | — | Visible label, linked to the control. |
|
|
56
|
+
| `hint` | `string` | — | Help text under the control, announced as its description. |
|
|
57
|
+
| `error` | `string \| boolean` | — | `true` marks the control invalid; a string also shows it as the message, replacing the hint. |
|
|
58
|
+
| `optional` | `boolean` | `false` | Appends the `optional` translation to the label. |
|
|
59
|
+
| `disabled` | `boolean` | `false` | Disables the control and its remove buttons. |
|
|
60
|
+
| `placeholder` | `string` | — | Placeholder for the text field. |
|
|
61
|
+
| `max` | `number` | — | Most tags allowed; unlimited when omitted. |
|
|
62
|
+
| `name` | `string` | — | Form field name: submits one hidden input per tag. |
|
|
63
|
+
| `id` | `string` | — | Id for the text field; generated with `useId()` when omitted. |
|
|
64
|
+
| `modelValue` | `string[]` | — | The tags. |
|
|
65
|
+
|
|
66
|
+
| Event | Payload | Description |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `update:modelValue` | `[value: string[] \| undefined]` | `v-model:modelValue` update. |
|
|
69
|
+
|
|
70
|
+
## Styling
|
|
71
|
+
|
|
72
|
+
- Parts (`[data-part="…"]`): `field`, `field-label`, `field-optional`, `tag-input-control`, `tag-input-chip`, `tag-input-chip-label`, `tag-input-chip-remove`, `tag-input`, `field-message`
|
|
73
|
+
- State attributes: `data-field-error`, `data-field-name`, `data-tag-input-disabled`, `data-tag-input-full`, `data-field-tone`
|
|
74
|
+
|
|
75
|
+
## Keyboard
|
|
76
|
+
|
|
77
|
+
| Keys | Action |
|
|
78
|
+
| ------------ | ------------------------------------------- |
|
|
79
|
+
| `Enter`, `,` | Add the typed tag |
|
|
80
|
+
| `Backspace` | Remove the last tag when the field is empty |
|
|
81
|
+
| `Tab` | Move to the next chip's remove button |
|
|
82
|
+
|
|
83
|
+
## Accessibility
|
|
84
|
+
|
|
85
|
+
- Each chip's remove button is a real `<button>` named by the `removeItem` translation with the tag, so it's reachable and announced on its own.
|
|
86
|
+
- With `name`, one hidden input per tag submits the tags with a native form.
|
|
87
|
+
- The label is linked to the text field; hint and error are part of its description.
|
|
88
|
+
- Duplicate tags are kept: the value is exactly what the user entered.
|