@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 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../utils/cn.cjs"),n=require("./Divider.cjs"),l=require("./Icon.cjs"),o=require("./Link.cjs"),u=require("./Logo.cjs"),r=require("./Text.cjs"),a=require("./Typography.cjs"),c={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"},x={class:"grid grid-cols-1 md:grid-cols-4 gap-8"},f={class:"col-span-1 md:col-span-2"},m={class:"space-y-2"},N={class:"flex space-x-4"},V={class:"flex flex-col md:flex-row justify-between items-center"},p={class:"flex space-x-6 mt-4 md:mt-0"},v={__name:"Footer",props:{className:{type:String,default:""}},setup(d){return(s,t)=>(e.openBlock(),e.createElementBlock("footer",{class:e.normalizeClass(e.unref(i.cn)(" border-t ",d.className))},[e.createElementVNode("div",c,[e.createElementVNode("div",x,[e.createElementVNode("div",f,[e.renderSlot(s.$slots,"brand",{},()=>[e.createVNode(u.default,{class:"mb-4"}),e.createVNode(r.default,{class:"ui-text max-w-md"},{default:e.withCtx(()=>[...t[0]||(t[0]=[e.createTextVNode(" Building beautiful applications with modern Vue.js components. ",-1)])]),_:1})])]),e.createElementVNode("div",null,[e.renderSlot(s.$slots,"links",{},()=>[e.createVNode(a.default,{variant:"text-sm",class:"mb-4"},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" Quick Links ",-1)])]),_:1}),e.createElementVNode("div",m,[e.createVNode(o.default,{href:"#",class:"block ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode(" About ",-1)])]),_:1}),e.createVNode(o.default,{href:"#",class:"block ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode(" Services ",-1)])]),_:1}),e.createVNode(o.default,{href:"#",class:"block ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode(" Contact ",-1)])]),_:1})])])]),e.createElementVNode("div",null,[e.renderSlot(s.$slots,"social",{},()=>[e.createVNode(a.default,{variant:"text-sm",class:"mb-4"},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode(" Follow Us ",-1)])]),_:1}),e.createElementVNode("div",N,[e.createVNode(o.default,{href:"#",class:"ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[e.createVNode(l.default,{name:"square-x-twitter",prefix:"fab",class:"h-5 w-5"})]),_:1}),e.createVNode(o.default,{href:"#",class:"ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[e.createVNode(l.default,{name:"github",prefix:"fab",class:"h-5 w-5"})]),_:1})])])])]),e.createVNode(n.default,{class:"my-8"}),e.createElementVNode("div",V,[e.renderSlot(s.$slots,"copyright",{},()=>[e.createVNode(r.default,{class:"ui-text"},{default:e.withCtx(()=>[e.createTextVNode(" © "+e.toDisplayString(new Date().getFullYear())+" Your Company. All rights reserved. ",1)]),_:1})]),e.renderSlot(s.$slots,"legal",{},()=>[e.createElementVNode("div",p,[e.createVNode(o.default,{href:"#",class:"ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode(" Privacy ",-1)])]),_:1}),e.createVNode(o.default,{href:"#",class:"ui-text hover:text-(--ui-text)"},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Terms ",-1)])]),_:1})])])])])],2))}};exports.default=v;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { createElementBlock as d, openBlock as x, normalizeClass as c, unref as p, createElementVNode as l, createVNode as s, renderSlot as a, withCtx as e, createTextVNode as o, toDisplayString as _ } from "vue";
|
|
2
|
+
import { cn as v } from "../utils/cn.js";
|
|
3
|
+
import b from "./Divider.js";
|
|
4
|
+
import m from "./Icon.js";
|
|
5
|
+
import i from "./Link.js";
|
|
6
|
+
import g from "./Logo.js";
|
|
7
|
+
import f from "./Text.js";
|
|
8
|
+
import n from "./Typography.js";
|
|
9
|
+
const h = { class: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12" }, w = { class: "grid grid-cols-1 md:grid-cols-4 gap-8" }, $ = { class: "col-span-1 md:col-span-2" }, y = { class: "space-y-2" }, k = { class: "flex space-x-4" }, N = { class: "flex flex-col md:flex-row justify-between items-center" }, C = { class: "flex space-x-6 mt-4 md:mt-0" }, T = {
|
|
10
|
+
__name: "Footer",
|
|
11
|
+
props: {
|
|
12
|
+
className: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(u) {
|
|
18
|
+
return (r, t) => (x(), d("footer", {
|
|
19
|
+
class: c(p(v)(" border-t ", u.className))
|
|
20
|
+
}, [
|
|
21
|
+
l("div", h, [
|
|
22
|
+
l("div", w, [
|
|
23
|
+
l("div", $, [
|
|
24
|
+
a(r.$slots, "brand", {}, () => [
|
|
25
|
+
s(g, { class: "mb-4" }),
|
|
26
|
+
s(f, { class: "ui-text max-w-md" }, {
|
|
27
|
+
default: e(() => [...t[0] || (t[0] = [
|
|
28
|
+
o(" Building beautiful applications with modern Vue.js components. ", -1)
|
|
29
|
+
])]),
|
|
30
|
+
_: 1
|
|
31
|
+
})
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
l("div", null, [
|
|
35
|
+
a(r.$slots, "links", {}, () => [
|
|
36
|
+
s(n, {
|
|
37
|
+
variant: "text-sm",
|
|
38
|
+
class: "mb-4"
|
|
39
|
+
}, {
|
|
40
|
+
default: e(() => [...t[1] || (t[1] = [
|
|
41
|
+
o(" Quick Links ", -1)
|
|
42
|
+
])]),
|
|
43
|
+
_: 1
|
|
44
|
+
}),
|
|
45
|
+
l("div", y, [
|
|
46
|
+
s(i, {
|
|
47
|
+
href: "#",
|
|
48
|
+
class: "block ui-text hover:text-(--ui-text)"
|
|
49
|
+
}, {
|
|
50
|
+
default: e(() => [...t[2] || (t[2] = [
|
|
51
|
+
o(" About ", -1)
|
|
52
|
+
])]),
|
|
53
|
+
_: 1
|
|
54
|
+
}),
|
|
55
|
+
s(i, {
|
|
56
|
+
href: "#",
|
|
57
|
+
class: "block ui-text hover:text-(--ui-text)"
|
|
58
|
+
}, {
|
|
59
|
+
default: e(() => [...t[3] || (t[3] = [
|
|
60
|
+
o(" Services ", -1)
|
|
61
|
+
])]),
|
|
62
|
+
_: 1
|
|
63
|
+
}),
|
|
64
|
+
s(i, {
|
|
65
|
+
href: "#",
|
|
66
|
+
class: "block ui-text hover:text-(--ui-text)"
|
|
67
|
+
}, {
|
|
68
|
+
default: e(() => [...t[4] || (t[4] = [
|
|
69
|
+
o(" Contact ", -1)
|
|
70
|
+
])]),
|
|
71
|
+
_: 1
|
|
72
|
+
})
|
|
73
|
+
])
|
|
74
|
+
])
|
|
75
|
+
]),
|
|
76
|
+
l("div", null, [
|
|
77
|
+
a(r.$slots, "social", {}, () => [
|
|
78
|
+
s(n, {
|
|
79
|
+
variant: "text-sm",
|
|
80
|
+
class: "mb-4"
|
|
81
|
+
}, {
|
|
82
|
+
default: e(() => [...t[5] || (t[5] = [
|
|
83
|
+
o(" Follow Us ", -1)
|
|
84
|
+
])]),
|
|
85
|
+
_: 1
|
|
86
|
+
}),
|
|
87
|
+
l("div", k, [
|
|
88
|
+
s(i, {
|
|
89
|
+
href: "#",
|
|
90
|
+
class: "ui-text hover:text-(--ui-text)"
|
|
91
|
+
}, {
|
|
92
|
+
default: e(() => [
|
|
93
|
+
s(m, {
|
|
94
|
+
name: "square-x-twitter",
|
|
95
|
+
prefix: "fab",
|
|
96
|
+
class: "h-5 w-5"
|
|
97
|
+
})
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
}),
|
|
101
|
+
s(i, {
|
|
102
|
+
href: "#",
|
|
103
|
+
class: "ui-text hover:text-(--ui-text)"
|
|
104
|
+
}, {
|
|
105
|
+
default: e(() => [
|
|
106
|
+
s(m, {
|
|
107
|
+
name: "github",
|
|
108
|
+
prefix: "fab",
|
|
109
|
+
class: "h-5 w-5"
|
|
110
|
+
})
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
})
|
|
114
|
+
])
|
|
115
|
+
])
|
|
116
|
+
])
|
|
117
|
+
]),
|
|
118
|
+
s(b, { class: "my-8" }),
|
|
119
|
+
l("div", N, [
|
|
120
|
+
a(r.$slots, "copyright", {}, () => [
|
|
121
|
+
s(f, { class: "ui-text" }, {
|
|
122
|
+
default: e(() => [
|
|
123
|
+
o(" © " + _((/* @__PURE__ */ new Date()).getFullYear()) + " Your Company. All rights reserved. ", 1)
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
})
|
|
127
|
+
]),
|
|
128
|
+
a(r.$slots, "legal", {}, () => [
|
|
129
|
+
l("div", C, [
|
|
130
|
+
s(i, {
|
|
131
|
+
href: "#",
|
|
132
|
+
class: "ui-text hover:text-(--ui-text)"
|
|
133
|
+
}, {
|
|
134
|
+
default: e(() => [...t[6] || (t[6] = [
|
|
135
|
+
o(" Privacy ", -1)
|
|
136
|
+
])]),
|
|
137
|
+
_: 1
|
|
138
|
+
}),
|
|
139
|
+
s(i, {
|
|
140
|
+
href: "#",
|
|
141
|
+
class: "ui-text hover:text-(--ui-text)"
|
|
142
|
+
}, {
|
|
143
|
+
default: e(() => [...t[7] || (t[7] = [
|
|
144
|
+
o(" Terms ", -1)
|
|
145
|
+
])]),
|
|
146
|
+
_: 1
|
|
147
|
+
})
|
|
148
|
+
])
|
|
149
|
+
])
|
|
150
|
+
])
|
|
151
|
+
])
|
|
152
|
+
], 2));
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
T as default
|
|
157
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("class-variance-authority"),l=require("../utils/cn.cjs"),z=require("./DatePicker.cjs"),b=["for"],B={key:0,class:"ui-danger ml-1","aria-label":"required"},S={class:"relative"},C=["aria-label"],w=["id"],N=["id"],E={__name:"FormField",props:{label:String,description:String,error:String,success:String,helpText:String,required:{type:Boolean,default:!1},type:{type:String,default:"text"},modelValue:[String,Date],size:{type:String,default:"md",validator:t=>["sm","md","lg"].includes(t)},id:String},emits:["update:modelValue"],setup(t,{emit:v}){const o=t,f=v,y=`field-${Math.random().toString(36).slice(2,9)}`,a=e.computed(()=>`${o.id||y}-${Math.random().toString(36).slice(2,5)}`),i=e.computed(()=>!!o.error),n=e.ref(!1),d=()=>{n.value=!n.value},g=e.computed(()=>{const s=[];return o.error?s.push(`${a.value}-error`):o.helpText&&s.push(`${a.value}-help`),s.length>0?s.join(" "):void 0}),h=r.cva("ui-text",{variants:{size:{sm:"space-y-1",md:"space-y-2",lg:"space-y-3"}},defaultVariants:{size:"md"}}),V=r.cva("block ui-text",{variants:{size:{sm:"text-xs font-medium",md:"text-sm font-medium",lg:"text-base font-medium"}},defaultVariants:{size:"md"}}),k=r.cva("ui-text",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),u=r.cva("flex items-start gap-2",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-sm"},intent:{error:"ui-danger",success:"ui-success"}},defaultVariants:{size:"md",intent:"error"}}),x=r.cva("ui-text",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-sm"}},defaultVariants:{size:"md"}});return(s,m)=>{const c=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l.cn)(e.unref(h)({size:t.size}),s.$attrs.class))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:e.normalizeClass(e.unref(l.cn)(e.unref(V)({size:t.size})))},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",B,"*")):e.createCommentVNode("",!0)],10,b)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(l.cn)(e.unref(k)({size:t.size})))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0),e.createElementVNode("div",S,[t.type==="date"?(e.openBlock(),e.createBlock(z.default,{key:0,id:a.value,"model-value":t.modelValue,disabled:!1,required:t.required,class:e.normalizeClass(i.value?"border-(--ui-danger)":""),"onUpdate:modelValue":m[0]||(m[0]=p=>f("update:modelValue",p))},null,8,["id","model-value","required","class"])):e.renderSlot(s.$slots,"default",{key:1,fieldId:a.value,hasError:i.value,ariaDescribedBy:g.value,showPassword:n.value,togglePasswordVisibility:d}),t.type==="password"?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"absolute inset-y-0 right-0 pr-3 flex items-center ui-text hover:text-(--ui-text) transition-colors","aria-label":n.value?"Hide password":"Show password",onClick:d},[e.createVNode(c,{icon:n.value?"eye-slash":"eye",class:"w-4 h-4"},null,8,["icon"])],8,C)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-150","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${a.value}-error`,class:e.normalizeClass(e.unref(l.cn)(e.unref(u)({size:t.size,intent:"error"}))),role:"alert","aria-live":"polite"},[e.createVNode(c,{icon:"exclamation-triangle",class:"w-4 h-4 shrink-0 mt-0.5"}),e.createElementVNode("span",null,e.toDisplayString(t.error),1)],10,w)):e.createCommentVNode("",!0)]),_:1}),t.helpText&&!i.value?(e.openBlock(),e.createElementBlock("p",{key:2,id:`${a.value}-help`,class:e.normalizeClass(e.unref(l.cn)(e.unref(x)({size:t.size})))},e.toDisplayString(t.helpText),11,N)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-150","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[t.success&&!i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l.cn)(e.unref(u)({size:t.size,intent:"success"})))},[e.createVNode(c,{icon:"check",class:"w-4 h-4 shrink-0 mt-0.5"}),e.createElementVNode("span",null,e.toDisplayString(t.success),1)],2)):e.createCommentVNode("",!0)]),_:1})],2)}}};exports.default=E;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { computed as x, ref as E, resolveComponent as N, createElementBlock as s, openBlock as a, normalizeClass as r, unref as t, createCommentVNode as n, createElementVNode as h, createVNode as u, createTextVNode as P, toDisplayString as m, createBlock as I, renderSlot as F, Transition as b, withCtx as p } from "vue";
|
|
2
|
+
import { cva as v } from "class-variance-authority";
|
|
3
|
+
import { cn as o } from "../utils/cn.js";
|
|
4
|
+
import M from "./DatePicker.js";
|
|
5
|
+
const j = ["for"], H = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "ui-danger ml-1",
|
|
8
|
+
"aria-label": "required"
|
|
9
|
+
}, U = { class: "relative" }, A = ["aria-label"], G = ["id"], J = ["id"], R = {
|
|
10
|
+
__name: "FormField",
|
|
11
|
+
props: {
|
|
12
|
+
label: String,
|
|
13
|
+
description: String,
|
|
14
|
+
error: String,
|
|
15
|
+
success: String,
|
|
16
|
+
helpText: String,
|
|
17
|
+
required: { type: Boolean, default: !1 },
|
|
18
|
+
type: { type: String, default: "text" },
|
|
19
|
+
// Added type prop
|
|
20
|
+
modelValue: [String, Date],
|
|
21
|
+
size: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "md",
|
|
24
|
+
validator: (e) => ["sm", "md", "lg"].includes(e)
|
|
25
|
+
},
|
|
26
|
+
id: String
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue"],
|
|
29
|
+
setup(e, { emit: k }) {
|
|
30
|
+
const f = e, w = k, S = `field-${Math.random().toString(36).slice(2, 9)}`, i = x(() => `${f.id || S}-${Math.random().toString(36).slice(2, 5)}`), c = x(() => !!f.error), d = E(!1), g = () => {
|
|
31
|
+
d.value = !d.value;
|
|
32
|
+
}, $ = x(() => {
|
|
33
|
+
const l = [];
|
|
34
|
+
return f.error ? l.push(`${i.value}-error`) : f.helpText && l.push(`${i.value}-help`), l.length > 0 ? l.join(" ") : void 0;
|
|
35
|
+
}), q = v("ui-text", {
|
|
36
|
+
variants: {
|
|
37
|
+
size: {
|
|
38
|
+
sm: "space-y-1",
|
|
39
|
+
md: "space-y-2",
|
|
40
|
+
lg: "space-y-3"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: { size: "md" }
|
|
44
|
+
}), B = v("block ui-text", {
|
|
45
|
+
variants: {
|
|
46
|
+
size: {
|
|
47
|
+
sm: "text-xs font-medium",
|
|
48
|
+
md: "text-sm font-medium",
|
|
49
|
+
lg: "text-base font-medium"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: { size: "md" }
|
|
53
|
+
}), T = v("ui-text", {
|
|
54
|
+
variants: {
|
|
55
|
+
size: {
|
|
56
|
+
sm: "text-xs",
|
|
57
|
+
md: "text-sm",
|
|
58
|
+
lg: "text-base"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: { size: "md" }
|
|
62
|
+
}), z = v("flex items-start gap-2", {
|
|
63
|
+
variants: {
|
|
64
|
+
size: {
|
|
65
|
+
sm: "text-xs",
|
|
66
|
+
md: "text-sm",
|
|
67
|
+
lg: "text-sm"
|
|
68
|
+
},
|
|
69
|
+
intent: {
|
|
70
|
+
error: "ui-danger",
|
|
71
|
+
success: "ui-success"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: { size: "md", intent: "error" }
|
|
75
|
+
}), C = v("ui-text", {
|
|
76
|
+
variants: {
|
|
77
|
+
size: {
|
|
78
|
+
sm: "text-xs",
|
|
79
|
+
md: "text-sm",
|
|
80
|
+
lg: "text-sm"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: { size: "md" }
|
|
84
|
+
});
|
|
85
|
+
return (l, V) => {
|
|
86
|
+
const y = N("font-awesome-icon");
|
|
87
|
+
return a(), s("div", {
|
|
88
|
+
class: r(t(o)(t(q)({ size: e.size }), l.$attrs.class))
|
|
89
|
+
}, [
|
|
90
|
+
e.label ? (a(), s("label", {
|
|
91
|
+
key: 0,
|
|
92
|
+
for: i.value,
|
|
93
|
+
class: r(t(o)(t(B)({ size: e.size })))
|
|
94
|
+
}, [
|
|
95
|
+
P(m(e.label) + " ", 1),
|
|
96
|
+
e.required ? (a(), s("span", H, "*")) : n("", !0)
|
|
97
|
+
], 10, j)) : n("", !0),
|
|
98
|
+
e.description ? (a(), s("p", {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: r(t(o)(t(T)({ size: e.size })))
|
|
101
|
+
}, m(e.description), 3)) : n("", !0),
|
|
102
|
+
h("div", U, [
|
|
103
|
+
e.type === "date" ? (a(), I(M, {
|
|
104
|
+
key: 0,
|
|
105
|
+
id: i.value,
|
|
106
|
+
"model-value": e.modelValue,
|
|
107
|
+
disabled: !1,
|
|
108
|
+
required: e.required,
|
|
109
|
+
class: r(c.value ? "border-(--ui-danger)" : ""),
|
|
110
|
+
"onUpdate:modelValue": V[0] || (V[0] = (D) => w("update:modelValue", D))
|
|
111
|
+
}, null, 8, ["id", "model-value", "required", "class"])) : F(l.$slots, "default", {
|
|
112
|
+
key: 1,
|
|
113
|
+
fieldId: i.value,
|
|
114
|
+
hasError: c.value,
|
|
115
|
+
ariaDescribedBy: $.value,
|
|
116
|
+
showPassword: d.value,
|
|
117
|
+
togglePasswordVisibility: g
|
|
118
|
+
}),
|
|
119
|
+
e.type === "password" ? (a(), s("button", {
|
|
120
|
+
key: 2,
|
|
121
|
+
type: "button",
|
|
122
|
+
class: "absolute inset-y-0 right-0 pr-3 flex items-center ui-text hover:text-(--ui-text) transition-colors",
|
|
123
|
+
"aria-label": d.value ? "Hide password" : "Show password",
|
|
124
|
+
onClick: g
|
|
125
|
+
}, [
|
|
126
|
+
u(y, {
|
|
127
|
+
icon: d.value ? "eye-slash" : "eye",
|
|
128
|
+
class: "w-4 h-4"
|
|
129
|
+
}, null, 8, ["icon"])
|
|
130
|
+
], 8, A)) : n("", !0)
|
|
131
|
+
]),
|
|
132
|
+
u(b, {
|
|
133
|
+
"enter-active-class": "transition-all duration-200",
|
|
134
|
+
"enter-from-class": "opacity-0 -translate-y-1",
|
|
135
|
+
"enter-to-class": "opacity-100 translate-y-0",
|
|
136
|
+
"leave-active-class": "transition-all duration-150",
|
|
137
|
+
"leave-from-class": "opacity-100 translate-y-0",
|
|
138
|
+
"leave-to-class": "opacity-0 -translate-y-1"
|
|
139
|
+
}, {
|
|
140
|
+
default: p(() => [
|
|
141
|
+
c.value ? (a(), s("div", {
|
|
142
|
+
key: 0,
|
|
143
|
+
id: `${i.value}-error`,
|
|
144
|
+
class: r(t(o)(t(z)({ size: e.size, intent: "error" }))),
|
|
145
|
+
role: "alert",
|
|
146
|
+
"aria-live": "polite"
|
|
147
|
+
}, [
|
|
148
|
+
u(y, {
|
|
149
|
+
icon: "exclamation-triangle",
|
|
150
|
+
class: "w-4 h-4 shrink-0 mt-0.5"
|
|
151
|
+
}),
|
|
152
|
+
h("span", null, m(e.error), 1)
|
|
153
|
+
], 10, G)) : n("", !0)
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}),
|
|
157
|
+
e.helpText && !c.value ? (a(), s("p", {
|
|
158
|
+
key: 2,
|
|
159
|
+
id: `${i.value}-help`,
|
|
160
|
+
class: r(t(o)(t(C)({ size: e.size })))
|
|
161
|
+
}, m(e.helpText), 11, J)) : n("", !0),
|
|
162
|
+
u(b, {
|
|
163
|
+
"enter-active-class": "transition-all duration-200",
|
|
164
|
+
"enter-from-class": "opacity-0 -translate-y-1",
|
|
165
|
+
"enter-to-class": "opacity-100 translate-y-0",
|
|
166
|
+
"leave-active-class": "transition-all duration-150",
|
|
167
|
+
"leave-from-class": "opacity-100 translate-y-0",
|
|
168
|
+
"leave-to-class": "opacity-0 -translate-y-1"
|
|
169
|
+
}, {
|
|
170
|
+
default: p(() => [
|
|
171
|
+
e.success && !c.value ? (a(), s("div", {
|
|
172
|
+
key: 0,
|
|
173
|
+
class: r(t(o)(t(z)({ size: e.size, intent: "success" })))
|
|
174
|
+
}, [
|
|
175
|
+
u(y, {
|
|
176
|
+
icon: "check",
|
|
177
|
+
class: "w-4 h-4 shrink-0 mt-0.5"
|
|
178
|
+
}),
|
|
179
|
+
h("span", null, m(e.success), 1)
|
|
180
|
+
], 2)) : n("", !0)
|
|
181
|
+
]),
|
|
182
|
+
_: 1
|
|
183
|
+
})
|
|
184
|
+
], 2);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
export {
|
|
189
|
+
R as default
|
|
190
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("class-variance-authority"),r=require("../utils/cn.cjs"),p={class:"flex items-start justify-between"},u={class:"flex-1 min-w-0"},m={key:0,class:"shrink-0 ml-4"},g="text-lg font-semibold ui-text truncate",f="text-sm ui-text mt-1",v={__name:"Graph",props:{variant:{type:String,default:"default",validator:t=>["default","outlined","elevated","filled"].includes(t)},padding:{type:String,default:"md",validator:t=>["none","sm","md","lg","xl"].includes(t)},title:String,description:String},setup(t){const l=a.cva("rounded-lg overflow-hidden transition-all duration-200",{variants:{variant:{default:" border ",outlined:" border-2 ",elevated:" shadow-lg border ",filled:" border "},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}},defaultVariants:{variant:"default",padding:"md"}}),o=a.cva("border-b ui-border-strong last:border-b-0",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 pt-3",md:"px-4 pt-4",lg:"px-6 pt-6",xl:"px-8 pt-8"}}}),s=a.cva("border-b ui-border-strong",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 py-3",md:"px-4 py-4",lg:"px-6 py-6",xl:"px-8 py-8"}}}),d=a.cva("",{variants:{padding:{none:"p-4",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}}}),i=a.cva("border-t ui-border-strong bg-[color:color-mix(in oklab, var(--ui-surface), transparent 50%)]",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}}),c=a.cva("border-t ui-border-strong bg-[color:color-mix(in oklab, var(--ui-surface), transparent 50%)]",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}});return(n,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.cn)(e.unref(l)({variant:t.variant,padding:t.padding})))},[n.$slots.header||t.title||t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r.cn)(e.unref(o)({padding:t.padding})))},[e.renderSlot(n.$slots,"header",{},()=>[e.createElementVNode("div",p,[e.createElementVNode("div",u,[t.title?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(g)},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(f)},e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),n.$slots.actions?(e.openBlock(),e.createElementBlock("div",m,[e.renderSlot(n.$slots,"actions")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),n.$slots.filters?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r.cn)(e.unref(s)({padding:t.padding})))},[e.renderSlot(n.$slots,"filters")],2)):e.createCommentVNode("",!0),n.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(r.cn)(e.unref(d)({padding:t.padding})))},[e.renderSlot(n.$slots,"default")],2)):e.createCommentVNode("",!0),n.$slots.legend?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(r.cn)(e.unref(i)({padding:t.padding})))},[e.renderSlot(n.$slots,"legend")],2)):e.createCommentVNode("",!0),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(r.cn)(e.unref(c)({padding:t.padding})))},[e.renderSlot(n.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}};exports.default=v;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createElementBlock as n, openBlock as d, normalizeClass as s, unref as a, createCommentVNode as i, renderSlot as r, createElementVNode as p, toDisplayString as g } from "vue";
|
|
2
|
+
import { cva as l } from "class-variance-authority";
|
|
3
|
+
import { cn as o } from "../utils/cn.js";
|
|
4
|
+
const x = { class: "flex items-start justify-between" }, y = { class: "flex-1 min-w-0" }, h = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "shrink-0 ml-4"
|
|
7
|
+
}, k = "text-lg font-semibold ui-text truncate", $ = "text-sm ui-text mt-1", B = {
|
|
8
|
+
__name: "Graph",
|
|
9
|
+
props: {
|
|
10
|
+
variant: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "default",
|
|
13
|
+
validator: (t) => ["default", "outlined", "elevated", "filled"].includes(t)
|
|
14
|
+
},
|
|
15
|
+
padding: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "md",
|
|
18
|
+
validator: (t) => ["none", "sm", "md", "lg", "xl"].includes(t)
|
|
19
|
+
},
|
|
20
|
+
title: String,
|
|
21
|
+
description: String
|
|
22
|
+
},
|
|
23
|
+
setup(t) {
|
|
24
|
+
const u = l(
|
|
25
|
+
"rounded-lg overflow-hidden transition-all duration-200",
|
|
26
|
+
{
|
|
27
|
+
variants: {
|
|
28
|
+
variant: {
|
|
29
|
+
default: " border ",
|
|
30
|
+
outlined: " border-2 ",
|
|
31
|
+
elevated: " shadow-lg border ",
|
|
32
|
+
filled: " border "
|
|
33
|
+
},
|
|
34
|
+
padding: {
|
|
35
|
+
none: "",
|
|
36
|
+
sm: "p-3",
|
|
37
|
+
md: "p-4",
|
|
38
|
+
lg: "p-6",
|
|
39
|
+
xl: "p-8"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: "default",
|
|
44
|
+
padding: "md"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
), c = l(
|
|
48
|
+
"border-b ui-border-strong last:border-b-0",
|
|
49
|
+
{
|
|
50
|
+
variants: {
|
|
51
|
+
padding: {
|
|
52
|
+
none: "p-4 pb-0",
|
|
53
|
+
sm: "px-3 pt-3",
|
|
54
|
+
md: "px-4 pt-4",
|
|
55
|
+
lg: "px-6 pt-6",
|
|
56
|
+
xl: "px-8 pt-8"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
), m = l(
|
|
61
|
+
"border-b ui-border-strong",
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
padding: {
|
|
65
|
+
none: "p-4 pb-0",
|
|
66
|
+
sm: "px-3 py-3",
|
|
67
|
+
md: "px-4 py-4",
|
|
68
|
+
lg: "px-6 py-6",
|
|
69
|
+
xl: "px-8 py-8"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
), b = l("", {
|
|
74
|
+
variants: {
|
|
75
|
+
padding: {
|
|
76
|
+
none: "p-4",
|
|
77
|
+
sm: "p-3",
|
|
78
|
+
md: "p-4",
|
|
79
|
+
lg: "p-6",
|
|
80
|
+
xl: "p-8"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}), f = l(
|
|
84
|
+
"border-t ui-border-strong bg-[color:color-mix(in oklab, var(--ui-surface), transparent 50%)]",
|
|
85
|
+
{
|
|
86
|
+
variants: {
|
|
87
|
+
padding: {
|
|
88
|
+
none: "p-4 pt-0",
|
|
89
|
+
sm: "px-3 pb-3",
|
|
90
|
+
md: "px-4 pb-4",
|
|
91
|
+
lg: "px-6 pb-6",
|
|
92
|
+
xl: "px-8 pb-8"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
), v = l(
|
|
97
|
+
"border-t ui-border-strong bg-[color:color-mix(in oklab, var(--ui-surface), transparent 50%)]",
|
|
98
|
+
{
|
|
99
|
+
variants: {
|
|
100
|
+
padding: {
|
|
101
|
+
none: "p-4 pt-0",
|
|
102
|
+
sm: "px-3 pb-3",
|
|
103
|
+
md: "px-4 pb-4",
|
|
104
|
+
lg: "px-6 pb-6",
|
|
105
|
+
xl: "px-8 pb-8"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
return (e, V) => (d(), n("div", {
|
|
111
|
+
class: s(a(o)(a(u)({ variant: t.variant, padding: t.padding })))
|
|
112
|
+
}, [
|
|
113
|
+
e.$slots.header || t.title || t.description ? (d(), n("div", {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: s(a(o)(a(c)({ padding: t.padding })))
|
|
116
|
+
}, [
|
|
117
|
+
r(e.$slots, "header", {}, () => [
|
|
118
|
+
p("div", x, [
|
|
119
|
+
p("div", y, [
|
|
120
|
+
t.title ? (d(), n("h3", {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: s(k)
|
|
123
|
+
}, g(t.title), 1)) : i("", !0),
|
|
124
|
+
t.description ? (d(), n("p", {
|
|
125
|
+
key: 1,
|
|
126
|
+
class: s($)
|
|
127
|
+
}, g(t.description), 1)) : i("", !0)
|
|
128
|
+
]),
|
|
129
|
+
e.$slots.actions ? (d(), n("div", h, [
|
|
130
|
+
r(e.$slots, "actions")
|
|
131
|
+
])) : i("", !0)
|
|
132
|
+
])
|
|
133
|
+
])
|
|
134
|
+
], 2)) : i("", !0),
|
|
135
|
+
e.$slots.filters ? (d(), n("div", {
|
|
136
|
+
key: 1,
|
|
137
|
+
class: s(a(o)(a(m)({ padding: t.padding })))
|
|
138
|
+
}, [
|
|
139
|
+
r(e.$slots, "filters")
|
|
140
|
+
], 2)) : i("", !0),
|
|
141
|
+
e.$slots.default ? (d(), n("div", {
|
|
142
|
+
key: 2,
|
|
143
|
+
class: s(a(o)(a(b)({ padding: t.padding })))
|
|
144
|
+
}, [
|
|
145
|
+
r(e.$slots, "default")
|
|
146
|
+
], 2)) : i("", !0),
|
|
147
|
+
e.$slots.legend ? (d(), n("div", {
|
|
148
|
+
key: 3,
|
|
149
|
+
class: s(a(o)(a(f)({ padding: t.padding })))
|
|
150
|
+
}, [
|
|
151
|
+
r(e.$slots, "legend")
|
|
152
|
+
], 2)) : i("", !0),
|
|
153
|
+
e.$slots.footer ? (d(), n("div", {
|
|
154
|
+
key: 4,
|
|
155
|
+
class: s(a(o)(a(v)({ padding: t.padding })))
|
|
156
|
+
}, [
|
|
157
|
+
r(e.$slots, "footer")
|
|
158
|
+
], 2)) : i("", !0)
|
|
159
|
+
], 2));
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
export {
|
|
163
|
+
B as default
|
|
164
|
+
};
|
|
@@ -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"),$=require("../utils/cn.cjs"),m=require("./Button.cjs"),y=require("./Select.cjs"),u=require("./Icon.cjs"),q={class:"border-b"},A={key:0,class:"flex items-center gap-3 min-w-64"},R={class:"relative flex-1"},U={class:"relative flex-1"},L={key:1,class:"min-w-40"},M={class:"relative"},_={key:2,class:"min-w-40"},I={class:"relative"},P=["value"],j={key:3,class:"flex items-center gap-2"},G={class:"flex items-center gap-3 ml-auto"},O={class:"flex items-center gap-3 flex-wrap"},H=["onClick"],J={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:o=>["default","minimal","bordered"].includes(o)},padding:{type:String,default:"normal",validator:o=>["compact","normal","comfortable"].includes(o)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(o,{emit:h}){const d=o,i=h,r=e.ref(""),s=e.ref(""),c=e.ref("bar"),n=e.ref(""),x=D.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"",minimal:"bg-transparent",bordered:""},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),C=e.computed(()=>r.value||s.value||n.value),p=e.computed(()=>{const l=[];if(r.value||s.value){let t="";r.value&&s.value?t=`${r.value} to ${s.value}`:r.value?t=`From ${r.value}`:s.value&&(t=`Until ${s.value}`),t&&l.push({key:"date",label:"Date Range",value:t,icon:"calendar"})}if(n.value){const t=d.dataSources.find(a=>a.value===n.value);l.push({key:"dataSource",label:"Data Source",value:t?.label||n.value,icon:"database"})}return l}),g=e.computed(()=>$.cn(x({variant:d.variant,padding:d.padding}))),v=e.computed(()=>"w-full pl-10 pr-3 py-2 border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm ui-surface "),f=e.computed(()=>"w-full pr-8 appearance-none border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm py-2 pl-3 ui-surface "),V=e.computed(()=>"ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"),k=e.computed(()=>"ui-text ui-primary-bg hover:bg-(--ui-primary-strong) border border-(--ui-primary) px-3 py-2 rounded-lg text-sm font-medium transition-all"),b=e.computed(()=>"ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"),N=e.computed(()=>"px-6 py-3 ui-primary-soft border-t border-(--ui-primary-soft)"),B=e.computed(()=>"text-sm font-semibold ui-primary"),w=e.computed(()=>"flex items-center gap-1.5 ui-surface border border-(--ui-primary-soft) ui-primary px-3 py-1.5 rounded-full text-sm font-medium"),E=e.computed(()=>"ui-primary hover:text-(--ui-primary) ml-1 hover:bg-(--ui-primary-soft) rounded-full p-0.5 transition-all"),F=l=>{c.value=l.target.value,i("update:chartType",l.target.value)},S=l=>{n.value=l.target.value,i("update:dataSource",l.target.value)},T=()=>{r.value="",s.value="",n.value="",i("clear-filters")},z=l=>{switch(l){case"date":r.value="",s.value="";break;case"dataSource":n.value="";break}};return e.watch(()=>r.value,l=>{i("update:dateFrom",l)}),e.watch(()=>s.value,l=>{i("update:dateTo",l)}),(l,t)=>(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",{class:e.normalizeClass(g.value)},[o.showDateFilter?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",R,[e.createVNode(u.default,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>r.value=a),type:"date",class:e.normalizeClass(v.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),t[6]||(t[6]=e.createElementVNode("span",{class:"ui-text text-sm"},"to",-1)),e.createElementVNode("div",U,[e.createVNode(u.default,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>s.value=a),type:"date",class:e.normalizeClass(v.value),placeholder:"To date"},null,2),[[e.vModelText,s.value]])])])):e.createCommentVNode("",!0),o.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",M,[e.createVNode(y.default,{modelValue:c.value,"onUpdate:modelValue":t[2]||(t[2]=a=>c.value=a),class:e.normalizeClass(f.value),onChange:F},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(u.default,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"})])])):e.createCommentVNode("",!0),o.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",I,[e.createVNode(y.default,{modelValue:n.value,"onUpdate:modelValue":t[3]||(t[3]=a=>n.value=a),class:e.normalizeClass(f.value),onChange:S},{default:e.withCtx(()=>[t[8]||(t[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataSources,a=>(e.openBlock(),e.createElementBlock("option",{key:a.value,value:a.value},e.toDisplayString(a.label),9,P))),128))]),_:1},8,["modelValue","class"]),e.createVNode(u.default,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"})])])):e.createCommentVNode("",!0),l.$slots.filters?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",G,[C.value?(e.openBlock(),e.createBlock(m.default,{key:0,class:e.normalizeClass(V.value),onClick:T},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),t[9]||(t[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),o.showExport?(e.openBlock(),e.createBlock(m.default,{key:1,class:e.normalizeClass(k.value),onClick:t[4]||(t[4]=a=>l.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"download",class:"w-4 h-4 mr-2"}),t[10]||(t[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),o.showRefresh?(e.openBlock(),e.createBlock(m.default,{key:2,class:e.normalizeClass(b.value),onClick:t[5]||(t[5]=a=>l.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"sync",class:"w-4 h-4 mr-2"}),t[11]||(t[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),p.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(N.value)},[e.createElementVNode("div",O,[e.createElementVNode("span",{class:e.normalizeClass(B.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.key,class:e.normalizeClass(w.value)},[e.createVNode(u.default,{icon:a.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(a.label)+": "+e.toDisplayString(a.value),1),e.createElementVNode("button",{class:e.normalizeClass(E.value),onClick:K=>z(a.key)},[e.createVNode(u.default,{icon:"circle-xmark",class:"w-3 h-3"})],10,H)],2))),128))])],2)):e.createCommentVNode("",!0)]))}};exports.default=J;
|