cisse-vue-ui 0.5.22 → 0.5.23
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/{Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js → Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js} +13 -4
- package/dist/Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js.map +1 -0
- package/dist/{Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs → Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs} +13 -4
- package/dist/Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs.map +1 -0
- package/dist/{Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs → Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs} +233 -101
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs.map +1 -0
- package/dist/{Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js → Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js} +234 -102
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js.map +1 -0
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs} +76 -29
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs.map +1 -0
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js} +77 -30
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js.map +1 -0
- package/dist/{DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs → DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs} +76 -44
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs.map +1 -0
- package/dist/{DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js → DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js} +76 -44
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs → Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js → Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js.map +1 -0
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs.map → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs.map} +1 -1
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js.map → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js.map} +1 -1
- package/dist/components/core/AccordionItem.vue.d.ts +2 -0
- package/dist/components/core/Dropdown.vue.d.ts +2 -0
- package/dist/components/core/Popover.vue.d.ts +2 -0
- package/dist/components/core/Tooltip.vue.d.ts +2 -0
- package/dist/components/core/index.cjs +3 -3
- package/dist/components/core/index.js +3 -3
- package/dist/components/core/index.test.d.ts +1 -0
- package/dist/components/feedback/LoadingSpinner.vue.d.ts +6 -1
- package/dist/components/feedback/Modal.vue.d.ts +8 -2
- package/dist/components/feedback/index.cjs +2 -2
- package/dist/components/feedback/index.js +2 -2
- package/dist/components/feedback/index.test.d.ts +1 -0
- package/dist/components/form/Checkbox.vue.d.ts +2 -0
- package/dist/components/form/DatePicker.vue.d.ts +2 -0
- package/dist/components/form/FormHelp.vue.d.ts +2 -0
- package/dist/components/form/Switch.vue.d.ts +2 -0
- package/dist/components/form/index.cjs +2 -2
- package/dist/components/form/index.js +2 -2
- package/dist/components/form/index.test.d.ts +1 -0
- package/dist/components/index.cjs +7 -7
- package/dist/components/index.js +7 -7
- package/dist/components/index.test.d.ts +1 -0
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/index.test.d.ts +1 -0
- package/dist/components/type/index.test.d.ts +1 -0
- package/dist/composables/index.cjs +6 -0
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +6 -0
- package/dist/composables/index.js.map +1 -1
- package/dist/composables/index.test.d.ts +1 -0
- package/dist/composables/useDarkMode.test.d.ts +1 -0
- package/dist/composables/useDropdown.test.d.ts +1 -0
- package/dist/composables/useExportCSV.test.d.ts +1 -0
- package/dist/composables/useFocusTrap.d.ts +41 -0
- package/dist/composables/useFocusTrap.test.d.ts +1 -0
- package/dist/composables/useId.d.ts +42 -0
- package/dist/composables/useId.test.d.ts +1 -0
- package/dist/composables/useModal.d.ts +1 -1
- package/dist/composables/useModal.test.d.ts +1 -0
- package/dist/{index-DZYqrXV0.js → index-BMoLBt6A.js} +8 -8
- package/dist/index-BMoLBt6A.js.map +1 -0
- package/dist/{index-Dghdw1yo.js → index-CJwlO351.js} +18 -9
- package/dist/index-CJwlO351.js.map +1 -0
- package/dist/{index-D7HVSFi2.cjs → index-CUNU12xk.cjs} +17 -8
- package/dist/index-CUNU12xk.cjs.map +1 -0
- package/dist/{index-DjEv91o4.cjs → index-DwFvFW-3.cjs} +8 -8
- package/dist/index-DwFvFW-3.cjs.map +1 -0
- package/dist/index.cjs +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +1 -0
- package/dist/types/form.d.ts +4 -0
- package/dist/types/index.test.d.ts +1 -0
- package/dist/useFocusTrap-AnlJsihM.js +120 -0
- package/dist/useFocusTrap-AnlJsihM.js.map +1 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs +119 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs.map +1 -0
- package/dist/useId-nxrBaIC9.cjs +25 -0
- package/dist/useId-nxrBaIC9.cjs.map +1 -0
- package/dist/useId-xeHj7rkg.js +26 -0
- package/dist/useId-xeHj7rkg.js.map +1 -0
- package/dist/useToast-Bk60GArg.cjs.map +1 -1
- package/dist/useToast-ina5g3mj.js.map +1 -1
- package/package.json +9 -8
- package/dist/Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js.map +0 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs.map +0 -1
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js.map +0 -1
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs.map +0 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js.map +0 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs.map +0 -1
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js.map +0 -1
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs.map +0 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js.map +0 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs.map +0 -1
- package/dist/index-D7HVSFi2.cjs.map +0 -1
- package/dist/index-DZYqrXV0.js.map +0 -1
- package/dist/index-Dghdw1yo.js.map +0 -1
- package/dist/index-DjEv91o4.cjs.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic,
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic, computed, ref, watch, createElementVNode, createBlock, unref, normalizeClass, createVNode, Teleport, Transition, withCtx, createCommentVNode, normalizeStyle, vModelText, Fragment, renderList, nextTick, withModifiers, withKeys } from "vue";
|
|
2
|
+
import { u as useId } from "./useId-xeHj7rkg.js";
|
|
2
3
|
import { Icon } from "@iconify/vue";
|
|
3
4
|
import { u as useDropdown } from "./useDropdown-iVu14E6s.js";
|
|
4
5
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
5
|
-
import { o as onClickOutside } from "./index-
|
|
6
|
+
import { o as onClickOutside } from "./index-CJwlO351.js";
|
|
6
7
|
const _hoisted_1$d = ["data-error", "for"];
|
|
7
8
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
8
9
|
__name: "FormLabel",
|
|
@@ -22,17 +23,21 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
|
-
const _hoisted_1$c = ["data-error"];
|
|
26
|
+
const _hoisted_1$c = ["id", "data-error", "role", "aria-live"];
|
|
26
27
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
27
28
|
__name: "FormHelp",
|
|
28
29
|
props: {
|
|
30
|
+
id: {},
|
|
29
31
|
error: { type: Boolean },
|
|
30
32
|
text: {}
|
|
31
33
|
},
|
|
32
34
|
setup(__props) {
|
|
33
35
|
return (_ctx, _cache) => {
|
|
34
36
|
return openBlock(), createElementBlock("p", {
|
|
37
|
+
id: __props.id,
|
|
35
38
|
"data-error": __props.error,
|
|
39
|
+
role: __props.error ? "alert" : void 0,
|
|
40
|
+
"aria-live": __props.error ? "polite" : void 0,
|
|
36
41
|
class: "mt-2 text-sm text-gray-400 peer-user-invalid:visible data-[error=true]:text-red-500 dark:text-gray-500"
|
|
37
42
|
}, [
|
|
38
43
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -42,7 +47,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
42
47
|
};
|
|
43
48
|
}
|
|
44
49
|
});
|
|
45
|
-
const _hoisted_1$b = ["id", "disabled", "name", "placeholder", "type"];
|
|
50
|
+
const _hoisted_1$b = ["id", "disabled", "name", "placeholder", "type", "required", "aria-invalid", "aria-required", "aria-describedby"];
|
|
46
51
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
47
52
|
__name: "FormInput",
|
|
48
53
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -52,22 +57,29 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
52
57
|
disabled: { type: Boolean },
|
|
53
58
|
invalid: { type: Boolean },
|
|
54
59
|
id: {},
|
|
55
|
-
name: {}
|
|
60
|
+
name: {},
|
|
61
|
+
required: { type: Boolean },
|
|
62
|
+
describedBy: {}
|
|
56
63
|
}, {
|
|
57
64
|
"modelValue": {},
|
|
58
65
|
"modelModifiers": {}
|
|
59
66
|
}),
|
|
60
67
|
emits: ["update:modelValue"],
|
|
61
68
|
setup(__props) {
|
|
69
|
+
const props = __props;
|
|
62
70
|
const modelValue = useModel(__props, "modelValue");
|
|
63
71
|
return (_ctx, _cache) => {
|
|
64
72
|
return withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
65
|
-
id:
|
|
73
|
+
id: props.id ?? props.name ?? "",
|
|
66
74
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
67
|
-
disabled:
|
|
68
|
-
name:
|
|
69
|
-
placeholder:
|
|
70
|
-
type:
|
|
75
|
+
disabled: props.disabled,
|
|
76
|
+
name: props.name ?? "",
|
|
77
|
+
placeholder: props.placeholder,
|
|
78
|
+
type: props.type,
|
|
79
|
+
required: props.required,
|
|
80
|
+
"aria-invalid": props.invalid || void 0,
|
|
81
|
+
"aria-required": props.required || void 0,
|
|
82
|
+
"aria-describedby": props.describedBy || void 0,
|
|
71
83
|
class: "mt-1 block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-gray-400 shadow-sm user-invalid:border-red-500 user-invalid:text-red-600 focus:border-primary focus:ring-1 focus:ring-primary focus:outline-none focus:user-invalid:border-red-500 focus:user-invalid:ring-red-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:placeholder-gray-500 dark:focus:border-primary dark:focus:ring-primary dark:disabled:border-gray-800 dark:disabled:bg-gray-950 dark:disabled:text-gray-500"
|
|
72
84
|
}, _ctx.$attrs), null, 16, _hoisted_1$b)), [
|
|
73
85
|
[vModelDynamic, modelValue.value]
|
|
@@ -76,24 +88,27 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
76
88
|
}
|
|
77
89
|
});
|
|
78
90
|
const _hoisted_1$a = { class: "relative" };
|
|
79
|
-
const _hoisted_2$9 = ["id", "disabled"];
|
|
91
|
+
const _hoisted_2$9 = ["id", "disabled", "aria-expanded", "aria-controls", "aria-invalid", "aria-describedby"];
|
|
80
92
|
const _hoisted_3$8 = { class: "flex-1 truncate" };
|
|
81
|
-
const _hoisted_4$6 =
|
|
93
|
+
const _hoisted_4$6 = ["id", "aria-label"];
|
|
94
|
+
const _hoisted_5$5 = {
|
|
82
95
|
key: 0,
|
|
83
96
|
class: "sticky top-0 border-b border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-gray-800"
|
|
84
97
|
};
|
|
85
|
-
const
|
|
86
|
-
const
|
|
98
|
+
const _hoisted_6$5 = { class: "flex items-center gap-2 rounded-md border border-gray-300 bg-gray-50 px-2 py-1.5 dark:border-gray-600 dark:bg-gray-900" };
|
|
99
|
+
const _hoisted_7$5 = {
|
|
87
100
|
key: 1,
|
|
88
|
-
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400"
|
|
101
|
+
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400",
|
|
102
|
+
role: "status"
|
|
89
103
|
};
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
104
|
+
const _hoisted_8$4 = { class: "py-1" };
|
|
105
|
+
const _hoisted_9$2 = ["aria-selected", "data-index", "onClick", "onMouseenter"];
|
|
106
|
+
const _hoisted_10$2 = {
|
|
93
107
|
key: 1,
|
|
94
|
-
class: "size-4 shrink-0"
|
|
108
|
+
class: "size-4 shrink-0",
|
|
109
|
+
"aria-hidden": "true"
|
|
95
110
|
};
|
|
96
|
-
const
|
|
111
|
+
const _hoisted_11$2 = { class: "flex-1" };
|
|
97
112
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
98
113
|
__name: "FormSelect",
|
|
99
114
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -105,6 +120,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
105
120
|
invalid: { type: Boolean },
|
|
106
121
|
id: {},
|
|
107
122
|
name: {},
|
|
123
|
+
required: { type: Boolean },
|
|
124
|
+
describedBy: {},
|
|
108
125
|
teleport: { type: Boolean, default: true },
|
|
109
126
|
searchable: { type: Boolean, default: false },
|
|
110
127
|
noResultsText: { default: "No results found" },
|
|
@@ -116,6 +133,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
116
133
|
emits: ["update:modelValue"],
|
|
117
134
|
setup(__props) {
|
|
118
135
|
const props = __props;
|
|
136
|
+
const { id: generatedId, related } = useId({ prefix: "select", id: props.id });
|
|
137
|
+
const triggerId = computed(() => props.id ?? props.name ?? generatedId.value);
|
|
138
|
+
const listboxId = computed(() => related("listbox"));
|
|
119
139
|
const modelValue = useModel(__props, "modelValue");
|
|
120
140
|
const searchQuery = ref("");
|
|
121
141
|
const triggerRef = ref();
|
|
@@ -209,12 +229,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
209
229
|
return (_ctx, _cache) => {
|
|
210
230
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
211
231
|
createElementVNode("button", {
|
|
212
|
-
id:
|
|
232
|
+
id: triggerId.value,
|
|
213
233
|
ref_key: "triggerRef",
|
|
214
234
|
ref: triggerRef,
|
|
215
235
|
type: "button",
|
|
216
236
|
disabled: __props.disabled,
|
|
217
237
|
class: normalizeClass(triggerClasses.value),
|
|
238
|
+
"aria-haspopup": "listbox",
|
|
239
|
+
"aria-expanded": unref(isOpen),
|
|
240
|
+
"aria-controls": listboxId.value,
|
|
241
|
+
"aria-invalid": __props.invalid || void 0,
|
|
242
|
+
"aria-describedby": __props.describedBy || void 0,
|
|
218
243
|
onClick: toggle,
|
|
219
244
|
onKeydown: handleKeydown
|
|
220
245
|
}, [
|
|
@@ -226,7 +251,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
226
251
|
]),
|
|
227
252
|
createVNode(unref(Icon), {
|
|
228
253
|
icon: "lucide:chevron-down",
|
|
229
|
-
class: normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", unref(isOpen) && "rotate-180"])
|
|
254
|
+
class: normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", unref(isOpen) && "rotate-180"]),
|
|
255
|
+
"aria-hidden": "true"
|
|
230
256
|
}, null, 8, ["class"])
|
|
231
257
|
], 42, _hoisted_2$9),
|
|
232
258
|
(openBlock(), createBlock(Teleport, {
|
|
@@ -244,19 +270,23 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
244
270
|
default: withCtx(() => [
|
|
245
271
|
unref(isOpen) ? (openBlock(), createElementBlock("div", {
|
|
246
272
|
key: 0,
|
|
273
|
+
id: listboxId.value,
|
|
247
274
|
ref_key: "dropdownRef",
|
|
248
275
|
ref: dropdownRef,
|
|
276
|
+
role: "listbox",
|
|
277
|
+
"aria-label": __props.placeholder || "Select an option",
|
|
249
278
|
style: normalizeStyle(unref(dropdownStyle)),
|
|
250
279
|
class: normalizeClass([
|
|
251
280
|
"z-[9999] max-h-60 overflow-auto rounded-lg border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",
|
|
252
281
|
!__props.teleport && "absolute mt-1 w-full"
|
|
253
282
|
])
|
|
254
283
|
}, [
|
|
255
|
-
__props.searchable ? (openBlock(), createElementBlock("div",
|
|
256
|
-
createElementVNode("div",
|
|
284
|
+
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
|
|
285
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
257
286
|
createVNode(unref(Icon), {
|
|
258
287
|
icon: "lucide:search",
|
|
259
|
-
class: "size-4 text-gray-400"
|
|
288
|
+
class: "size-4 text-gray-400",
|
|
289
|
+
"aria-hidden": "true"
|
|
260
290
|
}),
|
|
261
291
|
withDirectives(createElementVNode("input", {
|
|
262
292
|
ref_key: "searchInputRef",
|
|
@@ -265,18 +295,21 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
265
295
|
type: "text",
|
|
266
296
|
class: "flex-1 bg-transparent text-sm outline-none dark:text-white",
|
|
267
297
|
placeholder: "Search...",
|
|
298
|
+
"aria-label": "Search options",
|
|
268
299
|
onKeydown: handleKeydown
|
|
269
300
|
}, null, 544), [
|
|
270
301
|
[vModelText, searchQuery.value]
|
|
271
302
|
])
|
|
272
303
|
])
|
|
273
304
|
])) : createCommentVNode("", true),
|
|
274
|
-
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div",
|
|
275
|
-
createElementVNode("div",
|
|
305
|
+
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$5, toDisplayString(__props.noResultsText), 1)) : createCommentVNode("", true),
|
|
306
|
+
createElementVNode("div", _hoisted_8$4, [
|
|
276
307
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
|
|
277
308
|
return openBlock(), createElementBlock("button", {
|
|
278
309
|
key: String(option.value),
|
|
279
310
|
type: "button",
|
|
311
|
+
role: "option",
|
|
312
|
+
"aria-selected": modelValue.value === option.value,
|
|
280
313
|
"data-index": index,
|
|
281
314
|
class: normalizeClass([
|
|
282
315
|
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
@@ -295,14 +328,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
295
328
|
modelValue.value === option.value ? (openBlock(), createBlock(unref(Icon), {
|
|
296
329
|
key: 0,
|
|
297
330
|
icon: "lucide:check",
|
|
298
|
-
class: "size-4 shrink-0 text-primary"
|
|
299
|
-
|
|
300
|
-
|
|
331
|
+
class: "size-4 shrink-0 text-primary",
|
|
332
|
+
"aria-hidden": "true"
|
|
333
|
+
})) : (openBlock(), createElementBlock("span", _hoisted_10$2)),
|
|
334
|
+
createElementVNode("span", _hoisted_11$2, toDisplayString(option.label), 1)
|
|
301
335
|
])
|
|
302
|
-
], 42,
|
|
336
|
+
], 42, _hoisted_9$2);
|
|
303
337
|
}), 128))
|
|
304
338
|
])
|
|
305
|
-
], 6)) : createCommentVNode("", true)
|
|
339
|
+
], 14, _hoisted_4$6)) : createCommentVNode("", true)
|
|
306
340
|
]),
|
|
307
341
|
_: 3
|
|
308
342
|
})
|
|
@@ -327,6 +361,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
327
361
|
invalid: { type: Boolean },
|
|
328
362
|
id: {},
|
|
329
363
|
name: {},
|
|
364
|
+
required: { type: Boolean },
|
|
365
|
+
describedBy: {},
|
|
330
366
|
options: {}
|
|
331
367
|
}, {
|
|
332
368
|
"modelValue": {},
|
|
@@ -336,8 +372,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
336
372
|
setup(__props) {
|
|
337
373
|
const props = __props;
|
|
338
374
|
const modelValue = useModel(__props, "modelValue");
|
|
375
|
+
const { id: generatedId, related } = useId({ prefix: "field", id: props.id });
|
|
376
|
+
const inputId = computed(() => props.id ?? props.name ?? generatedId.value);
|
|
377
|
+
const helpId = computed(() => related("help"));
|
|
339
378
|
const computedCols = computed(() => `span ${props.cols} / span ${props.cols}`);
|
|
340
379
|
const isSelect = computed(() => props.select === true);
|
|
380
|
+
const hasError = computed(() => props.error && typeof props.error === "string");
|
|
341
381
|
return (_ctx, _cache) => {
|
|
342
382
|
return openBlock(), createElementBlock("div", {
|
|
343
383
|
style: normalizeStyle({ gridColumn: computedCols.value }),
|
|
@@ -347,7 +387,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
347
387
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
348
388
|
__props.label ? (openBlock(), createBlock(_sfc_main$d, {
|
|
349
389
|
key: 0,
|
|
350
|
-
"html-for":
|
|
390
|
+
"html-for": inputId.value,
|
|
351
391
|
error: __props.error
|
|
352
392
|
}, {
|
|
353
393
|
default: withCtx(() => [
|
|
@@ -361,21 +401,30 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
361
401
|
key: 0,
|
|
362
402
|
modelValue: modelValue.value,
|
|
363
403
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
364
|
-
}, { ..._ctx.$attrs, ..._ctx.$props }
|
|
404
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }, {
|
|
405
|
+
id: inputId.value,
|
|
406
|
+
invalid: Boolean(__props.error),
|
|
407
|
+
"described-by": hasError.value ? helpId.value : void 0
|
|
408
|
+
}), null, 16, ["modelValue", "id", "invalid", "described-by"])) : (openBlock(), createBlock(_sfc_main$b, mergeProps({
|
|
365
409
|
key: 1,
|
|
366
410
|
modelValue: modelValue.value,
|
|
367
411
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
368
|
-
}, { ..._ctx.$attrs, ..._ctx.$props }
|
|
412
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }, {
|
|
413
|
+
id: inputId.value,
|
|
414
|
+
invalid: Boolean(__props.error),
|
|
415
|
+
"described-by": hasError.value ? helpId.value : void 0
|
|
416
|
+
}), null, 16, ["modelValue", "id", "invalid", "described-by"]))
|
|
369
417
|
]),
|
|
370
|
-
|
|
418
|
+
hasError.value ? (openBlock(), createBlock(_sfc_main$c, {
|
|
371
419
|
key: 0,
|
|
420
|
+
id: helpId.value,
|
|
372
421
|
error: true
|
|
373
422
|
}, {
|
|
374
423
|
default: withCtx(() => [
|
|
375
424
|
createTextVNode(toDisplayString(__props.error), 1)
|
|
376
425
|
]),
|
|
377
426
|
_: 1
|
|
378
|
-
})) : createCommentVNode("", true)
|
|
427
|
+
}, 8, ["id"])) : createCommentVNode("", true)
|
|
379
428
|
])
|
|
380
429
|
], 12, _hoisted_1$9);
|
|
381
430
|
};
|
|
@@ -416,19 +465,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
416
465
|
};
|
|
417
466
|
}
|
|
418
467
|
});
|
|
419
|
-
const _hoisted_1$7 = ["aria-checked", "disabled"];
|
|
468
|
+
const _hoisted_1$7 = ["id", "aria-checked", "aria-labelledby", "aria-describedby", "disabled"];
|
|
420
469
|
const _hoisted_2$7 = {
|
|
421
470
|
key: 0,
|
|
422
471
|
class: "flex flex-col"
|
|
423
472
|
};
|
|
424
|
-
const _hoisted_3$7 =
|
|
425
|
-
|
|
426
|
-
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
427
|
-
};
|
|
428
|
-
const _hoisted_4$5 = {
|
|
429
|
-
key: 1,
|
|
430
|
-
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
431
|
-
};
|
|
473
|
+
const _hoisted_3$7 = ["id"];
|
|
474
|
+
const _hoisted_4$5 = ["id"];
|
|
432
475
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
433
476
|
__name: "Switch",
|
|
434
477
|
props: {
|
|
@@ -436,12 +479,17 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
436
479
|
label: {},
|
|
437
480
|
description: {},
|
|
438
481
|
disabled: { type: Boolean },
|
|
439
|
-
size: { default: "md" }
|
|
482
|
+
size: { default: "md" },
|
|
483
|
+
id: {}
|
|
440
484
|
},
|
|
441
485
|
emits: ["update:modelValue"],
|
|
442
486
|
setup(__props, { emit: __emit }) {
|
|
443
487
|
const props = __props;
|
|
444
488
|
const emit = __emit;
|
|
489
|
+
const { id: generatedId, related } = useId({ prefix: "switch", id: props.id });
|
|
490
|
+
const switchId = computed(() => props.id ?? generatedId.value);
|
|
491
|
+
const labelId = computed(() => related("label"));
|
|
492
|
+
const descriptionId = computed(() => related("description"));
|
|
445
493
|
const toggle = () => {
|
|
446
494
|
if (props.disabled) return;
|
|
447
495
|
emit("update:modelValue", !props.modelValue);
|
|
@@ -466,9 +514,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
466
514
|
class: normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
467
515
|
}, [
|
|
468
516
|
createElementVNode("button", {
|
|
517
|
+
id: switchId.value,
|
|
469
518
|
type: "button",
|
|
470
519
|
role: "switch",
|
|
471
520
|
"aria-checked": __props.modelValue,
|
|
521
|
+
"aria-labelledby": __props.label ? labelId.value : void 0,
|
|
522
|
+
"aria-describedby": __props.description ? descriptionId.value : void 0,
|
|
472
523
|
disabled: __props.disabled,
|
|
473
524
|
class: normalizeClass([
|
|
474
525
|
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
@@ -482,12 +533,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
482
533
|
"inline-block transform rounded-full bg-white shadow-sm transition-transform",
|
|
483
534
|
dotSizes[__props.size],
|
|
484
535
|
__props.modelValue ? translateSizes[__props.size] : "translate-x-1"
|
|
485
|
-
])
|
|
536
|
+
]),
|
|
537
|
+
"aria-hidden": "true"
|
|
486
538
|
}, null, 2)
|
|
487
539
|
], 10, _hoisted_1$7),
|
|
488
540
|
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
489
|
-
__props.label ? (openBlock(), createElementBlock("span",
|
|
490
|
-
|
|
541
|
+
__props.label ? (openBlock(), createElementBlock("span", {
|
|
542
|
+
key: 0,
|
|
543
|
+
id: labelId.value,
|
|
544
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
545
|
+
}, toDisplayString(__props.label), 9, _hoisted_3$7)) : createCommentVNode("", true),
|
|
546
|
+
__props.description ? (openBlock(), createElementBlock("span", {
|
|
547
|
+
key: 1,
|
|
548
|
+
id: descriptionId.value,
|
|
549
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
550
|
+
}, toDisplayString(__props.description), 9, _hoisted_4$5)) : createCommentVNode("", true)
|
|
491
551
|
])) : createCommentVNode("", true)
|
|
492
552
|
], 2);
|
|
493
553
|
};
|
|
@@ -502,7 +562,7 @@ const _hoisted_3$6 = { class: "text-gray-600 dark:text-gray-400" };
|
|
|
502
562
|
const _hoisted_4$4 = { class: "font-medium text-gray-900 dark:text-white" };
|
|
503
563
|
const _hoisted_5$4 = { class: "text-gray-600 dark:text-gray-400" };
|
|
504
564
|
const _hoisted_6$4 = { class: "relative" };
|
|
505
|
-
const _hoisted_7$
|
|
565
|
+
const _hoisted_7$4 = ["value", "min", "max", "step", "disabled"];
|
|
506
566
|
const _hoisted_8$3 = { class: "pointer-events-none absolute inset-y-0 left-0 flex items-center" };
|
|
507
567
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
508
568
|
__name: "Slider",
|
|
@@ -551,7 +611,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
551
611
|
disabled: __props.disabled,
|
|
552
612
|
class: "slider-input w-full cursor-pointer appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
553
613
|
onInput: handleInput
|
|
554
|
-
}, null, 40, _hoisted_7$
|
|
614
|
+
}, null, 40, _hoisted_7$4),
|
|
555
615
|
createElementVNode("div", _hoisted_8$3, [
|
|
556
616
|
createElementVNode("div", {
|
|
557
617
|
class: "h-2 rounded-full bg-primary",
|
|
@@ -565,15 +625,24 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
565
625
|
});
|
|
566
626
|
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a411f1b4"]]);
|
|
567
627
|
const _hoisted_1$5 = { class: "relative" };
|
|
568
|
-
const _hoisted_2$5 = ["disabled"];
|
|
628
|
+
const _hoisted_2$5 = ["id", "disabled", "aria-expanded", "aria-controls"];
|
|
569
629
|
const _hoisted_3$5 = { class: "flex-1 truncate" };
|
|
570
630
|
const _hoisted_4$3 = { class: "flex items-center gap-1" };
|
|
571
|
-
const _hoisted_5$3 =
|
|
572
|
-
const _hoisted_6$3 = { class: "
|
|
573
|
-
const _hoisted_7$
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
631
|
+
const _hoisted_5$3 = ["id", "aria-label"];
|
|
632
|
+
const _hoisted_6$3 = { class: "mb-4 flex items-center justify-between" };
|
|
633
|
+
const _hoisted_7$3 = {
|
|
634
|
+
class: "font-medium text-gray-900 dark:text-white",
|
|
635
|
+
"aria-live": "polite",
|
|
636
|
+
"aria-atomic": "true"
|
|
637
|
+
};
|
|
638
|
+
const _hoisted_8$2 = {
|
|
639
|
+
class: "mb-2 grid grid-cols-7 gap-1",
|
|
640
|
+
role: "row"
|
|
641
|
+
};
|
|
642
|
+
const _hoisted_9$1 = ["abbr"];
|
|
643
|
+
const _hoisted_10$1 = ["id", "aria-label"];
|
|
644
|
+
const _hoisted_11$1 = ["aria-label", "aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
645
|
+
const _hoisted_12 = { class: "mt-4 border-t border-gray-200 pt-3 dark:border-gray-700" };
|
|
577
646
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
578
647
|
__name: "DatePicker",
|
|
579
648
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -583,7 +652,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
583
652
|
disabled: { type: Boolean, default: false },
|
|
584
653
|
minDate: {},
|
|
585
654
|
maxDate: {},
|
|
586
|
-
teleport: { type: Boolean, default: true }
|
|
655
|
+
teleport: { type: Boolean, default: true },
|
|
656
|
+
id: {}
|
|
587
657
|
}, {
|
|
588
658
|
"modelValue": { default: null },
|
|
589
659
|
"modelModifiers": {}
|
|
@@ -591,6 +661,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
591
661
|
emits: ["update:modelValue"],
|
|
592
662
|
setup(__props) {
|
|
593
663
|
const props = __props;
|
|
664
|
+
const { related } = useId({ prefix: "datepicker", id: props.id });
|
|
665
|
+
const triggerId = computed(() => related("trigger"));
|
|
666
|
+
const calendarId = computed(() => related("calendar"));
|
|
667
|
+
const gridId = computed(() => related("grid"));
|
|
594
668
|
const modelValue = useModel(__props, "modelValue");
|
|
595
669
|
const triggerRef = ref();
|
|
596
670
|
const calendarRef = ref();
|
|
@@ -683,13 +757,26 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
683
757
|
const clear = () => {
|
|
684
758
|
modelValue.value = null;
|
|
685
759
|
};
|
|
760
|
+
const getDateLabel = (date) => {
|
|
761
|
+
const formatter = new Intl.DateTimeFormat(props.locale, {
|
|
762
|
+
weekday: "long",
|
|
763
|
+
year: "numeric",
|
|
764
|
+
month: "long",
|
|
765
|
+
day: "numeric"
|
|
766
|
+
});
|
|
767
|
+
return formatter.format(date);
|
|
768
|
+
};
|
|
686
769
|
return (_ctx, _cache) => {
|
|
687
770
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
688
771
|
createElementVNode("button", {
|
|
772
|
+
id: triggerId.value,
|
|
689
773
|
ref_key: "triggerRef",
|
|
690
774
|
ref: triggerRef,
|
|
691
775
|
type: "button",
|
|
692
776
|
disabled: __props.disabled,
|
|
777
|
+
"aria-expanded": unref(isOpen),
|
|
778
|
+
"aria-haspopup": "dialog",
|
|
779
|
+
"aria-controls": calendarId.value,
|
|
693
780
|
class: normalizeClass([
|
|
694
781
|
"flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm text-left transition",
|
|
695
782
|
__props.disabled ? "cursor-not-allowed border-gray-200 bg-gray-50 text-gray-500 dark:border-gray-800 dark:bg-gray-950" : unref(isOpen) ? "border-primary ring-2 ring-primary/20 bg-white dark:bg-gray-900" : "border-gray-300 bg-white hover:border-gray-400 dark:border-gray-700 dark:bg-gray-900",
|
|
@@ -704,16 +791,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
704
791
|
key: 0,
|
|
705
792
|
type: "button",
|
|
706
793
|
class: "rounded p-0.5 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
794
|
+
"aria-label": "Clear date",
|
|
707
795
|
onClick: withModifiers(clear, ["stop"])
|
|
708
796
|
}, [
|
|
709
797
|
createVNode(unref(Icon), {
|
|
710
798
|
icon: "lucide:x",
|
|
711
|
-
class: "size-4 text-gray-400"
|
|
799
|
+
class: "size-4 text-gray-400",
|
|
800
|
+
"aria-hidden": "true"
|
|
712
801
|
})
|
|
713
802
|
])) : createCommentVNode("", true),
|
|
714
803
|
createVNode(unref(Icon), {
|
|
715
804
|
icon: "lucide:calendar",
|
|
716
|
-
class: "size-4 text-gray-400"
|
|
805
|
+
class: "size-4 text-gray-400",
|
|
806
|
+
"aria-hidden": "true"
|
|
717
807
|
})
|
|
718
808
|
])
|
|
719
809
|
], 10, _hoisted_2$5),
|
|
@@ -732,47 +822,66 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
732
822
|
default: withCtx(() => [
|
|
733
823
|
unref(isOpen) ? (openBlock(), createElementBlock("div", {
|
|
734
824
|
key: 0,
|
|
825
|
+
id: calendarId.value,
|
|
735
826
|
ref_key: "calendarRef",
|
|
736
827
|
ref: calendarRef,
|
|
828
|
+
role: "dialog",
|
|
829
|
+
"aria-modal": "true",
|
|
830
|
+
"aria-label": `Choose date, ${monthYear.value}`,
|
|
737
831
|
style: normalizeStyle(unref(dropdownStyle)),
|
|
738
832
|
class: "z-[9999] w-72 rounded-lg border border-gray-200 bg-white p-4 shadow-lg dark:border-gray-700 dark:bg-gray-800"
|
|
739
833
|
}, [
|
|
740
|
-
createElementVNode("div",
|
|
834
|
+
createElementVNode("div", _hoisted_6$3, [
|
|
741
835
|
createElementVNode("button", {
|
|
742
836
|
type: "button",
|
|
743
837
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
838
|
+
"aria-label": "Previous month",
|
|
744
839
|
onClick: prevMonth
|
|
745
840
|
}, [
|
|
746
841
|
createVNode(unref(Icon), {
|
|
747
842
|
icon: "lucide:chevron-left",
|
|
748
|
-
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
843
|
+
class: "size-5 text-gray-600 dark:text-gray-400",
|
|
844
|
+
"aria-hidden": "true"
|
|
749
845
|
})
|
|
750
846
|
]),
|
|
751
|
-
createElementVNode("span",
|
|
847
|
+
createElementVNode("span", _hoisted_7$3, toDisplayString(monthYear.value), 1),
|
|
752
848
|
createElementVNode("button", {
|
|
753
849
|
type: "button",
|
|
754
850
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
851
|
+
"aria-label": "Next month",
|
|
755
852
|
onClick: nextMonth
|
|
756
853
|
}, [
|
|
757
854
|
createVNode(unref(Icon), {
|
|
758
855
|
icon: "lucide:chevron-right",
|
|
759
|
-
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
856
|
+
class: "size-5 text-gray-600 dark:text-gray-400",
|
|
857
|
+
"aria-hidden": "true"
|
|
760
858
|
})
|
|
761
859
|
])
|
|
762
860
|
]),
|
|
763
|
-
createElementVNode("div",
|
|
861
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
764
862
|
(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
|
|
765
863
|
return openBlock(), createElementBlock("div", {
|
|
766
864
|
key: day,
|
|
767
|
-
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
768
|
-
|
|
865
|
+
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
866
|
+
role: "columnheader",
|
|
867
|
+
abbr: day
|
|
868
|
+
}, toDisplayString(day), 9, _hoisted_9$1);
|
|
769
869
|
}), 128))
|
|
770
870
|
]),
|
|
771
|
-
createElementVNode("div",
|
|
871
|
+
createElementVNode("div", {
|
|
872
|
+
id: gridId.value,
|
|
873
|
+
class: "grid grid-cols-7 gap-1",
|
|
874
|
+
role: "grid",
|
|
875
|
+
"aria-label": monthYear.value
|
|
876
|
+
}, [
|
|
772
877
|
(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day, index) => {
|
|
773
878
|
return openBlock(), createElementBlock("button", {
|
|
774
879
|
key: index,
|
|
775
880
|
type: "button",
|
|
881
|
+
role: "gridcell",
|
|
882
|
+
"aria-label": getDateLabel(day.date),
|
|
883
|
+
"aria-selected": day.isSelected,
|
|
884
|
+
"aria-disabled": day.isDisabled || void 0,
|
|
776
885
|
disabled: day.isDisabled,
|
|
777
886
|
class: normalizeClass([
|
|
778
887
|
"h-8 w-8 rounded text-sm transition",
|
|
@@ -783,17 +892,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
783
892
|
day.isSelected && "bg-primary text-white font-semibold"
|
|
784
893
|
]),
|
|
785
894
|
onClick: ($event) => selectDate(day)
|
|
786
|
-
}, toDisplayString(day.date.getDate()), 11,
|
|
895
|
+
}, toDisplayString(day.date.getDate()), 11, _hoisted_11$1);
|
|
787
896
|
}), 128))
|
|
788
|
-
]),
|
|
789
|
-
createElementVNode("div",
|
|
897
|
+
], 8, _hoisted_10$1),
|
|
898
|
+
createElementVNode("div", _hoisted_12, [
|
|
790
899
|
createElementVNode("button", {
|
|
791
900
|
type: "button",
|
|
792
901
|
class: "w-full rounded py-1.5 text-sm font-medium text-primary hover:bg-primary/10",
|
|
793
902
|
onClick: _cache[1] || (_cache[1] = ($event) => selectDate({ date: /* @__PURE__ */ new Date(), isDisabled: false }))
|
|
794
903
|
}, " Today ")
|
|
795
904
|
])
|
|
796
|
-
],
|
|
905
|
+
], 12, _hoisted_5$3)) : createCommentVNode("", true)
|
|
797
906
|
]),
|
|
798
907
|
_: 1
|
|
799
908
|
})
|
|
@@ -814,7 +923,7 @@ const _hoisted_6$2 = {
|
|
|
814
923
|
key: 1,
|
|
815
924
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
816
925
|
};
|
|
817
|
-
const _hoisted_7$
|
|
926
|
+
const _hoisted_7$2 = {
|
|
818
927
|
key: 0,
|
|
819
928
|
class: "space-y-2"
|
|
820
929
|
};
|
|
@@ -978,7 +1087,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
978
1087
|
__props.maxSize ? (openBlock(), createElementBlock("p", _hoisted_6$2, " Max size: " + toDisplayString(formatSize(__props.maxSize)), 1)) : createCommentVNode("", true)
|
|
979
1088
|
])
|
|
980
1089
|
], 34),
|
|
981
|
-
files.value.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_7$
|
|
1090
|
+
files.value.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_7$2, [
|
|
982
1091
|
(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (uploadedFile) => {
|
|
983
1092
|
return openBlock(), createElementBlock("li", {
|
|
984
1093
|
key: uploadedFile.id,
|
|
@@ -1127,7 +1236,7 @@ const _hoisted_3$2 = ["disabled"];
|
|
|
1127
1236
|
const _hoisted_4$1 = { class: "text-sm font-mono text-gray-700 dark:text-gray-300" };
|
|
1128
1237
|
const _hoisted_5$1 = { class: "grid grid-cols-5 gap-2 mb-3" };
|
|
1129
1238
|
const _hoisted_6$1 = ["title", "onClick"];
|
|
1130
|
-
const _hoisted_7 = {
|
|
1239
|
+
const _hoisted_7$1 = {
|
|
1131
1240
|
key: 0,
|
|
1132
1241
|
class: "flex items-center gap-2 pt-3 border-t border-gray-200 dark:border-gray-700"
|
|
1133
1242
|
};
|
|
@@ -1260,7 +1369,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1260
1369
|
], 14, _hoisted_6$1);
|
|
1261
1370
|
}), 128))
|
|
1262
1371
|
]),
|
|
1263
|
-
__props.showInput ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
1372
|
+
__props.showInput ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
|
|
1264
1373
|
createElementVNode("input", {
|
|
1265
1374
|
type: "color",
|
|
1266
1375
|
value: __props.modelValue,
|
|
@@ -1421,17 +1530,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1421
1530
|
};
|
|
1422
1531
|
}
|
|
1423
1532
|
});
|
|
1424
|
-
const _hoisted_1 = ["
|
|
1425
|
-
const _hoisted_2 =
|
|
1426
|
-
const _hoisted_3 = {
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
};
|
|
1430
|
-
const
|
|
1431
|
-
const _hoisted_5 = { class: "flex-1" };
|
|
1432
|
-
const _hoisted_6 = {
|
|
1533
|
+
const _hoisted_1 = ["aria-expanded", "aria-controls"];
|
|
1534
|
+
const _hoisted_2 = ["id", "name", "placeholder", "disabled", "aria-controls"];
|
|
1535
|
+
const _hoisted_3 = { class: "flex items-center gap-1" };
|
|
1536
|
+
const _hoisted_4 = ["id", "aria-label", "aria-multiselectable"];
|
|
1537
|
+
const _hoisted_5 = ["aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
1538
|
+
const _hoisted_6 = { class: "flex-1" };
|
|
1539
|
+
const _hoisted_7 = {
|
|
1433
1540
|
key: 1,
|
|
1434
|
-
class: "px-3 py-2 text-center text-sm text-gray-500 dark:text-gray-400"
|
|
1541
|
+
class: "px-3 py-2 text-center text-sm text-gray-500 dark:text-gray-400",
|
|
1542
|
+
role: "status"
|
|
1435
1543
|
};
|
|
1436
1544
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1437
1545
|
__name: "Combobox",
|
|
@@ -1451,6 +1559,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1451
1559
|
emits: ["update:modelValue"],
|
|
1452
1560
|
setup(__props, { emit: __emit }) {
|
|
1453
1561
|
const props = __props;
|
|
1562
|
+
const { id: generatedId, related } = useId({ prefix: "combobox", id: props.id });
|
|
1563
|
+
const inputId = computed(() => props.id ?? generatedId.value);
|
|
1564
|
+
const listboxId = computed(() => related("listbox"));
|
|
1454
1565
|
const teleportDisabled = computed(() => props.teleport === false);
|
|
1455
1566
|
const teleportTarget = computed(() => props.teleport === false ? "body" : props.teleport);
|
|
1456
1567
|
const emit = __emit;
|
|
@@ -1529,6 +1640,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1529
1640
|
class: "relative"
|
|
1530
1641
|
}, [
|
|
1531
1642
|
createElementVNode("div", {
|
|
1643
|
+
role: "combobox",
|
|
1644
|
+
"aria-expanded": isOpen.value,
|
|
1645
|
+
"aria-haspopup": "listbox",
|
|
1646
|
+
"aria-controls": listboxId.value,
|
|
1532
1647
|
class: normalizeClass([
|
|
1533
1648
|
"flex min-h-[42px] w-full cursor-pointer items-center rounded-lg border bg-white px-3 py-2 transition-colors",
|
|
1534
1649
|
"dark:bg-gray-900",
|
|
@@ -1544,7 +1659,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1544
1659
|
])
|
|
1545
1660
|
}, toDisplayString(displayValue.value || __props.placeholder), 3)) : withDirectives((openBlock(), createElementBlock("input", {
|
|
1546
1661
|
key: 1,
|
|
1547
|
-
id:
|
|
1662
|
+
id: inputId.value,
|
|
1548
1663
|
ref_key: "inputRef",
|
|
1549
1664
|
ref: inputRef,
|
|
1550
1665
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
@@ -1552,22 +1667,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1552
1667
|
name: __props.name,
|
|
1553
1668
|
placeholder: __props.searchPlaceholder,
|
|
1554
1669
|
disabled: __props.disabled,
|
|
1670
|
+
"aria-autocomplete": "list",
|
|
1671
|
+
"aria-controls": listboxId.value,
|
|
1555
1672
|
class: "flex-1 border-none bg-transparent text-sm text-gray-900 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
1556
1673
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
1557
1674
|
}, ["stop"]))
|
|
1558
|
-
}, null, 8,
|
|
1675
|
+
}, null, 8, _hoisted_2)), [
|
|
1559
1676
|
[vModelText, search.value]
|
|
1560
1677
|
]),
|
|
1561
|
-
createElementVNode("div",
|
|
1678
|
+
createElementVNode("div", _hoisted_3, [
|
|
1562
1679
|
__props.clearable && selectedOptions.value.length > 0 && !__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
1563
1680
|
key: 0,
|
|
1564
1681
|
type: "button",
|
|
1565
1682
|
class: "rounded p-0.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
|
|
1683
|
+
"aria-label": "Clear selection",
|
|
1566
1684
|
onClick: withModifiers(clear, ["stop"])
|
|
1567
1685
|
}, [
|
|
1568
1686
|
createVNode(unref(Icon), {
|
|
1569
1687
|
icon: "lucide:x",
|
|
1570
|
-
class: "h-4 w-4"
|
|
1688
|
+
class: "h-4 w-4",
|
|
1689
|
+
"aria-hidden": "true"
|
|
1571
1690
|
})
|
|
1572
1691
|
])) : createCommentVNode("", true),
|
|
1573
1692
|
createVNode(unref(Icon), {
|
|
@@ -1575,10 +1694,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1575
1694
|
class: normalizeClass([
|
|
1576
1695
|
"h-4 w-4 text-gray-400 transition-transform",
|
|
1577
1696
|
isOpen.value && "rotate-180"
|
|
1578
|
-
])
|
|
1697
|
+
]),
|
|
1698
|
+
"aria-hidden": "true"
|
|
1579
1699
|
}, null, 8, ["class"])
|
|
1580
1700
|
])
|
|
1581
|
-
],
|
|
1701
|
+
], 10, _hoisted_1),
|
|
1582
1702
|
(openBlock(), createBlock(Teleport, {
|
|
1583
1703
|
to: teleportTarget.value,
|
|
1584
1704
|
disabled: teleportDisabled.value
|
|
@@ -1592,11 +1712,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1592
1712
|
"leave-to-class": "transform scale-95 opacity-0"
|
|
1593
1713
|
}, {
|
|
1594
1714
|
default: withCtx(() => [
|
|
1595
|
-
isOpen.value ? (openBlock(), createElementBlock("div",
|
|
1715
|
+
isOpen.value ? (openBlock(), createElementBlock("div", {
|
|
1716
|
+
key: 0,
|
|
1717
|
+
id: listboxId.value,
|
|
1718
|
+
role: "listbox",
|
|
1719
|
+
"aria-label": __props.placeholder,
|
|
1720
|
+
"aria-multiselectable": __props.multiple || void 0,
|
|
1721
|
+
class: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900"
|
|
1722
|
+
}, [
|
|
1596
1723
|
filteredOptions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(filteredOptions.value, (option) => {
|
|
1597
1724
|
return openBlock(), createElementBlock("button", {
|
|
1598
1725
|
key: option.value,
|
|
1599
1726
|
type: "button",
|
|
1727
|
+
role: "option",
|
|
1728
|
+
"aria-selected": isSelected(option),
|
|
1729
|
+
"aria-disabled": option.disabled || void 0,
|
|
1600
1730
|
disabled: option.disabled,
|
|
1601
1731
|
class: normalizeClass([
|
|
1602
1732
|
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
@@ -1609,7 +1739,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1609
1739
|
class: normalizeClass([
|
|
1610
1740
|
"flex h-4 w-4 items-center justify-center rounded border",
|
|
1611
1741
|
isSelected(option) ? "border-primary bg-primary text-white" : "border-gray-300 dark:border-gray-600"
|
|
1612
|
-
])
|
|
1742
|
+
]),
|
|
1743
|
+
"aria-hidden": "true"
|
|
1613
1744
|
}, [
|
|
1614
1745
|
isSelected(option) ? (openBlock(), createBlock(unref(Icon), {
|
|
1615
1746
|
key: 0,
|
|
@@ -1617,15 +1748,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1617
1748
|
class: "h-3 w-3"
|
|
1618
1749
|
})) : createCommentVNode("", true)
|
|
1619
1750
|
], 2)) : createCommentVNode("", true),
|
|
1620
|
-
createElementVNode("span",
|
|
1751
|
+
createElementVNode("span", _hoisted_6, toDisplayString(option.label), 1),
|
|
1621
1752
|
!__props.multiple && isSelected(option) ? (openBlock(), createBlock(unref(Icon), {
|
|
1622
1753
|
key: 1,
|
|
1623
1754
|
icon: "lucide:check",
|
|
1624
|
-
class: "h-4 w-4 text-primary"
|
|
1755
|
+
class: "h-4 w-4 text-primary",
|
|
1756
|
+
"aria-hidden": "true"
|
|
1625
1757
|
})) : createCommentVNode("", true)
|
|
1626
|
-
], 10,
|
|
1627
|
-
}), 128)) : (openBlock(), createElementBlock("div",
|
|
1628
|
-
])) : createCommentVNode("", true)
|
|
1758
|
+
], 10, _hoisted_5);
|
|
1759
|
+
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(__props.noResultsText), 1))
|
|
1760
|
+
], 8, _hoisted_4)) : createCommentVNode("", true)
|
|
1629
1761
|
]),
|
|
1630
1762
|
_: 1
|
|
1631
1763
|
})
|
|
@@ -1650,4 +1782,4 @@ export {
|
|
|
1650
1782
|
_sfc_main$1 as k,
|
|
1651
1783
|
_sfc_main as l
|
|
1652
1784
|
};
|
|
1653
|
-
//# sourceMappingURL=Combobox.vue_vue_type_script_setup_true_lang-
|
|
1785
|
+
//# sourceMappingURL=Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js.map
|