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,119 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { tagsInputTheme as r } from "../theme/tags-input.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, openBlock as p, renderList as m, renderSlot as h, unref as g, withCtx as _ } from "vue";
|
|
6
|
+
import { Cancel01Icon as v } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { TagsInputClear as y, TagsInputInput as b, TagsInputItem as x, TagsInputItemDelete as S, TagsInputItemText as C, TagsInputRoot as w } from "reka-ui";
|
|
8
|
+
//#region src/components/TagsInput.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var T = /*@__PURE__*/ u({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "TagsInput",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
14
|
+
placeholder: {},
|
|
15
|
+
max: {},
|
|
16
|
+
delimiter: { default: "," },
|
|
17
|
+
duplicate: { type: Boolean },
|
|
18
|
+
addOnPaste: { type: Boolean },
|
|
19
|
+
addOnTab: { type: Boolean },
|
|
20
|
+
addOnBlur: { type: Boolean },
|
|
21
|
+
clearable: { type: Boolean },
|
|
22
|
+
disabled: { type: Boolean },
|
|
23
|
+
invalid: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
size: {},
|
|
28
|
+
id: {},
|
|
29
|
+
unstyled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
class: {},
|
|
34
|
+
ui: {}
|
|
35
|
+
},
|
|
36
|
+
emits: [
|
|
37
|
+
"update:modelValue",
|
|
38
|
+
"invalidTag",
|
|
39
|
+
"addTag",
|
|
40
|
+
"removeTag"
|
|
41
|
+
],
|
|
42
|
+
setup(u, { emit: T }) {
|
|
43
|
+
let E = u, D = T, O = a(() => E.modelValue ?? []), k = a(() => E.max !== void 0 && O.value.length >= E.max), A = n(), j = a(() => E.id ?? A?.id.value), M = a(() => E.invalid ?? A?.invalid.value ?? !1), N = e(), P = a(() => E.unstyled ?? N.unstyled), F = a(() => r({
|
|
44
|
+
size: E.size,
|
|
45
|
+
invalid: M.value
|
|
46
|
+
}));
|
|
47
|
+
function I(e, t) {
|
|
48
|
+
let n = [E.ui?.[e], t];
|
|
49
|
+
return P.value ? n : F.value[e]({ class: n });
|
|
50
|
+
}
|
|
51
|
+
return (e, n) => (p(), o(g(w), {
|
|
52
|
+
"model-value": O.value,
|
|
53
|
+
max: E.max,
|
|
54
|
+
delimiter: E.delimiter,
|
|
55
|
+
duplicate: E.duplicate,
|
|
56
|
+
"add-on-paste": E.addOnPaste,
|
|
57
|
+
"add-on-tab": E.addOnTab,
|
|
58
|
+
"add-on-blur": E.addOnBlur,
|
|
59
|
+
disabled: E.disabled,
|
|
60
|
+
class: f(I("root", E.class)),
|
|
61
|
+
"onUpdate:modelValue": n[0] ||= (e) => D("update:modelValue", e),
|
|
62
|
+
onInvalid: n[1] ||= (e) => D("invalidTag", String(e)),
|
|
63
|
+
onAddTag: n[2] ||= (e) => D("addTag", String(e)),
|
|
64
|
+
onRemoveTag: n[3] ||= (e) => D("removeTag", String(e))
|
|
65
|
+
}, {
|
|
66
|
+
default: _(() => [
|
|
67
|
+
(p(!0), c(i, null, m(O.value, (n) => (p(), o(g(x), {
|
|
68
|
+
key: n,
|
|
69
|
+
value: n,
|
|
70
|
+
class: f(I("tag"))
|
|
71
|
+
}, {
|
|
72
|
+
default: _(() => [h(e.$slots, "tag", { tag: n }, () => [l(g(C), { class: f(I("tagText")) }, null, 8, ["class"]), l(g(S), {
|
|
73
|
+
"aria-label": `Remove ${n}`,
|
|
74
|
+
class: f(I("tagDelete"))
|
|
75
|
+
}, {
|
|
76
|
+
default: _(() => [l(t, { icon: g(v) }, null, 8, ["icon"])]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 8, ["aria-label", "class"])])]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, 1032, ["value", "class"]))), 128)),
|
|
81
|
+
l(g(b), d({
|
|
82
|
+
id: j.value,
|
|
83
|
+
placeholder: k.value ? void 0 : E.placeholder,
|
|
84
|
+
readonly: k.value || void 0,
|
|
85
|
+
"aria-invalid": M.value || void 0,
|
|
86
|
+
"aria-describedby": g(A)?.describedBy.value
|
|
87
|
+
}, e.$attrs, { class: I("input") }), null, 16, [
|
|
88
|
+
"id",
|
|
89
|
+
"placeholder",
|
|
90
|
+
"readonly",
|
|
91
|
+
"aria-invalid",
|
|
92
|
+
"aria-describedby",
|
|
93
|
+
"class"
|
|
94
|
+
]),
|
|
95
|
+
E.clearable && O.value.length ? (p(), o(g(y), {
|
|
96
|
+
key: 0,
|
|
97
|
+
"aria-label": "Clear all",
|
|
98
|
+
class: f(I("clear"))
|
|
99
|
+
}, {
|
|
100
|
+
default: _(() => [h(e.$slots, "clear", {}, () => [l(t, { icon: g(v) }, null, 8, ["icon"])])]),
|
|
101
|
+
_: 3
|
|
102
|
+
}, 8, ["class"])) : s("", !0)
|
|
103
|
+
]),
|
|
104
|
+
_: 3
|
|
105
|
+
}, 8, [
|
|
106
|
+
"model-value",
|
|
107
|
+
"max",
|
|
108
|
+
"delimiter",
|
|
109
|
+
"duplicate",
|
|
110
|
+
"add-on-paste",
|
|
111
|
+
"add-on-tab",
|
|
112
|
+
"add-on-blur",
|
|
113
|
+
"disabled",
|
|
114
|
+
"class"
|
|
115
|
+
]));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
//#endregion
|
|
119
|
+
export { T as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { textareaTheme as t } from "../theme/input.js";
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
4
|
import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, nextTick as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, unref as f, useModel as p, vModelText as m, watch as h, withDirectives as g } from "vue";
|
|
5
5
|
//#region src/components/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _ = [
|
|
@@ -36,7 +36,7 @@ var _ = [
|
|
|
36
36
|
}),
|
|
37
37
|
emits: ["update:modelValue"],
|
|
38
38
|
setup(a, { expose: o }) {
|
|
39
|
-
let v = a, y = p(a, "modelValue"), b =
|
|
39
|
+
let v = a, y = p(a, "modelValue"), b = n(), x = r(() => v.id ?? b?.id.value), S = r(() => v.invalid ?? b?.invalid.value ?? !1), C = e(), w = r(() => v.unstyled ?? C.unstyled), T = r(() => w.value ? v.class : t({
|
|
40
40
|
size: v.size,
|
|
41
41
|
invalid: S.value,
|
|
42
42
|
autosize: !!v.autosize,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface TimeFieldProps {
|
|
2
|
+
/**
|
|
3
|
+
* The time as a `HH:mm` (or `HH:mm:ss`) **string** on a 24-hour clock,
|
|
4
|
+
* never a `Date`. A `Date` carries a date and a time zone nobody asked for,
|
|
5
|
+
* and "half past nine" is neither. Padded so it sorts as a string.
|
|
6
|
+
*/
|
|
7
|
+
modelValue?: string | null;
|
|
8
|
+
/** How much of the time to show. `second` adds a seconds segment. */
|
|
9
|
+
granularity?: 'hour' | 'minute' | 'second';
|
|
10
|
+
/**
|
|
11
|
+
* 12- or 24-hour display. Left unset it follows `locale`, which is the
|
|
12
|
+
* right default — this is a display choice, not a data one; the model
|
|
13
|
+
* stays 24-hour either way.
|
|
14
|
+
*/
|
|
15
|
+
hourCycle?: 12 | 24;
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** Stepping interval per segment, for arrow keys and scrolling. */
|
|
18
|
+
step?: {
|
|
19
|
+
hour?: number;
|
|
20
|
+
minute?: number;
|
|
21
|
+
second?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Earliest and latest allowed, in the same `HH:mm` form. */
|
|
24
|
+
minValue?: string;
|
|
25
|
+
maxValue?: string;
|
|
26
|
+
size?: 'sm' | 'md' | 'lg';
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
readonly?: boolean;
|
|
29
|
+
invalid?: boolean;
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
32
|
+
unstyled?: boolean;
|
|
33
|
+
class?: string;
|
|
34
|
+
/** Override classes per slot, e.g. `{ segment: 'px-1' }`. */
|
|
35
|
+
ui?: {
|
|
36
|
+
root?: string;
|
|
37
|
+
segment?: string;
|
|
38
|
+
literal?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
declare const __VLS_export: import("vue").DefineComponent<TimeFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
|
+
"update:modelValue": (value: string | null) => any;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<TimeFieldProps> & Readonly<{
|
|
44
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
unstyled: boolean;
|
|
47
|
+
invalid: boolean;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { toIsoTime as n, toTime as r } from "../composables/date.js";
|
|
4
|
+
import { timeFieldTheme as i } from "../theme/time-field.js";
|
|
5
|
+
import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, createTextVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
6
|
+
import { TimeFieldInput as _, TimeFieldRoot as v } from "reka-ui";
|
|
7
|
+
//#region src/components/TimeField.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var y = /*@__PURE__*/ u({
|
|
9
|
+
__name: "TimeField",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {},
|
|
12
|
+
granularity: {},
|
|
13
|
+
hourCycle: {},
|
|
14
|
+
locale: {},
|
|
15
|
+
step: {},
|
|
16
|
+
minValue: {},
|
|
17
|
+
maxValue: {},
|
|
18
|
+
size: {},
|
|
19
|
+
disabled: { type: Boolean },
|
|
20
|
+
readonly: { type: Boolean },
|
|
21
|
+
invalid: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
id: {},
|
|
26
|
+
unstyled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
class: {},
|
|
31
|
+
ui: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue"],
|
|
34
|
+
setup(u, { emit: y }) {
|
|
35
|
+
let b = u, x = y, S = t(), C = o(() => b.id ?? S?.id.value), w = o(() => b.invalid ?? S?.invalid.value ?? !1), T = e(), E = o(() => b.unstyled ?? T.unstyled), D = o(() => i({
|
|
36
|
+
size: b.size,
|
|
37
|
+
invalid: w.value
|
|
38
|
+
})), O = o(() => E.value ? [b.ui?.root, b.class] : D.value.root({ class: [b.ui?.root, b.class] })), k = o(() => E.value ? b.ui?.segment : D.value.segment({ class: b.ui?.segment })), A = o(() => E.value ? b.ui?.literal : D.value.literal({ class: b.ui?.literal }));
|
|
39
|
+
return (e, t) => (f(), s(h(v), {
|
|
40
|
+
id: C.value,
|
|
41
|
+
"model-value": h(r)(b.modelValue),
|
|
42
|
+
granularity: b.granularity,
|
|
43
|
+
"hour-cycle": b.hourCycle,
|
|
44
|
+
locale: b.locale,
|
|
45
|
+
step: b.step,
|
|
46
|
+
"min-value": h(r)(b.minValue),
|
|
47
|
+
"max-value": h(r)(b.maxValue),
|
|
48
|
+
disabled: b.disabled,
|
|
49
|
+
readonly: b.readonly,
|
|
50
|
+
"aria-invalid": w.value || void 0,
|
|
51
|
+
"aria-describedby": h(S)?.describedBy.value,
|
|
52
|
+
class: d(O.value),
|
|
53
|
+
"onUpdate:modelValue": t[0] ||= (e) => x("update:modelValue", h(n)(e))
|
|
54
|
+
}, {
|
|
55
|
+
default: g(({ segments: e }) => [(f(!0), c(a, null, p(e, (e) => (f(), c(a, { key: e.part }, [e.part === "literal" ? (f(), c("span", {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: d(A.value)
|
|
58
|
+
}, m(e.value), 3)) : (f(), s(h(_), {
|
|
59
|
+
key: 1,
|
|
60
|
+
part: e.part,
|
|
61
|
+
class: d(k.value)
|
|
62
|
+
}, {
|
|
63
|
+
default: g(() => [l(m(e.value), 1)]),
|
|
64
|
+
_: 2
|
|
65
|
+
}, 1032, ["part", "class"]))], 64))), 128))]),
|
|
66
|
+
_: 1
|
|
67
|
+
}, 8, [
|
|
68
|
+
"id",
|
|
69
|
+
"model-value",
|
|
70
|
+
"granularity",
|
|
71
|
+
"hour-cycle",
|
|
72
|
+
"locale",
|
|
73
|
+
"step",
|
|
74
|
+
"min-value",
|
|
75
|
+
"max-value",
|
|
76
|
+
"disabled",
|
|
77
|
+
"readonly",
|
|
78
|
+
"aria-invalid",
|
|
79
|
+
"aria-describedby",
|
|
80
|
+
"class"
|
|
81
|
+
]));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
export { y as default };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IconLike } from '../composables/icon';
|
|
2
|
+
export type TimelineVariant = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
export interface TimelineItem {
|
|
4
|
+
/** What happened. Say it in the title — colour alone carries nothing. */
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/**
|
|
8
|
+
* When it happened. Rendered as given, so format it where you know the
|
|
9
|
+
* reader's locale rather than guessing here.
|
|
10
|
+
*/
|
|
11
|
+
time?: string;
|
|
12
|
+
/** Machine-readable timestamp for the `<time>` element, e.g. an ISO string. */
|
|
13
|
+
datetime?: string;
|
|
14
|
+
icon?: IconLike;
|
|
15
|
+
variant?: TimelineVariant;
|
|
16
|
+
}
|
|
17
|
+
export interface TimelineProps {
|
|
18
|
+
items?: TimelineItem[];
|
|
19
|
+
size?: 'sm' | 'md';
|
|
20
|
+
/** Applied to any item that does not set its own. */
|
|
21
|
+
variant?: TimelineVariant;
|
|
22
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
23
|
+
unstyled?: boolean;
|
|
24
|
+
class?: string;
|
|
25
|
+
/** Override classes per slot, e.g. `{ title: 'text-base' }`. */
|
|
26
|
+
ui?: {
|
|
27
|
+
root?: string;
|
|
28
|
+
item?: string;
|
|
29
|
+
rail?: string;
|
|
30
|
+
marker?: string;
|
|
31
|
+
line?: string;
|
|
32
|
+
content?: string;
|
|
33
|
+
header?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
time?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
declare var __VLS_1: {
|
|
40
|
+
item: TimelineItem;
|
|
41
|
+
index: number;
|
|
42
|
+
}, __VLS_8: {
|
|
43
|
+
item: TimelineItem;
|
|
44
|
+
index: number;
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Slots = {} & {
|
|
47
|
+
marker?: (props: typeof __VLS_1) => any;
|
|
48
|
+
} & {
|
|
49
|
+
item?: (props: typeof __VLS_8) => any;
|
|
50
|
+
};
|
|
51
|
+
declare const __VLS_base: import("vue").DefineComponent<TimelineProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TimelineProps> & Readonly<{}>, {
|
|
52
|
+
unstyled: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
55
|
+
declare const _default: typeof __VLS_export;
|
|
56
|
+
export default _default;
|
|
57
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { timelineTheme as n } from "../theme/timeline.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m } from "vue";
|
|
5
|
+
//#region src/components/Timeline.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var h = ["datetime"], g = /*@__PURE__*/ l({
|
|
7
|
+
__name: "Timeline",
|
|
8
|
+
props: {
|
|
9
|
+
items: {},
|
|
10
|
+
size: {},
|
|
11
|
+
variant: {},
|
|
12
|
+
unstyled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
16
|
+
class: {},
|
|
17
|
+
ui: {}
|
|
18
|
+
},
|
|
19
|
+
setup(l) {
|
|
20
|
+
let g = l, _ = i(() => g.items ?? []), v = e(), y = i(() => g.unstyled ?? v.unstyled);
|
|
21
|
+
function b(e, t) {
|
|
22
|
+
return n({
|
|
23
|
+
size: g.size,
|
|
24
|
+
variant: e.variant ?? g.variant,
|
|
25
|
+
withIcon: !!e.icon,
|
|
26
|
+
last: t === _.value.length - 1
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
let x = i(() => n({ size: g.size })), S = i(() => y.value ? [g.ui?.root, g.class] : x.value.root({ class: [g.ui?.root, g.class] }));
|
|
30
|
+
function C(e, t, n) {
|
|
31
|
+
let r = g.ui?.[n];
|
|
32
|
+
return y.value ? r : b(e, t)[n]({ class: r });
|
|
33
|
+
}
|
|
34
|
+
return (e, n) => (d(), s("ol", { class: u(S.value) }, [(d(!0), s(r, null, f(_.value, (n, r) => (d(), s("li", {
|
|
35
|
+
key: r,
|
|
36
|
+
class: u(y.value ? g.ui?.item : x.value.item({ class: g.ui?.item }))
|
|
37
|
+
}, [c("div", { class: u(y.value ? g.ui?.rail : x.value.rail({ class: g.ui?.rail })) }, [c("span", { class: u(C(n, r, "marker")) }, [p(e.$slots, "marker", {
|
|
38
|
+
item: n,
|
|
39
|
+
index: r
|
|
40
|
+
}, () => [n.icon ? (d(), a(t, {
|
|
41
|
+
key: 0,
|
|
42
|
+
icon: n.icon
|
|
43
|
+
}, null, 8, ["icon"])) : o("", !0)])], 2), r === _.value.length - 1 ? o("", !0) : (d(), s("span", {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: u(y.value ? g.ui?.line : x.value.line({ class: g.ui?.line }))
|
|
46
|
+
}, null, 2))], 2), c("div", { class: u(C(n, r, "content")) }, [p(e.$slots, "item", {
|
|
47
|
+
item: n,
|
|
48
|
+
index: r
|
|
49
|
+
}, () => [c("div", { class: u(C(n, r, "header")) }, [c("span", { class: u(C(n, r, "title")) }, m(n.title), 3), n.time ? (d(), s("time", {
|
|
50
|
+
key: 0,
|
|
51
|
+
datetime: n.datetime,
|
|
52
|
+
class: u(C(n, r, "time"))
|
|
53
|
+
}, m(n.time), 11, h)) : o("", !0)], 2), n.description ? (d(), s("p", {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: u(C(n, r, "description"))
|
|
56
|
+
}, m(n.description), 3)) : o("", !0)])], 2)], 2))), 128))], 2));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { g as default };
|
|
@@ -20,8 +20,8 @@ export interface ToasterProps {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
declare const __VLS_export: import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
23
|
-
closeLabel: string;
|
|
24
23
|
unstyled: boolean;
|
|
24
|
+
closeLabel: string;
|
|
25
25
|
duration: number;
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface ToggleProps {
|
|
2
|
+
/** Pressed or not. Two-way via `v-model`. */
|
|
3
|
+
modelValue?: boolean | null;
|
|
4
|
+
/** Starting state when you are not controlling it. */
|
|
5
|
+
defaultValue?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
/**
|
|
9
|
+
* Square the toggle for icon-only use, dropping the horizontal padding.
|
|
10
|
+
* An icon-only control has no text to name it, so pass an `aria-label`.
|
|
11
|
+
*
|
|
12
|
+
* For an icon *beside* a label, mark the icon with
|
|
13
|
+
* `data-icon="inline-start"` or `data-icon="inline-end"` instead — the
|
|
14
|
+
* padding then tightens on that side, exactly as it does on `IButton`.
|
|
15
|
+
*/
|
|
16
|
+
square?: boolean;
|
|
17
|
+
/** Stretch to the full width of the container. */
|
|
18
|
+
block?: boolean;
|
|
19
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
20
|
+
unstyled?: boolean;
|
|
21
|
+
class?: string;
|
|
22
|
+
}
|
|
23
|
+
declare var __VLS_10: {};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
default?: (props: typeof __VLS_10) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_base: import("vue").DefineComponent<ToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
"update:modelValue": (value: boolean) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<ToggleProps> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
unstyled: boolean;
|
|
33
|
+
modelValue: boolean | null;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import { toggleTheme as t } from "../theme/toggle.js";
|
|
3
|
+
import { computed as n, createBlock as r, defineComponent as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c, withCtx as l } from "vue";
|
|
4
|
+
import { Toggle as u } from "reka-ui";
|
|
5
|
+
//#region src/components/Toggle.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var d = /*@__PURE__*/ i({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "Toggle",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [Boolean, null],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
defaultValue: { type: Boolean },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
size: {},
|
|
17
|
+
square: { type: Boolean },
|
|
18
|
+
block: { type: Boolean },
|
|
19
|
+
unstyled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
class: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(i, { emit: d }) {
|
|
27
|
+
let f = i, p = d, m = e(), h = n(() => f.unstyled ?? m.unstyled), g = n(() => h.value ? f.class : t({
|
|
28
|
+
size: f.size,
|
|
29
|
+
square: f.square,
|
|
30
|
+
block: f.block,
|
|
31
|
+
class: f.class
|
|
32
|
+
}));
|
|
33
|
+
return (e, t) => (o(), r(c(u), a({
|
|
34
|
+
"model-value": f.modelValue,
|
|
35
|
+
"default-value": f.defaultValue,
|
|
36
|
+
disabled: f.disabled
|
|
37
|
+
}, e.$attrs, {
|
|
38
|
+
class: g.value,
|
|
39
|
+
"onUpdate:modelValue": t[0] ||= (e) => p("update:modelValue", e)
|
|
40
|
+
}), {
|
|
41
|
+
default: l(() => [s(e.$slots, "default")]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 16, [
|
|
44
|
+
"model-value",
|
|
45
|
+
"default-value",
|
|
46
|
+
"disabled",
|
|
47
|
+
"class"
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { d as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { IconLike } from '../composables/icon';
|
|
2
|
+
import type { ToggleGroupVariant } from '../theme/toggle';
|
|
3
|
+
export interface ToggleGroupItemOption {
|
|
4
|
+
label: string;
|
|
5
|
+
/** Identifies the item. Defaults to the label. */
|
|
6
|
+
value?: string;
|
|
7
|
+
icon?: IconLike;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Names the item when `iconOnly` hides its label. Without one, an icon-only
|
|
11
|
+
* item reaches a screen reader as an unnamed button.
|
|
12
|
+
*/
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ToggleGroupProps {
|
|
16
|
+
items?: (ToggleGroupItemOption | string)[];
|
|
17
|
+
/**
|
|
18
|
+
* `single` behaves like a segmented control — one item on at a time, and
|
|
19
|
+
* the model is that item's value. `multiple` lets any number be on, and the
|
|
20
|
+
* model is an array.
|
|
21
|
+
*/
|
|
22
|
+
type?: 'single' | 'multiple';
|
|
23
|
+
modelValue?: string | string[];
|
|
24
|
+
variant?: ToggleGroupVariant;
|
|
25
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
/** Hide the labels and square the items, leaving only the icons. */
|
|
28
|
+
iconOnly?: boolean;
|
|
29
|
+
/** Stretch to fill the container, splitting the width between items. */
|
|
30
|
+
block?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Wrap from the last item back to the first when arrowing past the end. */
|
|
33
|
+
loop?: boolean;
|
|
34
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
35
|
+
unstyled?: boolean;
|
|
36
|
+
class?: string;
|
|
37
|
+
/** Override classes per slot, e.g. `{ item: 'px-6' }`. */
|
|
38
|
+
ui?: {
|
|
39
|
+
root?: string;
|
|
40
|
+
item?: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
declare var __VLS_16: {
|
|
44
|
+
item: ToggleGroupItemOption;
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Slots = {} & {
|
|
47
|
+
item?: (props: typeof __VLS_16) => any;
|
|
48
|
+
};
|
|
49
|
+
declare const __VLS_base: import("vue").DefineComponent<ToggleGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
"update:modelValue": (value: string | string[]) => any;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<ToggleGroupProps> & Readonly<{
|
|
52
|
+
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
type: "single" | "multiple";
|
|
55
|
+
unstyled: boolean;
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
57
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
61
|
+
new (): {
|
|
62
|
+
$slots: S;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
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, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
5
|
+
import { ToggleGroupItem as _, ToggleGroupRoot as v } from "reka-ui";
|
|
6
|
+
//#region src/components/ToggleGroup.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { key: 1 }, b = /*@__PURE__*/ l({
|
|
8
|
+
__name: "ToggleGroup",
|
|
9
|
+
props: {
|
|
10
|
+
items: {},
|
|
11
|
+
type: { default: "single" },
|
|
12
|
+
modelValue: {},
|
|
13
|
+
variant: {},
|
|
14
|
+
size: {},
|
|
15
|
+
orientation: {},
|
|
16
|
+
iconOnly: { type: Boolean },
|
|
17
|
+
block: { type: Boolean },
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
loop: { type: Boolean },
|
|
20
|
+
unstyled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
class: {},
|
|
25
|
+
ui: {}
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:modelValue"],
|
|
28
|
+
setup(l, { emit: b }) {
|
|
29
|
+
let x = l, S = b, C = a(() => (x.items ?? []).map((e) => typeof e == "string" ? { label: e } : e)), w = (e) => e.value ?? e.label, T = e(), E = a(() => x.unstyled ?? T.unstyled), D = a(() => n({
|
|
30
|
+
variant: x.variant,
|
|
31
|
+
orientation: x.orientation,
|
|
32
|
+
block: x.block
|
|
33
|
+
})), O = a(() => E.value ? [x.ui?.root, x.class] : D.value.root({ class: [x.ui?.root, x.class] })), k = a(() => E.value ? x.ui?.item : r({
|
|
34
|
+
size: x.size,
|
|
35
|
+
square: x.iconOnly,
|
|
36
|
+
class: D.value.item({ class: x.ui?.item })
|
|
37
|
+
}));
|
|
38
|
+
return (e, n) => (d(), o(h(v), {
|
|
39
|
+
type: x.type,
|
|
40
|
+
"model-value": x.modelValue,
|
|
41
|
+
disabled: x.disabled,
|
|
42
|
+
orientation: x.orientation,
|
|
43
|
+
loop: x.loop,
|
|
44
|
+
class: u(O.value),
|
|
45
|
+
"onUpdate:modelValue": n[0] ||= (e) => S("update:modelValue", e)
|
|
46
|
+
}, {
|
|
47
|
+
default: g(() => [(d(!0), c(i, null, f(C.value, (n) => (d(), o(h(_), {
|
|
48
|
+
key: w(n),
|
|
49
|
+
value: w(n),
|
|
50
|
+
disabled: n.disabled,
|
|
51
|
+
"aria-label": n.ariaLabel ?? (x.iconOnly ? n.label : void 0),
|
|
52
|
+
class: u(k.value)
|
|
53
|
+
}, {
|
|
54
|
+
default: g(() => [p(e.$slots, "item", { item: n }, () => [n.icon ? (d(), o(t, {
|
|
55
|
+
key: 0,
|
|
56
|
+
icon: n.icon,
|
|
57
|
+
"data-icon": x.iconOnly ? void 0 : "inline-start"
|
|
58
|
+
}, null, 8, ["icon", "data-icon"])) : s("", !0), x.iconOnly ? s("", !0) : (d(), c("span", y, m(n.label), 1))])]),
|
|
59
|
+
_: 2
|
|
60
|
+
}, 1032, [
|
|
61
|
+
"value",
|
|
62
|
+
"disabled",
|
|
63
|
+
"aria-label",
|
|
64
|
+
"class"
|
|
65
|
+
]))), 128))]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 8, [
|
|
68
|
+
"type",
|
|
69
|
+
"model-value",
|
|
70
|
+
"disabled",
|
|
71
|
+
"orientation",
|
|
72
|
+
"loop",
|
|
73
|
+
"class"
|
|
74
|
+
]));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
export { b as default };
|