iryx-ui 0.4.0 → 0.5.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.
- package/README.md +88 -7
- package/dist/component-names.d.ts +1 -1
- package/dist/components/App.vue.d.ts +1 -1
- package/dist/components/Combobox.vue.d.ts +112 -0
- package/dist/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/components/Select.vue.d.ts +13 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +49 -47
- package/dist/nuxt.d.ts +1 -1
- package/dist/packages/iryx-ui/src/component-names.js +1 -1
- package/dist/packages/iryx-ui/src/components/Combobox.js +5 -0
- package/dist/packages/iryx-ui/src/components/Combobox.vue_vue_type_script_setup_true_lang.js +284 -0
- package/dist/packages/iryx-ui/src/components/Select.vue_vue_type_script_setup_true_lang.js +72 -27
- package/dist/packages/iryx-ui/src/components/index.js +48 -46
- package/dist/packages/iryx-ui/src/theme/alert.js +2 -2
- package/dist/packages/iryx-ui/src/theme/button.js +2 -2
- package/dist/packages/iryx-ui/src/theme/card.js +1 -1
- package/dist/packages/iryx-ui/src/theme/checkbox.js +1 -1
- package/dist/packages/iryx-ui/src/theme/combobox.js +29 -0
- package/dist/packages/iryx-ui/src/theme/dialog.js +2 -2
- package/dist/packages/iryx-ui/src/theme/dropdown-menu.js +4 -4
- package/dist/packages/iryx-ui/src/theme/input.js +1 -1
- package/dist/packages/iryx-ui/src/theme/number-input.js +1 -1
- package/dist/packages/iryx-ui/src/theme/pagination.js +1 -1
- package/dist/packages/iryx-ui/src/theme/presets.js +0 -42
- package/dist/packages/iryx-ui/src/theme/radio-group.js +1 -1
- package/dist/packages/iryx-ui/src/theme/select.js +5 -3
- package/dist/packages/iryx-ui/src/theme/skeleton.js +1 -1
- package/dist/packages/iryx-ui/src/theme/stepper.js +1 -1
- package/dist/packages/iryx-ui/src/theme/switch.js +1 -1
- package/dist/packages/iryx-ui/src/theme/tabs.js +3 -3
- package/dist/packages/iryx-ui/src/theme/toast.js +3 -3
- package/dist/packages/iryx-ui/src/theme/tooltip.js +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/theme/button.d.ts +2 -2
- package/dist/theme/combobox.d.ts +101 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/input.d.ts +5 -5
- package/dist/theme/presets.d.ts +0 -42
- package/dist/theme/select.d.ts +6 -0
- package/package.json +1 -1
- package/theme.css +14 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { ArrowDown01Icon as e, Tick02Icon 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 { comboboxTheme as ee } from "../theme/combobox.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, vShow as x, withCtx as S, withDirectives as te } from "vue";
|
|
7
|
+
import { ComboboxAnchor as ne, ComboboxContent as re, ComboboxEmpty as ie, ComboboxGroup as ae, ComboboxInput as oe, ComboboxItem as C, ComboboxItemIndicator as w, ComboboxLabel as T, ComboboxPortal as se, ComboboxRoot as E, ComboboxTrigger as D, ComboboxViewport as O, ComboboxVirtualizer as k, useFilter as A, useForwardPropsEmits as j } from "reka-ui";
|
|
8
|
+
//#region src/components/Combobox.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var M = /*@__PURE__*/ f({
|
|
10
|
+
__name: "Combobox",
|
|
11
|
+
props: {
|
|
12
|
+
items: {},
|
|
13
|
+
placeholder: {},
|
|
14
|
+
size: {},
|
|
15
|
+
invalid: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
id: {},
|
|
20
|
+
emptyText: { default: "No results found." },
|
|
21
|
+
create: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
createLabel: {
|
|
26
|
+
type: Function,
|
|
27
|
+
default: (e) => `Create "${e}"`
|
|
28
|
+
},
|
|
29
|
+
virtual: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
estimateSize: { default: 32 },
|
|
34
|
+
overscan: { default: 12 },
|
|
35
|
+
unstyled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
class: {},
|
|
40
|
+
ui: {},
|
|
41
|
+
open: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
defaultOpen: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: void 0
|
|
48
|
+
},
|
|
49
|
+
resetSearchTermOnBlur: { type: Boolean },
|
|
50
|
+
resetSearchTermOnSelect: { type: Boolean },
|
|
51
|
+
openOnFocus: { type: Boolean },
|
|
52
|
+
openOnClick: { type: Boolean },
|
|
53
|
+
ignoreFilter: { type: Boolean },
|
|
54
|
+
resetModelValueOnClear: { type: Boolean },
|
|
55
|
+
modelValue: {},
|
|
56
|
+
defaultValue: {},
|
|
57
|
+
multiple: { type: Boolean },
|
|
58
|
+
dir: {},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
highlightOnHover: { type: Boolean },
|
|
64
|
+
by: {},
|
|
65
|
+
asChild: { type: Boolean },
|
|
66
|
+
as: {},
|
|
67
|
+
name: {},
|
|
68
|
+
required: { type: Boolean }
|
|
69
|
+
},
|
|
70
|
+
emits: [
|
|
71
|
+
"update:modelValue",
|
|
72
|
+
"highlight",
|
|
73
|
+
"update:open",
|
|
74
|
+
"create"
|
|
75
|
+
],
|
|
76
|
+
setup(f, { emit: M }) {
|
|
77
|
+
let N = f, P = M, F = j(o(() => {
|
|
78
|
+
let { items: e, placeholder: t, size: n, invalid: r, id: i, emptyText: ee, create: a, createLabel: o, virtual: s, estimateSize: c, overscan: l, unstyled: u, class: d, ui: f, ...p } = N;
|
|
79
|
+
return p;
|
|
80
|
+
}), P);
|
|
81
|
+
function I(e) {
|
|
82
|
+
return typeof e == "string" ? {
|
|
83
|
+
label: e,
|
|
84
|
+
value: e
|
|
85
|
+
} : e;
|
|
86
|
+
}
|
|
87
|
+
function L(e) {
|
|
88
|
+
return typeof e != "string" && "items" in e;
|
|
89
|
+
}
|
|
90
|
+
let R = o(() => {
|
|
91
|
+
let e = N.items ?? [];
|
|
92
|
+
return e.some(L) ? e.map((e) => L(e) ? e : {
|
|
93
|
+
label: "",
|
|
94
|
+
items: [e]
|
|
95
|
+
}) : void 0;
|
|
96
|
+
}), z = o(() => (N.items ?? []).flatMap((e) => L(e) ? e.items.map(I) : [I(e)])), B = o(() => !!N.virtual), V = g(""), H = g("");
|
|
97
|
+
function U(e) {
|
|
98
|
+
H.value = e.target.value;
|
|
99
|
+
}
|
|
100
|
+
let { contains: W } = A({ sensitivity: "base" }), G = o(() => {
|
|
101
|
+
let e = H.value.trim();
|
|
102
|
+
return e ? z.value.filter((t) => W(t.label, e)) : z.value;
|
|
103
|
+
});
|
|
104
|
+
function ce(e) {
|
|
105
|
+
let t = (e) => z.value.find((t) => t.value === e)?.label ?? String(e ?? "");
|
|
106
|
+
return Array.isArray(e) ? e.map(t).join(", ") : e == null || e === "" ? "" : t(e);
|
|
107
|
+
}
|
|
108
|
+
function le(e) {
|
|
109
|
+
let t = e.target;
|
|
110
|
+
requestAnimationFrame(() => {
|
|
111
|
+
document.activeElement === t && t.select();
|
|
112
|
+
}), H.value = "";
|
|
113
|
+
}
|
|
114
|
+
let K = o(() => {
|
|
115
|
+
let e = H.value.trim();
|
|
116
|
+
return !!N.create && e.length > 0 && !z.value.some((t) => t.label.toLowerCase() === e.toLowerCase());
|
|
117
|
+
});
|
|
118
|
+
function q(e) {
|
|
119
|
+
e.preventDefault(), P("create", H.value.trim()), e.target?.dispatchEvent(new KeyboardEvent("keydown", {
|
|
120
|
+
key: "Escape",
|
|
121
|
+
bubbles: !0
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
let J = i(), ue = o(() => N.id ?? J?.id.value), Y = o(() => N.invalid ?? J?.invalid.value ?? !1), de = n(), X = o(() => N.unstyled ?? de.unstyled), Z = o(() => ee({
|
|
125
|
+
size: N.size,
|
|
126
|
+
invalid: Y.value,
|
|
127
|
+
disabled: N.disabled
|
|
128
|
+
}));
|
|
129
|
+
function Q(e, t) {
|
|
130
|
+
let n = N.ui?.[e];
|
|
131
|
+
return X.value ? [n, t] : Z.value[e]({ class: [n, t] });
|
|
132
|
+
}
|
|
133
|
+
let $ = o(() => X.value ? void 0 : Z.value.itemIndicator());
|
|
134
|
+
return (n, i) => (h(), s(b(E), p(b(F), {
|
|
135
|
+
"open-on-click": "",
|
|
136
|
+
class: "contents"
|
|
137
|
+
}), {
|
|
138
|
+
default: S(() => [d(b(ne), { class: m(Q("anchor", N.class)) }, {
|
|
139
|
+
default: S(() => [d(b(oe), {
|
|
140
|
+
id: ue.value,
|
|
141
|
+
modelValue: V.value,
|
|
142
|
+
"onUpdate:modelValue": i[0] ||= (e) => V.value = e,
|
|
143
|
+
placeholder: N.placeholder,
|
|
144
|
+
"display-value": ce,
|
|
145
|
+
"aria-invalid": Y.value || void 0,
|
|
146
|
+
"aria-describedby": b(J)?.describedBy.value,
|
|
147
|
+
class: m(Q("input")),
|
|
148
|
+
onFocus: le,
|
|
149
|
+
onInput: U
|
|
150
|
+
}, null, 8, [
|
|
151
|
+
"id",
|
|
152
|
+
"modelValue",
|
|
153
|
+
"placeholder",
|
|
154
|
+
"aria-invalid",
|
|
155
|
+
"aria-describedby",
|
|
156
|
+
"class"
|
|
157
|
+
]), d(b(D), { class: m(Q("trigger")) }, {
|
|
158
|
+
default: S(() => [d(r, { icon: b(e) }, null, 8, ["icon"])]),
|
|
159
|
+
_: 1
|
|
160
|
+
}, 8, ["class"])]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["class"]), d(b(se), null, {
|
|
163
|
+
default: S(() => [d(b(re), {
|
|
164
|
+
class: m(Q("content")),
|
|
165
|
+
position: "popper",
|
|
166
|
+
"side-offset": 4
|
|
167
|
+
}, {
|
|
168
|
+
default: S(() => [d(b(O), { class: m(Q("viewport")) }, {
|
|
169
|
+
default: S(() => [
|
|
170
|
+
B.value ? te((h(), l("div", {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: m(Q("empty"))
|
|
173
|
+
}, [v(n.$slots, "empty", { query: H.value }, () => [u(y(N.emptyText), 1)])], 2)), [[x, !K.value && G.value.length === 0]]) : K.value ? c("", !0) : (h(), s(b(ie), {
|
|
174
|
+
key: 1,
|
|
175
|
+
class: m(Q("empty"))
|
|
176
|
+
}, {
|
|
177
|
+
default: S(() => [v(n.$slots, "empty", { query: H.value }, () => [u(y(N.emptyText), 1)])]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 8, ["class"])),
|
|
180
|
+
v(n.$slots, "default", {}, () => [B.value ? (h(), s(b(k), {
|
|
181
|
+
key: 0,
|
|
182
|
+
options: G.value,
|
|
183
|
+
"estimate-size": N.estimateSize,
|
|
184
|
+
overscan: N.overscan,
|
|
185
|
+
"text-content": (e) => e.label
|
|
186
|
+
}, {
|
|
187
|
+
default: S(({ option: e }) => [d(b(C), {
|
|
188
|
+
value: e.value,
|
|
189
|
+
"text-value": e.label,
|
|
190
|
+
disabled: e.disabled,
|
|
191
|
+
class: m(Q("item"))
|
|
192
|
+
}, {
|
|
193
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
194
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
195
|
+
_: 1
|
|
196
|
+
}, 8, ["class"]), u(" " + y(e.label), 1)]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, 1032, [
|
|
199
|
+
"value",
|
|
200
|
+
"text-value",
|
|
201
|
+
"disabled",
|
|
202
|
+
"class"
|
|
203
|
+
])]),
|
|
204
|
+
_: 1
|
|
205
|
+
}, 8, [
|
|
206
|
+
"options",
|
|
207
|
+
"estimate-size",
|
|
208
|
+
"overscan",
|
|
209
|
+
"text-content"
|
|
210
|
+
])) : R.value ? (h(!0), l(a, { key: 1 }, _(R.value, (e, n) => (h(), s(b(ae), {
|
|
211
|
+
key: e.label || n,
|
|
212
|
+
class: m(Q("group"))
|
|
213
|
+
}, {
|
|
214
|
+
default: S(() => [e.label ? (h(), s(b(T), {
|
|
215
|
+
key: 0,
|
|
216
|
+
class: m(Q("groupLabel"))
|
|
217
|
+
}, {
|
|
218
|
+
default: S(() => [u(y(e.label), 1)]),
|
|
219
|
+
_: 2
|
|
220
|
+
}, 1032, ["class"])) : c("", !0), (h(!0), l(a, null, _(e.items, (e) => (h(), s(b(C), {
|
|
221
|
+
key: typeof e == "string" ? e : e.value,
|
|
222
|
+
value: typeof e == "string" ? e : e.value,
|
|
223
|
+
"text-value": typeof e == "string" ? e : e.label,
|
|
224
|
+
disabled: typeof e == "string" ? void 0 : e.disabled,
|
|
225
|
+
class: m(Q("item"))
|
|
226
|
+
}, {
|
|
227
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
228
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
229
|
+
_: 1
|
|
230
|
+
}, 8, ["class"]), u(" " + y(typeof e == "string" ? e : e.label), 1)]),
|
|
231
|
+
_: 2
|
|
232
|
+
}, 1032, [
|
|
233
|
+
"value",
|
|
234
|
+
"text-value",
|
|
235
|
+
"disabled",
|
|
236
|
+
"class"
|
|
237
|
+
]))), 128))]),
|
|
238
|
+
_: 2
|
|
239
|
+
}, 1032, ["class"]))), 128)) : (h(!0), l(a, { key: 2 }, _(z.value, (e) => (h(), s(b(C), {
|
|
240
|
+
key: e.value,
|
|
241
|
+
value: e.value,
|
|
242
|
+
"text-value": e.label,
|
|
243
|
+
disabled: e.disabled,
|
|
244
|
+
class: m(Q("item"))
|
|
245
|
+
}, {
|
|
246
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
247
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, ["class"]), u(" " + y(e.label), 1)]),
|
|
250
|
+
_: 2
|
|
251
|
+
}, 1032, [
|
|
252
|
+
"value",
|
|
253
|
+
"text-value",
|
|
254
|
+
"disabled",
|
|
255
|
+
"class"
|
|
256
|
+
]))), 128))]),
|
|
257
|
+
K.value ? (h(), s(b(C), {
|
|
258
|
+
key: H.value,
|
|
259
|
+
value: H.value,
|
|
260
|
+
"data-create": "",
|
|
261
|
+
"text-value": H.value,
|
|
262
|
+
class: m(Q("item")),
|
|
263
|
+
onSelect: q
|
|
264
|
+
}, {
|
|
265
|
+
default: S(() => [v(n.$slots, "create", { query: H.value }, () => [u(y(N.createLabel(H.value.trim())), 1)])]),
|
|
266
|
+
_: 3
|
|
267
|
+
}, 8, [
|
|
268
|
+
"value",
|
|
269
|
+
"text-value",
|
|
270
|
+
"class"
|
|
271
|
+
])) : c("", !0)
|
|
272
|
+
]),
|
|
273
|
+
_: 3
|
|
274
|
+
}, 8, ["class"])]),
|
|
275
|
+
_: 3
|
|
276
|
+
}, 8, ["class"])]),
|
|
277
|
+
_: 3
|
|
278
|
+
})]),
|
|
279
|
+
_: 3
|
|
280
|
+
}, 16));
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
//#endregion
|
|
284
|
+
export { M as default };
|
|
@@ -2,10 +2,10 @@ import { ArrowDown01Icon as e, Tick02Icon as t } from "../../../../node_modules/
|
|
|
2
2
|
import { useIryxUiConfig as n } from "../config.js";
|
|
3
3
|
import r from "./Icon.js";
|
|
4
4
|
import { selectTheme as i } from "../theme/select.js";
|
|
5
|
-
import { Fragment as a, computed as o, createBlock as s,
|
|
6
|
-
import { SelectContent as
|
|
5
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
6
|
+
import { SelectContent as S, SelectGroup as C, SelectIcon as w, SelectItem as T, SelectItemIndicator as E, SelectItemText as D, SelectLabel as O, SelectPortal as k, SelectRoot as A, SelectTrigger as j, SelectValue as M, SelectViewport as N, useForwardPropsEmits as P } from "reka-ui";
|
|
7
7
|
//#region src/components/Select.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var F = /*@__PURE__*/ f({
|
|
9
9
|
__name: "Select",
|
|
10
10
|
props: {
|
|
11
11
|
items: {},
|
|
@@ -30,39 +30,84 @@ var M = /*@__PURE__*/ d({
|
|
|
30
30
|
required: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:modelValue", "update:open"],
|
|
33
|
-
setup(
|
|
34
|
-
let
|
|
35
|
-
let { items: e, placeholder: t, size: n, unstyled: r, class: i, ui: a, ...o } =
|
|
33
|
+
setup(f, { emit: F }) {
|
|
34
|
+
let I = f, L = F, R = P(o(() => {
|
|
35
|
+
let { items: e, placeholder: t, size: n, unstyled: r, class: i, ui: a, ...o } = I;
|
|
36
36
|
return o;
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}), L);
|
|
38
|
+
function z(e) {
|
|
39
|
+
return typeof e == "string" ? {
|
|
40
|
+
label: e,
|
|
41
|
+
value: e
|
|
42
|
+
} : e;
|
|
43
|
+
}
|
|
44
|
+
function B(e) {
|
|
45
|
+
return typeof e != "string" && "items" in e;
|
|
46
|
+
}
|
|
47
|
+
let V = o(() => {
|
|
48
|
+
let e = I.items ?? [];
|
|
49
|
+
if (e.some(B)) return e.map((e) => B(e) ? {
|
|
50
|
+
label: e.label,
|
|
51
|
+
options: e.items.map(z)
|
|
52
|
+
} : {
|
|
53
|
+
label: "",
|
|
54
|
+
options: [z(e)]
|
|
55
|
+
});
|
|
56
|
+
}), H = o(() => (I.items ?? []).flatMap((e) => B(e) ? e.items.map(z) : [z(e)])), U = n(), W = o(() => I.unstyled ?? U.unstyled), G = o(() => i({ size: I.size })), K = o(() => W.value ? [I.ui?.trigger, I.class] : G.value.trigger({ class: [I.ui?.trigger, I.class] })), q = o(() => W.value ? I.ui?.content : G.value.content({ class: I.ui?.content })), J = o(() => W.value ? I.ui?.viewport : G.value.viewport({ class: I.ui?.viewport })), Y = o(() => W.value ? I.ui?.item : G.value.item({ class: I.ui?.item })), X = o(() => W.value ? void 0 : G.value.itemIndicator()), Z = o(() => W.value ? I.ui?.group : G.value.group({ class: I.ui?.group })), Q = o(() => W.value ? I.ui?.groupLabel : G.value.groupLabel({ class: I.ui?.groupLabel }));
|
|
57
|
+
return (n, i) => (g(), s(b(A), h(p(b(R))), {
|
|
58
|
+
default: x(() => [d(b(j), { class: m(K.value) }, {
|
|
59
|
+
default: x(() => [d(b(M), { placeholder: I.placeholder }, null, 8, ["placeholder"]), d(b(w), { "as-child": "" }, {
|
|
60
|
+
default: x(() => [d(r, { icon: b(e) }, null, 8, ["icon"])]),
|
|
45
61
|
_: 1
|
|
46
62
|
})]),
|
|
47
63
|
_: 1
|
|
48
|
-
}, 8, ["class"]),
|
|
49
|
-
default:
|
|
50
|
-
class:
|
|
51
|
-
position: "
|
|
52
|
-
"side-offset": 4
|
|
64
|
+
}, 8, ["class"]), d(b(k), null, {
|
|
65
|
+
default: x(() => [d(b(S), {
|
|
66
|
+
class: m(q.value),
|
|
67
|
+
position: "item-aligned"
|
|
53
68
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
default:
|
|
69
|
+
default: x(() => [d(b(N), { class: m(J.value) }, {
|
|
70
|
+
default: x(() => [v(n.$slots, "default", {}, () => [V.value ? (g(!0), l(a, { key: 0 }, _(V.value, (e, n) => (g(), s(b(C), {
|
|
71
|
+
key: e.label || n,
|
|
72
|
+
class: m(Z.value)
|
|
73
|
+
}, {
|
|
74
|
+
default: x(() => [e.label ? (g(), s(b(O), {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: m(Q.value)
|
|
77
|
+
}, {
|
|
78
|
+
default: x(() => [u(y(e.label), 1)]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, 1032, ["class"])) : c("", !0), (g(!0), l(a, null, _(e.options, (e) => (g(), s(b(T), {
|
|
81
|
+
key: e.value,
|
|
82
|
+
value: e.value,
|
|
83
|
+
disabled: e.disabled,
|
|
84
|
+
class: m(Y.value)
|
|
85
|
+
}, {
|
|
86
|
+
default: x(() => [d(b(E), { class: m(X.value) }, {
|
|
87
|
+
default: x(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
88
|
+
_: 1
|
|
89
|
+
}, 8, ["class"]), d(b(D), null, {
|
|
90
|
+
default: x(() => [u(y(e.label), 1)]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1024)]),
|
|
93
|
+
_: 2
|
|
94
|
+
}, 1032, [
|
|
95
|
+
"value",
|
|
96
|
+
"disabled",
|
|
97
|
+
"class"
|
|
98
|
+
]))), 128))]),
|
|
99
|
+
_: 2
|
|
100
|
+
}, 1032, ["class"]))), 128)) : (g(!0), l(a, { key: 1 }, _(H.value, (e) => (g(), s(b(T), {
|
|
56
101
|
key: e.value,
|
|
57
102
|
value: e.value,
|
|
58
103
|
disabled: e.disabled,
|
|
59
|
-
class:
|
|
104
|
+
class: m(Y.value)
|
|
60
105
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
default:
|
|
106
|
+
default: x(() => [d(b(E), { class: m(X.value) }, {
|
|
107
|
+
default: x(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
63
108
|
_: 1
|
|
64
|
-
}, 8, ["class"]),
|
|
65
|
-
default:
|
|
109
|
+
}, 8, ["class"]), d(b(D), null, {
|
|
110
|
+
default: x(() => [u(y(e.label), 1)]),
|
|
66
111
|
_: 2
|
|
67
112
|
}, 1024)]),
|
|
68
113
|
_: 2
|
|
@@ -82,4 +127,4 @@ var M = /*@__PURE__*/ d({
|
|
|
82
127
|
}
|
|
83
128
|
});
|
|
84
129
|
//#endregion
|
|
85
|
-
export {
|
|
130
|
+
export { F as default };
|
|
@@ -7,30 +7,31 @@ import a from "./Button.js";
|
|
|
7
7
|
import o from "./ButtonGroup.js";
|
|
8
8
|
import s from "./Card.js";
|
|
9
9
|
import c from "./Checkbox.js";
|
|
10
|
-
import l from "./
|
|
11
|
-
import u from "./
|
|
12
|
-
import d from "./
|
|
13
|
-
import f from "./
|
|
14
|
-
import p from "./
|
|
15
|
-
import m from "./
|
|
16
|
-
import h from "./
|
|
17
|
-
import g from "./
|
|
18
|
-
import _ from "./
|
|
19
|
-
import v from "./
|
|
20
|
-
import y from "./
|
|
21
|
-
import b from "./
|
|
22
|
-
import x from "./
|
|
23
|
-
import S from "./
|
|
24
|
-
import C from "./
|
|
25
|
-
import w from "./
|
|
26
|
-
import T from "./
|
|
27
|
-
import E from "./
|
|
28
|
-
import D from "./
|
|
29
|
-
import O from "./
|
|
30
|
-
import k from "./
|
|
31
|
-
import A from "./
|
|
10
|
+
import l from "./Combobox.js";
|
|
11
|
+
import u from "./Dialog.js";
|
|
12
|
+
import d from "./ConfirmDialog.js";
|
|
13
|
+
import f from "./DropdownMenu.js";
|
|
14
|
+
import p from "./EmptyState.js";
|
|
15
|
+
import m from "./Form.js";
|
|
16
|
+
import h from "./Label.js";
|
|
17
|
+
import g from "./FormField.js";
|
|
18
|
+
import _ from "./Input.js";
|
|
19
|
+
import v from "./NumberInput.js";
|
|
20
|
+
import y from "./Pagination.js";
|
|
21
|
+
import b from "./Progress.js";
|
|
22
|
+
import x from "./RadioGroup.js";
|
|
23
|
+
import S from "./Select.js";
|
|
24
|
+
import C from "./Separator.js";
|
|
25
|
+
import w from "./Skeleton.js";
|
|
26
|
+
import T from "./Stat.js";
|
|
27
|
+
import E from "./Stepper.js";
|
|
28
|
+
import D from "./Switch.js";
|
|
29
|
+
import O from "./Tabs.js";
|
|
30
|
+
import k from "./Textarea.js";
|
|
31
|
+
import A from "./Toaster.js";
|
|
32
|
+
import j from "./Tooltip.js";
|
|
32
33
|
//#region src/components/index.ts
|
|
33
|
-
var
|
|
34
|
+
var M = /* @__PURE__ */ e({
|
|
34
35
|
Alert: () => t,
|
|
35
36
|
App: () => n,
|
|
36
37
|
Badge: () => r,
|
|
@@ -39,28 +40,29 @@ var j = /* @__PURE__ */ e({
|
|
|
39
40
|
ButtonGroup: () => o,
|
|
40
41
|
Card: () => s,
|
|
41
42
|
Checkbox: () => c,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
Combobox: () => l,
|
|
44
|
+
ConfirmDialog: () => d,
|
|
45
|
+
Dialog: () => u,
|
|
46
|
+
DropdownMenu: () => f,
|
|
47
|
+
EmptyState: () => p,
|
|
48
|
+
Form: () => m,
|
|
49
|
+
FormField: () => g,
|
|
50
|
+
Input: () => _,
|
|
51
|
+
Label: () => h,
|
|
52
|
+
NumberInput: () => v,
|
|
53
|
+
Pagination: () => y,
|
|
54
|
+
Progress: () => b,
|
|
55
|
+
RadioGroup: () => x,
|
|
56
|
+
Select: () => S,
|
|
57
|
+
Separator: () => C,
|
|
58
|
+
Skeleton: () => w,
|
|
59
|
+
Stat: () => T,
|
|
60
|
+
Stepper: () => E,
|
|
61
|
+
Switch: () => D,
|
|
62
|
+
Tabs: () => O,
|
|
63
|
+
Textarea: () => k,
|
|
64
|
+
Toaster: () => A,
|
|
65
|
+
Tooltip: () => j
|
|
64
66
|
});
|
|
65
67
|
//#endregion
|
|
66
|
-
export {
|
|
68
|
+
export { M as components_exports };
|
|
@@ -2,12 +2,12 @@ import { tv as e } from "tailwind-variants";
|
|
|
2
2
|
//#region src/theme/alert.ts
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: {
|
|
5
|
-
root: "flex w-full gap-3 rounded-
|
|
5
|
+
root: "flex w-full gap-3 rounded-xl border p-4",
|
|
6
6
|
icon: "mt-0.5 shrink-0 [&_svg]:size-5",
|
|
7
7
|
content: "min-w-0 flex-1",
|
|
8
8
|
title: "text-sm font-medium",
|
|
9
9
|
description: "text-sm opacity-90",
|
|
10
|
-
close: "-m-1 shrink-0 self-start rounded-
|
|
10
|
+
close: "-m-1 shrink-0 self-start rounded-lg p-1 opacity-70 transition-opacity outline-none hover:opacity-100 focus-visible:ring-2 focus-visible:ring-current/50 [&_svg]:size-4"
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { tv as e } from "tailwind-variants";
|
|
2
2
|
//#region src/theme/button.ts
|
|
3
3
|
var t = e({
|
|
4
|
-
base: "inline-flex shrink-0 items-center justify-center gap-2 rounded-
|
|
4
|
+
base: "inline-flex shrink-0 items-center justify-center gap-2 rounded-xl border border-transparent font-medium transition-[color,background-color,border-color,box-shadow,opacity,filter,translate] outline-none focus-visible:ring-2 focus-visible:ring-primary/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
5
5
|
variants: {
|
|
6
6
|
variant: {
|
|
7
7
|
solid: "bg-linear-to-b from-primary-from to-primary-to text-primary-foreground hover:brightness-110 active:brightness-95",
|
|
8
|
-
outline: "border-border bg-
|
|
8
|
+
outline: "border-border bg-input text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
9
9
|
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
10
10
|
link: "text-primary underline-offset-4 hover:underline active:translate-y-0"
|
|
11
11
|
},
|
|
@@ -2,7 +2,7 @@ import { tv as e } from "tailwind-variants";
|
|
|
2
2
|
//#region src/theme/card.ts
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: {
|
|
5
|
-
root: "rounded-
|
|
5
|
+
root: "rounded-2xl text-foreground",
|
|
6
6
|
header: "flex flex-col gap-1",
|
|
7
7
|
title: "text-base leading-none font-semibold",
|
|
8
8
|
description: "text-sm text-muted-foreground",
|
|
@@ -3,7 +3,7 @@ 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-colors outline-none focus
|
|
6
|
+
root: "peer flex shrink-0 cursor-pointer items-center justify-center rounded border border-border bg-background text-primary-foreground transition-colors outline-none focus:ring-2 focus: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",
|
|
7
7
|
indicator: "flex items-center justify-center text-current",
|
|
8
8
|
content: "grid gap-1",
|
|
9
9
|
label: "text-sm leading-5 font-medium text-foreground select-none",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { fieldBase as e } from "./input.js";
|
|
2
|
+
import { tv as t } from "tailwind-variants";
|
|
3
|
+
//#region src/theme/combobox.ts
|
|
4
|
+
var n = t({
|
|
5
|
+
slots: {
|
|
6
|
+
anchor: `flex items-center gap-2 ${e} focus-within:ring-2 focus-within:ring-primary/50`,
|
|
7
|
+
input: "min-w-0 grow bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",
|
|
8
|
+
trigger: "flex shrink-0 cursor-pointer items-center text-muted-foreground disabled:cursor-not-allowed [&_svg]:size-4",
|
|
9
|
+
content: "z-50 max-h-64 w-(--reka-combobox-trigger-width) min-w-32 overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-md",
|
|
10
|
+
viewport: "max-h-64 overflow-y-auto p-1",
|
|
11
|
+
item: "relative flex w-full cursor-pointer items-center rounded-lg py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
12
|
+
itemIndicator: "absolute left-2 flex items-center justify-center text-primary [&_svg]:size-4",
|
|
13
|
+
empty: "px-2 py-6 text-center text-sm text-muted-foreground",
|
|
14
|
+
group: "[[role=group]:not([hidden])~&]:mt-1",
|
|
15
|
+
groupLabel: "px-2 py-1.5 text-xs font-medium text-muted-foreground"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
sm: { anchor: "h-8 px-2.5 text-sm" },
|
|
20
|
+
md: { anchor: "h-9 px-3 text-sm" },
|
|
21
|
+
lg: { anchor: "h-10 px-4 text-base" }
|
|
22
|
+
},
|
|
23
|
+
invalid: { true: { anchor: "border-red-500 focus-within:ring-red-500/40" } },
|
|
24
|
+
disabled: { true: { anchor: "cursor-not-allowed opacity-50" } }
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: { size: "md" }
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as comboboxTheme };
|
|
@@ -3,13 +3,13 @@ import { tv as e } from "tailwind-variants";
|
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: {
|
|
5
5
|
overlay: "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",
|
|
6
|
-
content: "fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-
|
|
6
|
+
content: "fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-2xl border border-border bg-background p-6 text-foreground shadow-lg outline-none data-[state=closed]:animate-dialog-out data-[state=open]:animate-dialog-in",
|
|
7
7
|
header: "flex flex-col gap-1",
|
|
8
8
|
title: "text-base leading-none font-semibold",
|
|
9
9
|
description: "text-sm text-muted-foreground",
|
|
10
10
|
body: "-m-1 min-h-0 flex-1 overflow-y-auto p-1",
|
|
11
11
|
footer: "flex flex-wrap items-center justify-end gap-2",
|
|
12
|
-
close: "absolute top-4 right-4 rounded-
|
|
12
|
+
close: "absolute top-4 right-4 rounded-lg p-1 text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-primary/50 [&_svg]:size-4"
|
|
13
13
|
},
|
|
14
14
|
variants: { size: {
|
|
15
15
|
sm: { content: "sm:max-w-sm" },
|
|
@@ -2,12 +2,12 @@ import { tv as e } from "tailwind-variants";
|
|
|
2
2
|
//#region src/theme/dropdown-menu.ts
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: {
|
|
5
|
-
content: "z-50 min-w-40 overflow-hidden rounded-
|
|
6
|
-
item: "flex cursor-pointer items-center gap-2 rounded-
|
|
5
|
+
content: "z-50 min-w-40 overflow-hidden rounded-xl border border-border bg-background p-1 text-foreground shadow-lg outline-none data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",
|
|
6
|
+
item: "flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0",
|
|
7
7
|
label: "px-2 py-1.5 text-xs font-medium text-muted-foreground",
|
|
8
8
|
separator: "-mx-1 my-1 h-px bg-border",
|
|
9
|
-
subTrigger: "flex cursor-default items-center gap-2 rounded-
|
|
10
|
-
subContent: "z-50 min-w-40 overflow-hidden rounded-
|
|
9
|
+
subTrigger: "flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0",
|
|
10
|
+
subContent: "z-50 min-w-40 overflow-hidden rounded-xl border border-border bg-background p-1 text-foreground shadow-lg outline-none data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",
|
|
11
11
|
subTriggerIcon: "ml-auto"
|
|
12
12
|
},
|
|
13
13
|
variants: { danger: { true: { item: "text-danger data-[highlighted]:bg-danger-muted data-[highlighted]:text-danger-muted-foreground" } } }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tv as e } from "tailwind-variants";
|
|
2
2
|
//#region src/theme/input.ts
|
|
3
|
-
var t = "w-full rounded-
|
|
3
|
+
var t = "w-full rounded-xl border border-border bg-input text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", n = e({
|
|
4
4
|
base: `flex ${t}`,
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
@@ -5,7 +5,7 @@ var n = t({
|
|
|
5
5
|
slots: {
|
|
6
6
|
root: "relative inline-flex w-full items-stretch",
|
|
7
7
|
input: `flex w-full text-right tabular-nums ${e}`,
|
|
8
|
-
stepper: "absolute inset-y-px end-px flex flex-col justify-center overflow-hidden rounded-e-
|
|
8
|
+
stepper: "absolute inset-y-px end-px flex flex-col justify-center overflow-hidden rounded-e-xl border-s border-border",
|
|
9
9
|
step: "flex flex-1 items-center justify-center px-1.5 text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3"
|
|
10
10
|
},
|
|
11
11
|
variants: {
|