iryx-ui 0.6.0 → 0.7.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.
Files changed (40) hide show
  1. package/README.md +150 -2
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/components/DatePicker.vue.d.ts +52 -0
  4. package/dist/components/DateRangePicker.vue.d.ts +60 -0
  5. package/dist/components/Input.vue.d.ts +39 -1
  6. package/dist/components/Pagination.vue.d.ts +1 -1
  7. package/dist/components/PasswordInput.vue.d.ts +54 -0
  8. package/dist/components/Textarea.vue.d.ts +16 -1
  9. package/dist/components/index.d.ts +3 -0
  10. package/dist/composables/date.d.ts +21 -0
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.js +51 -44
  13. package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +91 -8
  14. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +122 -0
  15. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/DateFormatter.js +84 -0
  16. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +91 -0
  17. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +107 -0
  18. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +159 -0
  19. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +29 -0
  20. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +37 -0
  21. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +6 -0
  22. package/dist/packages/iryx-ui/src/component-names.js +1 -1
  23. package/dist/packages/iryx-ui/src/components/DatePicker.js +5 -0
  24. package/dist/packages/iryx-ui/src/components/DatePicker.vue_vue_type_script_setup_true_lang.js +186 -0
  25. package/dist/packages/iryx-ui/src/components/DateRangePicker.js +5 -0
  26. package/dist/packages/iryx-ui/src/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +210 -0
  27. package/dist/packages/iryx-ui/src/components/Input.vue_vue_type_script_setup_true_lang.js +94 -25
  28. package/dist/packages/iryx-ui/src/components/PasswordInput.js +5 -0
  29. package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +113 -0
  30. package/dist/packages/iryx-ui/src/components/Textarea.vue_vue_type_script_setup_true_lang.js +47 -21
  31. package/dist/packages/iryx-ui/src/components/index.js +50 -44
  32. package/dist/packages/iryx-ui/src/composables/date.js +25 -0
  33. package/dist/packages/iryx-ui/src/theme/date-picker.js +45 -0
  34. package/dist/packages/iryx-ui/src/theme/input.js +22 -6
  35. package/dist/packages/iryx-ui/src/theme/password-input.js +22 -0
  36. package/dist/theme/date-picker.d.ts +254 -0
  37. package/dist/theme/index.d.ts +2 -0
  38. package/dist/theme/input.d.ts +94 -15
  39. package/dist/theme/password-input.d.ts +79 -0
  40. package/package.json +2 -1
@@ -0,0 +1,159 @@
1
+ import { $93635573935797de$export$80ee6245ec4f29ec as e } from "./calendars/GregorianCalendar.js";
2
+ import { $d07e34cce18680fd$export$1b96692a1ba042ac as t, $d07e34cce18680fd$export$5107c82f94518f5c as n, $d07e34cce18680fd$export$b21e0b124e224484 as r, $d07e34cce18680fd$export$b4a036af3fc0b032 as i, $d07e34cce18680fd$export$bd4fb2bc8bb06fb as a } from "./conversion.js";
3
+ //#region ../../node_modules/.pnpm/@internationalized+date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.mjs
4
+ var o = 36e5;
5
+ function s(e, t) {
6
+ let n = e.copy(), r = "hour" in n ? b(n, t) : 0;
7
+ c(n, t.years || 0), n.calendar.balanceYearMonth && n.calendar.balanceYearMonth(n, e), n.month += t.months || 0, l(n), d(n), n.day += (t.weeks || 0) * 7, n.day += t.days || 0, n.day += r, u(n), n.calendar.balanceDate && n.calendar.balanceDate(n), n.year < 1 && (n.year = 1, n.month = 1, n.day = 1);
8
+ let i = n.calendar.getYearsInEra(n);
9
+ if (n.year > i) {
10
+ let e = n.calendar.isInverseEra?.(n);
11
+ n.year = i, n.month = e ? 1 : n.calendar.getMonthsInYear(n), n.day = e ? 1 : n.calendar.getDaysInMonth(n);
12
+ }
13
+ n.month < 1 && (n.month = 1, n.day = 1);
14
+ let a = n.calendar.getMonthsInYear(n);
15
+ return n.month > a && (n.month = a, n.day = n.calendar.getDaysInMonth(n)), n.day = Math.max(1, Math.min(n.calendar.getDaysInMonth(n), n.day)), n;
16
+ }
17
+ function c(e, t) {
18
+ e.calendar.isInverseEra?.(e) && (t = -t), e.year += t;
19
+ }
20
+ function l(e) {
21
+ for (; e.month < 1;) c(e, -1), e.month += e.calendar.getMonthsInYear(e);
22
+ let t = 0;
23
+ for (; e.month > (t = e.calendar.getMonthsInYear(e));) e.month -= t, c(e, 1);
24
+ }
25
+ function u(e) {
26
+ for (; e.day < 1;) e.month--, l(e), e.day += e.calendar.getDaysInMonth(e);
27
+ for (; e.day > e.calendar.getDaysInMonth(e);) e.day -= e.calendar.getDaysInMonth(e), e.month++, l(e);
28
+ }
29
+ function d(e) {
30
+ e.month = Math.max(1, Math.min(e.calendar.getMonthsInYear(e), e.month)), e.day = Math.max(1, Math.min(e.calendar.getDaysInMonth(e), e.day));
31
+ }
32
+ function f(e) {
33
+ e.calendar.constrainDate && e.calendar.constrainDate(e), e.year = Math.max(1, Math.min(e.calendar.getYearsInEra(e), e.year)), d(e);
34
+ }
35
+ function p(e) {
36
+ let t = {};
37
+ for (let n in e) typeof e[n] == "number" && (t[n] = -e[n]);
38
+ return t;
39
+ }
40
+ function m(e, t) {
41
+ return s(e, p(t));
42
+ }
43
+ function h(e, t) {
44
+ let n = e.copy();
45
+ return t.era != null && (n.era = t.era), t.year != null && (n.year = t.year), t.month != null && (n.month = t.month), t.day != null && (n.day = t.day), f(n), n;
46
+ }
47
+ function g(e, t) {
48
+ let n = e.copy();
49
+ return t.hour != null && (n.hour = t.hour), t.minute != null && (n.minute = t.minute), t.second != null && (n.second = t.second), t.millisecond != null && (n.millisecond = t.millisecond), v(n), n;
50
+ }
51
+ function _(e) {
52
+ e.second += Math.floor(e.millisecond / 1e3), e.millisecond = y(e.millisecond, 1e3), e.minute += Math.floor(e.second / 60), e.second = y(e.second, 60), e.hour += Math.floor(e.minute / 60), e.minute = y(e.minute, 60);
53
+ let t = Math.floor(e.hour / 24);
54
+ return e.hour = y(e.hour, 24), t;
55
+ }
56
+ function v(e) {
57
+ e.millisecond = Math.max(0, Math.min(e.millisecond, 999)), e.second = Math.max(0, Math.min(e.second, 59)), e.minute = Math.max(0, Math.min(e.minute, 59)), e.hour = Math.max(0, Math.min(e.hour, 23));
58
+ }
59
+ function y(e, t) {
60
+ let n = e % t;
61
+ return n < 0 && (n += t), n;
62
+ }
63
+ function b(e, t) {
64
+ return e.hour += t.hours || 0, e.minute += t.minutes || 0, e.second += t.seconds || 0, e.millisecond += t.milliseconds || 0, _(e);
65
+ }
66
+ function x(e, t, n, r) {
67
+ let i = e.copy();
68
+ switch (t) {
69
+ case "era": {
70
+ let t = e.calendar.getEras(), a = t.indexOf(e.era);
71
+ if (a < 0) throw Error("Invalid era: " + e.era);
72
+ a = C(a, n, 0, t.length - 1, r?.round), i.era = t[a], f(i);
73
+ break;
74
+ }
75
+ case "year":
76
+ i.calendar.isInverseEra?.(i) && (n = -n), i.year = C(e.year, n, -Infinity, 9999, r?.round), i.year === -Infinity && (i.year = 1), i.calendar.balanceYearMonth && i.calendar.balanceYearMonth(i, e);
77
+ break;
78
+ case "month":
79
+ i.month = C(e.month, n, 1, e.calendar.getMonthsInYear(e), r?.round);
80
+ break;
81
+ case "day":
82
+ i.day = C(e.day, n, 1, e.calendar.getDaysInMonth(e), r?.round);
83
+ break;
84
+ default: throw Error("Unsupported field " + t);
85
+ }
86
+ return e.calendar.balanceDate && e.calendar.balanceDate(i), f(i), i;
87
+ }
88
+ function S(e, t, n, r) {
89
+ let i = e.copy();
90
+ switch (t) {
91
+ case "hour": {
92
+ let t = e.hour, a = 0, o = 23;
93
+ if (r?.hourCycle === 12) {
94
+ let e = t >= 12;
95
+ a = e ? 12 : 0, o = e ? 23 : 11;
96
+ }
97
+ i.hour = C(t, n, a, o, r?.round);
98
+ break;
99
+ }
100
+ case "minute":
101
+ i.minute = C(e.minute, n, 0, 59, r?.round);
102
+ break;
103
+ case "second":
104
+ i.second = C(e.second, n, 0, 59, r?.round);
105
+ break;
106
+ case "millisecond":
107
+ i.millisecond = C(e.millisecond, n, 0, 999, r?.round);
108
+ break;
109
+ default: throw Error("Unsupported field " + t);
110
+ }
111
+ return i;
112
+ }
113
+ function C(e, t, n, r, i = !1) {
114
+ if (i) {
115
+ e += Math.sign(t), e < n && (e = r);
116
+ let i = Math.abs(t);
117
+ e = t > 0 ? Math.ceil(e / i) * i : Math.floor(e / i) * i, e > r && (e = n);
118
+ } else e += t, e < n ? e = r - (n - e - 1) : e > r && (e = n + (e - r - 1));
119
+ return e;
120
+ }
121
+ function w(e, o) {
122
+ let c;
123
+ return c = o.years != null && o.years !== 0 || o.months != null && o.months !== 0 || o.weeks != null && o.weeks !== 0 || o.days != null && o.days !== 0 ? n(s(r(e), {
124
+ years: o.years,
125
+ months: o.months,
126
+ weeks: o.weeks,
127
+ days: o.days
128
+ }), e.timeZone) : a(e) - e.offset, c += o.milliseconds || 0, c += (o.seconds || 0) * 1e3, c += (o.minutes || 0) * 6e4, c += (o.hours || 0) * 36e5, i(t(c, e.timeZone), e.calendar);
129
+ }
130
+ function T(e, t) {
131
+ return w(e, p(t));
132
+ }
133
+ function E(s, c, l, u) {
134
+ switch (c) {
135
+ case "hour": {
136
+ let c = 0, d = 23;
137
+ if (u?.hourCycle === 12) {
138
+ let e = s.hour >= 12;
139
+ c = e ? 12 : 0, d = e ? 23 : 11;
140
+ }
141
+ let f = r(s), p = i(g(f, { hour: c }), new e()), m = [n(p, s.timeZone, "earlier"), n(p, s.timeZone, "later")].filter((e) => t(e, s.timeZone).day === p.day)[0], h = i(g(f, { hour: d }), new e()), _ = [n(h, s.timeZone, "earlier"), n(h, s.timeZone, "later")].filter((e) => t(e, s.timeZone).day === h.day).pop(), v = a(s) - s.offset, y = Math.floor(v / o), b = v % o;
142
+ return v = C(y, l, Math.floor(m / o), Math.floor(_ / o), u?.round) * o + b, i(t(v, s.timeZone), s.calendar);
143
+ }
144
+ case "minute":
145
+ case "second":
146
+ case "millisecond": return S(s, c, l, u);
147
+ case "era":
148
+ case "year":
149
+ case "month":
150
+ case "day": return i(t(n(x(r(s), c, l, u), s.timeZone), s.timeZone), s.calendar);
151
+ default: throw Error("Unsupported field " + c);
152
+ }
153
+ }
154
+ function D(e, a, o) {
155
+ let s = r(e), c = g(h(s, a), a);
156
+ return c.compare(s) === 0 ? e : i(t(n(c, e.timeZone, o), e.timeZone), e.calendar);
157
+ }
158
+ //#endregion
159
+ export { D as $435a2ceaa8778ed8$export$31b5430eb18be4f8, m as $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3, T as $435a2ceaa8778ed8$export$6814caac34ca03c7, w as $435a2ceaa8778ed8$export$96b1d28349274637, E as $435a2ceaa8778ed8$export$9a297d111fc86b79, h as $435a2ceaa8778ed8$export$adaa4cf7ef1b65be, f as $435a2ceaa8778ed8$export$c4e2ecac49351ef2, x as $435a2ceaa8778ed8$export$d52ced6badfb9a4c, S as $435a2ceaa8778ed8$export$dd02b3e0007dfe28, s as $435a2ceaa8778ed8$export$e16d8520af44a096, g as $435a2ceaa8778ed8$export$e5d5e1c1822b6e56 };
@@ -0,0 +1,29 @@
1
+ import { $d07e34cce18680fd$export$1b96692a1ba042ac as e, $d07e34cce18680fd$export$93522d1a439f3617 as t } from "./conversion.js";
2
+ //#region ../../node_modules/.pnpm/@internationalized+date@3.12.3/node_modules/@internationalized/date/dist/private/queries.mjs
3
+ function n(e, t) {
4
+ return e.isEqual?.(t) ?? t.isEqual?.(e) ?? e.identifier === t.identifier;
5
+ }
6
+ function r(t) {
7
+ return e(Date.now(), t);
8
+ }
9
+ function i(e) {
10
+ return t(r(e));
11
+ }
12
+ function a(e, t) {
13
+ return e.calendar.toJulianDay(e) - t.calendar.toJulianDay(t);
14
+ }
15
+ function o(e, t) {
16
+ return s(e) - s(t);
17
+ }
18
+ function s(e) {
19
+ return e.hour * 36e5 + e.minute * 6e4 + e.second * 1e3 + e.millisecond;
20
+ }
21
+ var c = null, l = !1;
22
+ function u() {
23
+ return c ??= new Intl.DateTimeFormat().resolvedOptions().timeZone, c;
24
+ }
25
+ function d() {
26
+ return l;
27
+ }
28
+ //#endregion
29
+ export { a as $ad063034c8620db8$export$68781ddf31c0090f, d as $ad063034c8620db8$export$6ab69b273755230b, u as $ad063034c8620db8$export$aa8b41735afcabd2, o as $ad063034c8620db8$export$c19a80a9721b80f6, i as $ad063034c8620db8$export$d0bdf45af03a6ea3, n as $ad063034c8620db8$export$dbc69fd56b53d5e };
@@ -0,0 +1,37 @@
1
+ import { $93635573935797de$export$80ee6245ec4f29ec as e } from "./calendars/GregorianCalendar.js";
2
+ import { $d07e34cce18680fd$export$b4a036af3fc0b032 as t } from "./conversion.js";
3
+ import { $2aaf608024c21ca1$export$99faa760c7908e4f as n } from "./CalendarDate.js";
4
+ //#region ../../node_modules/.pnpm/@internationalized+date@3.12.3/node_modules/@internationalized/date/dist/private/string.mjs
5
+ var r = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/, i = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
6
+ function a(e) {
7
+ let t = e.match(r);
8
+ if (!t) throw i.test(e) ? Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`) : Error("Invalid ISO 8601 date string: " + e);
9
+ let a = new n(o(t[1], 0, 9999), o(t[2], 1, 12), 1);
10
+ return a.day = o(t[3], 1, a.calendar.getDaysInMonth(a)), a;
11
+ }
12
+ function o(e, t, n) {
13
+ let r = Number(e);
14
+ if (r < t || r > n) throw RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);
15
+ return r;
16
+ }
17
+ function s(e) {
18
+ return `${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${e.millisecond ? String(e.millisecond / 1e3).slice(1) : ""}`;
19
+ }
20
+ function c(n) {
21
+ let r = t(n, new e()), i;
22
+ return i = r.era === "BC" ? r.year === 1 ? "0000" : "-" + String(Math.abs(1 - r.year)).padStart(6, "00") : String(r.year).padStart(4, "0"), `${i}-${String(r.month).padStart(2, "0")}-${String(r.day).padStart(2, "0")}`;
23
+ }
24
+ function l(e) {
25
+ return `${c(e)}T${s(e)}`;
26
+ }
27
+ function u(e) {
28
+ let t = Math.sign(e) < 0 ? "-" : "+";
29
+ e = Math.abs(e);
30
+ let n = Math.floor(e / 36e5), r = Math.floor(e % 36e5 / 6e4), i = Math.floor(e % 36e5 % 6e4 / 1e3), a = `${t}${String(n).padStart(2, "0")}:${String(r).padStart(2, "0")}`;
31
+ return i !== 0 && (a += `:${String(i).padStart(2, "0")}`), a;
32
+ }
33
+ function d(e) {
34
+ return `${l(e)}${u(e.offset)}[${e.timeZone}]`;
35
+ }
36
+ //#endregion
37
+ export { l as $58246871e4652552$export$4223de14708adc63, c as $58246871e4652552$export$60dfd74aa96791bd, a as $58246871e4652552$export$6b862160d295c8e, d as $58246871e4652552$export$bf79f1ebf4b18792 };
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/.pnpm/@internationalized+date@3.12.3/node_modules/@internationalized/date/dist/private/utils.mjs
2
+ function e(e, t) {
3
+ return e - t * Math.floor(e / t);
4
+ }
5
+ //#endregion
6
+ export { e as $09ec6a572d60460f$export$842a2cf37af977e1 };
@@ -1,4 +1,4 @@
1
1
  //#region src/component-names.ts
2
- var e = /* @__PURE__ */ "Alert.App.Badge.Banner.Breadcrumb.Button.ButtonGroup.Card.Checkbox.Combobox.ConfirmDialog.Dialog.DropdownMenu.EmptyState.Form.FormField.Input.Label.NumberInput.Pagination.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Table.Tabs.Textarea.Toaster.Tooltip".split(".");
2
+ var e = /* @__PURE__ */ "Alert.App.Badge.Banner.Breadcrumb.Button.ButtonGroup.Card.Checkbox.Combobox.ConfirmDialog.DatePicker.DateRangePicker.Dialog.DropdownMenu.EmptyState.Form.FormField.Input.Label.NumberInput.Pagination.PasswordInput.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Table.Tabs.Textarea.Toaster.Tooltip".split(".");
3
3
  //#endregion
4
4
  export { e as componentNames };
@@ -0,0 +1,5 @@
1
+ import e from "./DatePicker.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/DatePicker.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,186 @@
1
+ import { ArrowLeft01Icon as e, ArrowRight01Icon as t, Calendar03Icon as n } from "../../../../node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js";
2
+ import { useIryxUiConfig as r } from "../config.js";
3
+ import i from "./Icon.js";
4
+ import { useFormField as a } from "../composables/form.js";
5
+ import { formatIsoDate as o, isoToday as ee, toCalendarDate as s, toIsoDate as c } from "../composables/date.js";
6
+ import { datePickerTheme as l } from "../theme/date-picker.js";
7
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, mergeModels as y, normalizeClass as b, openBlock as x, ref as S, renderList as C, toDisplayString as w, unref as T, useModel as E, withCtx as D } from "vue";
8
+ import { CalendarCell as te, CalendarCellTrigger as ne, CalendarGrid as O, CalendarGridBody as k, CalendarGridHead as A, CalendarGridRow as j, CalendarHeadCell as M, CalendarHeader as N, CalendarHeading as P, CalendarNext as F, CalendarPrev as I, CalendarRoot as L, PopoverContent as R, PopoverPortal as z, PopoverRoot as B, PopoverTrigger as V } from "reka-ui";
9
+ //#region src/components/DatePicker.vue?vue&type=script&setup=true&lang.ts
10
+ var H = [
11
+ "id",
12
+ "disabled",
13
+ "aria-invalid",
14
+ "aria-describedby"
15
+ ], U = { key: 0 }, W = /*@__PURE__*/ v({
16
+ __name: "DatePicker",
17
+ props: /*@__PURE__*/ y({
18
+ size: {},
19
+ placeholder: { default: "Pick a date" },
20
+ disabled: { type: Boolean },
21
+ invalid: {
22
+ type: Boolean,
23
+ default: void 0
24
+ },
25
+ id: {},
26
+ min: {},
27
+ max: {},
28
+ locale: {},
29
+ format: {},
30
+ weekStartsOn: {},
31
+ clearable: { type: Boolean },
32
+ todayLabel: { default: "Today" },
33
+ clearLabel: { default: "Clear" },
34
+ previousLabel: { default: "Previous month" },
35
+ nextLabel: { default: "Next month" },
36
+ unstyled: {
37
+ type: Boolean,
38
+ default: void 0
39
+ },
40
+ class: {},
41
+ ui: {}
42
+ }, {
43
+ modelValue: { default: null },
44
+ modelModifiers: {}
45
+ }),
46
+ emits: ["update:modelValue"],
47
+ setup(v) {
48
+ let y = v, W = E(v, "modelValue"), G = S(!1), K = a(), q = d(() => y.id ?? K?.id.value), J = d(() => y.invalid ?? K?.invalid.value ?? !1), Y = r(), X = d(() => y.unstyled ?? Y.unstyled), Z = d({
49
+ get: () => s(W.value),
50
+ set: (e) => {
51
+ W.value = c(e);
52
+ }
53
+ }), re = d(() => s(y.min)), ie = d(() => s(y.max)), Q = d(() => o(W.value, y.locale, y.format));
54
+ function ae() {
55
+ W.value = ee(), G.value = !1;
56
+ }
57
+ function oe() {
58
+ W.value = null, G.value = !1;
59
+ }
60
+ let se = d(() => l({
61
+ size: y.size,
62
+ invalid: J.value
63
+ }));
64
+ function $(e, t) {
65
+ let n = y.ui?.[e];
66
+ return X.value ? [n, t] : se.value[e]({ class: [n, t] });
67
+ }
68
+ return (r, a) => (x(), f(T(B), {
69
+ open: G.value,
70
+ "onUpdate:open": a[2] ||= (e) => G.value = e
71
+ }, {
72
+ default: D(() => [_(T(V), { "as-child": "" }, {
73
+ default: D(() => [h("button", {
74
+ id: q.value,
75
+ type: "button",
76
+ disabled: y.disabled,
77
+ "aria-invalid": J.value || void 0,
78
+ "aria-describedby": T(K)?.describedBy.value,
79
+ class: b($("trigger", y.class))
80
+ }, [Q.value ? (x(), m("span", U, w(Q.value), 1)) : (x(), m("span", {
81
+ key: 1,
82
+ class: b($("placeholder"))
83
+ }, w(y.placeholder), 3)), _(i, { icon: T(n) }, null, 8, ["icon"])], 10, H)]),
84
+ _: 1
85
+ }), _(T(z), null, {
86
+ default: D(() => [_(T(R), {
87
+ class: b($("content")),
88
+ "side-offset": 4,
89
+ align: "start"
90
+ }, {
91
+ default: D(() => [_(T(L), {
92
+ modelValue: Z.value,
93
+ "onUpdate:modelValue": [a[0] ||= (e) => Z.value = e, a[1] ||= (e) => G.value = !1],
94
+ "min-value": re.value,
95
+ "max-value": ie.value,
96
+ locale: y.locale,
97
+ "week-starts-on": y.weekStartsOn,
98
+ "fixed-weeks": "",
99
+ "initial-focus": ""
100
+ }, {
101
+ default: D(({ grid: n, weekDays: r }) => [_(T(N), { class: b($("header")) }, {
102
+ default: D(() => [
103
+ _(T(I), {
104
+ "aria-label": y.previousLabel,
105
+ class: b($("nav"))
106
+ }, {
107
+ default: D(() => [_(i, { icon: T(e) }, null, 8, ["icon"])]),
108
+ _: 1
109
+ }, 8, ["aria-label", "class"]),
110
+ _(T(P), { class: b($("heading")) }, null, 8, ["class"]),
111
+ _(T(F), {
112
+ "aria-label": y.nextLabel,
113
+ class: b($("nav"))
114
+ }, {
115
+ default: D(() => [_(i, { icon: T(t) }, null, 8, ["icon"])]),
116
+ _: 1
117
+ }, 8, ["aria-label", "class"])
118
+ ]),
119
+ _: 1
120
+ }, 8, ["class"]), h("div", { class: b($("months")) }, [(x(!0), m(u, null, C(n, (e) => (x(), f(T(O), {
121
+ key: e.value.toString(),
122
+ class: b($("grid"))
123
+ }, {
124
+ default: D(() => [_(T(A), null, {
125
+ default: D(() => [_(T(j), null, {
126
+ default: D(() => [(x(!0), m(u, null, C(r, (e) => (x(), f(T(M), {
127
+ key: e,
128
+ class: b($("headCell"))
129
+ }, {
130
+ default: D(() => [g(w(e), 1)]),
131
+ _: 2
132
+ }, 1032, ["class"]))), 128))]),
133
+ _: 2
134
+ }, 1024)]),
135
+ _: 2
136
+ }, 1024), _(T(k), null, {
137
+ default: D(() => [(x(!0), m(u, null, C(e.rows, (t, n) => (x(), f(T(j), { key: `week-${n}` }, {
138
+ default: D(() => [(x(!0), m(u, null, C(t, (t) => (x(), f(T(te), {
139
+ key: t.toString(),
140
+ date: t,
141
+ class: b($("cell"))
142
+ }, {
143
+ default: D(() => [_(T(ne), {
144
+ day: t,
145
+ month: e.value,
146
+ class: b($("cellTrigger"))
147
+ }, null, 8, [
148
+ "day",
149
+ "month",
150
+ "class"
151
+ ])]),
152
+ _: 2
153
+ }, 1032, ["date", "class"]))), 128))]),
154
+ _: 2
155
+ }, 1024))), 128))]),
156
+ _: 2
157
+ }, 1024)]),
158
+ _: 2
159
+ }, 1032, ["class"]))), 128))], 2)]),
160
+ _: 1
161
+ }, 8, [
162
+ "modelValue",
163
+ "min-value",
164
+ "max-value",
165
+ "locale",
166
+ "week-starts-on"
167
+ ]), h("div", { class: b($("footer")) }, [h("button", {
168
+ type: "button",
169
+ class: b($("action")),
170
+ onClick: ae
171
+ }, w(y.todayLabel), 3), y.clearable ? (x(), m("button", {
172
+ key: 0,
173
+ type: "button",
174
+ class: b($("action")),
175
+ onClick: oe
176
+ }, w(y.clearLabel), 3)) : p("", !0)], 2)]),
177
+ _: 1
178
+ }, 8, ["class"])]),
179
+ _: 1
180
+ })]),
181
+ _: 1
182
+ }, 8, ["open"]));
183
+ }
184
+ });
185
+ //#endregion
186
+ export { W as default };
@@ -0,0 +1,5 @@
1
+ import e from "./DateRangePicker.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/DateRangePicker.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,210 @@
1
+ import { ArrowLeft01Icon as e, ArrowRight01Icon as t, Calendar03Icon as n } from "../../../../node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js";
2
+ import { useIryxUiConfig as r } from "../config.js";
3
+ import i from "./Icon.js";
4
+ import { useFormField as a } from "../composables/form.js";
5
+ import { formatIsoDate as o, toCalendarDate as s, toIsoDate as c } from "../composables/date.js";
6
+ import { datePickerTheme as ee } from "../theme/date-picker.js";
7
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as te, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, mergeModels as _, normalizeClass as v, openBlock as y, ref as b, renderList as x, shallowRef as S, toDisplayString as C, unref as w, useModel as ne, watch as T, withCtx as E } from "vue";
8
+ import { PopoverContent as D, PopoverPortal as O, PopoverRoot as k, PopoverTrigger as A, RangeCalendarCell as re, RangeCalendarCellTrigger as j, RangeCalendarGrid as M, RangeCalendarGridBody as N, RangeCalendarGridHead as P, RangeCalendarGridRow as F, RangeCalendarHeadCell as I, RangeCalendarHeader as L, RangeCalendarHeading as R, RangeCalendarNext as z, RangeCalendarPrev as B, RangeCalendarRoot as V } from "reka-ui";
9
+ //#region src/components/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
10
+ var H = [
11
+ "id",
12
+ "disabled",
13
+ "aria-invalid",
14
+ "aria-describedby"
15
+ ], U = { key: 0 }, W = /*@__PURE__*/ g({
16
+ __name: "DateRangePicker",
17
+ props: /*@__PURE__*/ _({
18
+ size: {},
19
+ placeholder: { default: "Pick a date range" },
20
+ disabled: { type: Boolean },
21
+ invalid: {
22
+ type: Boolean,
23
+ default: void 0
24
+ },
25
+ id: {},
26
+ min: {},
27
+ max: {},
28
+ locale: {},
29
+ format: {},
30
+ weekStartsOn: {},
31
+ months: { default: 2 },
32
+ clearable: { type: Boolean },
33
+ separator: { default: " – " },
34
+ clearLabel: { default: "Clear" },
35
+ previousLabel: { default: "Previous month" },
36
+ nextLabel: { default: "Next month" },
37
+ unstyled: {
38
+ type: Boolean,
39
+ default: void 0
40
+ },
41
+ class: {},
42
+ ui: {}
43
+ }, {
44
+ modelValue: { default: () => ({
45
+ start: null,
46
+ end: null
47
+ }) },
48
+ modelModifiers: {}
49
+ }),
50
+ emits: ["update:modelValue"],
51
+ setup(g) {
52
+ let _ = g, W = ne(g, "modelValue"), G = b(!1), K = a(), q = u(() => _.id ?? K?.id.value), J = u(() => _.invalid ?? K?.invalid.value ?? !1), Y = r(), ie = u(() => _.unstyled ?? Y.unstyled), X = S({
53
+ start: s(W.value?.start),
54
+ end: s(W.value?.end)
55
+ });
56
+ function Z(e) {
57
+ return c(e.start) === (W.value?.start ?? null) && c(e.end) === (W.value?.end ?? null);
58
+ }
59
+ T(W, () => {
60
+ Z(X.value) || (X.value = {
61
+ start: s(W.value?.start),
62
+ end: s(W.value?.end)
63
+ });
64
+ }, { deep: !0 }), T(X, (e) => {
65
+ Z(e) || (W.value = {
66
+ start: c(e.start),
67
+ end: c(e.end)
68
+ });
69
+ });
70
+ let ae = u(() => s(_.min)), oe = u(() => s(_.max)), Q = u(() => {
71
+ let e = o(W.value?.start, _.locale, _.format), t = o(W.value?.end, _.locale, _.format);
72
+ return !e && !t ? "" : t ? `${e}${_.separator}${t}` : e;
73
+ });
74
+ T(W, (e) => {
75
+ G.value && e?.start && e?.end && (G.value = !1);
76
+ }, { deep: !0 });
77
+ function se() {
78
+ W.value = {
79
+ start: null,
80
+ end: null
81
+ }, G.value = !1;
82
+ }
83
+ let ce = u(() => ee({
84
+ size: _.size,
85
+ invalid: J.value,
86
+ range: !0
87
+ }));
88
+ function $(e, t) {
89
+ let n = _.ui?.[e];
90
+ return ie.value ? [n, t] : ce.value[e]({ class: [n, t] });
91
+ }
92
+ return (r, a) => (y(), d(w(k), {
93
+ open: G.value,
94
+ "onUpdate:open": a[1] ||= (e) => G.value = e
95
+ }, {
96
+ default: E(() => [h(w(A), { "as-child": "" }, {
97
+ default: E(() => [p("button", {
98
+ id: q.value,
99
+ type: "button",
100
+ disabled: _.disabled,
101
+ "aria-invalid": J.value || void 0,
102
+ "aria-describedby": w(K)?.describedBy.value,
103
+ class: v($("trigger", _.class))
104
+ }, [Q.value ? (y(), f("span", U, C(Q.value), 1)) : (y(), f("span", {
105
+ key: 1,
106
+ class: v($("placeholder"))
107
+ }, C(_.placeholder), 3)), h(i, { icon: w(n) }, null, 8, ["icon"])], 10, H)]),
108
+ _: 1
109
+ }), h(w(O), null, {
110
+ default: E(() => [h(w(D), {
111
+ class: v($("content")),
112
+ "side-offset": 4,
113
+ align: "start"
114
+ }, {
115
+ default: E(() => [h(w(V), {
116
+ modelValue: X.value,
117
+ "onUpdate:modelValue": a[0] ||= (e) => X.value = e,
118
+ "min-value": ae.value,
119
+ "max-value": oe.value,
120
+ locale: _.locale,
121
+ "week-starts-on": _.weekStartsOn,
122
+ "number-of-months": _.months,
123
+ "fixed-weeks": "",
124
+ "initial-focus": ""
125
+ }, {
126
+ default: E(({ grid: n, weekDays: r }) => [h(w(L), { class: v($("header")) }, {
127
+ default: E(() => [
128
+ h(w(B), {
129
+ "aria-label": _.previousLabel,
130
+ class: v($("nav"))
131
+ }, {
132
+ default: E(() => [h(i, { icon: w(e) }, null, 8, ["icon"])]),
133
+ _: 1
134
+ }, 8, ["aria-label", "class"]),
135
+ h(w(R), { class: v($("heading")) }, null, 8, ["class"]),
136
+ h(w(z), {
137
+ "aria-label": _.nextLabel,
138
+ class: v($("nav"))
139
+ }, {
140
+ default: E(() => [h(i, { icon: w(t) }, null, 8, ["icon"])]),
141
+ _: 1
142
+ }, 8, ["aria-label", "class"])
143
+ ]),
144
+ _: 1
145
+ }, 8, ["class"]), p("div", { class: v($("months")) }, [(y(!0), f(l, null, x(n, (e) => (y(), d(w(M), {
146
+ key: e.value.toString(),
147
+ class: v($("grid"))
148
+ }, {
149
+ default: E(() => [h(w(P), null, {
150
+ default: E(() => [h(w(F), null, {
151
+ default: E(() => [(y(!0), f(l, null, x(r, (e) => (y(), d(w(I), {
152
+ key: e,
153
+ class: v($("headCell"))
154
+ }, {
155
+ default: E(() => [m(C(e), 1)]),
156
+ _: 2
157
+ }, 1032, ["class"]))), 128))]),
158
+ _: 2
159
+ }, 1024)]),
160
+ _: 2
161
+ }, 1024), h(w(N), null, {
162
+ default: E(() => [(y(!0), f(l, null, x(e.rows, (t, n) => (y(), d(w(F), { key: `week-${n}` }, {
163
+ default: E(() => [(y(!0), f(l, null, x(t, (t) => (y(), d(w(re), {
164
+ key: t.toString(),
165
+ date: t,
166
+ class: v($("cell"))
167
+ }, {
168
+ default: E(() => [h(w(j), {
169
+ day: t,
170
+ month: e.value,
171
+ class: v($("cellTrigger"))
172
+ }, null, 8, [
173
+ "day",
174
+ "month",
175
+ "class"
176
+ ])]),
177
+ _: 2
178
+ }, 1032, ["date", "class"]))), 128))]),
179
+ _: 2
180
+ }, 1024))), 128))]),
181
+ _: 2
182
+ }, 1024)]),
183
+ _: 2
184
+ }, 1032, ["class"]))), 128))], 2)]),
185
+ _: 1
186
+ }, 8, [
187
+ "modelValue",
188
+ "min-value",
189
+ "max-value",
190
+ "locale",
191
+ "week-starts-on",
192
+ "number-of-months"
193
+ ]), _.clearable ? (y(), f("div", {
194
+ key: 0,
195
+ class: v($("footer"))
196
+ }, [p("button", {
197
+ type: "button",
198
+ class: v($("action")),
199
+ onClick: se
200
+ }, C(_.clearLabel), 3)], 2)) : te("", !0)]),
201
+ _: 1
202
+ }, 8, ["class"])]),
203
+ _: 1
204
+ })]),
205
+ _: 1
206
+ }, 8, ["open"]));
207
+ }
208
+ });
209
+ //#endregion
210
+ export { W as default };