@indielayer/ui 1.4.0 → 1.5.1
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/docs/components/common/CodePreview.vue +1 -1
- package/docs/components/common/CodeSnippet.vue +5 -7
- package/docs/components/common/DocumentPage.vue +89 -93
- package/docs/components/menu/DocsMenu.vue +75 -122
- package/docs/components/toolbar/PreToolbar.vue +10 -12
- package/docs/components/toolbar/Toolbar.vue +21 -8
- package/docs/layouts/default.vue +7 -3
- package/docs/pages/colors.vue +49 -54
- package/docs/pages/component/button/button-group.vue +6 -2
- package/docs/pages/component/button/size.vue +1 -1
- package/docs/pages/component/carousel/usage.vue +2 -2
- package/docs/pages/component/form/usage.vue +3 -3
- package/docs/pages/component/formGroup/usage.vue +1 -0
- package/docs/pages/component/input/usage.vue +8 -9
- package/docs/pages/component/modal/composed.vue +10 -2
- package/docs/pages/component/modal/usage.vue +11 -6
- package/docs/pages/component/popover/usage.vue +3 -3
- package/docs/pages/component/select/usage.vue +1 -0
- package/docs/pages/component/tabs/usage.vue +6 -1
- package/docs/pages/component/textarea/usage.vue +10 -13
- package/docs/pages/component/toggle/usage.vue +9 -11
- package/docs/pages/component/tooltip/index.vue +2 -2
- package/docs/pages/component/tooltip/usage.vue +4 -8
- package/docs/pages/icons.vue +54 -58
- package/docs/pages/index.vue +73 -77
- package/docs/pages/play.vue +2 -14
- package/docs/pages/typography.vue +26 -30
- package/docs/router/index.ts +2 -0
- package/exports/tailwind.preset.js +0 -1
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +7 -7
- package/lib/components/badge/Badge.vue.js +7 -7
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +1 -1
- package/lib/components/button/Button.vue.js +2 -2
- package/lib/components/button/Button.vue2.js +26 -26
- package/lib/components/button/theme/Button.base.theme.js +7 -7
- package/lib/components/card/theme/Card.base.theme.js +1 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +3 -0
- package/lib/components/checkbox/Checkbox.vue2.js +23 -23
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +6 -6
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +2 -2
- package/lib/components/container/theme/Container.base.theme.js +2 -2
- package/lib/components/divider/Divider.vue.js +14 -14
- package/lib/components/divider/theme/Divider.base.theme.js +2 -2
- package/lib/components/drawer/Drawer.vue.js +2 -2
- package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
- package/lib/components/form/Form.vue.js +1 -1
- package/lib/components/form/theme/Form.base.theme.js +4 -4
- package/lib/components/form/theme/Form.carbon.theme.js +4 -4
- package/lib/components/formGroup/FormGroup.vue.d.ts +3 -0
- package/lib/components/formGroup/FormGroup.vue.js +16 -15
- package/lib/components/formGroup/theme/FormGroup.base.theme.js +1 -1
- package/lib/components/icon/theme/Icon.base.theme.js +1 -1
- package/lib/components/index.js +108 -107
- package/lib/components/input/Input.vue.d.ts +3 -0
- package/lib/components/input/Input.vue.js +4 -3
- package/lib/components/input/theme/Input.base.theme.js +10 -10
- package/lib/components/input/theme/Input.carbon.theme.js +10 -10
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -3
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +2 -2
- package/lib/components/label/Label.vue.d.ts +3 -0
- package/lib/components/label/Label.vue.js +26 -20
- package/lib/components/label/theme/Label.base.theme.js +1 -1
- package/lib/components/label/theme/Label.carbon.theme.js +3 -3
- package/lib/components/link/Link.vue.js +2 -2
- package/lib/components/link/Link.vue2.js +4 -4
- package/lib/components/loader/theme/Loader.base.theme.js +1 -1
- package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
- package/lib/components/menu/Menu.vue.js +19 -19
- package/lib/components/menu/theme/MenuItem.base.theme.js +21 -31
- package/lib/components/modal/Modal.vue.d.ts +4 -0
- package/lib/components/modal/Modal.vue.js +80 -74
- package/lib/components/modal/theme/Modal.base.theme.js +10 -10
- package/lib/components/modal/theme/Modal.carbon.theme.js +3 -3
- package/lib/components/notifications/Notifications.vue.js +1 -1
- package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +3 -3
- package/lib/components/pagination/Pagination.vue.js +27 -27
- package/lib/components/popover/Popover.vue.d.ts +13 -0
- package/lib/components/popover/Popover.vue.js +13 -8
- package/lib/components/popover/Popover.vue2.js +3 -2
- package/lib/components/popover/Popover.vue3.js +2 -3
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +4 -4
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +4 -4
- package/lib/components/progress/Progress.vue.js +11 -11
- package/lib/components/progress/theme/Progress.base.theme.js +10 -10
- package/lib/components/radio/Radio.vue.d.ts +3 -0
- package/lib/components/radio/theme/Radio.base.theme.js +28 -28
- package/lib/components/radio/theme/Radio.carbon.theme.js +8 -8
- package/lib/components/select/Select.vue.d.ts +16 -0
- package/lib/components/select/Select.vue.js +95 -92
- package/lib/components/select/theme/Select.base.theme.js +11 -11
- package/lib/components/select/theme/Select.carbon.theme.js +10 -10
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +1 -1
- package/lib/components/slider/Slider.vue.d.ts +3 -0
- package/lib/components/slider/Slider.vue.js +1 -1
- package/lib/components/slider/theme/Slider.carbon.theme.js +6 -6
- package/lib/components/stepper/Stepper.vue.js +14 -14
- package/lib/components/tab/Tab.vue.js +55 -54
- package/lib/components/tab/theme/TabGroup.base.theme.js +15 -15
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +8 -8
- package/lib/components/table/Table.vue.js +192 -194
- package/lib/components/table/theme/Table.base.theme.js +3 -3
- package/lib/components/table/theme/Table.carbon.theme.js +7 -7
- package/lib/components/table/theme/TableHead.base.theme.js +1 -1
- package/lib/components/table/theme/TableHead.carbon.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.carbon.theme.js +2 -2
- package/lib/components/table/theme/TableRow.base.theme.js +3 -3
- package/lib/components/table/theme/TableRow.carbon.theme.js +3 -3
- package/lib/components/tag/Tag.vue.js +4 -4
- package/lib/components/textarea/Textarea.vue.d.ts +7 -0
- package/lib/components/textarea/Textarea.vue.js +23 -21
- package/lib/components/textarea/theme/Textarea.base.theme.js +6 -6
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +6 -6
- package/lib/components/toggle/Toggle.vue.d.ts +3 -0
- package/lib/components/toggle/Toggle.vue.js +26 -26
- package/lib/components/toggle/theme/Toggle.base.theme.js +1 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +14 -0
- package/lib/components/tooltip/ToggleTip.vue.js +29 -0
- package/lib/components/tooltip/ToggleTip.vue2.js +4 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +22 -3
- package/lib/components/tooltip/Tooltip.vue.js +26 -17
- package/lib/components/tooltip/__tests__/ToggleTip.spec.d.ts +1 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/useColors.js +9 -9
- package/lib/composables/useInputtable.d.ts +1 -0
- package/lib/composables/useInputtable.js +20 -19
- package/lib/index.js +37 -35
- package/lib/index.umd.js +7 -3
- package/lib/tailwind.preset.js +0 -1
- package/lib/themes/base/index.js +3 -6
- package/lib/themes/base/styles.css.js +4 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +2 -2
- package/src/components/badge/Badge.vue +1 -1
- package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +1 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/button/theme/Button.base.theme.ts +2 -2
- package/src/components/card/theme/Card.base.theme.ts +1 -1
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +8 -8
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +2 -2
- package/src/components/container/theme/Container.base.theme.ts +2 -2
- package/src/components/divider/Divider.vue +1 -1
- package/src/components/divider/theme/Divider.base.theme.ts +2 -2
- package/src/components/drawer/Drawer.vue +2 -2
- package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
- package/src/components/form/Form.vue +1 -1
- package/src/components/form/theme/Form.base.theme.ts +1 -1
- package/src/components/form/theme/Form.carbon.theme.ts +1 -1
- package/src/components/formGroup/FormGroup.vue +1 -0
- package/src/components/formGroup/theme/FormGroup.base.theme.ts +1 -1
- package/src/components/icon/theme/Icon.base.theme.ts +2 -2
- package/src/components/input/Input.vue +2 -1
- package/src/components/input/theme/Input.base.theme.ts +5 -5
- package/src/components/input/theme/Input.carbon.theme.ts +6 -6
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +3 -3
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -2
- package/src/components/label/Label.vue +4 -1
- package/src/components/label/theme/Label.base.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +1 -1
- package/src/components/link/Link.vue +1 -1
- package/src/components/loader/theme/Loader.base.theme.ts +1 -1
- package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
- package/src/components/menu/Menu.vue +3 -3
- package/src/components/menu/theme/MenuItem.base.theme.ts +30 -34
- package/src/components/modal/Modal.vue +11 -4
- package/src/components/modal/theme/Modal.base.theme.ts +9 -6
- package/src/components/modal/theme/Modal.carbon.theme.ts +3 -3
- package/src/components/notifications/Notifications.vue +1 -1
- package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +1 -1
- package/src/components/pagination/Pagination.vue +3 -3
- package/src/components/popover/Popover.vue +77 -2
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +1 -1
- package/src/components/progress/Progress.vue +1 -1
- package/src/components/progress/theme/Progress.base.theme.ts +2 -2
- package/src/components/radio/theme/Radio.base.theme.ts +8 -8
- package/src/components/radio/theme/Radio.carbon.theme.ts +1 -1
- package/src/components/select/Select.vue +7 -4
- package/src/components/select/theme/Select.base.theme.ts +8 -8
- package/src/components/select/theme/Select.carbon.theme.ts +8 -8
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +1 -1
- package/src/components/slider/Slider.vue +1 -1
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/stepper/Stepper.vue +3 -3
- package/src/components/tab/Tab.vue +3 -3
- package/src/components/tab/theme/TabGroup.base.theme.ts +4 -4
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +3 -3
- package/src/components/table/Table.vue +2 -0
- package/src/components/table/theme/Table.base.theme.ts +1 -1
- package/src/components/table/theme/Table.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableHead.base.theme.ts +1 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableRow.base.theme.ts +3 -3
- package/src/components/table/theme/TableRow.carbon.theme.ts +3 -3
- package/src/components/tag/Tag.vue +1 -1
- package/src/components/textarea/Textarea.vue +3 -1
- package/src/components/textarea/theme/Textarea.base.theme.ts +5 -4
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +5 -5
- package/src/components/toggle/Toggle.vue +3 -3
- package/src/components/toggle/theme/Toggle.base.theme.ts +1 -1
- package/src/components/tooltip/ToggleTip.vue +31 -0
- package/src/components/tooltip/Tooltip.vue +14 -4
- package/src/components/tooltip/__tests__/ToggleTip.spec.ts +11 -0
- package/src/components/tooltip/index.ts +3 -0
- package/src/composables/useColors.ts +1 -1
- package/src/composables/useInputtable.ts +1 -0
- package/src/themes/base/index.ts +0 -3
- package/src/themes/base/styles.css +4 -0
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as C, resolveComponent as B, openBlock as d, createElementBlock as n, normalizeStyle as
|
|
1
|
+
import { defineComponent as C, resolveComponent as B, openBlock as d, createElementBlock as n, normalizeStyle as E, unref as p, normalizeClass as i, Fragment as a, renderList as w, createBlock as u, withCtx as b, createVNode as r, createCommentVNode as M } from "vue";
|
|
2
2
|
import { useCommon as m } from "../../composables/useCommon.js";
|
|
3
|
-
import { useColors as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import
|
|
3
|
+
import { useColors as N } from "../../composables/useColors.js";
|
|
4
|
+
import { useTheme as g } from "../../composables/useTheme.js";
|
|
5
|
+
import c from "./MenuItem.vue.js";
|
|
6
6
|
import A from "../accordion/AccordionItem.vue.js";
|
|
7
7
|
import S from "../divider/Divider.vue.js";
|
|
8
8
|
const V = {
|
|
9
9
|
...m.props(),
|
|
10
|
-
...
|
|
10
|
+
...N.props("secondary"),
|
|
11
11
|
items: Array,
|
|
12
12
|
collapsible: {
|
|
13
13
|
type: Boolean,
|
|
@@ -34,19 +34,19 @@ const V = {
|
|
|
34
34
|
props: V,
|
|
35
35
|
emits: ["expand", "item-click"],
|
|
36
36
|
setup(y) {
|
|
37
|
-
const z = y, { styles: k, classes: v, className: $ } =
|
|
37
|
+
const z = y, { styles: k, classes: v, className: $ } = g("Menu", {}, z);
|
|
38
38
|
return (e, o) => {
|
|
39
|
-
const
|
|
39
|
+
const f = B("x-menu");
|
|
40
40
|
return e.items ? (d(), n("div", {
|
|
41
41
|
key: 0,
|
|
42
|
-
style:
|
|
42
|
+
style: E(p(k)),
|
|
43
43
|
class: i([
|
|
44
44
|
"space-y-1",
|
|
45
45
|
p($),
|
|
46
46
|
p(v).wrapper
|
|
47
47
|
])
|
|
48
48
|
}, [
|
|
49
|
-
(d(!0), n(a, null,
|
|
49
|
+
(d(!0), n(a, null, w(e.items, (l, t) => (d(), n(a, { key: t }, [
|
|
50
50
|
l.items ? (d(), n(a, { key: 0 }, [
|
|
51
51
|
l.collapsible !== !1 ? (d(), u(A, {
|
|
52
52
|
key: 0,
|
|
@@ -57,8 +57,8 @@ const V = {
|
|
|
57
57
|
class: "x-menu-inner space-y-1",
|
|
58
58
|
onExpand: o[1] || (o[1] = (s) => e.$emit("expand"))
|
|
59
59
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
r(
|
|
60
|
+
default: b(({}) => [
|
|
61
|
+
r(c, {
|
|
62
62
|
item: l,
|
|
63
63
|
rounded: e.rounded,
|
|
64
64
|
color: l.color || e.color,
|
|
@@ -68,9 +68,9 @@ const V = {
|
|
|
68
68
|
class: "font-medium"
|
|
69
69
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled"])
|
|
70
70
|
]),
|
|
71
|
-
content:
|
|
72
|
-
r(
|
|
73
|
-
class: i(["border-l ml-4 border-
|
|
71
|
+
content: b(({ expand: s }) => [
|
|
72
|
+
r(f, {
|
|
73
|
+
class: i(["border-l ml-4 border-secondary-100 dark:border-secondary-700", { "pl-1": e.filled }]),
|
|
74
74
|
items: l.items,
|
|
75
75
|
color: l.color || e.color,
|
|
76
76
|
size: l.size || e.size,
|
|
@@ -86,7 +86,7 @@ const V = {
|
|
|
86
86
|
]),
|
|
87
87
|
_: 2
|
|
88
88
|
}, 1032, ["icon", "expanded", "disabled", "show-icon"])) : (d(), n(a, { key: 1 }, [
|
|
89
|
-
r(
|
|
89
|
+
r(c, {
|
|
90
90
|
item: l,
|
|
91
91
|
rounded: e.rounded,
|
|
92
92
|
color: l.color || e.color,
|
|
@@ -97,8 +97,8 @@ const V = {
|
|
|
97
97
|
inactive: "",
|
|
98
98
|
onClick: o[2] || (o[2] = (s) => e.$emit("item-click"))
|
|
99
99
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled"]),
|
|
100
|
-
r(
|
|
101
|
-
class: i(["x-menu-inner space-y-1 ml-4 border-l border-
|
|
100
|
+
r(f, {
|
|
101
|
+
class: i(["x-menu-inner space-y-1 ml-4 border-l border-secondary-100 dark:border-secondary-700", { "pl-1": e.filled }]),
|
|
102
102
|
items: l.items,
|
|
103
103
|
color: l.color || e.color,
|
|
104
104
|
size: l.size || e.size,
|
|
@@ -112,7 +112,7 @@ const V = {
|
|
|
112
112
|
}, null, 8, ["class", "items", "color", "size", "collapsible", "collapse-icon", "expanded", "disabled", "rounded", "filled"])
|
|
113
113
|
], 64))
|
|
114
114
|
], 64)) : (d(), n(a, { key: 1 }, [
|
|
115
|
-
l.divider ? (d(), u(S, { key: 0 })) : (d(), u(
|
|
115
|
+
l.divider ? (d(), u(S, { key: 0 })) : (d(), u(c, {
|
|
116
116
|
key: 1,
|
|
117
117
|
item: l,
|
|
118
118
|
rounded: e.rounded,
|
|
@@ -126,7 +126,7 @@ const V = {
|
|
|
126
126
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled", "class"]))
|
|
127
127
|
], 64))
|
|
128
128
|
], 64))), 128))
|
|
129
|
-
], 6)) :
|
|
129
|
+
], 6)) : M("", !0);
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -1,58 +1,48 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = {
|
|
2
2
|
classes: {
|
|
3
|
-
wrapper: ({ props:
|
|
4
|
-
const
|
|
5
|
-
return i.push(
|
|
6
|
-
"font-medium": a.isActive,
|
|
7
|
-
"cursor-pointer": !r.disabled,
|
|
8
|
-
// size
|
|
9
|
-
"py-1 text-xs": r.size === "xs",
|
|
10
|
-
"py-2 text-sm": r.size === "sm",
|
|
11
|
-
"py-1.5": !r.size || !["xs", "sm", "lg", "xl"].includes(r.size),
|
|
12
|
-
"py-3": r.size === "lg",
|
|
13
|
-
"py-4 text-lg": r.size === "xl",
|
|
14
|
-
rounded: r.rounded
|
|
15
|
-
}), i;
|
|
3
|
+
wrapper: ({ props: i, data: s }) => {
|
|
4
|
+
const r = ["relative !flex items-center whitespace-nowrap px-3"];
|
|
5
|
+
return i.disabled || r.push("cursor-pointer"), s.isActive && r.push("font-medium"), i.rounded && r.push("rounded"), i.size === "xs" ? r.push("py-1 text-xs") : i.size === "sm" ? r.push("py-1.5 text-sm") : i.size === "lg" ? r.push("py-3") : i.size === "xl" ? r.push("py-4 text-lg") : r.push("py-1.5"), r;
|
|
16
6
|
}
|
|
17
7
|
},
|
|
18
|
-
styles: ({ colors:
|
|
19
|
-
const e =
|
|
20
|
-
return
|
|
8
|
+
styles: ({ colors: i, props: s, css: r, data: a }) => {
|
|
9
|
+
const e = i.getPalette(s.color || "gray"), t = i.getPalette("secondary");
|
|
10
|
+
return s.disabled ? r.variables({
|
|
21
11
|
text: t[300],
|
|
22
12
|
dark: {
|
|
23
13
|
text: t[600]
|
|
24
14
|
}
|
|
25
|
-
}) :
|
|
26
|
-
bg:
|
|
27
|
-
text: e[
|
|
15
|
+
}) : s.filled ? a.isActive ? r.variables({
|
|
16
|
+
bg: s.selected ? e[100] : e[200],
|
|
17
|
+
text: e[800],
|
|
28
18
|
hover: {
|
|
29
|
-
bg:
|
|
30
|
-
text: e[
|
|
19
|
+
bg: (s.selected, e[200]),
|
|
20
|
+
text: e[800]
|
|
31
21
|
},
|
|
32
22
|
dark: {
|
|
33
|
-
bg: (
|
|
23
|
+
bg: (s.selected, e[700]),
|
|
34
24
|
text: e[100],
|
|
35
25
|
hover: {
|
|
36
|
-
bg: (
|
|
26
|
+
bg: (s.selected, e[700]),
|
|
37
27
|
text: e[100]
|
|
38
28
|
}
|
|
39
29
|
}
|
|
40
|
-
}) :
|
|
41
|
-
bg:
|
|
30
|
+
}) : r.variables({
|
|
31
|
+
bg: s.selected ? t[100] : "transparent",
|
|
42
32
|
text: t[800],
|
|
43
33
|
hover: {
|
|
44
|
-
bg: t[
|
|
34
|
+
bg: t[100],
|
|
45
35
|
text: t[900]
|
|
46
36
|
},
|
|
47
37
|
dark: {
|
|
48
|
-
bg:
|
|
38
|
+
bg: s.selected ? t[800] : "transparent",
|
|
49
39
|
text: t[200],
|
|
50
40
|
hover: {
|
|
51
41
|
bg: t[600],
|
|
52
42
|
text: t[100]
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
|
-
}) :
|
|
45
|
+
}) : a.isActive ? r.variables({
|
|
56
46
|
text: e[500],
|
|
57
47
|
hover: {
|
|
58
48
|
text: e[500],
|
|
@@ -65,7 +55,7 @@ const x = {
|
|
|
65
55
|
border: e[500]
|
|
66
56
|
}
|
|
67
57
|
}
|
|
68
|
-
}) :
|
|
58
|
+
}) : r.variables({
|
|
69
59
|
text: t[800],
|
|
70
60
|
hover: {
|
|
71
61
|
text: t[900],
|
|
@@ -80,7 +70,7 @@ const x = {
|
|
|
80
70
|
}
|
|
81
71
|
});
|
|
82
72
|
}
|
|
83
|
-
}, d =
|
|
73
|
+
}, d = l;
|
|
84
74
|
export {
|
|
85
75
|
d as default
|
|
86
76
|
};
|
|
@@ -36,6 +36,7 @@ declare const modalProps: {
|
|
|
36
36
|
type: PropType<[FormError[], FormError]>;
|
|
37
37
|
default: () => never[];
|
|
38
38
|
};
|
|
39
|
+
persistent: BooleanConstructor;
|
|
39
40
|
};
|
|
40
41
|
export type ModalSize = typeof modalSize[number];
|
|
41
42
|
export type ModalProps = ExtractPublicPropTypes<typeof modalProps>;
|
|
@@ -79,6 +80,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
79
80
|
type: PropType<[FormError[], FormError]>;
|
|
80
81
|
default: () => never[];
|
|
81
82
|
};
|
|
83
|
+
persistent: BooleanConstructor;
|
|
82
84
|
}, {
|
|
83
85
|
open: () => void;
|
|
84
86
|
close: () => void;
|
|
@@ -116,6 +118,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
116
118
|
type: PropType<[FormError[], FormError]>;
|
|
117
119
|
default: () => never[];
|
|
118
120
|
};
|
|
121
|
+
persistent: BooleanConstructor;
|
|
119
122
|
}>> & {
|
|
120
123
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
121
124
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -132,6 +135,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
132
135
|
formDisabled: boolean;
|
|
133
136
|
formAutoValidate: boolean;
|
|
134
137
|
formErrors: [FormError[], FormError];
|
|
138
|
+
persistent: boolean;
|
|
135
139
|
}, {}>, {
|
|
136
140
|
image?(_: {}): any;
|
|
137
141
|
header?(_: {}): any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { onClickOutside as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { closeIcon as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as f, watch as g, nextTick as B, useSlots as I, computed as M, openBlock as t, createBlock as p, Teleport as P, createElementBlock as i, normalizeStyle as W, unref as o, normalizeClass as s, createCommentVNode as a, createElementVNode as S, resolveDynamicComponent as K, withCtx as w, renderSlot as r, toDisplayString as v } from "vue";
|
|
2
|
+
import { onClickOutside as L, useEventListener as q } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useTheme as G } from "../../composables/useTheme.js";
|
|
4
|
+
import { useFocusTrap as J } from "../../composables/useFocusTrap.js";
|
|
5
|
+
import { closeIcon as Q } from "../../common/icons.js";
|
|
6
|
+
import U from "../button/Button.vue.js";
|
|
7
|
+
import Y from "../scroll/Scroll.vue.js";
|
|
8
|
+
import Z from "../form/Form.vue.js";
|
|
9
|
+
const _ = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-screen" }, x = { key: 0 }, ee = ["xs", "sm", "md", "lg", "xl", "full"], oe = {
|
|
10
10
|
size: {
|
|
11
11
|
type: String,
|
|
12
12
|
default: "xl"
|
|
@@ -40,61 +40,67 @@ const Y = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-s
|
|
|
40
40
|
formErrors: {
|
|
41
41
|
type: [Array, Object],
|
|
42
42
|
default: () => []
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
},
|
|
44
|
+
persistent: Boolean
|
|
45
|
+
}, te = {
|
|
45
46
|
name: "XModal",
|
|
46
47
|
validators: {
|
|
47
|
-
size:
|
|
48
|
+
size: ee
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
-
...
|
|
51
|
-
props:
|
|
50
|
+
}, ce = /* @__PURE__ */ H({
|
|
51
|
+
...te,
|
|
52
|
+
props: oe,
|
|
52
53
|
emits: ["update:modelValue", "submit"],
|
|
53
|
-
setup(V, { expose:
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
g(
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
setup(V, { expose: C, emit: T }) {
|
|
55
|
+
const n = V, b = T, u = f(n.modelValue), d = f(!1), y = f(null), $ = f(null), { initFocusTrap: D, clearFocusTrap: z } = J();
|
|
56
|
+
let c;
|
|
57
|
+
g(u, (e) => {
|
|
58
|
+
c && (c(), c = void 0), e && setTimeout(() => {
|
|
59
|
+
c = L(y, F, {
|
|
60
|
+
ignore: [".v-popper__popper"]
|
|
61
|
+
});
|
|
59
62
|
});
|
|
60
|
-
}), g(() =>
|
|
63
|
+
}), g(() => n.modelValue, E, { immediate: !0 });
|
|
61
64
|
async function E() {
|
|
62
|
-
const e =
|
|
63
|
-
e ? (
|
|
65
|
+
const e = n.modelValue;
|
|
66
|
+
e ? (u.value = e, await B(), d.value = e, await B(), D(y), document.body.style.overflow = "hidden") : (d.value = e, u.value = e, z(), document.body.style.overflow = "auto");
|
|
64
67
|
}
|
|
65
|
-
typeof window < "u" &&
|
|
68
|
+
typeof window < "u" && q(document, "keydown", A);
|
|
66
69
|
function A(e) {
|
|
67
|
-
e.key === "Escape" &&
|
|
70
|
+
e.key === "Escape" && u.value && !n.persistent && m();
|
|
68
71
|
}
|
|
69
|
-
function
|
|
70
|
-
n.
|
|
72
|
+
function F() {
|
|
73
|
+
n.persistent || m();
|
|
74
|
+
}
|
|
75
|
+
function m() {
|
|
76
|
+
d.value = !1, setTimeout(() => {
|
|
71
77
|
b("update:modelValue", !1);
|
|
72
78
|
}, 150);
|
|
73
79
|
}
|
|
74
|
-
function
|
|
75
|
-
b("update:modelValue", !0),
|
|
80
|
+
function O() {
|
|
81
|
+
b("update:modelValue", !0), d.value = !0;
|
|
76
82
|
}
|
|
77
|
-
const k =
|
|
78
|
-
visible:
|
|
83
|
+
const k = I(), R = M(() => !!(k["tertiary-action"] || k["cancel-action"])), { styles: N, classes: l, className: X } = G("Modal", {}, n, {
|
|
84
|
+
visible: d
|
|
79
85
|
});
|
|
80
|
-
return
|
|
81
|
-
|
|
86
|
+
return C({ open: O, close: m }), (e, h) => (t(), p(P, { to: "body" }, [
|
|
87
|
+
u.value ? (t(), i("div", {
|
|
82
88
|
key: 0,
|
|
83
89
|
ref_key: "modalWrapperRef",
|
|
84
|
-
ref:
|
|
85
|
-
style:
|
|
86
|
-
class:
|
|
87
|
-
o(
|
|
88
|
-
o(
|
|
89
|
-
|
|
90
|
+
ref: $,
|
|
91
|
+
style: W(o(N)),
|
|
92
|
+
class: s([
|
|
93
|
+
o(X),
|
|
94
|
+
o(l).wrapper,
|
|
95
|
+
d.value ? "visible" : "invisible ease-in duration-100"
|
|
90
96
|
])
|
|
91
97
|
}, [
|
|
92
|
-
e.backdrop ? (
|
|
98
|
+
e.backdrop ? (t(), i("div", {
|
|
93
99
|
key: 0,
|
|
94
|
-
class:
|
|
95
|
-
}, null, 2)) :
|
|
96
|
-
S("div",
|
|
97
|
-
(
|
|
100
|
+
class: s(o(l).backdrop)
|
|
101
|
+
}, null, 2)) : a("", !0),
|
|
102
|
+
S("div", _, [
|
|
103
|
+
(t(), p(K(e.isForm ? Z : "div"), {
|
|
98
104
|
ref_key: "modalRef",
|
|
99
105
|
ref: y,
|
|
100
106
|
disabled: e.formDisabled,
|
|
@@ -102,78 +108,78 @@ const Y = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-s
|
|
|
102
108
|
title: e.formTitle,
|
|
103
109
|
description: e.formDescription,
|
|
104
110
|
errors: e.formErrors,
|
|
105
|
-
class:
|
|
111
|
+
class: s(o(l).modal),
|
|
106
112
|
"auto-focus": "",
|
|
107
113
|
"has-footer": !1,
|
|
108
114
|
role: "dialog",
|
|
109
115
|
"aria-modal": "true",
|
|
110
116
|
"aria-labelledby": "modal-headline",
|
|
111
|
-
onSubmit: h[0] || (h[0] = (
|
|
117
|
+
onSubmit: h[0] || (h[0] = (j) => e.$emit("submit", j))
|
|
112
118
|
}, {
|
|
113
119
|
default: w(() => [
|
|
114
120
|
r(e.$slots, "image"),
|
|
115
|
-
e.hasHeader ? (
|
|
121
|
+
e.hasHeader ? (t(), i("div", {
|
|
116
122
|
key: 0,
|
|
117
|
-
class:
|
|
123
|
+
class: s(o(l).header)
|
|
118
124
|
}, [
|
|
119
125
|
r(e.$slots, "header", {}, () => [
|
|
120
|
-
e.label ? (
|
|
126
|
+
e.label ? (t(), i("div", {
|
|
121
127
|
key: 0,
|
|
122
|
-
class:
|
|
123
|
-
}, v(e.label), 3)) :
|
|
124
|
-
e.title ? (
|
|
128
|
+
class: s(o(l).label)
|
|
129
|
+
}, v(e.label), 3)) : a("", !0),
|
|
130
|
+
e.title ? (t(), i("div", {
|
|
125
131
|
key: 1,
|
|
126
|
-
class:
|
|
127
|
-
}, v(e.title), 3)) :
|
|
132
|
+
class: s(o(l).title)
|
|
133
|
+
}, v(e.title), 3)) : a("", !0)
|
|
128
134
|
])
|
|
129
|
-
], 2)) :
|
|
130
|
-
e.$slots.default ? (
|
|
135
|
+
], 2)) : a("", !0),
|
|
136
|
+
e.$slots.default ? (t(), p(Y, {
|
|
131
137
|
key: 1,
|
|
132
138
|
scrollbar: !1,
|
|
133
139
|
vertical: ""
|
|
134
140
|
}, {
|
|
135
141
|
default: w(() => [
|
|
136
142
|
S("div", {
|
|
137
|
-
class:
|
|
143
|
+
class: s(o(l).content)
|
|
138
144
|
}, [
|
|
139
|
-
e.description ? (
|
|
145
|
+
e.description ? (t(), i("div", {
|
|
140
146
|
key: 0,
|
|
141
|
-
class:
|
|
142
|
-
}, v(e.description), 3)) :
|
|
147
|
+
class: s(o(l).description)
|
|
148
|
+
}, v(e.description), 3)) : a("", !0),
|
|
143
149
|
r(e.$slots, "default")
|
|
144
150
|
], 2)
|
|
145
151
|
]),
|
|
146
152
|
_: 3
|
|
147
|
-
})) :
|
|
148
|
-
e.showClose ? (
|
|
153
|
+
})) : a("", !0),
|
|
154
|
+
e.showClose ? (t(), p(U, {
|
|
149
155
|
key: 2,
|
|
150
156
|
ghost: "",
|
|
151
|
-
size: "
|
|
157
|
+
size: "sm",
|
|
152
158
|
tabindex: "-1",
|
|
153
|
-
icon: o(
|
|
154
|
-
class:
|
|
155
|
-
onClick:
|
|
156
|
-
}, null, 8, ["icon", "class"])) :
|
|
157
|
-
e.hasActions ? (
|
|
159
|
+
icon: o(Q),
|
|
160
|
+
class: s(o(l).closeIcon),
|
|
161
|
+
onClick: m
|
|
162
|
+
}, null, 8, ["icon", "class"])) : a("", !0),
|
|
163
|
+
e.hasActions ? (t(), i("div", {
|
|
158
164
|
key: 3,
|
|
159
|
-
class:
|
|
165
|
+
class: s(o(l).actions)
|
|
160
166
|
}, [
|
|
161
167
|
r(e.$slots, "actions", {}, () => [
|
|
162
168
|
r(e.$slots, "cancel-action"),
|
|
163
|
-
R.value ? (
|
|
169
|
+
R.value ? (t(), i("div", x)) : a("", !0),
|
|
164
170
|
r(e.$slots, "tertiary-action"),
|
|
165
171
|
r(e.$slots, "secondary-action"),
|
|
166
172
|
r(e.$slots, "primary-action")
|
|
167
173
|
])
|
|
168
|
-
], 2)) :
|
|
174
|
+
], 2)) : a("", !0)
|
|
169
175
|
]),
|
|
170
176
|
_: 3
|
|
171
177
|
}, 40, ["disabled", "auto-validate", "title", "description", "errors", "class"]))
|
|
172
178
|
])
|
|
173
|
-
], 6)) :
|
|
179
|
+
], 6)) : a("", !0)
|
|
174
180
|
]));
|
|
175
181
|
}
|
|
176
182
|
});
|
|
177
183
|
export {
|
|
178
|
-
|
|
184
|
+
ce as default
|
|
179
185
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
const a = {
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "fixed z-40 inset-0 overflow-y-auto transition-all",
|
|
4
|
-
backdrop: ({ data:
|
|
5
|
-
const t = ["fixed inset-0 bg-
|
|
6
|
-
return
|
|
4
|
+
backdrop: ({ data: e }) => {
|
|
5
|
+
const t = ["fixed inset-0 bg-secondary-500 dark:bg-black transition-opacity"];
|
|
6
|
+
return e.visible ? t.push("ease-out duration-200 opacity-30 dark:opacity-70") : t.push("ease-in duration-100 opacity-0"), t;
|
|
7
7
|
},
|
|
8
|
-
modal: ({ props:
|
|
9
|
-
const
|
|
10
|
-
return t.visible ?
|
|
8
|
+
modal: ({ props: e, data: t }) => {
|
|
9
|
+
const s = ["relative flex flex-col z-10 bg-white dark:bg-secondary-900 rounded-md shadow-lg transform transition-all overflow-hidden max-h-full w-full"];
|
|
10
|
+
return t.visible ? s.push("ease-out duration-200 opacity-100 translate-y-0 sm:scale-100") : s.push("ease-in duration-200 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"), e.size === "xs" ? s.push("sm:max-w-xs") : e.size === "sm" ? s.push("sm:max-w-sm") : e.size === "lg" ? s.push("sm:max-w-xl") : e.size === "xl" ? s.push("sm:max-w-3xl") : s.push("sm:max-w-lg"), s;
|
|
11
11
|
},
|
|
12
12
|
closeIcon: "!absolute top-2 z-10 right-2",
|
|
13
13
|
header: "text-lg pl-6 py-4 border-b pr-12",
|
|
14
14
|
content: "px-6 py-4",
|
|
15
|
-
actions: "bg-
|
|
16
|
-
label: "text-xs text-
|
|
17
|
-
title: "text-xl font-semibold
|
|
18
|
-
description: "text-sm"
|
|
15
|
+
actions: ({ props: e, slots: t }) => ["flex gap-4 bg-secondary-50 dark:bg-secondary-800 p-4 justify-end"],
|
|
16
|
+
label: "text-xs text-secondary-500 mb-1",
|
|
17
|
+
title: "text-xl font-semibold",
|
|
18
|
+
description: "text-sm mb-8"
|
|
19
19
|
}
|
|
20
20
|
}, l = a;
|
|
21
21
|
export {
|
|
@@ -2,11 +2,11 @@ const a = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "fixed z-40 inset-0 overflow-y-auto transition-all",
|
|
4
4
|
backdrop: ({ data: t }) => {
|
|
5
|
-
const e = ["fixed inset-0 bg-
|
|
5
|
+
const e = ["fixed inset-0 bg-secondary-500 dark:bg-black transition-opacity"];
|
|
6
6
|
return t.visible ? e.push("ease-out duration-200 opacity-70 dark:opacity-70") : e.push("ease-in duration-100 opacity-0"), e;
|
|
7
7
|
},
|
|
8
8
|
modal: ({ props: t, data: e }) => {
|
|
9
|
-
const s = ["relative flex flex-col z-10 bg-
|
|
9
|
+
const s = ["relative flex flex-col z-10 bg-secondary-200 dark:bg-secondary-900 shadow-lg transform transition-all overflow-hidden max-h-full w-full"];
|
|
10
10
|
return e.visible ? s.push("ease-out duration-200 opacity-100 translate-y-0 sm:scale-100") : s.push("ease-in duration-200 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"), t.size === "xs" ? s.push("sm:max-w-xs") : t.size === "sm" ? s.push("sm:max-w-sm") : t.size === "lg" ? s.push("sm:max-w-xl") : t.size === "xl" ? s.push("sm:max-w-3xl") : s.push("sm:max-w-lg"), s;
|
|
11
11
|
},
|
|
12
12
|
closeIcon: "!absolute top-0 z-10 right-0",
|
|
@@ -19,7 +19,7 @@ const a = {
|
|
|
19
19
|
const s = ["grid grid-flow-col gap-[1px]"];
|
|
20
20
|
return e["tertiary-action"] || e["cancel-action"] ? s.push("grid-cols-4") : s.push("grid-cols-2"), s;
|
|
21
21
|
},
|
|
22
|
-
label: "text-xs text-
|
|
22
|
+
label: "text-xs text-secondary-500 mb-1",
|
|
23
23
|
title: "text-xl mb-4",
|
|
24
24
|
description: "text-sm mb-4"
|
|
25
25
|
}
|
|
@@ -217,7 +217,7 @@ const se = { class: "flex items-center flex-wrap" }, re = {
|
|
|
217
217
|
e.removable ? (a(), k(E, {
|
|
218
218
|
key: 2,
|
|
219
219
|
icon: l(oe),
|
|
220
|
-
class: "text-
|
|
220
|
+
class: "text-secondary-400 hover:text-secondary-500 ml-3 cursor-pointer",
|
|
221
221
|
onClick: () => {
|
|
222
222
|
y(e);
|
|
223
223
|
}
|
|
@@ -2,7 +2,7 @@ const e = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "fixed z-50 w-full sm:w-auto overflow-y-auto max-h-screen",
|
|
4
4
|
list: "flex flex-col items-end w-full sm:w-[520px] px-4",
|
|
5
|
-
item: "w-full flex items-center rounded-md px-4 py-3 bg-
|
|
5
|
+
item: "w-full flex items-center rounded-md px-4 py-3 bg-secondary-800 dark:bg-secondary-50 text-white dark:text-secondary-900 border border-secondary-700 dark:border-secondary-100"
|
|
6
6
|
}
|
|
7
7
|
}, r = e;
|
|
8
8
|
export {
|
|
@@ -2,9 +2,9 @@ const e = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "fixed z-50 w-full sm:w-auto overflow-y-auto max-h-screen",
|
|
4
4
|
list: "flex flex-col items-end w-full sm:w-[520px] px-4",
|
|
5
|
-
item: () => ["w-full flex items-center px-4 py-3 bg-
|
|
5
|
+
item: () => ["w-full flex items-center px-4 py-3 bg-secondary-800 dark:bg-secondary-50 text-white dark:text-secondary-900 border-l-2 border-[color:var(--x-notification-icon)]"]
|
|
6
6
|
}
|
|
7
|
-
},
|
|
7
|
+
}, t = e;
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
t as default
|
|
10
10
|
};
|