@gspa/ui 0.1.3 → 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 +311 -19548
- 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/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +37 -7
- package/dist/index.js +0 -605
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ref as x, computed as o, useId as h, watch as z, nextTick as u, createElementBlock as w, openBlock as B, normalizeClass as k } from "vue";
|
|
2
|
+
import { cva as R } from "class-variance-authority";
|
|
3
|
+
import { cn as S } from "../utils/cn.js";
|
|
4
|
+
const V = ["id", "value", "placeholder", "disabled", "readonly", "required", "rows", "maxlength", "aria-describedby", "aria-invalid"], E = {
|
|
5
|
+
__name: "Textarea",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { type: String, default: "" },
|
|
8
|
+
placeholder: { type: String, default: "" },
|
|
9
|
+
disabled: { type: Boolean, default: !1 },
|
|
10
|
+
readonly: { type: Boolean, default: !1 },
|
|
11
|
+
required: { type: Boolean, default: !1 },
|
|
12
|
+
rows: { type: Number, default: 3 },
|
|
13
|
+
maxlength: { type: Number, default: null },
|
|
14
|
+
resize: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "vertical",
|
|
17
|
+
validator: (e) => ["none", "vertical", "horizontal", "both"].includes(e)
|
|
18
|
+
},
|
|
19
|
+
autoResize: { type: Boolean, default: !1 },
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "md",
|
|
23
|
+
validator: (e) => ["sm", "md", "lg"].includes(e)
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "default",
|
|
28
|
+
validator: (e) => ["default", "error", "success"].includes(e)
|
|
29
|
+
},
|
|
30
|
+
error: { type: String, default: null },
|
|
31
|
+
id: { type: String, default: null }
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue", "blur", "focus", "keydown"],
|
|
34
|
+
setup(e, { expose: n, emit: d }) {
|
|
35
|
+
const t = e, l = d, r = x(null), s = o(() => t.id || h()), c = (a) => {
|
|
36
|
+
l("update:modelValue", a.target.value), t.autoResize && u(() => i());
|
|
37
|
+
}, f = (a) => l("blur", a), m = (a) => l("focus", a), y = (a) => l("keydown", a), b = o(() => !!t.error || t.variant === "error"), v = o(
|
|
38
|
+
() => t.error ? `${s.value}-error` : void 0
|
|
39
|
+
), p = R(
|
|
40
|
+
"block w-full rounded-lg border ui-surface transition-colors duration-200 placeholder:text-(--ui-text-muted) focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:bg-(--ui-surface) disabled:text-(--ui-text) disabled:cursor-not-allowed",
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
size: {
|
|
44
|
+
sm: "px-3 py-1.5 text-sm",
|
|
45
|
+
md: "px-3 py-2 text-sm",
|
|
46
|
+
lg: "px-4 py-3 text-base"
|
|
47
|
+
},
|
|
48
|
+
variant: {
|
|
49
|
+
default: "ui-border-strong focus:border-(--ui-primary) focus:ring-(--ui-primary)",
|
|
50
|
+
error: "border-(--ui-danger-soft) focus:border-(--ui-danger) focus:ring-(--ui-danger)",
|
|
51
|
+
success: "border-(--ui-success-soft) focus:border-(--ui-success) focus:ring-(--ui-success)"
|
|
52
|
+
},
|
|
53
|
+
resize: {
|
|
54
|
+
none: "resize-none",
|
|
55
|
+
vertical: "resize-y",
|
|
56
|
+
horizontal: "resize-x",
|
|
57
|
+
both: "resize"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
size: "md",
|
|
62
|
+
variant: "default",
|
|
63
|
+
resize: "vertical"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
), g = o(
|
|
67
|
+
() => S(p({ size: t.size, variant: t.variant, resize: t.resize }))
|
|
68
|
+
), i = () => {
|
|
69
|
+
if (!r.value || !t.autoResize) return;
|
|
70
|
+
const a = r.value;
|
|
71
|
+
a.style.height = "auto", a.style.height = `${a.scrollHeight}px`;
|
|
72
|
+
};
|
|
73
|
+
return z(() => t.modelValue, () => {
|
|
74
|
+
t.autoResize && u(() => i());
|
|
75
|
+
}, { immediate: !0 }), n({
|
|
76
|
+
focus: () => r.value?.focus(),
|
|
77
|
+
blur: () => r.value?.blur(),
|
|
78
|
+
select: () => r.value?.select()
|
|
79
|
+
}), (a, q) => (B(), w("textarea", {
|
|
80
|
+
id: s.value,
|
|
81
|
+
ref_key: "textareaRef",
|
|
82
|
+
ref: r,
|
|
83
|
+
value: e.modelValue,
|
|
84
|
+
placeholder: e.placeholder,
|
|
85
|
+
disabled: e.disabled,
|
|
86
|
+
readonly: e.readonly,
|
|
87
|
+
required: e.required,
|
|
88
|
+
rows: e.rows,
|
|
89
|
+
maxlength: e.maxlength,
|
|
90
|
+
class: k(g.value),
|
|
91
|
+
"aria-describedby": v.value,
|
|
92
|
+
"aria-invalid": b.value,
|
|
93
|
+
onInput: c,
|
|
94
|
+
onBlur: f,
|
|
95
|
+
onFocus: m,
|
|
96
|
+
onKeydown: y
|
|
97
|
+
}, null, 42, V));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
E as default
|
|
102
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../lib/theme.cjs"),a=require("./Option.cjs"),d=require("./Select.cjs"),i={class:"ui-surface-strong fixed bottom-5 rounded-2xl right-5 z-50"},c={key:0,class:"mt-3 ui-sur w-72 rounded-2xl border ui-border-strong p-4 shadow-xl"},m={class:"mt-3 space-y-3"},p={class:"block text-xs font-medium ui-text"},f={__name:"ThemeConfigurator",setup(x){const u=["light","dark"],l=e.ref(!1),r=e.ref(n.getMode()||"light");return e.watch(r,s=>{n.setMode(s)}),(s,t)=>(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("button",{class:"rounded-full ui-text px-4 py-2 text-sm font-semibold shadow-sm hover:brightness-105",onClick:t[0]||(t[0]=o=>l.value=!l.value)}," Appearance "),l.value?(e.openBlock(),e.createElementBlock("div",c,[t[3]||(t[3]=e.createElementVNode("div",{class:"text-sm font-semibold ui-text"}," Appearance ",-1)),e.createElementVNode("div",m,[e.createElementVNode("label",p,[t[2]||(t[2]=e.createTextVNode(" Mode ",-1)),e.createVNode(d.default,{modelValue:r.value,"onUpdate:modelValue":t[1]||(t[1]=o=>r.value=o),class:"mt-1 w-full"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,o=>e.createVNode(a.default,{key:o,value:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])])])])):e.createCommentVNode("",!0)]))}};exports.default=f;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ref as d, watch as f, createElementBlock as l, openBlock as n, createElementVNode as o, createCommentVNode as p, createTextVNode as u, createVNode as i, withCtx as m, Fragment as x, renderList as _, toDisplayString as v } from "vue";
|
|
2
|
+
import { getMode as g, setMode as b } from "../lib/theme.js";
|
|
3
|
+
import h from "./Option.js";
|
|
4
|
+
import k from "./Select.js";
|
|
5
|
+
const V = { class: "ui-surface-strong fixed bottom-5 rounded-2xl right-5 z-50" }, w = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "mt-3 ui-sur w-72 rounded-2xl border ui-border-strong p-4 shadow-xl"
|
|
8
|
+
}, y = { class: "mt-3 space-y-3" }, C = { class: "block text-xs font-medium ui-text" }, E = {
|
|
9
|
+
__name: "ThemeConfigurator",
|
|
10
|
+
setup(M) {
|
|
11
|
+
const c = ["light", "dark"], s = d(!1), r = d(g() || "light");
|
|
12
|
+
return f(r, (a) => {
|
|
13
|
+
b(a);
|
|
14
|
+
}), (a, e) => (n(), l("div", V, [
|
|
15
|
+
o("button", {
|
|
16
|
+
class: "rounded-full ui-text px-4 py-2 text-sm font-semibold shadow-sm hover:brightness-105",
|
|
17
|
+
onClick: e[0] || (e[0] = (t) => s.value = !s.value)
|
|
18
|
+
}, " Appearance "),
|
|
19
|
+
s.value ? (n(), l("div", w, [
|
|
20
|
+
e[3] || (e[3] = o("div", { class: "text-sm font-semibold ui-text" }, " Appearance ", -1)),
|
|
21
|
+
o("div", y, [
|
|
22
|
+
o("label", C, [
|
|
23
|
+
e[2] || (e[2] = u(" Mode ", -1)),
|
|
24
|
+
i(k, {
|
|
25
|
+
modelValue: r.value,
|
|
26
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => r.value = t),
|
|
27
|
+
class: "mt-1 w-full"
|
|
28
|
+
}, {
|
|
29
|
+
default: m(() => [
|
|
30
|
+
(n(), l(x, null, _(c, (t) => i(h, {
|
|
31
|
+
key: t,
|
|
32
|
+
value: t
|
|
33
|
+
}, {
|
|
34
|
+
default: m(() => [
|
|
35
|
+
u(v(t), 1)
|
|
36
|
+
]),
|
|
37
|
+
_: 2
|
|
38
|
+
}, 1032, ["value"])), 64))
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 8, ["modelValue"])
|
|
42
|
+
])
|
|
43
|
+
])
|
|
44
|
+
])) : p("", !0)
|
|
45
|
+
]));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
E as default
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex ui-text",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(l.$slots,"default")],2))}};exports.default=r;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createElementBlock as l, openBlock as r, normalizeClass as a, renderSlot as o } from "vue";
|
|
2
|
+
const c = {
|
|
3
|
+
__name: "Timeline",
|
|
4
|
+
props: {
|
|
5
|
+
orientation: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: "vertical",
|
|
8
|
+
validator: (e) => ["vertical", "horizontal"].includes(e)
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
return (t, i) => (r(), l("div", {
|
|
13
|
+
class: a([
|
|
14
|
+
"relative flex ui-text",
|
|
15
|
+
e.orientation === "vertical" ? "flex-col" : "flex-row"
|
|
16
|
+
])
|
|
17
|
+
}, [
|
|
18
|
+
o(t.$slots, "default")
|
|
19
|
+
], 2));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
c as default
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r={key:0,class:"absolute left-3 top-0 w-0.5 h-full ui-bg"},o={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-(--ui-primary) ui-surface ui-primary"},s={class:"ui-text font-medium"},n={key:0,class:"ui-text text-sm"},a={class:"mt-2 ui-text text-sm"},c={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",r)):e.createCommentVNode("",!0),e.createElementVNode("div",o,[e.renderSlot(l.$slots,"icon",{},()=>[i[0]||(i[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full ui-primary-bg"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",s,[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",n,[e.renderSlot(l.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",a,[e.renderSlot(l.$slots,"default")])],2)],2))}};exports.default=c;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createElementBlock as s, openBlock as r, normalizeClass as a, createCommentVNode as n, createElementVNode as e, renderSlot as l, createTextVNode as u, toDisplayString as d } from "vue";
|
|
2
|
+
const c = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "absolute left-3 top-0 w-0.5 h-full ui-bg"
|
|
5
|
+
}, m = { class: "z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-(--ui-primary) ui-surface ui-primary" }, f = { class: "ui-text font-medium" }, v = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "ui-text text-sm"
|
|
8
|
+
}, b = { class: "mt-2 ui-text text-sm" }, x = {
|
|
9
|
+
__name: "TimelineItem",
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
subtitle: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
orientation: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "vertical",
|
|
22
|
+
validator: (t) => ["vertical", "horizontal"].includes(t)
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(t) {
|
|
26
|
+
return (i, o) => (r(), s("div", {
|
|
27
|
+
class: a([
|
|
28
|
+
"relative flex",
|
|
29
|
+
t.orientation === "vertical" ? "items-start mb-8 last:mb-0" : "flex-col items-center mx-8 last:mx-0"
|
|
30
|
+
])
|
|
31
|
+
}, [
|
|
32
|
+
t.orientation === "vertical" ? (r(), s("div", c)) : n("", !0),
|
|
33
|
+
e("div", m, [
|
|
34
|
+
l(i.$slots, "icon", {}, () => [
|
|
35
|
+
o[0] || (o[0] = e("div", { class: "w-2 h-2 rounded-full ui-primary-bg" }, null, -1))
|
|
36
|
+
])
|
|
37
|
+
]),
|
|
38
|
+
e("div", {
|
|
39
|
+
class: a([
|
|
40
|
+
"ml-6",
|
|
41
|
+
t.orientation === "horizontal" ? "mt-2 text-center" : ""
|
|
42
|
+
])
|
|
43
|
+
}, [
|
|
44
|
+
e("h3", f, [
|
|
45
|
+
l(i.$slots, "title", {}, () => [
|
|
46
|
+
u(d(t.title), 1)
|
|
47
|
+
])
|
|
48
|
+
]),
|
|
49
|
+
t.subtitle ? (r(), s("p", v, [
|
|
50
|
+
l(i.$slots, "subtitle", {}, () => [
|
|
51
|
+
u(d(t.subtitle), 1)
|
|
52
|
+
])
|
|
53
|
+
])) : n("", !0),
|
|
54
|
+
e("div", b, [
|
|
55
|
+
l(i.$slots, "default")
|
|
56
|
+
])
|
|
57
|
+
], 2)
|
|
58
|
+
], 2));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
x as default
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),S=require("class-variance-authority"),o=require("../utils/cn.cjs"),q=require("../lib/toast.cjs"),s=require("./Icon.cjs"),I=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["aria-live"],j={class:"flex-1 min-w-0 pt-0.5"},A=["onClick"],$=["onClick"],K={key:2,class:"absolute bottom-0 left-0 right-0 h-0.5 overflow-hidden"},L={__name:"Toast",props:{position:{type:String,default:"top-right",validator:i=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(i)},hotkey:{type:Array,default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!0},expand:{type:Boolean,default:!1},visibleToasts:{type:Number,default:3},closeButton:{type:Boolean,default:!0}},setup(i){const n=i,{toasts:p,dismiss:v}=q.useToaster(),x=e.computed(()=>p.value.slice(0,n.visibleToasts)),w={"top-left":"top-0 left-0 flex-col items-start","top-center":"top-0 left-1/2 -translate-x-1/2 flex-col items-center","top-right":"top-0 right-0 flex-col items-end","bottom-left":"bottom-0 left-0 flex-col-reverse items-start","bottom-center":"bottom-0 left-1/2 -translate-x-1/2 flex-col-reverse items-center","bottom-right":"bottom-0 right-0 flex-col-reverse items-end"},b=e.computed(()=>o.cn(w[n.position])),k=S.cva("group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border p-4 transition-all duration-200 hover:-translate-y-0.5",{variants:{variant:{default:"ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30",info:"border-blue-700 bg-blue-700 ui-text-inverse shadow-lg shadow-blue-900/25",success:"border-green-700 bg-green-700 ui-text-inverse shadow-lg shadow-green-900/25",warning:"border-amber-600 bg-amber-600 ui-text-inverse shadow-lg shadow-amber-900/25",error:"border-red-700 bg-red-700 ui-text-inverse shadow-lg shadow-red-900/25",loading:"ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30"}},defaultVariants:{variant:"default"}}),y=r=>o.cn(k({variant:r.variant})),l={default:"bell",info:"info",success:"check-circle",warning:"triangle-exclamation",error:"circle-xmark",loading:"loader-circle"},c={default:"ui-primary",info:"text-white",success:"text-white",warning:"text-white",error:"text-white",loading:"ui-primary"},u={default:"ui-surface-muted border ui-border",info:"bg-white/15 ring-1 ring-white/25",success:"bg-white/15 ring-1 ring-white/25",warning:"bg-white/15 ring-1 ring-white/25",error:"bg-white/15 ring-1 ring-white/25",loading:"ui-surface-muted border ui-border"},d={default:"bg-(--ui-primary)",info:"bg-white/70",success:"bg-white/70",warning:"bg-white/70",error:"bg-white/70",loading:"bg-(--ui-primary)"},h={default:"ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline",info:"text-white/90 hover:text-white underline-offset-4 hover:underline",success:"text-white/90 hover:text-white underline-offset-4 hover:underline",warning:"text-white/90 hover:text-white underline-offset-4 hover:underline",error:"text-white/90 hover:text-white underline-offset-4 hover:underline",loading:"ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline"},m={default:"ui-text",info:"text-white",success:"text-white",warning:"text-white",error:"text-white",loading:"ui-text"},f={default:"ui-text-muted",info:"text-white/90",success:"text-white/90",warning:"text-white/90",error:"text-white/90",loading:"ui-text-muted"},g={default:"ui-text-soft hover:bg-black/5 dark:hover:bg-white/10 hover:text-(--ui-text)",info:"text-white/80 hover:text-white hover:bg-white/15",success:"text-white/80 hover:text-white hover:bg-white/15",warning:"text-white/80 hover:text-white hover:bg-white/15",error:"text-white/80 hover:text-white hover:bg-white/15",loading:"ui-text hover:bg-black/5 dark:hover:bg-white/5 hover:text-(--ui-text)"},C=r=>r.icon||l[r.variant]||l.default,B=r=>{const a=c[r.variant]||c.default;return r.variant==="loading"?`${a} animate-spin`:a},_=r=>u[r.variant]||u.default,V=r=>d[r.variant]||d.default,N=r=>h[r.variant]||h.default,T=r=>m[r.variant]||m.default,z=r=>f[r.variant]||f.default,E=r=>g[r.variant]||g.default,M=r=>r.icon!==!1,D=r=>r.dismissible!==!1&&(r.closeButton||n.closeButton||r.dismissible);return(r,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.cn)(b.value,"fixed z-[10000] flex max-h-screen w-full p-4 md:max-w-[420px] pointer-events-none"))},[e.createVNode(e.TransitionGroup,{"enter-active-class":"transition-all duration-400 ease-[cubic-bezier(0.16,1,0.3,1)]","enter-from-class":"transform translate-x-full opacity-0 scale-90","enter-to-class":"transform translate-x-0 opacity-100 scale-100","leave-active-class":"transition-all duration-300 ease-[cubic-bezier(0.4,0,1,1)]","leave-from-class":"transform translate-x-0 opacity-100 scale-100","leave-to-class":"transform translate-x-full opacity-0 scale-90","move-class":"transition-all duration-300 ease-out",tag:"div",class:"w-full space-y-3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:e.normalizeClass(y(t)),role:"alert","aria-live":t.variant==="error"?"assertive":"polite"},[M(t)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.cn)("relative flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-all duration-300",_(t)))},[e.createVNode(s.default,{icon:C(t),class:e.normalizeClass(e.unref(o.cn)("h-5 w-5 transition-transform duration-300 group-hover:scale-110",B(t)))},null,8,["icon","class"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",j,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.cn)("text-md font-semibold leading-tight mb-1",T(t)))},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0),t.message||t.description?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o.cn)("text-md leading-relaxed",z(t)))},e.toDisplayString(t.message||t.description),3)):e.createCommentVNode("",!0),t.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),e.mergeProps({key:2,ref_for:!0},t.componentProps,{class:"mt-3"}),null,16)):e.createCommentVNode("",!0),t.action?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["mt-3 inline-flex items-center gap-1.5 text-sm font-medium transition-colors",N(t)]),onClick:t.action.onClick},[e.createTextVNode(e.toDisplayString(t.action.label)+" ",1),e.createVNode(s.default,{icon:"arrow-right",class:"h-3 w-3 transition-transform duration-200 group-hover:translate-x-0.5"})],10,A)):e.createCommentVNode("",!0)]),D(t)?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(o.cn)("absolute right-2 top-2 flex h-7 w-7 shrink-0 items-center justify-center rounded-md opacity-70 transition-all hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-(--ui-ring)",E(t))),"aria-label":"Dismiss",onClick:G=>e.unref(v)(t.id)},[e.createVNode(s.default,{icon:"x",class:"h-4 w-4"})],10,$)):e.createCommentVNode("",!0),t.duration&&t.duration>0?(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.cn)("h-full origin-left animate-toast-progress",V(t))),style:e.normalizeStyle({animationDuration:`${t.duration}ms`})},null,6)])):e.createCommentVNode("",!0)],10,P))),128))]),_:1})],2)]))}},F=I._export_sfc(L,[["__scopeId","data-v-8acde4d1"]]);exports.default=F;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { computed as _, createBlock as C, openBlock as r, Teleport as G, createElementVNode as h, normalizeClass as i, unref as n, createVNode as l, TransitionGroup as q, withCtx as H, createElementBlock as s, Fragment as J, renderList as O, createCommentVNode as a, toDisplayString as f, resolveDynamicComponent as Q, mergeProps as R, createTextVNode as U, normalizeStyle as W } from "vue";
|
|
2
|
+
import { cva as X } from "class-variance-authority";
|
|
3
|
+
import { cn as o } from "../utils/cn.js";
|
|
4
|
+
import { useToaster as Y } from "../lib/toast.js";
|
|
5
|
+
import g from "./Icon.js";
|
|
6
|
+
import { _ as Z } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const ee = ["aria-live"], te = { class: "flex-1 min-w-0 pt-0.5" }, re = ["onClick"], ie = ["onClick"], oe = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "absolute bottom-0 left-0 right-0 h-0.5 overflow-hidden"
|
|
10
|
+
}, ne = {
|
|
11
|
+
__name: "Toast",
|
|
12
|
+
props: {
|
|
13
|
+
position: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "top-right",
|
|
16
|
+
validator: (c) => [
|
|
17
|
+
"top-left",
|
|
18
|
+
"top-center",
|
|
19
|
+
"top-right",
|
|
20
|
+
"bottom-left",
|
|
21
|
+
"bottom-center",
|
|
22
|
+
"bottom-right"
|
|
23
|
+
].includes(c)
|
|
24
|
+
},
|
|
25
|
+
hotkey: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: () => ["altKey", "KeyT"]
|
|
28
|
+
},
|
|
29
|
+
richColors: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !0
|
|
32
|
+
},
|
|
33
|
+
expand: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
visibleToasts: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 3
|
|
40
|
+
},
|
|
41
|
+
closeButton: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setup(c) {
|
|
47
|
+
const u = c, { toasts: B, dismiss: T } = Y(), M = _(
|
|
48
|
+
() => B.value.slice(0, u.visibleToasts)
|
|
49
|
+
), N = {
|
|
50
|
+
"top-left": "top-0 left-0 flex-col items-start",
|
|
51
|
+
"top-center": "top-0 left-1/2 -translate-x-1/2 flex-col items-center",
|
|
52
|
+
"top-right": "top-0 right-0 flex-col items-end",
|
|
53
|
+
"bottom-left": "bottom-0 left-0 flex-col-reverse items-start",
|
|
54
|
+
"bottom-center": "bottom-0 left-1/2 -translate-x-1/2 flex-col-reverse items-center",
|
|
55
|
+
"bottom-right": "bottom-0 right-0 flex-col-reverse items-end"
|
|
56
|
+
}, V = _(
|
|
57
|
+
() => o(N[u.position])
|
|
58
|
+
), z = X(
|
|
59
|
+
"group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border p-4 transition-all duration-200 hover:-translate-y-0.5",
|
|
60
|
+
{
|
|
61
|
+
variants: {
|
|
62
|
+
variant: {
|
|
63
|
+
default: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30",
|
|
64
|
+
info: "border-blue-700 bg-blue-700 ui-text-inverse shadow-lg shadow-blue-900/25",
|
|
65
|
+
success: "border-green-700 bg-green-700 ui-text-inverse shadow-lg shadow-green-900/25",
|
|
66
|
+
warning: "border-amber-600 bg-amber-600 ui-text-inverse shadow-lg shadow-amber-900/25",
|
|
67
|
+
error: "border-red-700 bg-red-700 ui-text-inverse shadow-lg shadow-red-900/25",
|
|
68
|
+
loading: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: { variant: "default" }
|
|
72
|
+
}
|
|
73
|
+
), D = (t) => o(z({ variant: t.variant })), m = {
|
|
74
|
+
default: "bell",
|
|
75
|
+
info: "info",
|
|
76
|
+
success: "check-circle",
|
|
77
|
+
warning: "triangle-exclamation",
|
|
78
|
+
error: "circle-xmark",
|
|
79
|
+
loading: "loader-circle"
|
|
80
|
+
}, p = {
|
|
81
|
+
default: "ui-primary",
|
|
82
|
+
info: "text-white",
|
|
83
|
+
success: "text-white",
|
|
84
|
+
warning: "text-white",
|
|
85
|
+
error: "text-white",
|
|
86
|
+
loading: "ui-primary"
|
|
87
|
+
}, v = {
|
|
88
|
+
default: "ui-surface-muted border ui-border",
|
|
89
|
+
info: "bg-white/15 ring-1 ring-white/25",
|
|
90
|
+
success: "bg-white/15 ring-1 ring-white/25",
|
|
91
|
+
warning: "bg-white/15 ring-1 ring-white/25",
|
|
92
|
+
error: "bg-white/15 ring-1 ring-white/25",
|
|
93
|
+
loading: "ui-surface-muted border ui-border"
|
|
94
|
+
}, x = {
|
|
95
|
+
default: "bg-(--ui-primary)",
|
|
96
|
+
info: "bg-white/70",
|
|
97
|
+
success: "bg-white/70",
|
|
98
|
+
warning: "bg-white/70",
|
|
99
|
+
error: "bg-white/70",
|
|
100
|
+
loading: "bg-(--ui-primary)"
|
|
101
|
+
}, w = {
|
|
102
|
+
default: "ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline",
|
|
103
|
+
info: "text-white/90 hover:text-white underline-offset-4 hover:underline",
|
|
104
|
+
success: "text-white/90 hover:text-white underline-offset-4 hover:underline",
|
|
105
|
+
warning: "text-white/90 hover:text-white underline-offset-4 hover:underline",
|
|
106
|
+
error: "text-white/90 hover:text-white underline-offset-4 hover:underline",
|
|
107
|
+
loading: "ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline"
|
|
108
|
+
}, b = {
|
|
109
|
+
default: "ui-text",
|
|
110
|
+
info: "text-white",
|
|
111
|
+
success: "text-white",
|
|
112
|
+
warning: "text-white",
|
|
113
|
+
error: "text-white",
|
|
114
|
+
loading: "ui-text"
|
|
115
|
+
}, y = {
|
|
116
|
+
default: "ui-text-muted",
|
|
117
|
+
info: "text-white/90",
|
|
118
|
+
success: "text-white/90",
|
|
119
|
+
warning: "text-white/90",
|
|
120
|
+
error: "text-white/90",
|
|
121
|
+
loading: "ui-text-muted"
|
|
122
|
+
}, k = {
|
|
123
|
+
default: "ui-text-soft hover:bg-black/5 dark:hover:bg-white/10 hover:text-(--ui-text)",
|
|
124
|
+
info: "text-white/80 hover:text-white hover:bg-white/15",
|
|
125
|
+
success: "text-white/80 hover:text-white hover:bg-white/15",
|
|
126
|
+
warning: "text-white/80 hover:text-white hover:bg-white/15",
|
|
127
|
+
error: "text-white/80 hover:text-white hover:bg-white/15",
|
|
128
|
+
loading: "ui-text hover:bg-black/5 dark:hover:bg-white/5 hover:text-(--ui-text)"
|
|
129
|
+
}, I = (t) => t.icon || m[t.variant] || m.default, $ = (t) => {
|
|
130
|
+
const d = p[t.variant] || p.default;
|
|
131
|
+
return t.variant === "loading" ? `${d} animate-spin` : d;
|
|
132
|
+
}, P = (t) => v[t.variant] || v.default, S = (t) => x[t.variant] || x.default, j = (t) => w[t.variant] || w.default, A = (t) => b[t.variant] || b.default, E = (t) => y[t.variant] || y.default, K = (t) => k[t.variant] || k.default, L = (t) => t.icon !== !1, F = (t) => t.dismissible !== !1 && (t.closeButton || u.closeButton || t.dismissible);
|
|
133
|
+
return (t, d) => (r(), C(G, { to: "body" }, [
|
|
134
|
+
h("div", {
|
|
135
|
+
class: i(n(o)(
|
|
136
|
+
V.value,
|
|
137
|
+
"fixed z-[10000] flex max-h-screen w-full p-4 md:max-w-[420px] pointer-events-none"
|
|
138
|
+
))
|
|
139
|
+
}, [
|
|
140
|
+
l(q, {
|
|
141
|
+
"enter-active-class": "transition-all duration-400 ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
142
|
+
"enter-from-class": "transform translate-x-full opacity-0 scale-90",
|
|
143
|
+
"enter-to-class": "transform translate-x-0 opacity-100 scale-100",
|
|
144
|
+
"leave-active-class": "transition-all duration-300 ease-[cubic-bezier(0.4,0,1,1)]",
|
|
145
|
+
"leave-from-class": "transform translate-x-0 opacity-100 scale-100",
|
|
146
|
+
"leave-to-class": "transform translate-x-full opacity-0 scale-90",
|
|
147
|
+
"move-class": "transition-all duration-300 ease-out",
|
|
148
|
+
tag: "div",
|
|
149
|
+
class: "w-full space-y-3"
|
|
150
|
+
}, {
|
|
151
|
+
default: H(() => [
|
|
152
|
+
(r(!0), s(J, null, O(M.value, (e) => (r(), s("div", {
|
|
153
|
+
key: e.id,
|
|
154
|
+
class: i(D(e)),
|
|
155
|
+
role: "alert",
|
|
156
|
+
"aria-live": e.variant === "error" ? "assertive" : "polite"
|
|
157
|
+
}, [
|
|
158
|
+
L(e) ? (r(), s("div", {
|
|
159
|
+
key: 0,
|
|
160
|
+
class: i(n(o)(
|
|
161
|
+
"relative flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-all duration-300",
|
|
162
|
+
P(e)
|
|
163
|
+
))
|
|
164
|
+
}, [
|
|
165
|
+
l(g, {
|
|
166
|
+
icon: I(e),
|
|
167
|
+
class: i(n(o)(
|
|
168
|
+
"h-5 w-5 transition-transform duration-300 group-hover:scale-110",
|
|
169
|
+
$(e)
|
|
170
|
+
))
|
|
171
|
+
}, null, 8, ["icon", "class"])
|
|
172
|
+
], 2)) : a("", !0),
|
|
173
|
+
h("div", te, [
|
|
174
|
+
e.title ? (r(), s("div", {
|
|
175
|
+
key: 0,
|
|
176
|
+
class: i(n(o)("text-md font-semibold leading-tight mb-1", A(e)))
|
|
177
|
+
}, f(e.title), 3)) : a("", !0),
|
|
178
|
+
e.message || e.description ? (r(), s("div", {
|
|
179
|
+
key: 1,
|
|
180
|
+
class: i(n(o)("text-md leading-relaxed", E(e)))
|
|
181
|
+
}, f(e.message || e.description), 3)) : a("", !0),
|
|
182
|
+
e.component ? (r(), C(Q(e.component), R({
|
|
183
|
+
key: 2,
|
|
184
|
+
ref_for: !0
|
|
185
|
+
}, e.componentProps, { class: "mt-3" }), null, 16)) : a("", !0),
|
|
186
|
+
e.action ? (r(), s("button", {
|
|
187
|
+
key: 3,
|
|
188
|
+
class: i(["mt-3 inline-flex items-center gap-1.5 text-sm font-medium transition-colors", j(e)]),
|
|
189
|
+
onClick: e.action.onClick
|
|
190
|
+
}, [
|
|
191
|
+
U(f(e.action.label) + " ", 1),
|
|
192
|
+
l(g, {
|
|
193
|
+
icon: "arrow-right",
|
|
194
|
+
class: "h-3 w-3 transition-transform duration-200 group-hover:translate-x-0.5"
|
|
195
|
+
})
|
|
196
|
+
], 10, re)) : a("", !0)
|
|
197
|
+
]),
|
|
198
|
+
F(e) ? (r(), s("button", {
|
|
199
|
+
key: 1,
|
|
200
|
+
class: i(n(o)(
|
|
201
|
+
"absolute right-2 top-2 flex h-7 w-7 shrink-0 items-center justify-center rounded-md opacity-70 transition-all hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-(--ui-ring)",
|
|
202
|
+
K(e)
|
|
203
|
+
)),
|
|
204
|
+
"aria-label": "Dismiss",
|
|
205
|
+
onClick: (se) => n(T)(e.id)
|
|
206
|
+
}, [
|
|
207
|
+
l(g, {
|
|
208
|
+
icon: "x",
|
|
209
|
+
class: "h-4 w-4"
|
|
210
|
+
})
|
|
211
|
+
], 10, ie)) : a("", !0),
|
|
212
|
+
e.duration && e.duration > 0 ? (r(), s("div", oe, [
|
|
213
|
+
h("div", {
|
|
214
|
+
class: i(n(o)(
|
|
215
|
+
"h-full origin-left animate-toast-progress",
|
|
216
|
+
S(e)
|
|
217
|
+
)),
|
|
218
|
+
style: W({ animationDuration: `${e.duration}ms` })
|
|
219
|
+
}, null, 6)
|
|
220
|
+
])) : a("", !0)
|
|
221
|
+
], 10, ee))), 128))
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
})
|
|
225
|
+
], 2)
|
|
226
|
+
]));
|
|
227
|
+
}
|
|
228
|
+
}, fe = /* @__PURE__ */ Z(ne, [["__scopeId", "data-v-8acde4d1"]]);
|
|
229
|
+
export {
|
|
230
|
+
fe as default
|
|
231
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),m=require("class-variance-authority"),x=require("../utils/cn.cjs"),S={__name:"Tooltip",props:{content:{type:String,required:!0},placement:{type:String,default:"top",validator:s=>["top","bottom","left","right"].includes(s)},delay:{type:Number,default:0},class:String},setup(s){const n=s,u=t.ref(!1),p=t.ref(null),f=t.ref(null),d=t.ref({});let r=null;const h=m.cva("fixed z-[9999] px-3 py-1.5 text-sm ui-text ui-surface rounded-md shadow-lg pointer-events-none whitespace-nowrap",{variants:{placement:{top:"",bottom:"",left:"",right:""}}}),g=m.cva("absolute w-2 h-2 bg-primary transform rotate-45",{variants:{placement:{top:"top-full left-1/2 transform -translate-x-1/2 -mt-1",bottom:"bottom-full left-1/2 transform -translate-x-1/2 -mb-1",left:"left-full top-1/2 transform -translate-y-1/2 -ml-1",right:"right-full top-1/2 transform -translate-y-1/2 -mr-1"}}}),v=t.computed(()=>x.cn(h({placement:n.placement}),n.class)),y=t.computed(()=>g({placement:n.placement})),w=()=>{if(!p.value||!f.value)return;const e=p.value.getBoundingClientRect(),o=f.value.getBoundingClientRect();let a=0,l=0;const c=8;switch(n.placement){case"top":a=e.top-o.height-c,l=e.left+e.width/2-o.width/2;break;case"bottom":a=e.bottom+c,l=e.left+e.width/2-o.width/2;break;case"left":a=e.top+e.height/2-o.height/2,l=e.left-o.width-c;break;case"right":a=e.top+e.height/2-o.height/2,l=e.right+c;break}const i=8;l<i&&(l=i),l+o.width>window.innerWidth-i&&(l=window.innerWidth-o.width-i),a<i&&(a=i),a+o.height>window.innerHeight-i&&(a=window.innerHeight-o.height-i),d.value={top:`${a}px`,left:`${l}px`}},b=()=>{r&&clearTimeout(r),r=setTimeout(async()=>{u.value=!0,await t.nextTick(),w()},n.delay)},k=()=>{r&&clearTimeout(r),u.value=!1};return(e,o)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"triggerRef",ref:p,class:"relative inline-block",onMouseenter:b,onMouseleave:k},[t.renderSlot(e.$slots,"default"),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:t.withCtx(()=>[u.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tooltipRef",ref:f,class:t.normalizeClass(v.value),style:t.normalizeStyle(d.value),role:"tooltip"},[t.createTextVNode(t.toDisplayString(s.content)+" ",1),t.createElementVNode("div",{class:t.normalizeClass(y.value)},null,2)],6)):t.createCommentVNode("",!0)]),_:1})]))],544))}};exports.default=S;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ref as c, computed as h, createElementBlock as g, openBlock as m, renderSlot as S, createBlock as V, Teleport as _, createVNode as B, Transition as N, withCtx as z, createCommentVNode as $, normalizeStyle as E, normalizeClass as v, createTextVNode as H, createElementVNode as M, toDisplayString as W, nextTick as q } from "vue";
|
|
2
|
+
import { cva as w } from "class-variance-authority";
|
|
3
|
+
import { cn as D } from "../utils/cn.js";
|
|
4
|
+
const A = {
|
|
5
|
+
__name: "Tooltip",
|
|
6
|
+
props: {
|
|
7
|
+
content: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: !0
|
|
10
|
+
},
|
|
11
|
+
placement: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "top",
|
|
14
|
+
validator: (r) => ["top", "bottom", "left", "right"].includes(r)
|
|
15
|
+
},
|
|
16
|
+
delay: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0
|
|
19
|
+
},
|
|
20
|
+
class: String
|
|
21
|
+
},
|
|
22
|
+
setup(r) {
|
|
23
|
+
const i = r, p = c(!1), f = c(null), u = c(null), d = c({});
|
|
24
|
+
let n = null;
|
|
25
|
+
const y = w(
|
|
26
|
+
"fixed z-[9999] px-3 py-1.5 text-sm ui-text ui-surface rounded-md shadow-lg pointer-events-none whitespace-nowrap",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
placement: {
|
|
30
|
+
top: "",
|
|
31
|
+
bottom: "",
|
|
32
|
+
left: "",
|
|
33
|
+
right: ""
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
), b = w(
|
|
38
|
+
"absolute w-2 h-2 bg-primary transform rotate-45",
|
|
39
|
+
{
|
|
40
|
+
variants: {
|
|
41
|
+
placement: {
|
|
42
|
+
top: "top-full left-1/2 transform -translate-x-1/2 -mt-1",
|
|
43
|
+
bottom: "bottom-full left-1/2 transform -translate-x-1/2 -mb-1",
|
|
44
|
+
left: "left-full top-1/2 transform -translate-y-1/2 -ml-1",
|
|
45
|
+
right: "right-full top-1/2 transform -translate-y-1/2 -mr-1"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
), k = h(
|
|
50
|
+
() => D(y({ placement: i.placement }), i.class)
|
|
51
|
+
), x = h(
|
|
52
|
+
() => b({ placement: i.placement })
|
|
53
|
+
), R = () => {
|
|
54
|
+
if (!f.value || !u.value) return;
|
|
55
|
+
const t = f.value.getBoundingClientRect(), e = u.value.getBoundingClientRect();
|
|
56
|
+
let o = 0, a = 0;
|
|
57
|
+
const s = 8;
|
|
58
|
+
switch (i.placement) {
|
|
59
|
+
case "top":
|
|
60
|
+
o = t.top - e.height - s, a = t.left + t.width / 2 - e.width / 2;
|
|
61
|
+
break;
|
|
62
|
+
case "bottom":
|
|
63
|
+
o = t.bottom + s, a = t.left + t.width / 2 - e.width / 2;
|
|
64
|
+
break;
|
|
65
|
+
case "left":
|
|
66
|
+
o = t.top + t.height / 2 - e.height / 2, a = t.left - e.width - s;
|
|
67
|
+
break;
|
|
68
|
+
case "right":
|
|
69
|
+
o = t.top + t.height / 2 - e.height / 2, a = t.right + s;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
const l = 8;
|
|
73
|
+
a < l && (a = l), a + e.width > window.innerWidth - l && (a = window.innerWidth - e.width - l), o < l && (o = l), o + e.height > window.innerHeight - l && (o = window.innerHeight - e.height - l), d.value = {
|
|
74
|
+
top: `${o}px`,
|
|
75
|
+
left: `${a}px`
|
|
76
|
+
};
|
|
77
|
+
}, T = () => {
|
|
78
|
+
n && clearTimeout(n), n = setTimeout(async () => {
|
|
79
|
+
p.value = !0, await q(), R();
|
|
80
|
+
}, i.delay);
|
|
81
|
+
}, C = () => {
|
|
82
|
+
n && clearTimeout(n), p.value = !1;
|
|
83
|
+
};
|
|
84
|
+
return (t, e) => (m(), g("div", {
|
|
85
|
+
ref_key: "triggerRef",
|
|
86
|
+
ref: f,
|
|
87
|
+
class: "relative inline-block",
|
|
88
|
+
onMouseenter: T,
|
|
89
|
+
onMouseleave: C
|
|
90
|
+
}, [
|
|
91
|
+
S(t.$slots, "default"),
|
|
92
|
+
(m(), V(_, { to: "body" }, [
|
|
93
|
+
B(N, {
|
|
94
|
+
"enter-active-class": "transition-opacity duration-200",
|
|
95
|
+
"enter-from-class": "opacity-0",
|
|
96
|
+
"enter-to-class": "opacity-100",
|
|
97
|
+
"leave-active-class": "transition-opacity duration-200",
|
|
98
|
+
"leave-from-class": "opacity-100",
|
|
99
|
+
"leave-to-class": "opacity-0"
|
|
100
|
+
}, {
|
|
101
|
+
default: z(() => [
|
|
102
|
+
p.value ? (m(), g("div", {
|
|
103
|
+
key: 0,
|
|
104
|
+
ref_key: "tooltipRef",
|
|
105
|
+
ref: u,
|
|
106
|
+
class: v(k.value),
|
|
107
|
+
style: E(d.value),
|
|
108
|
+
role: "tooltip"
|
|
109
|
+
}, [
|
|
110
|
+
H(W(r.content) + " ", 1),
|
|
111
|
+
M("div", {
|
|
112
|
+
class: v(x.value)
|
|
113
|
+
}, null, 2)
|
|
114
|
+
], 6)) : $("", !0)
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
})
|
|
118
|
+
]))
|
|
119
|
+
], 544));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
A as default
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),f={key:0,class:"ui-danger ml-1","aria-hidden":"true"},b={__name:"Typography",props:{variant:{type:String,default:"body-md",validator:e=>["body-2xs","body-xs","body-sm","body-md","body-lg","body-xl","body-2xl","text-2xs","text-xs","text-sm","text-md","text-lg","text-xl","text-2xl","display-xs","display-sm","display-md","display-lg","display-xl","display-2xl","caption","overline","label"].includes(e)},color:{type:String,default:"default",validator:e=>["default","primary","secondary","accent","success","warning","danger","info","muted","disabled","white","black"].includes(e)},align:{type:String,default:"left",validator:e=>["left","center","right","justify"].includes(e)},weight:{type:String,default:null,validator:e=>["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"].includes(e)},transform:{type:String,default:null,validator:e=>["uppercase","lowercase","capitalize","normal"].includes(e)},leading:{type:String,default:null,validator:e=>["none","tight","snug","normal","relaxed","loose"].includes(e)},tracking:{type:String,default:null,validator:e=>["tighter","tight","normal","wide","wider","widest"].includes(e)},italic:Boolean,underline:Boolean,lineThrough:Boolean,truncate:Boolean,noWrap:Boolean,required:Boolean,gradient:Boolean,maxLines:{type:Number,default:null},shadow:{type:String,default:null,validator:e=>["sm","md","lg","xl","2xl"].includes(e)},spacing:{type:String,default:null,validator:e=>["tight","normal","relaxed","loose"].includes(e)},responsive:Boolean,opacity:{type:Number,default:null,validator:e=>e>=0&&e<=100}},setup(e){const t=e,n=l.computed(()=>({"body-2xs":"p","body-xs":"p","body-sm":"p","body-md":"p","body-lg":"p","body-xl":"p","body-2xl":"p","text-2xs":"h6","text-xs":"h6","text-sm":"h5","text-md":"h4","text-lg":"h3","text-xl":"h2","text-2xl":"h1","display-xs":"h2","display-sm":"h2","display-md":"h1","display-lg":"h1","display-xl":"h1","display-2xl":"h1",caption:"span",overline:"span",label:"label"})[t.variant]||"p"),i=l.computed(()=>({"body-2xs":"text-[10px] leading-normal","body-xs":"text-xs leading-normal","body-sm":"text-sm leading-relaxed","body-md":"text-base leading-relaxed","body-lg":"text-lg leading-relaxed","body-xl":"text-xl leading-relaxed","body-2xl":"text-2xl leading-relaxed","text-2xs":"text-xs font-semibold leading-snug","text-xs":"text-sm font-semibold leading-snug","text-sm":"text-lg font-semibold leading-snug","text-md":"text-xl font-semibold leading-snug","text-lg":"text-2xl font-bold leading-snug","text-xl":"text-3xl font-bold leading-snug","text-2xl":"text-4xl font-bold leading-snug","display-xs":"text-3xl font-bold leading-tight tracking-tight","display-sm":"text-4xl font-bold leading-tight tracking-tight","display-md":"text-5xl font-bold leading-tight tracking-tight","display-lg":"text-6xl font-bold leading-tight tracking-tight","display-xl":"text-7xl font-bold leading-tight tracking-tighter","display-2xl":"text-8xl font-bold leading-tight tracking-tighter",caption:"text-xs leading-normal ui-text",overline:"text-xs font-medium uppercase tracking-wider leading-normal",label:"text-sm font-medium leading-normal"})[t.variant]),o=l.computed(()=>t.gradient?"bg-linear-to-r from-(--ui-primary) to-(--ui-accent) bg-clip-text text-transparent":{default:"ui-text",primary:"ui-primary",secondary:"ui-text",accent:"ui-accent",success:"ui-success",warning:"ui-warning",danger:"ui-danger",info:"ui-primary",muted:"ui-text",disabled:"ui-text",white:"ui-text",black:"ui-text"}[t.color]),s=l.computed(()=>({left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"})[t.align]),r=l.computed(()=>t.weight?{thin:"font-thin",extralight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold",black:"font-black"}[t.weight]:""),d=l.computed(()=>t.transform?{uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize",normal:"normal-case"}[t.transform]:""),g=l.computed(()=>t.leading?{none:"leading-none",tight:"leading-tight",snug:"leading-snug",normal:"leading-normal",relaxed:"leading-relaxed",loose:"leading-loose"}[t.leading]:""),u=l.computed(()=>t.tracking?{tighter:"tracking-tighter",tight:"tracking-tight",normal:"tracking-normal",wide:"tracking-wide",wider:"tracking-wider",widest:"tracking-widest"}[t.tracking]:""),c=l.computed(()=>t.shadow?{sm:"drop-shadow-sm",md:"drop-shadow-md",lg:"drop-shadow-lg",xl:"drop-shadow-xl","2xl":"drop-shadow-2xl"}[t.shadow]:""),x=l.computed(()=>t.spacing?{tight:"mb-1",normal:"mb-2",relaxed:"mb-4",loose:"mb-6"}[t.spacing]:""),m=l.computed(()=>t.responsive?"text-sm sm:text-base md:text-lg lg:text-xl":""),p=l.computed(()=>t.maxLines?`line-clamp-${t.maxLines}`:""),h=l.computed(()=>{const a={};return t.opacity!==null&&(a.opacity=t.opacity/100),a}),y=l.computed(()=>[i.value,o.value,s.value,r.value,d.value,g.value,u.value,c.value,x.value,m.value,p.value,{italic:t.italic,underline:t.underline,"line-through":t.lineThrough,truncate:t.truncate&&!t.maxLines,"whitespace-nowrap":t.noWrap,"transition-colors duration-200":!0,"select-none":t.variant==="overline"||t.variant==="label"}]);return(a,v)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.value),l.mergeProps({class:y.value,style:h.value},a.$attrs),{default:l.withCtx(()=>[l.renderSlot(a.$slots,"default"),e.required?(l.openBlock(),l.createElementBlock("span",f,"*")):l.createCommentVNode("",!0)]),_:3},16,["class","style"]))}};exports.default=b;
|