iryx-ui 0.27.0 → 0.29.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/dist/components/AppShell.vue.d.ts +13 -7
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +58 -48
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/DonutChart.vue.d.ts +9 -0
- package/dist/components/DonutChart.vue_vue_type_script_setup_true_lang.js +73 -65
- package/dist/components/Input.vue.d.ts +1 -1
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +192 -177
- package/dist/components/Select.vue.d.ts +2 -0
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/Sidebar.vue.d.ts +3 -0
- package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +65 -62
- package/dist/components/Stat.vue.d.ts +12 -2
- package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +16 -3
- package/dist/components/Textarea.vue.d.ts +1 -1
- package/dist/components/ToggleGroup.vue.d.ts +1 -1
- package/dist/components/ToggleGroup.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/composables/character-count.d.ts +1 -1
- package/dist/composables/character-count.js +8 -5
- package/dist/composables/sidebar.d.ts +11 -1
- package/dist/composables/sidebar.js +24 -13
- package/dist/index.js +166 -166
- package/dist/nuxt.js +3 -2
- package/dist/theme/app-shell.d.ts +3 -0
- package/dist/theme/app-shell.js +2 -1
- package/dist/theme/stat.d.ts +3 -0
- package/dist/theme/stat.js +2 -1
- package/package.json +2 -2
- package/theme.css +2 -2
|
@@ -8,12 +8,12 @@ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d
|
|
|
8
8
|
import { ArrowRight01Icon as k } from "@hugeicons/core-free-icons";
|
|
9
9
|
import { CollapsibleContent as A, CollapsibleRoot as j, CollapsibleTrigger as M, Primitive as N } from "reka-ui";
|
|
10
10
|
//#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var P = [
|
|
11
|
+
var P = ["data-pinned"], F = [
|
|
12
12
|
"aria-label",
|
|
13
13
|
"disabled",
|
|
14
14
|
"data-active",
|
|
15
15
|
"data-disabled"
|
|
16
|
-
],
|
|
16
|
+
], I = /*@__PURE__*/ g({
|
|
17
17
|
__name: "Sidebar",
|
|
18
18
|
props: /*@__PURE__*/ v({
|
|
19
19
|
items: {},
|
|
@@ -39,17 +39,17 @@ var P = [
|
|
|
39
39
|
}),
|
|
40
40
|
emits: ["update:collapsed"],
|
|
41
41
|
setup(g) {
|
|
42
|
-
let v = g,
|
|
42
|
+
let v = g, I = D(g, "collapsed"), L = _(r, void 0), R = l(() => I.value && L !== "drawer"), z = e(), B = l(() => v.unstyled ?? z.unstyled), V = l(() => i(v.items)), H = l(() => V.value.findIndex((e) => e.pinned)), U = l(() => s({
|
|
43
43
|
side: v.side,
|
|
44
|
-
collapsed:
|
|
45
|
-
inShell:
|
|
44
|
+
collapsed: R.value,
|
|
45
|
+
inShell: L !== void 0
|
|
46
46
|
}));
|
|
47
|
-
function
|
|
47
|
+
function W(e) {
|
|
48
48
|
let t = v.ui?.[e];
|
|
49
|
-
return
|
|
49
|
+
return B.value ? t : U.value[e]({ class: t });
|
|
50
50
|
}
|
|
51
|
-
let
|
|
52
|
-
function
|
|
51
|
+
let G = l(() => v.side === "right" ? "left" : "right"), K = x({}), q = (e, t) => `${e}:${t.label}`, J = (e) => e.href ? "a" : "button", Y = (e) => [...e.label][0], X = (e) => e.badge === void 0 ? e.label : `${e.label} (${e.badge})`;
|
|
52
|
+
function Z(e) {
|
|
53
53
|
return (e.items ?? []).map((e) => ({
|
|
54
54
|
label: e.label,
|
|
55
55
|
icon: e.icon,
|
|
@@ -58,66 +58,69 @@ var P = [
|
|
|
58
58
|
onSelect: e.onSelect
|
|
59
59
|
}));
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Q(e, t) {
|
|
62
62
|
if (e.disabled) {
|
|
63
63
|
t.preventDefault();
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
e.onSelect?.();
|
|
67
67
|
}
|
|
68
|
-
let
|
|
68
|
+
let $ = (e) => e.label;
|
|
69
69
|
return (e, r) => (b(), u(E(N), {
|
|
70
70
|
as: "nav",
|
|
71
71
|
"aria-label": v.label,
|
|
72
|
-
"data-collapsed":
|
|
73
|
-
class: y(
|
|
72
|
+
"data-collapsed": R.value ? "" : void 0,
|
|
73
|
+
class: y(B.value ? [v.ui?.root, v.class] : U.value.root({ class: [v.ui?.root, v.class] }))
|
|
74
74
|
}, {
|
|
75
75
|
default: O(() => [
|
|
76
76
|
e.$slots.header ? (b(), f("div", {
|
|
77
77
|
key: 0,
|
|
78
|
-
class: y(
|
|
79
|
-
}, [C(e.$slots, "header", { collapsed:
|
|
80
|
-
p("div", { class: y(
|
|
78
|
+
class: y(W("header"))
|
|
79
|
+
}, [C(e.$slots, "header", { collapsed: R.value })], 2)) : d("", !0),
|
|
80
|
+
p("div", { class: y(W("nav")) }, [C(e.$slots, "default", { collapsed: R.value }, () => [(b(!0), f(c, null, S(V.value, (r, i) => (b(), f("div", {
|
|
81
81
|
key: r.section || i,
|
|
82
|
-
|
|
82
|
+
"data-pinned": r.pinned ? "" : void 0,
|
|
83
|
+
class: y([W("section"), i === H.value && "mt-auto"])
|
|
83
84
|
}, [r.section ? (b(), f("p", {
|
|
84
85
|
key: 0,
|
|
85
|
-
class: y(
|
|
86
|
-
}, T(r.section), 3)) : d("", !0), (b(!0), f(c, null, S(r.items, (r) => (b(), f(c, { key: r.label }, [E(n)(r) &&
|
|
86
|
+
class: y(W("sectionLabel"))
|
|
87
|
+
}, T(r.section), 3)) : d("", !0), (b(!0), f(c, null, S(r.items, (r) => (b(), f(c, { key: r.label }, [E(n)(r) && R.value ? (b(), u(a, {
|
|
87
88
|
key: 0,
|
|
88
|
-
text:
|
|
89
|
-
side:
|
|
90
|
-
unstyled:
|
|
89
|
+
text: X(r),
|
|
90
|
+
side: G.value,
|
|
91
|
+
unstyled: B.value
|
|
91
92
|
}, {
|
|
92
93
|
trigger: O(() => [h(o, {
|
|
93
|
-
items:
|
|
94
|
-
side:
|
|
95
|
-
unstyled:
|
|
94
|
+
items: Z(r),
|
|
95
|
+
side: G.value,
|
|
96
|
+
unstyled: B.value,
|
|
97
|
+
ui: v.ui?.menu
|
|
96
98
|
}, {
|
|
97
99
|
trigger: O(() => [p("button", {
|
|
98
100
|
type: "button",
|
|
99
|
-
"aria-label":
|
|
101
|
+
"aria-label": $(r),
|
|
100
102
|
disabled: r.disabled,
|
|
101
103
|
"data-active": r.active ? "" : void 0,
|
|
102
104
|
"data-disabled": r.disabled ? "" : void 0,
|
|
103
|
-
class: y(
|
|
105
|
+
class: y(W("link"))
|
|
104
106
|
}, [C(e.$slots, "link", {
|
|
105
107
|
link: r,
|
|
106
|
-
collapsed:
|
|
108
|
+
collapsed: R.value
|
|
107
109
|
}, () => [r.icon ? (b(), u(t, {
|
|
108
110
|
key: 0,
|
|
109
111
|
icon: r.icon
|
|
110
112
|
}, null, 8, ["icon"])) : (b(), f("span", {
|
|
111
113
|
key: 1,
|
|
112
114
|
"aria-hidden": "true",
|
|
113
|
-
class: y(
|
|
114
|
-
}, T(
|
|
115
|
+
class: y(W("linkInitial"))
|
|
116
|
+
}, T(Y(r)), 3))])], 10, F)]),
|
|
115
117
|
header: O(() => [m(T(r.label), 1)]),
|
|
116
118
|
_: 2
|
|
117
119
|
}, 1032, [
|
|
118
120
|
"items",
|
|
119
121
|
"side",
|
|
120
|
-
"unstyled"
|
|
122
|
+
"unstyled",
|
|
123
|
+
"ui"
|
|
121
124
|
])]),
|
|
122
125
|
_: 2
|
|
123
126
|
}, 1032, [
|
|
@@ -126,25 +129,25 @@ var P = [
|
|
|
126
129
|
"unstyled"
|
|
127
130
|
])) : E(n)(r) ? (b(), u(E(j), {
|
|
128
131
|
key: 1,
|
|
129
|
-
open:
|
|
132
|
+
open: K.value[q(i, r)] ?? r.defaultOpen ?? !1,
|
|
130
133
|
disabled: r.disabled,
|
|
131
|
-
"onUpdate:open": (e) =>
|
|
134
|
+
"onUpdate:open": (e) => K.value[q(i, r)] = e
|
|
132
135
|
}, {
|
|
133
136
|
default: O(() => [h(E(M), {
|
|
134
|
-
"aria-label":
|
|
137
|
+
"aria-label": $(r),
|
|
135
138
|
"data-active": r.active ? "" : void 0,
|
|
136
139
|
"data-disabled": r.disabled ? "" : void 0,
|
|
137
|
-
class: y(
|
|
140
|
+
class: y(W("link"))
|
|
138
141
|
}, {
|
|
139
142
|
default: O(() => [
|
|
140
143
|
r.icon ? (b(), u(t, {
|
|
141
144
|
key: 0,
|
|
142
145
|
icon: r.icon
|
|
143
146
|
}, null, 8, ["icon"])) : d("", !0),
|
|
144
|
-
p("span", { class: y(
|
|
147
|
+
p("span", { class: y(W("linkLabel")) }, T(r.label), 3),
|
|
145
148
|
h(t, {
|
|
146
149
|
icon: E(k),
|
|
147
|
-
class: y(
|
|
150
|
+
class: y(W("groupIcon"))
|
|
148
151
|
}, null, 8, ["icon", "class"])
|
|
149
152
|
]),
|
|
150
153
|
_: 2
|
|
@@ -153,28 +156,28 @@ var P = [
|
|
|
153
156
|
"data-active",
|
|
154
157
|
"data-disabled",
|
|
155
158
|
"class"
|
|
156
|
-
]), h(E(A), { class: y(
|
|
157
|
-
default: O(() => [p("div", { class: y(
|
|
159
|
+
]), h(E(A), { class: y(W("groupContent")) }, {
|
|
160
|
+
default: O(() => [p("div", { class: y(W("groupInner")) }, [(b(!0), f(c, null, S(r.items, (e) => (b(), u(w(J(e)), {
|
|
158
161
|
key: e.label,
|
|
159
162
|
href: e.href,
|
|
160
163
|
type: e.href ? void 0 : "button",
|
|
161
|
-
"aria-label":
|
|
164
|
+
"aria-label": $(e),
|
|
162
165
|
"aria-current": e.active ? "page" : void 0,
|
|
163
166
|
"aria-disabled": e.disabled || void 0,
|
|
164
167
|
"data-active": e.active ? "" : void 0,
|
|
165
168
|
"data-disabled": e.disabled ? "" : void 0,
|
|
166
|
-
class: y(
|
|
167
|
-
onClick: (t) =>
|
|
169
|
+
class: y(W("link")),
|
|
170
|
+
onClick: (t) => Q(e, t)
|
|
168
171
|
}, {
|
|
169
172
|
default: O(() => [
|
|
170
173
|
e.icon ? (b(), u(t, {
|
|
171
174
|
key: 0,
|
|
172
175
|
icon: e.icon
|
|
173
176
|
}, null, 8, ["icon"])) : d("", !0),
|
|
174
|
-
p("span", { class: y(
|
|
177
|
+
p("span", { class: y(W("linkLabel")) }, T(e.label), 3),
|
|
175
178
|
e.badge === void 0 ? d("", !0) : (b(), f("span", {
|
|
176
179
|
key: 1,
|
|
177
|
-
class: y(
|
|
180
|
+
class: y(W("linkBadge"))
|
|
178
181
|
}, T(e.badge), 3))
|
|
179
182
|
]),
|
|
180
183
|
_: 2
|
|
@@ -198,38 +201,38 @@ var P = [
|
|
|
198
201
|
"onUpdate:open"
|
|
199
202
|
])) : (b(), u(a, {
|
|
200
203
|
key: 2,
|
|
201
|
-
text:
|
|
202
|
-
side:
|
|
203
|
-
disabled: !
|
|
204
|
-
unstyled:
|
|
204
|
+
text: X(r),
|
|
205
|
+
side: G.value,
|
|
206
|
+
disabled: !R.value,
|
|
207
|
+
unstyled: B.value
|
|
205
208
|
}, {
|
|
206
|
-
trigger: O(() => [(b(), u(w(
|
|
209
|
+
trigger: O(() => [(b(), u(w(J(r)), {
|
|
207
210
|
href: r.href,
|
|
208
211
|
type: r.href ? void 0 : "button",
|
|
209
|
-
"aria-label":
|
|
212
|
+
"aria-label": $(r),
|
|
210
213
|
"aria-current": r.active ? "page" : void 0,
|
|
211
214
|
"aria-disabled": r.disabled || void 0,
|
|
212
215
|
"data-active": r.active ? "" : void 0,
|
|
213
216
|
"data-disabled": r.disabled ? "" : void 0,
|
|
214
|
-
class: y(
|
|
215
|
-
onClick: (e) =>
|
|
217
|
+
class: y(W("link")),
|
|
218
|
+
onClick: (e) => Q(r, e)
|
|
216
219
|
}, {
|
|
217
220
|
default: O(() => [C(e.$slots, "link", {
|
|
218
221
|
link: r,
|
|
219
|
-
collapsed:
|
|
222
|
+
collapsed: R.value
|
|
220
223
|
}, () => [
|
|
221
224
|
r.icon ? (b(), u(t, {
|
|
222
225
|
key: 0,
|
|
223
226
|
icon: r.icon
|
|
224
|
-
}, null, 8, ["icon"])) :
|
|
227
|
+
}, null, 8, ["icon"])) : R.value ? (b(), f("span", {
|
|
225
228
|
key: 1,
|
|
226
229
|
"aria-hidden": "true",
|
|
227
|
-
class: y(
|
|
228
|
-
}, T(
|
|
229
|
-
p("span", { class: y(
|
|
230
|
+
class: y(W("linkInitial"))
|
|
231
|
+
}, T(Y(r)), 3)) : d("", !0),
|
|
232
|
+
p("span", { class: y(W("linkLabel")) }, T(r.label), 3),
|
|
230
233
|
r.badge === void 0 ? d("", !0) : (b(), f("span", {
|
|
231
234
|
key: 2,
|
|
232
|
-
class: y(
|
|
235
|
+
class: y(W("linkBadge"))
|
|
233
236
|
}, T(r.badge), 3))
|
|
234
237
|
])]),
|
|
235
238
|
_: 2
|
|
@@ -250,11 +253,11 @@ var P = [
|
|
|
250
253
|
"side",
|
|
251
254
|
"disabled",
|
|
252
255
|
"unstyled"
|
|
253
|
-
]))], 64))), 128))],
|
|
256
|
+
]))], 64))), 128))], 10, P))), 128))])], 2),
|
|
254
257
|
e.$slots.footer ? (b(), f("div", {
|
|
255
258
|
key: 1,
|
|
256
|
-
class: y(
|
|
257
|
-
}, [C(e.$slots, "footer", { collapsed:
|
|
259
|
+
class: y(W("footer"))
|
|
260
|
+
}, [C(e.$slots, "footer", { collapsed: R.value })], 2)) : d("", !0)
|
|
258
261
|
]),
|
|
259
262
|
_: 3
|
|
260
263
|
}, 8, [
|
|
@@ -265,4 +268,4 @@ var P = [
|
|
|
265
268
|
}
|
|
266
269
|
});
|
|
267
270
|
//#endregion
|
|
268
|
-
export {
|
|
271
|
+
export { I as default };
|
|
@@ -13,6 +13,8 @@ export interface StatProps {
|
|
|
13
13
|
trend?: 'up' | 'down' | 'neutral';
|
|
14
14
|
/** Secondary text under the value. */
|
|
15
15
|
hint?: string;
|
|
16
|
+
/** Show the delta beside the value, or beside the hint. */
|
|
17
|
+
deltaPlacement?: 'value' | 'hint';
|
|
16
18
|
size?: 'sm' | 'md' | 'lg';
|
|
17
19
|
/**
|
|
18
20
|
* Format the delta. Defaults to a signed percentage; override for other
|
|
@@ -30,11 +32,14 @@ export interface StatProps {
|
|
|
30
32
|
delta?: string;
|
|
31
33
|
hint?: string;
|
|
32
34
|
row?: string;
|
|
35
|
+
hintRow?: string;
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {
|
|
36
39
|
trend: "up" | "down" | "neutral";
|
|
37
|
-
}, __VLS_19: {
|
|
40
|
+
}, __VLS_19: {
|
|
41
|
+
trend: "up" | "down" | "neutral";
|
|
42
|
+
}, __VLS_26: {}, __VLS_28: {};
|
|
38
43
|
type __VLS_Slots = {} & {
|
|
39
44
|
label?: (props: typeof __VLS_8) => any;
|
|
40
45
|
} & {
|
|
@@ -42,11 +47,16 @@ type __VLS_Slots = {} & {
|
|
|
42
47
|
} & {
|
|
43
48
|
delta?: (props: typeof __VLS_12) => any;
|
|
44
49
|
} & {
|
|
45
|
-
|
|
50
|
+
delta?: (props: typeof __VLS_19) => any;
|
|
51
|
+
} & {
|
|
52
|
+
hint?: (props: typeof __VLS_26) => any;
|
|
53
|
+
} & {
|
|
54
|
+
hint?: (props: typeof __VLS_28) => any;
|
|
46
55
|
};
|
|
47
56
|
declare const __VLS_base: import("vue").DefineComponent<StatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<StatProps> & Readonly<{}>, {
|
|
48
57
|
unstyled: boolean;
|
|
49
58
|
as: string;
|
|
59
|
+
deltaPlacement: "value" | "hint";
|
|
50
60
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
61
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
52
62
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,6 +14,7 @@ var x = /*@__PURE__*/ u({
|
|
|
14
14
|
delta: {},
|
|
15
15
|
trend: {},
|
|
16
16
|
hint: {},
|
|
17
|
+
deltaPlacement: { default: "value" },
|
|
17
18
|
size: {},
|
|
18
19
|
formatDelta: {},
|
|
19
20
|
unstyled: {
|
|
@@ -38,7 +39,7 @@ var x = /*@__PURE__*/ u({
|
|
|
38
39
|
}), E = e(), D = r(() => x.unstyled ?? E.unstyled), O = r(() => n({
|
|
39
40
|
size: x.size,
|
|
40
41
|
trend: C.value
|
|
41
|
-
})), k = r(() => D.value ? [x.ui?.root, x.class] : O.value.root({ class: [x.ui?.root, x.class] })), A = r(() => D.value ? x.ui?.label : O.value.label({ class: x.ui?.label })), j = r(() => D.value ? x.ui?.value : O.value.value({ class: x.ui?.value })), M = r(() => D.value ? x.ui?.delta : O.value.delta({ class: x.ui?.delta })), N = r(() => D.value ? x.ui?.hint : O.value.hint({ class: x.ui?.hint })), P = r(() => D.value ? x.ui?.row : O.value.row({ class: x.ui?.row }));
|
|
42
|
+
})), k = r(() => D.value ? [x.ui?.root, x.class] : O.value.root({ class: [x.ui?.root, x.class] })), A = r(() => D.value ? x.ui?.label : O.value.label({ class: x.ui?.label })), j = r(() => D.value ? x.ui?.value : O.value.value({ class: x.ui?.value })), M = r(() => D.value ? x.ui?.delta : O.value.delta({ class: x.ui?.delta })), N = r(() => D.value ? x.ui?.hint : O.value.hint({ class: x.ui?.hint })), P = r(() => D.value ? x.ui?.row : O.value.row({ class: x.ui?.row })), F = r(() => D.value ? x.ui?.hintRow : O.value.hintRow({ class: x.ui?.hintRow })), I = r(() => T.value !== void 0);
|
|
42
43
|
return (e, n) => (f(), i(h(b), {
|
|
43
44
|
as: x.as,
|
|
44
45
|
class: d(k.value)
|
|
@@ -48,15 +49,27 @@ var x = /*@__PURE__*/ u({
|
|
|
48
49
|
key: 0,
|
|
49
50
|
class: d(A.value)
|
|
50
51
|
}, [p(e.$slots, "label", {}, () => [c(m(x.label), 1)])], 2)) : a("", !0),
|
|
51
|
-
s("span", { class: d(P.value) }, [s("span", { class: d(j.value) }, [p(e.$slots, "default", {}, () => [c(m(x.value), 1)])], 2),
|
|
52
|
+
s("span", { class: d(P.value) }, [s("span", { class: d(j.value) }, [p(e.$slots, "default", {}, () => [c(m(x.value), 1)])], 2), x.deltaPlacement === "value" && (I.value || e.$slots.delta) ? (f(), o("span", {
|
|
52
53
|
key: 0,
|
|
53
54
|
class: d(M.value)
|
|
54
55
|
}, [p(e.$slots, "delta", { trend: C.value }, () => [l(t, {
|
|
55
56
|
icon: w.value,
|
|
56
57
|
"data-icon": "inline-start"
|
|
57
58
|
}, null, 8, ["icon"]), c(" " + m(T.value), 1)])], 2)) : a("", !0)], 2),
|
|
58
|
-
x.
|
|
59
|
+
x.deltaPlacement === "hint" ? (f(), o("span", {
|
|
59
60
|
key: 1,
|
|
61
|
+
class: d(F.value)
|
|
62
|
+
}, [I.value || e.$slots.delta ? (f(), o("span", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: d(M.value)
|
|
65
|
+
}, [p(e.$slots, "delta", { trend: C.value }, () => [l(t, {
|
|
66
|
+
icon: w.value,
|
|
67
|
+
"data-icon": "inline-start"
|
|
68
|
+
}, null, 8, ["icon"]), c(" " + m(T.value), 1)])], 2)) : a("", !0), x.hint || e.$slots.hint ? (f(), o("span", {
|
|
69
|
+
key: 1,
|
|
70
|
+
class: d(N.value)
|
|
71
|
+
}, [p(e.$slots, "hint", {}, () => [c(m(x.hint), 1)])], 2)) : a("", !0)], 2)) : x.hint || e.$slots.hint ? (f(), o("span", {
|
|
72
|
+
key: 2,
|
|
60
73
|
class: d(N.value)
|
|
61
74
|
}, [p(e.$slots, "hint", {}, () => [c(m(x.hint), 1)])], 2)) : a("", !0)
|
|
62
75
|
]),
|
|
@@ -20,7 +20,7 @@ export interface TextareaProps {
|
|
|
20
20
|
/** Mark the field as invalid — styles the border and ring red. */
|
|
21
21
|
invalid?: boolean;
|
|
22
22
|
/** Hard limit in characters, enforced by the browser. */
|
|
23
|
-
maxlength?: number;
|
|
23
|
+
maxlength?: number | string;
|
|
24
24
|
/**
|
|
25
25
|
* Show a character count under the field — "120/500" with `maxlength`,
|
|
26
26
|
* turning red within the last tenth of the limit.
|
|
@@ -17,7 +17,7 @@ export interface ToggleGroupProps {
|
|
|
17
17
|
items?: (ToggleGroupItemOption | string)[];
|
|
18
18
|
/**
|
|
19
19
|
* `single` behaves like a segmented control — one item on at a time, and
|
|
20
|
-
* the model is that item's value. `multiple` lets any number be on, and the
|
|
20
|
+
* the model is that item's value. Once one is on, clicking it again keeps it on. `multiple` lets any number be on, and the
|
|
21
21
|
* model is an array.
|
|
22
22
|
*/
|
|
23
23
|
type?: 'single' | 'multiple';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { toggleGroupTheme as n, toggleTheme as r } from "../theme/toggle.js";
|
|
4
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, defineComponent as l, normalizeClass as u, openBlock as d,
|
|
5
|
-
import { ToggleGroupItem as
|
|
4
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, defineComponent as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
|
|
5
|
+
import { ToggleGroupItem as y, ToggleGroupRoot as b } from "reka-ui";
|
|
6
6
|
//#region src/components/ToggleGroup.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var x = { key: 1 }, S = /*@__PURE__*/ l({
|
|
8
8
|
__name: "ToggleGroup",
|
|
9
9
|
props: {
|
|
10
10
|
items: {},
|
|
@@ -30,37 +30,43 @@ var y = { key: 1 }, b = /*@__PURE__*/ l({
|
|
|
30
30
|
ui: {}
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:modelValue"],
|
|
33
|
-
setup(l, { emit:
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
setup(l, { emit: S }) {
|
|
34
|
+
let C = l, w = S, T = f(C.modelValue);
|
|
35
|
+
_(() => C.modelValue, (e) => T.value = e);
|
|
36
|
+
function E(e) {
|
|
37
|
+
let t = e;
|
|
38
|
+
C.type === "single" && !t || (T.value = t, w("update:modelValue", t));
|
|
39
|
+
}
|
|
40
|
+
let D = a(() => (C.items ?? []).map((e) => typeof e == "string" ? { label: e } : e)), O = (e) => e.value ?? e.label, k = e(), A = a(() => C.unstyled ?? k.unstyled), j = a(() => n({
|
|
41
|
+
variant: C.variant,
|
|
42
|
+
orientation: C.orientation,
|
|
43
|
+
block: C.block
|
|
44
|
+
})), M = a(() => A.value ? [C.ui?.root, C.class] : j.value.root({ class: [C.ui?.root, C.class] })), N = a(() => A.value ? C.ui?.item : r({
|
|
45
|
+
size: C.size,
|
|
46
|
+
square: C.iconOnly,
|
|
47
|
+
class: j.value.item({ class: C.ui?.item })
|
|
42
48
|
}));
|
|
43
|
-
return (e, n) => (d(), o(
|
|
44
|
-
type:
|
|
45
|
-
"model-value":
|
|
46
|
-
disabled:
|
|
47
|
-
orientation:
|
|
48
|
-
loop:
|
|
49
|
-
class: u(
|
|
50
|
-
"onUpdate:modelValue":
|
|
49
|
+
return (e, n) => (d(), o(g(b), {
|
|
50
|
+
type: C.type,
|
|
51
|
+
"model-value": T.value ?? (C.type === "multiple" ? [] : ""),
|
|
52
|
+
disabled: C.disabled,
|
|
53
|
+
orientation: C.orientation,
|
|
54
|
+
loop: C.loop,
|
|
55
|
+
class: u(M.value),
|
|
56
|
+
"onUpdate:modelValue": E
|
|
51
57
|
}, {
|
|
52
|
-
default:
|
|
53
|
-
key:
|
|
54
|
-
value:
|
|
58
|
+
default: v(() => [(d(!0), c(i, null, p(D.value, (n) => (d(), o(g(y), {
|
|
59
|
+
key: O(n),
|
|
60
|
+
value: O(n),
|
|
55
61
|
disabled: n.disabled,
|
|
56
|
-
"aria-label": n.ariaLabel ?? (
|
|
57
|
-
class: u(
|
|
62
|
+
"aria-label": n.ariaLabel ?? (C.iconOnly ? n.label : void 0),
|
|
63
|
+
class: u(N.value)
|
|
58
64
|
}, {
|
|
59
|
-
default:
|
|
65
|
+
default: v(() => [m(e.$slots, "item", { item: n }, () => [n.icon ? (d(), o(t, {
|
|
60
66
|
key: 0,
|
|
61
67
|
icon: n.icon,
|
|
62
|
-
"data-icon":
|
|
63
|
-
}, null, 8, ["icon", "data-icon"])) : s("", !0),
|
|
68
|
+
"data-icon": C.iconOnly ? void 0 : "inline-start"
|
|
69
|
+
}, null, 8, ["icon", "data-icon"])) : s("", !0), C.iconOnly ? s("", !0) : (d(), c("span", x, h(n.label), 1))])]),
|
|
64
70
|
_: 2
|
|
65
71
|
}, 1032, [
|
|
66
72
|
"value",
|
|
@@ -80,4 +86,4 @@ var y = { key: 1 }, b = /*@__PURE__*/ l({
|
|
|
80
86
|
}
|
|
81
87
|
});
|
|
82
88
|
//#endregion
|
|
83
|
-
export {
|
|
89
|
+
export { S as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function defaultCountLabel(remaining: number): string;
|
|
2
|
-
export declare function useCharacterCount(value: () => string | number | null | undefined,
|
|
2
|
+
export declare function useCharacterCount(value: () => string | number | null | undefined, maxRaw: () => number | string | undefined): {
|
|
3
3
|
remaining: import("vue").ComputedRef<number | undefined>;
|
|
4
4
|
nearLimit: import("vue").ComputedRef<boolean>;
|
|
5
5
|
text: import("vue").ComputedRef<string>;
|
|
@@ -4,14 +4,17 @@ function t(e) {
|
|
|
4
4
|
return `${e} ${e === 1 ? "character" : "characters"} left`;
|
|
5
5
|
}
|
|
6
6
|
function n(t, n) {
|
|
7
|
-
let r =
|
|
7
|
+
let r = () => {
|
|
8
8
|
let e = n();
|
|
9
|
-
return e == null ? void 0 : e
|
|
9
|
+
return e == null || e === "" ? void 0 : Number(e);
|
|
10
|
+
}, i = e(() => String(t() ?? "").length), a = e(() => {
|
|
11
|
+
let e = r();
|
|
12
|
+
return e == null ? void 0 : e - i.value;
|
|
10
13
|
});
|
|
11
14
|
return {
|
|
12
|
-
remaining:
|
|
13
|
-
nearLimit: e(() =>
|
|
14
|
-
text: e(() =>
|
|
15
|
+
remaining: a,
|
|
16
|
+
nearLimit: e(() => a.value != null && a.value <= Math.ceil(r() * .1)),
|
|
17
|
+
text: e(() => r() == null ? `${i.value}` : `${i.value}/${r()}`)
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InjectionKey } from 'vue';
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
2
|
import type { IconLike } from './icon';
|
|
3
3
|
export interface SidebarLink {
|
|
4
4
|
label: string;
|
|
@@ -28,6 +28,8 @@ export interface SidebarLink {
|
|
|
28
28
|
export interface SidebarSection {
|
|
29
29
|
section: string;
|
|
30
30
|
items: SidebarLink[];
|
|
31
|
+
/** Push to the bottom of the column, above the footer. Pass `section: ''` for no heading. */
|
|
32
|
+
pinned?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export type SidebarItems = (SidebarLink | SidebarSection)[];
|
|
33
35
|
/** Provided by `IAppShell` around each copy of its sidebar slot. */
|
|
@@ -36,3 +38,11 @@ export declare function isSidebarSection(item: SidebarLink | SidebarSection): it
|
|
|
36
38
|
/** Normalise to sections, so the template has a single path to render. */
|
|
37
39
|
export declare function toSidebarSections(items: SidebarItems | undefined): SidebarSection[];
|
|
38
40
|
export declare function isSidebarGroup(link: SidebarLink): boolean;
|
|
41
|
+
export declare const sidebarCollapsedCookie = "iryx-ui-sidebar-collapsed";
|
|
42
|
+
/**
|
|
43
|
+
* Provide a ref read from the request cookie so the server renders the sidebar
|
|
44
|
+
* the way the user left it. The Nuxt module does this for you.
|
|
45
|
+
*/
|
|
46
|
+
export declare const sidebarCollapsedKey: InjectionKey<Ref<boolean>>;
|
|
47
|
+
/** Collapsed state remembered in a cookie. Bind it with `v-model:collapsed`. */
|
|
48
|
+
export declare function useSidebarCollapsed(): Ref<boolean>;
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
+
import { inject as e, ref as t, watch as n } from "vue";
|
|
1
2
|
//#region src/composables/sidebar.ts
|
|
2
|
-
var
|
|
3
|
-
function
|
|
3
|
+
var r = Symbol.for("iryx-ui:sidebar-placement");
|
|
4
|
+
function i(e) {
|
|
4
5
|
return typeof e.section == "string";
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
for (let
|
|
9
|
-
if (
|
|
10
|
-
|
|
7
|
+
function a(e) {
|
|
8
|
+
let t = [], n;
|
|
9
|
+
for (let r of e ?? []) {
|
|
10
|
+
if (i(r)) {
|
|
11
|
+
t.push(r), n = void 0;
|
|
11
12
|
continue;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
n || (n = [], t.push({
|
|
14
15
|
section: "",
|
|
15
|
-
items:
|
|
16
|
-
})),
|
|
16
|
+
items: n
|
|
17
|
+
})), n.push(r);
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return [...t.filter((e) => !e.pinned), ...t.filter((e) => e.pinned)];
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function o(e) {
|
|
21
22
|
return Array.isArray(e.items) && e.items.length > 0;
|
|
22
23
|
}
|
|
24
|
+
var s = "iryx-ui-sidebar-collapsed", c = Symbol.for("iryx-ui:sidebar-collapsed");
|
|
25
|
+
function l() {
|
|
26
|
+
let r = e(c, null);
|
|
27
|
+
if (r) return r;
|
|
28
|
+
if (typeof document > "u") return t(!1);
|
|
29
|
+
let i = t(document.cookie.match(RegExp(`(?:^|; )${s}=([^;]*)`))?.[1] === "true");
|
|
30
|
+
return n(i, (e) => {
|
|
31
|
+
document.cookie = `${s}=${e}; path=/; max-age=31536000; samesite=lax`;
|
|
32
|
+
}), i;
|
|
33
|
+
}
|
|
23
34
|
//#endregion
|
|
24
|
-
export {
|
|
35
|
+
export { o as isSidebarGroup, i as isSidebarSection, s as sidebarCollapsedCookie, c as sidebarCollapsedKey, r as sidebarPlacementKey, a as toSidebarSections, l as useSidebarCollapsed };
|