iryx-ui 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Carousel.js +5 -0
- package/dist/components/Carousel.vue.d.ts +74 -0
- package/dist/components/Carousel.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/Checkbox.vue.d.ts +20 -3
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +90 -43
- package/dist/components/Progress.vue.d.ts +29 -3
- package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +103 -47
- package/dist/components/RadioGroup.vue.d.ts +12 -0
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +73 -39
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +124 -122
- package/dist/index.d.ts +1 -0
- package/dist/index.js +127 -126
- package/dist/theme/carousel.d.ts +65 -0
- package/dist/theme/carousel.js +22 -0
- package/dist/theme/checkbox.d.ts +42 -39
- package/dist/theme/checkbox.js +117 -15
- package/dist/theme/form.d.ts +3 -3
- package/dist/theme/presets.d.ts +8 -2
- package/dist/theme/presets.js +2 -2
- package/dist/theme/progress.d.ts +75 -0
- package/dist/theme/progress.js +43 -11
- package/dist/theme/radio-group.d.ts +45 -30
- package/dist/theme/radio-group.js +118 -11
- package/package.json +1 -1
- package/theme.css +25 -0
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import { progressTheme as t } from "../theme/progress.js";
|
|
3
3
|
import { Fragment as n, 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, normalizeStyle as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useSlots as y, withCtx as b } from "vue";
|
|
4
|
-
import { ProgressIndicator as x, ProgressRoot as S, useId as
|
|
4
|
+
import { ProgressIndicator as x, ProgressRoot as S, useId as ee } from "reka-ui";
|
|
5
5
|
//#region src/components/Progress.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var w = ["
|
|
6
|
+
var C = ["transform"], w = ["stroke-linecap", "stroke-dasharray"], T = ["stroke-dasharray"], te = ["id"], E = ["id"], ne = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "flex h-full w-full"
|
|
9
|
-
},
|
|
9
|
+
}, D = 8, O = /*@__PURE__*/ u({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "Progress",
|
|
12
12
|
props: {
|
|
13
13
|
modelValue: {},
|
|
14
14
|
max: { default: 100 },
|
|
15
|
+
shape: {},
|
|
16
|
+
angle: {},
|
|
15
17
|
variant: {},
|
|
16
18
|
segments: {},
|
|
17
19
|
size: {},
|
|
@@ -32,60 +34,114 @@ var w = ["id"], T = {
|
|
|
32
34
|
ui: {}
|
|
33
35
|
},
|
|
34
36
|
setup(u) {
|
|
35
|
-
let
|
|
37
|
+
let O = u, re = y(), k = ee(), A = r(() => !!(O.label || re.label)), j = r(() => O.shape === "circle"), M = r(() => !j.value && (O.segments?.length ?? 0) > 0), N = r(() => !M.value && (O.indeterminate || O.modelValue == null)), P = r(() => {
|
|
36
38
|
let e = 0;
|
|
37
|
-
return (
|
|
38
|
-
let n = Math.max(t.value, 0), r = Math.max(
|
|
39
|
+
return (O.segments ?? []).map((t) => {
|
|
40
|
+
let n = Math.max(t.value, 0), r = Math.max(O.max - e, 0), i = Math.min(n, r);
|
|
39
41
|
return e += i, {
|
|
40
42
|
...t,
|
|
41
43
|
value: n,
|
|
42
|
-
percent:
|
|
44
|
+
percent: O.max > 0 ? i / O.max * 100 : 0
|
|
43
45
|
};
|
|
44
46
|
});
|
|
45
|
-
}),
|
|
46
|
-
if (
|
|
47
|
-
}),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
}), F = r(() => P.value.reduce((e, t) => e + t.value, 0)), I = r(() => P.value.filter((e) => e.label)), L = r(() => N.value ? null : M.value ? Math.min(F.value, O.max) : Math.min(Math.max(O.modelValue ?? 0, 0), O.max)), R = r(() => L.value == null ? 0 : L.value / O.max * 100), z = r(() => {
|
|
48
|
+
if (L.value != null) return O.formatValue ? O.formatValue(L.value, O.max) : `${Math.round(R.value)}%`;
|
|
49
|
+
}), B = r(() => !!(O.label || O.showValue && z.value)), V = e(), H = r(() => O.unstyled ?? V.unstyled), U = r(() => t({
|
|
50
|
+
shape: O.shape,
|
|
51
|
+
variant: O.variant,
|
|
52
|
+
size: O.size,
|
|
53
|
+
indeterminate: N.value
|
|
54
|
+
})), W = r(() => H.value ? [O.ui?.root, O.class] : U.value.root({ class: [O.ui?.root, O.class] })), G = r(() => H.value ? O.ui?.header : U.value.header({ class: O.ui?.header })), K = r(() => H.value ? O.ui?.label : U.value.label({ class: O.ui?.label })), q = r(() => H.value ? O.ui?.value : U.value.value({ class: O.ui?.value })), J = r(() => H.value ? O.ui?.track : U.value.track({ class: O.ui?.track })), Y = r(() => H.value ? O.ui?.indicator : U.value.indicator({ class: O.ui?.indicator })), ie = r(() => H.value ? O.ui?.ring : U.value.ring({ class: O.ui?.ring })), ae = r(() => H.value ? O.ui?.ringTrack : U.value.ringTrack({ class: O.ui?.ringTrack })), oe = r(() => H.value ? O.ui?.ringIndicator : U.value.ringIndicator({ class: O.ui?.ringIndicator })), se = r(() => H.value ? O.ui?.ringContent : U.value.ringContent({ class: O.ui?.ringContent })), ce = r(() => H.value ? O.ui?.ringValue : U.value.ringValue({ class: O.ui?.ringValue })), le = r(() => H.value ? O.ui?.ringLabel : U.value.ringLabel({ class: O.ui?.ringLabel })), ue = r(() => H.value ? O.ui?.legend : U.value.legend({ class: O.ui?.legend })), de = r(() => H.value ? O.ui?.legendItem : U.value.legendItem({ class: O.ui?.legendItem })), fe = r(() => H.value ? O.ui?.legendValue : U.value.legendValue({ class: O.ui?.legendValue }));
|
|
55
|
+
function pe(e) {
|
|
56
|
+
return H.value ? O.ui?.segment : t({ variant: e ?? "neutral" }).segment({ class: O.ui?.segment });
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
58
|
+
function me(e) {
|
|
59
|
+
return H.value ? O.ui?.legendSwatch : t({ variant: e ?? "neutral" }).legendSwatch({ class: O.ui?.legendSwatch });
|
|
57
60
|
}
|
|
58
|
-
let $ = r(() =>
|
|
59
|
-
return (e, t) => (m(), o("div", {
|
|
60
|
-
|
|
61
|
+
let X = (100 - D) / 2, Z = 2 * Math.PI * X, Q = r(() => Math.min(Math.max(O.angle ?? 360, 1), 360)), $ = r(() => Z * (Q.value / 360)), he = r(() => Q.value === 360 ? -90 : -(90 + Q.value / 2)), ge = r(() => `${N.value ? $.value * .25 : $.value * (R.value / 100)} ${Z}`), _e = r(() => `${$.value} ${Z}`), ve = r(() => N.value ? void 0 : { transform: `translateX(-${100 - R.value}%)` });
|
|
62
|
+
return (e, t) => j.value ? (m(), o("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: f(W.value)
|
|
65
|
+
}, [l(v(S), d({
|
|
66
|
+
"model-value": L.value,
|
|
67
|
+
max: O.max,
|
|
68
|
+
"get-value-label": () => z.value ?? "",
|
|
69
|
+
"aria-labelledby": A.value ? v(k) : void 0
|
|
70
|
+
}, e.$attrs, { "as-child": "" }), {
|
|
71
|
+
default: b(() => [(m(), o("svg", {
|
|
72
|
+
class: f(ie.value),
|
|
73
|
+
viewBox: "0 0 100 100",
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}, [s("g", { transform: `rotate(${he.value} 50 50)` }, [s("circle", {
|
|
76
|
+
class: f(ae.value),
|
|
77
|
+
cx: "50",
|
|
78
|
+
cy: "50",
|
|
79
|
+
r: X,
|
|
80
|
+
"stroke-width": D,
|
|
81
|
+
"stroke-linecap": Q.value === 360 ? void 0 : "round",
|
|
82
|
+
"stroke-dasharray": _e.value
|
|
83
|
+
}, null, 10, w), l(v(x), { "as-child": "" }, {
|
|
84
|
+
default: b(() => [s("circle", {
|
|
85
|
+
class: f(oe.value),
|
|
86
|
+
cx: "50",
|
|
87
|
+
cy: "50",
|
|
88
|
+
r: X,
|
|
89
|
+
"stroke-width": D,
|
|
90
|
+
"stroke-linecap": "round",
|
|
91
|
+
"stroke-dasharray": ge.value
|
|
92
|
+
}, null, 10, T)]),
|
|
93
|
+
_: 1
|
|
94
|
+
})], 8, C)], 2))]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 16, [
|
|
97
|
+
"model-value",
|
|
98
|
+
"max",
|
|
99
|
+
"get-value-label",
|
|
100
|
+
"aria-labelledby"
|
|
101
|
+
]), s("div", { class: f(se.value) }, [O.showValue && z.value ? (m(), o("span", {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: f(ce.value)
|
|
104
|
+
}, [g(e.$slots, "value", {
|
|
105
|
+
value: L.value,
|
|
106
|
+
percent: R.value,
|
|
107
|
+
formatted: z.value
|
|
108
|
+
}, () => [c(_(z.value), 1)])], 2)) : a("", !0), A.value ? (m(), o("span", {
|
|
109
|
+
key: 1,
|
|
110
|
+
id: v(k),
|
|
111
|
+
class: f(le.value)
|
|
112
|
+
}, [g(e.$slots, "label", {}, () => [c(_(O.label), 1)])], 10, te)) : a("", !0)], 2)], 2)) : (m(), o("div", {
|
|
113
|
+
key: 1,
|
|
114
|
+
class: f(W.value)
|
|
115
|
+
}, [
|
|
116
|
+
B.value ? (m(), o("div", {
|
|
61
117
|
key: 0,
|
|
62
|
-
class: f(
|
|
63
|
-
}, [
|
|
118
|
+
class: f(G.value)
|
|
119
|
+
}, [A.value ? (m(), o("span", {
|
|
64
120
|
key: 0,
|
|
65
|
-
id: v(
|
|
66
|
-
class: f(
|
|
67
|
-
}, [g(e.$slots, "label", {}, () => [c(_(
|
|
121
|
+
id: v(k),
|
|
122
|
+
class: f(K.value)
|
|
123
|
+
}, [g(e.$slots, "label", {}, () => [c(_(O.label), 1)])], 10, E)) : a("", !0), O.showValue && z.value ? (m(), o("span", {
|
|
68
124
|
key: 1,
|
|
69
|
-
class: f(
|
|
125
|
+
class: f(q.value)
|
|
70
126
|
}, [g(e.$slots, "value", {
|
|
71
|
-
value:
|
|
72
|
-
percent:
|
|
73
|
-
formatted:
|
|
74
|
-
}, () => [c(_(
|
|
127
|
+
value: L.value,
|
|
128
|
+
percent: R.value,
|
|
129
|
+
formatted: z.value
|
|
130
|
+
}, () => [c(_(z.value), 1)])], 2)) : a("", !0)], 2)) : a("", !0),
|
|
75
131
|
l(v(S), d({
|
|
76
|
-
"model-value":
|
|
77
|
-
max:
|
|
78
|
-
"get-value-label": () =>
|
|
79
|
-
"aria-labelledby":
|
|
80
|
-
}, e.$attrs, { class:
|
|
81
|
-
default: b(() => [
|
|
132
|
+
"model-value": L.value,
|
|
133
|
+
max: O.max,
|
|
134
|
+
"get-value-label": () => z.value ?? "",
|
|
135
|
+
"aria-labelledby": A.value ? v(k) : void 0
|
|
136
|
+
}, e.$attrs, { class: J.value }), {
|
|
137
|
+
default: b(() => [M.value ? (m(), o("div", ne, [(m(!0), o(n, null, h(P.value, (e, t) => (m(), o("div", {
|
|
82
138
|
key: e.label ?? t,
|
|
83
|
-
class: f(
|
|
139
|
+
class: f(pe(e.variant)),
|
|
84
140
|
style: p({ width: `${e.percent}%` })
|
|
85
141
|
}, null, 6))), 128))])) : (m(), i(v(x), {
|
|
86
142
|
key: 1,
|
|
87
|
-
class: f(
|
|
88
|
-
style: p(
|
|
143
|
+
class: f(Y.value),
|
|
144
|
+
style: p(ve.value)
|
|
89
145
|
}, null, 8, ["class", "style"]))]),
|
|
90
146
|
_: 1
|
|
91
147
|
}, 16, [
|
|
@@ -95,19 +151,19 @@ var w = ["id"], T = {
|
|
|
95
151
|
"aria-labelledby",
|
|
96
152
|
"class"
|
|
97
153
|
]),
|
|
98
|
-
|
|
154
|
+
I.value.length ? (m(), o("ul", {
|
|
99
155
|
key: 1,
|
|
100
|
-
class: f(
|
|
101
|
-
}, [(m(!0), o(n, null, h(
|
|
156
|
+
class: f(ue.value)
|
|
157
|
+
}, [(m(!0), o(n, null, h(I.value, (e, t) => (m(), o("li", {
|
|
102
158
|
key: e.label ?? t,
|
|
103
|
-
class: f(
|
|
159
|
+
class: f(de.value)
|
|
104
160
|
}, [
|
|
105
|
-
s("span", { class: f(
|
|
161
|
+
s("span", { class: f(me(e.variant)) }, null, 2),
|
|
106
162
|
s("span", null, _(e.label), 1),
|
|
107
|
-
s("span", { class: f(
|
|
163
|
+
s("span", { class: f(fe.value) }, _(O.formatValue ? O.formatValue(e.value, O.max) : `${Math.round(e.value / O.max * 100)}%`), 3)
|
|
108
164
|
], 2))), 128))], 2)) : a("", !0)
|
|
109
165
|
], 2));
|
|
110
166
|
}
|
|
111
167
|
});
|
|
112
168
|
//#endregion
|
|
113
|
-
export {
|
|
169
|
+
export { O as default };
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import type { RadioGroupRootProps } from 'reka-ui';
|
|
2
2
|
import type { ClassValue } from '../class-value';
|
|
3
|
+
import type { IconLike } from '../composables/icon';
|
|
3
4
|
export interface RadioGroupItemOption {
|
|
4
5
|
label: string;
|
|
5
6
|
value: string;
|
|
6
7
|
/** Secondary text under the label. */
|
|
7
8
|
description?: string;
|
|
9
|
+
/** Shown above the label by the `tile` variant, ignored by the others. */
|
|
10
|
+
icon?: IconLike;
|
|
8
11
|
disabled?: boolean;
|
|
9
12
|
}
|
|
10
13
|
export interface RadioGroupProps extends RadioGroupRootProps {
|
|
11
14
|
/** Options to render. Strings are expanded to `{ label, value }`. */
|
|
12
15
|
items?: (RadioGroupItemOption | string)[];
|
|
16
|
+
/**
|
|
17
|
+
* How each option is drawn. `radio` is a circle beside its label, `card`
|
|
18
|
+
* makes the whole bordered surface the control, and `tile` centres an icon
|
|
19
|
+
* above the label.
|
|
20
|
+
*/
|
|
21
|
+
variant?: 'radio' | 'card' | 'tile';
|
|
13
22
|
size?: 'sm' | 'md' | 'lg';
|
|
14
23
|
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
15
24
|
invalid?: boolean;
|
|
@@ -19,6 +28,9 @@ export interface RadioGroupProps extends RadioGroupRootProps {
|
|
|
19
28
|
ui?: {
|
|
20
29
|
root?: string;
|
|
21
30
|
item?: string;
|
|
31
|
+
mark?: string;
|
|
32
|
+
icon?: string;
|
|
33
|
+
content?: string;
|
|
22
34
|
label?: string;
|
|
23
35
|
description?: string;
|
|
24
36
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { radioGroupTheme as r } from "../theme/radio-group.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, openBlock as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
|
|
6
|
+
import { Label as x, RadioGroupIndicator as S, RadioGroupItem as C, RadioGroupRoot as w, useForwardPropsEmits as T, useId as E } from "reka-ui";
|
|
6
7
|
//#region src/components/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
8
|
+
var D = ["id"], O = ["id"], k = ["id"], A = /*@__PURE__*/ f({
|
|
8
9
|
__name: "RadioGroup",
|
|
9
10
|
props: {
|
|
10
11
|
items: {},
|
|
12
|
+
variant: {},
|
|
11
13
|
size: {},
|
|
12
14
|
invalid: {
|
|
13
15
|
type: Boolean,
|
|
@@ -36,37 +38,38 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
36
38
|
required: { type: Boolean }
|
|
37
39
|
},
|
|
38
40
|
emits: ["update:modelValue"],
|
|
39
|
-
setup(
|
|
40
|
-
let
|
|
41
|
-
let { items: e,
|
|
42
|
-
return
|
|
43
|
-
}),
|
|
41
|
+
setup(f, { emit: A }) {
|
|
42
|
+
let j = f, M = A, N = T(a(() => {
|
|
43
|
+
let { items: e, variant: t, size: n, invalid: r, unstyled: i, class: a, ui: o, ...s } = j;
|
|
44
|
+
return s;
|
|
45
|
+
}), M), P = a(() => (j.items ?? []).map((e) => typeof e == "string" ? {
|
|
44
46
|
label: e,
|
|
45
47
|
value: e
|
|
46
|
-
} : e)),
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"aria-
|
|
56
|
-
"aria-
|
|
57
|
-
|
|
48
|
+
} : e)), F = E(), I = n();
|
|
49
|
+
I && (I.id.value = void 0);
|
|
50
|
+
let L = a(() => j.invalid ?? I?.invalid.value ?? !1), R = e(), z = a(() => j.unstyled ?? R.unstyled), B = a(() => r({
|
|
51
|
+
variant: j.variant,
|
|
52
|
+
size: j.size,
|
|
53
|
+
orientation: j.orientation ?? "vertical",
|
|
54
|
+
invalid: L.value
|
|
55
|
+
})), V = a(() => z.value ? [j.ui?.root, j.class] : B.value.root({ class: [j.ui?.root, j.class] })), H = a(() => z.value ? j.ui?.item : B.value.item({ class: j.ui?.item })), U = a(() => z.value ? j.ui?.label : B.value.label({ class: j.ui?.label })), W = a(() => z.value ? j.ui?.description : B.value.description({ class: j.ui?.description })), G = a(() => z.value ? j.ui?.content : B.value.content({ class: j.ui?.content })), K = a(() => z.value ? j.ui?.mark : B.value.mark({ class: j.ui?.mark })), q = a(() => z.value ? j.ui?.icon : B.value.icon({ class: j.ui?.icon }));
|
|
56
|
+
return (e, n) => (h(), o(y(w), p(y(N), {
|
|
57
|
+
"aria-labelledby": y(I)?.labelId.value,
|
|
58
|
+
"aria-invalid": L.value || void 0,
|
|
59
|
+
"aria-describedby": y(I)?.describedBy.value,
|
|
60
|
+
class: V.value
|
|
58
61
|
}), {
|
|
59
|
-
default:
|
|
60
|
-
key:
|
|
61
|
-
class:
|
|
62
|
-
}, [
|
|
63
|
-
id: `${
|
|
62
|
+
default: b(() => [_(e.$slots, "default", {}, () => [(h(!0), c(i, null, g(P.value, (e) => (h(), c(i, { key: e.value }, [(j.variant ?? "radio") === "radio" ? (h(), c("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: m(z.value ? void 0 : B.value.wrapper())
|
|
65
|
+
}, [d(y(C), {
|
|
66
|
+
id: `${y(F)}-${e.value}`,
|
|
64
67
|
value: e.value,
|
|
65
68
|
disabled: e.disabled,
|
|
66
|
-
"aria-describedby": e.description ? `${
|
|
67
|
-
class:
|
|
69
|
+
"aria-describedby": e.description ? `${y(F)}-${e.value}-description` : void 0,
|
|
70
|
+
class: m(H.value)
|
|
68
71
|
}, {
|
|
69
|
-
default:
|
|
72
|
+
default: b(() => [d(y(S), { class: m(z.value ? void 0 : B.value.indicator()) }, null, 8, ["class"])]),
|
|
70
73
|
_: 1
|
|
71
74
|
}, 8, [
|
|
72
75
|
"id",
|
|
@@ -74,17 +77,48 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
74
77
|
"disabled",
|
|
75
78
|
"aria-describedby",
|
|
76
79
|
"class"
|
|
77
|
-
]),
|
|
78
|
-
for: `${
|
|
79
|
-
class:
|
|
80
|
+
]), l("div", { class: m(G.value) }, [d(y(x), {
|
|
81
|
+
for: `${y(F)}-${e.value}`,
|
|
82
|
+
class: m(U.value)
|
|
80
83
|
}, {
|
|
81
|
-
default:
|
|
84
|
+
default: b(() => [u(v(e.label), 1)]),
|
|
82
85
|
_: 2
|
|
83
|
-
}, 1032, ["for", "class"]), e.description ? (
|
|
86
|
+
}, 1032, ["for", "class"]), e.description ? (h(), c("p", {
|
|
84
87
|
key: 0,
|
|
85
|
-
id: `${
|
|
86
|
-
class:
|
|
87
|
-
},
|
|
88
|
+
id: `${y(F)}-${e.value}-description`,
|
|
89
|
+
class: m(W.value)
|
|
90
|
+
}, v(e.description), 11, D)) : s("", !0)], 2)], 2)) : (h(), o(y(C), {
|
|
91
|
+
key: 1,
|
|
92
|
+
value: e.value,
|
|
93
|
+
disabled: e.disabled,
|
|
94
|
+
"aria-labelledby": `${y(F)}-${e.value}-label`,
|
|
95
|
+
"aria-describedby": e.description ? `${y(F)}-${e.value}-description` : void 0,
|
|
96
|
+
class: m([H.value, "group/item"])
|
|
97
|
+
}, {
|
|
98
|
+
default: b(() => [j.variant === "card" ? (h(), c("span", {
|
|
99
|
+
key: 0,
|
|
100
|
+
class: m(K.value)
|
|
101
|
+
}, [d(y(S), { class: m(z.value ? void 0 : B.value.indicator()) }, null, 8, ["class"])], 2)) : e.icon ? (h(), o(t, {
|
|
102
|
+
key: 1,
|
|
103
|
+
icon: e.icon,
|
|
104
|
+
"data-slot": "icon",
|
|
105
|
+
class: m(q.value)
|
|
106
|
+
}, null, 8, ["icon", "class"])) : s("", !0), l("span", { class: m(G.value) }, [l("span", {
|
|
107
|
+
id: `${y(F)}-${e.value}-label`,
|
|
108
|
+
class: m(U.value)
|
|
109
|
+
}, v(e.label), 11, O), e.description ? (h(), c("span", {
|
|
110
|
+
key: 0,
|
|
111
|
+
id: `${y(F)}-${e.value}-description`,
|
|
112
|
+
class: m(W.value)
|
|
113
|
+
}, v(e.description), 11, k)) : s("", !0)], 2)]),
|
|
114
|
+
_: 2
|
|
115
|
+
}, 1032, [
|
|
116
|
+
"value",
|
|
117
|
+
"disabled",
|
|
118
|
+
"aria-labelledby",
|
|
119
|
+
"aria-describedby",
|
|
120
|
+
"class"
|
|
121
|
+
]))], 64))), 128))])]),
|
|
88
122
|
_: 3
|
|
89
123
|
}, 16, [
|
|
90
124
|
"aria-labelledby",
|
|
@@ -95,4 +129,4 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
95
129
|
}
|
|
96
130
|
});
|
|
97
131
|
//#endregion
|
|
98
|
-
export {
|
|
132
|
+
export { A as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import { useFormField as t } from "../composables/form.js";
|
|
3
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,
|
|
5
|
-
import { Label as
|
|
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, useSlots as _, withCtx as v } from "vue";
|
|
5
|
+
import { Label as y, SwitchRoot as b, SwitchThumb as x, useForwardPropsEmits as S, useId as C } from "reka-ui";
|
|
6
6
|
//#region src/components/Switch.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var w = ["id"], T = /*@__PURE__*/ u({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "Switch",
|
|
10
10
|
props: {
|
|
@@ -39,56 +39,56 @@ var C = ["id"], w = /*@__PURE__*/ u({
|
|
|
39
39
|
required: { type: Boolean }
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:modelValue"],
|
|
42
|
-
setup(u, { emit:
|
|
43
|
-
let
|
|
44
|
-
let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } =
|
|
42
|
+
setup(u, { emit: T }) {
|
|
43
|
+
let E = u, D = T, O = S(r(() => {
|
|
44
|
+
let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = E;
|
|
45
45
|
return c;
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
size:
|
|
50
|
-
withText:
|
|
51
|
-
invalid:
|
|
52
|
-
})),
|
|
53
|
-
return (e, t) =>
|
|
46
|
+
}), D), k = _(), A = C(), j = t(), M = r(() => E.invalid ?? j?.invalid.value ?? !1), N = r(() => E.id ?? j?.id.value ?? A);
|
|
47
|
+
j && (j.id.value = N.value);
|
|
48
|
+
let P = r(() => !!(E.description || k.description)), F = r(() => !!(E.label || k.label || P.value)), I = r(() => P.value ? `${N.value}-description` : void 0), L = e(), R = r(() => E.unstyled ?? L.unstyled), z = r(() => n({
|
|
49
|
+
size: E.size,
|
|
50
|
+
withText: F.value,
|
|
51
|
+
invalid: M.value
|
|
52
|
+
})), B = r(() => R.value ? E.ui?.wrapper : z.value.wrapper({ class: E.ui?.wrapper })), V = r(() => R.value ? [E.ui?.root, E.class] : z.value.root({ class: [E.ui?.root, E.class] })), H = r(() => R.value ? E.ui?.thumb : z.value.thumb({ class: E.ui?.thumb })), U = r(() => R.value ? E.ui?.content : z.value.content({ class: E.ui?.content })), W = r(() => R.value ? E.ui?.label : z.value.label({ class: E.ui?.label })), G = r(() => R.value ? E.ui?.description : z.value.description({ class: E.ui?.description }));
|
|
53
|
+
return (e, t) => F.value ? (p(), o("div", {
|
|
54
54
|
key: 0,
|
|
55
|
-
class: f(
|
|
56
|
-
}, [l(g(
|
|
57
|
-
...g(
|
|
55
|
+
class: f(B.value)
|
|
56
|
+
}, [l(g(b), d({ id: N.value }, {
|
|
57
|
+
...g(O),
|
|
58
58
|
...e.$attrs
|
|
59
59
|
}, {
|
|
60
|
-
"aria-invalid":
|
|
61
|
-
"aria-describedby":
|
|
62
|
-
class:
|
|
60
|
+
"aria-invalid": M.value || void 0,
|
|
61
|
+
"aria-describedby": I.value,
|
|
62
|
+
class: V.value
|
|
63
63
|
}), {
|
|
64
|
-
default:
|
|
64
|
+
default: v(() => [l(g(x), { class: f(H.value) }, null, 8, ["class"])]),
|
|
65
65
|
_: 1
|
|
66
66
|
}, 16, [
|
|
67
67
|
"id",
|
|
68
68
|
"aria-invalid",
|
|
69
69
|
"aria-describedby",
|
|
70
70
|
"class"
|
|
71
|
-
]), s("div", { class: f(
|
|
72
|
-
for:
|
|
73
|
-
class: f(
|
|
71
|
+
]), s("div", { class: f(U.value) }, [l(g(y), {
|
|
72
|
+
for: N.value,
|
|
73
|
+
class: f(W.value)
|
|
74
74
|
}, {
|
|
75
|
-
default:
|
|
75
|
+
default: v(() => [m(e.$slots, "label", {}, () => [c(h(E.label), 1)])]),
|
|
76
76
|
_: 3
|
|
77
|
-
}, 8, ["for", "class"]),
|
|
77
|
+
}, 8, ["for", "class"]), P.value ? (p(), o("p", {
|
|
78
78
|
key: 0,
|
|
79
|
-
id: `${
|
|
80
|
-
class: f(
|
|
81
|
-
}, [m(e.$slots, "description", {}, () => [c(h(
|
|
79
|
+
id: `${N.value}-description`,
|
|
80
|
+
class: f(G.value)
|
|
81
|
+
}, [m(e.$slots, "description", {}, () => [c(h(E.description), 1)])], 10, w)) : a("", !0)], 2)], 2)) : (p(), i(g(b), d({
|
|
82
82
|
key: 1,
|
|
83
|
-
id:
|
|
83
|
+
id: N.value
|
|
84
84
|
}, {
|
|
85
|
-
...g(
|
|
85
|
+
...g(O),
|
|
86
86
|
...e.$attrs
|
|
87
87
|
}, {
|
|
88
|
-
"aria-invalid":
|
|
89
|
-
class:
|
|
88
|
+
"aria-invalid": M.value || void 0,
|
|
89
|
+
class: V.value
|
|
90
90
|
}), {
|
|
91
|
-
default:
|
|
91
|
+
default: v(() => [l(g(x), { class: f(H.value) }, null, 8, ["class"])]),
|
|
92
92
|
_: 1
|
|
93
93
|
}, 16, [
|
|
94
94
|
"id",
|
|
@@ -98,4 +98,4 @@ var C = ["id"], w = /*@__PURE__*/ u({
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
//#endregion
|
|
101
|
-
export {
|
|
101
|
+
export { T as default };
|
|
@@ -14,6 +14,7 @@ export { default as Button } from './Button.vue';
|
|
|
14
14
|
export { default as ButtonGroup } from './ButtonGroup.vue';
|
|
15
15
|
export { default as Calendar } from './Calendar.vue';
|
|
16
16
|
export { default as Card } from './Card.vue';
|
|
17
|
+
export { default as Carousel } from './Carousel.vue';
|
|
17
18
|
export { default as ChartLegend } from './ChartLegend.vue';
|
|
18
19
|
export { default as Checkbox } from './Checkbox.vue';
|
|
19
20
|
export { default as Collapsible } from './Collapsible.vue';
|