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.
@@ -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 C } from "reka-ui";
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 = ["id"], T = {
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
- }, E = /*@__PURE__*/ u({
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 E = u, D = y(), O = C(), k = r(() => !!(E.label || D.label)), A = r(() => (E.segments?.length ?? 0) > 0), j = r(() => !A.value && (E.indeterminate || E.modelValue == null)), M = r(() => {
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 (E.segments ?? []).map((t) => {
38
- let n = Math.max(t.value, 0), r = Math.max(E.max - e, 0), i = Math.min(n, r);
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: E.max > 0 ? i / E.max * 100 : 0
44
+ percent: O.max > 0 ? i / O.max * 100 : 0
43
45
  };
44
46
  });
45
- }), N = r(() => M.value.reduce((e, t) => e + t.value, 0)), P = r(() => M.value.filter((e) => e.label)), F = r(() => j.value ? null : A.value ? Math.min(N.value, E.max) : Math.min(Math.max(E.modelValue ?? 0, 0), E.max)), I = r(() => F.value == null ? 0 : F.value / E.max * 100), L = r(() => {
46
- if (F.value != null) return E.formatValue ? E.formatValue(F.value, E.max) : `${Math.round(I.value)}%`;
47
- }), R = r(() => !!(E.label || E.showValue && L.value)), z = e(), B = r(() => E.unstyled ?? z.unstyled), V = r(() => t({
48
- variant: E.variant,
49
- size: E.size,
50
- indeterminate: j.value
51
- })), H = r(() => B.value ? [E.ui?.root, E.class] : V.value.root({ class: [E.ui?.root, E.class] })), U = r(() => B.value ? E.ui?.header : V.value.header({ class: E.ui?.header })), W = r(() => B.value ? E.ui?.label : V.value.label({ class: E.ui?.label })), G = r(() => B.value ? E.ui?.value : V.value.value({ class: E.ui?.value })), K = r(() => B.value ? E.ui?.track : V.value.track({ class: E.ui?.track })), q = r(() => B.value ? E.ui?.indicator : V.value.indicator({ class: E.ui?.indicator })), J = r(() => B.value ? E.ui?.legend : V.value.legend({ class: E.ui?.legend })), Y = r(() => B.value ? E.ui?.legendItem : V.value.legendItem({ class: E.ui?.legendItem })), X = r(() => B.value ? E.ui?.legendValue : V.value.legendValue({ class: E.ui?.legendValue }));
52
- function Z(e) {
53
- return B.value ? E.ui?.segment : t({ variant: e ?? "neutral" }).segment({ class: E.ui?.segment });
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 Q(e) {
56
- return B.value ? E.ui?.legendSwatch : t({ variant: e ?? "neutral" }).legendSwatch({ class: E.ui?.legendSwatch });
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(() => j.value ? void 0 : { transform: `translateX(-${100 - I.value}%)` });
59
- return (e, t) => (m(), o("div", { class: f(H.value) }, [
60
- R.value ? (m(), o("div", {
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(U.value)
63
- }, [k.value ? (m(), o("span", {
118
+ class: f(G.value)
119
+ }, [A.value ? (m(), o("span", {
64
120
  key: 0,
65
- id: v(O),
66
- class: f(W.value)
67
- }, [g(e.$slots, "label", {}, () => [c(_(E.label), 1)])], 10, w)) : a("", !0), E.showValue && L.value ? (m(), o("span", {
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(G.value)
125
+ class: f(q.value)
70
126
  }, [g(e.$slots, "value", {
71
- value: F.value,
72
- percent: I.value,
73
- formatted: L.value
74
- }, () => [c(_(L.value), 1)])], 2)) : a("", !0)], 2)) : a("", !0),
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": F.value,
77
- max: E.max,
78
- "get-value-label": () => L.value ?? "",
79
- "aria-labelledby": k.value ? v(O) : void 0
80
- }, e.$attrs, { class: K.value }), {
81
- default: b(() => [A.value ? (m(), o("div", T, [(m(!0), o(n, null, h(M.value, (e, t) => (m(), o("div", {
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(Z(e.variant)),
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(q.value),
88
- style: p($.value)
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
- P.value.length ? (m(), o("ul", {
154
+ I.value.length ? (m(), o("ul", {
99
155
  key: 1,
100
- class: f(J.value)
101
- }, [(m(!0), o(n, null, h(P.value, (e, t) => (m(), o("li", {
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(Y.value)
159
+ class: f(de.value)
104
160
  }, [
105
- s("span", { class: f(Q(e.variant)) }, null, 2),
161
+ s("span", { class: f(me(e.variant)) }, null, 2),
106
162
  s("span", null, _(e.label), 1),
107
- s("span", { class: f(X.value) }, _(E.formatValue ? E.formatValue(e.value, E.max) : `${Math.round(e.value / E.max * 100)}%`), 3)
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 { E as default };
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 { 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";
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 E = ["id"], D = /*@__PURE__*/ d({
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(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" ? {
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)), 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
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: y(() => [g(e.$slots, "default", {}, () => [(m(!0), s(r, null, h(j.value, (e) => (m(), s("div", {
60
- key: e.value,
61
- class: p(I.value ? void 0 : L.value.wrapper())
62
- }, [u(v(S), {
63
- id: `${v(M)}-${e.value}`,
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 ? `${v(M)}-${e.value}-description` : void 0,
67
- class: p(z.value)
69
+ "aria-describedby": e.description ? `${y(F)}-${e.value}-description` : void 0,
70
+ class: m(H.value)
68
71
  }, {
69
- default: y(() => [u(v(x), { class: p(I.value ? void 0 : L.value.indicator()) }, null, 8, ["class"])]),
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
- ]), 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)
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: y(() => [l(_(e.label), 1)]),
84
+ default: b(() => [u(v(e.label), 1)]),
82
85
  _: 2
83
- }, 1032, ["for", "class"]), e.description ? (m(), s("p", {
86
+ }, 1032, ["for", "class"]), e.description ? (h(), c("p", {
84
87
  key: 0,
85
- id: `${v(M)}-${e.value}-description`,
86
- class: p(V.value)
87
- }, _(e.description), 11, E)) : o("", !0)], 2)], 2))), 128))])]),
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 { D as default };
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, withCtx as _ } from "vue";
5
- import { Label as v, SwitchRoot as y, SwitchThumb as b, useForwardPropsEmits as x, useId as S } from "reka-ui";
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 C = ["id"], w = /*@__PURE__*/ u({
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: 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;
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
- }), 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
+ }), 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(I.value)
56
- }, [l(g(y), d({ id: j.value }, {
57
- ...g(D),
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": A.value || void 0,
61
- "aria-describedby": T.description ? `${j.value}-description` : void 0,
62
- class: L.value
60
+ "aria-invalid": M.value || void 0,
61
+ "aria-describedby": I.value,
62
+ class: V.value
63
63
  }), {
64
- default: _(() => [l(g(b), { class: f(R.value) }, null, 8, ["class"])]),
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(z.value) }, [l(g(v), {
72
- for: j.value,
73
- class: f(B.value)
71
+ ]), s("div", { class: f(U.value) }, [l(g(y), {
72
+ for: N.value,
73
+ class: f(W.value)
74
74
  }, {
75
- default: _(() => [m(e.$slots, "label", {}, () => [c(h(T.label), 1)])]),
75
+ default: v(() => [m(e.$slots, "label", {}, () => [c(h(E.label), 1)])]),
76
76
  _: 3
77
- }, 8, ["for", "class"]), T.description || e.$slots.description ? (p(), o("p", {
77
+ }, 8, ["for", "class"]), P.value ? (p(), o("p", {
78
78
  key: 0,
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({
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: j.value
83
+ id: N.value
84
84
  }, {
85
- ...g(D),
85
+ ...g(O),
86
86
  ...e.$attrs
87
87
  }, {
88
- "aria-invalid": A.value || void 0,
89
- class: L.value
88
+ "aria-invalid": M.value || void 0,
89
+ class: V.value
90
90
  }), {
91
- default: _(() => [l(g(b), { class: f(R.value) }, null, 8, ["class"])]),
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 { w as default };
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';