@gspa/ui 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js +205 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs +1 -0
- package/dist/DataTable.css +1 -0
- package/dist/DataTableToolBar.css +1 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js +205 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-mEO-VA6R.cjs +1 -0
- package/dist/Header.css +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js +137 -0
- package/dist/Loader.css +1 -0
- package/dist/ReminderConfig.css +1 -0
- package/dist/ReusableForm.css +1 -0
- package/dist/Sidebar.css +1 -0
- package/dist/Toast.css +1 -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 +227 -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 +4 -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 +4 -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 +58 -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 +4 -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 +686 -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 +73 -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/gspa-ui.css +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +315 -19546
- package/dist/layouts/AuthLayout.cjs +1 -0
- package/dist/layouts/AuthLayout.js +188 -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/form-field.cjs +1 -0
- package/dist/lib/form-field.js +4 -0
- package/dist/lib/icon.cjs +1 -0
- package/dist/lib/icon.js +4 -0
- package/dist/lib/theme.cjs +1 -0
- package/dist/lib/theme.js +145 -0
- package/dist/lib/toast.cjs +1 -0
- package/dist/lib/toast.js +81 -0
- package/dist/src/components/Alert.vue.d.ts.map +1 -1
- package/dist/src/components/Button.vue.d.ts +127 -29
- package/dist/src/components/Button.vue.d.ts.map +1 -1
- package/dist/src/components/Checkbox.vue.d.ts +2 -2
- package/dist/src/components/DataTable.vue.d.ts +1 -1
- package/dist/src/components/FormField.vue.d.ts +106 -38
- package/dist/src/components/FormField.vue.d.ts.map +1 -1
- package/dist/src/components/Icon.vue.d.ts.map +1 -1
- package/dist/src/components/Input.vue.d.ts +137 -33
- package/dist/src/components/Input.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableFormModal.vue.d.ts +1 -1
- package/dist/src/components/Textarea.vue.d.ts +2 -2
- package/dist/src/index.d.ts +9 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/AuthLayout.vue.d.ts +2 -0
- package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
- package/dist/src/lib/form-field.d.ts +2 -0
- package/dist/src/lib/form-field.d.ts.map +1 -0
- package/dist/src/lib/icon.d.ts +2 -0
- package/dist/src/lib/icon.d.ts.map +1 -0
- package/dist/src/lib/theme.d.ts +4 -0
- package/dist/src/lib/theme.d.ts.map +1 -1
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/styles/auth-layout.css +1 -0
- package/dist/styles/button.css +1 -0
- package/dist/styles/form-field.css +1 -0
- package/dist/styles/input.css +1 -0
- package/dist/styles/tokens.css +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +45 -8
- package/dist/index.js +0 -605
- package/dist/src/__tests__/Alert.spec.d.ts +0 -2
- package/dist/src/__tests__/Alert.spec.d.ts.map +0 -1
- package/dist/src/__tests__/App.spec.d.ts +0 -2
- package/dist/src/__tests__/App.spec.d.ts.map +0 -1
- package/dist/src/__tests__/AuthLayout.spec.d.ts +0 -2
- package/dist/src/__tests__/AuthLayout.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Badge.spec.d.ts +0 -2
- package/dist/src/__tests__/Badge.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Button.spec.d.ts +0 -2
- package/dist/src/__tests__/Button.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Card.spec.d.ts +0 -2
- package/dist/src/__tests__/Card.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Checkbox.spec.d.ts +0 -2
- package/dist/src/__tests__/Checkbox.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Dropdown.spec.d.ts +0 -2
- package/dist/src/__tests__/Dropdown.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Input.spec.d.ts +0 -2
- package/dist/src/__tests__/Input.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Modal.spec.d.ts +0 -2
- package/dist/src/__tests__/Modal.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Radio.spec.d.ts +0 -2
- package/dist/src/__tests__/Radio.spec.d.ts.map +0 -1
- package/dist/src/__tests__/ReusableForm.spec.d.ts +0 -2
- package/dist/src/__tests__/ReusableForm.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Tabs.spec.d.ts +0 -2
- package/dist/src/__tests__/Tabs.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts.map +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { ref as d, computed as q, onMounted as U, onUnmounted as X, watch as w, nextTick as b, createElementBlock as a, openBlock as l, createElementVNode as c, createBlock as L, normalizeClass as x, toDisplayString as E, Fragment as H, renderList as R, withCtx as B, createTextVNode as F, Teleport as Q, createVNode as Z, Transition as j, createCommentVNode as J, normalizeStyle as Y, withDirectives as ee, withModifiers as S, vModelText as te } from "vue";
|
|
2
|
+
import oe from "./Badge.js";
|
|
3
|
+
const ne = { class: "relative" }, le = ["id", "disabled"], ie = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "ui-text-muted"
|
|
6
|
+
}, ae = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "flex flex-wrap gap-1.5"
|
|
9
|
+
}, re = { class: "px-3 py-2.5 border-b ui-border-strong ui-surface-muted" }, se = ["onClick"], ue = { class: "flex items-center gap-3" }, de = ["checked"], ce = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "px-4 py-6 text-sm ui-text text-center"
|
|
12
|
+
}, f = 12, g = 4, W = 320, fe = 180, pe = 10050, he = {
|
|
13
|
+
__name: "MultiSelect",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
options: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: !0,
|
|
22
|
+
validator: (i) => i.every((h) => h.value !== void 0 && h.label)
|
|
23
|
+
},
|
|
24
|
+
id: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
placeholder: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "Select options"
|
|
35
|
+
},
|
|
36
|
+
hasError: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:modelValue"],
|
|
42
|
+
setup(i, { emit: h }) {
|
|
43
|
+
const n = i, P = h, r = d(!1), p = d(""), _ = d(null), u = d([...n.options]), m = d(null), k = d(null), M = d({}), O = q(() => n.options.filter((e) => n.modelValue.includes(e.value)).map((e) => e.label)), V = () => {
|
|
44
|
+
r.value = !1, p.value = "", u.value = [...n.options];
|
|
45
|
+
}, s = () => {
|
|
46
|
+
if (!m.value || !r.value) return;
|
|
47
|
+
const e = m.value.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, v = Math.max(0, o - e.bottom - g - f), N = Math.max(0, e.top - g - f), C = N > v, G = Math.max(
|
|
48
|
+
Math.min(W, C ? N : v),
|
|
49
|
+
Math.min(fe, W)
|
|
50
|
+
), K = Math.max(0, t - f * 2), D = Math.min(e.width, K);
|
|
51
|
+
let y = e.left;
|
|
52
|
+
y + D > t - f && (y = t - f - D), y < f && (y = f), M.value = {
|
|
53
|
+
position: "fixed",
|
|
54
|
+
left: `${y}px`,
|
|
55
|
+
width: `${D}px`,
|
|
56
|
+
maxHeight: `${G}px`,
|
|
57
|
+
zIndex: pe,
|
|
58
|
+
...C ? { bottom: `${o - e.top + g}px` } : { top: `${e.bottom + g}px` }
|
|
59
|
+
};
|
|
60
|
+
}, T = () => {
|
|
61
|
+
n.disabled || (r.value ? V() : (r.value = !0, b(() => {
|
|
62
|
+
s(), _.value?.focus();
|
|
63
|
+
})));
|
|
64
|
+
}, z = (e) => {
|
|
65
|
+
let t;
|
|
66
|
+
n.modelValue.includes(e) ? t = n.modelValue.filter((o) => o !== e) : t = [...n.modelValue, e], P("update:modelValue", t), b(() => {
|
|
67
|
+
s();
|
|
68
|
+
});
|
|
69
|
+
}, A = () => {
|
|
70
|
+
if (!p.value.trim())
|
|
71
|
+
u.value = [...n.options];
|
|
72
|
+
else {
|
|
73
|
+
const e = p.value.toLowerCase();
|
|
74
|
+
u.value = n.options.filter(
|
|
75
|
+
(t) => t.label.toLowerCase().includes(e)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}, $ = (e) => {
|
|
79
|
+
e.key === "Escape" && V();
|
|
80
|
+
}, I = (e) => {
|
|
81
|
+
if (!m.value) return;
|
|
82
|
+
const t = e.target;
|
|
83
|
+
if (!t) return;
|
|
84
|
+
const o = k.value && k.value.contains(t), v = m.value.contains(t);
|
|
85
|
+
!o && !v && V();
|
|
86
|
+
};
|
|
87
|
+
return U(() => {
|
|
88
|
+
document.addEventListener("click", I), window.addEventListener("scroll", s, !0), window.addEventListener("resize", s);
|
|
89
|
+
}), X(() => {
|
|
90
|
+
document.removeEventListener("click", I), window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
|
|
91
|
+
}), w(() => n.options, (e) => {
|
|
92
|
+
u.value = [...e];
|
|
93
|
+
}, { immediate: !0 }), w(() => n.modelValue, () => {
|
|
94
|
+
r.value && b(() => {
|
|
95
|
+
s();
|
|
96
|
+
});
|
|
97
|
+
}), w(u, () => {
|
|
98
|
+
r.value && b(() => {
|
|
99
|
+
s();
|
|
100
|
+
});
|
|
101
|
+
}), w(r, (e) => {
|
|
102
|
+
e && s();
|
|
103
|
+
}), (e, t) => (l(), a("div", ne, [
|
|
104
|
+
c("button", {
|
|
105
|
+
id: i.id,
|
|
106
|
+
ref_key: "buttonRef",
|
|
107
|
+
ref: m,
|
|
108
|
+
type: "button",
|
|
109
|
+
disabled: i.disabled,
|
|
110
|
+
class: x([
|
|
111
|
+
"w-full px-3 py-2.5 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) ui-surface min-h-[42px]",
|
|
112
|
+
i.hasError ? "border-(--ui-danger)" : "ui-border-strong ",
|
|
113
|
+
i.disabled ? "ui-surface-muted cursor-not-allowed opacity-50" : "hover:border-(--ui-border-strong)"
|
|
114
|
+
]),
|
|
115
|
+
onClick: T,
|
|
116
|
+
onKeydown: $
|
|
117
|
+
}, [
|
|
118
|
+
O.value.length === 0 ? (l(), a("div", ie, E(i.placeholder || "Select options"), 1)) : (l(), a("div", ae, [
|
|
119
|
+
(l(!0), a(H, null, R(O.value, (o) => (l(), L(oe, {
|
|
120
|
+
key: o,
|
|
121
|
+
variant: "primary",
|
|
122
|
+
size: "sm"
|
|
123
|
+
}, {
|
|
124
|
+
default: B(() => [
|
|
125
|
+
F(E(o), 1)
|
|
126
|
+
]),
|
|
127
|
+
_: 2
|
|
128
|
+
}, 1024))), 128))
|
|
129
|
+
])),
|
|
130
|
+
(l(), a("svg", {
|
|
131
|
+
class: x(["absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 ui-text pointer-events-none transition-transform duration-200", { "rotate-180": r.value }]),
|
|
132
|
+
fill: "currentColor",
|
|
133
|
+
viewBox: "0 0 20 20"
|
|
134
|
+
}, [...t[3] || (t[3] = [
|
|
135
|
+
c("path", {
|
|
136
|
+
"fill-rule": "evenodd",
|
|
137
|
+
d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
|
|
138
|
+
"clip-rule": "evenodd"
|
|
139
|
+
}, null, -1)
|
|
140
|
+
])], 2))
|
|
141
|
+
], 42, le),
|
|
142
|
+
(l(), L(Q, { to: "body" }, [
|
|
143
|
+
Z(j, {
|
|
144
|
+
"enter-active-class": "transition ease-out duration-100",
|
|
145
|
+
"enter-from-class": "transform opacity-0 scale-95",
|
|
146
|
+
"enter-to-class": "transform opacity-100 scale-100",
|
|
147
|
+
"leave-active-class": "transition ease-in duration-75",
|
|
148
|
+
"leave-from-class": "transform opacity-100 scale-100",
|
|
149
|
+
"leave-to-class": "transform opacity-0 scale-95"
|
|
150
|
+
}, {
|
|
151
|
+
default: B(() => [
|
|
152
|
+
r.value ? (l(), a("div", {
|
|
153
|
+
key: 0,
|
|
154
|
+
ref_key: "dropdownRef",
|
|
155
|
+
ref: k,
|
|
156
|
+
style: Y(M.value),
|
|
157
|
+
"data-multiselect-dropdown": "",
|
|
158
|
+
class: "shadow-lg rounded-md text-base ring-1 ring-(--ui-border-strong) ring-opacity-5 overflow-hidden focus:outline-none ui-surface flex flex-col overscroll-contain"
|
|
159
|
+
}, [
|
|
160
|
+
c("div", re, [
|
|
161
|
+
ee(c("input", {
|
|
162
|
+
ref_key: "searchInput",
|
|
163
|
+
ref: _,
|
|
164
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => p.value = o),
|
|
165
|
+
type: "text",
|
|
166
|
+
placeholder: "Search options...",
|
|
167
|
+
class: "w-full px-3 py-2 text-sm border ui-border-strong rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent ui-surface placeholder:text-(--ui-text-muted)",
|
|
168
|
+
onInput: A,
|
|
169
|
+
onKeydown: t[1] || (t[1] = S(() => {
|
|
170
|
+
}, ["stop"]))
|
|
171
|
+
}, null, 544), [
|
|
172
|
+
[te, p.value]
|
|
173
|
+
])
|
|
174
|
+
]),
|
|
175
|
+
u.value.length > 0 ? (l(), a("div", {
|
|
176
|
+
key: 0,
|
|
177
|
+
class: "overflow-y-auto py-1 flex-1 overscroll-contain",
|
|
178
|
+
onWheel: t[2] || (t[2] = S(() => {
|
|
179
|
+
}, ["stop"]))
|
|
180
|
+
}, [
|
|
181
|
+
(l(!0), a(H, null, R(u.value, (o) => (l(), a("button", {
|
|
182
|
+
key: o.value,
|
|
183
|
+
type: "button",
|
|
184
|
+
class: x(["cursor-pointer select-none relative py-2.5 pl-3 pr-9 w-full text-left hover:bg-(--ui-primary-soft) focus:bg-(--ui-primary-soft) focus:outline-none transition-colors duration-150", { "ui-primary-soft": i.modelValue.includes(o.value) }]),
|
|
185
|
+
onClick: (v) => z(o.value)
|
|
186
|
+
}, [
|
|
187
|
+
c("div", ue, [
|
|
188
|
+
c("input", {
|
|
189
|
+
type: "checkbox",
|
|
190
|
+
checked: i.modelValue.includes(o.value),
|
|
191
|
+
class: "h-4 w-4 ui-primary focus:ring-(--ui-primary) ui-border-strong rounded cursor-pointer pointer-events-none",
|
|
192
|
+
readonly: "",
|
|
193
|
+
tabindex: "-1"
|
|
194
|
+
}, null, 8, de),
|
|
195
|
+
c("span", {
|
|
196
|
+
class: x(["block font-normal truncate", { "ui-primary font-medium": i.modelValue.includes(o.value) }])
|
|
197
|
+
}, E(o.label), 3)
|
|
198
|
+
])
|
|
199
|
+
], 10, se))), 128))
|
|
200
|
+
], 32)) : (l(), a("div", ce, " No options found "))
|
|
201
|
+
], 4)) : J("", !0)
|
|
202
|
+
]),
|
|
203
|
+
_: 1
|
|
204
|
+
})
|
|
205
|
+
]))
|
|
206
|
+
]));
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
export {
|
|
210
|
+
he as default
|
|
211
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("class-variance-authority"),k=require("../utils/cn.cjs"),r=require("./Icon.cjs"),y=["aria-live"],b={class:"flex items-start space-x-3"},p={key:0,class:"shrink-0"},h={class:"flex-1 min-w-0"},w={key:0,class:"text-sm font-medium"},C={__name:"Notification",props:{title:String,message:String,variant:{type:String,default:"default",validator:t=>["default","success","warning","danger"].includes(t)},dismissible:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},autoClose:{type:Number,default:0}},emits:["dismiss"],setup(t,{emit:i}){const a=t,l=i,s=e.ref(!0),c=o.cva("pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg shadow-lg ring-1 ring-(----ui-bg) ring-opacity-5 ui-surface",{variants:{variant:{default:"border-l-4 border-(--ui-primary)",success:"border-l-4 border-(--ui-success)",warning:"border-l-4 border-(--ui-warning)",danger:"border-l-4 border-(--ui-danger)"}}}),u={default:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"},d=o.cva("h-5 w-5",{variants:{variant:{default:"ui-primary",success:"ui-success",warning:"ui-warning",danger:"ui-danger"}}}),m=e.computed(()=>k.cn(c({variant:a.variant}),"p-4")),f=e.computed(()=>u[a.variant]),v=e.computed(()=>d({variant:a.variant})),n=()=>{s.value=!1,l("dismiss")};return e.onMounted(()=>{a.autoClose>0&&setTimeout(()=>{n()},a.autoClose)}),(g,B)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"transform translate-x-full opacity-0","enter-to-class":"transform translate-x-0 opacity-100","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"transform translate-x-0 opacity-100","leave-to-class":"transform translate-x-full opacity-0"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(m.value),role:"alert","aria-live":t.variant==="danger"?"assertive":"polite"},[e.createElementVNode("div",b,[t.showIcon?(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(r.default,{name:f.value,class:e.normalizeClass(v.value)},null,8,["name","class"])])):e.createCommentVNode("",!0),e.createElementVNode("div",h,[t.title?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.message?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["text-sm",{"mt-1":t.title}])},e.toDisplayString(t.message),3)):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default")]),t.dismissible?(e.openBlock(),e.createElementBlock("button",{key:1,class:"shrink-0 rounded-md p-1.5 hover:bg-[color:color-mix(in oklab, var(----ui-bg), transparent 95%)] focus:outline-none focus:ring-2 focus:ring-offset-2",onClick:n},[e.createVNode(r.default,{name:"x",class:"h-4 w-4"})])):e.createCommentVNode("",!0)])],10,y)):e.createCommentVNode("",!0)]),_:3}))}};exports.default=C;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ref as C, computed as n, onMounted as N, createBlock as V, openBlock as t, Transition as B, withCtx as S, createElementBlock as s, createCommentVNode as i, normalizeClass as r, createElementVNode as c, createVNode as u, renderSlot as E, toDisplayString as d } from "vue";
|
|
2
|
+
import { cva as m } from "class-variance-authority";
|
|
3
|
+
import { cn as I } from "../utils/cn.js";
|
|
4
|
+
import f from "./Icon.js";
|
|
5
|
+
const T = ["aria-live"], _ = { class: "flex items-start space-x-3" }, $ = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "shrink-0"
|
|
8
|
+
}, z = { class: "flex-1 min-w-0" }, D = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-sm font-medium"
|
|
11
|
+
}, G = {
|
|
12
|
+
__name: "Notification",
|
|
13
|
+
props: {
|
|
14
|
+
title: String,
|
|
15
|
+
message: String,
|
|
16
|
+
variant: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "default",
|
|
19
|
+
validator: (e) => ["default", "success", "warning", "danger"].includes(e)
|
|
20
|
+
},
|
|
21
|
+
dismissible: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
showIcon: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !0
|
|
28
|
+
},
|
|
29
|
+
autoClose: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
// 0 means no auto close
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["dismiss"],
|
|
36
|
+
setup(e, { emit: v }) {
|
|
37
|
+
const a = e, g = v, o = C(!0), b = m(
|
|
38
|
+
"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg shadow-lg ring-1 ring-(----ui-bg) ring-opacity-5 ui-surface",
|
|
39
|
+
{
|
|
40
|
+
variants: {
|
|
41
|
+
variant: {
|
|
42
|
+
default: "border-l-4 border-(--ui-primary)",
|
|
43
|
+
success: "border-l-4 border-(--ui-success)",
|
|
44
|
+
warning: "border-l-4 border-(--ui-warning)",
|
|
45
|
+
danger: "border-l-4 border-(--ui-danger)"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
), h = {
|
|
50
|
+
default: "info",
|
|
51
|
+
success: "check-circle",
|
|
52
|
+
warning: "alert-triangle",
|
|
53
|
+
danger: "alert-circle"
|
|
54
|
+
}, y = m("h-5 w-5", {
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
default: "ui-primary",
|
|
58
|
+
success: "ui-success",
|
|
59
|
+
warning: "ui-warning",
|
|
60
|
+
danger: "ui-danger"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}), w = n(
|
|
64
|
+
() => I(b({ variant: a.variant }), "p-4")
|
|
65
|
+
), p = n(() => h[a.variant]), x = n(() => y({ variant: a.variant })), l = () => {
|
|
66
|
+
o.value = !1, g("dismiss");
|
|
67
|
+
};
|
|
68
|
+
return N(() => {
|
|
69
|
+
a.autoClose > 0 && setTimeout(() => {
|
|
70
|
+
l();
|
|
71
|
+
}, a.autoClose);
|
|
72
|
+
}), (k, M) => (t(), V(B, {
|
|
73
|
+
"enter-active-class": "transition-all duration-300 ease-out",
|
|
74
|
+
"enter-from-class": "transform translate-x-full opacity-0",
|
|
75
|
+
"enter-to-class": "transform translate-x-0 opacity-100",
|
|
76
|
+
"leave-active-class": "transition-all duration-300 ease-in",
|
|
77
|
+
"leave-from-class": "transform translate-x-0 opacity-100",
|
|
78
|
+
"leave-to-class": "transform translate-x-full opacity-0"
|
|
79
|
+
}, {
|
|
80
|
+
default: S(() => [
|
|
81
|
+
o.value ? (t(), s("div", {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: r(w.value),
|
|
84
|
+
role: "alert",
|
|
85
|
+
"aria-live": e.variant === "danger" ? "assertive" : "polite"
|
|
86
|
+
}, [
|
|
87
|
+
c("div", _, [
|
|
88
|
+
e.showIcon ? (t(), s("div", $, [
|
|
89
|
+
u(f, {
|
|
90
|
+
name: p.value,
|
|
91
|
+
class: r(x.value)
|
|
92
|
+
}, null, 8, ["name", "class"])
|
|
93
|
+
])) : i("", !0),
|
|
94
|
+
c("div", z, [
|
|
95
|
+
e.title ? (t(), s("div", D, d(e.title), 1)) : i("", !0),
|
|
96
|
+
e.message ? (t(), s("div", {
|
|
97
|
+
key: 1,
|
|
98
|
+
class: r(["text-sm", { "mt-1": e.title }])
|
|
99
|
+
}, d(e.message), 3)) : i("", !0),
|
|
100
|
+
E(k.$slots, "default")
|
|
101
|
+
]),
|
|
102
|
+
e.dismissible ? (t(), s("button", {
|
|
103
|
+
key: 1,
|
|
104
|
+
class: "shrink-0 rounded-md p-1.5 hover:bg-[color:color-mix(in oklab, var(----ui-bg), transparent 95%)] focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
105
|
+
onClick: l
|
|
106
|
+
}, [
|
|
107
|
+
u(f, {
|
|
108
|
+
name: "x",
|
|
109
|
+
class: "h-4 w-4"
|
|
110
|
+
})
|
|
111
|
+
])) : i("", !0)
|
|
112
|
+
])
|
|
113
|
+
], 10, T)) : i("", !0)
|
|
114
|
+
]),
|
|
115
|
+
_: 3
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
G as default
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=["value","disabled","selected"],u={__name:"Option",props:{value:{type:[String,Number,Boolean],required:!0},label:{type:String,default:""},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1}},setup(t){const l=t,a=e.computed(()=>["ui-surface-strong","ui-text",l.disabled?"ui-text-soft":"ui-text"]);return(s,d)=>(e.openBlock(),e.createElementBlock("option",{value:t.value,disabled:t.disabled,selected:t.selected,class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],10,o))}};exports.default=u;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed as s, createElementBlock as o, openBlock as d, normalizeClass as n, renderSlot as u, createTextVNode as i, toDisplayString as r } from "vue";
|
|
2
|
+
const c = ["value", "disabled", "selected"], b = {
|
|
3
|
+
__name: "Option",
|
|
4
|
+
props: {
|
|
5
|
+
value: {
|
|
6
|
+
type: [String, Number, Boolean],
|
|
7
|
+
required: !0
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
selected: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const t = e, l = s(
|
|
24
|
+
() => [
|
|
25
|
+
"ui-surface-strong",
|
|
26
|
+
"ui-text",
|
|
27
|
+
t.disabled ? "ui-text-soft" : "ui-text"
|
|
28
|
+
]
|
|
29
|
+
);
|
|
30
|
+
return (a, f) => (d(), o("option", {
|
|
31
|
+
value: e.value,
|
|
32
|
+
disabled: e.disabled,
|
|
33
|
+
selected: e.selected,
|
|
34
|
+
class: n(l.value)
|
|
35
|
+
}, [
|
|
36
|
+
u(a.$slots, "default", {}, () => [
|
|
37
|
+
i(r(e.label), 1)
|
|
38
|
+
])
|
|
39
|
+
], 10, c));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
b as default
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("class-variance-authority"),u=require("../utils/cn.cjs"),d=["aria-valuenow"],c={__name:"Progress",props:{value:{type:Number,default:0},max:{type:Number,default:100},size:{type:String,default:"default",validator:a=>["sm","md","lg","default"].includes(a)},variant:{type:String,default:"default",validator:a=>["default","success","warning","danger"].includes(a)}},setup(a){const r=a,l=e.computed(()=>{const t=r.value/r.max*100;return Math.min(Math.max(t,0),100)}),s=n.cva("relative w-full overflow-hidden rounded-full ui-surface-muted border",{variants:{size:{sm:"h-1.5",default:"h-2",md:"h-3",lg:"h-4"}},defaultVariants:{size:"default"}}),i=n.cva("h-full w-full flex-1 transition-all duration-300 ease-in-out rounded-full",{variants:{variant:{default:"ui-primary-bg",success:"ui-success-bg",warning:"ui-warning-bg",danger:"ui-danger-bg"}},defaultVariants:{variant:"default"}});return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(u.cn)(e.unref(s)({size:a.size}),t.$attrs.class))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u.cn)(e.unref(i)({variant:a.variant}))),style:e.normalizeStyle({width:`${l.value}%`}),role:"progressbar","aria-valuenow":l.value,"aria-valuemin":0,"aria-valuemax":100},null,14,d)],2))}};exports.default=c;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { computed as o, createElementBlock as c, openBlock as f, normalizeClass as n, unref as e, createElementVNode as m, normalizeStyle as v } from "vue";
|
|
2
|
+
import { cva as i } from "class-variance-authority";
|
|
3
|
+
import { cn as s } from "../utils/cn.js";
|
|
4
|
+
const g = ["aria-valuenow"], y = {
|
|
5
|
+
__name: "Progress",
|
|
6
|
+
props: {
|
|
7
|
+
value: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
max: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 100
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "default",
|
|
18
|
+
validator: (a) => ["sm", "md", "lg", "default"].includes(a)
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "default",
|
|
23
|
+
validator: (a) => ["default", "success", "warning", "danger"].includes(a)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(a) {
|
|
27
|
+
const r = a, l = o(() => {
|
|
28
|
+
const t = r.value / r.max * 100;
|
|
29
|
+
return Math.min(Math.max(t, 0), 100);
|
|
30
|
+
}), u = i(
|
|
31
|
+
"relative w-full overflow-hidden rounded-full ui-surface-muted border",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
sm: "h-1.5",
|
|
36
|
+
default: "h-2",
|
|
37
|
+
md: "h-3",
|
|
38
|
+
lg: "h-4"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
size: "default"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
), d = i(
|
|
46
|
+
"h-full w-full flex-1 transition-all duration-300 ease-in-out rounded-full",
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
variant: {
|
|
50
|
+
default: "ui-primary-bg",
|
|
51
|
+
success: "ui-success-bg",
|
|
52
|
+
warning: "ui-warning-bg",
|
|
53
|
+
danger: "ui-danger-bg"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
variant: "default"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
return (t, p) => (f(), c("div", {
|
|
62
|
+
class: n(e(s)(e(u)({ size: a.size }), t.$attrs.class))
|
|
63
|
+
}, [
|
|
64
|
+
m("div", {
|
|
65
|
+
class: n(e(s)(e(d)({ variant: a.variant }))),
|
|
66
|
+
style: v({ width: `${l.value}%` }),
|
|
67
|
+
role: "progressbar",
|
|
68
|
+
"aria-valuenow": l.value,
|
|
69
|
+
"aria-valuemin": 0,
|
|
70
|
+
"aria-valuemax": 100
|
|
71
|
+
}, null, 14, g)
|
|
72
|
+
], 2));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
y as default
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("class-variance-authority"),u=require("../utils/cn.cjs"),h=["aria-valuenow"],y={__name:"ProgressBar",props:{value:{type:Number,default:0},max:{type:Number,default:100},size:{type:String,default:"md",validator:l=>["sm","md","lg"].includes(l)},variant:{type:String,default:"default",validator:l=>["default","success","warning","danger"].includes(l)},showLabel:Boolean,class:String},setup(l){const s=l,t=e.computed(()=>{const a=s.max>0?s.max:100,r=s.value/a*100;return Math.min(Math.max(r,0),100)}),i=o.cva("relative w-full overflow-hidden rounded-full ui-surface-muted border ui-border-strong",{variants:{size:{sm:"h-2",md:"h-3",lg:"h-4"}}}),m=o.cva("h-full w-full flex-1 transition-[width,background-color] duration-300 ease-in-out"),d=e.computed(()=>u.cn(i({size:s.size}),s.class)),n=[{max:20,class:"bg-red-700"},{max:40,class:"bg-orange-600"},{max:60,class:"bg-amber-500"},{max:80,class:"bg-lime-600"},{max:100,class:"bg-emerald-700"}],g={success:[{max:33,class:"bg-emerald-500"},{max:66,class:"bg-emerald-600"},{max:100,class:"bg-emerald-700"}],warning:[{max:33,class:"bg-amber-500"},{max:66,class:"bg-amber-600"},{max:100,class:"bg-orange-700"}],danger:[{max:33,class:"bg-rose-500"},{max:66,class:"bg-red-600"},{max:100,class:"bg-red-700"}]},c=(a,r)=>a.find(f=>r<=f.max)?.class||a[a.length-1].class,v=e.computed(()=>{if(s.variant==="default")return c(n,t.value);const a=g[s.variant]||n;return c(a,t.value)}),b=e.computed(()=>u.cn(m(),v.value)),x=e.computed(()=>"absolute inset-0 flex items-center justify-center text-xs font-medium ui-text"),p=e.computed(()=>({width:`${t.value}%`}));return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value)},[e.createElementVNode("div",{class:e.normalizeClass(b.value),style:e.normalizeStyle(p.value),role:"progressbar","aria-valuenow":t.value,"aria-valuemin":0,"aria-valuemax":100},null,14,h),l.showLabel?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(x.value)},e.toDisplayString(t.value)+"% ",3)):e.createCommentVNode("",!0)],2))}};exports.default=y;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { computed as l, createElementBlock as i, openBlock as m, normalizeClass as n, createElementVNode as C, createCommentVNode as S, normalizeStyle as z, toDisplayString as _ } from "vue";
|
|
2
|
+
import { cva as u } from "class-variance-authority";
|
|
3
|
+
import { cn as d } from "../utils/cn.js";
|
|
4
|
+
const V = ["aria-valuenow"], M = {
|
|
5
|
+
__name: "ProgressBar",
|
|
6
|
+
props: {
|
|
7
|
+
value: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
max: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 100
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "md",
|
|
18
|
+
validator: (s) => ["sm", "md", "lg"].includes(s)
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "default",
|
|
23
|
+
validator: (s) => ["default", "success", "warning", "danger"].includes(s)
|
|
24
|
+
},
|
|
25
|
+
showLabel: Boolean,
|
|
26
|
+
class: String
|
|
27
|
+
},
|
|
28
|
+
setup(s) {
|
|
29
|
+
const e = s, t = l(() => {
|
|
30
|
+
const a = e.max > 0 ? e.max : 100, r = e.value / a * 100;
|
|
31
|
+
return Math.min(Math.max(r, 0), 100);
|
|
32
|
+
}), g = u(
|
|
33
|
+
"relative w-full overflow-hidden rounded-full ui-surface-muted border ui-border-strong",
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
size: {
|
|
37
|
+
sm: "h-2",
|
|
38
|
+
md: "h-3",
|
|
39
|
+
lg: "h-4"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
), v = u(
|
|
44
|
+
"h-full w-full flex-1 transition-[width,background-color] duration-300 ease-in-out"
|
|
45
|
+
), x = l(
|
|
46
|
+
() => d(g({ size: e.size }), e.class)
|
|
47
|
+
), o = [
|
|
48
|
+
{ max: 20, class: "bg-red-700" },
|
|
49
|
+
{ max: 40, class: "bg-orange-600" },
|
|
50
|
+
{ max: 60, class: "bg-amber-500" },
|
|
51
|
+
{ max: 80, class: "bg-lime-600" },
|
|
52
|
+
{ max: 100, class: "bg-emerald-700" }
|
|
53
|
+
], b = {
|
|
54
|
+
success: [
|
|
55
|
+
{ max: 33, class: "bg-emerald-500" },
|
|
56
|
+
{ max: 66, class: "bg-emerald-600" },
|
|
57
|
+
{ max: 100, class: "bg-emerald-700" }
|
|
58
|
+
],
|
|
59
|
+
warning: [
|
|
60
|
+
{ max: 33, class: "bg-amber-500" },
|
|
61
|
+
{ max: 66, class: "bg-amber-600" },
|
|
62
|
+
{ max: 100, class: "bg-orange-700" }
|
|
63
|
+
],
|
|
64
|
+
danger: [
|
|
65
|
+
{ max: 33, class: "bg-rose-500" },
|
|
66
|
+
{ max: 66, class: "bg-red-600" },
|
|
67
|
+
{ max: 100, class: "bg-red-700" }
|
|
68
|
+
]
|
|
69
|
+
}, c = (a, r) => a.find((y) => r <= y.max)?.class || a[a.length - 1].class, f = l(() => {
|
|
70
|
+
if (e.variant === "default")
|
|
71
|
+
return c(o, t.value);
|
|
72
|
+
const a = b[e.variant] || o;
|
|
73
|
+
return c(a, t.value);
|
|
74
|
+
}), p = l(
|
|
75
|
+
() => d(v(), f.value)
|
|
76
|
+
), h = l(
|
|
77
|
+
() => "absolute inset-0 flex items-center justify-center text-xs font-medium ui-text"
|
|
78
|
+
), w = l(() => ({
|
|
79
|
+
width: `${t.value}%`
|
|
80
|
+
}));
|
|
81
|
+
return (a, r) => (m(), i("div", {
|
|
82
|
+
class: n(x.value)
|
|
83
|
+
}, [
|
|
84
|
+
C("div", {
|
|
85
|
+
class: n(p.value),
|
|
86
|
+
style: z(w.value),
|
|
87
|
+
role: "progressbar",
|
|
88
|
+
"aria-valuenow": t.value,
|
|
89
|
+
"aria-valuemin": 0,
|
|
90
|
+
"aria-valuemax": 100
|
|
91
|
+
}, null, 14, V),
|
|
92
|
+
s.showLabel ? (m(), i("span", {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: n(h.value)
|
|
95
|
+
}, _(t.value) + "% ", 3)) : S("", !0)
|
|
96
|
+
], 2));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
M as default
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("class-variance-authority"),a=require("../utils/cn.cjs"),b={class:"flex items-center space-x-2"},p=["aria-checked","disabled"],f={__name:"Radio",props:{modelValue:null,value:{type:[String,Number,Boolean],required:!0},label:String,disabled:Boolean,size:{type:String,default:"md",validator:s=>["sm","md","lg"].includes(s)},class:String},emits:["update:modelValue"],setup(s,{emit:i}){const l=s,r=i,t=e.computed(()=>l.modelValue===l.value),c=m.cva("aspect-square rounded-full border border-(--ui-primary) ui-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-(--ui-primary) focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}}}),n=e.computed(()=>a.cn(c({size:l.size}),l.disabled&&"cursor-not-allowed opacity-50",l.class)),d=e.computed(()=>a.cn("flex items-center justify-center rounded-full bg-primary",{"h-2 w-2":l.size==="sm","h-2.5 w-2.5":l.size==="md","h-3 w-3":l.size==="lg"})),u=e.computed(()=>a.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",!l.disabled&&"cursor-pointer")),o=()=>{l.disabled||r("update:modelValue",l.value)};return(v,g)=>(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{type:"button",role:"radio","aria-checked":t.value,disabled:s.disabled,class:e.normalizeClass(n.value),onClick:o},[t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):e.createCommentVNode("",!0)],10,p),s.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(u.value),onClick:o},e.toDisplayString(s.label),3)):e.createCommentVNode("",!0)]))}};exports.default=f;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { computed as s, createElementBlock as a, openBlock as i, createElementVNode as v, createCommentVNode as n, normalizeClass as t, toDisplayString as g } from "vue";
|
|
2
|
+
import { cva as y } from "class-variance-authority";
|
|
3
|
+
import { cn as o } from "../utils/cn.js";
|
|
4
|
+
const h = { class: "flex items-center space-x-2" }, k = ["aria-checked", "disabled"], S = {
|
|
5
|
+
__name: "Radio",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: null,
|
|
8
|
+
value: {
|
|
9
|
+
type: [String, Number, Boolean],
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
label: String,
|
|
13
|
+
disabled: Boolean,
|
|
14
|
+
size: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "md",
|
|
17
|
+
validator: (l) => ["sm", "md", "lg"].includes(l)
|
|
18
|
+
},
|
|
19
|
+
class: String
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue"],
|
|
22
|
+
setup(l, { emit: c }) {
|
|
23
|
+
const e = l, u = c, r = s(() => e.modelValue === e.value), m = y(
|
|
24
|
+
"aspect-square rounded-full border border-(--ui-primary) ui-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-(--ui-primary) focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
25
|
+
{
|
|
26
|
+
variants: {
|
|
27
|
+
size: {
|
|
28
|
+
sm: "h-4 w-4",
|
|
29
|
+
md: "h-5 w-5",
|
|
30
|
+
lg: "h-6 w-6"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
), b = s(
|
|
35
|
+
() => o(
|
|
36
|
+
m({ size: e.size }),
|
|
37
|
+
e.disabled && "cursor-not-allowed opacity-50",
|
|
38
|
+
e.class
|
|
39
|
+
)
|
|
40
|
+
), p = s(
|
|
41
|
+
() => o(
|
|
42
|
+
"flex items-center justify-center rounded-full bg-primary",
|
|
43
|
+
{
|
|
44
|
+
"h-2 w-2": e.size === "sm",
|
|
45
|
+
"h-2.5 w-2.5": e.size === "md",
|
|
46
|
+
"h-3 w-3": e.size === "lg"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
), f = s(
|
|
50
|
+
() => o(
|
|
51
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
52
|
+
!e.disabled && "cursor-pointer"
|
|
53
|
+
)
|
|
54
|
+
), d = () => {
|
|
55
|
+
e.disabled || u("update:modelValue", e.value);
|
|
56
|
+
};
|
|
57
|
+
return (w, z) => (i(), a("div", h, [
|
|
58
|
+
v("button", {
|
|
59
|
+
type: "button",
|
|
60
|
+
role: "radio",
|
|
61
|
+
"aria-checked": r.value,
|
|
62
|
+
disabled: l.disabled,
|
|
63
|
+
class: t(b.value),
|
|
64
|
+
onClick: d
|
|
65
|
+
}, [
|
|
66
|
+
r.value ? (i(), a("div", {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: t(p.value)
|
|
69
|
+
}, null, 2)) : n("", !0)
|
|
70
|
+
], 10, k),
|
|
71
|
+
l.label ? (i(), a("label", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: t(f.value),
|
|
74
|
+
onClick: d
|
|
75
|
+
}, g(l.label), 3)) : n("", !0)
|
|
76
|
+
]));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
S as default
|
|
81
|
+
};
|