iryx-ui 0.18.1 → 0.18.3
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/AppShell.vue.d.ts +1 -1
- package/dist/components/Checkbox.vue.d.ts +3 -0
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +59 -42
- package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/FormField.vue_vue_type_script_setup_true_lang.js +50 -47
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/PinInput.vue.d.ts +1 -0
- package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +40 -32
- package/dist/components/RadioGroup.vue.d.ts +3 -0
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +49 -31
- package/dist/components/Select.vue.d.ts +5 -0
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +67 -44
- package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +58 -53
- package/dist/components/Switch.vue.d.ts +3 -0
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +50 -33
- package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/composables/form.d.ts +8 -1
- package/dist/index.js +9 -9
- package/dist/theme/accordion.d.ts +2 -2
- package/dist/theme/alert.d.ts +2 -2
- package/dist/theme/app-shell.d.ts +2 -2
- package/dist/theme/auth-providers.d.ts +2 -2
- package/dist/theme/avatar.d.ts +4 -4
- package/dist/theme/badge.d.ts +2 -2
- package/dist/theme/banner.d.ts +2 -2
- package/dist/theme/bar-chart.d.ts +2 -2
- package/dist/theme/breadcrumb.d.ts +2 -2
- package/dist/theme/button-group.d.ts +11 -11
- package/dist/theme/button.d.ts +38 -38
- package/dist/theme/calendar.d.ts +2 -2
- package/dist/theme/card.d.ts +2 -2
- package/dist/theme/chart-legend.d.ts +2 -2
- package/dist/theme/checkbox.d.ts +17 -2
- package/dist/theme/checkbox.js +2 -1
- package/dist/theme/collapsible.d.ts +2 -2
- package/dist/theme/color-picker.d.ts +2 -2
- package/dist/theme/combobox.d.ts +2 -2
- package/dist/theme/command-palette.d.ts +2 -2
- package/dist/theme/container.d.ts +2 -2
- package/dist/theme/date-field.d.ts +2 -2
- package/dist/theme/date-picker.d.ts +2 -2
- package/dist/theme/dialog.d.ts +2 -2
- package/dist/theme/donut-chart.d.ts +2 -2
- package/dist/theme/drawer.d.ts +2 -2
- package/dist/theme/dropdown-menu.d.ts +2 -2
- package/dist/theme/editable.d.ts +2 -2
- package/dist/theme/empty-state.d.ts +2 -2
- package/dist/theme/file-upload.d.ts +2 -2
- package/dist/theme/form.d.ts +2 -2
- package/dist/theme/hover-card.d.ts +2 -2
- package/dist/theme/input.d.ts +19 -19
- package/dist/theme/kbd.d.ts +2 -2
- package/dist/theme/label.d.ts +5 -5
- package/dist/theme/line-chart.d.ts +2 -2
- package/dist/theme/menubar.d.ts +2 -2
- package/dist/theme/navigation-menu.d.ts +2 -2
- package/dist/theme/number-input.d.ts +2 -2
- package/dist/theme/page-header.d.ts +2 -2
- package/dist/theme/pagination.d.ts +2 -2
- package/dist/theme/password-input.d.ts +2 -2
- package/dist/theme/pin-input.d.ts +2 -2
- package/dist/theme/popover.d.ts +2 -2
- package/dist/theme/progress.d.ts +2 -2
- package/dist/theme/radio-group.d.ts +17 -2
- package/dist/theme/radio-group.js +2 -1
- package/dist/theme/scroll-area.d.ts +2 -2
- package/dist/theme/scroll-fade.d.ts +2 -2
- package/dist/theme/select.d.ts +17 -2
- package/dist/theme/select.js +9 -6
- package/dist/theme/separator.d.ts +2 -2
- package/dist/theme/sidebar.d.ts +2 -2
- package/dist/theme/signature-pad.d.ts +2 -2
- package/dist/theme/skeleton.d.ts +11 -11
- package/dist/theme/slider.d.ts +2 -2
- package/dist/theme/sparkline.d.ts +2 -2
- package/dist/theme/splitter.d.ts +2 -2
- package/dist/theme/stat.d.ts +2 -2
- package/dist/theme/stepper.d.ts +2 -2
- package/dist/theme/switch.d.ts +17 -2
- package/dist/theme/switch.js +2 -1
- package/dist/theme/table.d.ts +2 -2
- package/dist/theme/tabs.d.ts +2 -2
- package/dist/theme/tags-input.d.ts +2 -2
- package/dist/theme/time-field.d.ts +2 -2
- package/dist/theme/timeline.d.ts +2 -2
- package/dist/theme/toast.d.ts +2 -2
- package/dist/theme/toggle.d.ts +28 -28
- package/dist/theme/toolbar.d.ts +2 -2
- package/dist/theme/tooltip.d.ts +2 -2
- package/dist/theme/tree.d.ts +2 -2
- package/package.json +3 -3
|
@@ -60,8 +60,8 @@ declare const __VLS_base: import("vue").DefineComponent<AppShellProps, {
|
|
|
60
60
|
unstyled: boolean;
|
|
61
61
|
as: string;
|
|
62
62
|
scroll: "main" | "page";
|
|
63
|
-
sidebarPosition: "left" | "right";
|
|
64
63
|
mobileNav: boolean;
|
|
64
|
+
sidebarPosition: "left" | "right";
|
|
65
65
|
navLabel: string;
|
|
66
66
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
67
67
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -7,6 +7,8 @@ export interface CheckboxProps extends CheckboxRootProps {
|
|
|
7
7
|
description?: string;
|
|
8
8
|
size?: 'sm' | 'md' | 'lg';
|
|
9
9
|
id?: string;
|
|
10
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
11
|
+
invalid?: boolean;
|
|
10
12
|
/** Skip built-in classes; you take over styling entirely. */
|
|
11
13
|
unstyled?: boolean;
|
|
12
14
|
class?: ClassValue;
|
|
@@ -36,6 +38,7 @@ declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {}, {}, {
|
|
|
36
38
|
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
37
39
|
}>, {
|
|
38
40
|
unstyled: boolean;
|
|
41
|
+
invalid: boolean;
|
|
39
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
44
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { checkboxTheme as r } from "../theme/checkbox.js";
|
|
5
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
6
|
+
import { MinusSignIcon as y, Tick02Icon as b } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { CheckboxIndicator as x, CheckboxRoot as S, Label as C, useForwardPropsEmits as w, useId as T } from "reka-ui";
|
|
7
8
|
//#region src/components/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var E = ["id"], D = /*@__PURE__*/ d({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "Checkbox",
|
|
11
12
|
props: {
|
|
@@ -13,6 +14,10 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
13
14
|
description: {},
|
|
14
15
|
size: {},
|
|
15
16
|
id: {},
|
|
17
|
+
invalid: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
16
21
|
unstyled: {
|
|
17
22
|
type: Boolean,
|
|
18
23
|
default: void 0
|
|
@@ -36,69 +41,81 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
36
41
|
required: { type: Boolean }
|
|
37
42
|
},
|
|
38
43
|
emits: ["update:modelValue"],
|
|
39
|
-
setup(
|
|
40
|
-
let
|
|
41
|
-
let { label: e, description: t, size: n, id: r,
|
|
42
|
-
return
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
setup(d, { emit: D }) {
|
|
45
|
+
let O = d, k = D, A = w(i(() => {
|
|
46
|
+
let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = O;
|
|
47
|
+
return c;
|
|
48
|
+
}), k), j = T(), M = n(), N = i(() => O.invalid ?? M?.invalid.value ?? !1), P = i(() => O.id ?? M?.id.value ?? j);
|
|
49
|
+
M && (M.id.value = P.value);
|
|
50
|
+
let F = i(() => !!(O.label || O.description)), I = e(), L = i(() => O.unstyled ?? I.unstyled), R = i(() => r({
|
|
51
|
+
size: O.size,
|
|
52
|
+
withText: F.value,
|
|
53
|
+
invalid: N.value
|
|
54
|
+
})), z = i(() => L.value ? O.ui?.wrapper : R.value.wrapper({ class: O.ui?.wrapper })), B = i(() => L.value ? [O.ui?.root, O.class] : R.value.root({ class: [O.ui?.root, O.class] })), V = i(() => L.value ? O.ui?.indicator : R.value.indicator({ class: O.ui?.indicator })), H = i(() => L.value ? O.ui?.content : R.value.content({ class: O.ui?.content })), U = i(() => L.value ? O.ui?.label : R.value.label({ class: O.ui?.label })), W = i(() => L.value ? O.ui?.description : R.value.description({ class: O.ui?.description }));
|
|
55
|
+
return (e, n) => F.value ? (m(), s("div", {
|
|
48
56
|
key: 0,
|
|
49
|
-
class:
|
|
50
|
-
}, [
|
|
51
|
-
...
|
|
57
|
+
class: p(z.value)
|
|
58
|
+
}, [u(_(S), f({ id: P.value }, {
|
|
59
|
+
..._(A),
|
|
52
60
|
...e.$attrs
|
|
53
61
|
}, {
|
|
54
|
-
"aria-
|
|
55
|
-
|
|
62
|
+
"aria-invalid": N.value || void 0,
|
|
63
|
+
"aria-describedby": O.description ? `${P.value}-description` : void 0,
|
|
64
|
+
class: B.value
|
|
56
65
|
}), {
|
|
57
|
-
default:
|
|
58
|
-
default:
|
|
66
|
+
default: v(() => [u(_(x), { class: p(V.value) }, {
|
|
67
|
+
default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
|
|
59
68
|
key: 0,
|
|
60
|
-
icon:
|
|
61
|
-
}, null, 8, ["icon"])) : (
|
|
69
|
+
icon: _(y)
|
|
70
|
+
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
62
71
|
key: 1,
|
|
63
|
-
icon:
|
|
72
|
+
icon: _(b)
|
|
64
73
|
}, null, 8, ["icon"]))])]),
|
|
65
74
|
_: 3
|
|
66
75
|
}, 8, ["class"])]),
|
|
67
76
|
_: 3
|
|
68
77
|
}, 16, [
|
|
69
78
|
"id",
|
|
79
|
+
"aria-invalid",
|
|
70
80
|
"aria-describedby",
|
|
71
81
|
"class"
|
|
72
|
-
]),
|
|
73
|
-
for:
|
|
74
|
-
class:
|
|
82
|
+
]), c("div", { class: p(H.value) }, [u(_(C), {
|
|
83
|
+
for: P.value,
|
|
84
|
+
class: p(U.value)
|
|
75
85
|
}, {
|
|
76
|
-
default:
|
|
86
|
+
default: v(() => [h(e.$slots, "label", {}, () => [l(g(O.label), 1)])]),
|
|
77
87
|
_: 3
|
|
78
|
-
}, 8, ["for", "class"]),
|
|
88
|
+
}, 8, ["for", "class"]), O.description || e.$slots.description ? (m(), s("p", {
|
|
79
89
|
key: 0,
|
|
80
|
-
id: `${
|
|
81
|
-
class:
|
|
82
|
-
}, [
|
|
90
|
+
id: `${P.value}-description`,
|
|
91
|
+
class: p(W.value)
|
|
92
|
+
}, [h(e.$slots, "description", {}, () => [l(g(O.description), 1)])], 10, E)) : o("", !0)], 2)], 2)) : (m(), a(_(S), f({
|
|
83
93
|
key: 1,
|
|
84
|
-
id:
|
|
94
|
+
id: P.value
|
|
85
95
|
}, {
|
|
86
|
-
...
|
|
96
|
+
..._(A),
|
|
87
97
|
...e.$attrs
|
|
88
|
-
}, {
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
}, {
|
|
99
|
+
"aria-invalid": N.value || void 0,
|
|
100
|
+
class: B.value
|
|
101
|
+
}), {
|
|
102
|
+
default: v(() => [u(_(x), { class: p(V.value) }, {
|
|
103
|
+
default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
|
|
91
104
|
key: 0,
|
|
92
|
-
icon:
|
|
93
|
-
}, null, 8, ["icon"])) : (
|
|
105
|
+
icon: _(y)
|
|
106
|
+
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
94
107
|
key: 1,
|
|
95
|
-
icon:
|
|
108
|
+
icon: _(b)
|
|
96
109
|
}, null, 8, ["icon"]))])]),
|
|
97
110
|
_: 3
|
|
98
111
|
}, 8, ["class"])]),
|
|
99
112
|
_: 3
|
|
100
|
-
}, 16, [
|
|
113
|
+
}, 16, [
|
|
114
|
+
"id",
|
|
115
|
+
"aria-invalid",
|
|
116
|
+
"class"
|
|
117
|
+
]));
|
|
101
118
|
}
|
|
102
119
|
});
|
|
103
120
|
//#endregion
|
|
104
|
-
export {
|
|
121
|
+
export { D as default };
|
|
@@ -79,7 +79,8 @@ var B = /*@__PURE__*/ h({
|
|
|
79
79
|
default: O(() => [m(T(ne), null, {
|
|
80
80
|
default: O(() => [m(T(te), { class: _($("overlay")) }, null, 8, ["class"]), m(T(ee), {
|
|
81
81
|
class: _(Z.value ? [B.ui?.content, B.class] : Q.value.content({ class: [B.ui?.content, B.class] })),
|
|
82
|
-
"aria-label": B.label
|
|
82
|
+
"aria-label": B.label,
|
|
83
|
+
"aria-describedby": void 0
|
|
83
84
|
}, {
|
|
84
85
|
default: O(() => [
|
|
85
86
|
m(T(R), null, {
|
|
@@ -2,10 +2,10 @@ import { useIryxUiConfig as e } from "../config.js";
|
|
|
2
2
|
import { formFieldContextKey as t, getByPath as n, useForm as r } from "../composables/form.js";
|
|
3
3
|
import { formFieldTheme as i } from "../theme/form.js";
|
|
4
4
|
import a from "./Label.js";
|
|
5
|
-
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m,
|
|
6
|
-
import { useId as
|
|
5
|
+
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
|
|
6
|
+
import { useId as x } from "reka-ui";
|
|
7
7
|
//#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var S = ["data-iryx-field"], C = ["id"], w = ["id"], T = ["id"], E = /*@__PURE__*/ d({
|
|
9
9
|
__name: "FormField",
|
|
10
10
|
props: {
|
|
11
11
|
name: {},
|
|
@@ -28,73 +28,76 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
28
28
|
ui: {}
|
|
29
29
|
},
|
|
30
30
|
setup(d) {
|
|
31
|
-
let
|
|
31
|
+
let E = d, D = r(), O = x(), k = h(O), A = o(() => E.error ?? D?.errorFor(E.name)), j = o(() => {
|
|
32
32
|
let e = [];
|
|
33
|
-
return
|
|
33
|
+
return E.description && e.push(`${O}-description`), A.value ? e.push(`${O}-error`) : E.help && e.push(`${O}-help`), e.length ? e.join(" ") : void 0;
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
if (!
|
|
37
|
-
let e =
|
|
38
|
-
(e.includes("change") || e.includes("input")) &&
|
|
35
|
+
y(() => E.name && D ? n(D.state.value, E.name) : void 0, () => {
|
|
36
|
+
if (!E.name || !D) return;
|
|
37
|
+
let e = D.validateOn.value;
|
|
38
|
+
(e.includes("change") || e.includes("input")) && D.validateField(E.name);
|
|
39
39
|
});
|
|
40
|
-
function
|
|
41
|
-
!
|
|
40
|
+
function M() {
|
|
41
|
+
!E.name || !D || D.validateOn.value.includes("blur") && D.validateField(E.name);
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
return
|
|
43
|
+
let N = e(), P = o(() => E.unstyled ?? N.unstyled), F = i();
|
|
44
|
+
function I(e, t) {
|
|
45
|
+
return P.value ? t : F[e]({ class: t });
|
|
46
46
|
}
|
|
47
47
|
return m(t, {
|
|
48
|
-
id:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
id: k,
|
|
49
|
+
labelId: o(() => E.label ? `${O}-label` : void 0),
|
|
50
|
+
name: o(() => E.name),
|
|
51
|
+
invalid: o(() => !!A.value),
|
|
52
|
+
describedBy: j
|
|
52
53
|
}), (e, t) => (p(), l("div", {
|
|
53
|
-
"data-iryx-field":
|
|
54
|
-
class: f(
|
|
55
|
-
onFocusout:
|
|
54
|
+
"data-iryx-field": E.name,
|
|
55
|
+
class: f(P.value ? E.class : v(F).root({ class: [E.ui?.root, E.class] })),
|
|
56
|
+
onFocusout: M
|
|
56
57
|
}, [
|
|
57
|
-
|
|
58
|
+
E.label || E.hint || e.$slots.hint ? (p(), l("div", {
|
|
58
59
|
key: 0,
|
|
59
|
-
class: f(
|
|
60
|
-
}, [
|
|
60
|
+
class: f(I("header", E.ui?.header))
|
|
61
|
+
}, [E.label ? (p(), s(a, {
|
|
61
62
|
key: 0,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
id: `${v(O)}-label`,
|
|
64
|
+
for: k.value,
|
|
65
|
+
required: E.required,
|
|
66
|
+
class: f(E.ui?.label)
|
|
65
67
|
}, {
|
|
66
|
-
default:
|
|
68
|
+
default: b(() => [u(_(E.label), 1)]),
|
|
67
69
|
_: 1
|
|
68
70
|
}, 8, [
|
|
71
|
+
"id",
|
|
69
72
|
"for",
|
|
70
73
|
"required",
|
|
71
74
|
"class"
|
|
72
|
-
])) : c("", !0),
|
|
75
|
+
])) : c("", !0), E.hint || e.$slots.hint ? (p(), l("span", {
|
|
73
76
|
key: 1,
|
|
74
|
-
class: f(
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
+
class: f(I("hint", E.ui?.hint))
|
|
78
|
+
}, [g(e.$slots, "hint", {}, () => [u(_(E.hint), 1)])], 2)) : c("", !0)], 2)) : c("", !0),
|
|
79
|
+
E.description ? (p(), l("p", {
|
|
77
80
|
key: 1,
|
|
78
|
-
id: `${
|
|
79
|
-
class: f(
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
id:
|
|
83
|
-
error:
|
|
81
|
+
id: `${v(O)}-description`,
|
|
82
|
+
class: f(I("description", E.ui?.description))
|
|
83
|
+
}, _(E.description), 11, C)) : c("", !0),
|
|
84
|
+
g(e.$slots, "default", {
|
|
85
|
+
id: v(O),
|
|
86
|
+
error: A.value
|
|
84
87
|
}),
|
|
85
|
-
|
|
88
|
+
A.value ? (p(), l("p", {
|
|
86
89
|
key: 2,
|
|
87
|
-
id: `${
|
|
90
|
+
id: `${v(O)}-error`,
|
|
88
91
|
role: "alert",
|
|
89
92
|
"aria-live": "polite",
|
|
90
|
-
class: f(
|
|
91
|
-
},
|
|
93
|
+
class: f(I("error", E.ui?.error))
|
|
94
|
+
}, _(A.value), 11, w)) : E.help ? (p(), l("p", {
|
|
92
95
|
key: 3,
|
|
93
|
-
id: `${
|
|
94
|
-
class: f(
|
|
95
|
-
},
|
|
96
|
-
], 42,
|
|
96
|
+
id: `${v(O)}-help`,
|
|
97
|
+
class: f(I("help", E.ui?.help))
|
|
98
|
+
}, _(E.help), 11, T)) : c("", !0)
|
|
99
|
+
], 42, S));
|
|
97
100
|
}
|
|
98
101
|
});
|
|
99
102
|
//#endregion
|
|
100
|
-
export {
|
|
103
|
+
export { E as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { inputTheme as r } from "../theme/input.js";
|
|
5
5
|
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, normalizeClass as p, onBeforeUnmount as m, openBlock as h, ref as g, renderSlot as _, unref as v, useModel as y, useSlots as b, watch as x, withKeys as S } from "vue";
|
|
6
6
|
import { Cancel01Icon as C, Loading03Icon as w } from "@hugeicons/core-free-icons";
|
|
7
7
|
//#region src/components/Input.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -55,7 +55,7 @@ var T = [
|
|
|
55
55
|
"url",
|
|
56
56
|
"tel",
|
|
57
57
|
"password"
|
|
58
|
-
].includes(D.type) ? !1 : void 0), k = y(u, "modelValue"), A = b(), j =
|
|
58
|
+
].includes(D.type) ? !1 : void 0), k = y(u, "modelValue"), A = b(), j = n(), M = i(() => D.id ?? j?.id.value), N = i(() => D.invalid ?? j?.invalid.value ?? !1), P = e(), F = i(() => D.unstyled ?? P.unstyled), I = g(k.value), L;
|
|
59
59
|
function R() {
|
|
60
60
|
L !== void 0 && (clearTimeout(L), L = void 0);
|
|
61
61
|
}
|
|
@@ -81,7 +81,7 @@ var T = [
|
|
|
81
81
|
R(), I.value = "", k.value = "", V.value?.focus();
|
|
82
82
|
}
|
|
83
83
|
d({ input: V });
|
|
84
|
-
let U = i(() => I.value !== "" && I.value != null), W = i(() => D.clearable && U.value && !D.disabled), G = i(() => D.loading || W.value || !!A.trailing), K = i(() =>
|
|
84
|
+
let U = i(() => I.value !== "" && I.value != null), W = i(() => D.clearable && U.value && !D.disabled), G = i(() => D.loading || W.value || !!A.trailing), K = i(() => r({
|
|
85
85
|
size: D.size,
|
|
86
86
|
invalid: N.value
|
|
87
87
|
}));
|
|
@@ -55,6 +55,7 @@ declare const __VLS_base: import("vue").DefineComponent<PinInputProps, {}, {}, {
|
|
|
55
55
|
length: number;
|
|
56
56
|
unstyled: boolean;
|
|
57
57
|
separator: string;
|
|
58
|
+
invalid: boolean;
|
|
58
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
60
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
61
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { pinInputTheme as n } from "../theme/pin-input.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
5
|
+
import { PinInputInput as v, PinInputRoot as y } from "reka-ui";
|
|
5
6
|
//#region src/components/PinInput.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var b = /*@__PURE__*/ u({
|
|
7
8
|
__name: "PinInput",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: {},
|
|
@@ -15,7 +16,10 @@ var y = /*@__PURE__*/ l({
|
|
|
15
16
|
groupSize: {},
|
|
16
17
|
separator: { default: "–" },
|
|
17
18
|
disabled: { type: Boolean },
|
|
18
|
-
invalid: {
|
|
19
|
+
invalid: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
19
23
|
size: {},
|
|
20
24
|
id: {},
|
|
21
25
|
unstyled: {
|
|
@@ -31,43 +35,47 @@ var y = /*@__PURE__*/ l({
|
|
|
31
35
|
ui: {}
|
|
32
36
|
},
|
|
33
37
|
emits: ["update:modelValue", "complete"],
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
36
|
-
let e =
|
|
37
|
-
return !e || e <= 0 ? /* @__PURE__ */ new Set() : new Set(
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
setup(u, { emit: b }) {
|
|
39
|
+
let x = u, S = b, C = i(() => (x.modelValue ?? "").split("")), w = (e) => e.join(""), T = i(() => Array.from({ length: x.length }, (e, t) => t)), E = i(() => {
|
|
40
|
+
let e = x.groupSize;
|
|
41
|
+
return !e || e <= 0 ? /* @__PURE__ */ new Set() : new Set(T.value.filter((t) => (t + 1) % e === 0 && t !== x.length - 1));
|
|
42
|
+
}), D = t(), O = i(() => x.id ?? D?.id.value);
|
|
43
|
+
D && x.id && (D.id.value = x.id);
|
|
44
|
+
let k = i(() => x.invalid ?? D?.invalid.value ?? !1), A = e(), j = i(() => x.unstyled ?? A.unstyled), M = i(() => n({
|
|
45
|
+
size: x.size,
|
|
46
|
+
invalid: k.value
|
|
47
|
+
})), N = i(() => j.value ? [x.ui?.root, x.class] : M.value.root({ class: [x.ui?.root, x.class] })), P = i(() => j.value ? x.ui?.input : M.value.input({ class: x.ui?.input })), F = i(() => j.value ? x.ui?.separator : M.value.separator({ class: x.ui?.separator }));
|
|
48
|
+
return (e, t) => (f(), a(g(y), {
|
|
49
|
+
"aria-describedby": g(D)?.describedBy.value,
|
|
50
|
+
"model-value": C.value,
|
|
51
|
+
type: x.type,
|
|
52
|
+
mask: x.mask,
|
|
53
|
+
otp: x.otp,
|
|
54
|
+
placeholder: x.placeholder,
|
|
55
|
+
disabled: x.disabled,
|
|
56
|
+
class: d(N.value),
|
|
57
|
+
"onUpdate:modelValue": t[0] ||= (e) => S("update:modelValue", w(e)),
|
|
58
|
+
onComplete: t[1] ||= (e) => S("complete", w(e))
|
|
53
59
|
}, {
|
|
54
|
-
default:
|
|
60
|
+
default: _(() => [(f(!0), s(r, null, p(T.value, (t) => (f(), s(r, { key: t }, [l(g(v), {
|
|
61
|
+
id: t === 0 ? O.value : void 0,
|
|
55
62
|
index: t,
|
|
56
63
|
spellcheck: "false",
|
|
57
|
-
"aria-invalid":
|
|
58
|
-
class:
|
|
64
|
+
"aria-invalid": k.value || void 0,
|
|
65
|
+
class: d(P.value)
|
|
59
66
|
}, null, 8, [
|
|
67
|
+
"id",
|
|
60
68
|
"index",
|
|
61
69
|
"aria-invalid",
|
|
62
70
|
"class"
|
|
63
|
-
]),
|
|
71
|
+
]), E.value.has(t) ? (f(), s("span", {
|
|
64
72
|
key: 0,
|
|
65
|
-
class:
|
|
73
|
+
class: d(F.value),
|
|
66
74
|
"aria-hidden": "true"
|
|
67
|
-
}, [
|
|
75
|
+
}, [m(e.$slots, "separator", {}, () => [c(h(x.separator), 1)])], 2)) : o("", !0)], 64))), 128))]),
|
|
68
76
|
_: 3
|
|
69
77
|
}, 8, [
|
|
70
|
-
"
|
|
78
|
+
"aria-describedby",
|
|
71
79
|
"model-value",
|
|
72
80
|
"type",
|
|
73
81
|
"mask",
|
|
@@ -79,4 +87,4 @@ var y = /*@__PURE__*/ l({
|
|
|
79
87
|
}
|
|
80
88
|
});
|
|
81
89
|
//#endregion
|
|
82
|
-
export {
|
|
90
|
+
export { b as default };
|
|
@@ -11,6 +11,8 @@ export interface RadioGroupProps extends RadioGroupRootProps {
|
|
|
11
11
|
/** Options to render. Strings are expanded to `{ label, value }`. */
|
|
12
12
|
items?: (RadioGroupItemOption | string)[];
|
|
13
13
|
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
15
|
+
invalid?: boolean;
|
|
14
16
|
/** Skip built-in classes; you take over styling entirely. */
|
|
15
17
|
unstyled?: boolean;
|
|
16
18
|
class?: ClassValue;
|
|
@@ -31,6 +33,7 @@ declare const __VLS_base: import("vue").DefineComponent<RadioGroupProps, {}, {},
|
|
|
31
33
|
"onUpdate:modelValue"?: ((payload: import("reka-ui").AcceptableValue) => any) | undefined;
|
|
32
34
|
}>, {
|
|
33
35
|
unstyled: boolean;
|
|
36
|
+
invalid: boolean;
|
|
34
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { radioGroupTheme as n } from "../theme/radio-group.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
5
|
+
import { Label as b, RadioGroupIndicator as x, RadioGroupItem as S, RadioGroupRoot as C, useForwardPropsEmits as w, useId as T } from "reka-ui";
|
|
5
6
|
//#region src/components/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var E = ["id"], D = /*@__PURE__*/ d({
|
|
7
8
|
__name: "RadioGroup",
|
|
8
9
|
props: {
|
|
9
10
|
items: {},
|
|
10
11
|
size: {},
|
|
12
|
+
invalid: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
11
16
|
unstyled: {
|
|
12
17
|
type: Boolean,
|
|
13
18
|
default: void 0
|
|
@@ -31,29 +36,37 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
31
36
|
required: { type: Boolean }
|
|
32
37
|
},
|
|
33
38
|
emits: ["update:modelValue"],
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
36
|
-
let { items: e, size: t,
|
|
37
|
-
return
|
|
38
|
-
}),
|
|
39
|
+
setup(d, { emit: D }) {
|
|
40
|
+
let O = d, k = D, A = w(i(() => {
|
|
41
|
+
let { items: e, size: t, invalid: n, unstyled: r, class: i, ui: a, ...o } = O;
|
|
42
|
+
return o;
|
|
43
|
+
}), k), j = i(() => (O.items ?? []).map((e) => typeof e == "string" ? {
|
|
39
44
|
label: e,
|
|
40
45
|
value: e
|
|
41
|
-
} : e)),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
} : e)), M = T(), N = t();
|
|
47
|
+
N && (N.id.value = void 0);
|
|
48
|
+
let P = i(() => O.invalid ?? N?.invalid.value ?? !1), F = e(), I = i(() => O.unstyled ?? F.unstyled), L = i(() => n({
|
|
49
|
+
size: O.size,
|
|
50
|
+
orientation: O.orientation ?? "vertical",
|
|
51
|
+
invalid: P.value
|
|
52
|
+
})), R = i(() => I.value ? [O.ui?.root, O.class] : L.value.root({ class: [O.ui?.root, O.class] })), z = i(() => I.value ? O.ui?.item : L.value.item({ class: O.ui?.item })), B = i(() => I.value ? O.ui?.label : L.value.label({ class: O.ui?.label })), V = i(() => I.value ? O.ui?.description : L.value.description({ class: O.ui?.description }));
|
|
53
|
+
return (e, t) => (m(), a(v(C), f(v(A), {
|
|
54
|
+
"aria-labelledby": v(N)?.labelId.value,
|
|
55
|
+
"aria-invalid": P.value || void 0,
|
|
56
|
+
"aria-describedby": v(N)?.describedBy.value,
|
|
57
|
+
class: R.value
|
|
58
|
+
}), {
|
|
59
|
+
default: y(() => [g(e.$slots, "default", {}, () => [(m(!0), s(r, null, h(j.value, (e) => (m(), s("div", {
|
|
47
60
|
key: e.value,
|
|
48
|
-
class:
|
|
49
|
-
}, [
|
|
50
|
-
id: `${
|
|
61
|
+
class: p(I.value ? void 0 : L.value.wrapper())
|
|
62
|
+
}, [u(v(S), {
|
|
63
|
+
id: `${v(M)}-${e.value}`,
|
|
51
64
|
value: e.value,
|
|
52
65
|
disabled: e.disabled,
|
|
53
|
-
"aria-describedby": e.description ? `${
|
|
54
|
-
class:
|
|
66
|
+
"aria-describedby": e.description ? `${v(M)}-${e.value}-description` : void 0,
|
|
67
|
+
class: p(z.value)
|
|
55
68
|
}, {
|
|
56
|
-
default:
|
|
69
|
+
default: y(() => [u(v(x), { class: p(I.value ? void 0 : L.value.indicator()) }, null, 8, ["class"])]),
|
|
57
70
|
_: 1
|
|
58
71
|
}, 8, [
|
|
59
72
|
"id",
|
|
@@ -61,20 +74,25 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
61
74
|
"disabled",
|
|
62
75
|
"aria-describedby",
|
|
63
76
|
"class"
|
|
64
|
-
]),
|
|
65
|
-
for: `${
|
|
66
|
-
class:
|
|
77
|
+
]), c("div", { class: p(I.value ? void 0 : L.value.content()) }, [u(v(b), {
|
|
78
|
+
for: `${v(M)}-${e.value}`,
|
|
79
|
+
class: p(B.value)
|
|
67
80
|
}, {
|
|
68
|
-
default:
|
|
81
|
+
default: y(() => [l(_(e.label), 1)]),
|
|
69
82
|
_: 2
|
|
70
|
-
}, 1032, ["for", "class"]), e.description ? (
|
|
83
|
+
}, 1032, ["for", "class"]), e.description ? (m(), s("p", {
|
|
71
84
|
key: 0,
|
|
72
|
-
id: `${
|
|
73
|
-
class:
|
|
74
|
-
},
|
|
85
|
+
id: `${v(M)}-${e.value}-description`,
|
|
86
|
+
class: p(V.value)
|
|
87
|
+
}, _(e.description), 11, E)) : o("", !0)], 2)], 2))), 128))])]),
|
|
75
88
|
_: 3
|
|
76
|
-
}, 16, [
|
|
89
|
+
}, 16, [
|
|
90
|
+
"aria-labelledby",
|
|
91
|
+
"aria-invalid",
|
|
92
|
+
"aria-describedby",
|
|
93
|
+
"class"
|
|
94
|
+
]));
|
|
77
95
|
}
|
|
78
96
|
});
|
|
79
97
|
//#endregion
|
|
80
|
-
export {
|
|
98
|
+
export { D as default };
|
|
@@ -19,6 +19,10 @@ export interface SelectProps extends SelectRootProps {
|
|
|
19
19
|
items?: SelectItems;
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
size?: 'sm' | 'md' | 'lg';
|
|
22
|
+
/** Lands on the trigger, so a `<label for>` names the control. */
|
|
23
|
+
id?: string;
|
|
24
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
25
|
+
invalid?: boolean;
|
|
22
26
|
/** Skip built-in classes; you take over styling entirely. */
|
|
23
27
|
unstyled?: boolean;
|
|
24
28
|
class?: ClassValue;
|
|
@@ -43,6 +47,7 @@ declare const __VLS_base: import("vue").DefineComponent<SelectProps, {}, {}, {},
|
|
|
43
47
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
44
48
|
}>, {
|
|
45
49
|
unstyled: boolean;
|
|
50
|
+
invalid: boolean;
|
|
46
51
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
52
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
48
53
|
declare const _default: typeof __VLS_export;
|