@gspa/ui 0.1.1 → 0.1.4
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 +18 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/Accordion.cjs +1 -0
- package/dist/components/Accordion.js +192 -0
- package/dist/components/AccordionItem.cjs +1 -0
- package/dist/components/AccordionItem.js +109 -0
- package/dist/components/AddReminderModal.cjs +1 -0
- package/dist/components/AddReminderModal.js +107 -0
- package/dist/components/Alert.cjs +1 -0
- package/dist/components/Alert.js +222 -0
- package/dist/components/Avatar.cjs +1 -0
- package/dist/components/Avatar.js +86 -0
- package/dist/components/Badge.cjs +1 -0
- package/dist/components/Badge.js +109 -0
- package/dist/components/Breadcrumb.cjs +1 -0
- package/dist/components/Breadcrumb.js +72 -0
- package/dist/components/Button.cjs +1 -0
- package/dist/components/Button.js +190 -0
- package/dist/components/ButtonGroup.cjs +1 -0
- package/dist/components/ButtonGroup.js +46 -0
- package/dist/components/Calendar.cjs +1 -0
- package/dist/components/Calendar.js +341 -0
- package/dist/components/Card.cjs +1 -0
- package/dist/components/Card.js +316 -0
- package/dist/components/CardBody.cjs +1 -0
- package/dist/components/CardBody.js +34 -0
- package/dist/components/CardContent.cjs +1 -0
- package/dist/components/CardContent.js +17 -0
- package/dist/components/CardFooter.cjs +1 -0
- package/dist/components/CardFooter.js +34 -0
- package/dist/components/CardHeader.cjs +1 -0
- package/dist/components/CardHeader.js +91 -0
- package/dist/components/CardTitle.cjs +1 -0
- package/dist/components/CardTitle.js +17 -0
- package/dist/components/Checkbox.cjs +1 -0
- package/dist/components/Checkbox.js +185 -0
- package/dist/components/CircularProgress.cjs +1 -0
- package/dist/components/CircularProgress.js +141 -0
- package/dist/components/DataTable.cjs +1 -0
- package/dist/components/DataTable.js +863 -0
- package/dist/components/DataTableCell.cjs +1 -0
- package/dist/components/DataTableCell.js +95 -0
- package/dist/components/DataTableFilters.cjs +1 -0
- package/dist/components/DataTableFilters.js +519 -0
- package/dist/components/DataTableHeader.cjs +1 -0
- package/dist/components/DataTableHeader.js +116 -0
- package/dist/components/DataTablePagination.cjs +1 -0
- package/dist/components/DataTablePagination.js +290 -0
- package/dist/components/DataTableRow.cjs +1 -0
- package/dist/components/DataTableRow.js +199 -0
- package/dist/components/DataTableToolBar.cjs +1 -0
- package/dist/components/DataTableToolBar.js +477 -0
- package/dist/components/DatePicker.cjs +1 -0
- package/dist/components/DatePicker.js +401 -0
- package/dist/components/Divider.cjs +1 -0
- package/dist/components/Divider.js +103 -0
- package/dist/components/Dropdown.cjs +1 -0
- package/dist/components/Dropdown.js +104 -0
- package/dist/components/DropdownItem.cjs +1 -0
- package/dist/components/DropdownItem.js +60 -0
- package/dist/components/EventsCalendar.cjs +1 -0
- package/dist/components/EventsCalendar.js +863 -0
- package/dist/components/FileUpload.cjs +1 -0
- package/dist/components/FileUpload.js +195 -0
- package/dist/components/FilterDrawer.cjs +1 -0
- package/dist/components/FilterDrawer.js +412 -0
- package/dist/components/Footer.cjs +1 -0
- package/dist/components/Footer.js +157 -0
- package/dist/components/FormField.cjs +1 -0
- package/dist/components/FormField.js +190 -0
- package/dist/components/Graph.cjs +1 -0
- package/dist/components/Graph.js +164 -0
- package/dist/components/GraphFilters.cjs +1 -0
- package/dist/components/GraphFilters.js +305 -0
- package/dist/components/Header.cjs +1 -0
- package/dist/components/Header.js +674 -0
- package/dist/components/Icon.cjs +1 -0
- package/dist/components/Icon.js +51 -0
- package/dist/components/Image.cjs +1 -0
- package/dist/components/Image.js +112 -0
- package/dist/components/Input.cjs +1 -0
- package/dist/components/Input.js +166 -0
- package/dist/components/InputGroup.cjs +1 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.cjs +1 -0
- package/dist/components/Label.js +46 -0
- package/dist/components/Link.cjs +1 -0
- package/dist/components/Link.js +119 -0
- package/dist/components/ListItem.cjs +1 -0
- package/dist/components/ListItem.js +89 -0
- package/dist/components/Loader.cjs +1 -0
- package/dist/components/Loader.js +154 -0
- package/dist/components/Logo.cjs +1 -0
- package/dist/components/Logo.js +67 -0
- package/dist/components/MenuItem.cjs +1 -0
- package/dist/components/MenuItem.js +66 -0
- package/dist/components/Modal.cjs +1 -0
- package/dist/components/Modal.js +110 -0
- package/dist/components/ModalBody.cjs +1 -0
- package/dist/components/ModalBody.js +33 -0
- package/dist/components/ModalFooter.cjs +1 -0
- package/dist/components/ModalFooter.js +33 -0
- package/dist/components/ModalHeader.cjs +1 -0
- package/dist/components/ModalHeader.js +24 -0
- package/dist/components/MultiSelect.cjs +1 -0
- package/dist/components/MultiSelect.js +211 -0
- package/dist/components/Notification.cjs +1 -0
- package/dist/components/Notification.js +121 -0
- package/dist/components/Option.cjs +1 -0
- package/dist/components/Option.js +44 -0
- package/dist/components/Progress.cjs +1 -0
- package/dist/components/Progress.js +77 -0
- package/dist/components/ProgressBar.cjs +1 -0
- package/dist/components/ProgressBar.js +101 -0
- package/dist/components/Radio.cjs +1 -0
- package/dist/components/Radio.js +81 -0
- package/dist/components/RailNav.cjs +1 -0
- package/dist/components/RailNav.js +124 -0
- package/dist/components/ReminderConfig.cjs +1 -0
- package/dist/components/ReminderConfig.js +375 -0
- package/dist/components/ReusableForm.cjs +1 -0
- package/dist/components/ReusableForm.js +657 -0
- package/dist/components/ReusableFormModal.cjs +1 -0
- package/dist/components/ReusableFormModal.js +112 -0
- package/dist/components/RightDrawer.cjs +1 -0
- package/dist/components/RightDrawer.js +143 -0
- package/dist/components/Search.cjs +1 -0
- package/dist/components/Search.js +252 -0
- package/dist/components/Select.cjs +1 -0
- package/dist/components/Select.js +243 -0
- package/dist/components/Sidebar.cjs +1 -0
- package/dist/components/Sidebar.js +372 -0
- package/dist/components/Slider.cjs +1 -0
- package/dist/components/Slider.js +42 -0
- package/dist/components/Spinner.cjs +1 -0
- package/dist/components/Spinner.js +87 -0
- package/dist/components/Stepper.cjs +1 -0
- package/dist/components/Stepper.js +12 -0
- package/dist/components/StepperItem.cjs +1 -0
- package/dist/components/StepperItem.js +33 -0
- package/dist/components/Switch.cjs +1 -0
- package/dist/components/Switch.js +112 -0
- package/dist/components/Tab.cjs +1 -0
- package/dist/components/Tab.js +134 -0
- package/dist/components/TabPanel.cjs +1 -0
- package/dist/components/TabPanel.js +49 -0
- package/dist/components/Text.cjs +1 -0
- package/dist/components/Text.js +84 -0
- package/dist/components/Textarea.cjs +1 -0
- package/dist/components/Textarea.js +102 -0
- package/dist/components/ThemeConfigurator.cjs +1 -0
- package/dist/components/ThemeConfigurator.js +50 -0
- package/dist/components/Timeline.cjs +1 -0
- package/dist/components/Timeline.js +24 -0
- package/dist/components/TimelineItem.cjs +1 -0
- package/dist/components/TimelineItem.js +63 -0
- package/dist/components/Toast.cjs +1 -0
- package/dist/components/Toast.js +231 -0
- package/dist/components/Tooltip.cjs +1 -0
- package/dist/components/Tooltip.js +124 -0
- package/dist/components/Typography.cjs +1 -0
- package/dist/components/Typography.js +267 -0
- package/dist/components/charts/BarChart.cjs +1 -0
- package/dist/components/charts/BarChart.js +323 -0
- package/dist/components/charts/LineChart.cjs +1 -0
- package/dist/components/charts/LineChart.js +322 -0
- package/dist/components/charts/PieChart.cjs +1 -0
- package/dist/components/charts/PieChart.js +311 -0
- package/dist/components/charts/StackedBarChart.cjs +1 -0
- package/dist/components/charts/StackedBarChart.js +348 -0
- package/dist/components/widgets/DashboardWidget.cjs +1 -0
- package/dist/components/widgets/DashboardWidget.js +309 -0
- package/dist/directives/tooltip.cjs +47 -0
- package/dist/directives/tooltip.js +115 -0
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +310 -19533
- package/dist/layouts/AuthLayout.cjs +1 -0
- package/dist/layouts/AuthLayout.js +190 -0
- package/dist/layouts/DashboardLayout.cjs +1 -0
- package/dist/layouts/DashboardLayout.js +244 -0
- package/dist/layouts/DefaultLayout.cjs +1 -0
- package/dist/layouts/DefaultLayout.js +94 -0
- package/dist/layouts/ErrorLayout.cjs +1 -0
- package/dist/layouts/ErrorLayout.js +452 -0
- package/dist/lib/auth.cjs +1 -0
- package/dist/lib/auth.js +4 -0
- package/dist/lib/theme.cjs +1 -0
- package/dist/lib/theme.js +135 -0
- package/dist/lib/toast.cjs +1 -0
- package/dist/lib/toast.js +81 -0
- package/dist/src/__tests__/AuthLayout.spec.d.ts +2 -0
- package/dist/src/__tests__/AuthLayout.spec.d.ts.map +1 -0
- package/dist/src/layouts/AuthLayout.vue.d.ts +10 -6
- package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +43 -11
- package/dist/applogo.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.js +0 -605
- package/dist/logo.png +0 -0
- package/dist/stlbacklogo.jpeg +0 -0
- package/dist/stlbacklogo.png +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { ref as V, computed as c, createBlock as u, openBlock as r, Transition as $, withCtx as k, createElementBlock as o, createCommentVNode as a, normalizeClass as l, unref as p, createElementVNode as d, resolveDynamicComponent as A, toDisplayString as m, renderSlot as x, createTextVNode as y, Fragment as N, renderList as D, createVNode as T, h as s } from "vue";
|
|
2
|
+
import { cva as E } from "class-variance-authority";
|
|
3
|
+
import { cn as X } from "../utils/cn.js";
|
|
4
|
+
import F from "./Button.js";
|
|
5
|
+
const O = { class: "flex items-start gap-3" }, q = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "shrink-0 mt-0.5"
|
|
8
|
+
}, G = { class: "flex-1 min-w-0" }, H = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "font-medium text-sm mb-1"
|
|
11
|
+
}, J = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "mt-3 flex gap-2"
|
|
14
|
+
}, K = ["aria-label"], Z = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
15
|
+
__name: "Alert",
|
|
16
|
+
props: {
|
|
17
|
+
variant: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "info",
|
|
20
|
+
validator: (e) => ["info", "success", "warning", "error", "default", "danger"].includes(
|
|
21
|
+
e
|
|
22
|
+
)
|
|
23
|
+
},
|
|
24
|
+
title: String,
|
|
25
|
+
message: String,
|
|
26
|
+
dismissible: { type: Boolean, default: !1 },
|
|
27
|
+
dismissLabel: { type: String, default: "Dismiss alert" },
|
|
28
|
+
showIcon: { type: Boolean, default: !0 },
|
|
29
|
+
actions: { type: Array, default: () => [] },
|
|
30
|
+
autoClose: { type: [Boolean, Number], default: !1 }
|
|
31
|
+
},
|
|
32
|
+
emits: ["dismiss", "action"],
|
|
33
|
+
setup(e, { emit: C }) {
|
|
34
|
+
const n = e, f = C, g = V(!0), v = () => {
|
|
35
|
+
g.value = !1, f("dismiss");
|
|
36
|
+
}, b = (t) => {
|
|
37
|
+
f("action", t), t.onClick && t.onClick();
|
|
38
|
+
};
|
|
39
|
+
if (n.autoClose) {
|
|
40
|
+
const t = typeof n.autoClose == "number" ? n.autoClose : 5e3;
|
|
41
|
+
setTimeout(v, t);
|
|
42
|
+
}
|
|
43
|
+
const h = {
|
|
44
|
+
render() {
|
|
45
|
+
return s("svg", {
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
fill: "none",
|
|
48
|
+
viewBox: "0 0 24 24",
|
|
49
|
+
stroke: "currentColor"
|
|
50
|
+
}, [
|
|
51
|
+
s("path", {
|
|
52
|
+
"stroke-linecap": "round",
|
|
53
|
+
"stroke-linejoin": "round",
|
|
54
|
+
"stroke-width": "2",
|
|
55
|
+
d: "M12 9v2m0 4h.01M21 12A9 9 0 1112 3a9 9 0 019 9z"
|
|
56
|
+
})
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
}, B = {
|
|
60
|
+
render() {
|
|
61
|
+
return s("svg", {
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
fill: "none",
|
|
64
|
+
viewBox: "0 0 24 24",
|
|
65
|
+
stroke: "currentColor"
|
|
66
|
+
}, [
|
|
67
|
+
s("path", {
|
|
68
|
+
"stroke-linecap": "round",
|
|
69
|
+
"stroke-linejoin": "round",
|
|
70
|
+
"stroke-width": "2",
|
|
71
|
+
d: "M9 12l2 2l4-4m5 2a9 9 0 11-18 0a9 9 0 0118 0z"
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
}, M = {
|
|
76
|
+
render() {
|
|
77
|
+
return s("svg", {
|
|
78
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
+
fill: "none",
|
|
80
|
+
viewBox: "0 0 24 24",
|
|
81
|
+
stroke: "currentColor"
|
|
82
|
+
}, [
|
|
83
|
+
s("path", {
|
|
84
|
+
"stroke-linecap": "round",
|
|
85
|
+
"stroke-linejoin": "round",
|
|
86
|
+
"stroke-width": "2",
|
|
87
|
+
d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a1.5 1.5 0 001.29 2.25h18.78a1.5 1.5 0 001.29-2.25L13.71 3.86a1.5 1.5 0 00-2.42 0z"
|
|
88
|
+
})
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
}, w = {
|
|
92
|
+
render() {
|
|
93
|
+
return s("svg", {
|
|
94
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
95
|
+
fill: "none",
|
|
96
|
+
viewBox: "0 0 24 24",
|
|
97
|
+
stroke: "currentColor"
|
|
98
|
+
}, [
|
|
99
|
+
s("path", {
|
|
100
|
+
"stroke-linecap": "round",
|
|
101
|
+
"stroke-linejoin": "round",
|
|
102
|
+
"stroke-width": "2",
|
|
103
|
+
d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0a9 9 0 0118 0z"
|
|
104
|
+
})
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
}, z = {
|
|
108
|
+
render() {
|
|
109
|
+
return s("svg", {
|
|
110
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
111
|
+
fill: "none",
|
|
112
|
+
viewBox: "0 0 24 24",
|
|
113
|
+
stroke: "currentColor"
|
|
114
|
+
}, [
|
|
115
|
+
s("path", {
|
|
116
|
+
"stroke-linecap": "round",
|
|
117
|
+
"stroke-linejoin": "round",
|
|
118
|
+
"stroke-width": "2",
|
|
119
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
120
|
+
})
|
|
121
|
+
]);
|
|
122
|
+
}
|
|
123
|
+
}, I = c(() => ({
|
|
124
|
+
info: h,
|
|
125
|
+
success: B,
|
|
126
|
+
warning: M,
|
|
127
|
+
error: w,
|
|
128
|
+
default: h,
|
|
129
|
+
danger: w
|
|
130
|
+
})[n.variant]), j = E(
|
|
131
|
+
"relative w-full rounded-lg border p-4 flex items-start gap-3 ",
|
|
132
|
+
{
|
|
133
|
+
variants: {
|
|
134
|
+
variant: {
|
|
135
|
+
default: "ui-surface ui-text ",
|
|
136
|
+
danger: "ui-danger-soft ui-danger",
|
|
137
|
+
info: "ui-primary-soft ui-primary",
|
|
138
|
+
success: "ui-success-soft ui-success",
|
|
139
|
+
warning: "ui-warning-soft ui-warning",
|
|
140
|
+
error: "ui-danger-soft ui-danger"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
defaultVariants: { variant: "default" }
|
|
144
|
+
}
|
|
145
|
+
), L = c(() => ["w-5 h-5", {
|
|
146
|
+
info: "ui-primary",
|
|
147
|
+
success: "ui-success",
|
|
148
|
+
warning: "ui-warning",
|
|
149
|
+
error: "ui-danger",
|
|
150
|
+
default: "ui-text",
|
|
151
|
+
danger: "ui-danger"
|
|
152
|
+
}[n.variant]]), S = c(() => ["shrink-0 p-1 rounded-md transition-colors duration-200", {
|
|
153
|
+
info: "ui-primary hover:text-(--ui-primary) hover:bg-(--ui-primary-soft)",
|
|
154
|
+
success: "ui-success hover:text-(--ui-success) hover:bg-(--ui-success-soft)",
|
|
155
|
+
warning: "ui-warning hover:text-(--ui-warning) hover:bg-(--ui-warning-soft)",
|
|
156
|
+
error: "ui-danger hover:text-(--ui-danger) hover:bg-(--ui-danger-soft)",
|
|
157
|
+
default: "ui-text hover:text-(--ui-text) hover:bg-(--ui-surface)",
|
|
158
|
+
danger: "ui-danger hover:text-(--ui-danger) hover:bg-(--ui-danger-soft)"
|
|
159
|
+
}[n.variant]]);
|
|
160
|
+
return (t, P) => (r(), u($, {
|
|
161
|
+
"enter-active-class": "transition-all duration-300",
|
|
162
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
163
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
164
|
+
"leave-active-class": "transition-all duration-200",
|
|
165
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
166
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
167
|
+
}, {
|
|
168
|
+
default: k(() => [
|
|
169
|
+
g.value ? (r(), o("div", {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: l(p(X)(p(j)({ variant: e.variant }), t.$attrs.class)),
|
|
172
|
+
role: "alert"
|
|
173
|
+
}, [
|
|
174
|
+
d("div", O, [
|
|
175
|
+
e.showIcon ? (r(), o("div", q, [
|
|
176
|
+
(r(), u(A(I.value), {
|
|
177
|
+
class: l(L.value)
|
|
178
|
+
}, null, 8, ["class"]))
|
|
179
|
+
])) : a("", !0),
|
|
180
|
+
d("div", G, [
|
|
181
|
+
e.title ? (r(), o("h4", H, m(e.title), 1)) : a("", !0),
|
|
182
|
+
d("div", {
|
|
183
|
+
class: l(["text-sm", { "mt-0": !e.title, "mt-1": e.title }])
|
|
184
|
+
}, [
|
|
185
|
+
x(t.$slots, "default", {}, () => [
|
|
186
|
+
y(m(e.message), 1)
|
|
187
|
+
])
|
|
188
|
+
], 2),
|
|
189
|
+
t.$slots.actions || e.actions.length > 0 ? (r(), o("div", J, [
|
|
190
|
+
x(t.$slots, "actions", {}, () => [
|
|
191
|
+
(r(!0), o(N, null, D(e.actions, (i) => (r(), u(F, {
|
|
192
|
+
key: i.label,
|
|
193
|
+
variant: i.variant || "outline",
|
|
194
|
+
size: i.size || "sm",
|
|
195
|
+
onClick: (Q) => b(i)
|
|
196
|
+
}, {
|
|
197
|
+
default: k(() => [
|
|
198
|
+
y(m(i.label), 1)
|
|
199
|
+
]),
|
|
200
|
+
_: 2
|
|
201
|
+
}, 1032, ["variant", "size", "onClick"]))), 128))
|
|
202
|
+
])
|
|
203
|
+
])) : a("", !0)
|
|
204
|
+
]),
|
|
205
|
+
e.dismissible ? (r(), o("button", {
|
|
206
|
+
key: 1,
|
|
207
|
+
class: l(S.value),
|
|
208
|
+
"aria-label": e.dismissLabel,
|
|
209
|
+
onClick: v
|
|
210
|
+
}, [
|
|
211
|
+
T(z, { class: "w-4 h-4" })
|
|
212
|
+
], 10, K)) : a("", !0)
|
|
213
|
+
])
|
|
214
|
+
], 2)) : a("", !0)
|
|
215
|
+
]),
|
|
216
|
+
_: 3
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
export {
|
|
221
|
+
Z as default
|
|
222
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("class-variance-authority"),l=require("../utils/cn.cjs"),m=require("./Icon.cjs"),f=["src","alt"],g={__name:"Avatar",props:{src:String,alt:String,initials:String,size:{type:String,default:"md",validator:s=>["xs","sm","md","lg","xl"].includes(s)},variant:{type:String,default:"default",validator:s=>["default","outline"].includes(s)},class:String},setup(s){const t=s,a=e.ref(!1),r=d.cva("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12",xl:"h-16 w-16"},variant:{default:"bg-muted",outline:"border-2 ui-border-strong ui-surface "}}}),n=e.computed(()=>l.cn(r({size:t.size,variant:t.variant}),t.class)),i=e.computed(()=>"aspect-square h-full w-full object-cover"),c=e.computed(()=>l.cn("flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",{"text-xs":t.size==="xs","text-sm":t.size==="sm","text-base":t.size==="md","text-lg":t.size==="lg","text-xl":t.size==="xl"})),o=e.computed(()=>l.cn("h-4 w-4 text-muted-foreground",{"h-3 w-3":t.size==="xs","h-4 w-4":t.size==="sm"||t.size==="md","h-5 w-5":t.size==="lg","h-6 w-6":t.size==="xl"})),u=()=>{a.value=!0};return(v,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(n.value)},[s.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.src,alt:s.alt,class:e.normalizeClass(i.value),onError:u},null,42,f)):s.initials?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(c.value)},e.toDisplayString(s.initials),3)):(e.openBlock(),e.createBlock(m.default,{key:2,name:"user",class:e.normalizeClass(o.value)},null,8,["class"]))],2))}};exports.default=g;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ref as g, computed as t, createElementBlock as i, openBlock as a, normalizeClass as l, createBlock as x, toDisplayString as v } from "vue";
|
|
2
|
+
import { cva as h } from "class-variance-authority";
|
|
3
|
+
import { cn as r } from "../utils/cn.js";
|
|
4
|
+
import z from "./Icon.js";
|
|
5
|
+
const w = ["src", "alt"], E = {
|
|
6
|
+
__name: "Avatar",
|
|
7
|
+
props: {
|
|
8
|
+
src: String,
|
|
9
|
+
alt: String,
|
|
10
|
+
initials: String,
|
|
11
|
+
size: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "md",
|
|
14
|
+
validator: (s) => ["xs", "sm", "md", "lg", "xl"].includes(s)
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "default",
|
|
19
|
+
validator: (s) => ["default", "outline"].includes(s)
|
|
20
|
+
},
|
|
21
|
+
class: String
|
|
22
|
+
},
|
|
23
|
+
setup(s) {
|
|
24
|
+
const e = s, n = g(!1), o = h(
|
|
25
|
+
"relative flex shrink-0 overflow-hidden rounded-full",
|
|
26
|
+
{
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
xs: "h-6 w-6",
|
|
30
|
+
sm: "h-8 w-8",
|
|
31
|
+
md: "h-10 w-10",
|
|
32
|
+
lg: "h-12 w-12",
|
|
33
|
+
xl: "h-16 w-16"
|
|
34
|
+
},
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-muted",
|
|
37
|
+
outline: "border-2 ui-border-strong ui-surface "
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
), c = t(
|
|
42
|
+
() => r(o({ size: e.size, variant: e.variant }), e.class)
|
|
43
|
+
), u = t(() => "aspect-square h-full w-full object-cover"), m = t(
|
|
44
|
+
() => r(
|
|
45
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",
|
|
46
|
+
{
|
|
47
|
+
"text-xs": e.size === "xs",
|
|
48
|
+
"text-sm": e.size === "sm",
|
|
49
|
+
"text-base": e.size === "md",
|
|
50
|
+
"text-lg": e.size === "lg",
|
|
51
|
+
"text-xl": e.size === "xl"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
), d = t(
|
|
55
|
+
() => r("h-4 w-4 text-muted-foreground", {
|
|
56
|
+
"h-3 w-3": e.size === "xs",
|
|
57
|
+
"h-4 w-4": e.size === "sm" || e.size === "md",
|
|
58
|
+
"h-5 w-5": e.size === "lg",
|
|
59
|
+
"h-6 w-6": e.size === "xl"
|
|
60
|
+
})
|
|
61
|
+
), f = () => {
|
|
62
|
+
n.value = !0;
|
|
63
|
+
};
|
|
64
|
+
return (k, p) => (a(), i("div", {
|
|
65
|
+
class: l(c.value)
|
|
66
|
+
}, [
|
|
67
|
+
s.src ? (a(), i("img", {
|
|
68
|
+
key: 0,
|
|
69
|
+
src: s.src,
|
|
70
|
+
alt: s.alt,
|
|
71
|
+
class: l(u.value),
|
|
72
|
+
onError: f
|
|
73
|
+
}, null, 42, w)) : s.initials ? (a(), i("span", {
|
|
74
|
+
key: 1,
|
|
75
|
+
class: l(m.value)
|
|
76
|
+
}, v(s.initials), 3)) : (a(), x(z, {
|
|
77
|
+
key: 2,
|
|
78
|
+
name: "user",
|
|
79
|
+
class: l(d.value)
|
|
80
|
+
}, null, 8, ["class"]))
|
|
81
|
+
], 2));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
E as default
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),d=require("class-variance-authority"),l=require("../utils/cn.cjs"),c=require("./Icon.cjs"),m=["aria-label"],b=Object.assign({inheritAttrs:!1},{__name:"Badge",props:{variant:{type:String,default:"default",validator:e=>["default","secondary","danger","primary","outline","success","warning","info","ghost","link","subtle","dark","light","primaryOutline","dangerOutline","successOutline","gradient"].includes(e)},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},shape:{type:String,default:"rounded",validator:e=>["rounded","pill","square"].includes(e)},icon:{type:[String,Object],default:null},dismissible:{type:Boolean,default:!1},dismissLabel:{type:String,default:"Dismiss"}},emits:["dismiss"],setup(e,{emit:t}){const a=e,s=t,o=()=>s("dismiss"),u=d.cva("inline-flex items-center font-medium border transition-all duration-200",{variants:{variant:{default:"border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",secondary:"border ui-border-strong ui-surface-muted ui-text hover:bg-(--ui-surface) dark:border-(--ui-border-strong) dark:bg-(--ui-surface) dark:text-(--ui-text)",danger:"border border-(--ui-danger-soft) ui-danger-soft ui-danger hover:bg-(--ui-danger-soft) dark:border-(--ui-danger-soft) dark:bg-(--ui-danger-soft) dark:text-(--ui-danger)",primary:"border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",outline:"ui-text border",success:"border border-(--ui-success-soft) ui-success-soft ui-success dark:border-(--ui-success-soft) dark:bg-(--ui-success-soft) dark:text-(--ui-success)",warning:"border border-(--ui-warning-soft) ui-warning-soft ui-warning hover:bg-(--ui-warning-soft) dark:border-(--ui-warning-soft) dark:bg-(--ui-warning-soft) dark:text-(--ui-warning)",info:"border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",ghost:"bg-transparent ui-text hover:bg-(--ui-surface)",link:"ui-primary hover:underline",subtle:"ui-surface-muted ui-text hover:bg-(--ui-bg)",dark:"ui-bg ui-text hover:bg-(--ui-bg)",light:"ui-surface-muted ui-text border ui-border-strong hover:bg-(--ui-surface)",primaryOutline:"border border-(--ui-primary) ui-primary bg-transparent hover:bg-(--ui-primary-soft)",dangerOutline:"border border-(--ui-danger) ui-danger bg-transparent hover:bg-(--ui-danger-soft)",successOutline:"border border-(--ui-success) ui-success bg-transparent hover:bg-(--ui-success-soft)",gradient:"bg-linear-to-r from-(--ui-primary-soft) to-(--ui-accent) ui-text hover:from-(--ui-primary) hover:to-(--ui-accent)"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},shape:{rounded:"rounded-md",pill:"rounded-full",square:"rounded-none"}},defaultVariants:{variant:"default",size:"md",shape:"rounded"}}),n=r.computed(()=>["mr-1",{sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"}[a.size]]);return(i,g)=>(r.openBlock(),r.createElementBlock("span",{class:r.normalizeClass(r.unref(l.cn)(r.unref(u)({variant:e.variant,size:e.size,shape:e.shape}),i.$attrs.class))},[e.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.icon),{key:0,class:r.normalizeClass(n.value)},null,8,["class"])):r.createCommentVNode("",!0),r.renderSlot(i.$slots,"default"),e.dismissible?(r.openBlock(),r.createElementBlock("button",{key:1,class:"ml-1 hover:bg-[color:color-mix(in oklab, var(--ui-bg), transparent 90%)] rounded-full p-0.5 transition-colors","aria-label":e.dismissLabel,onClick:o},[r.createVNode(c.default,{icon:"circle-xmark",class:"w-3 h-3"})],8,m)):r.createCommentVNode("",!0)],2))}});exports.default=b;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { computed as b, createElementBlock as t, openBlock as i, normalizeClass as a, unref as s, createBlock as g, createCommentVNode as o, renderSlot as f, resolveDynamicComponent as p, createVNode as y } from "vue";
|
|
2
|
+
import { cva as h } from "class-variance-authority";
|
|
3
|
+
import { cn as k } from "../utils/cn.js";
|
|
4
|
+
import v from "./Icon.js";
|
|
5
|
+
const x = ["aria-label"], C = /* @__PURE__ */ Object.assign({
|
|
6
|
+
inheritAttrs: !1
|
|
7
|
+
}, {
|
|
8
|
+
__name: "Badge",
|
|
9
|
+
props: {
|
|
10
|
+
variant: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "default",
|
|
13
|
+
validator: (r) => ["default", "secondary", "danger", "primary", "outline", "success", "warning", "info", "ghost", "link", "subtle", "dark", "light", "primaryOutline", "dangerOutline", "successOutline", "gradient"].includes(r)
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "md",
|
|
18
|
+
validator: (r) => ["sm", "md", "lg"].includes(r)
|
|
19
|
+
},
|
|
20
|
+
shape: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "rounded",
|
|
23
|
+
validator: (r) => ["rounded", "pill", "square"].includes(r)
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
type: [String, Object],
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
dismissible: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
dismissLabel: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "Dismiss"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["dismiss"],
|
|
39
|
+
setup(r, { emit: u }) {
|
|
40
|
+
const n = r, d = u, l = () => d("dismiss"), c = h(
|
|
41
|
+
"inline-flex items-center font-medium border transition-all duration-200",
|
|
42
|
+
{
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",
|
|
46
|
+
secondary: "border ui-border-strong ui-surface-muted ui-text hover:bg-(--ui-surface) dark:border-(--ui-border-strong) dark:bg-(--ui-surface) dark:text-(--ui-text)",
|
|
47
|
+
danger: "border border-(--ui-danger-soft) ui-danger-soft ui-danger hover:bg-(--ui-danger-soft) dark:border-(--ui-danger-soft) dark:bg-(--ui-danger-soft) dark:text-(--ui-danger)",
|
|
48
|
+
primary: "border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",
|
|
49
|
+
outline: "ui-text border",
|
|
50
|
+
success: "border border-(--ui-success-soft) ui-success-soft ui-success dark:border-(--ui-success-soft) dark:bg-(--ui-success-soft) dark:text-(--ui-success)",
|
|
51
|
+
warning: "border border-(--ui-warning-soft) ui-warning-soft ui-warning hover:bg-(--ui-warning-soft) dark:border-(--ui-warning-soft) dark:bg-(--ui-warning-soft) dark:text-(--ui-warning)",
|
|
52
|
+
info: "border border-(--ui-primary-soft) ui-primary-soft ui-primary hover:bg-(--ui-primary-soft) dark:border-(--ui-primary-soft) dark:bg-(--ui-primary-soft) dark:text-(--ui-primary)",
|
|
53
|
+
ghost: "bg-transparent ui-text hover:bg-(--ui-surface)",
|
|
54
|
+
link: "ui-primary hover:underline",
|
|
55
|
+
subtle: "ui-surface-muted ui-text hover:bg-(--ui-bg)",
|
|
56
|
+
dark: "ui-bg ui-text hover:bg-(--ui-bg)",
|
|
57
|
+
light: "ui-surface-muted ui-text border ui-border-strong hover:bg-(--ui-surface)",
|
|
58
|
+
primaryOutline: "border border-(--ui-primary) ui-primary bg-transparent hover:bg-(--ui-primary-soft)",
|
|
59
|
+
dangerOutline: "border border-(--ui-danger) ui-danger bg-transparent hover:bg-(--ui-danger-soft)",
|
|
60
|
+
successOutline: "border border-(--ui-success) ui-success bg-transparent hover:bg-(--ui-success-soft)",
|
|
61
|
+
gradient: "bg-linear-to-r from-(--ui-primary-soft) to-(--ui-accent) ui-text hover:from-(--ui-primary) hover:to-(--ui-accent)"
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
sm: "px-2 py-0.5 text-xs",
|
|
65
|
+
md: "px-2.5 py-1 text-sm",
|
|
66
|
+
lg: "px-3 py-1.5 text-base"
|
|
67
|
+
},
|
|
68
|
+
shape: {
|
|
69
|
+
rounded: "rounded-md",
|
|
70
|
+
pill: "rounded-full",
|
|
71
|
+
square: "rounded-none"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
variant: "default",
|
|
76
|
+
size: "md",
|
|
77
|
+
shape: "rounded"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
), m = b(() => ["mr-1", {
|
|
81
|
+
sm: "w-3 h-3",
|
|
82
|
+
md: "w-4 h-4",
|
|
83
|
+
lg: "w-5 h-5"
|
|
84
|
+
}[n.size]]);
|
|
85
|
+
return (e, w) => (i(), t("span", {
|
|
86
|
+
class: a(s(k)(s(c)({ variant: r.variant, size: r.size, shape: r.shape }), e.$attrs.class))
|
|
87
|
+
}, [
|
|
88
|
+
r.icon ? (i(), g(p(r.icon), {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: a(m.value)
|
|
91
|
+
}, null, 8, ["class"])) : o("", !0),
|
|
92
|
+
f(e.$slots, "default"),
|
|
93
|
+
r.dismissible ? (i(), t("button", {
|
|
94
|
+
key: 1,
|
|
95
|
+
class: "ml-1 hover:bg-[color:color-mix(in oklab, var(--ui-bg), transparent 90%)] rounded-full p-0.5 transition-colors",
|
|
96
|
+
"aria-label": r.dismissLabel,
|
|
97
|
+
onClick: l
|
|
98
|
+
}, [
|
|
99
|
+
y(v, {
|
|
100
|
+
icon: "circle-xmark",
|
|
101
|
+
class: "w-3 h-3"
|
|
102
|
+
})
|
|
103
|
+
], 8, x)) : o("", !0)
|
|
104
|
+
], 2));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
export {
|
|
108
|
+
C as default
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("class-variance-authority"),s=require("../utils/cn.cjs"),i=require("./Icon.cjs"),u=["aria-label"],m={class:"flex items-center space-x-1"},d={__name:"Breadcrumb",props:{items:{type:Array,required:!0,validator:t=>t.every(r=>r.label)},separator:{type:String,default:"chevron-right"},ariaLabel:{type:String,default:"Breadcrumb navigation"},variant:{type:String,default:"default",validator:t=>["default","ghost"].includes(t)}},setup(t){const r=t,l=c.cva("",{variants:{variant:{default:"",ghost:"text-muted-foreground"}}}),o=e.computed(()=>s.cn(l({variant:r.variant})));return(f,h)=>(e.openBlock(),e.createElementBlock("nav",{"aria-label":t.ariaLabel,class:e.normalizeClass(["flex",o.value])},[e.createElementVNode("ol",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,a)=>(e.openBlock(),e.createElementBlock("li",{key:a,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.href?"a":"span"),{href:n.href,class:e.normalizeClass(["text-sm font-medium transition-colors hover:text-(--ui-text)",a===t.items.length-1?"ui-text":"ui-text hover:text-(--ui-text)"]),"aria-current":a===t.items.length-1?"page":void 0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.label),1)]),_:2},1032,["href","class","aria-current"])),a<t.items.length-1?(e.openBlock(),e.createBlock(i.default,{key:0,name:t.separator,class:"mx-2 h-4 w-4 text-muted-foreground"},null,8,["name"])):e.createCommentVNode("",!0)]))),128))])],10,u))}};exports.default=d;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { computed as m, createElementBlock as l, openBlock as t, normalizeClass as i, createElementVNode as u, Fragment as d, renderList as f, createBlock as s, createCommentVNode as h, resolveDynamicComponent as v, withCtx as g, createTextVNode as x, toDisplayString as b } from "vue";
|
|
2
|
+
import { cva as p } from "class-variance-authority";
|
|
3
|
+
import { cn as y } from "../utils/cn.js";
|
|
4
|
+
import k from "./Icon.js";
|
|
5
|
+
const B = ["aria-label"], C = { class: "flex items-center space-x-1" }, E = {
|
|
6
|
+
__name: "Breadcrumb",
|
|
7
|
+
props: {
|
|
8
|
+
items: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: !0,
|
|
11
|
+
validator: (e) => e.every((r) => r.label)
|
|
12
|
+
},
|
|
13
|
+
separator: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "chevron-right"
|
|
16
|
+
},
|
|
17
|
+
ariaLabel: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "Breadcrumb navigation"
|
|
20
|
+
},
|
|
21
|
+
variant: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "default",
|
|
24
|
+
validator: (e) => ["default", "ghost"].includes(e)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(e) {
|
|
28
|
+
const r = e, o = p("", {
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
default: "",
|
|
32
|
+
ghost: "text-muted-foreground"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}), c = m(
|
|
36
|
+
() => y(o({ variant: r.variant }))
|
|
37
|
+
);
|
|
38
|
+
return (S, V) => (t(), l("nav", {
|
|
39
|
+
"aria-label": e.ariaLabel,
|
|
40
|
+
class: i(["flex", c.value])
|
|
41
|
+
}, [
|
|
42
|
+
u("ol", C, [
|
|
43
|
+
(t(!0), l(d, null, f(e.items, (n, a) => (t(), l("li", {
|
|
44
|
+
key: a,
|
|
45
|
+
class: "flex items-center"
|
|
46
|
+
}, [
|
|
47
|
+
(t(), s(v(n.href ? "a" : "span"), {
|
|
48
|
+
href: n.href,
|
|
49
|
+
class: i([
|
|
50
|
+
"text-sm font-medium transition-colors hover:text-(--ui-text)",
|
|
51
|
+
a === e.items.length - 1 ? "ui-text" : "ui-text hover:text-(--ui-text)"
|
|
52
|
+
]),
|
|
53
|
+
"aria-current": a === e.items.length - 1 ? "page" : void 0
|
|
54
|
+
}, {
|
|
55
|
+
default: g(() => [
|
|
56
|
+
x(b(n.label), 1)
|
|
57
|
+
]),
|
|
58
|
+
_: 2
|
|
59
|
+
}, 1032, ["href", "class", "aria-current"])),
|
|
60
|
+
a < e.items.length - 1 ? (t(), s(k, {
|
|
61
|
+
key: 0,
|
|
62
|
+
name: e.separator,
|
|
63
|
+
class: "mx-2 h-4 w-4 text-muted-foreground"
|
|
64
|
+
}, null, 8, ["name"])) : h("", !0)
|
|
65
|
+
]))), 128))
|
|
66
|
+
])
|
|
67
|
+
], 10, B));
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
E as default
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("class-variance-authority"),b=require("../utils/cn.cjs"),p=require("./Icon.cjs"),f=require("../lib/auth.cjs"),v=["disabled","aria-disabled","aria-busy"],w={key:2},y=Object.assign({inheritAttrs:!1},{__name:"Button",props:{variant:{type:String,default:"default",validator:t=>["primary","default","danger","outline","secondary","ghost","link","success","warning","info","subtle","dark","light","primaryOutline","dangerOutline","successOutline","gradient"].includes(t)},size:{type:String,default:"default",validator:t=>["2xs","xs","sm","default","md","lg","xl","2xl","icon-sm","icon","icon-lg"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{type:String,default:null},icon:{type:String,default:null},permission:{type:[String,Array,Boolean,Function],default:null},role:{type:[String,Array,Boolean,Function],default:null},requireAll:{type:Boolean,default:!1},unauthorized:{type:String,default:"show",validator:t=>["show","hide","disable"].includes(t)}},setup(t){const o=t,i=e.inject(f.AUTH_RESOLVER_KEY,null),s=r=>r==null?null:typeof r=="boolean"?r:typeof r=="function"?!!r():r,a=e.computed(()=>{const r=s(o.permission),n=s(o.role);return r===null&&n===null?!0:(r===null||typeof r=="boolean")&&(n===null||typeof n=="boolean")?(r??!0)&&(n??!0):typeof i=="function"?!!i({permission:r,role:n,requireAll:o.requireAll}):!0}),l=e.computed(()=>o.unauthorized==="hide"&&!a.value),d=e.computed(()=>o.unauthorized==="disable"&&!a.value),u=e.computed(()=>o.disabled||o.loading||d.value),c=m.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ui-primary) focus-visible:ring-offset-2 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{primary:"ui-primary-bg shadow-sm hover:bg-(--ui-primary-strong) hover:shadow-md",default:"ui-primary-bg shadow-sm hover:bg-(--ui-primary-strong) hover:shadow-md",danger:"ui-danger-bg shadow-sm hover:bg-(--ui-danger-strong) hover:shadow-md",outline:"border ui-border-strong ui-surface ui-text hover:bg-(--ui-surface-soft) hover:border-(--ui-primary) hover:text-(--ui-primary)",secondary:"border ui-border ui-surface-muted ui-text hover:bg-(--ui-surface-soft) hover:shadow-sm",ghost:"bg-transparent ui-text-muted hover:bg-[color:color-mix(in oklab, var(--ui-accent-soft), transparent 40%)] hover:text-(--ui-text)",link:"ui-primary underline-offset-4 hover:underline hover:text-(--ui-primary-strong)",success:"ui-success-bg shadow-sm hover:bg-(--ui-success-strong) hover:shadow-md",warning:"ui-warning-bg shadow-sm hover:bg-(--ui-warning-strong) hover:shadow-md",info:"border border-blue-600 bg-blue-600 text-white shadow-sm hover:bg-blue-700 hover:shadow-md dark:border-blue-500 dark:bg-blue-500 dark:text-white dark:hover:bg-blue-400",subtle:"border ui-border ui-surface ui-text-muted hover:text-(--ui-text) hover:bg-(--ui-surface-soft)",dark:"border border-zinc-900 bg-zinc-900 text-white shadow-sm hover:bg-black hover:shadow-md dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white",light:"border border-zinc-200 bg-white text-zinc-900 shadow-sm hover:bg-zinc-50 hover:shadow-md dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:bg-zinc-800",primaryOutline:"border border-(--ui-primary) ui-primary bg-transparent hover:bg-(--ui-primary-soft) hover:border-(--ui-primary-strong) hover:text-(--ui-primary-strong)",dangerOutline:"border border-(--ui-danger) ui-danger bg-transparent hover:bg-(--ui-danger-soft) hover:border-(--ui-danger-strong) hover:text-(--ui-danger-strong)",successOutline:"border border-(--ui-success) ui-success bg-transparent hover:bg-(--ui-success-soft) hover:border-(--ui-success-strong) hover:text-(--ui-success-strong)",gradient:"bg-linear-to-r from-(--ui-primary) to-(--ui-accent) ui-text-inverse shadow-sm hover:from-(--ui-primary-strong) hover:to-(--ui-accent-strong) hover:shadow-md"},size:{"2xs":"h-4 px-1 py-3 text-md rounded",xs:"h-7 px-2.5 py-1 text-xs rounded-md",sm:"h-8 px-3 py-1.5 text-sm rounded-md",default:"h-9 px-4 py-2 text-sm rounded-md",md:"h-10 px-4 py-2 text-sm rounded-md",lg:"h-11 px-6 py-2.5 text-base rounded-md",xl:"h-12 px-8 py-3 text-base rounded-lg","2xl":"h-14 px-10 py-3.5 text-lg rounded-lg","icon-sm":"h-8 w-8 p-0",icon:"h-10 w-10 p-0","icon-lg":"h-12 w-12 p-0"}},defaultVariants:{variant:"default",size:"default"}}),h=e.computed(()=>({"2xs":"h-3 w-3",xs:"h-3.5 w-3.5",sm:"h-4 w-4",default:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-5 w-5","2xl":"h-6 w-6","icon-sm":"h-4 w-4",icon:"h-5 w-5","icon-lg":"h-6 w-6"})[o.size]||"h-4 w-4"),g=e.computed(()=>({"2xs":"h-3 w-3",xs:"h-3.5 w-3.5",sm:"h-4 w-4",default:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-5 w-5","2xl":"h-6 w-6","icon-sm":"h-4 w-4",icon:"h-5 w-5","icon-lg":"h-6 w-6"})[o.size]||"h-4 w-4");return(r,n)=>l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:0,class:e.unref(b.cn)(e.unref(c)({variant:t.variant,size:t.size}),r.$attrs.class),disabled:u.value,"aria-disabled":u.value,"aria-busy":t.loading},r.$attrs),[t.loading?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass([g.value,"animate-spin mr-2 text-current"]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-width":"4",d:"M4 12a8 8 0 018-8"},null,-1)])],2)):e.createCommentVNode("",!0),t.icon&&!t.loading?(e.openBlock(),e.createBlock(p.default,{key:1,icon:t.icon,class:e.normalizeClass(h.value)},null,8,["icon","class"])):e.createCommentVNode("",!0),t.loading&&t.loadingText?(e.openBlock(),e.createElementBlock("span",w,e.toDisplayString(t.loadingText),1)):e.renderSlot(r.$slots,"default",{key:3})],16,v))}});exports.default=y;
|