iryx-ui 0.5.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 (71) hide show
  1. package/README.md +355 -5
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/components/Alert.vue.d.ts +19 -4
  4. package/dist/components/Badge.vue.d.ts +4 -3
  5. package/dist/components/Banner.vue.d.ts +81 -0
  6. package/dist/components/Combobox.vue.d.ts +3 -3
  7. package/dist/components/DatePicker.vue.d.ts +52 -0
  8. package/dist/components/DateRangePicker.vue.d.ts +60 -0
  9. package/dist/components/DropdownMenu.vue.d.ts +1 -1
  10. package/dist/components/Input.vue.d.ts +39 -1
  11. package/dist/components/Pagination.vue.d.ts +3 -1
  12. package/dist/components/PasswordInput.vue.d.ts +54 -0
  13. package/dist/components/Select.vue.d.ts +2 -2
  14. package/dist/components/Table.vue.d.ts +131 -0
  15. package/dist/components/Textarea.vue.d.ts +16 -1
  16. package/dist/components/index.d.ts +5 -0
  17. package/dist/composables/data-table.d.ts +93 -0
  18. package/dist/composables/date.d.ts +21 -0
  19. package/dist/index.d.ts +7 -0
  20. package/dist/index.js +72 -60
  21. package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +104 -7
  22. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +122 -0
  23. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/DateFormatter.js +84 -0
  24. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +91 -0
  25. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +107 -0
  26. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +159 -0
  27. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +29 -0
  28. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +37 -0
  29. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +6 -0
  30. package/dist/packages/iryx-ui/src/component-names.js +1 -1
  31. package/dist/packages/iryx-ui/src/components/Alert.vue_vue_type_script_setup_true_lang.js +51 -35
  32. package/dist/packages/iryx-ui/src/components/Badge.vue_vue_type_script_setup_true_lang.js +1 -2
  33. package/dist/packages/iryx-ui/src/components/Banner.js +5 -0
  34. package/dist/packages/iryx-ui/src/components/Banner.vue_vue_type_script_setup_true_lang.js +93 -0
  35. package/dist/packages/iryx-ui/src/components/DatePicker.js +5 -0
  36. package/dist/packages/iryx-ui/src/components/DatePicker.vue_vue_type_script_setup_true_lang.js +186 -0
  37. package/dist/packages/iryx-ui/src/components/DateRangePicker.js +5 -0
  38. package/dist/packages/iryx-ui/src/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +210 -0
  39. package/dist/packages/iryx-ui/src/components/Input.vue_vue_type_script_setup_true_lang.js +94 -25
  40. package/dist/packages/iryx-ui/src/components/Pagination.vue_vue_type_script_setup_true_lang.js +5 -1
  41. package/dist/packages/iryx-ui/src/components/PasswordInput.js +5 -0
  42. package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +113 -0
  43. package/dist/packages/iryx-ui/src/components/Table.js +5 -0
  44. package/dist/packages/iryx-ui/src/components/Table.vue_vue_type_script_setup_true_lang.js +217 -0
  45. package/dist/packages/iryx-ui/src/components/Textarea.vue_vue_type_script_setup_true_lang.js +47 -21
  46. package/dist/packages/iryx-ui/src/components/index.js +68 -58
  47. package/dist/packages/iryx-ui/src/composables/data-table.js +106 -0
  48. package/dist/packages/iryx-ui/src/composables/date.js +25 -0
  49. package/dist/packages/iryx-ui/src/theme/alert.js +10 -21
  50. package/dist/packages/iryx-ui/src/theme/badge.js +37 -37
  51. package/dist/packages/iryx-ui/src/theme/banner.js +62 -0
  52. package/dist/packages/iryx-ui/src/theme/date-picker.js +45 -0
  53. package/dist/packages/iryx-ui/src/theme/input.js +22 -6
  54. package/dist/packages/iryx-ui/src/theme/pagination.js +23 -13
  55. package/dist/packages/iryx-ui/src/theme/password-input.js +22 -0
  56. package/dist/packages/iryx-ui/src/theme/stat.js +4 -4
  57. package/dist/packages/iryx-ui/src/theme/table.js +62 -0
  58. package/dist/packages/iryx-ui/src/theme/toast.js +11 -26
  59. package/dist/theme/alert.d.ts +6 -12
  60. package/dist/theme/badge.d.ts +15 -12
  61. package/dist/theme/banner.d.ts +185 -0
  62. package/dist/theme/date-picker.d.ts +254 -0
  63. package/dist/theme/index.d.ts +4 -0
  64. package/dist/theme/input.d.ts +94 -15
  65. package/dist/theme/pagination.d.ts +33 -0
  66. package/dist/theme/password-input.d.ts +79 -0
  67. package/dist/theme/stat.d.ts +0 -3
  68. package/dist/theme/table.d.ts +230 -0
  69. package/dist/theme/toast.d.ts +0 -15
  70. package/package.json +2 -1
  71. package/theme.css +10 -0
@@ -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 };
@@ -1,19 +1,23 @@
1
- import { useIryxUiConfig as e } from "../config.js";
2
- import { useFormField as t } from "../composables/form.js";
3
- import { inputTheme as n } from "../theme/input.js";
4
- import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, normalizeClass as s, openBlock as c, unref as l, useModel as u, vModelDynamic as d, withDirectives as f } from "vue";
1
+ import { Cancel01Icon as e, Loading03Icon as t } 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 n } from "../config.js";
3
+ import r from "./Icon.js";
4
+ import { useFormField as i } from "../composables/form.js";
5
+ import { inputTheme as a } from "../theme/input.js";
6
+ import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, mergeProps as m, normalizeClass as h, onBeforeUnmount as g, openBlock as _, ref as v, renderSlot as y, unref as b, useModel as x, useSlots as S, watch as C, withKeys as w } from "vue";
5
7
  //#region src/components/Input.vue?vue&type=script&setup=true&lang.ts
6
- var p = [
8
+ var T = [
7
9
  "id",
10
+ "value",
8
11
  "type",
9
12
  "placeholder",
10
13
  "disabled",
11
14
  "required",
12
15
  "aria-invalid",
13
16
  "aria-describedby"
14
- ], m = /*@__PURE__*/ a({
17
+ ], E = ["aria-label"], D = /*@__PURE__*/ f({
18
+ inheritAttrs: !1,
15
19
  __name: "Input",
16
- props: /*@__PURE__*/ o({
20
+ props: /*@__PURE__*/ p({
17
21
  type: { default: "text" },
18
22
  size: {},
19
23
  placeholder: {},
@@ -24,34 +28,99 @@ var p = [
24
28
  default: void 0
25
29
  },
26
30
  id: {},
31
+ clearable: { type: Boolean },
32
+ loading: { type: Boolean },
33
+ debounce: { default: 0 },
34
+ clearLabel: { default: "Clear" },
27
35
  unstyled: {
28
36
  type: Boolean,
29
37
  default: void 0
30
38
  },
31
- class: {}
39
+ class: {},
40
+ ui: {}
32
41
  }, {
33
42
  modelValue: {},
34
43
  modelModifiers: {}
35
44
  }),
36
45
  emits: ["update:modelValue"],
37
- setup(a) {
38
- let o = a, m = u(a, "modelValue"), h = t(), g = r(() => o.id ?? h?.id.value), _ = r(() => o.invalid ?? h?.invalid.value ?? !1), v = e(), y = r(() => o.unstyled ?? v.unstyled), b = r(() => y.value ? o.class : n({
39
- size: o.size,
40
- invalid: _.value,
41
- class: o.class
46
+ setup(f, { expose: p }) {
47
+ let D = f, O = x(f, "modelValue"), k = S(), A = i(), j = o(() => D.id ?? A?.id.value), M = o(() => D.invalid ?? A?.invalid.value ?? !1), N = n(), P = o(() => D.unstyled ?? N.unstyled), F = v(O.value), I;
48
+ function L() {
49
+ I !== void 0 && (clearTimeout(I), I = void 0);
50
+ }
51
+ C(O, (e) => {
52
+ L(), F.value = e;
53
+ });
54
+ function R(e) {
55
+ let t = e.target.value;
56
+ if (F.value = t, L(), !D.debounce) {
57
+ O.value = t;
58
+ return;
59
+ }
60
+ I = setTimeout(() => {
61
+ I = void 0, O.value = t;
62
+ }, D.debounce);
63
+ }
64
+ function z() {
65
+ I !== void 0 && (L(), O.value = F.value);
66
+ }
67
+ g(L);
68
+ let B = v();
69
+ function V() {
70
+ L(), F.value = "", O.value = "", B.value?.focus();
71
+ }
72
+ p({ input: B });
73
+ let H = o(() => F.value !== "" && F.value != null), U = o(() => D.clearable && H.value && !D.disabled), W = o(() => D.loading || U.value || !!k.trailing), G = o(() => a({
74
+ size: D.size,
75
+ invalid: M.value
42
76
  }));
43
- return (e, t) => f((c(), i("input", {
44
- id: g.value,
45
- "onUpdate:modelValue": t[0] ||= (e) => m.value = e,
46
- type: o.type,
47
- placeholder: o.placeholder,
48
- disabled: o.disabled,
49
- required: o.required,
50
- "aria-invalid": _.value || void 0,
51
- "aria-describedby": l(h)?.describedBy.value,
52
- class: s(b.value)
53
- }, null, 10, p)), [[d, m.value]]);
77
+ function K(e, t) {
78
+ let n = D.ui?.[e];
79
+ return P.value ? [n, t] : G.value[e]({ class: [n, t] });
80
+ }
81
+ return (n, i) => (_(), l("div", { class: h(K("root", D.class)) }, [
82
+ b(k).leading ? (_(), l("span", {
83
+ key: 0,
84
+ class: h(K("leading"))
85
+ }, [y(n.$slots, "leading")], 2)) : c("", !0),
86
+ u("input", m({
87
+ id: j.value,
88
+ ref_key: "inputEl",
89
+ ref: B,
90
+ value: F.value,
91
+ type: D.type,
92
+ placeholder: D.placeholder,
93
+ disabled: D.disabled,
94
+ required: D.required,
95
+ "aria-invalid": M.value || void 0,
96
+ "aria-describedby": b(A)?.describedBy.value,
97
+ class: K("input")
98
+ }, n.$attrs, {
99
+ onInput: R,
100
+ onBlur: z,
101
+ onKeydown: w(z, ["enter"])
102
+ }), null, 16, T),
103
+ W.value ? (_(), l("span", {
104
+ key: 1,
105
+ class: h(K("trailing"))
106
+ }, [
107
+ y(n.$slots, "trailing"),
108
+ U.value ? (_(), l("button", {
109
+ key: 0,
110
+ type: "button",
111
+ tabindex: "-1",
112
+ "aria-label": D.clearLabel,
113
+ class: h(K("clear")),
114
+ onClick: V
115
+ }, [d(r, { icon: b(e) }, null, 8, ["icon"])], 10, E)) : c("", !0),
116
+ D.loading ? (_(), s(r, {
117
+ key: 1,
118
+ icon: b(t),
119
+ class: "animate-spin"
120
+ }, null, 8, ["icon"])) : c("", !0)
121
+ ], 2)) : c("", !0)
122
+ ], 2));
54
123
  }
55
124
  });
56
125
  //#endregion
57
- export { m as default };
126
+ export { D as default };
@@ -16,6 +16,7 @@ var D = /*@__PURE__*/ d({
16
16
  default: !0
17
17
  },
18
18
  size: {},
19
+ align: {},
19
20
  prevLabel: { default: "Previous page" },
20
21
  nextLabel: { default: "Next page" },
21
22
  label: { default: "Pagination" },
@@ -31,7 +32,10 @@ var D = /*@__PURE__*/ d({
31
32
  }),
32
33
  emits: ["update:page"],
33
34
  setup(d) {
34
- let f = d, D = y(d, "page"), O = n(), k = o(() => f.unstyled ?? O.unstyled), A = o(() => i({ size: f.size })), j = o(() => k.value ? [f.ui?.root, f.class] : A.value.root({ class: [f.ui?.root, f.class] })), M = o(() => k.value ? f.ui?.list : A.value.list({ class: f.ui?.list })), N = o(() => k.value ? f.ui?.ellipsis : A.value.ellipsis({ class: f.ui?.ellipsis }));
35
+ let f = d, D = y(d, "page"), O = n(), k = o(() => f.unstyled ?? O.unstyled), A = o(() => i({
36
+ size: f.size,
37
+ align: f.align
38
+ })), j = o(() => k.value ? [f.ui?.root, f.class] : A.value.root({ class: [f.ui?.root, f.class] })), M = o(() => k.value ? f.ui?.list : A.value.list({ class: f.ui?.list })), N = o(() => k.value ? f.ui?.ellipsis : A.value.ellipsis({ class: f.ui?.ellipsis }));
35
39
  function P(e) {
36
40
  return k.value ? f.ui?.item : [A.value.item({ class: f.ui?.item }), e ? A.value.active() : A.value.inactive()];
37
41
  }
@@ -0,0 +1,5 @@
1
+ import e from "./PasswordInput.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/PasswordInput.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };