iryx-ui 0.18.2 → 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/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 +3 -0
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +65 -46
- 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/checkbox.d.ts +15 -0
- package/dist/theme/checkbox.js +2 -1
- package/dist/theme/radio-group.d.ts +15 -0
- package/dist/theme/radio-group.js +2 -1
- package/dist/theme/select.d.ts +15 -0
- package/dist/theme/select.js +8 -5
- package/dist/theme/switch.d.ts +15 -0
- package/dist/theme/switch.js +2 -1
- package/package.json +1 -1
|
@@ -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 { selectTheme as r } from "../theme/select.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
6
|
+
import { ArrowDown01Icon as S, Tick02Icon as C } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { SelectContent as w, SelectGroup as T, SelectIcon as E, SelectItem as D, SelectItemIndicator as O, SelectItemText as k, SelectLabel as A, SelectPortal as ee, SelectRoot as te, SelectTrigger as j, SelectValue as M, SelectViewport as N, useForwardPropsEmits as P } from "reka-ui";
|
|
7
8
|
//#region src/components/Select.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var F = /*@__PURE__*/ d({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "Select",
|
|
11
12
|
props: {
|
|
@@ -13,6 +14,10 @@ var I = /*@__PURE__*/ u({
|
|
|
13
14
|
placeholder: {},
|
|
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
|
|
@@ -38,67 +43,81 @@ var I = /*@__PURE__*/ u({
|
|
|
38
43
|
required: { type: Boolean }
|
|
39
44
|
},
|
|
40
45
|
emits: ["update:modelValue", "update:open"],
|
|
41
|
-
setup(
|
|
42
|
-
let
|
|
43
|
-
let { items: e, placeholder: t, size: n, id: r,
|
|
44
|
-
return
|
|
45
|
-
}),
|
|
46
|
-
function
|
|
46
|
+
setup(d, { emit: F }) {
|
|
47
|
+
let I = d, L = F, R = P(a(() => {
|
|
48
|
+
let { items: e, placeholder: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = I;
|
|
49
|
+
return c;
|
|
50
|
+
}), L);
|
|
51
|
+
function z(e) {
|
|
47
52
|
return typeof e == "string" ? {
|
|
48
53
|
label: e,
|
|
49
54
|
value: e
|
|
50
55
|
} : e;
|
|
51
56
|
}
|
|
52
|
-
function
|
|
57
|
+
function B(e) {
|
|
53
58
|
return typeof e != "string" && "items" in e;
|
|
54
59
|
}
|
|
55
|
-
let
|
|
56
|
-
let e =
|
|
57
|
-
if (e.some(
|
|
60
|
+
let V = a(() => {
|
|
61
|
+
let e = I.items ?? [];
|
|
62
|
+
if (e.some(B)) return e.map((e) => B(e) ? {
|
|
58
63
|
label: e.label,
|
|
59
|
-
options: e.items.map(
|
|
64
|
+
options: e.items.map(z)
|
|
60
65
|
} : {
|
|
61
66
|
label: "",
|
|
62
|
-
options: [
|
|
67
|
+
options: [z(e)]
|
|
63
68
|
});
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
}), H = a(() => (I.items ?? []).flatMap((e) => B(e) ? e.items.map(z) : [z(e)])), U = n(), W = a(() => I.id ?? U?.id.value);
|
|
70
|
+
U && I.id && (U.id.value = I.id);
|
|
71
|
+
let G = a(() => I.invalid ?? U?.invalid.value ?? !1), K = e(), q = a(() => I.unstyled ?? K.unstyled), J = a(() => r({
|
|
72
|
+
size: I.size,
|
|
73
|
+
invalid: G.value
|
|
74
|
+
})), Y = a(() => q.value ? [I.ui?.trigger, I.class] : J.value.trigger({ class: [I.ui?.trigger, I.class] })), X = a(() => q.value ? I.ui?.content : J.value.content({ class: I.ui?.content })), Z = a(() => q.value ? I.ui?.viewport : J.value.viewport({ class: I.ui?.viewport })), Q = a(() => q.value ? I.ui?.item : J.value.item({ class: I.ui?.item })), $ = a(() => q.value ? void 0 : J.value.itemIndicator()), ne = a(() => q.value ? I.ui?.group : J.value.group({ class: I.ui?.group })), re = a(() => q.value ? I.ui?.groupLabel : J.value.groupLabel({ class: I.ui?.groupLabel }));
|
|
75
|
+
return (e, n) => (g(), o(b(te), h(f(b(R))), {
|
|
76
|
+
default: x(() => [u(b(j), p({
|
|
77
|
+
id: W.value,
|
|
78
|
+
"aria-invalid": G.value || void 0,
|
|
79
|
+
"aria-describedby": b(U)?.describedBy.value
|
|
80
|
+
}, e.$attrs, { class: Y.value }), {
|
|
81
|
+
default: x(() => [u(b(M), {
|
|
68
82
|
class: "truncate",
|
|
69
|
-
placeholder:
|
|
70
|
-
}, null, 8, ["placeholder"]),
|
|
71
|
-
default:
|
|
83
|
+
placeholder: I.placeholder
|
|
84
|
+
}, null, 8, ["placeholder"]), u(b(E), { "as-child": "" }, {
|
|
85
|
+
default: x(() => [u(t, { icon: b(S) }, null, 8, ["icon"])]),
|
|
72
86
|
_: 1
|
|
73
87
|
})]),
|
|
74
88
|
_: 1
|
|
75
|
-
}, 16, [
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
}, 16, [
|
|
90
|
+
"id",
|
|
91
|
+
"aria-invalid",
|
|
92
|
+
"aria-describedby",
|
|
93
|
+
"class"
|
|
94
|
+
]), u(b(ee), null, {
|
|
95
|
+
default: x(() => [u(b(w), {
|
|
96
|
+
class: m(X.value),
|
|
78
97
|
position: "item-aligned"
|
|
79
98
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
default:
|
|
99
|
+
default: x(() => [u(b(N), { class: m(Z.value) }, {
|
|
100
|
+
default: x(() => [v(e.$slots, "default", {}, () => [V.value ? (g(!0), c(i, { key: 0 }, _(V.value, (e, n) => (g(), o(b(T), {
|
|
82
101
|
key: e.label || n,
|
|
83
|
-
class:
|
|
102
|
+
class: m(ne.value)
|
|
84
103
|
}, {
|
|
85
|
-
default:
|
|
104
|
+
default: x(() => [e.label ? (g(), o(b(A), {
|
|
86
105
|
key: 0,
|
|
87
|
-
class:
|
|
106
|
+
class: m(re.value)
|
|
88
107
|
}, {
|
|
89
|
-
default:
|
|
108
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
90
109
|
_: 2
|
|
91
|
-
}, 1032, ["class"])) :
|
|
110
|
+
}, 1032, ["class"])) : s("", !0), (g(!0), c(i, null, _(e.options, (e) => (g(), o(b(D), {
|
|
92
111
|
key: e.value,
|
|
93
112
|
value: e.value,
|
|
94
113
|
disabled: e.disabled,
|
|
95
|
-
class:
|
|
114
|
+
class: m(Q.value)
|
|
96
115
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
default:
|
|
116
|
+
default: x(() => [u(b(O), { class: m($.value) }, {
|
|
117
|
+
default: x(() => [u(t, { icon: b(C) }, null, 8, ["icon"])]),
|
|
99
118
|
_: 1
|
|
100
|
-
}, 8, ["class"]),
|
|
101
|
-
default:
|
|
119
|
+
}, 8, ["class"]), u(b(k), null, {
|
|
120
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
102
121
|
_: 2
|
|
103
122
|
}, 1024)]),
|
|
104
123
|
_: 2
|
|
@@ -108,17 +127,17 @@ var I = /*@__PURE__*/ u({
|
|
|
108
127
|
"class"
|
|
109
128
|
]))), 128))]),
|
|
110
129
|
_: 2
|
|
111
|
-
}, 1032, ["class"]))), 128)) : (
|
|
130
|
+
}, 1032, ["class"]))), 128)) : (g(!0), c(i, { key: 1 }, _(H.value, (e) => (g(), o(b(D), {
|
|
112
131
|
key: e.value,
|
|
113
132
|
value: e.value,
|
|
114
133
|
disabled: e.disabled,
|
|
115
|
-
class:
|
|
134
|
+
class: m(Q.value)
|
|
116
135
|
}, {
|
|
117
|
-
default:
|
|
118
|
-
default:
|
|
136
|
+
default: x(() => [u(b(O), { class: m($.value) }, {
|
|
137
|
+
default: x(() => [u(t, { icon: b(C) }, null, 8, ["icon"])]),
|
|
119
138
|
_: 1
|
|
120
|
-
}, 8, ["class"]),
|
|
121
|
-
default:
|
|
139
|
+
}, 8, ["class"]), u(b(k), null, {
|
|
140
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
122
141
|
_: 2
|
|
123
142
|
}, 1024)]),
|
|
124
143
|
_: 2
|
|
@@ -138,4 +157,4 @@ var I = /*@__PURE__*/ u({
|
|
|
138
157
|
}
|
|
139
158
|
});
|
|
140
159
|
//#endregion
|
|
141
|
-
export {
|
|
160
|
+
export { F as default };
|
|
@@ -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 { sliderTheme as n } from "../theme/slider.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 { SliderRange as b, SliderRoot as x, SliderThumb as S, SliderTrack as C, useId as w } from "reka-ui";
|
|
5
6
|
//#region src/components/Slider.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var T = ["id"], E = /*@__PURE__*/ d({
|
|
7
8
|
inheritAttrs: !1,
|
|
8
9
|
__name: "Slider",
|
|
9
10
|
props: {
|
|
@@ -35,62 +36,65 @@ var w = ["id"], T = /*@__PURE__*/ u({
|
|
|
35
36
|
ui: {}
|
|
36
37
|
},
|
|
37
38
|
emits: ["update:modelValue", "valueCommit"],
|
|
38
|
-
setup(
|
|
39
|
-
let
|
|
40
|
-
function
|
|
41
|
-
return
|
|
39
|
+
setup(d, { emit: E }) {
|
|
40
|
+
let D = d, O = E, k = i(() => typeof D.modelValue == "number"), A = i(() => Array.isArray(D.modelValue) ? D.modelValue : typeof D.modelValue == "number" ? [D.modelValue] : [D.min]);
|
|
41
|
+
function j(e) {
|
|
42
|
+
return k.value ? e[0] ?? D.min : e;
|
|
42
43
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
let M = i(() => D.formatValue ?? ((e) => String(e))), N = i(() => A.value.map((e) => M.value(e)).join(" – "));
|
|
45
|
+
function P(e, t) {
|
|
46
|
+
return D.label ? A.value.length > 1 ? `${D.label} ${D.rangeLabels[e] ?? ""}`.trim() : D.label : A.value.length > 1 ? D.rangeLabels[e] ?? void 0 : M.value(t);
|
|
46
47
|
}
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
let F = w(), I = t();
|
|
49
|
+
I && (I.id.value = void 0);
|
|
50
|
+
let L = i(() => `${D.id ?? F}-label`), R = i(() => !!(D.label || D.showValue)), z = e(), B = i(() => D.unstyled ?? z.unstyled), V = i(() => n({
|
|
51
|
+
orientation: D.orientation,
|
|
52
|
+
size: D.size,
|
|
53
|
+
disabled: D.disabled ?? !1
|
|
51
54
|
}));
|
|
52
|
-
function
|
|
53
|
-
let n = [
|
|
54
|
-
return
|
|
55
|
+
function H(e, t) {
|
|
56
|
+
let n = [D.ui?.[e], t];
|
|
57
|
+
return B.value ? n : V.value[e]({ class: n });
|
|
55
58
|
}
|
|
56
|
-
return (e, t) => (
|
|
57
|
-
|
|
59
|
+
return (e, t) => (m(), s("div", { class: p(H("root", D.class)) }, [
|
|
60
|
+
R.value ? (m(), s("div", {
|
|
58
61
|
key: 0,
|
|
59
|
-
class:
|
|
60
|
-
}, [
|
|
62
|
+
class: p(H("header"))
|
|
63
|
+
}, [D.label || e.$slots.label ? (m(), s("span", {
|
|
61
64
|
key: 0,
|
|
62
|
-
id:
|
|
63
|
-
class:
|
|
64
|
-
}, [
|
|
65
|
+
id: L.value,
|
|
66
|
+
class: p(H("label"))
|
|
67
|
+
}, [g(e.$slots, "label", {}, () => [l(_(D.label), 1)])], 10, T)) : o("", !0), D.showValue ? (m(), s("span", {
|
|
65
68
|
key: 1,
|
|
66
|
-
class:
|
|
67
|
-
}, [
|
|
68
|
-
values:
|
|
69
|
-
text:
|
|
70
|
-
}, () => [
|
|
71
|
-
|
|
72
|
-
"model-value":
|
|
73
|
-
min:
|
|
74
|
-
max:
|
|
75
|
-
step:
|
|
76
|
-
disabled:
|
|
77
|
-
orientation:
|
|
78
|
-
inverted:
|
|
79
|
-
"min-steps-between-thumbs":
|
|
80
|
-
"aria-labelledby":
|
|
69
|
+
class: p(H("value"))
|
|
70
|
+
}, [g(e.$slots, "value", {
|
|
71
|
+
values: A.value,
|
|
72
|
+
text: N.value
|
|
73
|
+
}, () => [l(_(N.value), 1)])], 2)) : o("", !0)], 2)) : o("", !0),
|
|
74
|
+
u(v(x), f({
|
|
75
|
+
"model-value": A.value,
|
|
76
|
+
min: D.min,
|
|
77
|
+
max: D.max,
|
|
78
|
+
step: D.step,
|
|
79
|
+
disabled: D.disabled,
|
|
80
|
+
orientation: D.orientation,
|
|
81
|
+
inverted: D.inverted,
|
|
82
|
+
"min-steps-between-thumbs": D.minStepsBetweenThumbs,
|
|
83
|
+
"aria-labelledby": D.label ? L.value : v(I)?.labelId.value,
|
|
84
|
+
"aria-describedby": v(I)?.describedBy.value
|
|
81
85
|
}, e.$attrs, {
|
|
82
|
-
class:
|
|
83
|
-
"onUpdate:modelValue": t[0] ||= (e) => e &&
|
|
84
|
-
onValueCommit: t[1] ||= (e) =>
|
|
86
|
+
class: H("slider"),
|
|
87
|
+
"onUpdate:modelValue": t[0] ||= (e) => e && O("update:modelValue", j(e)),
|
|
88
|
+
onValueCommit: t[1] ||= (e) => O("valueCommit", j(e))
|
|
85
89
|
}), {
|
|
86
|
-
default:
|
|
87
|
-
default:
|
|
90
|
+
default: y(() => [u(v(C), { class: p(H("track")) }, {
|
|
91
|
+
default: y(() => [u(v(b), { class: p(H("range")) }, null, 8, ["class"])]),
|
|
88
92
|
_: 1
|
|
89
|
-
}, 8, ["class"]), (
|
|
93
|
+
}, 8, ["class"]), (m(!0), s(r, null, h(A.value, (e, t) => (m(), a(v(S), {
|
|
90
94
|
key: t,
|
|
91
|
-
"aria-label":
|
|
92
|
-
"aria-valuetext":
|
|
93
|
-
class:
|
|
95
|
+
"aria-label": P(t, e),
|
|
96
|
+
"aria-valuetext": M.value(e),
|
|
97
|
+
class: p(H("thumb"))
|
|
94
98
|
}, null, 8, [
|
|
95
99
|
"aria-label",
|
|
96
100
|
"aria-valuetext",
|
|
@@ -107,14 +111,15 @@ var w = ["id"], T = /*@__PURE__*/ u({
|
|
|
107
111
|
"inverted",
|
|
108
112
|
"min-steps-between-thumbs",
|
|
109
113
|
"aria-labelledby",
|
|
114
|
+
"aria-describedby",
|
|
110
115
|
"class"
|
|
111
116
|
]),
|
|
112
|
-
|
|
117
|
+
D.showScale && D.orientation !== "vertical" ? (m(), s("div", {
|
|
113
118
|
key: 1,
|
|
114
|
-
class:
|
|
115
|
-
}, [
|
|
119
|
+
class: p(H("scale"))
|
|
120
|
+
}, [c("span", null, _(M.value(D.min)), 1), c("span", null, _(M.value(D.max)), 1)], 2)) : o("", !0)
|
|
116
121
|
], 2));
|
|
117
122
|
}
|
|
118
123
|
});
|
|
119
124
|
//#endregion
|
|
120
|
-
export {
|
|
125
|
+
export { E as default };
|
|
@@ -7,6 +7,8 @@ export interface SwitchProps extends SwitchRootProps {
|
|
|
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;
|
|
@@ -32,6 +34,7 @@ declare const __VLS_base: import("vue").DefineComponent<SwitchProps, {}, {}, {},
|
|
|
32
34
|
"onUpdate:modelValue"?: ((payload: boolean) => any) | undefined;
|
|
33
35
|
}>, {
|
|
34
36
|
unstyled: boolean;
|
|
37
|
+
invalid: boolean;
|
|
35
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
39
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
40
|
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 { switchTheme as n } from "../theme/switch.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
5
|
+
import { Label as v, SwitchRoot as y, SwitchThumb as b, useForwardPropsEmits as x, useId as S } from "reka-ui";
|
|
5
6
|
//#region src/components/Switch.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var C = ["id"], w = /*@__PURE__*/ u({
|
|
7
8
|
inheritAttrs: !1,
|
|
8
9
|
__name: "Switch",
|
|
9
10
|
props: {
|
|
@@ -11,6 +12,10 @@ var S = ["id"], C = /*@__PURE__*/ l({
|
|
|
11
12
|
description: {},
|
|
12
13
|
size: {},
|
|
13
14
|
id: {},
|
|
15
|
+
invalid: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
14
19
|
unstyled: {
|
|
15
20
|
type: Boolean,
|
|
16
21
|
default: void 0
|
|
@@ -34,51 +39,63 @@ var S = ["id"], C = /*@__PURE__*/ l({
|
|
|
34
39
|
required: { type: Boolean }
|
|
35
40
|
},
|
|
36
41
|
emits: ["update:modelValue"],
|
|
37
|
-
setup(
|
|
38
|
-
let
|
|
39
|
-
let { label: e, description: t, size: n, id: r,
|
|
40
|
-
return
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
setup(u, { emit: w }) {
|
|
43
|
+
let T = u, E = w, D = x(r(() => {
|
|
44
|
+
let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = T;
|
|
45
|
+
return c;
|
|
46
|
+
}), E), O = S(), k = t(), A = r(() => T.invalid ?? k?.invalid.value ?? !1), j = r(() => T.id ?? k?.id.value ?? O);
|
|
47
|
+
k && (k.id.value = j.value);
|
|
48
|
+
let M = r(() => !!(T.label || T.description)), N = e(), P = r(() => T.unstyled ?? N.unstyled), F = r(() => n({
|
|
49
|
+
size: T.size,
|
|
50
|
+
withText: M.value,
|
|
51
|
+
invalid: A.value
|
|
52
|
+
})), I = r(() => P.value ? T.ui?.wrapper : F.value.wrapper({ class: T.ui?.wrapper })), L = r(() => P.value ? [T.ui?.root, T.class] : F.value.root({ class: [T.ui?.root, T.class] })), R = r(() => P.value ? T.ui?.thumb : F.value.thumb({ class: T.ui?.thumb })), z = r(() => P.value ? T.ui?.content : F.value.content({ class: T.ui?.content })), B = r(() => P.value ? T.ui?.label : F.value.label({ class: T.ui?.label })), V = r(() => P.value ? T.ui?.description : F.value.description({ class: T.ui?.description }));
|
|
53
|
+
return (e, t) => M.value ? (p(), o("div", {
|
|
46
54
|
key: 0,
|
|
47
|
-
class:
|
|
48
|
-
}, [
|
|
49
|
-
...
|
|
55
|
+
class: f(I.value)
|
|
56
|
+
}, [l(g(y), d({ id: j.value }, {
|
|
57
|
+
...g(D),
|
|
50
58
|
...e.$attrs
|
|
51
59
|
}, {
|
|
52
|
-
"aria-
|
|
53
|
-
|
|
60
|
+
"aria-invalid": A.value || void 0,
|
|
61
|
+
"aria-describedby": T.description ? `${j.value}-description` : void 0,
|
|
62
|
+
class: L.value
|
|
54
63
|
}), {
|
|
55
|
-
default:
|
|
64
|
+
default: _(() => [l(g(b), { class: f(R.value) }, null, 8, ["class"])]),
|
|
56
65
|
_: 1
|
|
57
66
|
}, 16, [
|
|
58
67
|
"id",
|
|
68
|
+
"aria-invalid",
|
|
59
69
|
"aria-describedby",
|
|
60
70
|
"class"
|
|
61
|
-
]),
|
|
62
|
-
for:
|
|
63
|
-
class:
|
|
71
|
+
]), s("div", { class: f(z.value) }, [l(g(v), {
|
|
72
|
+
for: j.value,
|
|
73
|
+
class: f(B.value)
|
|
64
74
|
}, {
|
|
65
|
-
default:
|
|
75
|
+
default: _(() => [m(e.$slots, "label", {}, () => [c(h(T.label), 1)])]),
|
|
66
76
|
_: 3
|
|
67
|
-
}, 8, ["for", "class"]),
|
|
77
|
+
}, 8, ["for", "class"]), T.description || e.$slots.description ? (p(), o("p", {
|
|
68
78
|
key: 0,
|
|
69
|
-
id: `${
|
|
70
|
-
class:
|
|
71
|
-
}, [
|
|
79
|
+
id: `${j.value}-description`,
|
|
80
|
+
class: f(V.value)
|
|
81
|
+
}, [m(e.$slots, "description", {}, () => [c(h(T.description), 1)])], 10, C)) : a("", !0)], 2)], 2)) : (p(), i(g(y), d({
|
|
72
82
|
key: 1,
|
|
73
|
-
id:
|
|
83
|
+
id: j.value
|
|
74
84
|
}, {
|
|
75
|
-
...
|
|
85
|
+
...g(D),
|
|
76
86
|
...e.$attrs
|
|
77
|
-
}, {
|
|
78
|
-
|
|
87
|
+
}, {
|
|
88
|
+
"aria-invalid": A.value || void 0,
|
|
89
|
+
class: L.value
|
|
90
|
+
}), {
|
|
91
|
+
default: _(() => [l(g(b), { class: f(R.value) }, null, 8, ["class"])]),
|
|
79
92
|
_: 1
|
|
80
|
-
}, 16, [
|
|
93
|
+
}, 16, [
|
|
94
|
+
"id",
|
|
95
|
+
"aria-invalid",
|
|
96
|
+
"class"
|
|
97
|
+
]));
|
|
81
98
|
}
|
|
82
99
|
});
|
|
83
100
|
//#endregion
|
|
84
|
-
export {
|
|
101
|
+
export { w as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { textareaTheme as n } from "../theme/input.js";
|
|
4
4
|
import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, nextTick as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, unref as f, useModel as p, vModelText as m, watch as h, withDirectives as g } from "vue";
|
|
5
5
|
//#region src/components/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _ = [
|
|
@@ -41,7 +41,7 @@ var _ = [
|
|
|
41
41
|
}),
|
|
42
42
|
emits: ["update:modelValue"],
|
|
43
43
|
setup(a, { expose: o }) {
|
|
44
|
-
let v = a, y = p(a, "modelValue"), b =
|
|
44
|
+
let v = a, y = p(a, "modelValue"), b = t(), x = r(() => v.id ?? b?.id.value), S = r(() => v.invalid ?? b?.invalid.value ?? !1), C = e(), w = r(() => v.unstyled ?? C.unstyled), T = r(() => w.value ? v.class : n({
|
|
45
45
|
size: v.size,
|
|
46
46
|
invalid: S.value,
|
|
47
47
|
autosize: !!v.autosize,
|
|
@@ -52,7 +52,14 @@ export interface FormContext {
|
|
|
52
52
|
export declare const formContextKey: InjectionKey<FormContext>;
|
|
53
53
|
/** Context a `FormField` exposes to the control it wraps. */
|
|
54
54
|
export interface FormFieldContext {
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The id the field's `<label for>` points at. Writable: a control with its
|
|
57
|
+
* own `id` writes that back, and one a label cannot target — a radio group,
|
|
58
|
+
* a slider — clears it so the field renders no dangling `for`.
|
|
59
|
+
*/
|
|
60
|
+
id: Ref<string | undefined>;
|
|
61
|
+
/** Id of the field's own `<label>`, for controls a `for` cannot target. */
|
|
62
|
+
labelId: ComputedRef<string | undefined>;
|
|
56
63
|
name: ComputedRef<string | undefined>;
|
|
57
64
|
invalid: ComputedRef<boolean>;
|
|
58
65
|
describedBy: ComputedRef<string | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -43,14 +43,14 @@ import { calendarTheme as _e } from "./theme/calendar.js";
|
|
|
43
43
|
import ve from "./components/Calendar.js";
|
|
44
44
|
import { cardTheme as ye } from "./theme/card.js";
|
|
45
45
|
import be from "./components/Card.js";
|
|
46
|
-
import {
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import {
|
|
52
|
-
import
|
|
53
|
-
import
|
|
46
|
+
import { formContextKey as xe, formFieldContextKey as Se, getByPath as Ce, isStandardSchema as we, issuePath as Te, useForm as Ee, useFormField as De } from "./composables/form.js";
|
|
47
|
+
import { checkboxTheme as Oe } from "./theme/checkbox.js";
|
|
48
|
+
import ke from "./components/Checkbox.js";
|
|
49
|
+
import { collapsibleTheme as Ae } from "./theme/collapsible.js";
|
|
50
|
+
import je from "./components/Collapsible.js";
|
|
51
|
+
import { fieldBase as Me, inputTheme as Ne, textareaTheme as Pe } from "./theme/input.js";
|
|
52
|
+
import { colorPickerTheme as Fe } from "./theme/color-picker.js";
|
|
53
|
+
import Ie from "./components/ColorPicker.js";
|
|
54
54
|
import { comboboxTheme as Le } from "./theme/combobox.js";
|
|
55
55
|
import Re from "./components/Combobox.js";
|
|
56
56
|
import { isApplePlatform as ze, parseHotkey as Be, useApplePlatform as Ve } from "./composables/kbd.js";
|
|
@@ -167,4 +167,4 @@ import pr from "./components/Tooltip.js";
|
|
|
167
167
|
import { treeTheme as mr } from "./theme/tree.js";
|
|
168
168
|
import hr from "./components/Tree.js";
|
|
169
169
|
import { IryxUi as gr, createIryxUi as _r } from "./plugin.js";
|
|
170
|
-
export { B as AXIS_GAP, s as Accordion, l as Alert, h as App, b as AppShell, x as AspectRatio, D as AuthProviders, A as Avatar, j as AvatarGroup, N as Badge, F as Banner, ie as BarChart, oe as Breadcrumb, E as Button, ce as ButtonGroup, V as CATEGORY_HEIGHT, H as CHAR_WIDTH, ve as Calendar, le as CalendarDate, be as Card, re as ChartLegend,
|
|
170
|
+
export { B as AXIS_GAP, s as Accordion, l as Alert, h as App, b as AppShell, x as AspectRatio, D as AuthProviders, A as Avatar, j as AvatarGroup, N as Badge, F as Banner, ie as BarChart, oe as Breadcrumb, E as Button, ce as ButtonGroup, V as CATEGORY_HEIGHT, H as CHAR_WIDTH, ve as Calendar, le as CalendarDate, be as Card, re as ChartLegend, ke as Checkbox, je as Collapsible, Ie as ColorPicker, Re as Combobox, Ye as CommandPalette, tt as ConfirmDialog, rt as Container, st as ContextMenu, lt as DateField, dt as DatePicker, ft as DateRangePicker, et as Dialog, mt as DonutChart, y as Drawer, ht as DropdownMenu, _t as Editable, yt as EmptyState, xt as FileUpload, St as Form, Tt as FormField, Dt as HoverCard, o as Icon, Ot as Input, gr as IryxUi, Je as Kbd, wt as Label, At as LineChart, Mt as Menubar, Ft as NavigationMenu, Jt as NumberInput, Xt as PageHeader, Qt as Pagination, en as PasswordInput, nn as PinInput, an as Popover, sn as Progress, Z as REVEAL_DURATION, ln as RadioGroup, U as SERIES_SLOTS, dn as ScrollArea, hn as ScrollFade, _n as Select, yn as Separator, wn as Sidebar, On as SignaturePad, An as Skeleton, Mn as Slider, Pn as Sparkline, In as Splitter, Rn as Stat, Bn as Stepper, Hn as Switch, W as TOP_PAD, Kn as Table, Jn as Tabs, Xn as TagsInput, Zn as Textarea, ue as Time, $n as TimeField, tr as Timeline, ar as Toaster, cr as Toggle, lr as ToggleGroup, dr as Toolbar, pr as Tooltip, hr as Tree, i as accordionTheme, It as addDecimals, c as alertTheme, _ as appShellTheme, f as applyTheme, S as authProvidersTheme, O as avatarGroupTheme, k as avatarTheme, M as badgeTheme, P as bannerTheme, te as barChartTheme, ae as breadcrumbTheme, C as buttonGroupContextKey, se as buttonGroupTheme, T as buttonTheme, _e as calendarTheme, ye as cardTheme, G as cartesianLayout, ne as chartLegendTheme, Oe as checkboxTheme, Lt as clampDecimal, K as clampTooltip, p as clearTheme, Ae as collapsibleTheme, Fe as colorPickerTheme, Le as comboboxTheme, He as commandHaystack, Ke as commandPaletteTheme, Rt as compareDecimals, e as componentNames, nt as containerTheme, _r as createIryxUi, ct as dateFieldTheme, ut as datePickerTheme, t as defaultConfig, $e as dialogTheme, pt as donutChartTheme, v as drawerTheme, it as dropdownMenuTheme, gt as editableTheme, vt as emptyStateTheme, I as extent, Me as fieldBase, bt as fileUploadTheme, L as finiteValues, xe as formContextKey, Se as formFieldContextKey, zt as formatDecimal, Bt as formatForLocale, de as formatIsoDate, Ce as getByPath, Un as getRowValue, Tn as hasInk, Et as hoverCardTheme, u as initAppearance, Ne as inputTheme, n as iryxUiConfigKey, ze as isApplePlatform, Ue as isCommandGroup, Vt as isDecimal, a as isIconArray, Nt as isNavigationGroup, at as isSeparator, bn as isSidebarGroup, xn as isSidebarSection, we as isStandardSchema, ot as isSubmenu, fe as isoToday, Te as issuePath, qe as kbdTheme, Ct as labelTheme, kt as lineChartTheme, R as linearScale, Ht as localeSeparators, We as matchesHotkey, jt as menubarTheme, Pt as navigationMenuTheme, z as niceTicks, qt as numberInputTheme, Yt as pageHeaderTheme, Zt as paginationTheme, Ut as parseDecimal, Wt as parseFromLocale, Be as parseHotkey, $t as passwordInputTheme, tn as pinInputTheme, rn as popoverTheme, on as progressTheme, cn as radioGroupTheme, Xe as resolveConfirm, Gt as roundDecimal, un as scrollAreaTheme, fn as scrollFadeMask, mn as scrollFadeTheme, gn as selectTheme, vn as separatorTheme, q as seriesColor, Cn as sidebarTheme, Dn as signaturePadTheme, kn as skeletonTheme, jn as sliderTheme, J as slotOf, Nn as sparklineTheme, Fn as splitterTheme, Ln as statTheme, zn as stepperTheme, En as strokeWidth, Vn as switchTheme, Gn as tableTheme, qn as tabsTheme, Yn as tagsInputTheme, Pe as textareaTheme, m as themes, Qn as timeFieldTheme, er as timelineTheme, pe as toCalendarDate, Ge as toCommandGroups, Kt as toEditable, me as toIsoDate, he as toIsoTime, Sn as toSidebarSections, ge as toTime, ir as toastTheme, or as toggleGroupTheme, sr as toggleTheme, ur as toolbarTheme, Y as tooltipHalfWidth, fr as tooltipTheme, mr as treeTheme, d as useAppearance, Ve as useApplePlatform, w as useButtonGroup, Q as useChartAnimation, $ as useChartProgress, ee as useChartReveal, Ze as useConfirm, Qe as useConfirmState, Wn as useDataTable, g as useElementSize, Ee as useForm, De as useFormField, r as useIryxUiConfig, pn as useScrollEdges, nr as useToast, rr as useToastState, X as warnOnSlotOverflow };
|
package/dist/theme/checkbox.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export declare const checkboxTheme: import("tailwind-variants").TVReturnType<{
|
|
|
18
18
|
root: string;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
invalid: {
|
|
22
|
+
true: {
|
|
23
|
+
root: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
21
26
|
}, {
|
|
22
27
|
wrapper: string;
|
|
23
28
|
root: string;
|
|
@@ -45,6 +50,11 @@ export declare const checkboxTheme: import("tailwind-variants").TVReturnType<{
|
|
|
45
50
|
root: string;
|
|
46
51
|
};
|
|
47
52
|
};
|
|
53
|
+
invalid: {
|
|
54
|
+
true: {
|
|
55
|
+
root: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
48
58
|
}, {
|
|
49
59
|
wrapper: string;
|
|
50
60
|
root: string;
|
|
@@ -72,6 +82,11 @@ export declare const checkboxTheme: import("tailwind-variants").TVReturnType<{
|
|
|
72
82
|
root: string;
|
|
73
83
|
};
|
|
74
84
|
};
|
|
85
|
+
invalid: {
|
|
86
|
+
true: {
|
|
87
|
+
root: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
75
90
|
}, {
|
|
76
91
|
wrapper: string;
|
|
77
92
|
root: string;
|
package/dist/theme/checkbox.js
CHANGED
|
@@ -24,7 +24,8 @@ var t = e({
|
|
|
24
24
|
indicator: "[&_svg]:size-3.5"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
withText: { true: { root: "mt-0.5" } }
|
|
27
|
+
withText: { true: { root: "mt-0.5" } },
|
|
28
|
+
invalid: { true: { root: "border-red-500 focus-visible:ring-red-500/40" } }
|
|
28
29
|
},
|
|
29
30
|
compoundVariants: [{
|
|
30
31
|
size: "lg",
|
|
@@ -21,6 +21,11 @@ export declare const radioGroupTheme: import("tailwind-variants").TVReturnType<{
|
|
|
21
21
|
root: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
+
invalid: {
|
|
25
|
+
true: {
|
|
26
|
+
item: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
24
29
|
}, {
|
|
25
30
|
root: string;
|
|
26
31
|
wrapper: string;
|
|
@@ -52,6 +57,11 @@ export declare const radioGroupTheme: import("tailwind-variants").TVReturnType<{
|
|
|
52
57
|
root: string;
|
|
53
58
|
};
|
|
54
59
|
};
|
|
60
|
+
invalid: {
|
|
61
|
+
true: {
|
|
62
|
+
item: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
55
65
|
}, {
|
|
56
66
|
root: string;
|
|
57
67
|
wrapper: string;
|
|
@@ -83,6 +93,11 @@ export declare const radioGroupTheme: import("tailwind-variants").TVReturnType<{
|
|
|
83
93
|
root: string;
|
|
84
94
|
};
|
|
85
95
|
};
|
|
96
|
+
invalid: {
|
|
97
|
+
true: {
|
|
98
|
+
item: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
86
101
|
}, {
|
|
87
102
|
root: string;
|
|
88
103
|
wrapper: string;
|