iryx-ui 0.18.2 → 0.18.4

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.
Files changed (37) hide show
  1. package/dist/components/Checkbox.vue.d.ts +3 -0
  2. package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +59 -42
  3. package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +3 -1
  4. package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +2 -1
  5. package/dist/components/DateField.vue_vue_type_script_setup_true_lang.js +3 -1
  6. package/dist/components/DatePicker.vue_vue_type_script_setup_true_lang.js +3 -1
  7. package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +65 -63
  8. package/dist/components/Editable.vue_vue_type_script_setup_true_lang.js +7 -2
  9. package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +3 -1
  10. package/dist/components/FormField.vue_vue_type_script_setup_true_lang.js +50 -47
  11. package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +6 -4
  12. package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +3 -1
  13. package/dist/components/PinInput.vue.d.ts +1 -0
  14. package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +40 -32
  15. package/dist/components/RadioGroup.vue.d.ts +3 -0
  16. package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +49 -31
  17. package/dist/components/Select.vue.d.ts +3 -0
  18. package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +65 -46
  19. package/dist/components/SignaturePad.vue_vue_type_script_setup_true_lang.js +3 -1
  20. package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +58 -53
  21. package/dist/components/Switch.vue.d.ts +3 -0
  22. package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +50 -33
  23. package/dist/components/TagsInput.vue_vue_type_script_setup_true_lang.js +3 -1
  24. package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +5 -3
  25. package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +3 -1
  26. package/dist/composables/form.d.ts +8 -1
  27. package/dist/index.js +9 -9
  28. package/dist/theme/checkbox.d.ts +15 -0
  29. package/dist/theme/checkbox.js +2 -1
  30. package/dist/theme/radio-group.d.ts +15 -0
  31. package/dist/theme/radio-group.js +2 -1
  32. package/dist/theme/select.d.ts +15 -0
  33. package/dist/theme/select.js +8 -5
  34. package/dist/theme/switch.d.ts +15 -0
  35. package/dist/theme/switch.js +2 -1
  36. package/dist/theme/timeline.js +5 -5
  37. package/package.json +1 -1
@@ -7,6 +7,8 @@ export interface CheckboxProps extends CheckboxRootProps {
7
7
  description?: string;
8
8
  size?: 'sm' | 'md' | 'lg';
9
9
  id?: string;
10
+ /** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
11
+ invalid?: boolean;
10
12
  /** Skip built-in classes; you take over styling entirely. */
11
13
  unstyled?: boolean;
12
14
  class?: ClassValue;
@@ -36,6 +38,7 @@ declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {}, {}, {
36
38
  "onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
37
39
  }>, {
38
40
  unstyled: boolean;
41
+ invalid: boolean;
39
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
43
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
44
  declare const _default: typeof __VLS_export;
@@ -1,11 +1,12 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
- import { checkboxTheme as n } from "../theme/checkbox.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 { MinusSignIcon as v, Tick02Icon as y } from "@hugeicons/core-free-icons";
6
- import { CheckboxIndicator as b, CheckboxRoot as x, Label as S, useForwardPropsEmits as C, useId as w } from "reka-ui";
3
+ import { useFormField as n } from "../composables/form.js";
4
+ import { checkboxTheme as r } from "../theme/checkbox.js";
5
+ import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
6
+ import { MinusSignIcon as y, Tick02Icon as b } from "@hugeicons/core-free-icons";
7
+ import { CheckboxIndicator as x, CheckboxRoot as S, Label as C, useForwardPropsEmits as w, useId as T } from "reka-ui";
7
8
  //#region src/components/Checkbox.vue?vue&type=script&setup=true&lang.ts
8
- var T = ["id"], E = /*@__PURE__*/ u({
9
+ var E = ["id"], D = /*@__PURE__*/ d({
9
10
  inheritAttrs: !1,
10
11
  __name: "Checkbox",
11
12
  props: {
@@ -13,6 +14,10 @@ var T = ["id"], E = /*@__PURE__*/ u({
13
14
  description: {},
14
15
  size: {},
15
16
  id: {},
17
+ invalid: {
18
+ type: Boolean,
19
+ default: void 0
20
+ },
16
21
  unstyled: {
17
22
  type: Boolean,
18
23
  default: void 0
@@ -36,69 +41,81 @@ var T = ["id"], E = /*@__PURE__*/ u({
36
41
  required: { type: Boolean }
37
42
  },
38
43
  emits: ["update:modelValue"],
39
- setup(u, { emit: E }) {
40
- let D = u, O = E, k = C(r(() => {
41
- let { label: e, description: t, size: n, id: r, unstyled: i, class: a, ui: o, ...s } = D;
42
- return s;
43
- }), O), A = w(), j = r(() => D.id ?? A), M = r(() => !!(D.label || D.description)), N = e(), P = r(() => D.unstyled ?? N.unstyled), F = r(() => n({
44
- size: D.size,
45
- withText: M.value
46
- })), I = r(() => P.value ? D.ui?.wrapper : F.value.wrapper({ class: D.ui?.wrapper })), L = r(() => P.value ? [D.ui?.root, D.class] : F.value.root({ class: [D.ui?.root, D.class] })), R = r(() => P.value ? D.ui?.indicator : F.value.indicator({ class: D.ui?.indicator })), z = r(() => P.value ? D.ui?.content : F.value.content({ class: D.ui?.content })), B = r(() => P.value ? D.ui?.label : F.value.label({ class: D.ui?.label })), V = r(() => P.value ? D.ui?.description : F.value.description({ class: D.ui?.description }));
47
- return (e, n) => M.value ? (p(), o("div", {
44
+ setup(d, { emit: D }) {
45
+ let O = d, k = D, A = w(i(() => {
46
+ let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = O;
47
+ return c;
48
+ }), k), j = T(), M = n(), N = i(() => O.invalid ?? M?.invalid.value ?? !1), P = i(() => O.id ?? M?.id.value ?? j);
49
+ M && (M.id.value = P.value);
50
+ let F = i(() => !!(O.label || O.description)), I = e(), L = i(() => O.unstyled ?? I.unstyled), R = i(() => r({
51
+ size: O.size,
52
+ withText: F.value,
53
+ invalid: N.value
54
+ })), z = i(() => L.value ? O.ui?.wrapper : R.value.wrapper({ class: O.ui?.wrapper })), B = i(() => L.value ? [O.ui?.root, O.class] : R.value.root({ class: [O.ui?.root, O.class] })), V = i(() => L.value ? O.ui?.indicator : R.value.indicator({ class: O.ui?.indicator })), H = i(() => L.value ? O.ui?.content : R.value.content({ class: O.ui?.content })), U = i(() => L.value ? O.ui?.label : R.value.label({ class: O.ui?.label })), W = i(() => L.value ? O.ui?.description : R.value.description({ class: O.ui?.description }));
55
+ return (e, n) => F.value ? (m(), s("div", {
48
56
  key: 0,
49
- class: f(I.value)
50
- }, [l(g(x), d({ id: j.value }, {
51
- ...g(k),
57
+ class: p(z.value)
58
+ }, [u(_(S), f({ id: P.value }, {
59
+ ..._(A),
52
60
  ...e.$attrs
53
61
  }, {
54
- "aria-describedby": D.description ? `${j.value}-description` : void 0,
55
- class: L.value
62
+ "aria-invalid": N.value || void 0,
63
+ "aria-describedby": O.description ? `${P.value}-description` : void 0,
64
+ class: B.value
56
65
  }), {
57
- default: _(() => [l(g(b), { class: f(R.value) }, {
58
- default: _(() => [m(e.$slots, "default", {}, () => [D.modelValue === "indeterminate" ? (p(), i(t, {
66
+ default: v(() => [u(_(x), { class: p(V.value) }, {
67
+ default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
59
68
  key: 0,
60
- icon: g(v)
61
- }, null, 8, ["icon"])) : (p(), i(t, {
69
+ icon: _(y)
70
+ }, null, 8, ["icon"])) : (m(), a(t, {
62
71
  key: 1,
63
- icon: g(y)
72
+ icon: _(b)
64
73
  }, null, 8, ["icon"]))])]),
65
74
  _: 3
66
75
  }, 8, ["class"])]),
67
76
  _: 3
68
77
  }, 16, [
69
78
  "id",
79
+ "aria-invalid",
70
80
  "aria-describedby",
71
81
  "class"
72
- ]), s("div", { class: f(z.value) }, [l(g(S), {
73
- for: j.value,
74
- class: f(B.value)
82
+ ]), c("div", { class: p(H.value) }, [u(_(C), {
83
+ for: P.value,
84
+ class: p(U.value)
75
85
  }, {
76
- default: _(() => [m(e.$slots, "label", {}, () => [c(h(D.label), 1)])]),
86
+ default: v(() => [h(e.$slots, "label", {}, () => [l(g(O.label), 1)])]),
77
87
  _: 3
78
- }, 8, ["for", "class"]), D.description || e.$slots.description ? (p(), o("p", {
88
+ }, 8, ["for", "class"]), O.description || e.$slots.description ? (m(), s("p", {
79
89
  key: 0,
80
- id: `${j.value}-description`,
81
- class: f(V.value)
82
- }, [m(e.$slots, "description", {}, () => [c(h(D.description), 1)])], 10, T)) : a("", !0)], 2)], 2)) : (p(), i(g(x), d({
90
+ id: `${P.value}-description`,
91
+ class: p(W.value)
92
+ }, [h(e.$slots, "description", {}, () => [l(g(O.description), 1)])], 10, E)) : o("", !0)], 2)], 2)) : (m(), a(_(S), f({
83
93
  key: 1,
84
- id: D.id
94
+ id: P.value
85
95
  }, {
86
- ...g(k),
96
+ ..._(A),
87
97
  ...e.$attrs
88
- }, { class: L.value }), {
89
- default: _(() => [l(g(b), { class: f(R.value) }, {
90
- default: _(() => [m(e.$slots, "default", {}, () => [D.modelValue === "indeterminate" ? (p(), i(t, {
98
+ }, {
99
+ "aria-invalid": N.value || void 0,
100
+ class: B.value
101
+ }), {
102
+ default: v(() => [u(_(x), { class: p(V.value) }, {
103
+ default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
91
104
  key: 0,
92
- icon: g(v)
93
- }, null, 8, ["icon"])) : (p(), i(t, {
105
+ icon: _(y)
106
+ }, null, 8, ["icon"])) : (m(), a(t, {
94
107
  key: 1,
95
- icon: g(y)
108
+ icon: _(b)
96
109
  }, null, 8, ["icon"]))])]),
97
110
  _: 3
98
111
  }, 8, ["class"])]),
99
112
  _: 3
100
- }, 16, ["id", "class"]));
113
+ }, 16, [
114
+ "id",
115
+ "aria-invalid",
116
+ "class"
117
+ ]));
101
118
  }
102
119
  });
103
120
  //#endregion
104
- export { E as default };
121
+ export { D as default };
@@ -167,7 +167,9 @@ var E = /*@__PURE__*/ u({
167
167
  bubbles: !0
168
168
  }));
169
169
  }
170
- let q = n(), J = i(() => D.id ?? q?.id.value), Y = i(() => D.invalid ?? q?.invalid.value ?? !1), Oe = e(), X = i(() => D.unstyled ?? Oe.unstyled), Z = i(() => ee({
170
+ let q = n(), J = i(() => D.id ?? q?.id.value);
171
+ q && D.id && (q.id.value = D.id);
172
+ let Y = i(() => D.invalid ?? q?.invalid.value ?? !1), Oe = e(), X = i(() => D.unstyled ?? Oe.unstyled), Z = i(() => ee({
171
173
  size: D.size,
172
174
  chips: H.value,
173
175
  invalid: Y.value,
@@ -79,7 +79,8 @@ var B = /*@__PURE__*/ h({
79
79
  default: O(() => [m(T(ne), null, {
80
80
  default: O(() => [m(T(te), { class: _($("overlay")) }, null, 8, ["class"]), m(T(ee), {
81
81
  class: _(Z.value ? [B.ui?.content, B.class] : Q.value.content({ class: [B.ui?.content, B.class] })),
82
- "aria-label": B.label
82
+ "aria-label": B.label,
83
+ "aria-describedby": void 0
83
84
  }, {
84
85
  default: O(() => [
85
86
  m(T(R), null, {
@@ -37,7 +37,9 @@ var y = /*@__PURE__*/ u({
37
37
  },
38
38
  emits: ["update:modelValue"],
39
39
  setup(u, { emit: y }) {
40
- let b = u, x = y, S = r(), C = o(() => b.id ?? S?.id.value), w = o(() => {
40
+ let b = u, x = y, S = r(), C = o(() => b.id ?? S?.id.value);
41
+ S && b.id && (S.id.value = b.id);
42
+ let w = o(() => {
41
43
  let e = b.modelValue;
42
44
  return !e || !t(e) ? !1 : b.minValue && e < b.minValue || b.maxValue && e > b.maxValue ? !0 : b.isUnavailable?.(e) ?? !1;
43
45
  }), T = o(() => (b.invalid ?? S?.invalid.value ?? !1) || w.value), E = e(), D = o(() => b.unstyled ?? E.unstyled), O = o(() => {
@@ -52,7 +52,9 @@ var D = [
52
52
  }),
53
53
  emits: ["update:modelValue"],
54
54
  setup(p) {
55
- let m = p, k = b(p, "modelValue"), A = _(!1), j = a(), M = s(() => m.id ?? j?.id.value), N = s(() => m.invalid ?? j?.invalid.value ?? !1), P = e(), F = s(() => m.unstyled ?? P.unstyled), I = s(() => n(k.value, m.locale, m.format));
55
+ let m = p, k = b(p, "modelValue"), A = _(!1), j = a(), M = s(() => m.id ?? j?.id.value);
56
+ j && m.id && (j.id.value = m.id);
57
+ let N = s(() => m.invalid ?? j?.invalid.value ?? !1), P = e(), F = s(() => m.unstyled ?? P.unstyled), I = s(() => n(k.value, m.locale, m.format));
56
58
  function L() {
57
59
  k.value = r(), A.value = !1;
58
60
  }
@@ -2,10 +2,10 @@ import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
3
  import { formatIsoDate as n, toCalendarDate as r, toIsoDate as i } from "../composables/date.js";
4
4
  import { calendarTheme as ee } from "../theme/calendar.js";
5
- import { useFormField as a } from "../composables/form.js";
6
- import { datePickerTheme as o } from "../theme/date-picker.js";
7
- import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, normalizeClass as _, openBlock as v, ref as y, renderList as b, shallowRef as x, toDisplayString as S, unref as C, useModel as w, watch as T, withCtx as E } from "vue";
8
- import { ArrowLeft01Icon as te, ArrowRight01Icon as ne, Calendar03Icon as re } from "@hugeicons/core-free-icons";
5
+ import { useFormField as te } from "../composables/form.js";
6
+ import { datePickerTheme as a } from "../theme/date-picker.js";
7
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, mergeModels as h, normalizeClass as g, openBlock as _, ref as v, renderList as y, shallowRef as b, toDisplayString as x, unref as S, useModel as C, watch as w, withCtx as T } from "vue";
8
+ import { ArrowLeft01Icon as E, ArrowRight01Icon as ne, Calendar03Icon as re } from "@hugeicons/core-free-icons";
9
9
  import { PopoverContent as D, PopoverPortal as O, PopoverRoot as k, PopoverTrigger as A, RangeCalendarCell as j, RangeCalendarCellTrigger as M, RangeCalendarGrid as N, RangeCalendarGridBody as P, RangeCalendarGridHead as F, RangeCalendarGridRow as I, RangeCalendarHeadCell as L, RangeCalendarHeader as R, RangeCalendarHeading as z, RangeCalendarNext as B, RangeCalendarPrev as V, RangeCalendarRoot as ie } from "reka-ui";
10
10
  //#region src/components/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
11
11
  var H = [
@@ -13,9 +13,9 @@ var H = [
13
13
  "disabled",
14
14
  "aria-invalid",
15
15
  "aria-describedby"
16
- ], U = { key: 0 }, W = /*@__PURE__*/ h({
16
+ ], U = { key: 0 }, W = /*@__PURE__*/ m({
17
17
  __name: "DateRangePicker",
18
- props: /*@__PURE__*/ g({
18
+ props: /*@__PURE__*/ h({
19
19
  size: {},
20
20
  placeholder: { default: "Pick a date range" },
21
21
  disabled: { type: Boolean },
@@ -54,30 +54,32 @@ var H = [
54
54
  modelModifiers: {}
55
55
  }),
56
56
  emits: ["update:modelValue"],
57
- setup(h) {
58
- let g = h, W = w(h, "modelValue"), G = y(!1), K = a(), q = c(() => g.id ?? K?.id.value), J = c(() => g.invalid ?? K?.invalid.value ?? !1), Y = e(), ae = c(() => g.unstyled ?? Y.unstyled), X = x({
57
+ setup(m) {
58
+ let h = m, W = C(m, "modelValue"), G = v(!1), K = te(), q = s(() => h.id ?? K?.id.value);
59
+ K && h.id && (K.id.value = h.id);
60
+ let J = s(() => h.invalid ?? K?.invalid.value ?? !1), Y = e(), ae = s(() => h.unstyled ?? Y.unstyled), X = b({
59
61
  start: r(W.value?.start),
60
62
  end: r(W.value?.end)
61
63
  });
62
64
  function Z(e) {
63
65
  return i(e.start) === (W.value?.start ?? null) && i(e.end) === (W.value?.end ?? null);
64
66
  }
65
- T(W, () => {
67
+ w(W, () => {
66
68
  Z(X.value) || (X.value = {
67
69
  start: r(W.value?.start),
68
70
  end: r(W.value?.end)
69
71
  });
70
- }, { deep: !0 }), T(X, (e) => {
72
+ }, { deep: !0 }), w(X, (e) => {
71
73
  Z(e) || (W.value = {
72
74
  start: i(e.start),
73
75
  end: i(e.end)
74
76
  });
75
77
  });
76
- let oe = c(() => r(g.min)), se = c(() => r(g.max)), Q = c(() => {
77
- let e = n(W.value?.start, g.locale, g.format), t = n(W.value?.end, g.locale, g.format);
78
- return !e && !t ? "" : t ? `${e}${g.separator}${t}` : e;
78
+ let oe = s(() => r(h.min)), se = s(() => r(h.max)), Q = s(() => {
79
+ let e = n(W.value?.start, h.locale, h.format), t = n(W.value?.end, h.locale, h.format);
80
+ return !e && !t ? "" : t ? `${e}${h.separator}${t}` : e;
79
81
  });
80
- T(W, (e) => {
82
+ w(W, (e) => {
81
83
  G.value && e?.start && e?.end && (G.value = !1);
82
84
  }, { deep: !0 });
83
85
  function ce() {
@@ -86,97 +88,97 @@ var H = [
86
88
  end: null
87
89
  }, G.value = !1;
88
90
  }
89
- let le = c(() => ({
90
- ...o({
91
- size: g.size,
91
+ let le = s(() => ({
92
+ ...a({
93
+ size: h.size,
92
94
  invalid: J.value
93
95
  }),
94
96
  ...ee({ range: !0 })
95
97
  }));
96
98
  function $(e, t) {
97
- let n = g.ui?.[e];
99
+ let n = h.ui?.[e];
98
100
  return ae.value ? [n, t] : le.value[e]({ class: [n, t] });
99
101
  }
100
- return (e, n) => (v(), l(C(k), {
102
+ return (e, n) => (_(), c(S(k), {
101
103
  open: G.value,
102
104
  "onUpdate:open": n[1] ||= (e) => G.value = e
103
105
  }, {
104
- default: E(() => [m(C(A), { "as-child": "" }, {
105
- default: E(() => [f("button", {
106
+ default: T(() => [p(S(A), { "as-child": "" }, {
107
+ default: T(() => [d("button", {
106
108
  id: q.value,
107
109
  type: "button",
108
- disabled: g.disabled,
110
+ disabled: h.disabled,
109
111
  "aria-invalid": J.value || void 0,
110
- "aria-describedby": C(K)?.describedBy.value,
111
- class: _($("trigger", g.class))
112
- }, [Q.value ? (v(), d("span", U, S(Q.value), 1)) : (v(), d("span", {
112
+ "aria-describedby": S(K)?.describedBy.value,
113
+ class: g($("trigger", h.class))
114
+ }, [Q.value ? (_(), u("span", U, x(Q.value), 1)) : (_(), u("span", {
113
115
  key: 1,
114
- class: _($("placeholder"))
115
- }, S(g.placeholder), 3)), m(t, { icon: C(re) }, null, 8, ["icon"])], 10, H)]),
116
+ class: g($("placeholder"))
117
+ }, x(h.placeholder), 3)), p(t, { icon: S(re) }, null, 8, ["icon"])], 10, H)]),
116
118
  _: 1
117
- }), m(C(O), null, {
118
- default: E(() => [m(C(D), {
119
- class: _($("content")),
119
+ }), p(S(O), null, {
120
+ default: T(() => [p(S(D), {
121
+ class: g($("content")),
120
122
  "side-offset": 4,
121
123
  align: "start"
122
124
  }, {
123
- default: E(() => [m(C(ie), {
125
+ default: T(() => [p(S(ie), {
124
126
  modelValue: X.value,
125
127
  "onUpdate:modelValue": n[0] ||= (e) => X.value = e,
126
128
  "min-value": oe.value,
127
129
  "max-value": se.value,
128
- locale: g.locale,
129
- "week-starts-on": g.weekStartsOn,
130
- "number-of-months": g.months,
130
+ locale: h.locale,
131
+ "week-starts-on": h.weekStartsOn,
132
+ "number-of-months": h.months,
131
133
  "fixed-weeks": "",
132
134
  "initial-focus": ""
133
135
  }, {
134
- default: E(({ grid: e, weekDays: n }) => [m(C(R), { class: _($("header")) }, {
135
- default: E(() => [
136
- m(C(V), {
137
- "aria-label": g.previousLabel,
138
- class: _($("nav"))
136
+ default: T(({ grid: e, weekDays: n }) => [p(S(R), { class: g($("header")) }, {
137
+ default: T(() => [
138
+ p(S(V), {
139
+ "aria-label": h.previousLabel,
140
+ class: g($("nav"))
139
141
  }, {
140
- default: E(() => [m(t, { icon: C(te) }, null, 8, ["icon"])]),
142
+ default: T(() => [p(t, { icon: S(E) }, null, 8, ["icon"])]),
141
143
  _: 1
142
144
  }, 8, ["aria-label", "class"]),
143
- m(C(z), { class: _($("heading")) }, null, 8, ["class"]),
144
- m(C(B), {
145
- "aria-label": g.nextLabel,
146
- class: _($("nav"))
145
+ p(S(z), { class: g($("heading")) }, null, 8, ["class"]),
146
+ p(S(B), {
147
+ "aria-label": h.nextLabel,
148
+ class: g($("nav"))
147
149
  }, {
148
- default: E(() => [m(t, { icon: C(ne) }, null, 8, ["icon"])]),
150
+ default: T(() => [p(t, { icon: S(ne) }, null, 8, ["icon"])]),
149
151
  _: 1
150
152
  }, 8, ["aria-label", "class"])
151
153
  ]),
152
154
  _: 1
153
- }, 8, ["class"]), f("div", { class: _($("months")) }, [(v(!0), d(s, null, b(e, (e) => (v(), l(C(N), {
155
+ }, 8, ["class"]), d("div", { class: g($("months")) }, [(_(!0), u(o, null, y(e, (e) => (_(), c(S(N), {
154
156
  key: e.value.toString(),
155
- class: _($("grid"))
157
+ class: g($("grid"))
156
158
  }, {
157
- default: E(() => [m(C(F), null, {
158
- default: E(() => [m(C(I), null, {
159
- default: E(() => [(v(!0), d(s, null, b(n, (e) => (v(), l(C(L), {
159
+ default: T(() => [p(S(F), null, {
160
+ default: T(() => [p(S(I), null, {
161
+ default: T(() => [(_(!0), u(o, null, y(n, (e) => (_(), c(S(L), {
160
162
  key: e,
161
- class: _($("headCell"))
163
+ class: g($("headCell"))
162
164
  }, {
163
- default: E(() => [p(S(e), 1)]),
165
+ default: T(() => [f(x(e), 1)]),
164
166
  _: 2
165
167
  }, 1032, ["class"]))), 128))]),
166
168
  _: 2
167
169
  }, 1024)]),
168
170
  _: 2
169
- }, 1024), m(C(P), null, {
170
- default: E(() => [(v(!0), d(s, null, b(e.rows, (t, n) => (v(), l(C(I), { key: `week-${n}` }, {
171
- default: E(() => [(v(!0), d(s, null, b(t, (t) => (v(), l(C(j), {
171
+ }, 1024), p(S(P), null, {
172
+ default: T(() => [(_(!0), u(o, null, y(e.rows, (t, n) => (_(), c(S(I), { key: `week-${n}` }, {
173
+ default: T(() => [(_(!0), u(o, null, y(t, (t) => (_(), c(S(j), {
172
174
  key: t.toString(),
173
175
  date: t,
174
- class: _($("cell"))
176
+ class: g($("cell"))
175
177
  }, {
176
- default: E(() => [m(C(M), {
178
+ default: T(() => [p(S(M), {
177
179
  day: t,
178
180
  month: e.value,
179
- class: _($("cellTrigger"))
181
+ class: g($("cellTrigger"))
180
182
  }, null, 8, [
181
183
  "day",
182
184
  "month",
@@ -198,14 +200,14 @@ var H = [
198
200
  "locale",
199
201
  "week-starts-on",
200
202
  "number-of-months"
201
- ]), g.clearable ? (v(), d("div", {
203
+ ]), h.clearable ? (_(), u("div", {
202
204
  key: 0,
203
- class: _($("footer"))
204
- }, [f("button", {
205
+ class: g($("footer"))
206
+ }, [d("button", {
205
207
  type: "button",
206
- class: _($("action")),
208
+ class: g($("action")),
207
209
  onClick: ce
208
- }, S(g.clearLabel), 3)], 2)) : u("", !0)]),
210
+ }, x(h.clearLabel), 3)], 2)) : l("", !0)]),
209
211
  _: 1
210
212
  }, 8, ["class"])]),
211
213
  _: 1
@@ -48,7 +48,9 @@ var E = /*@__PURE__*/ u({
48
48
  },
49
49
  emits: ["update:modelValue", "submit"],
50
50
  setup(u, { emit: E }) {
51
- let D = u, O = E, k = n(), A = a(() => D.id ?? k?.id.value), j = a(() => D.invalid ?? k?.invalid.value ?? !1), M = e(), N = a(() => D.unstyled ?? M.unstyled), P = a(() => r({
51
+ let D = u, O = E, k = n(), A = a(() => D.id ?? k?.id.value);
52
+ k && D.id && (k.id.value = D.id);
53
+ let j = a(() => D.invalid ?? k?.invalid.value ?? !1), M = e(), N = a(() => D.unstyled ?? M.unstyled), P = a(() => r({
52
54
  size: D.size,
53
55
  invalid: j.value
54
56
  }));
@@ -83,7 +85,10 @@ var E = /*@__PURE__*/ u({
83
85
  isEmpty: r
84
86
  })]),
85
87
  _: 2
86
- }, 1032, ["class"]), l(m(S), { class: d(F("input")) }, null, 8, ["class"])]),
88
+ }, 1032, ["class"]), l(m(S), {
89
+ id: A.value,
90
+ class: d(F("input"))
91
+ }, null, 8, ["id", "class"])]),
87
92
  _: 2
88
93
  }, 1032, ["class"]), D.controls ? (f(), c(i, { key: 0 }, [n ? (f(), c(i, { key: 1 }, [l(m(T), {
89
94
  "aria-label": D.submitLabel,
@@ -54,7 +54,9 @@ var D = [
54
54
  }),
55
55
  emits: /*@__PURE__*/ f(["reject"], ["update:modelValue"]),
56
56
  setup(d, { emit: f }) {
57
- let A = d, j = f, M = b(d, "modelValue"), N = r(), P = o(() => A.id ?? N?.id.value), F = o(() => A.invalid ?? N?.invalid.value ?? !1), I = e(), L = o(() => A.unstyled ?? I.unstyled), R = g([]);
57
+ let A = d, j = f, M = b(d, "modelValue"), N = r(), P = o(() => A.id ?? N?.id.value);
58
+ N && A.id && (N.id.value = A.id);
59
+ let F = o(() => A.invalid ?? N?.invalid.value ?? !1), I = e(), L = o(() => A.unstyled ?? I.unstyled), R = g([]);
58
60
  function z(e) {
59
61
  if (!A.accept) return !0;
60
62
  let t = e.name.toLowerCase(), n = e.type.toLowerCase();
@@ -2,10 +2,10 @@ import { useIryxUiConfig as e } from "../config.js";
2
2
  import { formFieldContextKey as t, getByPath as n, useForm as r } from "../composables/form.js";
3
3
  import { formFieldTheme as i } from "../theme/form.js";
4
4
  import a from "./Label.js";
5
- import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m, renderSlot as h, toDisplayString as g, unref as _, watch as v, withCtx as y } from "vue";
6
- import { useId as b } from "reka-ui";
5
+ import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
6
+ import { useId as x } from "reka-ui";
7
7
  //#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
8
- var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__*/ d({
8
+ var S = ["data-iryx-field"], C = ["id"], w = ["id"], T = ["id"], E = /*@__PURE__*/ d({
9
9
  __name: "FormField",
10
10
  props: {
11
11
  name: {},
@@ -28,73 +28,76 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
28
28
  ui: {}
29
29
  },
30
30
  setup(d) {
31
- let T = d, E = r(), D = b(), O = o(() => T.error ?? E?.errorFor(T.name)), k = o(() => {
31
+ let E = d, D = r(), O = x(), k = h(O), A = o(() => E.error ?? D?.errorFor(E.name)), j = o(() => {
32
32
  let e = [];
33
- return T.description && e.push(`${D}-description`), O.value ? e.push(`${D}-error`) : T.help && e.push(`${D}-help`), e.length ? e.join(" ") : void 0;
33
+ return E.description && e.push(`${O}-description`), A.value ? e.push(`${O}-error`) : E.help && e.push(`${O}-help`), e.length ? e.join(" ") : void 0;
34
34
  });
35
- v(() => T.name && E ? n(E.state.value, T.name) : void 0, () => {
36
- if (!T.name || !E) return;
37
- let e = E.validateOn.value;
38
- (e.includes("change") || e.includes("input")) && E.validateField(T.name);
35
+ y(() => E.name && D ? n(D.state.value, E.name) : void 0, () => {
36
+ if (!E.name || !D) return;
37
+ let e = D.validateOn.value;
38
+ (e.includes("change") || e.includes("input")) && D.validateField(E.name);
39
39
  });
40
- function A() {
41
- !T.name || !E || E.validateOn.value.includes("blur") && E.validateField(T.name);
40
+ function M() {
41
+ !E.name || !D || D.validateOn.value.includes("blur") && D.validateField(E.name);
42
42
  }
43
- let j = e(), M = o(() => T.unstyled ?? j.unstyled), N = i();
44
- function P(e, t) {
45
- return M.value ? t : N[e]({ class: t });
43
+ let N = e(), P = o(() => E.unstyled ?? N.unstyled), F = i();
44
+ function I(e, t) {
45
+ return P.value ? t : F[e]({ class: t });
46
46
  }
47
47
  return m(t, {
48
- id: o(() => D),
49
- name: o(() => T.name),
50
- invalid: o(() => !!O.value),
51
- describedBy: k
48
+ id: k,
49
+ labelId: o(() => E.label ? `${O}-label` : void 0),
50
+ name: o(() => E.name),
51
+ invalid: o(() => !!A.value),
52
+ describedBy: j
52
53
  }), (e, t) => (p(), l("div", {
53
- "data-iryx-field": T.name,
54
- class: f(M.value ? T.class : _(N).root({ class: [T.ui?.root, T.class] })),
55
- onFocusout: A
54
+ "data-iryx-field": E.name,
55
+ class: f(P.value ? E.class : v(F).root({ class: [E.ui?.root, E.class] })),
56
+ onFocusout: M
56
57
  }, [
57
- T.label || T.hint || e.$slots.hint ? (p(), l("div", {
58
+ E.label || E.hint || e.$slots.hint ? (p(), l("div", {
58
59
  key: 0,
59
- class: f(P("header", T.ui?.header))
60
- }, [T.label ? (p(), s(a, {
60
+ class: f(I("header", E.ui?.header))
61
+ }, [E.label ? (p(), s(a, {
61
62
  key: 0,
62
- for: _(D),
63
- required: T.required,
64
- class: f(T.ui?.label)
63
+ id: `${v(O)}-label`,
64
+ for: k.value,
65
+ required: E.required,
66
+ class: f(E.ui?.label)
65
67
  }, {
66
- default: y(() => [u(g(T.label), 1)]),
68
+ default: b(() => [u(_(E.label), 1)]),
67
69
  _: 1
68
70
  }, 8, [
71
+ "id",
69
72
  "for",
70
73
  "required",
71
74
  "class"
72
- ])) : c("", !0), T.hint || e.$slots.hint ? (p(), l("span", {
75
+ ])) : c("", !0), E.hint || e.$slots.hint ? (p(), l("span", {
73
76
  key: 1,
74
- class: f(P("hint", T.ui?.hint))
75
- }, [h(e.$slots, "hint", {}, () => [u(g(T.hint), 1)])], 2)) : c("", !0)], 2)) : c("", !0),
76
- T.description ? (p(), l("p", {
77
+ class: f(I("hint", E.ui?.hint))
78
+ }, [g(e.$slots, "hint", {}, () => [u(_(E.hint), 1)])], 2)) : c("", !0)], 2)) : c("", !0),
79
+ E.description ? (p(), l("p", {
77
80
  key: 1,
78
- id: `${_(D)}-description`,
79
- class: f(P("description", T.ui?.description))
80
- }, g(T.description), 11, S)) : c("", !0),
81
- h(e.$slots, "default", {
82
- id: _(D),
83
- error: O.value
81
+ id: `${v(O)}-description`,
82
+ class: f(I("description", E.ui?.description))
83
+ }, _(E.description), 11, C)) : c("", !0),
84
+ g(e.$slots, "default", {
85
+ id: v(O),
86
+ error: A.value
84
87
  }),
85
- O.value ? (p(), l("p", {
88
+ A.value ? (p(), l("p", {
86
89
  key: 2,
87
- id: `${_(D)}-error`,
90
+ id: `${v(O)}-error`,
88
91
  role: "alert",
89
92
  "aria-live": "polite",
90
- class: f(P("error", T.ui?.error))
91
- }, g(O.value), 11, C)) : T.help ? (p(), l("p", {
93
+ class: f(I("error", E.ui?.error))
94
+ }, _(A.value), 11, w)) : E.help ? (p(), l("p", {
92
95
  key: 3,
93
- id: `${_(D)}-help`,
94
- class: f(P("help", T.ui?.help))
95
- }, g(T.help), 11, w)) : c("", !0)
96
- ], 42, x));
96
+ id: `${v(O)}-help`,
97
+ class: f(I("help", E.ui?.help))
98
+ }, _(E.help), 11, T)) : c("", !0)
99
+ ], 42, S));
97
100
  }
98
101
  });
99
102
  //#endregion
100
- export { T as default };
103
+ export { E as default };