iryx-ui 0.20.0 → 0.22.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/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Carousel.js +5 -0
- package/dist/components/Carousel.vue.d.ts +74 -0
- package/dist/components/Carousel.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/Checkbox.vue.d.ts +20 -3
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +90 -43
- package/dist/components/Progress.vue.d.ts +29 -3
- package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +103 -47
- package/dist/components/RadioGroup.vue.d.ts +12 -0
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +73 -39
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +124 -122
- package/dist/index.d.ts +1 -0
- package/dist/index.js +127 -126
- package/dist/theme/carousel.d.ts +65 -0
- package/dist/theme/carousel.js +22 -0
- package/dist/theme/checkbox.d.ts +42 -39
- package/dist/theme/checkbox.js +117 -15
- package/dist/theme/form.d.ts +3 -3
- package/dist/theme/presets.d.ts +8 -2
- package/dist/theme/presets.js +2 -2
- package/dist/theme/progress.d.ts +75 -0
- package/dist/theme/progress.js +43 -11
- package/dist/theme/radio-group.d.ts +45 -30
- package/dist/theme/radio-group.js +118 -11
- package/package.json +1 -1
- package/theme.css +25 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Consumed by the Vue plugin (global registration) and the Nuxt module
|
|
4
4
|
* (auto-imports). Keep in sync with `src/components/index.ts`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const componentNames: readonly ["Accordion", "Alert", "App", "AppShell", "AspectRatio", "AuthProviders", "Avatar", "AvatarGroup", "Badge", "BarChart", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Calendar", "Card", "ChartLegend", "Checkbox", "ColorPicker", "Combobox", "Collapsible", "CommandPalette", "Container", "ConfirmDialog", "ContextMenu", "DateField", "DatePicker", "DateRangePicker", "Dialog", "DonutChart", "Drawer", "DropdownMenu", "Editable", "EmptyState", "FileUpload", "Form", "FormField", "HoverCard", "Icon", "Input", "Kbd", "Label", "LineChart", "NavigationMenu", "NumberInput", "Menubar", "PageHeader", "Pagination", "PasswordInput", "PinInput", "Popover", "Progress", "RadioGroup", "Rating", "ScrollArea", "ScrollFade", "Select", "Separator", "Sidebar", "SignaturePad", "Skeleton", "Slider", "Sparkline", "Splitter", "Stat", "Stepper", "Switch", "Table", "Tabs", "TagsInput", "Textarea", "Toaster", "Toggle", "ToggleGroup", "TimeField", "Timeline", "Toolbar", "Tooltip", "Tree"];
|
|
6
|
+
export declare const componentNames: readonly ["Accordion", "Alert", "App", "AppShell", "AspectRatio", "AuthProviders", "Avatar", "AvatarGroup", "Badge", "BarChart", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Calendar", "Card", "Carousel", "ChartLegend", "Checkbox", "ColorPicker", "Combobox", "Collapsible", "CommandPalette", "Container", "ConfirmDialog", "ContextMenu", "DateField", "DatePicker", "DateRangePicker", "Dialog", "DonutChart", "Drawer", "DropdownMenu", "Editable", "EmptyState", "FileUpload", "Form", "FormField", "HoverCard", "Icon", "Input", "Kbd", "Label", "LineChart", "NavigationMenu", "NumberInput", "Menubar", "PageHeader", "Pagination", "PasswordInput", "PinInput", "Popover", "Progress", "RadioGroup", "Rating", "ScrollArea", "ScrollFade", "Select", "Separator", "Sidebar", "SignaturePad", "Skeleton", "Slider", "Sparkline", "Splitter", "Stat", "Stepper", "Switch", "Table", "Tabs", "TagsInput", "Textarea", "Toaster", "Toggle", "ToggleGroup", "TimeField", "Timeline", "Toolbar", "Tooltip", "Tree"];
|
|
7
7
|
export type ComponentName = (typeof componentNames)[number];
|
|
8
8
|
/**
|
|
9
9
|
* Names of every block exported from `iryx-ui/marketing`.
|
package/dist/component-names.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/component-names.ts
|
|
2
|
-
var e = /* @__PURE__ */ "Accordion.Alert.App.AppShell.AspectRatio.AuthProviders.Avatar.AvatarGroup.Badge.BarChart.Banner.Breadcrumb.Button.ButtonGroup.Calendar.Card.ChartLegend.Checkbox.ColorPicker.Combobox.Collapsible.CommandPalette.Container.ConfirmDialog.ContextMenu.DateField.DatePicker.DateRangePicker.Dialog.DonutChart.Drawer.DropdownMenu.Editable.EmptyState.FileUpload.Form.FormField.HoverCard.Icon.Input.Kbd.Label.LineChart.NavigationMenu.NumberInput.Menubar.PageHeader.Pagination.PasswordInput.PinInput.Popover.Progress.RadioGroup.Rating.ScrollArea.ScrollFade.Select.Separator.Sidebar.SignaturePad.Skeleton.Slider.Sparkline.Splitter.Stat.Stepper.Switch.Table.Tabs.TagsInput.Textarea.Toaster.Toggle.ToggleGroup.TimeField.Timeline.Toolbar.Tooltip.Tree".split("."), t = [
|
|
2
|
+
var e = /* @__PURE__ */ "Accordion.Alert.App.AppShell.AspectRatio.AuthProviders.Avatar.AvatarGroup.Badge.BarChart.Banner.Breadcrumb.Button.ButtonGroup.Calendar.Card.Carousel.ChartLegend.Checkbox.ColorPicker.Combobox.Collapsible.CommandPalette.Container.ConfirmDialog.ContextMenu.DateField.DatePicker.DateRangePicker.Dialog.DonutChart.Drawer.DropdownMenu.Editable.EmptyState.FileUpload.Form.FormField.HoverCard.Icon.Input.Kbd.Label.LineChart.NavigationMenu.NumberInput.Menubar.PageHeader.Pagination.PasswordInput.PinInput.Popover.Progress.RadioGroup.Rating.ScrollArea.ScrollFade.Select.Separator.Sidebar.SignaturePad.Skeleton.Slider.Sparkline.Splitter.Stat.Stepper.Switch.Table.Tabs.TagsInput.Textarea.Toaster.Toggle.ToggleGroup.TimeField.Timeline.Toolbar.Tooltip.Tree".split("."), t = [
|
|
3
3
|
"BrowserFrame",
|
|
4
4
|
"FeatureCard",
|
|
5
5
|
"Hero",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ClassValue } from '../class-value';
|
|
2
|
+
export interface CarouselProps<Item = unknown> {
|
|
3
|
+
/** What to lay out. Each one is rendered through the default slot. */
|
|
4
|
+
items?: Item[];
|
|
5
|
+
/**
|
|
6
|
+
* How many fit across, at the widest. Below `sm` it is always one, and
|
|
7
|
+
* `'auto'` leaves the width to the slide's own content.
|
|
8
|
+
*/
|
|
9
|
+
perView?: 1 | 2 | 3 | 4 | 'auto';
|
|
10
|
+
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Show the previous and next buttons. */
|
|
12
|
+
arrows?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Let a mouse drag the track. Touch and trackpad pan it natively either way.
|
|
15
|
+
*/
|
|
16
|
+
draggable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* How far a drag has to travel before it moves on, as a fraction of a slide.
|
|
19
|
+
* A quarter by default: enough that a nudge does not count, little enough
|
|
20
|
+
* that the track goes where it was pushed. `1` demands a whole slide.
|
|
21
|
+
*/
|
|
22
|
+
dragThreshold?: number;
|
|
23
|
+
/** Show the row of dots under the track. */
|
|
24
|
+
dots?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Accessible name for the carousel — "Customer stories", "Screenshots".
|
|
27
|
+
* A carousel with no name is a scroll region a screen reader cannot place.
|
|
28
|
+
*/
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Accessible names for the buttons — override for non-English sites. */
|
|
31
|
+
previousLabel?: string;
|
|
32
|
+
nextLabel?: string;
|
|
33
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
34
|
+
unstyled?: boolean;
|
|
35
|
+
class?: ClassValue;
|
|
36
|
+
/** Override classes per element, e.g. `{ dot: 'size-3' }`. */
|
|
37
|
+
ui?: {
|
|
38
|
+
root?: string;
|
|
39
|
+
track?: string;
|
|
40
|
+
item?: string;
|
|
41
|
+
viewport?: string;
|
|
42
|
+
control?: string;
|
|
43
|
+
dots?: string;
|
|
44
|
+
dot?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
declare const __VLS_export: <Item>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
48
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(CarouselProps<Item> & {
|
|
49
|
+
active?: number;
|
|
50
|
+
}) & {
|
|
51
|
+
"onUpdate:active"?: ((value: number) => any) | undefined;
|
|
52
|
+
}> & (typeof globalThis extends {
|
|
53
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
54
|
+
} ? P : {});
|
|
55
|
+
expose: (exposed: {}) => void;
|
|
56
|
+
attrs: any;
|
|
57
|
+
slots: {
|
|
58
|
+
default?: (props: {
|
|
59
|
+
item: Item;
|
|
60
|
+
index: number;
|
|
61
|
+
active: boolean;
|
|
62
|
+
}) => any;
|
|
63
|
+
};
|
|
64
|
+
emit: (event: "update:active", value: number) => void;
|
|
65
|
+
}>) => import("vue").VNode & {
|
|
66
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
67
|
+
};
|
|
68
|
+
declare const _default: typeof __VLS_export;
|
|
69
|
+
export default _default;
|
|
70
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
71
|
+
[K in keyof T]: T[K];
|
|
72
|
+
} : {
|
|
73
|
+
[K in keyof T as K]: T[K];
|
|
74
|
+
}) & {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import n from "./Button.js";
|
|
4
|
+
import { useScrollEdges as r } from "../composables/scroll-fade.js";
|
|
5
|
+
import { carouselTheme as i } from "../theme/carousel.js";
|
|
6
|
+
import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, openBlock as _, ref as v, renderList as y, renderSlot as b, unref as x, useModel as S, watch as C, withCtx as w, withModifiers as ee } from "vue";
|
|
7
|
+
import { ArrowLeft01Icon as te, ArrowRight01Icon as ne } from "@hugeicons/core-free-icons";
|
|
8
|
+
//#region src/components/Carousel.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var T = ["aria-label"], E = ["aria-label"], D = ["aria-label", "data-state"], O = [
|
|
10
|
+
"aria-label",
|
|
11
|
+
"aria-current",
|
|
12
|
+
"data-state",
|
|
13
|
+
"onClick"
|
|
14
|
+
], k = /*@__PURE__*/ d({
|
|
15
|
+
__name: "Carousel",
|
|
16
|
+
props: /*@__PURE__*/ f({
|
|
17
|
+
items: {},
|
|
18
|
+
perView: { default: 1 },
|
|
19
|
+
gap: {},
|
|
20
|
+
arrows: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
draggable: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: void 0
|
|
27
|
+
},
|
|
28
|
+
dragThreshold: { default: .25 },
|
|
29
|
+
dots: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
label: { default: "Carousel" },
|
|
34
|
+
previousLabel: { default: "Previous" },
|
|
35
|
+
nextLabel: { default: "Next" },
|
|
36
|
+
unstyled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
class: { type: [
|
|
41
|
+
String,
|
|
42
|
+
Boolean,
|
|
43
|
+
null,
|
|
44
|
+
Array
|
|
45
|
+
] },
|
|
46
|
+
ui: {}
|
|
47
|
+
}, {
|
|
48
|
+
active: { default: 0 },
|
|
49
|
+
activeModifiers: {}
|
|
50
|
+
}),
|
|
51
|
+
emits: ["update:active"],
|
|
52
|
+
setup(d) {
|
|
53
|
+
let f = d, k = S(d, "active"), A = e(), j = o(() => f.unstyled ?? A.unstyled), M = o(() => i({ gap: f.gap }));
|
|
54
|
+
function N(e, t) {
|
|
55
|
+
return j.value ? [f.ui?.[e], t] : M.value[e]({ class: [f.ui?.[e], t] });
|
|
56
|
+
}
|
|
57
|
+
let P = v(), { atStart: re, atEnd: ie, overflowing: ae } = r(P, v("horizontal")), oe = o(() => ({
|
|
58
|
+
none: 0,
|
|
59
|
+
sm: .5,
|
|
60
|
+
md: 1,
|
|
61
|
+
lg: 1.5
|
|
62
|
+
})[f.gap ?? "md"]);
|
|
63
|
+
function F(e) {
|
|
64
|
+
let t = oe.value * (e - 1) / e;
|
|
65
|
+
return `calc(${100 / e}% - ${t}rem)`;
|
|
66
|
+
}
|
|
67
|
+
let I = o(() => {
|
|
68
|
+
if (f.perView !== "auto") return {
|
|
69
|
+
"--iryx-carousel-item": F(f.perView),
|
|
70
|
+
"--iryx-carousel-item-sm": F(Math.min(f.perView, 2))
|
|
71
|
+
};
|
|
72
|
+
}), L = o(() => f.items?.length ?? 0), R = v(), z = o(() => R.value ?? Math.max(L.value, 1)), B;
|
|
73
|
+
function V() {
|
|
74
|
+
let e = P.value;
|
|
75
|
+
if (!e) return;
|
|
76
|
+
if (!e.clientWidth) {
|
|
77
|
+
R.value = void 0;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let t = e.scrollWidth - e.clientWidth + 1, n = [...e.children].filter((n) => n.offsetLeft - e.offsetLeft <= t).length;
|
|
81
|
+
R.value = Math.max(n, 1);
|
|
82
|
+
}
|
|
83
|
+
C(P, (e) => {
|
|
84
|
+
if (B?.disconnect(), B = void 0, e && (V(), !(typeof ResizeObserver > "u"))) {
|
|
85
|
+
B = new ResizeObserver(V), B.observe(e);
|
|
86
|
+
for (let t of e.children) B.observe(t);
|
|
87
|
+
}
|
|
88
|
+
}, { immediate: !0 }), C(L, () => p(V)), g(() => B?.disconnect());
|
|
89
|
+
let H = v(), U;
|
|
90
|
+
function W(e) {
|
|
91
|
+
let t = P.value, n = t?.children[e];
|
|
92
|
+
!t || !n || (H.value = e, k.value = e, t.scrollTo({ left: n.offsetLeft - t.offsetLeft }), clearTimeout(U), U = setTimeout(() => H.value = void 0, 1e3));
|
|
93
|
+
}
|
|
94
|
+
function G(e) {
|
|
95
|
+
W(Math.min(Math.max(k.value + e, 0), z.value - 1));
|
|
96
|
+
}
|
|
97
|
+
function K() {
|
|
98
|
+
let e = P.value;
|
|
99
|
+
if (!e) return k.value;
|
|
100
|
+
let t = [...e.children], n = e.scrollLeft + e.offsetLeft;
|
|
101
|
+
return t.reduce((e, r, i) => Math.abs(r.offsetLeft - n) < Math.abs(t[e].offsetLeft - n) ? i : e, 0);
|
|
102
|
+
}
|
|
103
|
+
C(k, (e) => {
|
|
104
|
+
H.value === void 0 && e !== K() && W(e);
|
|
105
|
+
});
|
|
106
|
+
function se() {
|
|
107
|
+
if (!P.value) return;
|
|
108
|
+
V();
|
|
109
|
+
let e = Math.min(K(), z.value - 1);
|
|
110
|
+
if (H.value !== void 0) {
|
|
111
|
+
e === H.value && (H.value = void 0, clearTimeout(U));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
k.value = e;
|
|
115
|
+
}
|
|
116
|
+
let q = v(!1), J = 0, Y = 0, X = 0, Z = 0;
|
|
117
|
+
function ce(e) {
|
|
118
|
+
let t = P.value;
|
|
119
|
+
!(f.draggable ?? !0) || e.pointerType === "touch" || !t || (q.value = !0, Z = 0, J = e.clientX, Y = t.scrollLeft, X = k.value, t.setPointerCapture(e.pointerId), t.style.scrollBehavior = "auto");
|
|
120
|
+
}
|
|
121
|
+
function Q(e) {
|
|
122
|
+
let t = [...e.children], n = (t[1]?.offsetLeft ?? 0) - (t[0]?.offsetLeft ?? 0);
|
|
123
|
+
if (n <= 0) return k.value;
|
|
124
|
+
let r = (e.scrollLeft - Y) / n, i = Math.trunc(r), a = Math.abs(r - i) >= Math.min(Math.max(f.dragThreshold, 0), 1) ? Math.sign(r) : 0;
|
|
125
|
+
return Math.min(Math.max(X + i + a, 0), z.value - 1);
|
|
126
|
+
}
|
|
127
|
+
function le(e) {
|
|
128
|
+
let t = P.value;
|
|
129
|
+
if (!q.value || !t) return;
|
|
130
|
+
let n = e.clientX - J;
|
|
131
|
+
Z = Math.max(Z, Math.abs(n)), t.scrollLeft = Y - n;
|
|
132
|
+
}
|
|
133
|
+
function $(e) {
|
|
134
|
+
let t = P.value;
|
|
135
|
+
if (!q.value || !t) return;
|
|
136
|
+
q.value = !1, t.releasePointerCapture(e.pointerId), t.style.scrollBehavior = "";
|
|
137
|
+
let n = Q(t);
|
|
138
|
+
p(() => W(n));
|
|
139
|
+
}
|
|
140
|
+
function ue(e) {
|
|
141
|
+
Z > 4 && (e.preventDefault(), e.stopPropagation(), Z = 0);
|
|
142
|
+
}
|
|
143
|
+
function de(e) {
|
|
144
|
+
e.key === "ArrowRight" ? (e.preventDefault(), G(1)) : e.key === "ArrowLeft" && (e.preventDefault(), G(-1));
|
|
145
|
+
}
|
|
146
|
+
let fe = o(() => (f.arrows ?? !0) && ae.value), pe = o(() => (f.dots ?? !0) && z.value > 1);
|
|
147
|
+
return (e, r) => (_(), c("div", {
|
|
148
|
+
role: "group",
|
|
149
|
+
"aria-roledescription": "carousel",
|
|
150
|
+
"aria-label": f.label,
|
|
151
|
+
class: m(N("root", f.class))
|
|
152
|
+
}, [l("div", { class: m(N("viewport")) }, [l("div", {
|
|
153
|
+
ref_key: "track",
|
|
154
|
+
ref: P,
|
|
155
|
+
tabindex: "0",
|
|
156
|
+
role: "group",
|
|
157
|
+
"aria-label": f.label,
|
|
158
|
+
class: m(N("track", q.value ? "snap-none scroll-auto cursor-grabbing select-none" : f.draggable ?? !0 ? "cursor-grab" : void 0)),
|
|
159
|
+
onScroll: se,
|
|
160
|
+
onKeydown: de,
|
|
161
|
+
onPointerdown: ce,
|
|
162
|
+
onPointermove: le,
|
|
163
|
+
onPointerup: $,
|
|
164
|
+
onPointercancel: $,
|
|
165
|
+
onClickCapture: ue,
|
|
166
|
+
onDragstart: r[0] ||= ee(() => {}, ["prevent"])
|
|
167
|
+
}, [(_(!0), c(a, null, y(f.items, (t, n) => (_(), c("div", {
|
|
168
|
+
key: n,
|
|
169
|
+
role: "group",
|
|
170
|
+
"aria-roledescription": "slide",
|
|
171
|
+
"aria-label": `${n + 1} of ${L.value}`,
|
|
172
|
+
"data-state": n === k.value ? "active" : "inactive",
|
|
173
|
+
style: h(I.value),
|
|
174
|
+
class: m(N("item", f.perView === "auto" ? "w-auto" : "w-full sm:w-[var(--iryx-carousel-item-sm)] lg:w-[var(--iryx-carousel-item)]"))
|
|
175
|
+
}, [b(e.$slots, "default", {
|
|
176
|
+
item: t,
|
|
177
|
+
index: n,
|
|
178
|
+
active: n === k.value
|
|
179
|
+
})], 14, D))), 128))], 42, E), fe.value ? (_(), c(a, { key: 0 }, [l("div", { class: m(N("control", "left-2")) }, [u(n, {
|
|
180
|
+
variant: "outline",
|
|
181
|
+
size: "sm",
|
|
182
|
+
square: "",
|
|
183
|
+
"aria-label": f.previousLabel,
|
|
184
|
+
disabled: x(re),
|
|
185
|
+
onClick: r[1] ||= (e) => G(-1)
|
|
186
|
+
}, {
|
|
187
|
+
default: w(() => [u(t, {
|
|
188
|
+
icon: x(te),
|
|
189
|
+
"data-icon": ""
|
|
190
|
+
}, null, 8, ["icon"])]),
|
|
191
|
+
_: 1
|
|
192
|
+
}, 8, ["aria-label", "disabled"])], 2), l("div", { class: m(N("control", "right-2")) }, [u(n, {
|
|
193
|
+
variant: "outline",
|
|
194
|
+
size: "sm",
|
|
195
|
+
square: "",
|
|
196
|
+
"aria-label": f.nextLabel,
|
|
197
|
+
disabled: x(ie),
|
|
198
|
+
onClick: r[2] ||= (e) => G(1)
|
|
199
|
+
}, {
|
|
200
|
+
default: w(() => [u(t, {
|
|
201
|
+
icon: x(ne),
|
|
202
|
+
"data-icon": ""
|
|
203
|
+
}, null, 8, ["icon"])]),
|
|
204
|
+
_: 1
|
|
205
|
+
}, 8, ["aria-label", "disabled"])], 2)], 64)) : s("", !0)], 2), pe.value ? (_(), c("div", {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: m(N("dots"))
|
|
208
|
+
}, [(_(!0), c(a, null, y(z.value, (e, t) => (_(), c("button", {
|
|
209
|
+
key: t,
|
|
210
|
+
type: "button",
|
|
211
|
+
"aria-label": `Go to slide ${t + 1}`,
|
|
212
|
+
"aria-current": t === k.value,
|
|
213
|
+
"data-state": t === k.value ? "active" : "inactive",
|
|
214
|
+
class: m(N("dot")),
|
|
215
|
+
onClick: (e) => W(t)
|
|
216
|
+
}, null, 10, O))), 128))], 2)) : s("", !0)], 10, T));
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
//#endregion
|
|
220
|
+
export { k as default };
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { CheckboxRootProps } from 'reka-ui';
|
|
2
2
|
import type { ClassValue } from '../class-value';
|
|
3
|
+
import type { IconLike } from '../composables/icon';
|
|
3
4
|
export interface CheckboxProps extends CheckboxRootProps {
|
|
4
5
|
/** Text shown beside the box. Also makes the text clickable. */
|
|
5
6
|
label?: string;
|
|
6
7
|
/** Secondary text under the label. */
|
|
7
8
|
description?: string;
|
|
9
|
+
/**
|
|
10
|
+
* How the control is drawn. `checkbox` is a box beside its label, `card`
|
|
11
|
+
* makes the whole bordered surface the control, and `tile` centres an icon
|
|
12
|
+
* above the label.
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'checkbox' | 'card' | 'tile';
|
|
15
|
+
/** Shown above the label by the `tile` variant, ignored by the others. */
|
|
16
|
+
icon?: IconLike;
|
|
8
17
|
size?: 'sm' | 'md' | 'lg';
|
|
9
18
|
id?: string;
|
|
10
19
|
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
@@ -16,21 +25,29 @@ export interface CheckboxProps extends CheckboxRootProps {
|
|
|
16
25
|
ui?: {
|
|
17
26
|
wrapper?: string;
|
|
18
27
|
root?: string;
|
|
28
|
+
mark?: string;
|
|
29
|
+
icon?: string;
|
|
19
30
|
indicator?: string;
|
|
20
31
|
content?: string;
|
|
21
32
|
label?: string;
|
|
22
33
|
description?: string;
|
|
23
34
|
};
|
|
24
35
|
}
|
|
25
|
-
declare var
|
|
36
|
+
declare var __VLS_14: {}, __VLS_31: {}, __VLS_33: {}, __VLS_47: {}, __VLS_65: {}, __VLS_67: {}, __VLS_82: {};
|
|
26
37
|
type __VLS_Slots = {} & {
|
|
27
|
-
default?: (props: typeof
|
|
38
|
+
default?: (props: typeof __VLS_14) => any;
|
|
28
39
|
} & {
|
|
29
40
|
label?: (props: typeof __VLS_31) => any;
|
|
30
41
|
} & {
|
|
31
42
|
description?: (props: typeof __VLS_33) => any;
|
|
32
43
|
} & {
|
|
33
|
-
default?: (props: typeof
|
|
44
|
+
default?: (props: typeof __VLS_47) => any;
|
|
45
|
+
} & {
|
|
46
|
+
label?: (props: typeof __VLS_65) => any;
|
|
47
|
+
} & {
|
|
48
|
+
description?: (props: typeof __VLS_67) => any;
|
|
49
|
+
} & {
|
|
50
|
+
default?: (props: typeof __VLS_82) => any;
|
|
34
51
|
};
|
|
35
52
|
declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
53
|
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
@@ -2,16 +2,18 @@ import { useIryxUiConfig as e } from "../config.js";
|
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { useFormField as n } from "../composables/form.js";
|
|
4
4
|
import { checkboxTheme as r } from "../theme/checkbox.js";
|
|
5
|
-
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _,
|
|
6
|
-
import { MinusSignIcon as
|
|
7
|
-
import { CheckboxIndicator as
|
|
5
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, useSlots as v, withCtx as y } from "vue";
|
|
6
|
+
import { MinusSignIcon as b, Tick02Icon as x } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { CheckboxIndicator as S, CheckboxRoot as C, Label as w, useForwardPropsEmits as T, useId as E } from "reka-ui";
|
|
8
8
|
//#region src/components/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var D = ["id"], O = ["id"], k = ["id"], A = /*@__PURE__*/ d({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "Checkbox",
|
|
12
12
|
props: {
|
|
13
13
|
label: {},
|
|
14
14
|
description: {},
|
|
15
|
+
variant: {},
|
|
16
|
+
icon: {},
|
|
15
17
|
size: {},
|
|
16
18
|
id: {},
|
|
17
19
|
invalid: {
|
|
@@ -41,35 +43,80 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
41
43
|
required: { type: Boolean }
|
|
42
44
|
},
|
|
43
45
|
emits: ["update:modelValue"],
|
|
44
|
-
setup(d, { emit:
|
|
45
|
-
let
|
|
46
|
-
let { label: e, description: t,
|
|
47
|
-
return
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
setup(d, { emit: A }) {
|
|
47
|
+
let j = d, M = A, N = T(i(() => {
|
|
48
|
+
let { label: e, description: t, variant: n, icon: r, size: i, id: a, invalid: o, unstyled: s, class: c, ui: l, ...u } = j;
|
|
49
|
+
return u;
|
|
50
|
+
}), M), P = v(), F = E(), I = n(), L = i(() => j.invalid ?? I?.invalid.value ?? !1), R = i(() => j.id ?? I?.id.value ?? F);
|
|
51
|
+
I && (I.id.value = R.value);
|
|
52
|
+
let z = i(() => !!(j.description || P.description)), B = i(() => !!(j.label || P.label || z.value)), V = i(() => z.value ? `${R.value}-description` : void 0), H = e(), U = i(() => j.unstyled ?? H.unstyled), W = i(() => (j.variant ?? "checkbox") !== "checkbox"), G = i(() => r({
|
|
53
|
+
variant: j.variant,
|
|
54
|
+
size: j.size,
|
|
55
|
+
withText: B.value,
|
|
56
|
+
invalid: L.value
|
|
57
|
+
})), K = i(() => U.value ? j.ui?.wrapper : G.value.wrapper({ class: j.ui?.wrapper })), q = i(() => U.value ? [j.ui?.root, j.class] : G.value.root({ class: [j.ui?.root, j.class] })), J = i(() => U.value ? j.ui?.indicator : G.value.indicator({ class: j.ui?.indicator })), Y = i(() => U.value ? j.ui?.content : G.value.content({ class: j.ui?.content })), X = i(() => U.value ? j.ui?.label : G.value.label({ class: j.ui?.label })), Z = i(() => U.value ? j.ui?.description : G.value.description({ class: j.ui?.description })), Q = i(() => U.value ? j.ui?.mark : G.value.mark({ class: j.ui?.mark })), $ = i(() => U.value ? j.ui?.icon : G.value.icon({ class: j.ui?.icon }));
|
|
58
|
+
return (e, n) => W.value ? (m(), a(_(C), f({
|
|
56
59
|
key: 0,
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
..._(
|
|
60
|
+
id: R.value
|
|
61
|
+
}, {
|
|
62
|
+
..._(N),
|
|
60
63
|
...e.$attrs
|
|
61
64
|
}, {
|
|
62
|
-
"aria-invalid":
|
|
63
|
-
"aria-
|
|
64
|
-
|
|
65
|
+
"aria-invalid": L.value || void 0,
|
|
66
|
+
"aria-labelledby": `${R.value}-label`,
|
|
67
|
+
"aria-describedby": V.value,
|
|
68
|
+
class: [q.value, "group/item"]
|
|
65
69
|
}), {
|
|
66
|
-
default:
|
|
67
|
-
|
|
70
|
+
default: y(() => [j.variant === "card" ? (m(), s("span", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: p(Q.value)
|
|
73
|
+
}, [u(_(S), { class: p(J.value) }, {
|
|
74
|
+
default: y(() => [h(e.$slots, "default", {}, () => [j.modelValue === "indeterminate" ? (m(), a(t, {
|
|
68
75
|
key: 0,
|
|
69
|
-
icon: _(
|
|
76
|
+
icon: _(b)
|
|
70
77
|
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
71
78
|
key: 1,
|
|
79
|
+
icon: _(x)
|
|
80
|
+
}, null, 8, ["icon"]))])]),
|
|
81
|
+
_: 3
|
|
82
|
+
}, 8, ["class"])], 2)) : j.icon ? (m(), a(t, {
|
|
83
|
+
key: 1,
|
|
84
|
+
icon: j.icon,
|
|
85
|
+
"data-slot": "icon",
|
|
86
|
+
class: p($.value)
|
|
87
|
+
}, null, 8, ["icon", "class"])) : o("", !0), c("span", { class: p(Y.value) }, [c("span", {
|
|
88
|
+
id: `${R.value}-label`,
|
|
89
|
+
class: p(X.value)
|
|
90
|
+
}, [h(e.$slots, "label", {}, () => [l(g(j.label), 1)])], 10, D), z.value ? (m(), s("span", {
|
|
91
|
+
key: 0,
|
|
92
|
+
id: `${R.value}-description`,
|
|
93
|
+
class: p(Z.value)
|
|
94
|
+
}, [h(e.$slots, "description", {}, () => [l(g(j.description), 1)])], 10, O)) : o("", !0)], 2)]),
|
|
95
|
+
_: 3
|
|
96
|
+
}, 16, [
|
|
97
|
+
"id",
|
|
98
|
+
"aria-invalid",
|
|
99
|
+
"aria-labelledby",
|
|
100
|
+
"aria-describedby",
|
|
101
|
+
"class"
|
|
102
|
+
])) : B.value ? (m(), s("div", {
|
|
103
|
+
key: 1,
|
|
104
|
+
class: p(K.value)
|
|
105
|
+
}, [u(_(C), f({ id: R.value }, {
|
|
106
|
+
..._(N),
|
|
107
|
+
...e.$attrs
|
|
108
|
+
}, {
|
|
109
|
+
"aria-invalid": L.value || void 0,
|
|
110
|
+
"aria-describedby": V.value,
|
|
111
|
+
class: q.value
|
|
112
|
+
}), {
|
|
113
|
+
default: y(() => [u(_(S), { class: p(J.value) }, {
|
|
114
|
+
default: y(() => [h(e.$slots, "default", {}, () => [j.modelValue === "indeterminate" ? (m(), a(t, {
|
|
115
|
+
key: 0,
|
|
72
116
|
icon: _(b)
|
|
117
|
+
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
118
|
+
key: 1,
|
|
119
|
+
icon: _(x)
|
|
73
120
|
}, null, 8, ["icon"]))])]),
|
|
74
121
|
_: 3
|
|
75
122
|
}, 8, ["class"])]),
|
|
@@ -79,33 +126,33 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
79
126
|
"aria-invalid",
|
|
80
127
|
"aria-describedby",
|
|
81
128
|
"class"
|
|
82
|
-
]), c("div", { class: p(
|
|
83
|
-
for:
|
|
84
|
-
class: p(
|
|
129
|
+
]), c("div", { class: p(Y.value) }, [u(_(w), {
|
|
130
|
+
for: R.value,
|
|
131
|
+
class: p(X.value)
|
|
85
132
|
}, {
|
|
86
|
-
default:
|
|
133
|
+
default: y(() => [h(e.$slots, "label", {}, () => [l(g(j.label), 1)])]),
|
|
87
134
|
_: 3
|
|
88
|
-
}, 8, ["for", "class"]),
|
|
135
|
+
}, 8, ["for", "class"]), z.value ? (m(), s("p", {
|
|
89
136
|
key: 0,
|
|
90
|
-
id: `${
|
|
91
|
-
class: p(
|
|
92
|
-
}, [h(e.$slots, "description", {}, () => [l(g(
|
|
93
|
-
key:
|
|
94
|
-
id:
|
|
137
|
+
id: `${R.value}-description`,
|
|
138
|
+
class: p(Z.value)
|
|
139
|
+
}, [h(e.$slots, "description", {}, () => [l(g(j.description), 1)])], 10, k)) : o("", !0)], 2)], 2)) : (m(), a(_(C), f({
|
|
140
|
+
key: 2,
|
|
141
|
+
id: R.value
|
|
95
142
|
}, {
|
|
96
|
-
..._(
|
|
143
|
+
..._(N),
|
|
97
144
|
...e.$attrs
|
|
98
145
|
}, {
|
|
99
|
-
"aria-invalid":
|
|
100
|
-
class:
|
|
146
|
+
"aria-invalid": L.value || void 0,
|
|
147
|
+
class: q.value
|
|
101
148
|
}), {
|
|
102
|
-
default:
|
|
103
|
-
default:
|
|
149
|
+
default: y(() => [u(_(S), { class: p(J.value) }, {
|
|
150
|
+
default: y(() => [h(e.$slots, "default", {}, () => [j.modelValue === "indeterminate" ? (m(), a(t, {
|
|
104
151
|
key: 0,
|
|
105
|
-
icon: _(
|
|
152
|
+
icon: _(b)
|
|
106
153
|
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
107
154
|
key: 1,
|
|
108
|
-
icon: _(
|
|
155
|
+
icon: _(x)
|
|
109
156
|
}, null, 8, ["icon"]))])]),
|
|
110
157
|
_: 3
|
|
111
158
|
}, 8, ["class"])]),
|
|
@@ -118,4 +165,4 @@ var E = ["id"], D = /*@__PURE__*/ d({
|
|
|
118
165
|
}
|
|
119
166
|
});
|
|
120
167
|
//#endregion
|
|
121
|
-
export {
|
|
168
|
+
export { A as default };
|
|
@@ -11,6 +11,18 @@ export interface ProgressProps {
|
|
|
11
11
|
/** Current value. `null` (or `indeterminate`) means unknown duration. */
|
|
12
12
|
modelValue?: number | null;
|
|
13
13
|
max?: number;
|
|
14
|
+
/**
|
|
15
|
+
* `linear` is a bar, `circle` a ring with the value in the middle. A ring
|
|
16
|
+
* ignores `segments` — a broken-up ring is a donut chart, and `IDonutChart`
|
|
17
|
+
* is the component for that.
|
|
18
|
+
*/
|
|
19
|
+
shape?: 'linear' | 'circle';
|
|
20
|
+
/**
|
|
21
|
+
* How many degrees of the ring the track covers — `180` is a half circle,
|
|
22
|
+
* `270` a gauge. The arc is centred at the top, so the gap sits at the
|
|
23
|
+
* bottom. Circles only, and ignored by the bar.
|
|
24
|
+
*/
|
|
25
|
+
angle?: number;
|
|
14
26
|
variant?: ProgressVariant;
|
|
15
27
|
/**
|
|
16
28
|
* Break the bar into runs that share one track — storage by file type, a
|
|
@@ -46,17 +58,31 @@ export interface ProgressProps {
|
|
|
46
58
|
legendItem?: string;
|
|
47
59
|
legendSwatch?: string;
|
|
48
60
|
legendValue?: string;
|
|
61
|
+
ring?: string;
|
|
62
|
+
ringTrack?: string;
|
|
63
|
+
ringIndicator?: string;
|
|
64
|
+
ringContent?: string;
|
|
65
|
+
ringValue?: string;
|
|
66
|
+
ringLabel?: string;
|
|
49
67
|
};
|
|
50
68
|
}
|
|
51
|
-
declare var
|
|
69
|
+
declare var __VLS_13: {
|
|
70
|
+
value: number | null;
|
|
71
|
+
percent: number;
|
|
72
|
+
formatted: string;
|
|
73
|
+
}, __VLS_15: {}, __VLS_17: {}, __VLS_19: {
|
|
52
74
|
value: number | null;
|
|
53
75
|
percent: number;
|
|
54
76
|
formatted: string;
|
|
55
77
|
};
|
|
56
78
|
type __VLS_Slots = {} & {
|
|
57
|
-
|
|
79
|
+
value?: (props: typeof __VLS_13) => any;
|
|
80
|
+
} & {
|
|
81
|
+
label?: (props: typeof __VLS_15) => any;
|
|
82
|
+
} & {
|
|
83
|
+
label?: (props: typeof __VLS_17) => any;
|
|
58
84
|
} & {
|
|
59
|
-
value?: (props: typeof
|
|
85
|
+
value?: (props: typeof __VLS_19) => any;
|
|
60
86
|
};
|
|
61
87
|
declare const __VLS_base: import("vue").DefineComponent<ProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{}>, {
|
|
62
88
|
unstyled: boolean;
|