iryx-ui 0.12.0 → 0.13.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 +35 -1315
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Accordion.js +5 -0
- package/dist/components/Accordion.vue.d.ts +80 -0
- package/dist/components/Accordion.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/Alert.vue.d.ts +1 -1
- package/dist/components/Alert.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/App.vue.d.ts +1 -1
- package/dist/components/AppShell.js +5 -0
- package/dist/components/AppShell.vue.d.ts +46 -0
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/AspectRatio.js +5 -0
- package/dist/components/AspectRatio.vue.d.ts +26 -0
- package/dist/components/AspectRatio.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/Avatar.js +5 -0
- package/dist/components/Avatar.vue.d.ts +52 -0
- package/dist/components/Avatar.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/AvatarGroup.js +5 -0
- package/dist/components/AvatarGroup.vue.d.ts +39 -0
- package/dist/components/AvatarGroup.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/Badge.vue.d.ts +1 -1
- package/dist/components/Banner.vue.d.ts +2 -2
- package/dist/components/BarChart.vue.d.ts +1 -1
- package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/components/Button.vue.d.ts +2 -2
- package/dist/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/components/Card.vue.d.ts +1 -1
- package/dist/components/Collapsible.js +5 -0
- package/dist/components/Collapsible.vue.d.ts +58 -0
- package/dist/components/Collapsible.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/ColorPicker.js +5 -0
- package/dist/components/ColorPicker.vue.d.ts +49 -0
- package/dist/components/ColorPicker.vue_vue_type_script_setup_true_lang.js +172 -0
- package/dist/components/Combobox.vue.d.ts +6 -6
- package/dist/components/CommandPalette.js +5 -0
- package/dist/components/CommandPalette.vue.d.ts +63 -0
- package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +185 -0
- package/dist/components/Container.js +5 -0
- package/dist/components/Container.vue.d.ts +33 -0
- package/dist/components/Container.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/ContextMenu.js +5 -0
- package/dist/components/ContextMenu.vue.d.ts +42 -0
- package/dist/components/ContextMenu.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/DateRangePicker.vue.d.ts +1 -1
- package/dist/components/Dialog.vue.d.ts +1 -1
- package/dist/components/Drawer.vue.d.ts +2 -2
- package/dist/components/EmptyState.vue.d.ts +1 -1
- package/dist/components/Input.vue.d.ts +1 -1
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/Kbd.js +5 -0
- package/dist/components/Kbd.vue.d.ts +46 -0
- package/dist/components/Kbd.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/components/Menubar.js +5 -0
- package/dist/components/Menubar.vue.d.ts +62 -0
- package/dist/components/Menubar.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/NavigationMenu.js +5 -0
- package/dist/components/NavigationMenu.vue.d.ts +75 -0
- package/dist/components/NavigationMenu.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/PageHeader.js +5 -0
- package/dist/components/PageHeader.vue.d.ts +52 -0
- package/dist/components/PageHeader.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/PinInput.js +5 -0
- package/dist/components/PinInput.vue.d.ts +65 -0
- package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/Popover.js +5 -0
- package/dist/components/Popover.vue.d.ts +75 -0
- package/dist/components/Popover.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/components/Progress.vue.d.ts +20 -1
- package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +84 -44
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/ScrollArea.js +5 -0
- package/dist/components/ScrollArea.vue.d.ts +41 -0
- package/dist/components/ScrollArea.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/ScrollFade.js +5 -0
- package/dist/components/ScrollFade.vue.d.ts +36 -0
- package/dist/components/ScrollFade.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/Select.vue.d.ts +2 -2
- package/dist/components/Sidebar.js +5 -0
- package/dist/components/Sidebar.vue.d.ts +72 -0
- package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/components/SignaturePad.js +5 -0
- package/dist/components/SignaturePad.vue.d.ts +60 -0
- package/dist/components/SignaturePad.vue_vue_type_script_setup_true_lang.js +158 -0
- package/dist/components/Skeleton.vue.d.ts +1 -1
- package/dist/components/Skeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/Slider.js +5 -0
- package/dist/components/Slider.vue.d.ts +80 -0
- package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/components/Splitter.js +5 -0
- package/dist/components/Splitter.vue.d.ts +59 -0
- package/dist/components/Splitter.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/Stat.vue.d.ts +1 -1
- package/dist/components/Switch.vue.d.ts +1 -0
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/components/Table.vue.d.ts +7 -1
- package/dist/components/Table.vue_vue_type_script_setup_true_lang.js +73 -58
- package/dist/components/TagsInput.js +5 -0
- package/dist/components/TagsInput.vue.d.ts +71 -0
- package/dist/components/TagsInput.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/TimeField.js +5 -0
- package/dist/components/TimeField.vue.d.ts +50 -0
- package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/components/Timeline.js +5 -0
- package/dist/components/Timeline.vue.d.ts +61 -0
- package/dist/components/Timeline.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/Toaster.vue.d.ts +1 -1
- package/dist/components/Toggle.js +5 -0
- package/dist/components/Toggle.vue.d.ts +42 -0
- package/dist/components/Toggle.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/ToggleGroup.js +5 -0
- package/dist/components/ToggleGroup.vue.d.ts +64 -0
- package/dist/components/ToggleGroup.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/Toolbar.js +5 -0
- package/dist/components/Toolbar.vue.d.ts +52 -0
- package/dist/components/Toolbar.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/components/Tree.js +5 -0
- package/dist/components/Tree.vue.d.ts +70 -0
- package/dist/components/Tree.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +144 -86
- package/dist/composables/appearance.js +5 -1
- package/dist/composables/cartesian.d.ts +11 -0
- package/dist/composables/cartesian.js +18 -19
- package/dist/composables/command-palette.d.ts +42 -0
- package/dist/composables/command-palette.js +32 -0
- package/dist/composables/date.d.ts +18 -2
- package/dist/composables/date.js +23 -12
- package/dist/composables/kbd.d.ts +26 -0
- package/dist/composables/kbd.js +161 -0
- package/dist/composables/navigation-menu.d.ts +29 -0
- package/dist/composables/navigation-menu.js +6 -0
- package/dist/composables/scroll-fade.d.ts +35 -0
- package/dist/composables/scroll-fade.js +36 -0
- package/dist/composables/sidebar.d.ts +35 -0
- package/dist/composables/sidebar.js +23 -0
- package/dist/composables/signature.d.ts +22 -0
- package/dist/composables/signature.js +13 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +153 -93
- package/dist/theme/accordion.d.ts +68 -0
- package/dist/theme/accordion.js +24 -0
- package/dist/theme/alert.d.ts +0 -3
- package/dist/theme/app-shell.d.ts +77 -0
- package/dist/theme/app-shell.js +35 -0
- package/dist/theme/avatar.d.ts +253 -0
- package/dist/theme/avatar.js +84 -0
- package/dist/theme/banner.d.ts +0 -9
- package/dist/theme/bar-chart.d.ts +0 -16
- package/dist/theme/breadcrumb.d.ts +3 -3
- package/dist/theme/button-group.d.ts +0 -3
- package/dist/theme/button.d.ts +0 -3
- package/dist/theme/card.js +2 -2
- package/dist/theme/chart-legend.d.ts +3 -11
- package/dist/theme/collapsible.d.ts +44 -0
- package/dist/theme/collapsible.js +17 -0
- package/dist/theme/color-picker.d.ts +98 -0
- package/dist/theme/color-picker.js +19 -0
- package/dist/theme/command-palette.d.ts +122 -0
- package/dist/theme/command-palette.js +22 -0
- package/dist/theme/container.d.ts +101 -0
- package/dist/theme/container.js +26 -0
- package/dist/theme/date-picker.d.ts +12 -0
- package/dist/theme/date-picker.js +1 -1
- package/dist/theme/dropdown-menu.d.ts +0 -9
- package/dist/theme/file-upload.d.ts +0 -3
- package/dist/theme/form.d.ts +12 -12
- package/dist/theme/index.d.ts +25 -0
- package/dist/theme/kbd.d.ts +71 -0
- package/dist/theme/kbd.js +29 -0
- package/dist/theme/line-chart.d.ts +0 -9
- package/dist/theme/menubar.d.ts +29 -0
- package/dist/theme/menubar.js +11 -0
- package/dist/theme/navigation-menu.d.ts +161 -0
- package/dist/theme/navigation-menu.js +43 -0
- package/dist/theme/number-input.d.ts +0 -3
- package/dist/theme/page-header.d.ts +47 -0
- package/dist/theme/page-header.js +17 -0
- package/dist/theme/pagination.d.ts +0 -3
- package/dist/theme/pin-input.d.ts +86 -0
- package/dist/theme/pin-input.js +32 -0
- package/dist/theme/popover.d.ts +119 -0
- package/dist/theme/popover.js +31 -0
- package/dist/theme/presets.d.ts +0 -2
- package/dist/theme/progress.d.ts +93 -0
- package/dist/theme/progress.js +37 -7
- package/dist/theme/radio-group.d.ts +24 -0
- package/dist/theme/radio-group.js +23 -14
- package/dist/theme/scroll-area.d.ts +65 -0
- package/dist/theme/scroll-area.js +57 -0
- package/dist/theme/scroll-fade.d.ts +35 -0
- package/dist/theme/scroll-fade.js +12 -0
- package/dist/theme/sidebar.d.ts +167 -0
- package/dist/theme/sidebar.js +43 -0
- package/dist/theme/signature-pad.d.ts +50 -0
- package/dist/theme/signature-pad.js +17 -0
- package/dist/theme/slider.d.ts +128 -0
- package/dist/theme/slider.js +49 -0
- package/dist/theme/sparkline.d.ts +0 -6
- package/dist/theme/splitter.d.ts +59 -0
- package/dist/theme/splitter.js +25 -0
- package/dist/theme/stat.d.ts +0 -3
- package/dist/theme/stepper.js +2 -2
- package/dist/theme/switch.d.ts +53 -29
- package/dist/theme/switch.js +33 -8
- package/dist/theme/table.d.ts +51 -3
- package/dist/theme/table.js +8 -3
- package/dist/theme/tabs.d.ts +0 -3
- package/dist/theme/tags-input.d.ts +110 -0
- package/dist/theme/tags-input.js +42 -0
- package/dist/theme/time-field.d.ts +68 -0
- package/dist/theme/time-field.js +21 -0
- package/dist/theme/timeline.d.ts +182 -0
- package/dist/theme/timeline.js +83 -0
- package/dist/theme/toggle.d.ts +145 -0
- package/dist/theme/toggle.js +84 -0
- package/dist/theme/toolbar.d.ts +56 -0
- package/dist/theme/toolbar.js +21 -0
- package/dist/theme/tree.d.ts +68 -0
- package/dist/theme/tree.js +28 -0
- package/package.json +2 -2
- package/theme.css +221 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { SidebarItems, SidebarLink } from '../composables/sidebar';
|
|
2
|
+
export interface SidebarProps {
|
|
3
|
+
/** Links, optionally grouped into labelled sections. */
|
|
4
|
+
items?: SidebarItems;
|
|
5
|
+
/** Which edge it sits on. Only decides where the border goes. */
|
|
6
|
+
side?: 'left' | 'right';
|
|
7
|
+
/**
|
|
8
|
+
* Accessible name for the navigation landmark — override for non-English
|
|
9
|
+
* apps.
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
13
|
+
unstyled?: boolean;
|
|
14
|
+
class?: string;
|
|
15
|
+
/** Override classes per slot, e.g. `{ nav: 'px-4' }`. */
|
|
16
|
+
ui?: {
|
|
17
|
+
root?: string;
|
|
18
|
+
header?: string;
|
|
19
|
+
nav?: string;
|
|
20
|
+
footer?: string;
|
|
21
|
+
section?: string;
|
|
22
|
+
sectionLabel?: string;
|
|
23
|
+
link?: string;
|
|
24
|
+
linkLabel?: string;
|
|
25
|
+
linkBadge?: string;
|
|
26
|
+
groupIcon?: string;
|
|
27
|
+
groupContent?: string;
|
|
28
|
+
groupInner?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type __VLS_Props = SidebarProps;
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
/** Icons-only mode. Bind it to persist the choice, or leave it internal. */
|
|
34
|
+
'collapsed'?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
37
|
+
declare var __VLS_8: {
|
|
38
|
+
collapsed: boolean;
|
|
39
|
+
}, __VLS_10: {
|
|
40
|
+
collapsed: boolean;
|
|
41
|
+
}, __VLS_61: {
|
|
42
|
+
link: SidebarLink;
|
|
43
|
+
collapsed: boolean;
|
|
44
|
+
}, __VLS_68: {
|
|
45
|
+
collapsed: boolean;
|
|
46
|
+
};
|
|
47
|
+
type __VLS_Slots = {} & {
|
|
48
|
+
header?: (props: typeof __VLS_8) => any;
|
|
49
|
+
} & {
|
|
50
|
+
default?: (props: typeof __VLS_10) => any;
|
|
51
|
+
} & {
|
|
52
|
+
link?: (props: typeof __VLS_61) => any;
|
|
53
|
+
} & {
|
|
54
|
+
footer?: (props: typeof __VLS_68) => any;
|
|
55
|
+
};
|
|
56
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
"update:collapsed": (value: boolean) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
59
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
unstyled: boolean;
|
|
62
|
+
label: string;
|
|
63
|
+
side: "left" | "right";
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
66
|
+
declare const _default: typeof __VLS_export;
|
|
67
|
+
export default _default;
|
|
68
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
69
|
+
new (): {
|
|
70
|
+
$slots: S;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { isSidebarGroup as n, toSidebarSections as r } from "../composables/sidebar.js";
|
|
4
|
+
import { sidebarTheme as i } from "../theme/sidebar.js";
|
|
5
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, normalizeClass as m, openBlock as h, renderList as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useModel as x, withCtx as S } from "vue";
|
|
6
|
+
import { ArrowRight01Icon as C } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { CollapsibleContent as w, CollapsibleRoot as T, CollapsibleTrigger as E, Primitive as D } from "reka-ui";
|
|
8
|
+
//#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var O = /*@__PURE__*/ f({
|
|
10
|
+
__name: "Sidebar",
|
|
11
|
+
props: /*@__PURE__*/ p({
|
|
12
|
+
items: {},
|
|
13
|
+
side: { default: "left" },
|
|
14
|
+
label: { default: "Sidebar" },
|
|
15
|
+
unstyled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
class: {},
|
|
20
|
+
ui: {}
|
|
21
|
+
}, {
|
|
22
|
+
collapsed: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
collapsedModifiers: {}
|
|
27
|
+
}),
|
|
28
|
+
emits: ["update:collapsed"],
|
|
29
|
+
setup(f) {
|
|
30
|
+
let p = f, O = x(f, "collapsed"), k = e(), A = o(() => p.unstyled ?? k.unstyled), j = o(() => r(p.items)), M = o(() => i({
|
|
31
|
+
side: p.side,
|
|
32
|
+
collapsed: O.value
|
|
33
|
+
}));
|
|
34
|
+
function N(e) {
|
|
35
|
+
let t = p.ui?.[e];
|
|
36
|
+
return A.value ? t : M.value[e]({ class: t });
|
|
37
|
+
}
|
|
38
|
+
let P = (e) => e.href ? "a" : "button";
|
|
39
|
+
function F(e, t) {
|
|
40
|
+
if (e.disabled) {
|
|
41
|
+
t.preventDefault();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
e.onSelect?.();
|
|
45
|
+
}
|
|
46
|
+
let I = (e) => e.label;
|
|
47
|
+
return (e, r) => (h(), s(b(D), {
|
|
48
|
+
as: "nav",
|
|
49
|
+
"aria-label": p.label,
|
|
50
|
+
"data-collapsed": O.value ? "" : void 0,
|
|
51
|
+
class: m(A.value ? [p.ui?.root, p.class] : M.value.root({ class: [p.ui?.root, p.class] }))
|
|
52
|
+
}, {
|
|
53
|
+
default: S(() => [
|
|
54
|
+
e.$slots.header ? (h(), l("div", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: m(N("header"))
|
|
57
|
+
}, [_(e.$slots, "header", { collapsed: O.value })], 2)) : c("", !0),
|
|
58
|
+
u("div", { class: m(N("nav")) }, [_(e.$slots, "default", { collapsed: O.value }, () => [(h(!0), l(a, null, g(j.value, (r, i) => (h(), l("div", {
|
|
59
|
+
key: r.section || i,
|
|
60
|
+
class: m(N("section"))
|
|
61
|
+
}, [r.section ? (h(), l("p", {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: m(N("sectionLabel"))
|
|
64
|
+
}, y(r.section), 3)) : c("", !0), (h(!0), l(a, null, g(r.items, (r) => (h(), l(a, { key: r.label }, [b(n)(r) ? (h(), s(b(T), {
|
|
65
|
+
key: 0,
|
|
66
|
+
"default-open": r.defaultOpen,
|
|
67
|
+
disabled: r.disabled
|
|
68
|
+
}, {
|
|
69
|
+
default: S(() => [d(b(E), {
|
|
70
|
+
"aria-label": I(r),
|
|
71
|
+
"data-active": r.active ? "" : void 0,
|
|
72
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
73
|
+
class: m(N("link"))
|
|
74
|
+
}, {
|
|
75
|
+
default: S(() => [
|
|
76
|
+
r.icon ? (h(), s(t, {
|
|
77
|
+
key: 0,
|
|
78
|
+
icon: r.icon
|
|
79
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
80
|
+
u("span", { class: m(N("linkLabel")) }, y(r.label), 3),
|
|
81
|
+
d(t, {
|
|
82
|
+
icon: b(C),
|
|
83
|
+
class: m(N("groupIcon"))
|
|
84
|
+
}, null, 8, ["icon", "class"])
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1032, [
|
|
88
|
+
"aria-label",
|
|
89
|
+
"data-active",
|
|
90
|
+
"data-disabled",
|
|
91
|
+
"class"
|
|
92
|
+
]), d(b(w), { class: m(N("groupContent")) }, {
|
|
93
|
+
default: S(() => [u("div", { class: m(N("groupInner")) }, [(h(!0), l(a, null, g(r.items, (e) => (h(), s(v(P(e)), {
|
|
94
|
+
key: e.label,
|
|
95
|
+
href: e.href,
|
|
96
|
+
type: e.href ? void 0 : "button",
|
|
97
|
+
"aria-label": I(e),
|
|
98
|
+
"aria-current": e.active ? "page" : void 0,
|
|
99
|
+
"aria-disabled": e.disabled || void 0,
|
|
100
|
+
"data-active": e.active ? "" : void 0,
|
|
101
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
102
|
+
class: m(N("link")),
|
|
103
|
+
onClick: (t) => F(e, t)
|
|
104
|
+
}, {
|
|
105
|
+
default: S(() => [
|
|
106
|
+
e.icon ? (h(), s(t, {
|
|
107
|
+
key: 0,
|
|
108
|
+
icon: e.icon
|
|
109
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
110
|
+
u("span", { class: m(N("linkLabel")) }, y(e.label), 3),
|
|
111
|
+
e.badge === void 0 ? c("", !0) : (h(), l("span", {
|
|
112
|
+
key: 1,
|
|
113
|
+
class: m(N("linkBadge"))
|
|
114
|
+
}, y(e.badge), 3))
|
|
115
|
+
]),
|
|
116
|
+
_: 2
|
|
117
|
+
}, 1032, [
|
|
118
|
+
"href",
|
|
119
|
+
"type",
|
|
120
|
+
"aria-label",
|
|
121
|
+
"aria-current",
|
|
122
|
+
"aria-disabled",
|
|
123
|
+
"data-active",
|
|
124
|
+
"data-disabled",
|
|
125
|
+
"class",
|
|
126
|
+
"onClick"
|
|
127
|
+
]))), 128))], 2)]),
|
|
128
|
+
_: 2
|
|
129
|
+
}, 1032, ["class"])]),
|
|
130
|
+
_: 2
|
|
131
|
+
}, 1032, ["default-open", "disabled"])) : (h(), s(v(P(r)), {
|
|
132
|
+
key: 1,
|
|
133
|
+
href: r.href,
|
|
134
|
+
type: r.href ? void 0 : "button",
|
|
135
|
+
"aria-label": I(r),
|
|
136
|
+
"aria-current": r.active ? "page" : void 0,
|
|
137
|
+
"aria-disabled": r.disabled || void 0,
|
|
138
|
+
"data-active": r.active ? "" : void 0,
|
|
139
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
140
|
+
class: m(N("link")),
|
|
141
|
+
onClick: (e) => F(r, e)
|
|
142
|
+
}, {
|
|
143
|
+
default: S(() => [_(e.$slots, "link", {
|
|
144
|
+
link: r,
|
|
145
|
+
collapsed: O.value
|
|
146
|
+
}, () => [
|
|
147
|
+
r.icon ? (h(), s(t, {
|
|
148
|
+
key: 0,
|
|
149
|
+
icon: r.icon
|
|
150
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
151
|
+
u("span", { class: m(N("linkLabel")) }, y(r.label), 3),
|
|
152
|
+
r.badge === void 0 ? c("", !0) : (h(), l("span", {
|
|
153
|
+
key: 1,
|
|
154
|
+
class: m(N("linkBadge"))
|
|
155
|
+
}, y(r.badge), 3))
|
|
156
|
+
])]),
|
|
157
|
+
_: 2
|
|
158
|
+
}, 1032, [
|
|
159
|
+
"href",
|
|
160
|
+
"type",
|
|
161
|
+
"aria-label",
|
|
162
|
+
"aria-current",
|
|
163
|
+
"aria-disabled",
|
|
164
|
+
"data-active",
|
|
165
|
+
"data-disabled",
|
|
166
|
+
"class",
|
|
167
|
+
"onClick"
|
|
168
|
+
]))], 64))), 128))], 2))), 128))])], 2),
|
|
169
|
+
e.$slots.footer ? (h(), l("div", {
|
|
170
|
+
key: 1,
|
|
171
|
+
class: m(N("footer"))
|
|
172
|
+
}, [_(e.$slots, "footer", { collapsed: O.value })], 2)) : c("", !0)
|
|
173
|
+
]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 8, [
|
|
176
|
+
"aria-label",
|
|
177
|
+
"data-collapsed",
|
|
178
|
+
"class"
|
|
179
|
+
]));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
//#endregion
|
|
183
|
+
export { O as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface SignaturePadProps {
|
|
2
|
+
/**
|
|
3
|
+
* The signature as a PNG data URL, or `null` when nothing has been drawn.
|
|
4
|
+
* A data URL is what goes in a request body and what an `<img>` can render
|
|
5
|
+
* back, so it is what the model holds.
|
|
6
|
+
*/
|
|
7
|
+
modelValue?: string | null;
|
|
8
|
+
/** Height of the drawing surface. The width follows the container. */
|
|
9
|
+
height?: number;
|
|
10
|
+
penColor?: string;
|
|
11
|
+
/** Nominal pen width. The drawn width varies with speed and pressure. */
|
|
12
|
+
penWidth?: number;
|
|
13
|
+
undoLabel?: string;
|
|
14
|
+
clearLabel?: string;
|
|
15
|
+
/** Names the pad itself, since a canvas has no text of its own. */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
21
|
+
unstyled?: boolean;
|
|
22
|
+
class?: string;
|
|
23
|
+
/** Override classes per slot, e.g. `{ canvas: 'bg-white' }`. */
|
|
24
|
+
ui?: {
|
|
25
|
+
root?: string;
|
|
26
|
+
canvas?: string;
|
|
27
|
+
actions?: string;
|
|
28
|
+
action?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare function toDataUrl(): string | null;
|
|
32
|
+
declare function undo(): void;
|
|
33
|
+
declare function clear(): void;
|
|
34
|
+
declare const __VLS_export: import("vue").DefineComponent<SignaturePadProps, {
|
|
35
|
+
clear: typeof clear;
|
|
36
|
+
undo: typeof undo;
|
|
37
|
+
isEmpty: import("vue").ComputedRef<boolean>;
|
|
38
|
+
toDataUrl: typeof toDataUrl;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
|
+
clear: () => any;
|
|
41
|
+
"update:modelValue": (value: string | null) => any;
|
|
42
|
+
start: () => any;
|
|
43
|
+
end: (value: string | null) => any;
|
|
44
|
+
}, string, import("vue").PublicProps, Readonly<SignaturePadProps> & Readonly<{
|
|
45
|
+
onClear?: (() => any) | undefined;
|
|
46
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
47
|
+
onStart?: (() => any) | undefined;
|
|
48
|
+
onEnd?: ((value: string | null) => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
unstyled: boolean;
|
|
51
|
+
height: number;
|
|
52
|
+
invalid: boolean;
|
|
53
|
+
ariaLabel: string;
|
|
54
|
+
clearLabel: string;
|
|
55
|
+
penColor: string;
|
|
56
|
+
penWidth: number;
|
|
57
|
+
undoLabel: string;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
|
+
declare const _default: typeof __VLS_export;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useAppearance as n } from "../composables/appearance.js";
|
|
4
|
+
import { useFormField as r } from "../composables/form.js";
|
|
5
|
+
import { hasInk as i, strokeWidth as a } from "../composables/signature.js";
|
|
6
|
+
import { signaturePadTheme as o } from "../theme/signature-pad.js";
|
|
7
|
+
import { computed as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, unref as v, watch as ee } from "vue";
|
|
8
|
+
import { ArrowTurnBackwardIcon as y, Delete02Icon as b } from "@hugeicons/core-free-icons";
|
|
9
|
+
//#region src/components/SignaturePad.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var x = [
|
|
11
|
+
"id",
|
|
12
|
+
"aria-label",
|
|
13
|
+
"aria-describedby"
|
|
14
|
+
], S = [
|
|
15
|
+
"aria-label",
|
|
16
|
+
"title",
|
|
17
|
+
"disabled"
|
|
18
|
+
], C = [
|
|
19
|
+
"aria-label",
|
|
20
|
+
"title",
|
|
21
|
+
"disabled"
|
|
22
|
+
], w = /*@__PURE__*/ d({
|
|
23
|
+
__name: "SignaturePad",
|
|
24
|
+
props: {
|
|
25
|
+
modelValue: {},
|
|
26
|
+
height: { default: 160 },
|
|
27
|
+
penColor: { default: "currentColor" },
|
|
28
|
+
penWidth: { default: 2 },
|
|
29
|
+
undoLabel: { default: "Undo last stroke" },
|
|
30
|
+
clearLabel: { default: "Clear signature" },
|
|
31
|
+
ariaLabel: { default: "Signature" },
|
|
32
|
+
disabled: { type: Boolean },
|
|
33
|
+
invalid: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
id: {},
|
|
38
|
+
unstyled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
class: {},
|
|
43
|
+
ui: {}
|
|
44
|
+
},
|
|
45
|
+
emits: [
|
|
46
|
+
"update:modelValue",
|
|
47
|
+
"start",
|
|
48
|
+
"end",
|
|
49
|
+
"clear"
|
|
50
|
+
],
|
|
51
|
+
setup(d, { expose: w, emit: T }) {
|
|
52
|
+
let E = d, D = T, O = _(), k = _([]), A = !1, j = 0, M = () => k.value.at(-1), N = r(), P = s(() => E.id ?? N?.id.value), F = s(() => E.invalid ?? N?.invalid.value ?? !1), I = s(() => !i(k.value));
|
|
53
|
+
function L() {
|
|
54
|
+
if (E.penColor !== "currentColor") return E.penColor;
|
|
55
|
+
let e = O.value;
|
|
56
|
+
return e ? getComputedStyle(e).color : "#000000";
|
|
57
|
+
}
|
|
58
|
+
function R() {
|
|
59
|
+
let e = O.value;
|
|
60
|
+
if (!e) return;
|
|
61
|
+
let t = window.devicePixelRatio || 1, n = e.clientWidth;
|
|
62
|
+
if (!n) return;
|
|
63
|
+
e.width = Math.round(n * t), e.height = Math.round(E.height * t);
|
|
64
|
+
let r = e.getContext("2d");
|
|
65
|
+
r && (r.scale(t, t), z());
|
|
66
|
+
}
|
|
67
|
+
function z() {
|
|
68
|
+
let e = O.value, t = e?.getContext("2d");
|
|
69
|
+
if (!e || !t) return;
|
|
70
|
+
let n = window.devicePixelRatio || 1;
|
|
71
|
+
t.clearRect(0, 0, e.width / n, e.height / n), t.strokeStyle = L(), t.lineCap = "round", t.lineJoin = "round";
|
|
72
|
+
for (let e of k.value) for (let n = 1; n < e.length; n++) {
|
|
73
|
+
let r = e[n - 1], i = e[n];
|
|
74
|
+
t.beginPath(), t.lineWidth = a(E.penWidth, r, i), t.moveTo(r.x, r.y), t.lineTo(i.x, i.y), t.stroke();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function B() {
|
|
78
|
+
return I.value ? null : O.value?.toDataURL("image/png") ?? null;
|
|
79
|
+
}
|
|
80
|
+
function V() {
|
|
81
|
+
let e = B();
|
|
82
|
+
D("update:modelValue", e), D("end", e);
|
|
83
|
+
}
|
|
84
|
+
function H(e) {
|
|
85
|
+
let t = O.value.getBoundingClientRect();
|
|
86
|
+
return {
|
|
87
|
+
x: e.clientX - t.left,
|
|
88
|
+
y: e.clientY - t.top,
|
|
89
|
+
t: performance.now() - j,
|
|
90
|
+
pressure: e.pressure > 0 ? e.pressure : .5
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function U(e) {
|
|
94
|
+
E.disabled || (O.value?.setPointerCapture(e.pointerId), j = performance.now(), A = !0, k.value = [...k.value, [H(e)]], D("start"));
|
|
95
|
+
}
|
|
96
|
+
function W(e) {
|
|
97
|
+
A && (M()?.push(H(e)), z());
|
|
98
|
+
}
|
|
99
|
+
function G(e) {
|
|
100
|
+
A && (O.value?.releasePointerCapture(e.pointerId), A = !1, z(), V());
|
|
101
|
+
}
|
|
102
|
+
function K() {
|
|
103
|
+
k.value.length && (k.value = k.value.slice(0, -1), z(), V());
|
|
104
|
+
}
|
|
105
|
+
function q() {
|
|
106
|
+
k.value = [], z(), D("update:modelValue", null), D("clear");
|
|
107
|
+
}
|
|
108
|
+
let { isDark: J } = n();
|
|
109
|
+
ee(J, z);
|
|
110
|
+
let Y;
|
|
111
|
+
h(() => {
|
|
112
|
+
R(), Y = new ResizeObserver(R), O.value && Y.observe(O.value);
|
|
113
|
+
}), m(() => Y?.disconnect()), w({
|
|
114
|
+
clear: q,
|
|
115
|
+
undo: K,
|
|
116
|
+
isEmpty: I,
|
|
117
|
+
toDataUrl: B
|
|
118
|
+
});
|
|
119
|
+
let X = e(), Z = s(() => E.unstyled ?? X.unstyled), Q = s(() => o({
|
|
120
|
+
invalid: F.value,
|
|
121
|
+
disabled: E.disabled
|
|
122
|
+
}));
|
|
123
|
+
function $(e, t) {
|
|
124
|
+
let n = [E.ui?.[e], t].filter(Boolean).join(" ");
|
|
125
|
+
return Z.value ? n : Q.value[e]({ class: n });
|
|
126
|
+
}
|
|
127
|
+
return (e, n) => (g(), c("div", { class: f($("root", E.class)) }, [l("canvas", {
|
|
128
|
+
id: P.value,
|
|
129
|
+
ref_key: "canvas",
|
|
130
|
+
ref: O,
|
|
131
|
+
role: "img",
|
|
132
|
+
"aria-label": E.ariaLabel,
|
|
133
|
+
"aria-describedby": v(N)?.describedBy.value,
|
|
134
|
+
style: p({ height: `${E.height}px` }),
|
|
135
|
+
class: f($("canvas")),
|
|
136
|
+
onPointerdown: U,
|
|
137
|
+
onPointermove: W,
|
|
138
|
+
onPointerup: G,
|
|
139
|
+
onPointercancel: G
|
|
140
|
+
}, null, 46, x), l("div", { class: f($("actions")) }, [l("button", {
|
|
141
|
+
type: "button",
|
|
142
|
+
"aria-label": E.undoLabel,
|
|
143
|
+
title: E.undoLabel,
|
|
144
|
+
disabled: E.disabled || !k.value.length,
|
|
145
|
+
class: f($("action")),
|
|
146
|
+
onClick: K
|
|
147
|
+
}, [u(t, { icon: v(y) }, null, 8, ["icon"])], 10, S), l("button", {
|
|
148
|
+
type: "button",
|
|
149
|
+
"aria-label": E.clearLabel,
|
|
150
|
+
title: E.clearLabel,
|
|
151
|
+
disabled: E.disabled || I.value,
|
|
152
|
+
class: f($("action")),
|
|
153
|
+
onClick: q
|
|
154
|
+
}, [u(t, { icon: v(b) }, null, 8, ["icon"])], 10, C)], 2)], 2));
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
//#endregion
|
|
158
|
+
export { w as default };
|
|
@@ -11,8 +11,8 @@ export interface SkeletonProps {
|
|
|
11
11
|
class?: string;
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
14
|
-
as: string;
|
|
15
14
|
unstyled: boolean;
|
|
15
|
+
as: string;
|
|
16
16
|
label: string;
|
|
17
17
|
lines: number;
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -17,26 +17,26 @@ var f = ["aria-label"], p = /*@__PURE__*/ o({
|
|
|
17
17
|
class: {}
|
|
18
18
|
},
|
|
19
19
|
setup(o) {
|
|
20
|
-
let p = o, m = e(), h = r(() => p.unstyled ?? m.unstyled), g = r(() => h.value ? p.class : t({
|
|
20
|
+
let p = o, m = e(), h = r(() => p.unstyled ?? m.unstyled), g = r(() => Math.max(1, p.lines)), _ = r(() => h.value ? void 0 : t({ variant: p.variant })), v = r(() => h.value || g.value > 1 ? p.class : t({
|
|
21
21
|
variant: p.variant,
|
|
22
22
|
class: p.class
|
|
23
|
-
}))
|
|
24
|
-
return (e, t) =>
|
|
23
|
+
}));
|
|
24
|
+
return (e, t) => g.value > 1 ? (c(), a("div", {
|
|
25
25
|
key: 0,
|
|
26
26
|
role: "status",
|
|
27
27
|
"aria-label": p.label,
|
|
28
|
-
class: "flex w-full flex-col gap-2"
|
|
29
|
-
}, [(c(!0), a(n, null, l(
|
|
28
|
+
class: s([h.value ? void 0 : "flex w-full flex-col gap-2", v.value])
|
|
29
|
+
}, [(c(!0), a(n, null, l(g.value, (e) => (c(), i(u(d), {
|
|
30
30
|
key: e,
|
|
31
31
|
as: p.as,
|
|
32
|
-
class: s(
|
|
32
|
+
class: s(_.value),
|
|
33
33
|
"aria-hidden": "true"
|
|
34
|
-
}, null, 8, ["as", "class"]))), 128))],
|
|
34
|
+
}, null, 8, ["as", "class"]))), 128))], 10, f)) : (c(), i(u(d), {
|
|
35
35
|
key: 1,
|
|
36
36
|
as: p.as,
|
|
37
37
|
role: "status",
|
|
38
38
|
"aria-label": p.label,
|
|
39
|
-
class: s(
|
|
39
|
+
class: s(v.value)
|
|
40
40
|
}, null, 8, [
|
|
41
41
|
"as",
|
|
42
42
|
"aria-label",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
export interface SliderProps extends /* @vue-ignore */ Omit<SliderRootProps, 'modelValue' | 'defaultValue'> {
|
|
3
|
+
/**
|
|
4
|
+
* A single number for one thumb, an array for a range. Whichever shape you
|
|
5
|
+
* pass back is the shape you get out, so `v-model` on a plain `ref(50)`
|
|
6
|
+
* stays a number instead of silently becoming `[50]`.
|
|
7
|
+
*/
|
|
8
|
+
modelValue?: number | number[] | null;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
inverted?: boolean;
|
|
15
|
+
/** Keeps range thumbs from crossing or stacking. */
|
|
16
|
+
minStepsBetweenThumbs?: number;
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** Text shown above the track. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Show the current value beside the label. */
|
|
21
|
+
showValue?: boolean;
|
|
22
|
+
/** Show `min` and `max` captions under the track. Horizontal only. */
|
|
23
|
+
showScale?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Format the displayed value, the scale captions and each thumb's
|
|
26
|
+
* accessible label. Override for units or non-English locales.
|
|
27
|
+
*/
|
|
28
|
+
formatValue?: (value: number) => string;
|
|
29
|
+
/**
|
|
30
|
+
* How each thumb of a range is named after the label — "Price minimum",
|
|
31
|
+
* "Price maximum". Override for non-English locales.
|
|
32
|
+
*/
|
|
33
|
+
rangeLabels?: [string, string];
|
|
34
|
+
id?: string;
|
|
35
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
36
|
+
unstyled?: boolean;
|
|
37
|
+
class?: string;
|
|
38
|
+
/** Override classes per slot, e.g. `{ thumb: 'size-6' }`. */
|
|
39
|
+
ui?: {
|
|
40
|
+
root?: string;
|
|
41
|
+
header?: string;
|
|
42
|
+
label?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
slider?: string;
|
|
45
|
+
track?: string;
|
|
46
|
+
range?: string;
|
|
47
|
+
thumb?: string;
|
|
48
|
+
scale?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
52
|
+
values: number[];
|
|
53
|
+
text: string;
|
|
54
|
+
};
|
|
55
|
+
type __VLS_Slots = {} & {
|
|
56
|
+
label?: (props: typeof __VLS_1) => any;
|
|
57
|
+
} & {
|
|
58
|
+
value?: (props: typeof __VLS_3) => any;
|
|
59
|
+
};
|
|
60
|
+
declare const __VLS_base: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
+
"update:modelValue": (value: number | number[]) => any;
|
|
62
|
+
valueCommit: (value: number | number[]) => any;
|
|
63
|
+
}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{
|
|
64
|
+
"onUpdate:modelValue"?: ((value: number | number[]) => any) | undefined;
|
|
65
|
+
onValueCommit?: ((value: number | number[]) => any) | undefined;
|
|
66
|
+
}>, {
|
|
67
|
+
unstyled: boolean;
|
|
68
|
+
max: number;
|
|
69
|
+
step: number;
|
|
70
|
+
min: number;
|
|
71
|
+
rangeLabels: [string, string];
|
|
72
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
73
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
74
|
+
declare const _default: typeof __VLS_export;
|
|
75
|
+
export default _default;
|
|
76
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
77
|
+
new (): {
|
|
78
|
+
$slots: S;
|
|
79
|
+
};
|
|
80
|
+
};
|