@talentlytica/prodigy 1.0.0 → 1.1.1

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 (34) hide show
  1. package/README.md +21 -12
  2. package/dist/components/BarChart/BarChart.d.ts +6 -0
  3. package/dist/components/Carousel/Carousel.d.ts +5 -0
  4. package/dist/components/CloseButton/CloseButton.d.ts +6 -0
  5. package/dist/components/ColorSwatch/ColorSwatch.d.ts +6 -0
  6. package/dist/components/DataTable/DataTable.d.ts +22 -0
  7. package/dist/components/DatePickerInput/DatePickerInput.d.ts +18 -0
  8. package/dist/components/DateTimePicker/DateTimePicker.d.ts +9 -0
  9. package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +10 -0
  10. package/dist/components/DonutChart/DonutChart.d.ts +6 -0
  11. package/dist/components/Dropzone/Dropzone.d.ts +8 -0
  12. package/dist/components/EmptyState/EmptyState.d.ts +8 -0
  13. package/dist/components/FileButton/FileButton.d.ts +6 -0
  14. package/dist/components/FileInput/FileInput.d.ts +6 -0
  15. package/dist/components/Loader/Loader.d.ts +6 -0
  16. package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +6 -0
  17. package/dist/components/MultiSelect/MultiSelect.d.ts +7 -0
  18. package/dist/components/NativeSelect/NativeSelect.d.ts +7 -0
  19. package/dist/components/Notification/Notification.d.ts +7 -0
  20. package/dist/components/NotificationsSystem/NotificationsSystem.d.ts +9 -0
  21. package/dist/components/Pill/Pill.d.ts +7 -0
  22. package/dist/components/Popover/Popover.d.ts +6 -0
  23. package/dist/components/RichTextEditor/RichTextEditor.d.ts +16 -0
  24. package/dist/components/RingProgress/RingProgress.d.ts +6 -0
  25. package/dist/components/SegmentedControl/SegmentedControl.d.ts +7 -0
  26. package/dist/components/Skeleton/Skeleton.d.ts +6 -0
  27. package/dist/components/Stepper/Stepper.d.ts +7 -0
  28. package/dist/components/Table/Table.d.ts +2 -3
  29. package/dist/components/TagsInput/TagsInput.d.ts +6 -0
  30. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +7 -0
  31. package/dist/components/index.d.ts +39 -11
  32. package/dist/index.js +784 -19
  33. package/dist/themes/kelola.d.ts +1 -1
  34. package/package.json +54 -2
package/dist/index.js CHANGED
@@ -1,5 +1,17 @@
1
- import { ActionIcon as e, ActionIcon as t, Alert as ee, Alert as n, Anchor as r, Anchor as i, AppShell as a, Avatar as o, Avatar as s, Badge as c, Badge as l, Box as u, Breadcrumbs as d, Burger as f, Button as p, Button as m, Card as h, Card as g, Center as _, Checkbox as v, Container as y, Divider as b, Flex as x, Grid as S, Group as C, Image as w, Indicator as te, Input as T, Menu as E, Menu as D, Modal as O, Modal as k, NavLink as A, NumberInput as j, Pagination as M, Paper as N, PasswordInput as P, Progress as F, Radio as I, ScrollArea as L, Select as R, SimpleGrid as z, Stack as B, Switch as V, Table as H, Table as U, Tabs as W, Text as G, TextInput as K, Textarea as q, ThemeIcon as J, Title as Y, Tooltip as X, Tooltip as Z, createTheme as Q } from "@mantine/core";
2
- var $ = Q({
1
+ import { ActionIcon as e, ActionIcon as t, Alert as n, Alert as r, Anchor as i, Anchor as a, AppShell as o, Avatar as s, Avatar as c, Badge as l, Badge as u, Box as d, Box as f, Breadcrumbs as p, Burger as m, Button as h, Button as g, Card as _, Card as v, Center as y, Checkbox as b, CloseButton as x, ColorSwatch as S, Container as C, Divider as w, EmptyState as T, FileButton as E, FileInput as D, Flex as O, Grid as ee, Group as k, Group as A, Image as te, Indicator as ne, Input as re, Loader as ie, LoadingOverlay as ae, Menu as oe, Menu as se, Modal as ce, Modal as le, MultiSelect as ue, NativeSelect as de, NavLink as fe, Notification as pe, NumberInput as me, Pagination as j, Paper as he, PasswordInput as ge, Pill as _e, Popover as ve, Popover as M, Progress as ye, Radio as be, RingProgress as xe, ScrollArea as Se, SegmentedControl as Ce, SegmentedControl as we, Select as Te, Select as N, SimpleGrid as Ee, Skeleton as De, Stack as P, Stepper as Oe, Switch as ke, Table as F, Table as Ae, Tabs as je, TagsInput as Me, Text as I, Text as L, TextInput as R, Textarea as Ne, ThemeIcon as Pe, Title as Fe, Tooltip as Ie, Tooltip as Le, UnstyledButton as z, VisuallyHidden as Re, createTheme as ze } from "@mantine/core";
2
+ import { DatePickerInput as Be, DateTimePicker as Ve } from "@mantine/dates";
3
+ import { jsx as B, jsxs as V } from "react/jsx-runtime";
4
+ import { useEffect as He, useState as H } from "react";
5
+ import { IconCalendar as U, IconChevronDown as Ue, IconChevronLeft as W, IconChevronRight as G, IconChevronUp as We, IconSearch as Ge, IconSelector as Ke, IconX as K } from "@tabler/icons-react";
6
+ import { Dropzone as qe } from "@mantine/dropzone";
7
+ import { useEditor as Je } from "@tiptap/react";
8
+ import Ye from "@tiptap/starter-kit";
9
+ import { Link as Xe, RichTextEditor as q } from "@mantine/tiptap";
10
+ import { Notifications as Ze, notifications as Qe } from "@mantine/notifications";
11
+ import { flexRender as J, getCoreRowModel as $e, getFilteredRowModel as et, getPaginationRowModel as tt, getSortedRowModel as nt, useReactTable as rt } from "@tanstack/react-table";
12
+ import { Carousel as it } from "@mantine/carousel";
13
+ import { BarChart as at, DonutChart as ot } from "@mantine/charts";
14
+ var Y = ze({
3
15
  primaryColor: "primary",
4
16
  primaryShade: 5,
5
17
  colors: {
@@ -145,47 +157,800 @@ var $ = Q({
145
157
  cursorType: "pointer",
146
158
  other: { appBackground: "#F7F7F7" },
147
159
  components: {
148
- Button: m.extend({
160
+ Button: g.extend({
149
161
  defaultProps: {
150
162
  variant: "filled",
151
163
  size: "sm",
152
164
  radius: "xl"
153
165
  },
154
- styles: { label: { fontWeight: 700 } }
166
+ styles: { label: { fontWeight: 700 } },
167
+ vars: (e, t) => t.variant === "subtle" ? { root: { "--button-color": `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : { root: {} }
155
168
  }),
156
- Input: T.extend({ defaultProps: { radius: "xl" } }),
157
- Badge: l.extend({ defaultProps: {
158
- variant: "light",
159
- radius: "xl"
160
- } }),
161
- Avatar: s.extend({ defaultProps: { radius: 9999 } }),
162
- Alert: n.extend({ defaultProps: { variant: "light" } }),
163
- Anchor: i.extend({ defaultProps: { underline: "hover" } }),
164
- Card: g.extend({ defaultProps: {
169
+ Input: re.extend({ defaultProps: { radius: "xl" } }),
170
+ Badge: u.extend({
171
+ defaultProps: {
172
+ variant: "light",
173
+ radius: "xl"
174
+ },
175
+ vars: (e, t) => t.variant === "light" ? { root: { "--badge-color": `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : { root: {} },
176
+ styles: (e, t) => t.variant === "dot" ? { label: { color: `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : {}
177
+ }),
178
+ Avatar: c.extend({ defaultProps: { radius: 9999 } }),
179
+ Alert: r.extend({ defaultProps: { variant: "light" } }),
180
+ Anchor: a.extend({ defaultProps: { underline: "hover" } }),
181
+ Card: v.extend({ defaultProps: {
165
182
  withBorder: !0,
166
183
  shadow: "md",
167
184
  radius: "md",
168
185
  padding: "lg"
169
186
  } }),
170
- Tooltip: Z.extend({ defaultProps: { withArrow: !0 } }),
187
+ Tooltip: Le.extend({ defaultProps: { withArrow: !0 } }),
171
188
  ActionIcon: t.extend({ defaultProps: {
172
189
  variant: "subtle",
173
190
  color: "gray"
174
191
  } }),
175
- Menu: D.extend({ defaultProps: {
192
+ Menu: se.extend({ defaultProps: {
176
193
  shadow: "md",
177
194
  radius: "md"
178
195
  } }),
179
- Modal: k.extend({ defaultProps: {
196
+ Modal: le.extend({ defaultProps: {
180
197
  centered: !0,
181
198
  radius: "md"
182
199
  } }),
183
- Table: U.extend({ defaultProps: {
200
+ Table: Ae.extend({ defaultProps: {
184
201
  highlightOnHover: !0,
185
202
  verticalSpacing: "sm",
186
203
  horizontalSpacing: "md"
187
- } })
204
+ } }),
205
+ SegmentedControl: we.extend({ defaultProps: { radius: "xl" } })
188
206
  }
189
207
  });
190
208
  //#endregion
191
- export { e as ActionIcon, ee as Alert, r as Anchor, a as AppShell, o as Avatar, c as Badge, u as Box, d as Breadcrumbs, f as Burger, p as Button, h as Card, _ as Center, v as Checkbox, y as Container, b as Divider, x as Flex, S as Grid, C as Group, w as Image, te as Indicator, E as Menu, O as Modal, A as NavLink, j as NumberInput, M as Pagination, N as Paper, P as PasswordInput, F as Progress, I as Radio, L as ScrollArea, R as Select, z as SimpleGrid, B as Stack, V as Switch, H as Table, W as Tabs, G as Text, K as TextInput, q as Textarea, J as ThemeIcon, Y as Title, X as Tooltip, $ as kelolaTheme, $ as theme };
209
+ //#region src/components/DatePickerInput/DatePickerInput.tsx
210
+ function st(e) {
211
+ let { withTime: t, ...n } = e;
212
+ return B(t ? Ve : Be, { ...n });
213
+ }
214
+ //#endregion
215
+ //#region src/components/DateTimePicker/DateTimePicker.tsx
216
+ var ct = [
217
+ "January",
218
+ "February",
219
+ "March",
220
+ "April",
221
+ "May",
222
+ "June",
223
+ "July",
224
+ "August",
225
+ "September",
226
+ "October",
227
+ "November",
228
+ "December"
229
+ ], lt = [
230
+ "Mo",
231
+ "Tu",
232
+ "We",
233
+ "Th",
234
+ "Fr",
235
+ "Sa",
236
+ "Su"
237
+ ];
238
+ function ut(e, t) {
239
+ return new Date(e, t + 1, 0).getDate();
240
+ }
241
+ function dt(e, t) {
242
+ let n = new Date(e, t, 1).getDay();
243
+ return n === 0 ? 6 : n - 1;
244
+ }
245
+ function ft(e) {
246
+ return e === 5 || e === 6;
247
+ }
248
+ function pt(e, t, n) {
249
+ return e ? `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}/${e.getFullYear()} ${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}` : "";
250
+ }
251
+ function mt({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
252
+ let i = ut(e, t), a = dt(e, t), o = ut(e, t - 1), s = [];
253
+ for (let e = a - 1; e >= 0; e--) s.push({
254
+ day: o - e,
255
+ month: "prev"
256
+ });
257
+ for (let e = 1; e <= i; e++) s.push({
258
+ day: e,
259
+ month: "current"
260
+ });
261
+ let c = 42 - s.length;
262
+ for (let e = 1; e <= c; e++) s.push({
263
+ day: e,
264
+ month: "next"
265
+ });
266
+ let l = /* @__PURE__ */ new Date(), u = new Date(l.getFullYear(), l.getMonth(), l.getDate()).getTime();
267
+ return /* @__PURE__ */ V(f, {
268
+ style: { width: 252 },
269
+ children: [/* @__PURE__ */ B(f, {
270
+ style: {
271
+ display: "grid",
272
+ gridTemplateColumns: "repeat(7, 36px)",
273
+ marginBottom: 4
274
+ },
275
+ children: lt.map((e, t) => /* @__PURE__ */ B(L, {
276
+ fz: 10,
277
+ ta: "center",
278
+ c: t >= 5 ? "red.6" : "neutral.5",
279
+ style: { lineHeight: "28px" },
280
+ children: e
281
+ }, e))
282
+ }), /* @__PURE__ */ B(f, {
283
+ style: {
284
+ display: "grid",
285
+ gridTemplateColumns: "repeat(7, 36px)"
286
+ },
287
+ children: s.map((i, a) => {
288
+ let o = a % 7, s = i.month === "current", c = !!(s && n && n.getDate() === i.day && n.getMonth() === t && n.getFullYear() === e), d = s && l.getDate() === i.day && l.getMonth() === t && l.getFullYear() === e, f = s && new Date(e, t, i.day).getTime() < u, p = !s || f, m = ft(o);
289
+ return /* @__PURE__ */ B(z, {
290
+ onClick: () => !p && r(i.day),
291
+ style: {
292
+ width: 36,
293
+ height: 36,
294
+ display: "flex",
295
+ alignItems: "center",
296
+ justifyContent: "center",
297
+ borderRadius: "50%",
298
+ background: c ? "var(--mantine-primary-color-5)" : "transparent",
299
+ cursor: p ? "not-allowed" : "pointer",
300
+ outline: d && !c ? "2px solid var(--mantine-primary-color-5)" : "none"
301
+ },
302
+ children: /* @__PURE__ */ B(L, {
303
+ fz: 13,
304
+ td: f ? "line-through" : void 0,
305
+ c: c ? "white" : p ? "neutral.3" : m ? "red.6" : "neutral.7",
306
+ children: i.day
307
+ })
308
+ }, a);
309
+ })
310
+ })]
311
+ });
312
+ }
313
+ function ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
314
+ let i = e instanceof Date ? e : /* @__PURE__ */ new Date(), [a, o] = H(!1), [s, c] = H(i.getFullYear()), [l, u] = H(i.getMonth()), [d, p] = H(e instanceof Date ? e : null), [m, h] = H(e instanceof Date ? e.getHours() : 0), [g, _] = H(e instanceof Date ? e.getMinutes() : 0), v = /* @__PURE__ */ new Date(), y = !!(d && d.getDate() === v.getDate() && d.getMonth() === v.getMonth() && d.getFullYear() === v.getFullYear()), b = Array.from({ length: 24 }, (e, t) => ({
315
+ value: String(t),
316
+ label: String(t).padStart(2, "0"),
317
+ disabled: y && t < v.getHours()
318
+ })), x = Array.from({ length: 60 }, (e, t) => ({
319
+ value: String(t),
320
+ label: String(t).padStart(2, "0"),
321
+ disabled: y && m === v.getHours() && t < v.getMinutes()
322
+ })), S = () => {
323
+ l === 0 ? (u(11), c((e) => e - 1)) : u((e) => e - 1);
324
+ }, C = () => {
325
+ l === 11 ? (u(0), c((e) => e + 1)) : u((e) => e + 1);
326
+ }, w = (e) => {
327
+ let t = m, r = g, i = new Date(s, l, e);
328
+ i.getDate() === v.getDate() && i.getMonth() === v.getMonth() && i.getFullYear() === v.getFullYear() && (t < v.getHours() || t === v.getHours() && r < v.getMinutes()) && (t = v.getHours(), r = v.getMinutes(), h(t), _(r));
329
+ let a = new Date(s, l, e, t, r);
330
+ p(a), n?.(a);
331
+ }, T = (e) => {
332
+ let t = Number(e);
333
+ if (h(t), d) {
334
+ let e = new Date(d);
335
+ e.setHours(t), p(e), n?.(e);
336
+ }
337
+ }, E = (e) => {
338
+ let t = Number(e);
339
+ if (_(t), d) {
340
+ let e = new Date(d);
341
+ e.setMinutes(t), p(e), n?.(e);
342
+ }
343
+ }, D = (e) => {
344
+ e.stopPropagation(), p(null), h(0), _(0), n?.(null);
345
+ }, O = pt(d, m, g);
346
+ return /* @__PURE__ */ V(M, {
347
+ opened: a,
348
+ onChange: o,
349
+ position: "bottom-start",
350
+ offset: 4,
351
+ shadow: "md",
352
+ radius: "md",
353
+ trapFocus: !0,
354
+ children: [/* @__PURE__ */ B(M.Target, { children: /* @__PURE__ */ V(f, {
355
+ onClick: () => o((e) => !e),
356
+ style: {
357
+ display: "flex",
358
+ alignItems: "center",
359
+ gap: 8,
360
+ height: 36,
361
+ padding: "0 16px",
362
+ borderRadius: 999,
363
+ border: "1px solid var(--mantine-color-gray-4)",
364
+ background: "var(--mantine-color-white)",
365
+ cursor: "pointer",
366
+ userSelect: "none",
367
+ minWidth: 0
368
+ },
369
+ children: [
370
+ /* @__PURE__ */ B(U, {
371
+ size: 16,
372
+ color: "var(--mantine-color-gray-5)",
373
+ style: { flexShrink: 0 }
374
+ }),
375
+ /* @__PURE__ */ B(L, {
376
+ fz: 12,
377
+ c: O ? "neutral.7" : "neutral.4",
378
+ style: {
379
+ flex: 1,
380
+ overflow: "hidden",
381
+ textOverflow: "ellipsis",
382
+ whiteSpace: "nowrap"
383
+ },
384
+ children: O || r
385
+ }),
386
+ d && /* @__PURE__ */ B(f, {
387
+ component: "span",
388
+ onClick: D,
389
+ style: {
390
+ display: "flex",
391
+ alignItems: "center",
392
+ flexShrink: 0
393
+ },
394
+ children: /* @__PURE__ */ B(K, {
395
+ size: 14,
396
+ color: "var(--mantine-color-gray-5)"
397
+ })
398
+ })
399
+ ]
400
+ }) }), /* @__PURE__ */ V(M.Dropdown, {
401
+ p: "md",
402
+ style: { minWidth: 280 },
403
+ children: [
404
+ /* @__PURE__ */ V(A, {
405
+ justify: "space-between",
406
+ align: "center",
407
+ mb: 8,
408
+ children: [
409
+ /* @__PURE__ */ B(t, {
410
+ variant: "subtle",
411
+ color: "gray",
412
+ size: "sm",
413
+ onClick: S,
414
+ children: /* @__PURE__ */ B(W, { size: 14 })
415
+ }),
416
+ /* @__PURE__ */ V(L, {
417
+ fz: 12,
418
+ fw: 700,
419
+ c: "neutral.7",
420
+ children: [
421
+ ct[l],
422
+ " ",
423
+ s
424
+ ]
425
+ }),
426
+ /* @__PURE__ */ B(t, {
427
+ variant: "subtle",
428
+ color: "gray",
429
+ size: "sm",
430
+ onClick: C,
431
+ children: /* @__PURE__ */ B(G, { size: 14 })
432
+ })
433
+ ]
434
+ }),
435
+ /* @__PURE__ */ B(mt, {
436
+ viewYear: s,
437
+ viewMonth: l,
438
+ selectedDate: d,
439
+ onSelect: w
440
+ }),
441
+ /* @__PURE__ */ B(f, { style: {
442
+ height: 1,
443
+ background: "var(--mantine-color-gray-2)",
444
+ margin: "12px 0"
445
+ } }),
446
+ /* @__PURE__ */ V(A, {
447
+ gap: 8,
448
+ align: "center",
449
+ wrap: "nowrap",
450
+ children: [
451
+ /* @__PURE__ */ B(L, {
452
+ fz: 12,
453
+ c: "neutral.6",
454
+ style: { flexShrink: 0 },
455
+ children: "Jam"
456
+ }),
457
+ /* @__PURE__ */ B(N, {
458
+ radius: "xl",
459
+ value: String(m),
460
+ onChange: T,
461
+ data: b,
462
+ w: 72,
463
+ size: "xs",
464
+ searchable: !0
465
+ }),
466
+ /* @__PURE__ */ B(L, {
467
+ fz: 12,
468
+ c: "neutral.6",
469
+ style: { flexShrink: 0 },
470
+ children: "Menit"
471
+ }),
472
+ /* @__PURE__ */ B(N, {
473
+ radius: "xl",
474
+ value: String(g),
475
+ onChange: E,
476
+ data: x,
477
+ w: 72,
478
+ size: "xs",
479
+ searchable: !0
480
+ })
481
+ ]
482
+ })
483
+ ]
484
+ })]
485
+ });
486
+ }
487
+ //#endregion
488
+ //#region src/components/DateTimeRangePicker/DateTimeRangePicker.tsx
489
+ var X = [
490
+ "January",
491
+ "February",
492
+ "March",
493
+ "April",
494
+ "May",
495
+ "June",
496
+ "July",
497
+ "August",
498
+ "September",
499
+ "October",
500
+ "November",
501
+ "December"
502
+ ], gt = [
503
+ "Mo",
504
+ "Tu",
505
+ "We",
506
+ "Th",
507
+ "Fr",
508
+ "Sa",
509
+ "Su"
510
+ ];
511
+ function _t(e, t) {
512
+ return new Date(e, t + 1, 0).getDate();
513
+ }
514
+ function vt(e, t) {
515
+ let n = new Date(e, t, 1).getDay();
516
+ return n === 0 ? 6 : n - 1;
517
+ }
518
+ function yt(e) {
519
+ return e === 5 || e === 6;
520
+ }
521
+ function Z(e, t) {
522
+ return !e || !t ? !1 : e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
523
+ }
524
+ function Q(e, t, n) {
525
+ return new Date(e, t, n).setHours(0, 0, 0, 0);
526
+ }
527
+ function bt(e) {
528
+ return e ? `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}/${e.getFullYear()} ${e.getHours().toString().padStart(2, "0")}:${e.getMinutes().toString().padStart(2, "0")}` : "";
529
+ }
530
+ function $({ viewYear: e, viewMonth: t, start: n, end: r, onSelect: i }) {
531
+ let a = _t(e, t), o = vt(e, t), s = _t(e, t - 1), c = [];
532
+ for (let e = o - 1; e >= 0; e--) c.push({
533
+ day: s - e,
534
+ month: "prev"
535
+ });
536
+ for (let e = 1; e <= a; e++) c.push({
537
+ day: e,
538
+ month: "current"
539
+ });
540
+ let l = 42 - c.length;
541
+ for (let e = 1; e <= l; e++) c.push({
542
+ day: e,
543
+ month: "next"
544
+ });
545
+ let u = /* @__PURE__ */ new Date(), d = new Date(u.getFullYear(), u.getMonth(), u.getDate()).getTime(), p = n ? Q(n.getFullYear(), n.getMonth(), n.getDate()) : null, m = r ? Q(r.getFullYear(), r.getMonth(), r.getDate()) : null;
546
+ return /* @__PURE__ */ V(f, {
547
+ style: { width: 252 },
548
+ children: [/* @__PURE__ */ B(f, {
549
+ style: {
550
+ display: "grid",
551
+ gridTemplateColumns: "repeat(7, 36px)",
552
+ marginBottom: 4
553
+ },
554
+ children: gt.map((e, t) => /* @__PURE__ */ B(L, {
555
+ fz: 10,
556
+ ta: "center",
557
+ c: t >= 5 ? "red.6" : "neutral.5",
558
+ style: { lineHeight: "28px" },
559
+ children: e
560
+ }, e))
561
+ }), /* @__PURE__ */ B(f, {
562
+ style: {
563
+ display: "grid",
564
+ gridTemplateColumns: "repeat(7, 36px)"
565
+ },
566
+ children: c.map((a, o) => {
567
+ let s = o % 7, c = a.month === "current", l = c ? Q(e, t, a.day) : null, h = c ? new Date(e, t, a.day) : null, g = c && Z(h, n), _ = c && Z(h, r), v = g || _, y = !!(c && l !== null && p !== null && m !== null && l > p && l < m), b = c && u.getDate() === a.day && u.getMonth() === t && u.getFullYear() === e, x = c && l !== null && l < d, S = !c || x, C = yt(s);
568
+ return /* @__PURE__ */ B(f, {
569
+ style: {
570
+ display: "flex",
571
+ alignItems: "center",
572
+ justifyContent: "center",
573
+ background: y ? "var(--mantine-color-primary-1)" : "transparent",
574
+ borderTopLeftRadius: g || y && s === 0 ? 999 : 0,
575
+ borderBottomLeftRadius: g || y && s === 0 ? 999 : 0,
576
+ borderTopRightRadius: _ || y && s === 6 ? 999 : 0,
577
+ borderBottomRightRadius: _ || y && s === 6 ? 999 : 0
578
+ },
579
+ children: /* @__PURE__ */ B(z, {
580
+ onClick: () => !S && i(e, t, a.day),
581
+ style: {
582
+ width: 36,
583
+ height: 36,
584
+ display: "flex",
585
+ alignItems: "center",
586
+ justifyContent: "center",
587
+ borderRadius: "50%",
588
+ background: v ? "var(--mantine-primary-color-5)" : "transparent",
589
+ cursor: S ? "not-allowed" : "pointer",
590
+ outline: b && !v ? "2px solid var(--mantine-primary-color-5)" : "none"
591
+ },
592
+ children: /* @__PURE__ */ B(L, {
593
+ fz: 13,
594
+ td: x ? "line-through" : void 0,
595
+ c: v ? "white" : S ? "neutral.3" : C ? "red.6" : "neutral.7",
596
+ children: a.day
597
+ })
598
+ })
599
+ }, o);
600
+ })
601
+ })]
602
+ });
603
+ }
604
+ function xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
605
+ let i = e?.[0] instanceof Date ? e[0] : /* @__PURE__ */ new Date(), [a, o] = H(!1), [s, c] = H(i.getFullYear()), [l, u] = H(i.getMonth()), [d, p] = H(e?.[0] instanceof Date ? e[0] : null), [m, h] = H(e?.[1] instanceof Date ? e[1] : null), g = l === 11 ? s + 1 : s, _ = l === 11 ? 0 : l + 1, v = /* @__PURE__ */ new Date(), y = (e) => Array.from({ length: 24 }, (t, n) => ({
606
+ value: String(n),
607
+ label: String(n).padStart(2, "0"),
608
+ disabled: Z(e, v) && n < v.getHours()
609
+ })), b = (e) => Array.from({ length: 60 }, (t, n) => ({
610
+ value: String(n),
611
+ label: String(n).padStart(2, "0"),
612
+ disabled: Z(e, v) && e !== null && e.getHours() === v.getHours() && n < v.getMinutes()
613
+ })), x = () => {
614
+ l === 0 ? (u(11), c((e) => e - 1)) : u((e) => e - 1);
615
+ }, S = () => {
616
+ l === 11 ? (u(0), c((e) => e + 1)) : u((e) => e + 1);
617
+ }, C = (e, t) => n?.([e, t]), w = (e) => Z(e, v) && e.getTime() < v.getTime() ? new Date(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes()) : e, T = (e, t, n) => {
618
+ if (!d || d && m) {
619
+ let r = d?.getHours() ?? 0, i = d?.getMinutes() ?? 0, a = w(new Date(e, t, n, r, i));
620
+ p(a), h(null), C(a, null);
621
+ return;
622
+ }
623
+ if (new Date(e, t, n, m?.getHours() ?? 0, m?.getMinutes() ?? 0).setHours(0, 0, 0, 0) < new Date(d).setHours(0, 0, 0, 0)) {
624
+ let r = w(new Date(e, t, n, d.getHours(), d.getMinutes()));
625
+ p(r), h(null), C(r, null);
626
+ return;
627
+ }
628
+ let r = w(new Date(e, t, n, m?.getHours() ?? 0, m?.getMinutes() ?? 0));
629
+ h(r), C(d, r);
630
+ }, E = (e, t, n) => {
631
+ let r = Number(n);
632
+ if (e === "start") {
633
+ if (!d) return;
634
+ let e = new Date(d);
635
+ t === "h" ? e.setHours(r) : e.setMinutes(r), p(e), C(e, m);
636
+ } else {
637
+ if (!m) return;
638
+ let e = new Date(m);
639
+ t === "h" ? e.setHours(r) : e.setMinutes(r), h(e), C(d, e);
640
+ }
641
+ }, D = (e) => {
642
+ e.stopPropagation(), p(null), h(null), C(null, null);
643
+ }, O = d ? `${bt(d)}${m ? ` - ${bt(m)}` : ""}` : "";
644
+ return /* @__PURE__ */ V(M, {
645
+ opened: a,
646
+ onChange: o,
647
+ position: "bottom-start",
648
+ offset: 4,
649
+ shadow: "md",
650
+ radius: "md",
651
+ trapFocus: !0,
652
+ children: [/* @__PURE__ */ B(M.Target, { children: /* @__PURE__ */ V(f, {
653
+ onClick: () => o((e) => !e),
654
+ style: {
655
+ display: "flex",
656
+ alignItems: "center",
657
+ gap: 8,
658
+ height: 36,
659
+ padding: "0 16px",
660
+ borderRadius: 999,
661
+ border: "1px solid var(--mantine-color-gray-4)",
662
+ background: "var(--mantine-color-white)",
663
+ cursor: "pointer",
664
+ userSelect: "none",
665
+ minWidth: 0
666
+ },
667
+ children: [
668
+ /* @__PURE__ */ B(U, {
669
+ size: 16,
670
+ color: "var(--mantine-color-gray-5)",
671
+ style: { flexShrink: 0 }
672
+ }),
673
+ /* @__PURE__ */ B(L, {
674
+ fz: 12,
675
+ c: O ? "neutral.7" : "neutral.4",
676
+ style: {
677
+ flex: 1,
678
+ overflow: "hidden",
679
+ textOverflow: "ellipsis",
680
+ whiteSpace: "nowrap"
681
+ },
682
+ children: O || r
683
+ }),
684
+ d && /* @__PURE__ */ B(f, {
685
+ component: "span",
686
+ onClick: D,
687
+ style: {
688
+ display: "flex",
689
+ alignItems: "center",
690
+ flexShrink: 0
691
+ },
692
+ children: /* @__PURE__ */ B(K, {
693
+ size: 14,
694
+ color: "var(--mantine-color-gray-5)"
695
+ })
696
+ })
697
+ ]
698
+ }) }), /* @__PURE__ */ V(M.Dropdown, {
699
+ p: "md",
700
+ children: [
701
+ /* @__PURE__ */ V(A, {
702
+ align: "flex-start",
703
+ gap: 24,
704
+ wrap: "nowrap",
705
+ children: [/* @__PURE__ */ V(f, { children: [/* @__PURE__ */ V(A, {
706
+ justify: "space-between",
707
+ align: "center",
708
+ mb: 8,
709
+ children: [
710
+ /* @__PURE__ */ B(t, {
711
+ variant: "subtle",
712
+ color: "gray",
713
+ size: "sm",
714
+ onClick: x,
715
+ children: /* @__PURE__ */ B(W, { size: 14 })
716
+ }),
717
+ /* @__PURE__ */ V(L, {
718
+ fz: 12,
719
+ fw: 700,
720
+ c: "neutral.7",
721
+ children: [
722
+ X[l],
723
+ " ",
724
+ s
725
+ ]
726
+ }),
727
+ /* @__PURE__ */ B(f, { w: 22 })
728
+ ]
729
+ }), /* @__PURE__ */ B($, {
730
+ viewYear: s,
731
+ viewMonth: l,
732
+ start: d,
733
+ end: m,
734
+ onSelect: T
735
+ })] }), /* @__PURE__ */ V(f, { children: [/* @__PURE__ */ V(A, {
736
+ justify: "space-between",
737
+ align: "center",
738
+ mb: 8,
739
+ children: [
740
+ /* @__PURE__ */ B(f, { w: 22 }),
741
+ /* @__PURE__ */ V(L, {
742
+ fz: 12,
743
+ fw: 700,
744
+ c: "neutral.7",
745
+ children: [
746
+ X[_],
747
+ " ",
748
+ g
749
+ ]
750
+ }),
751
+ /* @__PURE__ */ B(t, {
752
+ variant: "subtle",
753
+ color: "gray",
754
+ size: "sm",
755
+ onClick: S,
756
+ children: /* @__PURE__ */ B(G, { size: 14 })
757
+ })
758
+ ]
759
+ }), /* @__PURE__ */ B($, {
760
+ viewYear: g,
761
+ viewMonth: _,
762
+ start: d,
763
+ end: m,
764
+ onSelect: T
765
+ })] })]
766
+ }),
767
+ /* @__PURE__ */ B(f, { style: {
768
+ height: 1,
769
+ background: "var(--mantine-color-gray-2)",
770
+ margin: "12px 0"
771
+ } }),
772
+ /* @__PURE__ */ V(A, {
773
+ justify: "space-between",
774
+ align: "center",
775
+ wrap: "nowrap",
776
+ children: [/* @__PURE__ */ V(A, {
777
+ gap: 8,
778
+ align: "center",
779
+ wrap: "nowrap",
780
+ children: [
781
+ /* @__PURE__ */ B(L, {
782
+ fz: 12,
783
+ c: "neutral.6",
784
+ style: { flexShrink: 0 },
785
+ children: "Mulai"
786
+ }),
787
+ /* @__PURE__ */ B(N, {
788
+ radius: "xl",
789
+ value: d ? String(d.getHours()) : null,
790
+ onChange: (e) => E("start", "h", e),
791
+ data: y(d),
792
+ w: 68,
793
+ size: "xs",
794
+ searchable: !0,
795
+ disabled: !d,
796
+ placeholder: "--"
797
+ }),
798
+ /* @__PURE__ */ B(L, {
799
+ fz: 12,
800
+ c: "neutral.6",
801
+ children: ":"
802
+ }),
803
+ /* @__PURE__ */ B(N, {
804
+ radius: "xl",
805
+ value: d ? String(d.getMinutes()) : null,
806
+ onChange: (e) => E("start", "m", e),
807
+ data: b(d),
808
+ w: 68,
809
+ size: "xs",
810
+ searchable: !0,
811
+ disabled: !d,
812
+ placeholder: "--"
813
+ })
814
+ ]
815
+ }), /* @__PURE__ */ V(A, {
816
+ gap: 8,
817
+ align: "center",
818
+ wrap: "nowrap",
819
+ children: [
820
+ /* @__PURE__ */ B(L, {
821
+ fz: 12,
822
+ c: "neutral.6",
823
+ style: { flexShrink: 0 },
824
+ children: "Selesai"
825
+ }),
826
+ /* @__PURE__ */ B(N, {
827
+ radius: "xl",
828
+ value: m ? String(m.getHours()) : null,
829
+ onChange: (e) => E("end", "h", e),
830
+ data: y(m),
831
+ w: 68,
832
+ size: "xs",
833
+ searchable: !0,
834
+ disabled: !m,
835
+ placeholder: "--"
836
+ }),
837
+ /* @__PURE__ */ B(L, {
838
+ fz: 12,
839
+ c: "neutral.6",
840
+ children: ":"
841
+ }),
842
+ /* @__PURE__ */ B(N, {
843
+ radius: "xl",
844
+ value: m ? String(m.getMinutes()) : null,
845
+ onChange: (e) => E("end", "m", e),
846
+ data: b(m),
847
+ w: 68,
848
+ size: "xs",
849
+ searchable: !0,
850
+ disabled: !m,
851
+ placeholder: "--"
852
+ })
853
+ ]
854
+ })]
855
+ })
856
+ ]
857
+ })]
858
+ });
859
+ }
860
+ //#endregion
861
+ //#region src/components/RichTextEditor/RichTextEditor.tsx
862
+ function St({ content: e = "", onChange: t, editable: n = !0, ...r }) {
863
+ let i = Je({
864
+ extensions: [Ye.configure({ link: !1 }), Xe],
865
+ content: e,
866
+ editable: n,
867
+ immediatelyRender: !1,
868
+ onUpdate: ({ editor: e }) => t?.(e.getHTML())
869
+ });
870
+ return He(() => {
871
+ i?.setEditable(n);
872
+ }, [i, n]), /* @__PURE__ */ V(q, {
873
+ editor: i,
874
+ ...r,
875
+ children: [/* @__PURE__ */ V(q.Toolbar, {
876
+ sticky: !0,
877
+ children: [
878
+ /* @__PURE__ */ V(q.ControlsGroup, { children: [
879
+ /* @__PURE__ */ B(q.Bold, {}),
880
+ /* @__PURE__ */ B(q.Italic, {}),
881
+ /* @__PURE__ */ B(q.Underline, {}),
882
+ /* @__PURE__ */ B(q.Strikethrough, {}),
883
+ /* @__PURE__ */ B(q.ClearFormatting, {})
884
+ ] }),
885
+ /* @__PURE__ */ V(q.ControlsGroup, { children: [
886
+ /* @__PURE__ */ B(q.H1, {}),
887
+ /* @__PURE__ */ B(q.H2, {}),
888
+ /* @__PURE__ */ B(q.H3, {})
889
+ ] }),
890
+ /* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.BulletList, {}), /* @__PURE__ */ B(q.OrderedList, {})] }),
891
+ /* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.Link, {}), /* @__PURE__ */ B(q.Unlink, {})] }),
892
+ /* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.Undo, {}), /* @__PURE__ */ B(q.Redo, {})] })
893
+ ]
894
+ }), /* @__PURE__ */ B(q.Content, {})]
895
+ });
896
+ }
897
+ //#endregion
898
+ //#region src/components/DataTable/DataTable.tsx
899
+ function Ct({ data: e, columns: t, searchPlaceholder: n = "Cari...", pageSize: r = 10, emptyLabel: i = "Belum ada data" }) {
900
+ let a = rt({
901
+ data: e,
902
+ columns: t,
903
+ getCoreRowModel: $e(),
904
+ getSortedRowModel: nt(),
905
+ getFilteredRowModel: et(),
906
+ getPaginationRowModel: tt(),
907
+ initialState: { pagination: {
908
+ pageSize: r,
909
+ pageIndex: 0
910
+ } }
911
+ }), o = a.getRowModel().rows, s = {
912
+ asc: /* @__PURE__ */ B(We, { size: 14 }),
913
+ desc: /* @__PURE__ */ B(Ue, { size: 14 })
914
+ };
915
+ return /* @__PURE__ */ V(P, {
916
+ gap: "sm",
917
+ children: [
918
+ n !== void 0 && /* @__PURE__ */ B(R, {
919
+ placeholder: n,
920
+ leftSection: /* @__PURE__ */ B(Ge, { size: 16 }),
921
+ value: a.getState().globalFilter ?? "",
922
+ onChange: (e) => a.setGlobalFilter(e.currentTarget.value)
923
+ }),
924
+ /* @__PURE__ */ V(F, { children: [/* @__PURE__ */ B(F.Thead, { children: a.getHeaderGroups().map((e) => /* @__PURE__ */ B(F.Tr, { children: e.headers.map((e) => /* @__PURE__ */ B(F.Th, {
925
+ onClick: e.column.getToggleSortingHandler(),
926
+ style: { cursor: e.column.getCanSort() ? "pointer" : void 0 },
927
+ children: /* @__PURE__ */ V(k, {
928
+ gap: 4,
929
+ wrap: "nowrap",
930
+ children: [e.isPlaceholder ? null : J(e.column.columnDef.header, e.getContext()), e.column.getCanSort() && (s[e.column.getIsSorted()] ?? /* @__PURE__ */ B(Ke, {
931
+ size: 14,
932
+ opacity: .4
933
+ }))]
934
+ })
935
+ }, e.id)) }, e.id)) }), /* @__PURE__ */ B(F.Tbody, { children: o.length === 0 ? /* @__PURE__ */ B(F.Tr, { children: /* @__PURE__ */ B(F.Td, {
936
+ colSpan: t.length,
937
+ children: /* @__PURE__ */ B(I, {
938
+ ta: "center",
939
+ c: "dimmed",
940
+ py: "md",
941
+ children: i
942
+ })
943
+ }) }) : o.map((e) => /* @__PURE__ */ B(F.Tr, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ B(F.Td, { children: J(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] }),
944
+ a.getPageCount() > 1 && /* @__PURE__ */ B(k, {
945
+ justify: "flex-end",
946
+ children: /* @__PURE__ */ B(j, {
947
+ total: a.getPageCount(),
948
+ value: a.getState().pagination.pageIndex + 1,
949
+ onChange: (e) => a.setPageIndex(e - 1)
950
+ })
951
+ })
952
+ ]
953
+ });
954
+ }
955
+ //#endregion
956
+ export { e as ActionIcon, n as Alert, i as Anchor, o as AppShell, s as Avatar, l as Badge, at as BarChart, d as Box, p as Breadcrumbs, m as Burger, h as Button, _ as Card, it as Carousel, y as Center, b as Checkbox, x as CloseButton, S as ColorSwatch, C as Container, Ct as DataTable, st as DatePickerInput, ht as DateTimePicker, xt as DateTimeRangePicker, w as Divider, ot as DonutChart, qe as Dropzone, T as EmptyState, E as FileButton, D as FileInput, O as Flex, ee as Grid, k as Group, te as Image, ne as Indicator, ie as Loader, ae as LoadingOverlay, oe as Menu, ce as Modal, ue as MultiSelect, de as NativeSelect, fe as NavLink, pe as Notification, Ze as Notifications, me as NumberInput, j as Pagination, he as Paper, ge as PasswordInput, _e as Pill, ve as Popover, ye as Progress, be as Radio, St as RichTextEditor, xe as RingProgress, Se as ScrollArea, Ce as SegmentedControl, Te as Select, Ee as SimpleGrid, De as Skeleton, P as Stack, Oe as Stepper, ke as Switch, F as Table, je as Tabs, Me as TagsInput, I as Text, R as TextInput, Ne as Textarea, Pe as ThemeIcon, Fe as Title, Ie as Tooltip, Re as VisuallyHidden, Y as kelolaTheme, Y as theme, Qe as notifications };