@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.
Files changed (205) hide show
  1. package/README.md +18 -0
  2. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  3. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  4. package/dist/components/Accordion.cjs +1 -0
  5. package/dist/components/Accordion.js +192 -0
  6. package/dist/components/AccordionItem.cjs +1 -0
  7. package/dist/components/AccordionItem.js +109 -0
  8. package/dist/components/AddReminderModal.cjs +1 -0
  9. package/dist/components/AddReminderModal.js +107 -0
  10. package/dist/components/Alert.cjs +1 -0
  11. package/dist/components/Alert.js +222 -0
  12. package/dist/components/Avatar.cjs +1 -0
  13. package/dist/components/Avatar.js +86 -0
  14. package/dist/components/Badge.cjs +1 -0
  15. package/dist/components/Badge.js +109 -0
  16. package/dist/components/Breadcrumb.cjs +1 -0
  17. package/dist/components/Breadcrumb.js +72 -0
  18. package/dist/components/Button.cjs +1 -0
  19. package/dist/components/Button.js +190 -0
  20. package/dist/components/ButtonGroup.cjs +1 -0
  21. package/dist/components/ButtonGroup.js +46 -0
  22. package/dist/components/Calendar.cjs +1 -0
  23. package/dist/components/Calendar.js +341 -0
  24. package/dist/components/Card.cjs +1 -0
  25. package/dist/components/Card.js +316 -0
  26. package/dist/components/CardBody.cjs +1 -0
  27. package/dist/components/CardBody.js +34 -0
  28. package/dist/components/CardContent.cjs +1 -0
  29. package/dist/components/CardContent.js +17 -0
  30. package/dist/components/CardFooter.cjs +1 -0
  31. package/dist/components/CardFooter.js +34 -0
  32. package/dist/components/CardHeader.cjs +1 -0
  33. package/dist/components/CardHeader.js +91 -0
  34. package/dist/components/CardTitle.cjs +1 -0
  35. package/dist/components/CardTitle.js +17 -0
  36. package/dist/components/Checkbox.cjs +1 -0
  37. package/dist/components/Checkbox.js +185 -0
  38. package/dist/components/CircularProgress.cjs +1 -0
  39. package/dist/components/CircularProgress.js +141 -0
  40. package/dist/components/DataTable.cjs +1 -0
  41. package/dist/components/DataTable.js +863 -0
  42. package/dist/components/DataTableCell.cjs +1 -0
  43. package/dist/components/DataTableCell.js +95 -0
  44. package/dist/components/DataTableFilters.cjs +1 -0
  45. package/dist/components/DataTableFilters.js +519 -0
  46. package/dist/components/DataTableHeader.cjs +1 -0
  47. package/dist/components/DataTableHeader.js +116 -0
  48. package/dist/components/DataTablePagination.cjs +1 -0
  49. package/dist/components/DataTablePagination.js +290 -0
  50. package/dist/components/DataTableRow.cjs +1 -0
  51. package/dist/components/DataTableRow.js +199 -0
  52. package/dist/components/DataTableToolBar.cjs +1 -0
  53. package/dist/components/DataTableToolBar.js +477 -0
  54. package/dist/components/DatePicker.cjs +1 -0
  55. package/dist/components/DatePicker.js +401 -0
  56. package/dist/components/Divider.cjs +1 -0
  57. package/dist/components/Divider.js +103 -0
  58. package/dist/components/Dropdown.cjs +1 -0
  59. package/dist/components/Dropdown.js +104 -0
  60. package/dist/components/DropdownItem.cjs +1 -0
  61. package/dist/components/DropdownItem.js +60 -0
  62. package/dist/components/EventsCalendar.cjs +1 -0
  63. package/dist/components/EventsCalendar.js +863 -0
  64. package/dist/components/FileUpload.cjs +1 -0
  65. package/dist/components/FileUpload.js +195 -0
  66. package/dist/components/FilterDrawer.cjs +1 -0
  67. package/dist/components/FilterDrawer.js +412 -0
  68. package/dist/components/Footer.cjs +1 -0
  69. package/dist/components/Footer.js +157 -0
  70. package/dist/components/FormField.cjs +1 -0
  71. package/dist/components/FormField.js +190 -0
  72. package/dist/components/Graph.cjs +1 -0
  73. package/dist/components/Graph.js +164 -0
  74. package/dist/components/GraphFilters.cjs +1 -0
  75. package/dist/components/GraphFilters.js +305 -0
  76. package/dist/components/Header.cjs +1 -0
  77. package/dist/components/Header.js +674 -0
  78. package/dist/components/Icon.cjs +1 -0
  79. package/dist/components/Icon.js +51 -0
  80. package/dist/components/Image.cjs +1 -0
  81. package/dist/components/Image.js +112 -0
  82. package/dist/components/Input.cjs +1 -0
  83. package/dist/components/Input.js +166 -0
  84. package/dist/components/InputGroup.cjs +1 -0
  85. package/dist/components/InputGroup.js +45 -0
  86. package/dist/components/Label.cjs +1 -0
  87. package/dist/components/Label.js +46 -0
  88. package/dist/components/Link.cjs +1 -0
  89. package/dist/components/Link.js +119 -0
  90. package/dist/components/ListItem.cjs +1 -0
  91. package/dist/components/ListItem.js +89 -0
  92. package/dist/components/Loader.cjs +1 -0
  93. package/dist/components/Loader.js +154 -0
  94. package/dist/components/Logo.cjs +1 -0
  95. package/dist/components/Logo.js +67 -0
  96. package/dist/components/MenuItem.cjs +1 -0
  97. package/dist/components/MenuItem.js +66 -0
  98. package/dist/components/Modal.cjs +1 -0
  99. package/dist/components/Modal.js +110 -0
  100. package/dist/components/ModalBody.cjs +1 -0
  101. package/dist/components/ModalBody.js +33 -0
  102. package/dist/components/ModalFooter.cjs +1 -0
  103. package/dist/components/ModalFooter.js +33 -0
  104. package/dist/components/ModalHeader.cjs +1 -0
  105. package/dist/components/ModalHeader.js +24 -0
  106. package/dist/components/MultiSelect.cjs +1 -0
  107. package/dist/components/MultiSelect.js +211 -0
  108. package/dist/components/Notification.cjs +1 -0
  109. package/dist/components/Notification.js +121 -0
  110. package/dist/components/Option.cjs +1 -0
  111. package/dist/components/Option.js +44 -0
  112. package/dist/components/Progress.cjs +1 -0
  113. package/dist/components/Progress.js +77 -0
  114. package/dist/components/ProgressBar.cjs +1 -0
  115. package/dist/components/ProgressBar.js +101 -0
  116. package/dist/components/Radio.cjs +1 -0
  117. package/dist/components/Radio.js +81 -0
  118. package/dist/components/RailNav.cjs +1 -0
  119. package/dist/components/RailNav.js +124 -0
  120. package/dist/components/ReminderConfig.cjs +1 -0
  121. package/dist/components/ReminderConfig.js +375 -0
  122. package/dist/components/ReusableForm.cjs +1 -0
  123. package/dist/components/ReusableForm.js +657 -0
  124. package/dist/components/ReusableFormModal.cjs +1 -0
  125. package/dist/components/ReusableFormModal.js +112 -0
  126. package/dist/components/RightDrawer.cjs +1 -0
  127. package/dist/components/RightDrawer.js +143 -0
  128. package/dist/components/Search.cjs +1 -0
  129. package/dist/components/Search.js +252 -0
  130. package/dist/components/Select.cjs +1 -0
  131. package/dist/components/Select.js +243 -0
  132. package/dist/components/Sidebar.cjs +1 -0
  133. package/dist/components/Sidebar.js +372 -0
  134. package/dist/components/Slider.cjs +1 -0
  135. package/dist/components/Slider.js +42 -0
  136. package/dist/components/Spinner.cjs +1 -0
  137. package/dist/components/Spinner.js +87 -0
  138. package/dist/components/Stepper.cjs +1 -0
  139. package/dist/components/Stepper.js +12 -0
  140. package/dist/components/StepperItem.cjs +1 -0
  141. package/dist/components/StepperItem.js +33 -0
  142. package/dist/components/Switch.cjs +1 -0
  143. package/dist/components/Switch.js +112 -0
  144. package/dist/components/Tab.cjs +1 -0
  145. package/dist/components/Tab.js +134 -0
  146. package/dist/components/TabPanel.cjs +1 -0
  147. package/dist/components/TabPanel.js +49 -0
  148. package/dist/components/Text.cjs +1 -0
  149. package/dist/components/Text.js +84 -0
  150. package/dist/components/Textarea.cjs +1 -0
  151. package/dist/components/Textarea.js +102 -0
  152. package/dist/components/ThemeConfigurator.cjs +1 -0
  153. package/dist/components/ThemeConfigurator.js +50 -0
  154. package/dist/components/Timeline.cjs +1 -0
  155. package/dist/components/Timeline.js +24 -0
  156. package/dist/components/TimelineItem.cjs +1 -0
  157. package/dist/components/TimelineItem.js +63 -0
  158. package/dist/components/Toast.cjs +1 -0
  159. package/dist/components/Toast.js +231 -0
  160. package/dist/components/Tooltip.cjs +1 -0
  161. package/dist/components/Tooltip.js +124 -0
  162. package/dist/components/Typography.cjs +1 -0
  163. package/dist/components/Typography.js +267 -0
  164. package/dist/components/charts/BarChart.cjs +1 -0
  165. package/dist/components/charts/BarChart.js +323 -0
  166. package/dist/components/charts/LineChart.cjs +1 -0
  167. package/dist/components/charts/LineChart.js +322 -0
  168. package/dist/components/charts/PieChart.cjs +1 -0
  169. package/dist/components/charts/PieChart.js +311 -0
  170. package/dist/components/charts/StackedBarChart.cjs +1 -0
  171. package/dist/components/charts/StackedBarChart.js +348 -0
  172. package/dist/components/widgets/DashboardWidget.cjs +1 -0
  173. package/dist/components/widgets/DashboardWidget.js +309 -0
  174. package/dist/directives/tooltip.cjs +47 -0
  175. package/dist/directives/tooltip.js +115 -0
  176. package/dist/index.cjs +1 -0
  177. package/dist/index.esm.js +310 -19533
  178. package/dist/layouts/AuthLayout.cjs +1 -0
  179. package/dist/layouts/AuthLayout.js +190 -0
  180. package/dist/layouts/DashboardLayout.cjs +1 -0
  181. package/dist/layouts/DashboardLayout.js +244 -0
  182. package/dist/layouts/DefaultLayout.cjs +1 -0
  183. package/dist/layouts/DefaultLayout.js +94 -0
  184. package/dist/layouts/ErrorLayout.cjs +1 -0
  185. package/dist/layouts/ErrorLayout.js +452 -0
  186. package/dist/lib/auth.cjs +1 -0
  187. package/dist/lib/auth.js +4 -0
  188. package/dist/lib/theme.cjs +1 -0
  189. package/dist/lib/theme.js +135 -0
  190. package/dist/lib/toast.cjs +1 -0
  191. package/dist/lib/toast.js +81 -0
  192. package/dist/src/__tests__/AuthLayout.spec.d.ts +2 -0
  193. package/dist/src/__tests__/AuthLayout.spec.d.ts.map +1 -0
  194. package/dist/src/layouts/AuthLayout.vue.d.ts +10 -6
  195. package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
  196. package/dist/tsconfig.tsbuildinfo +1 -1
  197. package/dist/utils/cn.cjs +1 -0
  198. package/dist/utils/cn.js +7 -0
  199. package/package.json +43 -11
  200. package/dist/applogo.png +0 -0
  201. package/dist/favicon.ico +0 -0
  202. package/dist/index.js +0 -605
  203. package/dist/logo.png +0 -0
  204. package/dist/stlbacklogo.jpeg +0 -0
  205. package/dist/stlbacklogo.png +0 -0
@@ -0,0 +1,401 @@
1
+ import { ref as p, computed as x, watch as _, onMounted as le, onBeforeUnmount as se, createElementBlock as s, openBlock as l, createElementVNode as o, createBlock as ue, createCommentVNode as M, normalizeClass as T, withModifiers as U, Teleport as de, createVNode as ce, Transition as fe, withCtx as ve, normalizeStyle as me, toDisplayString as w, Fragment as C, renderList as V, nextTick as pe } from "vue";
2
+ const ge = { class: "relative w-full bg-(--ui-surface) rounded-md" }, be = { class: "relative" }, ye = ["id", "value", "disabled", "placeholder", "required", "aria-describedby"], he = { class: "flex items-center justify-between mb-3" }, xe = { class: "text-sm font-semibold ui-text" }, we = { class: "grid grid-cols-7 gap-1 mb-1" }, De = { class: "grid grid-cols-7 gap-1" }, ke = ["disabled", "onClick"], Se = {
3
+ key: 0,
4
+ class: "mt-3 pt-2 border-t ui-border"
5
+ }, Me = {
6
+ key: 0,
7
+ class: "border-l pl-3 ui-border"
8
+ }, Te = { class: "max-h-[260px] overflow-y-auto pr-1 space-y-1" }, Ce = ["onClick"], $e = {
9
+ __name: "DatePicker",
10
+ props: {
11
+ id: String,
12
+ modelValue: [String, Date],
13
+ disabled: Boolean,
14
+ required: Boolean,
15
+ min: [String, Date],
16
+ max: [String, Date],
17
+ placeholder: {
18
+ type: String,
19
+ default: "Select date"
20
+ },
21
+ format: {
22
+ type: String,
23
+ default: "DD/MM/YYYY"
24
+ },
25
+ clearable: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ showToday: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ ariaDescribedby: String,
34
+ // Custom validation function: (date: Date) => string | null
35
+ // Return error message string if invalid, null if valid
36
+ customValidation: {
37
+ type: Function,
38
+ default: null
39
+ },
40
+ // Array of disabled dates or function to determine if date is disabled
41
+ disabledDates: {
42
+ type: [Array, Function],
43
+ default: null
44
+ },
45
+ enableTime: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ minuteInterval: {
50
+ type: Number,
51
+ default: 1
52
+ }
53
+ },
54
+ emits: ["update:modelValue", "validation-error"],
55
+ setup(d, { emit: G }) {
56
+ const r = d, y = G, m = p(!1), B = p(null), Y = p(null), F = p({}), g = /* @__PURE__ */ new Date(), i = p(g.getMonth()), u = p(g.getFullYear()), c = p(null), D = p(!1), k = p("00:00"), J = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], K = x(
57
+ () => new Date(u.value, i.value).toLocaleString("default", {
58
+ month: "long"
59
+ })
60
+ ), I = x(() => new Date(u.value, i.value + 1, 0).getDate()), Q = x(() => new Date(u.value, i.value, 1).getDay()), E = x(() => {
61
+ const n = new Date(u.value, i.value, 0).getDate(), e = Q.value;
62
+ return Array.from({ length: e }, (t, a) => n - e + a + 1);
63
+ }), X = x(() => {
64
+ const n = E.value.length + I.value, e = n % 7 === 0 ? 0 : 7 - n % 7;
65
+ return Array.from({ length: e }, (t, a) => a + 1);
66
+ }), N = x(() => c.value ? r.enableTime ? ee(c.value) : z(c.value) : ""), Z = x(() => {
67
+ const n = Math.min(60, Math.max(1, Number(r.minuteInterval) || 1)), e = [];
68
+ for (let t = 0; t < 24; t++)
69
+ for (let a = 0; a < 60; a += n) {
70
+ const v = String(t).padStart(2, "0"), f = String(a).padStart(2, "0");
71
+ e.push(`${v}:${f}`);
72
+ }
73
+ return e;
74
+ });
75
+ function z(n) {
76
+ if (!n) return "";
77
+ const e = new Date(n), t = String(e.getMonth() + 1).padStart(2, "0"), a = String(e.getDate()).padStart(2, "0"), v = e.getFullYear();
78
+ return r.format.replace("MM", t).replace("DD", a).replace("YYYY", v);
79
+ }
80
+ function ee(n) {
81
+ const e = z(n), t = String(n.getHours()).padStart(2, "0"), a = String(n.getMinutes()).padStart(2, "0");
82
+ return `${e} ${t}:${a}`;
83
+ }
84
+ function S(n) {
85
+ if (!n) return null;
86
+ if (n instanceof Date) return n;
87
+ if (typeof n == "string") {
88
+ if (n.includes("T")) {
89
+ const [a, v] = n.split("T"), f = S(a);
90
+ if (!f) return null;
91
+ const [h = "00", b = "00"] = (v || "").slice(0, 5).split(":");
92
+ return f.setHours(parseInt(h, 10) || 0, parseInt(b, 10) || 0, 0, 0), f;
93
+ }
94
+ const t = n.split("-");
95
+ if (t.length === 3) {
96
+ const a = parseInt(t[0], 10), v = parseInt(t[1], 10) - 1, f = parseInt(t[2], 10);
97
+ return new Date(a, v, f);
98
+ }
99
+ }
100
+ const e = new Date(n);
101
+ return isNaN(e.getTime()) ? null : e;
102
+ }
103
+ function te(n) {
104
+ return g.getDate() === n && g.getMonth() === i.value && g.getFullYear() === u.value;
105
+ }
106
+ function H(n) {
107
+ if (!c.value) return !1;
108
+ const e = new Date(c.value);
109
+ return e.getDate() === n && e.getMonth() === i.value && e.getFullYear() === u.value;
110
+ }
111
+ function $(n) {
112
+ const e = new Date(u.value, i.value, n);
113
+ if (r.min) {
114
+ const t = S(r.min);
115
+ if (t && e < t) return !0;
116
+ }
117
+ if (r.max) {
118
+ const t = S(r.max);
119
+ if (t && e > t) return !0;
120
+ }
121
+ if (r.disabledDates) {
122
+ if (typeof r.disabledDates == "function")
123
+ return r.disabledDates(e);
124
+ if (Array.isArray(r.disabledDates))
125
+ return r.disabledDates.some((t) => {
126
+ const a = S(t);
127
+ return a && a.getTime() === e.getTime();
128
+ });
129
+ }
130
+ return !!(r.customValidation && r.customValidation(e));
131
+ }
132
+ function L(n) {
133
+ if (!n)
134
+ return D.value = !1, y("validation-error", null), !0;
135
+ if (r.customValidation) {
136
+ const e = r.customValidation(n);
137
+ if (e)
138
+ return D.value = !0, y("validation-error", e), !1;
139
+ }
140
+ return D.value = !1, y("validation-error", null), !0;
141
+ }
142
+ async function R() {
143
+ await pe();
144
+ const n = Y.value || (r.id ? document.getElementById(r.id) : null);
145
+ if (!n || !B.value) return;
146
+ const e = n.getBoundingClientRect(), t = 320, a = window.innerHeight - e.bottom, v = e.top, f = 8;
147
+ let h, b;
148
+ a >= t || a > v ? h = e.bottom + f : h = e.top - t - f, b = e.left;
149
+ const O = 256;
150
+ b + O > window.innerWidth && (b = window.innerWidth - O - 16), b < 16 && (b = 16), F.value = {
151
+ top: `${h}px`,
152
+ left: `${b}px`
153
+ };
154
+ }
155
+ async function ne() {
156
+ r.disabled || (m.value = !m.value, m.value && await R());
157
+ }
158
+ function A() {
159
+ m.value = !1;
160
+ }
161
+ function ae() {
162
+ i.value === 0 ? (i.value = 11, u.value--) : i.value--;
163
+ }
164
+ function re() {
165
+ i.value === 11 ? (i.value = 0, u.value++) : i.value++;
166
+ }
167
+ function j(n) {
168
+ if ($(n)) return;
169
+ const e = new Date(u.value, i.value, n);
170
+ L(e) && (c.value = e, P(e), setTimeout(() => {
171
+ r.enableTime || (m.value = !1);
172
+ }, 150));
173
+ }
174
+ function P(n) {
175
+ const e = n.getFullYear(), t = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
176
+ if (!r.enableTime) {
177
+ y("update:modelValue", `${e}-${t}-${a}`);
178
+ return;
179
+ }
180
+ const [v = "00", f = "00"] = k.value.split(":"), h = `${e}-${t}-${a}T${v}:${f}`;
181
+ y("update:modelValue", h);
182
+ }
183
+ function oe() {
184
+ i.value = g.getMonth(), u.value = g.getFullYear(), j(g.getDate());
185
+ }
186
+ function ie() {
187
+ c.value = null, k.value = "00:00", D.value = !1, y("update:modelValue", ""), y("validation-error", null);
188
+ }
189
+ _(() => r.modelValue, (n) => {
190
+ if (n) {
191
+ const e = S(n);
192
+ if (e) {
193
+ c.value = e;
194
+ const t = String(e.getHours()).padStart(2, "0"), a = String(e.getMinutes()).padStart(2, "0");
195
+ k.value = `${t}:${a}`, i.value = e.getMonth(), u.value = e.getFullYear(), L(e);
196
+ }
197
+ } else
198
+ c.value = null, D.value = !1;
199
+ }, { immediate: !0 }), _(k, (n) => {
200
+ if (!r.enableTime || !c.value) return;
201
+ const [e = "00", t = "00"] = (n || "00:00").split(":");
202
+ c.value.setHours(parseInt(e, 10) || 0, parseInt(t, 10) || 0, 0, 0), P(c.value);
203
+ });
204
+ function q() {
205
+ m.value && R();
206
+ }
207
+ function W(n) {
208
+ n.key === "Escape" && m.value && A();
209
+ }
210
+ return le(() => {
211
+ document.addEventListener("keydown", W), window.addEventListener("resize", q);
212
+ }), se(() => {
213
+ document.removeEventListener("keydown", W), window.removeEventListener("resize", q);
214
+ }), (n, e) => (l(), s("div", ge, [
215
+ o("div", be, [
216
+ o("input", {
217
+ id: d.id,
218
+ ref_key: "inputRef",
219
+ ref: Y,
220
+ type: "text",
221
+ value: N.value,
222
+ readonly: "",
223
+ disabled: d.disabled,
224
+ placeholder: d.placeholder,
225
+ required: d.required,
226
+ "aria-describedby": d.ariaDescribedby,
227
+ class: T([
228
+ "w-full px-3 py-2 pr-10 border rounded-md ui-surface ui-text placeholder-slate-400 text-sm ",
229
+ "focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-(--ui-primary) cursor-pointer transition-colors",
230
+ "disabled:bg-(--ui-bg) disabled:text-(--ui-text) disabled:cursor-not-allowed",
231
+ D.value ? "border-(--ui-danger) focus:ring-(--ui-danger) focus:border-(--ui-danger)" : "ui-border"
232
+ ]),
233
+ onClick: ne
234
+ }, null, 10, ye),
235
+ e[2] || (e[2] = o("div", { class: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none" }, [
236
+ o("svg", {
237
+ class: "w-4 h-4 ui-text",
238
+ fill: "none",
239
+ stroke: "currentColor",
240
+ viewBox: "0 0 24 24"
241
+ }, [
242
+ o("path", {
243
+ "stroke-linecap": "round",
244
+ "stroke-linejoin": "round",
245
+ "stroke-width": "2",
246
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
247
+ })
248
+ ])
249
+ ], -1)),
250
+ d.clearable && N.value && !d.disabled ? (l(), s("button", {
251
+ key: 0,
252
+ type: "button",
253
+ class: "absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-(--ui-bg) rounded transition-colors",
254
+ "aria-label": "Clear date",
255
+ onClick: U(ie, ["stop"])
256
+ }, [...e[1] || (e[1] = [
257
+ o("svg", {
258
+ class: "w-3.5 h-3.5 ui-text",
259
+ fill: "none",
260
+ stroke: "currentColor",
261
+ viewBox: "0 0 24 24"
262
+ }, [
263
+ o("path", {
264
+ "stroke-linecap": "round",
265
+ "stroke-linejoin": "round",
266
+ "stroke-width": "2",
267
+ d: "M6 18L18 6M6 6l12 12"
268
+ })
269
+ ], -1)
270
+ ])])) : M("", !0)
271
+ ]),
272
+ (l(), ue(de, { to: "body" }, [
273
+ ce(fe, {
274
+ "enter-active-class": "transition ease-out duration-100",
275
+ "enter-from-class": "transform opacity-0 scale-95",
276
+ "enter-to-class": "transform opacity-100 scale-100",
277
+ "leave-active-class": "transition ease-in duration-75",
278
+ "leave-from-class": "transform opacity-100 scale-100",
279
+ "leave-to-class": "transform opacity-0 scale-95"
280
+ }, {
281
+ default: ve(() => [
282
+ m.value ? (l(), s("div", {
283
+ key: 0,
284
+ ref_key: "calendarRef",
285
+ ref: B,
286
+ style: me(F.value),
287
+ class: T(["fixed z-10000 rounded-lg shadow-xl p-3 ui-surface ui-border-strong", d.enableTime ? "w-[420px]" : "w-64"]),
288
+ onClick: e[0] || (e[0] = U(() => {
289
+ }, ["stop"]))
290
+ }, [
291
+ o("div", {
292
+ class: T(d.enableTime ? "grid grid-cols-[1fr_124px] gap-3" : "block")
293
+ }, [
294
+ o("div", null, [
295
+ o("div", he, [
296
+ o("button", {
297
+ type: "button",
298
+ class: "p-1.5 rounded hover:bg-(--ui-bg) transition-colors",
299
+ "aria-label": "Previous Month",
300
+ onClick: ae
301
+ }, [...e[3] || (e[3] = [
302
+ o("svg", {
303
+ class: "w-4 h-4 ui-text",
304
+ fill: "none",
305
+ stroke: "currentColor",
306
+ viewBox: "0 0 24 24"
307
+ }, [
308
+ o("path", {
309
+ "stroke-linecap": "round",
310
+ "stroke-linejoin": "round",
311
+ "stroke-width": "2",
312
+ d: "M15 18l-6-6 6-6"
313
+ })
314
+ ], -1)
315
+ ])]),
316
+ o("div", xe, w(K.value) + " " + w(u.value), 1),
317
+ o("button", {
318
+ type: "button",
319
+ class: "p-1.5 rounded hover:bg-(--ui-bg) transition-colors",
320
+ "aria-label": "Next Month",
321
+ onClick: re
322
+ }, [...e[4] || (e[4] = [
323
+ o("svg", {
324
+ class: "w-4 h-4 ui-text",
325
+ fill: "none",
326
+ stroke: "currentColor",
327
+ viewBox: "0 0 24 24"
328
+ }, [
329
+ o("path", {
330
+ "stroke-linecap": "round",
331
+ "stroke-linejoin": "round",
332
+ "stroke-width": "2",
333
+ d: "M9 18l6-6-6-6"
334
+ })
335
+ ], -1)
336
+ ])])
337
+ ]),
338
+ o("div", we, [
339
+ (l(), s(C, null, V(J, (t) => o("div", {
340
+ key: t,
341
+ class: "text-center text-xs font-medium ui-text py-1"
342
+ }, w(t), 1)), 64))
343
+ ]),
344
+ o("div", De, [
345
+ (l(!0), s(C, null, V(E.value, (t, a) => (l(), s("div", {
346
+ key: "prev-" + a,
347
+ class: "text-center text-xs ui-text py-1.5"
348
+ }, w(t), 1))), 128)),
349
+ (l(!0), s(C, null, V(I.value, (t) => (l(), s("button", {
350
+ key: t,
351
+ type: "button",
352
+ disabled: $(t),
353
+ class: T([
354
+ "w-8 h-8 rounded text-xs font-medium transition-colors",
355
+ te(t) && !H(t) ? "ui-primary-soft ui-primary ring-1 ring-(--ui-primary)" : "",
356
+ H(t) ? "ui-primary-bg ui-text hover:bg-(--ui-primary)" : "ui-text hover:bg-(--ui-bg)",
357
+ $(t) ? "ui-text cursor-not-allowed hover:bg-transparent line-through" : "cursor-pointer"
358
+ ]),
359
+ onClick: (a) => j(t)
360
+ }, w(t), 11, ke))), 128)),
361
+ (l(!0), s(C, null, V(X.value, (t, a) => (l(), s("div", {
362
+ key: "next-" + a,
363
+ class: "text-center text-xs ui-text py-1.5"
364
+ }, w(t), 1))), 128))
365
+ ]),
366
+ d.showToday ? (l(), s("div", Se, [
367
+ o("button", {
368
+ type: "button",
369
+ class: "w-full px-3 py-1.5 text-xs font-medium ui-primary hover:bg-(--ui-primary-soft) rounded transition-colors",
370
+ onClick: oe
371
+ }, " Today ")
372
+ ])) : M("", !0)
373
+ ]),
374
+ d.enableTime ? (l(), s("div", Me, [
375
+ e[5] || (e[5] = o("div", { class: "text-xs font-semibold ui-text mb-2" }, "Time", -1)),
376
+ o("div", Te, [
377
+ (l(!0), s(C, null, V(Z.value, (t) => (l(), s("button", {
378
+ key: t,
379
+ type: "button",
380
+ class: T(["w-full px-2 py-1.5 text-left text-sm rounded transition-colors", t === k.value ? "ui-primary-bg ui-text" : "ui-text hover:bg-(--ui-bg)"]),
381
+ onClick: (a) => k.value = t
382
+ }, w(t), 11, Ce))), 128))
383
+ ])
384
+ ])) : M("", !0)
385
+ ], 2)
386
+ ], 6)) : M("", !0)
387
+ ]),
388
+ _: 1
389
+ }),
390
+ m.value ? (l(), s("div", {
391
+ key: 0,
392
+ class: "fixed inset-0 z-9999",
393
+ onClick: A
394
+ })) : M("", !0)
395
+ ]))
396
+ ]));
397
+ }
398
+ };
399
+ export {
400
+ $e as default
401
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),n=require("class-variance-authority"),o=require("../utils/cn.cjs"),l={key:0,class:"px-3 text-sm ui-text ui-surface dark:bg-(----ui-bg) dark:text-(--ui-text) relative z-10"},s={__name:"Divider",props:{orientation:{type:String,default:"horizontal",validator:e=>["horizontal","vertical"].includes(e)},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},color:{type:String,default:"gray",validator:e=>["gray","primary","secondary"].includes(e)},faded:{type:Boolean,default:!1},label:{type:String,default:null},spacing:{type:String,default:null}},setup(e){const i=e,a=n.cva("divider relative flex items-center",{variants:{orientation:{horizontal:"w-full h-px flex items-center",vertical:"h-full w-px"},size:{sm:"",md:"",lg:""},color:{gray:"ui-bg dark:bg-(--ui-bg)",primary:"ui-primary-bg",secondary:"ui-bg"}},compoundVariants:[{orientation:"horizontal",size:"sm",class:"my-2"},{orientation:"horizontal",size:"md",class:"my-4"},{orientation:"horizontal",size:"lg",class:"my-6"},{orientation:"vertical",size:"sm",class:"mx-2"},{orientation:"vertical",size:"md",class:"mx-4"},{orientation:"vertical",size:"lg",class:"mx-6"}],defaultVariants:{orientation:"horizontal",size:"md",color:"gray"}}),r=t.computed(()=>i.spacing?i.spacing:"");return(c,u)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(o.cn)(t.unref(a)({orientation:e.orientation,size:e.size,color:e.color}),{"opacity-50":e.faded},r.value))},[e.label&&e.orientation==="horizontal"?(t.openBlock(),t.createElementBlock("span",l,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0)],2))}};exports.default=s;
@@ -0,0 +1,103 @@
1
+ import { computed as l, createElementBlock as e, openBlock as a, normalizeClass as s, unref as o, createCommentVNode as c, toDisplayString as d } from "vue";
2
+ import { cva as m } from "class-variance-authority";
3
+ import { cn as u } from "../utils/cn.js";
4
+ const g = {
5
+ key: 0,
6
+ class: "px-3 text-sm ui-text ui-surface dark:bg-(----ui-bg) dark:text-(--ui-text) relative z-10"
7
+ }, x = {
8
+ __name: "Divider",
9
+ props: {
10
+ orientation: {
11
+ type: String,
12
+ default: "horizontal",
13
+ validator: (t) => ["horizontal", "vertical"].includes(t)
14
+ },
15
+ size: {
16
+ type: String,
17
+ default: "md",
18
+ validator: (t) => ["sm", "md", "lg"].includes(t)
19
+ },
20
+ color: {
21
+ type: String,
22
+ default: "gray",
23
+ validator: (t) => ["gray", "primary", "secondary"].includes(t)
24
+ },
25
+ faded: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ label: {
30
+ type: String,
31
+ default: null
32
+ },
33
+ spacing: {
34
+ type: String,
35
+ default: null
36
+ }
37
+ },
38
+ setup(t) {
39
+ const i = t, r = m("divider relative flex items-center", {
40
+ variants: {
41
+ orientation: {
42
+ horizontal: "w-full h-px flex items-center",
43
+ vertical: "h-full w-px"
44
+ },
45
+ size: {
46
+ sm: "",
47
+ md: "",
48
+ lg: ""
49
+ },
50
+ color: {
51
+ gray: "ui-bg dark:bg-(--ui-bg)",
52
+ primary: "ui-primary-bg",
53
+ secondary: "ui-bg"
54
+ }
55
+ },
56
+ compoundVariants: [
57
+ {
58
+ orientation: "horizontal",
59
+ size: "sm",
60
+ class: "my-2"
61
+ },
62
+ {
63
+ orientation: "horizontal",
64
+ size: "md",
65
+ class: "my-4"
66
+ },
67
+ {
68
+ orientation: "horizontal",
69
+ size: "lg",
70
+ class: "my-6"
71
+ },
72
+ {
73
+ orientation: "vertical",
74
+ size: "sm",
75
+ class: "mx-2"
76
+ },
77
+ {
78
+ orientation: "vertical",
79
+ size: "md",
80
+ class: "mx-4"
81
+ },
82
+ {
83
+ orientation: "vertical",
84
+ size: "lg",
85
+ class: "mx-6"
86
+ }
87
+ ],
88
+ defaultVariants: {
89
+ orientation: "horizontal",
90
+ size: "md",
91
+ color: "gray"
92
+ }
93
+ }), n = l(() => i.spacing ? i.spacing : "");
94
+ return (f, y) => (a(), e("div", {
95
+ class: s(o(u)(o(r)({ orientation: t.orientation, size: t.size, color: t.color }), { "opacity-50": t.faded }, n.value))
96
+ }, [
97
+ t.label && t.orientation === "horizontal" ? (a(), e("span", g, d(t.label), 1)) : c("", !0)
98
+ ], 2));
99
+ }
100
+ };
101
+ export {
102
+ x as default
103
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("class-variance-authority"),l=require("../utils/cn.cjs"),f=require("./Icon.cjs"),v=["aria-expanded"],g={__name:"Dropdown",props:{triggerText:{type:String,default:"Options"},placement:{type:String,default:"bottom-start",validator:t=>["bottom-start","bottom-end","top-start","top-end"].includes(t)},variant:{type:String,default:"default",validator:t=>["default","outline","ghost"].includes(t)}},setup(t){const n=t,o=e.ref(!1),r=e.ref(null),c=i.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ui-primary) focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"ui-text ui-primary-bg hover:bg-(--ui-primary-strong)",outline:" border ui-text ui-surface hover:brightness-105",ghost:"ui-text hover:bg-(--ui-surface) hover:text-(--ui-text)"}}}),u=i.cva("absolute z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 ui-text shadow-md",{variants:{placement:{"bottom-start":"top-full left-0 mt-1","bottom-end":"top-full right-0 mt-1","top-start":"bottom-full left-0 mb-1","top-end":"bottom-full right-0 mb-1"}}}),d=e.computed(()=>l.cn(c({variant:n.variant}),"h-10 px-4 py-2")),m=e.computed(()=>l.cn(u({placement:n.placement}))),p=()=>{o.value=!o.value},s=a=>{r.value&&!r.value.contains(a.target)&&(o.value=!1)};return e.onMounted(()=>{document.addEventListener("click",s)}),e.onUnmounted(()=>{document.removeEventListener("click",s)}),(a,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropdownRef",ref:r,class:"relative"},[e.createElementVNode("button",{class:e.normalizeClass(d.value),"aria-expanded":o.value,"aria-haspopup":!0,onClick:p},[e.renderSlot(a.$slots,"trigger",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.triggerText),1),e.createVNode(f.default,{name:"chevron-down",class:"ml-2 h-4 w-4"})])],10,v),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(m.value),role:"menu","aria-orientation":"vertical"},[e.renderSlot(a.$slots,"default")],2)):e.createCommentVNode("",!0)]),_:3})],512))}};exports.default=g;
@@ -0,0 +1,104 @@
1
+ import { ref as s, computed as i, onMounted as w, onUnmounted as _, createElementBlock as l, openBlock as c, createElementVNode as d, createVNode as u, normalizeClass as m, renderSlot as p, toDisplayString as k, Transition as C, withCtx as S, createCommentVNode as V } from "vue";
2
+ import { cva as f } from "class-variance-authority";
3
+ import { cn as v } from "../utils/cn.js";
4
+ import D from "./Icon.js";
5
+ const E = ["aria-expanded"], L = {
6
+ __name: "Dropdown",
7
+ props: {
8
+ triggerText: {
9
+ type: String,
10
+ default: "Options"
11
+ },
12
+ placement: {
13
+ type: String,
14
+ default: "bottom-start",
15
+ validator: (t) => ["bottom-start", "bottom-end", "top-start", "top-end"].includes(t)
16
+ },
17
+ variant: {
18
+ type: String,
19
+ default: "default",
20
+ validator: (t) => ["default", "outline", "ghost"].includes(t)
21
+ }
22
+ },
23
+ setup(t) {
24
+ const r = t, e = s(!1), a = s(null), g = f(
25
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--ui-primary) focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
26
+ {
27
+ variants: {
28
+ variant: {
29
+ default: "ui-text ui-primary-bg hover:bg-(--ui-primary-strong)",
30
+ outline: " border ui-text ui-surface hover:brightness-105",
31
+ ghost: "ui-text hover:bg-(--ui-surface) hover:text-(--ui-text)"
32
+ }
33
+ }
34
+ }
35
+ ), b = f(
36
+ "absolute z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 ui-text shadow-md",
37
+ {
38
+ variants: {
39
+ placement: {
40
+ "bottom-start": "top-full left-0 mt-1",
41
+ "bottom-end": "top-full right-0 mt-1",
42
+ "top-start": "bottom-full left-0 mb-1",
43
+ "top-end": "bottom-full right-0 mb-1"
44
+ }
45
+ }
46
+ }
47
+ ), h = i(
48
+ () => v(g({ variant: r.variant }), "h-10 px-4 py-2")
49
+ ), y = i(
50
+ () => v(b({ placement: r.placement }))
51
+ ), x = () => {
52
+ e.value = !e.value;
53
+ }, n = (o) => {
54
+ a.value && !a.value.contains(o.target) && (e.value = !1);
55
+ };
56
+ return w(() => {
57
+ document.addEventListener("click", n);
58
+ }), _(() => {
59
+ document.removeEventListener("click", n);
60
+ }), (o, N) => (c(), l("div", {
61
+ ref_key: "dropdownRef",
62
+ ref: a,
63
+ class: "relative"
64
+ }, [
65
+ d("button", {
66
+ class: m(h.value),
67
+ "aria-expanded": e.value,
68
+ "aria-haspopup": !0,
69
+ onClick: x
70
+ }, [
71
+ p(o.$slots, "trigger", {}, () => [
72
+ d("span", null, k(t.triggerText), 1),
73
+ u(D, {
74
+ name: "chevron-down",
75
+ class: "ml-2 h-4 w-4"
76
+ })
77
+ ])
78
+ ], 10, E),
79
+ u(C, {
80
+ "enter-active-class": "transition ease-out duration-100",
81
+ "enter-from-class": "transform opacity-0 scale-95",
82
+ "enter-to-class": "transform opacity-100 scale-100",
83
+ "leave-active-class": "transition ease-in duration-75",
84
+ "leave-from-class": "transform opacity-100 scale-100",
85
+ "leave-to-class": "transform opacity-0 scale-95"
86
+ }, {
87
+ default: S(() => [
88
+ e.value ? (c(), l("div", {
89
+ key: 0,
90
+ class: m(y.value),
91
+ role: "menu",
92
+ "aria-orientation": "vertical"
93
+ }, [
94
+ p(o.$slots, "default")
95
+ ], 2)) : V("", !0)
96
+ ]),
97
+ _: 3
98
+ })
99
+ ], 512));
100
+ }
101
+ };
102
+ export {
103
+ L as default
104
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("class-variance-authority"),u=require("../utils/cn.cjs"),d=require("./Icon.cjs"),m={key:1,class:"ml-auto text-xs tracking-widest opacity-60"},f={__name:"DropdownItem",props:{href:String,icon:String,shortcut:String,disabled:Boolean,variant:{type:String,default:"default",validator:t=>["default","danger"].includes(t)}},emits:["click"],setup(t,{emit:o}){const n=t,i=o,r=l.cva("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-(--ui-surface) focus:text-(--ui-text) data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{variant:{default:"hover:bg-(--ui-surface) hover:text-(--ui-text)",danger:"ui-danger hover:bg-(--ui-danger-soft) hover:text-(--ui-danger)"}}}),c=e.computed(()=>u.cn(r({variant:n.variant}))),s=a=>{n.disabled||i("click",a)};return(a,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.href?"a":"button"),{href:t.href,class:e.normalizeClass(c.value),disabled:t.disabled,role:"menuitem",onClick:s},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createBlock(d.default,{key:0,name:t.icon,class:"mr-2 h-4 w-4"},null,8,["name"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.shortcut?(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)]),_:3},8,["href","class","disabled"]))}};exports.default=f;