@humanonlyweb/ui 0.1.0 → 0.2.0
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/visually-hidden/VisuallyHidden.js +16 -0
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +19 -0
- package/dist/docs/README.md +8 -0
- package/dist/docs/changelog.md +8 -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/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 +42 -28
- package/dist/index.js +39 -27
- package/dist/nuxt/module.d.ts +1 -1
- package/dist/nuxt/module.js +9 -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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeStyle, openBlock, toDisplayString } from "vue";
|
|
2
|
+
//#region src/components/progress/Progress.vue
|
|
3
|
+
const _hoisted_1 = [
|
|
4
|
+
"aria-valuemax",
|
|
5
|
+
"aria-label",
|
|
6
|
+
"aria-valuenow",
|
|
7
|
+
"aria-valuetext",
|
|
8
|
+
"data-progress-indeterminate"
|
|
9
|
+
];
|
|
10
|
+
const _hoisted_2 = { "data-part": "progress-track" };
|
|
11
|
+
const _hoisted_3 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
"data-part": "progress-value",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
};
|
|
16
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
|
+
__name: "Progress",
|
|
18
|
+
props: {
|
|
19
|
+
value: {},
|
|
20
|
+
max: { default: 100 },
|
|
21
|
+
label: {},
|
|
22
|
+
valueText: {},
|
|
23
|
+
showValue: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const indeterminate = computed(() => __props.value == null || !Number.isFinite(__props.value));
|
|
30
|
+
const maximum = computed(() => __props.max > 0 ? __props.max : 100);
|
|
31
|
+
const clamped = computed(() => indeterminate.value ? 0 : Math.min(Math.max(__props.value ?? 0, 0), maximum.value));
|
|
32
|
+
const percent = computed(() => clamped.value / maximum.value * 100);
|
|
33
|
+
const display = computed(() => __props.valueText ?? `${Math.round(percent.value)}%`);
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return openBlock(), createElementBlock("div", {
|
|
36
|
+
"data-part": "progress",
|
|
37
|
+
role: "progressbar",
|
|
38
|
+
"aria-valuemin": "0",
|
|
39
|
+
"aria-valuemax": maximum.value,
|
|
40
|
+
"aria-label": __props.label,
|
|
41
|
+
"aria-valuenow": indeterminate.value ? void 0 : clamped.value,
|
|
42
|
+
"aria-valuetext": indeterminate.value ? void 0 : __props.valueText,
|
|
43
|
+
"data-progress-indeterminate": indeterminate.value || void 0
|
|
44
|
+
}, [createElementVNode("div", _hoisted_2, [createElementVNode("div", {
|
|
45
|
+
"data-part": "progress-indicator",
|
|
46
|
+
style: normalizeStyle({ "--ui-progress": `${percent.value}%` })
|
|
47
|
+
}, null, 4)]), __props.showValue && !indeterminate.value ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(display.value), 1)) : createCommentVNode("v-if", true)], 8, _hoisted_1);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/progress/Progress.vue.d.ts
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Current value. Omit it, or pass a non-finite number, for an indeterminate bar. */
|
|
4
|
+
value?: number;
|
|
5
|
+
/** The value at which the bar is full. */
|
|
6
|
+
max?: number;
|
|
7
|
+
/** Accessible name, e.g. "Uploading". */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Spoken and displayed text for the value, e.g. "3 of 5 files". Defaults to a percentage. */
|
|
10
|
+
valueText?: string;
|
|
11
|
+
/** Shows the value next to the bar. */
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { _default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRovingSelection } from "../../composables/use-roving-selection.js";
|
|
2
2
|
import { useSlideIndicator } from "../../composables/use-slide-indicator.js";
|
|
3
|
-
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useModel, useTemplateRef
|
|
3
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useModel, useTemplateRef } from "vue";
|
|
4
4
|
//#region src/components/segmented/Segmented.vue
|
|
5
5
|
const _hoisted_1 = [
|
|
6
6
|
"data-field-name",
|
|
@@ -70,12 +70,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
70
70
|
"aria-disabled": __props.disabled || void 0,
|
|
71
71
|
onKeydown: _cache[0] || (_cache[0] = (...args) => unref(onKeydown) && unref(onKeydown)(...args))
|
|
72
72
|
}, [
|
|
73
|
-
createCommentVNode(" Until measured (e.g. before hydration) style the checked segment itself,\n via [data-segment-checked], so the selection is never invisible. "),
|
|
74
|
-
|
|
73
|
+
createCommentVNode(" Until measured (e.g. before hydration) style the checked segment itself,\n via [data-segment-checked], so the selection is never invisible. Hiding the\n indicator with a style binding, not v-show, keeps that in the server HTML:\n directives' SSR props don't reach prebuilt render functions. "),
|
|
74
|
+
createElementVNode("span", {
|
|
75
|
+
style: normalizeStyle([unref(style), unref(isMeasured) ? void 0 : { display: "none" }]),
|
|
75
76
|
"data-part": "segmented-indicator",
|
|
76
|
-
style: normalizeStyle(unref(style)),
|
|
77
77
|
"aria-hidden": "true"
|
|
78
|
-
}, null, 4),
|
|
78
|
+
}, null, 4),
|
|
79
79
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, i) => {
|
|
80
80
|
return openBlock(), createElementBlock("button", {
|
|
81
81
|
ref_for: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRovingSelection } from "../../composables/use-roving-selection.js";
|
|
2
2
|
import { useSlideIndicator } from "../../composables/use-slide-indicator.js";
|
|
3
|
-
import { Fragment, computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef
|
|
3
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeModels, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef } from "vue";
|
|
4
4
|
//#region src/components/tabs/Tabs.vue
|
|
5
5
|
const _hoisted_1 = { "data-part": "tabs" };
|
|
6
6
|
const _hoisted_2 = [
|
|
@@ -62,30 +62,34 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
62
|
"data-tabs-animate": unref(canAnimate) || void 0,
|
|
63
63
|
"aria-label": __props.label,
|
|
64
64
|
onKeydown: _cache[0] || (_cache[0] = (...args) => unref(onKeydown) && unref(onKeydown)(...args))
|
|
65
|
-
}, [
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
}, [
|
|
66
|
+
createCommentVNode(" Hidden until measured with a style binding, not v-show, so the server HTML\n carries the hidden state even from a prebuilt render function. "),
|
|
67
|
+
createElementVNode("span", {
|
|
68
|
+
style: normalizeStyle([unref(style), unref(isMeasured) ? void 0 : { display: "none" }]),
|
|
69
|
+
"data-part": "tab-indicator",
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
}, null, 4),
|
|
72
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, i) => {
|
|
73
|
+
return openBlock(), createElementBlock("button", {
|
|
74
|
+
id: tabId(i),
|
|
75
|
+
ref_for: true,
|
|
76
|
+
ref: "tabs",
|
|
77
|
+
key: item.value,
|
|
78
|
+
type: "button",
|
|
79
|
+
role: "tab",
|
|
80
|
+
"data-part": "tab",
|
|
81
|
+
"aria-selected": item.value === model.value,
|
|
82
|
+
"aria-controls": panelId,
|
|
83
|
+
tabindex: unref(isTabStop)(item, i) ? 0 : -1,
|
|
84
|
+
disabled: __props.disabled || item.disabled,
|
|
85
|
+
"data-tab-selected": item.value === model.value || void 0,
|
|
86
|
+
onClick: ($event) => unref(select)(item)
|
|
87
|
+
}, [renderSlot(_ctx.$slots, "tab", {
|
|
88
|
+
item,
|
|
89
|
+
selected: item.value === model.value
|
|
90
|
+
}, () => [createTextVNode(toDisplayString(item.label), 1)])], 8, _hoisted_3);
|
|
91
|
+
}), 128))
|
|
92
|
+
], 40, _hoisted_2), createElementVNode("div", {
|
|
89
93
|
id: panelId,
|
|
90
94
|
role: "tabpanel",
|
|
91
95
|
"data-part": "tabpanel",
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useTranslations } from "../../config.js";
|
|
2
|
+
import { useField } from "../../composables/use-field.js";
|
|
3
|
+
import _sfc_main$1 from "../field/FieldMessage.js";
|
|
4
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, openBlock, ref, renderList, toDisplayString, unref, useModel, useTemplateRef, vModelText, withDirectives, withModifiers } from "vue";
|
|
5
|
+
//#region src/components/tag-input/TagInput.vue
|
|
6
|
+
const _hoisted_1 = ["data-field-error", "data-field-name"];
|
|
7
|
+
const _hoisted_2 = ["for"];
|
|
8
|
+
const _hoisted_3 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
"data-part": "field-optional"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_4 = ["data-tag-input-disabled", "data-tag-input-full"];
|
|
13
|
+
const _hoisted_5 = { "data-part": "tag-input-chip-label" };
|
|
14
|
+
const _hoisted_6 = [
|
|
15
|
+
"aria-label",
|
|
16
|
+
"disabled",
|
|
17
|
+
"onClick"
|
|
18
|
+
];
|
|
19
|
+
const _hoisted_7 = [
|
|
20
|
+
"id",
|
|
21
|
+
"placeholder",
|
|
22
|
+
"disabled",
|
|
23
|
+
"aria-invalid",
|
|
24
|
+
"aria-describedby"
|
|
25
|
+
];
|
|
26
|
+
const _hoisted_8 = ["name", "value"];
|
|
27
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
__name: "TagInput",
|
|
30
|
+
props: /*@__PURE__*/ mergeModels({
|
|
31
|
+
label: {},
|
|
32
|
+
hint: {},
|
|
33
|
+
error: { type: [String, Boolean] },
|
|
34
|
+
optional: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
placeholder: {},
|
|
43
|
+
max: {},
|
|
44
|
+
name: {},
|
|
45
|
+
id: {}
|
|
46
|
+
}, {
|
|
47
|
+
"modelValue": {},
|
|
48
|
+
"modelModifiers": {}
|
|
49
|
+
}),
|
|
50
|
+
emits: ["update:modelValue"],
|
|
51
|
+
setup(__props, { expose: __expose }) {
|
|
52
|
+
/** The tags. */
|
|
53
|
+
const model = useModel(__props, "modelValue");
|
|
54
|
+
const { id, hintId, errorId, isError, errorMessage, describedBy } = useField({
|
|
55
|
+
id: () => __props.id,
|
|
56
|
+
hint: () => __props.hint,
|
|
57
|
+
error: () => __props.error
|
|
58
|
+
});
|
|
59
|
+
const translations = useTranslations();
|
|
60
|
+
const inputRef = useTemplateRef("input");
|
|
61
|
+
const draft = ref("");
|
|
62
|
+
const tags = computed(() => model.value ?? []);
|
|
63
|
+
const isFull = computed(() => __props.max != null && tags.value.length >= __props.max);
|
|
64
|
+
/** Adds every non-empty part until `max` is reached. Duplicates are kept. */
|
|
65
|
+
function add(parts) {
|
|
66
|
+
if (__props.disabled) return;
|
|
67
|
+
const fresh = parts.map((part) => part.trim()).filter(Boolean);
|
|
68
|
+
if (!fresh.length) return;
|
|
69
|
+
const room = __props.max == null ? fresh.length : Math.max(__props.max - tags.value.length, 0);
|
|
70
|
+
if (!room) return;
|
|
71
|
+
model.value = [...tags.value, ...fresh.slice(0, room)];
|
|
72
|
+
}
|
|
73
|
+
/** Commits the text field, which always clears, even when `max` is reached. */
|
|
74
|
+
function commit() {
|
|
75
|
+
const value = draft.value;
|
|
76
|
+
draft.value = "";
|
|
77
|
+
add([value]);
|
|
78
|
+
}
|
|
79
|
+
function removeAt(index) {
|
|
80
|
+
if (__props.disabled || index < 0) return;
|
|
81
|
+
model.value = tags.value.filter((_, i) => i !== index);
|
|
82
|
+
inputRef.value?.focus();
|
|
83
|
+
}
|
|
84
|
+
function remove(tag) {
|
|
85
|
+
removeAt(tags.value.indexOf(tag));
|
|
86
|
+
}
|
|
87
|
+
function onKeydown(event) {
|
|
88
|
+
if (__props.disabled) return;
|
|
89
|
+
if (event.key === "Enter" || event.key === ",") {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
commit();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (event.key === "Backspace" && !draft.value && tags.value.length) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
removeAt(tags.value.length - 1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function onPaste(event) {
|
|
100
|
+
const text = event.clipboardData?.getData("text") ?? "";
|
|
101
|
+
if (!/[,\n]/.test(text)) return;
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
commit();
|
|
104
|
+
add(text.split(/[,\n]/));
|
|
105
|
+
}
|
|
106
|
+
__expose({ focus: () => inputRef.value?.focus() });
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return openBlock(), createElementBlock("div", {
|
|
109
|
+
"data-part": "field",
|
|
110
|
+
"data-field-error": unref(isError) || void 0,
|
|
111
|
+
"data-field-name": __props.name
|
|
112
|
+
}, [
|
|
113
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
114
|
+
key: 0,
|
|
115
|
+
for: unref(id),
|
|
116
|
+
"data-part": "field-label"
|
|
117
|
+
}, [createTextVNode(toDisplayString(__props.label), 1), __props.optional ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(` ${unref(translations).optional}`), 1)) : createCommentVNode("v-if", true)], 8, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
118
|
+
createElementVNode("div", {
|
|
119
|
+
"data-part": "tag-input-control",
|
|
120
|
+
"data-tag-input-disabled": __props.disabled || void 0,
|
|
121
|
+
"data-tag-input-full": isFull.value || void 0,
|
|
122
|
+
onClick: _cache[1] || (_cache[1] = ($event) => inputRef.value?.focus())
|
|
123
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(tags.value, (tag, index) => {
|
|
124
|
+
return openBlock(), createElementBlock("span", {
|
|
125
|
+
key: `${tag}-${index}`,
|
|
126
|
+
"data-part": "tag-input-chip"
|
|
127
|
+
}, [createElementVNode("span", _hoisted_5, toDisplayString(tag), 1), createElementVNode("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
"data-part": "tag-input-chip-remove",
|
|
130
|
+
"aria-label": unref(translations).removeItem(tag),
|
|
131
|
+
disabled: __props.disabled,
|
|
132
|
+
onClick: withModifiers(($event) => remove(tag), ["stop"])
|
|
133
|
+
}, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
|
|
134
|
+
viewBox: "0 0 16 16",
|
|
135
|
+
width: "12",
|
|
136
|
+
height: "12",
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
focusable: "false"
|
|
139
|
+
}, [createElementVNode("path", {
|
|
140
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
141
|
+
stroke: "currentColor",
|
|
142
|
+
"stroke-width": "1.5",
|
|
143
|
+
"stroke-linecap": "round"
|
|
144
|
+
})], -1)])], 8, _hoisted_6)]);
|
|
145
|
+
}), 128)), withDirectives(createElementVNode("input", mergeProps({
|
|
146
|
+
id: unref(id),
|
|
147
|
+
ref: "input",
|
|
148
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draft.value = $event)
|
|
149
|
+
}, _ctx.$attrs, {
|
|
150
|
+
type: "text",
|
|
151
|
+
autocomplete: "off",
|
|
152
|
+
placeholder: __props.placeholder,
|
|
153
|
+
disabled: __props.disabled,
|
|
154
|
+
"aria-invalid": unref(isError) || void 0,
|
|
155
|
+
"aria-describedby": unref(describedBy),
|
|
156
|
+
"data-part": "tag-input",
|
|
157
|
+
onKeydown,
|
|
158
|
+
onBlur: commit,
|
|
159
|
+
onPaste
|
|
160
|
+
}), null, 16, _hoisted_7), [[vModelText, draft.value]])], 8, _hoisted_4),
|
|
161
|
+
createCommentVNode(" Buttons don't submit values, so the form gets one hidden input per tag instead. "),
|
|
162
|
+
__props.name ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(tags.value, (tag, index) => {
|
|
163
|
+
return openBlock(), createElementBlock("input", {
|
|
164
|
+
key: index,
|
|
165
|
+
type: "hidden",
|
|
166
|
+
name: __props.name,
|
|
167
|
+
value: tag
|
|
168
|
+
}, null, 8, _hoisted_8);
|
|
169
|
+
}), 128)) : createCommentVNode("v-if", true),
|
|
170
|
+
createVNode(_sfc_main$1, {
|
|
171
|
+
"error-id": unref(errorId),
|
|
172
|
+
"hint-id": unref(hintId),
|
|
173
|
+
"error-message": unref(errorMessage),
|
|
174
|
+
hint: __props.hint
|
|
175
|
+
}, null, 8, [
|
|
176
|
+
"error-id",
|
|
177
|
+
"hint-id",
|
|
178
|
+
"error-message",
|
|
179
|
+
"hint"
|
|
180
|
+
])
|
|
181
|
+
], 8, _hoisted_1);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
//#endregion
|
|
186
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/components/tag-input/TagInput.vue.d.ts
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Visible label, linked to the control. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Help text under the control, announced as its description. */
|
|
6
|
+
hint?: string;
|
|
7
|
+
/** `true` marks the control invalid; a string also shows it as the message, replacing the hint. */
|
|
8
|
+
error?: string | boolean;
|
|
9
|
+
/** Appends the `optional` translation to the label. */
|
|
10
|
+
optional?: boolean;
|
|
11
|
+
/** Disables the control and its remove buttons. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Placeholder for the text field. */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Most tags allowed; unlimited when omitted. */
|
|
16
|
+
max?: number;
|
|
17
|
+
/** Form field name: submits one hidden input per tag. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** Id for the text field; generated with `useId()` when omitted. */
|
|
20
|
+
id?: string;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_ModelProps = {
|
|
23
|
+
/** The tags. */
|
|
24
|
+
modelValue?: string[];
|
|
25
|
+
};
|
|
26
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
28
|
+
focus: () => void | undefined;
|
|
29
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: string[] | undefined) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string[] | undefined) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { _default as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createBlock, defineComponent, openBlock, renderSlot, resolveDynamicComponent, withCtx } from "vue";
|
|
2
|
+
//#region src/components/visually-hidden/VisuallyHidden.vue
|
|
3
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
4
|
+
__name: "VisuallyHidden",
|
|
5
|
+
props: { as: { default: "span" } },
|
|
6
|
+
setup(__props) {
|
|
7
|
+
return (_ctx, _cache) => {
|
|
8
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as), { "data-part": "visually-hidden" }, {
|
|
9
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
10
|
+
_: 3
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/components/visually-hidden/VisuallyHidden.vue.d.ts
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Element to render, e.g. "div". */
|
|
4
|
+
as?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
/** The text to keep for assistive technology. */
|
|
8
|
+
default?(): unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { _default as default };
|
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,9 @@
|
|
|
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.
|
|
43
50
|
- [Toolbar](./components/toolbar.md): A row of controls with a single tab stop.
|
|
44
51
|
- [Tooltip](./components/tooltip.md): A short label shown on hover and focus.
|
|
52
|
+
- [Visually Hidden](./components/visually-hidden.md): Text for assistive technology only.
|
package/dist/docs/changelog.md
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
> What changed in each release.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 0.2.0 (2026-11-01)
|
|
6
6
|
|
|
7
|
+
- Bump version to 0.2.0 in package.json
|
|
8
|
+
|
|
9
|
+
## 0.1.1 (2026-11-01)
|
|
10
|
+
|
|
11
|
+
- Add tests for new components and enhance existing ones (#1)
|
|
12
|
+
- Bump version to 0.1.1 in package.json
|
|
13
|
+
- Enhance SSR support for Segmented and Tabs components; add hydration tests
|
|
7
14
|
- ci: update branch name formatting and paths-filter version deps: bump bun package manager to version 1.4.4
|
|
8
15
|
- Style: update checkbox and radio control background and border variables
|
|
9
16
|
- 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.
|