@nxgt/material-vue 0.26.1 → 0.27.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/CHANGELOG.md +175 -0
- package/README.md +8 -5
- package/dist/Button-DEUkxkrJ.js +728 -0
- package/dist/{DropdownMenuTrigger-BHAhXGUO.js → DropdownMenuTrigger-BsuyNVzV.js} +48 -41
- package/dist/HoverCardTrigger-TDll55LP.js +510 -0
- package/dist/{camera-DvKuqT4L.js → camera-UJXnnFeb.js} +4 -4
- package/dist/components/base-content.css +139 -0
- package/dist/components/base.css +150 -0
- package/dist/components/components.css +2 -0
- package/dist/components/reduced-motion.css +56 -0
- package/dist/components/theme-tokens.css +116 -0
- package/dist/components/ui/actions/button-group/button-group.css +1 -1
- package/dist/components/ui/feedback/toast/toast.css +21 -0
- package/dist/components/ui/primitives/label/label.css +33 -0
- package/dist/{components-CCWod7cJ.js → components-BZ1XAK37.js} +19198 -18568
- package/dist/components.js +7 -7
- package/dist/composables.js +3 -3
- package/dist/dnd.js +1 -1
- package/dist/field-name-attribute-Bl7LSVK0.js +4 -0
- package/dist/{form-scope-x-7TYn2s.js → form-scope-BFGca0h6.js} +1 -1
- package/dist/{i18n-provider-CaaZCmaR.js → i18n-provider-DBusa725.js} +1 -1
- package/dist/i18n.js +4 -4
- package/dist/icon-button-jHB4MhQ5.js +262 -0
- package/dist/lib/components/ui/actions/button/Button.vue.d.ts +22 -4
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +36 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/button/button.wrap.d.ts +8 -0
- package/dist/lib/components/ui/actions/button/label-text.d.ts +9 -0
- package/dist/lib/components/ui/actions/button/prepend-to-child.d.ts +18 -0
- package/dist/lib/components/ui/actions/button/use-click-lock.d.ts +14 -0
- package/dist/lib/components/ui/actions/copy-button/copy-button.vue.d.ts +6 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button.compound-variants.d.ts +28 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.vue.d.ts +1 -1
- package/dist/lib/components/ui/actions/responsive-button/responsive-button.vue.d.ts +1 -3
- package/dist/lib/components/ui/collections/data-table/partials/data-table-empty.vue.d.ts +5 -1
- package/dist/lib/components/ui/collections/data-table/partials/data-table-scroll-region.vue.d.ts +28 -0
- package/dist/lib/components/ui/collections/data-table/partials/data-table-toolbar.d.ts +60 -0
- package/dist/lib/components/ui/collections/data-table/types.d.ts +9 -0
- package/dist/lib/components/ui/collections/data-table/use-scroll-edges.d.ts +22 -0
- package/dist/lib/components/ui/collections/pagination/PaginationFirst.vue.d.ts +1 -1
- package/dist/lib/components/ui/collections/pagination/PaginationItem.vue.d.ts +1 -1
- package/dist/lib/components/ui/collections/pagination/PaginationLast.vue.d.ts +1 -1
- package/dist/lib/components/ui/collections/pagination/PaginationNext.vue.d.ts +1 -1
- package/dist/lib/components/ui/collections/pagination/PaginationPrevious.vue.d.ts +1 -1
- package/dist/lib/components/ui/dates/calendar/Calendar.vue.d.ts +4 -4
- package/dist/lib/components/ui/dates/calendar/calendar-day-label.d.ts +17 -0
- package/dist/lib/components/ui/dates/calendar/calendar-years.d.ts +11 -0
- package/dist/lib/components/ui/dates/calendar/partials/calendar-month-select.vue.d.ts +18 -0
- package/dist/lib/components/ui/dates/calendar/partials/calendar-year-select.vue.d.ts +19 -0
- package/dist/lib/components/ui/dates/calendar/use-calendar-locale.d.ts +7 -0
- package/dist/lib/components/ui/dates/calendar/use-calendar-selected-hint.d.ts +17 -0
- package/dist/lib/components/ui/dates/date-range-field/partials/date-range-day.vue.d.ts +8 -0
- package/dist/lib/components/ui/display/cards/cards.gallery.d.ts +3 -3
- package/dist/lib/components/ui/display/list-tile/list-tile.vue.d.ts +10 -6
- package/dist/lib/components/ui/feedback/alert-dialog/AlertDialogContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/feedback/sonner/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/toast/toast.d.ts +7 -0
- package/dist/lib/components/ui/feedback/toast/toast.vue.d.ts +18 -2
- package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
- package/dist/lib/components/ui/forms/use-field-blur.d.ts +3 -0
- package/dist/lib/components/ui/layout/app-shell/activity-content.vue.d.ts +9 -3
- package/dist/lib/components/ui/layout/app-shell/activity-layout.vue.d.ts +21 -4
- package/dist/lib/components/ui/layout/app-shell/app-header.vue.d.ts +7 -5
- package/dist/lib/components/ui/layout/app-shell/app-sidebar.vue.d.ts +4 -1
- package/dist/lib/components/ui/layout/app-shell/index.d.ts +2 -2
- package/dist/lib/components/ui/layout/app-shell/router-menu-link.d.ts +7 -0
- package/dist/lib/components/ui/layout/app-shell/types.d.ts +8 -0
- package/dist/lib/components/ui/layout/app-shell/use-content-scroll.d.ts +13 -0
- package/dist/lib/components/ui/layout/app-shell/use-navigation-sheet.d.ts +17 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-context.d.ts +15 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-item.vue.d.ts +13 -4
- package/dist/lib/components/ui/media/carousel/carousel-next.vue.d.ts +1 -1
- package/dist/lib/components/ui/media/carousel/carousel-previous.vue.d.ts +1 -1
- package/dist/lib/components/ui/menu-item-variant.d.ts +4 -4
- package/dist/lib/components/ui/overlays/context-menu/ContextMenuContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/dialog/DialogContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/dialog/DialogScrollContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/dialog/use-escape-forward.d.ts +17 -0
- package/dist/lib/components/ui/overlays/dialog/use-inert-others.d.ts +17 -0
- package/dist/lib/components/ui/overlays/dialog/use-modal-content.d.ts +32 -0
- package/dist/lib/components/ui/overlays/drawer/DrawerContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/dropdown-menu/DropdownMenu.vue.d.ts +3 -1
- package/dist/lib/components/ui/overlays/dropdown-menu/DropdownMenuContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/overlays/sheet/SheetContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/primitives/card/CardTitle.vue.d.ts +11 -4
- package/dist/lib/components/ui/primitives/card/index.d.ts +1 -0
- package/dist/lib/components/ui/primitives/toggle/Toggle.vue.d.ts +1 -1
- package/dist/lib/components/ui/primitives/toggle/index.d.ts +1 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-box.vue.d.ts +2 -0
- package/dist/lib/components/ui/selection/select/SelectContent.vue.d.ts +2 -2
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-field.vue.d.ts +1 -0
- package/dist/lib/i18n/resources/en/en.d.ts +9 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +13 -4
- package/dist/lib/i18n/resources/fr/fr.d.ts +9 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +13 -4
- package/dist/lib/i18n/resources/resources.d.ts +18 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/lib/field-name-attribute.d.ts +7 -0
- package/dist/lib/lib/focus-field.d.ts +17 -0
- package/dist/lib/lib/index.d.ts +1 -0
- package/dist/lib.js +76 -74
- package/dist/main.js +13 -13
- package/dist/map.js +4 -4
- package/dist/material-vue.css +1 -1
- package/dist/{pdf-outline-sidebar-D3vq2qfS.js → pdf-outline-sidebar-ChjAXoUX.js} +2 -2
- package/dist/{pdf-page-BrJbyjQj.js → pdf-page-D4OTPcpF.js} +1 -1
- package/dist/{pdf-page-list-BCgYEszV.js → pdf-page-list-CFgKYLur.js} +2 -2
- package/dist/{pdf-reader-BAzevSJU.js → pdf-reader-B1hw81cG.js} +9 -9
- package/dist/{pdf-sidebar-DSh2Mend.js → pdf-sidebar-Do5HzrDq.js} +3 -3
- package/dist/{pdf-thumbnail-sidebar-D_EMcbKF.js → pdf-thumbnail-sidebar-CMge0C9-.js} +3 -3
- package/dist/{pdf-toolbar-BcL7HlfS.js → pdf-toolbar-BBio9baU.js} +5 -5
- package/dist/pdf.js +2 -2
- package/dist/{sortable-provider-DMpmM7Ke.js → sortable-provider-DMVbbmUU.js} +2 -2
- package/dist/{stored-language-Bxhsx4iB.js → stored-language-AJpwOMsA.js} +26 -8
- package/dist/{stx-player-MldK_ZAZ.js → stx-player-gtyStl7e.js} +2 -2
- package/dist/styles.css +10 -368
- package/dist/{translator-CLI_7Crg.js → translator-D2_swsMz.js} +1 -1
- package/dist/{use-heading-spy-VPuFj2Gt.js → use-heading-spy-BbEbAfPK.js} +19 -19
- package/dist/use-inert-others-CtGqZKR8.js +22 -0
- package/dist/{use-material-translation-CONqD9wJ.js → use-material-translation-BHtgyMz3.js} +3 -3
- package/docs/components/buttons-and-actions.md +71 -16
- package/docs/components/data-display.md +12 -1
- package/docs/components/data-table-filter-and-lists.md +85 -5
- package/docs/components/date-and-time.md +25 -1
- package/docs/components/feedback-and-status.md +86 -11
- package/docs/components/form-fields.md +13 -4
- package/docs/components/media-and-files.md +7 -0
- package/docs/components/navigation-and-layout.md +19 -1
- package/docs/components/overlays-and-menus.md +20 -4
- package/docs/components/primitives.md +16 -2
- package/docs/components/selection-and-choice.md +12 -1
- package/docs/getting-started.md +2 -2
- package/docs/guides/app-shell.md +102 -6
- package/docs/guides/forms.md +58 -5
- package/docs/guides/helpers.md +2 -1
- package/docs/guides/i18n.md +5 -2
- package/docs/guides/ssr.md +1 -1
- package/docs/guides/theming.md +134 -6
- package/docs/previews/data-display-description.webp +0 -0
- package/docs/previews/feedback-status-toast.webp +0 -0
- package/docs/roadmap.md +21 -0
- package/docs/troubleshooting.md +854 -12
- package/lib/components/base-content.css +139 -0
- package/lib/components/base.css +150 -0
- package/lib/components/components.css +2 -0
- package/lib/components/reduced-motion.css +56 -0
- package/lib/components/theme-tokens.css +116 -0
- package/lib/components/ui/actions/button-group/button-group.css +1 -1
- package/lib/components/ui/feedback/toast/toast.css +21 -0
- package/lib/components/ui/primitives/label/label.css +33 -0
- package/lib/styles.css +10 -368
- package/package.json +2 -2
- package/dist/Button-16J7vTpE.js +0 -665
- package/dist/HoverCardTrigger-C41002JS.js +0 -455
- package/dist/icon-button-CDdNsZuZ.js +0 -227
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { t as e } from "./utils-CykWQ0iJ.js";
|
|
2
|
+
import { t } from "./use-material-translation-BHtgyMz3.js";
|
|
3
|
+
import { Comment as n, Fragment as r, Text as i, computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, inject as ee, isVNode as m, mergeProps as h, normalizeClass as g, normalizeProps as _, onBeforeUnmount as v, openBlock as y, provide as b, ref as x, renderSlot as S, shallowRef as C, unref as w, useAttrs as te, useSlots as ne, watch as T, withCtx as E } from "vue";
|
|
4
|
+
import { Primitive as D, TooltipArrow as O, TooltipContent as k, TooltipPortal as A, TooltipProvider as re, TooltipRoot as j, TooltipTrigger as M, useForwardPropsEmits as N } from "reka-ui";
|
|
5
|
+
import { cva as P } from "class-variance-authority";
|
|
6
|
+
import { createSharedComposable as F, defaultDocument as I, reactiveOmit as ie, useEventListener as ae } from "@vueuse/core";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region lib/components/ui/feedback/spinner/spinner.variants.ts
|
|
9
|
+
var L = P("transition-all duration-500", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
1: "",
|
|
13
|
+
2: "",
|
|
14
|
+
3: "",
|
|
15
|
+
4: ""
|
|
16
|
+
},
|
|
17
|
+
color: {
|
|
18
|
+
primary: null,
|
|
19
|
+
secondary: null,
|
|
20
|
+
info: null,
|
|
21
|
+
warning: null,
|
|
22
|
+
default: null,
|
|
23
|
+
error: null,
|
|
24
|
+
success: null,
|
|
25
|
+
light: null
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "1",
|
|
30
|
+
color: "primary"
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
variant: "1",
|
|
35
|
+
color: "primary",
|
|
36
|
+
class: "border-primary/10 border-t-primary"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
variant: "1",
|
|
40
|
+
color: "secondary",
|
|
41
|
+
class: "border-secondary/10 border-t-secondary"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
variant: "1",
|
|
45
|
+
color: "success",
|
|
46
|
+
class: "border-success/10 border-t-success"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: "1",
|
|
50
|
+
color: "info",
|
|
51
|
+
class: "border-info/10 border-t-info"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
variant: "1",
|
|
55
|
+
color: "warning",
|
|
56
|
+
class: "border-warning/10 border-t-warning"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
variant: "1",
|
|
60
|
+
color: "error",
|
|
61
|
+
class: "border-error/10 border-t-error"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
variant: "1",
|
|
65
|
+
color: "default",
|
|
66
|
+
class: "border-foreground/10 border-t-foreground"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
variant: "1",
|
|
70
|
+
color: "light",
|
|
71
|
+
class: "border-white/10 border-t-white"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
variant: "2",
|
|
75
|
+
color: "primary",
|
|
76
|
+
class: "border-primary/10 border-b-primary border-t-primary"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
variant: "2",
|
|
80
|
+
color: "secondary",
|
|
81
|
+
class: "border-secondary/10 border-b-secondary border-t-secondary"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
variant: "2",
|
|
85
|
+
color: "success",
|
|
86
|
+
class: "border-success/10 border-b-success border-t-success"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
variant: "2",
|
|
90
|
+
color: "info",
|
|
91
|
+
class: "border-info/10 border-b-info border-t-info"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
variant: "2",
|
|
95
|
+
color: "warning",
|
|
96
|
+
class: "border-warning/10 border-b-warning border-t-warning"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
variant: "2",
|
|
100
|
+
color: "error",
|
|
101
|
+
class: "border-error/10 border-b-error border-t-error"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
variant: "2",
|
|
105
|
+
color: "default",
|
|
106
|
+
class: "border-foreground/10 border-b-foreground border-t-foreground"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
variant: "2",
|
|
110
|
+
color: "light",
|
|
111
|
+
class: "border-white/10 border-b-white border-t-white"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
variant: "3",
|
|
115
|
+
color: "primary",
|
|
116
|
+
class: "border-primary/10 border-b-primary border-t-primary border-r-primary"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
variant: "3",
|
|
120
|
+
color: "secondary",
|
|
121
|
+
class: "border-secondary/10 border-b-secondary border-t-secondary border-r-secondary"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
variant: "3",
|
|
125
|
+
color: "success",
|
|
126
|
+
class: "border-success/10 border-b-success border-t-success border-r-success"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
variant: "3",
|
|
130
|
+
color: "info",
|
|
131
|
+
class: "border-info/10 border-b-info border-t-info border-r-info"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
variant: "3",
|
|
135
|
+
color: "warning",
|
|
136
|
+
class: "border-warning/10 border-b-warning border-t-warning border-r-warning"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
variant: "3",
|
|
140
|
+
color: "error",
|
|
141
|
+
class: "border-error/10 border-b-error border-t-error border-r-error"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
variant: "3",
|
|
145
|
+
color: "default",
|
|
146
|
+
class: "border-foreground/10 border-b-foreground border-t-foreground border-r-foreground"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
variant: "3",
|
|
150
|
+
color: "light",
|
|
151
|
+
class: "border-white/10 border-b-white border-t-white border-r-white"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
variant: "4",
|
|
155
|
+
color: "primary",
|
|
156
|
+
class: "stroke-primary"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
variant: "4",
|
|
160
|
+
color: "secondary",
|
|
161
|
+
class: "stroke-secondary"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: "4",
|
|
165
|
+
color: "success",
|
|
166
|
+
class: "stroke-success"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
variant: "4",
|
|
170
|
+
color: "info",
|
|
171
|
+
class: "stroke-info"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
variant: "4",
|
|
175
|
+
color: "warning",
|
|
176
|
+
class: "stroke-warning"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
variant: "4",
|
|
180
|
+
color: "error",
|
|
181
|
+
class: "stroke-error"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
variant: "4",
|
|
185
|
+
color: "default",
|
|
186
|
+
class: "stroke-foreground"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
variant: "4",
|
|
190
|
+
color: "light",
|
|
191
|
+
class: "stroke-white"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}), oe = [
|
|
195
|
+
"data-variant",
|
|
196
|
+
"data-color",
|
|
197
|
+
"aria-label"
|
|
198
|
+
], se = ["data-variant", "data-color"], R = /* @__PURE__ */ d({
|
|
199
|
+
__name: "spinner",
|
|
200
|
+
props: {
|
|
201
|
+
variant: { default: "1" },
|
|
202
|
+
color: { default: "primary" },
|
|
203
|
+
class: { type: [
|
|
204
|
+
Boolean,
|
|
205
|
+
null,
|
|
206
|
+
String,
|
|
207
|
+
Object,
|
|
208
|
+
Array
|
|
209
|
+
] }
|
|
210
|
+
},
|
|
211
|
+
setup(n) {
|
|
212
|
+
let r = n, { t: i } = t();
|
|
213
|
+
return (t, a) => n.variant === "4" ? (y(), s("svg", {
|
|
214
|
+
key: 0,
|
|
215
|
+
viewBox: "0 0 800 800",
|
|
216
|
+
"data-slot": "spinner",
|
|
217
|
+
"data-variant": n.variant,
|
|
218
|
+
"data-color": n.color,
|
|
219
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
220
|
+
role: "img",
|
|
221
|
+
"aria-label": w(i)("material.spinner.loading", "Loading..."),
|
|
222
|
+
class: g(w(e)("size-14", r.class))
|
|
223
|
+
}, [c("circle", {
|
|
224
|
+
class: g(["spin2", w(L)({
|
|
225
|
+
variant: n.variant,
|
|
226
|
+
color: n.color
|
|
227
|
+
})]),
|
|
228
|
+
cx: "400",
|
|
229
|
+
cy: "400",
|
|
230
|
+
fill: "none",
|
|
231
|
+
r: "200",
|
|
232
|
+
"stroke-width": "50",
|
|
233
|
+
"stroke-dasharray": "700 1400",
|
|
234
|
+
"stroke-linecap": "round"
|
|
235
|
+
}, null, 2)], 10, oe)) : (y(), s("div", {
|
|
236
|
+
key: 1,
|
|
237
|
+
"data-slot": "spinner",
|
|
238
|
+
"data-variant": n.variant,
|
|
239
|
+
"data-color": n.color,
|
|
240
|
+
class: g(w(e)("size-12 border-[2px] rounded-full animate-spin", w(L)({
|
|
241
|
+
variant: n.variant,
|
|
242
|
+
color: n.color
|
|
243
|
+
}), r.class))
|
|
244
|
+
}, null, 10, se));
|
|
245
|
+
}
|
|
246
|
+
}), z = /* @__PURE__ */ d({
|
|
247
|
+
__name: "Tooltip",
|
|
248
|
+
props: {
|
|
249
|
+
defaultOpen: { type: Boolean },
|
|
250
|
+
open: { type: Boolean },
|
|
251
|
+
delayDuration: {},
|
|
252
|
+
disableHoverableContent: { type: Boolean },
|
|
253
|
+
disableClosingTrigger: { type: Boolean },
|
|
254
|
+
disabled: { type: Boolean },
|
|
255
|
+
ignoreNonKeyboardFocus: { type: Boolean }
|
|
256
|
+
},
|
|
257
|
+
emits: ["update:open"],
|
|
258
|
+
setup(e, { emit: t }) {
|
|
259
|
+
let n = N(e, t);
|
|
260
|
+
return (e, t) => (y(), o(w(j), h({ "data-slot": "tooltip" }, w(n)), {
|
|
261
|
+
default: E((t) => [S(e.$slots, "default", _(f(t)))]),
|
|
262
|
+
_: 3
|
|
263
|
+
}, 16));
|
|
264
|
+
}
|
|
265
|
+
}), B = /* @__PURE__ */ new Set([
|
|
266
|
+
"VIDEO",
|
|
267
|
+
"IFRAME",
|
|
268
|
+
"CANVAS",
|
|
269
|
+
"IMG",
|
|
270
|
+
"EMBED"
|
|
271
|
+
]);
|
|
272
|
+
function V(e) {
|
|
273
|
+
let t = e?.fullscreenElement;
|
|
274
|
+
return !t || typeof HTMLElement > "u" || !(t instanceof HTMLElement) || B.has(t.tagName) ? null : t;
|
|
275
|
+
}
|
|
276
|
+
var H = F(() => {
|
|
277
|
+
let e = C(V(I));
|
|
278
|
+
return ae(I, "fullscreenchange", () => {
|
|
279
|
+
e.value = V(I);
|
|
280
|
+
}), e;
|
|
281
|
+
}), U = /* @__PURE__ */ d({
|
|
282
|
+
inheritAttrs: !1,
|
|
283
|
+
__name: "TooltipContent",
|
|
284
|
+
props: {
|
|
285
|
+
forceMount: { type: Boolean },
|
|
286
|
+
ariaLabel: {},
|
|
287
|
+
asChild: { type: Boolean },
|
|
288
|
+
as: {},
|
|
289
|
+
side: {},
|
|
290
|
+
sideOffset: { default: 4 },
|
|
291
|
+
align: {},
|
|
292
|
+
alignOffset: {},
|
|
293
|
+
avoidCollisions: { type: Boolean },
|
|
294
|
+
collisionBoundary: {},
|
|
295
|
+
collisionPadding: {},
|
|
296
|
+
arrowPadding: {},
|
|
297
|
+
sticky: {},
|
|
298
|
+
hideWhenDetached: { type: Boolean },
|
|
299
|
+
positionStrategy: {},
|
|
300
|
+
updatePositionStrategy: {},
|
|
301
|
+
class: { type: [
|
|
302
|
+
Boolean,
|
|
303
|
+
null,
|
|
304
|
+
String,
|
|
305
|
+
Object,
|
|
306
|
+
Array
|
|
307
|
+
] },
|
|
308
|
+
to: { default: void 0 }
|
|
309
|
+
},
|
|
310
|
+
emits: ["escapeKeyDown", "pointerDownOutside"],
|
|
311
|
+
setup(t, { emit: n }) {
|
|
312
|
+
let r = t, i = n, a = H(), s = N(ie(r, "class", "to"), i);
|
|
313
|
+
return (n, i) => (y(), o(w(A), { to: t.to ?? w(a) ?? void 0 }, {
|
|
314
|
+
default: E(() => [u(w(k), h({ "data-slot": "tooltip-content" }, {
|
|
315
|
+
...w(s),
|
|
316
|
+
...n.$attrs
|
|
317
|
+
}, { class: w(e)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance", r.class) }), {
|
|
318
|
+
default: E(() => [S(n.$slots, "default"), u(w(O), { class: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-xs" })]),
|
|
319
|
+
_: 3
|
|
320
|
+
}, 16, ["class"])]),
|
|
321
|
+
_: 3
|
|
322
|
+
}, 8, ["to"]));
|
|
323
|
+
}
|
|
324
|
+
}), W = /* @__PURE__ */ d({
|
|
325
|
+
__name: "TooltipProvider",
|
|
326
|
+
props: {
|
|
327
|
+
delayDuration: { default: 0 },
|
|
328
|
+
skipDelayDuration: {},
|
|
329
|
+
disableHoverableContent: { type: Boolean },
|
|
330
|
+
disableClosingTrigger: { type: Boolean },
|
|
331
|
+
disabled: { type: Boolean },
|
|
332
|
+
ignoreNonKeyboardFocus: { type: Boolean },
|
|
333
|
+
content: {}
|
|
334
|
+
},
|
|
335
|
+
setup(e) {
|
|
336
|
+
let t = e;
|
|
337
|
+
return (e, n) => (y(), o(w(re), _(f(t)), {
|
|
338
|
+
default: E(() => [S(e.$slots, "default")]),
|
|
339
|
+
_: 3
|
|
340
|
+
}, 16));
|
|
341
|
+
}
|
|
342
|
+
}), G = /* @__PURE__ */ d({
|
|
343
|
+
__name: "TooltipTrigger",
|
|
344
|
+
props: {
|
|
345
|
+
reference: {},
|
|
346
|
+
asChild: { type: Boolean },
|
|
347
|
+
as: {}
|
|
348
|
+
},
|
|
349
|
+
setup(e) {
|
|
350
|
+
let t = e;
|
|
351
|
+
return (e, n) => (y(), o(w(M), h({ "data-slot": "tooltip-trigger" }, t), {
|
|
352
|
+
default: E(() => [S(e.$slots, "default")]),
|
|
353
|
+
_: 3
|
|
354
|
+
}, 16));
|
|
355
|
+
}
|
|
356
|
+
}), K = Symbol("named-control"), q = {
|
|
357
|
+
primary: "text-primary dark:text-[color-mix(in_oklab,var(--color-primary)_40%,white)]",
|
|
358
|
+
secondary: "text-secondary",
|
|
359
|
+
success: "text-success dark:text-[color-mix(in_oklab,var(--color-success)_85%,white)]",
|
|
360
|
+
info: "text-info",
|
|
361
|
+
warning: "text-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:text-[color-mix(in_oklab,var(--color-warning)_85%,white)]",
|
|
362
|
+
error: "text-[color-mix(in_oklab,var(--color-error)_85%,black)] dark:text-[color-mix(in_oklab,var(--color-error)_70%,white)]",
|
|
363
|
+
default: "text-foreground"
|
|
364
|
+
}, J = {
|
|
365
|
+
primary: "[&_svg]:data-[slot=icon]:text-primary dark:[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-primary)_40%,white)]",
|
|
366
|
+
secondary: "[&_svg]:data-[slot=icon]:text-secondary",
|
|
367
|
+
success: "[&_svg]:data-[slot=icon]:text-success dark:[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-success)_85%,white)]",
|
|
368
|
+
info: "[&_svg]:data-[slot=icon]:text-info",
|
|
369
|
+
warning: "[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-warning)_85%,white)]",
|
|
370
|
+
error: "[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-error)_85%,black)] dark:[&_svg]:data-[slot=icon]:text-[color-mix(in_oklab,var(--color-error)_70%,white)]",
|
|
371
|
+
default: "[&_svg]:data-[slot=icon]:text-foreground"
|
|
372
|
+
}, ce = {
|
|
373
|
+
primary: "[&_svg]:stroke-primary dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-primary)_40%,white)]",
|
|
374
|
+
secondary: "[&_svg]:stroke-secondary",
|
|
375
|
+
success: "[&_svg]:stroke-success dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-success)_85%,white)]",
|
|
376
|
+
info: "[&_svg]:stroke-info",
|
|
377
|
+
warning: "[&_svg]:stroke-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-warning)_85%,white)]",
|
|
378
|
+
error: "[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_85%,black)] dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_70%,white)]",
|
|
379
|
+
default: "[&_svg]:stroke-foreground"
|
|
380
|
+
}, Y = P("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 aria-busy:cursor-progress [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error px-4 py-2 has-[>svg]:px-3", {
|
|
381
|
+
variants: {
|
|
382
|
+
variant: {
|
|
383
|
+
filled: "shadow-xs",
|
|
384
|
+
tonal: "shadow-xs",
|
|
385
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
386
|
+
outlined: "border shadow-xs",
|
|
387
|
+
link: "focus:underline underline-offset-4 hover:underline"
|
|
388
|
+
},
|
|
389
|
+
color: {
|
|
390
|
+
primary: null,
|
|
391
|
+
secondary: null,
|
|
392
|
+
info: null,
|
|
393
|
+
warning: null,
|
|
394
|
+
default: null,
|
|
395
|
+
error: null,
|
|
396
|
+
success: null
|
|
397
|
+
},
|
|
398
|
+
size: {
|
|
399
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
400
|
+
xs: "h-6 gap-1 rounded-full px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
401
|
+
sm: "h-8 rounded-full gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
402
|
+
lg: "h-10 rounded-full px-6 has-[>svg]:px-4",
|
|
403
|
+
icon: "size-9 px-0 py-0 has-[>svg]:px-0",
|
|
404
|
+
"icon-xs": "size-6 rounded-full px-0 py-0 has-[>svg]:px-0 [&_svg:not([class*='size-'])]:size-3",
|
|
405
|
+
"icon-sm": "size-8 px-0 py-0 has-[>svg]:px-0",
|
|
406
|
+
"icon-lg": "size-10 px-0 py-0 has-[>svg]:px-0"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
defaultVariants: {
|
|
410
|
+
variant: "filled",
|
|
411
|
+
color: "primary"
|
|
412
|
+
},
|
|
413
|
+
compoundVariants: [
|
|
414
|
+
{
|
|
415
|
+
variant: "filled",
|
|
416
|
+
color: "primary",
|
|
417
|
+
class: "bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--color-primary)_90%,black)] [&_svg]:data-[slot=icon]:text-primary-foreground active:bg-[color-mix(in_oklab,var(--color-primary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-primary)_85%,black)]"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
variant: "filled",
|
|
421
|
+
color: "secondary",
|
|
422
|
+
class: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--color-secondary)_90%,black)] [&_svg]:data-[slot=icon]:text-secondary-foreground active:bg-[color-mix(in_oklab,var(--color-secondary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-secondary)_85%,black)] dark:bg-secondary/70 dark:hover:bg-secondary/60 dark:active:bg-secondary/50 dark:focus:bg-secondary/60"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
variant: "filled",
|
|
426
|
+
color: "success",
|
|
427
|
+
class: "bg-success text-success-foreground hover:bg-[color-mix(in_oklab,var(--color-success)_90%,black)] [&_svg]:data-[slot=icon]:text-success-foreground active:bg-[color-mix(in_oklab,var(--color-success)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-success)_85%,black)] dark:bg-success/60 dark:hover:bg-success/50 dark:active:bg-success/40 dark:focus:bg-success/50"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
variant: "filled",
|
|
431
|
+
color: "info",
|
|
432
|
+
class: "bg-info text-info-foreground hover:bg-[color-mix(in_oklab,var(--color-info)_90%,black)] [&_svg]:data-[slot=icon]:text-info-foreground active:bg-[color-mix(in_oklab,var(--color-info)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-info)_85%,black)] dark:bg-info/60 dark:hover:bg-info/50 dark:active:bg-info/40 dark:focus:bg-info/50"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
variant: "filled",
|
|
436
|
+
color: "warning",
|
|
437
|
+
class: "bg-warning text-warning-foreground hover:bg-[color-mix(in_oklab,var(--color-warning)_90%,black)] [&_svg]:data-[slot=icon]:text-warning-foreground active:bg-[color-mix(in_oklab,var(--color-warning)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:bg-warning/60 dark:hover:bg-warning/50 dark:active:bg-warning/40 dark:focus:bg-warning/50"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
variant: "filled",
|
|
441
|
+
color: "error",
|
|
442
|
+
class: "bg-error text-error-foreground hover:bg-[color-mix(in_oklab,var(--color-error)_90%,black)] [&_svg]:data-[slot=icon]:text-error-foreground active:bg-[color-mix(in_oklab,var(--color-error)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-error)_85%,black)]"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
variant: "filled",
|
|
446
|
+
color: "default",
|
|
447
|
+
class: "bg-foreground text-background hover:bg-foreground/90 [&_svg]:data-[slot=icon]:text-foreground active:bg-foreground/70 focus:bg-foreground/80"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
variant: "tonal",
|
|
451
|
+
color: "primary",
|
|
452
|
+
class: `${q.primary} ${J.primary} bg-primary/15 hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
variant: "tonal",
|
|
456
|
+
color: "secondary",
|
|
457
|
+
class: `${q.secondary} ${J.secondary} bg-secondary/15 hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
variant: "tonal",
|
|
461
|
+
color: "info",
|
|
462
|
+
class: `${q.info} ${J.info} bg-info/15 hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
variant: "tonal",
|
|
466
|
+
color: "success",
|
|
467
|
+
class: `${q.success} ${J.success} bg-success/15 hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
variant: "tonal",
|
|
471
|
+
color: "warning",
|
|
472
|
+
class: `${q.warning} ${J.warning} bg-warning/15 hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
variant: "tonal",
|
|
476
|
+
color: "error",
|
|
477
|
+
class: `${q.error} ${J.error} bg-error/15 hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
variant: "tonal",
|
|
481
|
+
color: "default",
|
|
482
|
+
class: `${q.default} ${J.default} bg-foreground/15 hover:bg-foreground/10 active:bg-muted focus:bg-muted`
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
variant: "outlined",
|
|
486
|
+
color: "primary",
|
|
487
|
+
class: `${q.primary} ${J.primary} border-primary/50 focus:bg-primary/15 hover:bg-primary/10`
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
variant: "outlined",
|
|
491
|
+
color: "secondary",
|
|
492
|
+
class: `${q.secondary} ${J.secondary} border-secondary/50 focus:bg-secondary/15 hover:bg-secondary/10`
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
variant: "outlined",
|
|
496
|
+
color: "info",
|
|
497
|
+
class: `${q.info} ${J.info} border-info/50 focus:bg-info/15 hover:bg-info/10`
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
variant: "outlined",
|
|
501
|
+
color: "success",
|
|
502
|
+
class: `${q.success} ${J.success} border-success/50 focus:bg-success/15 hover:bg-success/10`
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
variant: "outlined",
|
|
506
|
+
color: "warning",
|
|
507
|
+
class: `${q.warning} ${J.warning} border-warning/50 focus:bg-warning/15 hover:bg-warning/10`
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
variant: "outlined",
|
|
511
|
+
color: "error",
|
|
512
|
+
class: `${q.error} ${J.error} border-error/50 focus:bg-error/15 hover:bg-error/10`
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
variant: "outlined",
|
|
516
|
+
color: "default",
|
|
517
|
+
class: `${q.default} ${J.default} border-foreground/50 focus:bg-foreground/15 hover:bg-foreground/10`
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
variant: "link",
|
|
521
|
+
color: "primary",
|
|
522
|
+
class: `${q.primary} ${J.primary} hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/15`
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
variant: "link",
|
|
526
|
+
color: "secondary",
|
|
527
|
+
class: `${q.secondary} ${J.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/15`
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
variant: "link",
|
|
531
|
+
color: "success",
|
|
532
|
+
class: `${q.success} ${J.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/15`
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
variant: "link",
|
|
536
|
+
color: "info",
|
|
537
|
+
class: `${q.info} ${J.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/15`
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
variant: "link",
|
|
541
|
+
color: "warning",
|
|
542
|
+
class: `${q.warning} ${J.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/15`
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
variant: "link",
|
|
546
|
+
color: "error",
|
|
547
|
+
class: `${q.error} ${J.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/15`
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
variant: "link",
|
|
551
|
+
color: "default",
|
|
552
|
+
class: `${q.default} ${J.default} hover:bg-foreground/10 active:bg-muted focus:bg-foreground/15`
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
}), le = {
|
|
556
|
+
xs: "min-h-6",
|
|
557
|
+
sm: "min-h-8",
|
|
558
|
+
default: "min-h-9",
|
|
559
|
+
lg: "min-h-10"
|
|
560
|
+
};
|
|
561
|
+
function ue(e, t) {
|
|
562
|
+
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ? le[t] : ""} whitespace-normal **:whitespace-normal text-center`;
|
|
563
|
+
}
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region lib/components/ui/actions/button/has-text-content.ts
|
|
566
|
+
function X(e) {
|
|
567
|
+
if (e == null || typeof e == "boolean") return !1;
|
|
568
|
+
if (typeof e == "string" || typeof e == "number") return String(e).trim() !== "";
|
|
569
|
+
if (Array.isArray(e)) return e.some(X);
|
|
570
|
+
if (!m(e) || e.type === n) return !1;
|
|
571
|
+
if (e.type === i) return String(e.children ?? "").trim() !== "";
|
|
572
|
+
if (de(e.props?.["aria-hidden"] ?? e.props?.ariaHidden)) return !1;
|
|
573
|
+
let { children: t } = e;
|
|
574
|
+
if (typeof t == "string") return t.trim() !== "";
|
|
575
|
+
if (Array.isArray(t)) return X(t);
|
|
576
|
+
let r = t?.default;
|
|
577
|
+
return typeof r == "function" && X(r());
|
|
578
|
+
}
|
|
579
|
+
function de(e) {
|
|
580
|
+
return e === "" || !!e && e !== "false";
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region lib/components/ui/actions/button/label-text.ts
|
|
584
|
+
function Z(e) {
|
|
585
|
+
let t = [], n = [], a = () => {
|
|
586
|
+
let e = n.join("");
|
|
587
|
+
n.length > 0 && e.trim() !== "" ? t.push(p("span", { "data-slot": "button-label" }, e)) : n.length > 0 && t.push(p(i, e)), n = [];
|
|
588
|
+
};
|
|
589
|
+
for (let o of e) {
|
|
590
|
+
if (o.type === i) {
|
|
591
|
+
n.push(String(o.children ?? ""));
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
a(), o.type === r && Array.isArray(o.children) ? t.push(p(r, { key: o.key ?? void 0 }, Z(o.children))) : t.push(o);
|
|
595
|
+
}
|
|
596
|
+
return a(), t;
|
|
597
|
+
}
|
|
598
|
+
var fe = (e, { slots: t }) => Z(t.default?.() ?? []), Q = (e) => e.flatMap((e) => e.type === r && Array.isArray(e.children) ? Q(e.children) : [e]), $ = (e, { attrs: t, slots: r }) => {
|
|
599
|
+
let i = Q(r.default?.() ?? []), a = i.find((e) => e.type !== n);
|
|
600
|
+
if (!a) return i;
|
|
601
|
+
let o = h(t, a.props ?? {});
|
|
602
|
+
if (e.leading) for (let e of ["aria-busy", "aria-disabled"]) e in t && (o[e] = t[e]);
|
|
603
|
+
let s;
|
|
604
|
+
if (typeof a.type == "string") {
|
|
605
|
+
let t = Array.isArray(a.children) ? a.children : a.children == null ? [] : [l(String(a.children))];
|
|
606
|
+
s = p(a.type, o, e.leading ? [e.leading, ...t] : a.children);
|
|
607
|
+
} else {
|
|
608
|
+
let t = a.children ?? {}, n = e.leading;
|
|
609
|
+
s = p(a.type, o, n ? {
|
|
610
|
+
...t,
|
|
611
|
+
default: (...e) => [n, ...t.default?.(...e) ?? []]
|
|
612
|
+
} : t);
|
|
613
|
+
}
|
|
614
|
+
return s.ref = a.ref, s.dirs = a.dirs, s;
|
|
615
|
+
};
|
|
616
|
+
$.props = ["leading"], $.inheritAttrs = !1;
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region lib/components/ui/actions/button/use-click-lock.ts
|
|
619
|
+
var pe = 1e3;
|
|
620
|
+
function me(e, t) {
|
|
621
|
+
let n = x(!1), r = !1, i;
|
|
622
|
+
function a() {
|
|
623
|
+
n.value = !1, r = !1, clearTimeout(i);
|
|
624
|
+
}
|
|
625
|
+
function o() {
|
|
626
|
+
e() && (n.value = !0, clearTimeout(i), i = setTimeout(() => {
|
|
627
|
+
r || a();
|
|
628
|
+
}, pe));
|
|
629
|
+
}
|
|
630
|
+
return T(t, (e) => {
|
|
631
|
+
n.value && (e ? r = !0 : r && a());
|
|
632
|
+
}), v(() => clearTimeout(i)), {
|
|
633
|
+
locked: n,
|
|
634
|
+
lock: o
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region lib/components/ui/actions/button/Button.vue
|
|
639
|
+
var he = /* @__PURE__ */ d({
|
|
640
|
+
inheritAttrs: !1,
|
|
641
|
+
__name: "Button",
|
|
642
|
+
props: {
|
|
643
|
+
asChild: { type: Boolean },
|
|
644
|
+
as: { default: "button" },
|
|
645
|
+
variant: { default: "filled" },
|
|
646
|
+
color: { default: "primary" },
|
|
647
|
+
size: {},
|
|
648
|
+
class: { type: [
|
|
649
|
+
Boolean,
|
|
650
|
+
null,
|
|
651
|
+
String,
|
|
652
|
+
Object,
|
|
653
|
+
Array
|
|
654
|
+
] },
|
|
655
|
+
loading: { type: Boolean },
|
|
656
|
+
lockOnClick: { type: Boolean },
|
|
657
|
+
spinnerVariant: { default: "2" },
|
|
658
|
+
wrap: { type: Boolean },
|
|
659
|
+
disabled: { type: Boolean },
|
|
660
|
+
tooltip: {}
|
|
661
|
+
},
|
|
662
|
+
setup(t) {
|
|
663
|
+
let n = t, i = te(), c = ne(), l = ee(K, void 0);
|
|
664
|
+
b(K, a(() => !!l?.value || !!(i["aria-label"] || i["aria-labelledby"]) || X(c.default?.())));
|
|
665
|
+
let d = me(() => n.lockOnClick, () => !!n.loading), f = a(() => !!(n.loading || d.locked.value)), m = (e) => f.value || i[e];
|
|
666
|
+
function g(e) {
|
|
667
|
+
if (f.value) {
|
|
668
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
d.lock();
|
|
672
|
+
}
|
|
673
|
+
let _ = () => p(R, {
|
|
674
|
+
variant: n.spinnerVariant,
|
|
675
|
+
color: n.variant === "filled" ? "light" : n.color,
|
|
676
|
+
class: e("starting:scale-0 duration-500", n.spinnerVariant === "4" ? "size-7.5" : "size-4.5")
|
|
677
|
+
}), v = () => f.value ? _() : null, x = (e, { slots: t }) => e.text ? p(W, () => p(z, () => [p(G, { asChild: !0 }, t.default), p(U, () => e.text)])) : t.default?.()[0];
|
|
678
|
+
x.props = ["text"];
|
|
679
|
+
let C = a(() => n.as !== "button" || n.asChild ? i.type : i.type ?? "button"), T = a(() => !!n.size?.startsWith("icon")), O = a(() => e("justify-center duration-500", !T.value && "w-fit max-w-full truncate line-clamp-1 text-ellipsis", Y({
|
|
680
|
+
variant: n.variant,
|
|
681
|
+
color: n.color,
|
|
682
|
+
size: n.size
|
|
683
|
+
}), ue(n.wrap, n.size), n.class));
|
|
684
|
+
return (e, n) => (y(), o(x, { text: t.tooltip }, {
|
|
685
|
+
default: E(() => [u(w(D), h(e.$attrs, {
|
|
686
|
+
onClickCapture: g,
|
|
687
|
+
"data-slot": e.$attrs["data-slot"] ?? "button",
|
|
688
|
+
"data-variant": t.variant,
|
|
689
|
+
"data-color": t.color,
|
|
690
|
+
"data-size": t.size,
|
|
691
|
+
as: t.as,
|
|
692
|
+
"as-child": t.asChild,
|
|
693
|
+
type: C.value,
|
|
694
|
+
disabled: t.disabled,
|
|
695
|
+
"aria-disabled": m("aria-disabled"),
|
|
696
|
+
"aria-busy": m("aria-busy"),
|
|
697
|
+
class: O.value
|
|
698
|
+
}), {
|
|
699
|
+
default: E(() => [t.asChild ? (y(), o(w($), {
|
|
700
|
+
key: 0,
|
|
701
|
+
leading: f.value ? _() : null
|
|
702
|
+
}, {
|
|
703
|
+
default: E(() => [S(e.$slots, "default")]),
|
|
704
|
+
_: 3
|
|
705
|
+
}, 8, ["leading"])) : (y(), s(r, { key: 1 }, [u(v), u(w(fe), null, {
|
|
706
|
+
default: E(() => [S(e.$slots, "default")]),
|
|
707
|
+
_: 3
|
|
708
|
+
})], 64))]),
|
|
709
|
+
_: 3
|
|
710
|
+
}, 16, [
|
|
711
|
+
"data-slot",
|
|
712
|
+
"data-variant",
|
|
713
|
+
"data-color",
|
|
714
|
+
"data-size",
|
|
715
|
+
"as",
|
|
716
|
+
"as-child",
|
|
717
|
+
"type",
|
|
718
|
+
"disabled",
|
|
719
|
+
"aria-disabled",
|
|
720
|
+
"aria-busy",
|
|
721
|
+
"class"
|
|
722
|
+
])]),
|
|
723
|
+
_: 3
|
|
724
|
+
}, 8, ["text"]));
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
//#endregion
|
|
728
|
+
export { ce as a, G as c, H as d, z as f, J as i, W as l, L as m, X as n, q as o, R as p, Y as r, K as s, he as t, U as u };
|