iryx-ui 0.21.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,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 };
@@ -1,96 +1,99 @@
1
1
  export declare const checkboxTheme: import("tailwind-variants").TVReturnType<{
2
- size: {
3
- sm: {
2
+ variant: {
3
+ checkbox: {
4
4
  root: string;
5
- indicator: string;
6
5
  };
7
- md: {
6
+ card: {
8
7
  root: string;
9
- indicator: string;
10
8
  };
11
- lg: {
9
+ tile: {
12
10
  root: string;
13
- indicator: string;
11
+ content: string;
14
12
  };
15
13
  };
14
+ size: {
15
+ sm: {};
16
+ md: {};
17
+ lg: {};
18
+ };
16
19
  withText: {
17
- true: {
18
- root: string;
19
- };
20
+ true: {};
20
21
  };
21
22
  invalid: {
22
- true: {
23
- root: string;
24
- };
23
+ true: {};
25
24
  };
26
25
  }, {
27
26
  wrapper: string;
28
27
  root: string;
28
+ mark: string;
29
29
  indicator: string;
30
+ icon: string;
30
31
  content: string;
31
32
  label: string;
32
33
  description: string;
33
34
  }, undefined, {
34
- size: {
35
- sm: {
35
+ variant: {
36
+ checkbox: {
36
37
  root: string;
37
- indicator: string;
38
38
  };
39
- md: {
39
+ card: {
40
40
  root: string;
41
- indicator: string;
42
41
  };
43
- lg: {
42
+ tile: {
44
43
  root: string;
45
- indicator: string;
44
+ content: string;
46
45
  };
47
46
  };
47
+ size: {
48
+ sm: {};
49
+ md: {};
50
+ lg: {};
51
+ };
48
52
  withText: {
49
- true: {
50
- root: string;
51
- };
53
+ true: {};
52
54
  };
53
55
  invalid: {
54
- true: {
55
- root: string;
56
- };
56
+ true: {};
57
57
  };
58
58
  }, {
59
59
  wrapper: string;
60
60
  root: string;
61
+ mark: string;
61
62
  indicator: string;
63
+ icon: string;
62
64
  content: string;
63
65
  label: string;
64
66
  description: string;
65
67
  }, import("tailwind-variants").TVReturnTypeLike<{
66
- size: {
67
- sm: {
68
+ variant: {
69
+ checkbox: {
68
70
  root: string;
69
- indicator: string;
70
71
  };
71
- md: {
72
+ card: {
72
73
  root: string;
73
- indicator: string;
74
74
  };
75
- lg: {
75
+ tile: {
76
76
  root: string;
77
- indicator: string;
77
+ content: string;
78
78
  };
79
79
  };
80
+ size: {
81
+ sm: {};
82
+ md: {};
83
+ lg: {};
84
+ };
80
85
  withText: {
81
- true: {
82
- root: string;
83
- };
86
+ true: {};
84
87
  };
85
88
  invalid: {
86
- true: {
87
- root: string;
88
- };
89
+ true: {};
89
90
  };
90
91
  }, {
91
92
  wrapper: string;
92
93
  root: string;
94
+ mark: string;
93
95
  indicator: string;
96
+ icon: string;
94
97
  content: string;
95
98
  label: string;
96
99
  description: string;
@@ -3,36 +3,138 @@ import { tv as e } from "tailwind-variants";
3
3
  var t = e({
4
4
  slots: {
5
5
  wrapper: "flex items-start gap-2.5",
6
- root: "peer flex shrink-0 cursor-pointer items-center justify-center rounded border border-border bg-background text-primary-foreground transition-[color,background-color,border-color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary",
6
+ root: "peer cursor-pointer transition-[color,background-color,border-color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50",
7
+ mark: "flex shrink-0 items-center justify-center rounded border border-border bg-background text-primary-foreground transition-[color,background-color,border-color] group-data-[state=checked]/item:border-primary group-data-[state=checked]/item:bg-primary group-data-[state=indeterminate]/item:border-primary group-data-[state=indeterminate]/item:bg-primary",
7
8
  indicator: "flex items-center justify-center text-current",
9
+ icon: "text-muted-foreground transition-colors",
8
10
  content: "grid gap-1",
9
11
  label: "text-sm leading-5 font-medium text-foreground select-none",
10
12
  description: "text-sm leading-snug text-muted-foreground"
11
13
  },
12
14
  variants: {
15
+ variant: {
16
+ checkbox: { root: "flex shrink-0 items-center justify-center rounded border border-border bg-background text-primary-foreground data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary" },
17
+ card: { root: "flex w-full items-start gap-3 rounded-lg border border-border bg-background text-left hover:bg-accent/50 data-[state=checked]:border-primary data-[state=checked]:bg-primary/5 data-[state=indeterminate]:border-primary" },
18
+ tile: {
19
+ root: "flex w-full flex-col items-center gap-2 rounded-lg border border-border bg-background text-center hover:bg-accent/50 data-[state=checked]:border-primary data-[state=checked]:bg-primary/5 data-[state=checked]:[&_[data-slot=icon]]:text-primary",
20
+ content: "justify-items-center gap-0.5"
21
+ }
22
+ },
13
23
  size: {
14
- sm: {
24
+ sm: {},
25
+ md: {},
26
+ lg: {}
27
+ },
28
+ withText: { true: {} },
29
+ invalid: { true: {} }
30
+ },
31
+ compoundVariants: [
32
+ {
33
+ variant: "checkbox",
34
+ size: "sm",
35
+ class: {
15
36
  root: "size-3.5",
16
37
  indicator: "[&_svg]:size-2.5"
17
- },
18
- md: {
38
+ }
39
+ },
40
+ {
41
+ variant: "checkbox",
42
+ size: "md",
43
+ class: {
19
44
  root: "size-4",
20
45
  indicator: "[&_svg]:size-3"
21
- },
22
- lg: {
46
+ }
47
+ },
48
+ {
49
+ variant: "checkbox",
50
+ size: "lg",
51
+ class: {
23
52
  root: "size-5",
24
53
  indicator: "[&_svg]:size-3.5"
25
54
  }
26
55
  },
27
- withText: { true: { root: "mt-0.5" } },
28
- invalid: { true: { root: "border-red-500 focus-visible:ring-red-500/40" } }
29
- },
30
- compoundVariants: [{
31
- size: "lg",
32
- withText: !0,
33
- class: { root: "mt-0" }
34
- }],
35
- defaultVariants: { size: "md" }
56
+ {
57
+ variant: "checkbox",
58
+ withText: !0,
59
+ class: { root: "mt-0.5" }
60
+ },
61
+ {
62
+ variant: "checkbox",
63
+ size: "lg",
64
+ withText: !0,
65
+ class: { root: "mt-0" }
66
+ },
67
+ {
68
+ variant: "checkbox",
69
+ invalid: !0,
70
+ class: { root: "border-red-500 focus-visible:ring-red-500/40" }
71
+ },
72
+ {
73
+ variant: "card",
74
+ size: "sm",
75
+ class: {
76
+ root: "p-3",
77
+ mark: "mt-0.5 size-3.5",
78
+ indicator: "[&_svg]:size-2.5"
79
+ }
80
+ },
81
+ {
82
+ variant: "card",
83
+ size: "md",
84
+ class: {
85
+ root: "p-4",
86
+ mark: "mt-0.5 size-4",
87
+ indicator: "[&_svg]:size-3"
88
+ }
89
+ },
90
+ {
91
+ variant: "card",
92
+ size: "lg",
93
+ class: {
94
+ root: "p-5",
95
+ mark: "size-5",
96
+ indicator: "[&_svg]:size-3.5"
97
+ }
98
+ },
99
+ {
100
+ variant: "card",
101
+ invalid: !0,
102
+ class: { root: "border-red-500 focus-visible:ring-red-500/40" }
103
+ },
104
+ {
105
+ variant: "tile",
106
+ size: "sm",
107
+ class: {
108
+ root: "p-3",
109
+ icon: "size-5"
110
+ }
111
+ },
112
+ {
113
+ variant: "tile",
114
+ size: "md",
115
+ class: {
116
+ root: "p-4",
117
+ icon: "size-6"
118
+ }
119
+ },
120
+ {
121
+ variant: "tile",
122
+ size: "lg",
123
+ class: {
124
+ root: "p-5",
125
+ icon: "size-7"
126
+ }
127
+ },
128
+ {
129
+ variant: "tile",
130
+ invalid: !0,
131
+ class: { root: "border-red-500 focus-visible:ring-red-500/40" }
132
+ }
133
+ ],
134
+ defaultVariants: {
135
+ variant: "checkbox",
136
+ size: "md"
137
+ }
36
138
  });
37
139
  //#endregion
38
140
  export { t as checkboxTheme };
@@ -33,8 +33,14 @@ export interface ThemeColors {
33
33
  }
34
34
  /** A theme provides token values per appearance mode. Omitted tokens keep the defaults from theme.css. */
35
35
  export interface Theme {
36
- light: ThemeColors;
37
- dark: ThemeColors;
36
+ light?: ThemeColors;
37
+ dark?: ThemeColors;
38
+ /**
39
+ * Corner radius for the whole library — what `rounded-lg` resolves to, with
40
+ * the rest of the scale derived from it. One value rather than one per mode:
41
+ * corners do not change between light and dark.
42
+ */
43
+ radius?: string;
38
44
  }
39
45
  /**
40
46
  * Built-in theme presets. Each swaps only the brand primary (solid colour +
@@ -66,8 +66,8 @@ function r(t) {
66
66
  }
67
67
  function i(e) {
68
68
  if (typeof document > "u") return;
69
- let i = typeof e == "string" ? t[e] : e, a = document.getElementById(n);
70
- a || (a = document.createElement("style"), a.id = n, document.head.appendChild(a)), a.textContent = `:root { ${r(i.light)} }\n.dark { ${r(i.dark)} }`;
69
+ let i = typeof e == "string" ? t[e] : e, a = i.radius == null ? "" : `--iryx-radius: ${i.radius}; `, o = document.getElementById(n);
70
+ o || (o = document.createElement("style"), o.id = n, document.head.appendChild(o)), o.textContent = `:root { ${a}${r(i.light ?? {})} }\n.dark { ${r(i.dark ?? {})} }`;
71
71
  }
72
72
  function a() {
73
73
  typeof document > "u" || document.getElementById(n)?.remove();