@datum-cloud/datum-ui 0.2.0-alpha.3 → 0.2.0-alpha.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 (132) hide show
  1. package/README.md +46 -21
  2. package/dist/alert/index.mjs +3 -0
  3. package/dist/alert-BC2Mccfo.mjs +95 -0
  4. package/dist/autocomplete/index.mjs +7 -0
  5. package/dist/autocomplete-DZtI97HP.mjs +295 -0
  6. package/dist/avatar-stack/index.mjs +5 -0
  7. package/dist/avatar-stack-JCfBlPB9.mjs +80 -0
  8. package/dist/badge/index.mjs +3 -0
  9. package/dist/badge-bFgeYceE.mjs +185 -0
  10. package/dist/breadcrumb/index.mjs +4 -0
  11. package/dist/breadcrumb-BGYJgom_.mjs +71 -0
  12. package/dist/button/index.mjs +4 -0
  13. package/dist/button-AzpnV-WB.mjs +49 -0
  14. package/dist/button-C1wRfGtT.mjs +230 -0
  15. package/dist/button-group/index.mjs +5 -0
  16. package/dist/button-group-C1IB2K5s.mjs +40 -0
  17. package/dist/calendar/index.mjs +5 -0
  18. package/dist/calendar-DlIHeWb0.mjs +113 -0
  19. package/dist/card/index.mjs +4 -0
  20. package/dist/card-3Kd0VdNf.mjs +63 -0
  21. package/dist/chart/index.mjs +4 -0
  22. package/dist/chart-BZqUKpkh.mjs +143 -0
  23. package/dist/checkbox/index.mjs +4 -0
  24. package/dist/checkbox-LG1OKTpG.mjs +34 -0
  25. package/dist/col-lrLMZaTJ.mjs +184 -0
  26. package/dist/collapsible/index.mjs +3 -0
  27. package/dist/collapsible-Bt9UYfv3.mjs +9 -0
  28. package/dist/command/index.mjs +5 -0
  29. package/dist/command-s0Yv3abE.mjs +86 -0
  30. package/dist/components/features/date-picker/index.d.ts +3 -0
  31. package/dist/components/features/date-picker/index.d.ts.map +1 -0
  32. package/dist/components/features/dropzone/index.d.ts +1 -0
  33. package/dist/components/features/dropzone/index.d.ts.map +1 -1
  34. package/dist/date-picker/index.mjs +9 -0
  35. package/dist/{datum.provider-D6VMjSV0.mjs → datum.provider-B77goJgl.mjs} +1 -1
  36. package/dist/dialog/index.mjs +5 -0
  37. package/dist/dialog-DXBaT9gA.mjs +86 -0
  38. package/dist/dialog-bnMMf9GD.mjs +73 -0
  39. package/dist/dropdown/index.mjs +3 -0
  40. package/dist/dropdown-DtSa_lqc.mjs +112 -0
  41. package/dist/dropzone/index.mjs +5 -0
  42. package/dist/dropzone-BkOnwrS4.mjs +221 -0
  43. package/dist/empty-content/index.mjs +3 -0
  44. package/dist/empty-content-BM9rzI13.mjs +196 -0
  45. package/dist/exports/map.d.ts +3 -0
  46. package/dist/exports/map.d.ts.map +1 -0
  47. package/dist/form/index.mjs +146 -0
  48. package/dist/grid/index.mjs +3 -0
  49. package/dist/hooks/index.mjs +2 -3
  50. package/dist/hover-card/index.mjs +4 -0
  51. package/dist/hover-card-CUPfFUqE.mjs +33 -0
  52. package/dist/icon-wrapper-9ticVbRL.mjs +14 -0
  53. package/dist/icons/index.mjs +3 -3
  54. package/dist/index.mjs +66 -8
  55. package/dist/input/index.mjs +5 -0
  56. package/dist/input-DuyjEKEW.mjs +17 -0
  57. package/dist/input-fzXBheCN.mjs +17 -0
  58. package/dist/input-group/index.mjs +7 -0
  59. package/dist/input-group-CPaFSTEV.mjs +80 -0
  60. package/dist/input-number/index.mjs +6 -0
  61. package/dist/input-number-9o62JHRl.mjs +106 -0
  62. package/dist/input-with-addons/index.mjs +3 -0
  63. package/dist/input-with-addons-BQn7KCTU.mjs +30 -0
  64. package/dist/label/index.mjs +4 -0
  65. package/dist/label-_ste_Re3.mjs +44 -0
  66. package/dist/link-button-TIF2Zdrk.mjs +36 -0
  67. package/dist/loader-overlay/index.mjs +3 -0
  68. package/dist/loader-overlay-DUaQSZQP.mjs +17 -0
  69. package/dist/map/index.mjs +13 -0
  70. package/dist/map-Df8QMcX0.mjs +1094 -0
  71. package/dist/more-actions/index.mjs +5 -0
  72. package/dist/more-actions-Ch1f6Mh3.mjs +54 -0
  73. package/dist/nprogress/index.mjs +32 -0
  74. package/dist/page-title/index.mjs +3 -0
  75. package/dist/page-title-BJuo81rT.mjs +26 -0
  76. package/dist/popover/index.mjs +4 -0
  77. package/dist/popover-SQlKSz6L.mjs +36 -0
  78. package/dist/provider/index.mjs +4 -0
  79. package/dist/radio-group/index.mjs +4 -0
  80. package/dist/radio-group-Oshv0b-U.mjs +49 -0
  81. package/dist/select/index.mjs +4 -0
  82. package/dist/select-DVlEzD2W.mjs +166 -0
  83. package/dist/separator/index.mjs +4 -0
  84. package/dist/separator-T2ppyD-8.mjs +18 -0
  85. package/dist/sheet/index.mjs +5 -0
  86. package/dist/sheet-BKiCwtNO.mjs +45 -0
  87. package/dist/sheet-CtnP6gTD.mjs +77 -0
  88. package/dist/sidebar/index.mjs +11 -0
  89. package/dist/sidebar-DfqezV8t.mjs +945 -0
  90. package/dist/skeleton/index.mjs +4 -0
  91. package/dist/skeleton-vzbxA-DQ.mjs +13 -0
  92. package/dist/spinner/index.mjs +4 -0
  93. package/dist/spinner-BE7k2bAD.mjs +16 -0
  94. package/dist/{icon-wrapper-BgPkifId.mjs → spinner.icon-Bg8zgGh0.mjs} +1 -12
  95. package/dist/stepper/index.mjs +5 -0
  96. package/dist/stepper-SWB-u_nM.mjs +323 -0
  97. package/dist/switch/index.mjs +4 -0
  98. package/dist/switch-Calk7Gyw.mjs +32 -0
  99. package/dist/table/index.mjs +4 -0
  100. package/dist/table-CsXBcQLI.mjs +68 -0
  101. package/dist/tabs/index.mjs +3 -0
  102. package/dist/tabs-D8n-dqnw.mjs +52 -0
  103. package/dist/tag-input/index.mjs +5 -0
  104. package/dist/tag-input-Di7SDNbK.mjs +284 -0
  105. package/dist/task-queue/index.mjs +7 -0
  106. package/dist/task-queue-dropdown-DW72ikDH.mjs +1356 -0
  107. package/dist/textarea/index.mjs +5 -0
  108. package/dist/textarea-CxE3YbC7.mjs +17 -0
  109. package/dist/textarea-QYRcDEpK.mjs +15 -0
  110. package/dist/theme/index.mjs +4 -0
  111. package/dist/theme-script-XBouzsNR.mjs +66 -0
  112. package/dist/to-api-format-C2xjQUcI.mjs +1506 -0
  113. package/dist/toast/index.mjs +3 -0
  114. package/dist/tooltip/index.mjs +4 -0
  115. package/dist/tooltip-Dd3ActSS.mjs +74 -0
  116. package/dist/typography/index.mjs +3 -0
  117. package/dist/typography-UA7ZZvgJ.mjs +200 -0
  118. package/dist/use-copy-to-clipboard-ki-WoTml.mjs +31 -0
  119. package/dist/use-stepper-BaToCYMs.mjs +2017 -0
  120. package/dist/{use-copy-to-clipboard-BfrpD6G8.mjs → use-toast-mdn_CqRY.mjs} +34 -27
  121. package/dist/utils/index.mjs +0 -1
  122. package/dist/utils-Bfgoe-Gm.mjs +20 -0
  123. package/dist/visually-hidden/index.mjs +3 -0
  124. package/dist/visuallyhidden-aaTUk4Yo.mjs +7 -0
  125. package/package.json +208 -8
  126. package/dist/components/index.mjs +0 -8
  127. package/dist/providers/index.mjs +0 -4
  128. package/dist/theme-script-DHyLk25i.mjs +0 -11128
  129. /package/dist/{close.icon-chkXPAUC.mjs → close.icon-CMNMoXM_.mjs} +0 -0
  130. /package/dist/{map-leaflet-imports-OKaoesjZ.mjs → map-leaflet-imports-CdzvEnzY.mjs} +0 -0
  131. /package/dist/{theme.provider-DpFLwtHe.mjs → theme.provider-DgGshapa.mjs} +0 -0
  132. /package/dist/{use-debounce-BYB-jPeX.mjs → use-debounce-DQ1tmxOL.mjs} +0 -0
@@ -0,0 +1,113 @@
1
+ import { t as cn } from "./cn-DWCc1QRE.mjs";
2
+ import { n as buttonVariants, t as Button } from "./button-AzpnV-WB.mjs";
3
+ import { t as Icon } from "./icon-wrapper-9ticVbRL.mjs";
4
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
5
+ import * as React$1 from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
8
+
9
+ //#region src/components/base/calendar/calendar.tsx
10
+ function CalendarRoot({ className, rootRef, ...props }) {
11
+ return /* @__PURE__ */ jsx("div", {
12
+ "data-slot": "calendar",
13
+ ref: rootRef,
14
+ className: cn(className),
15
+ ...props
16
+ });
17
+ }
18
+ function CalendarChevron({ className, orientation, ...props }) {
19
+ if (orientation === "left") return /* @__PURE__ */ jsx(Icon, {
20
+ icon: ChevronLeftIcon,
21
+ className: cn("size-4", className),
22
+ ...props
23
+ });
24
+ if (orientation === "right") return /* @__PURE__ */ jsx(Icon, {
25
+ icon: ChevronRightIcon,
26
+ className: cn("size-4", className),
27
+ ...props
28
+ });
29
+ return /* @__PURE__ */ jsx(Icon, {
30
+ icon: ChevronDownIcon,
31
+ className: cn("size-4", className),
32
+ ...props
33
+ });
34
+ }
35
+ function CalendarWeekNumber({ children, ...props }) {
36
+ return /* @__PURE__ */ jsx("td", {
37
+ ...props,
38
+ children: /* @__PURE__ */ jsx("div", {
39
+ className: "flex size-(--cell-size) items-center justify-center text-center",
40
+ children
41
+ })
42
+ });
43
+ }
44
+ function Calendar$1({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
45
+ const defaultClassNames = getDefaultClassNames();
46
+ return /* @__PURE__ */ jsx(DayPicker, {
47
+ showOutsideDays,
48
+ className: cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
49
+ captionLayout,
50
+ formatters: {
51
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
52
+ ...formatters
53
+ },
54
+ classNames: {
55
+ root: cn("w-fit", defaultClassNames.root),
56
+ months: cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
57
+ month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
58
+ nav: cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
59
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
60
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
61
+ month_caption: cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption),
62
+ dropdowns: cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns),
63
+ dropdown_root: cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
64
+ dropdown: cn("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown),
65
+ caption_label: cn("select-none font-medium", captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", defaultClassNames.caption_label),
66
+ table: "w-full border-collapse",
67
+ weekdays: cn("flex", defaultClassNames.weekdays),
68
+ weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday),
69
+ week: cn("flex w-full mt-2", defaultClassNames.week),
70
+ week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
71
+ week_number: cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
72
+ day: cn("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", defaultClassNames.day),
73
+ range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
74
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
75
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
76
+ today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
77
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
78
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
79
+ hidden: cn("invisible", defaultClassNames.hidden),
80
+ ...classNames
81
+ },
82
+ components: {
83
+ Root: CalendarRoot,
84
+ Chevron: CalendarChevron,
85
+ DayButton: CalendarDayButton,
86
+ WeekNumber: CalendarWeekNumber,
87
+ ...components
88
+ },
89
+ ...props
90
+ });
91
+ }
92
+ function CalendarDayButton({ className, day, modifiers, ...props }) {
93
+ const defaultClassNames = getDefaultClassNames();
94
+ const ref = React$1.useRef(null);
95
+ React$1.useEffect(() => {
96
+ if (modifiers.focused) ref.current?.focus();
97
+ }, [modifiers.focused]);
98
+ return /* @__PURE__ */ jsx(Button, {
99
+ ref,
100
+ variant: "ghost",
101
+ size: "icon",
102
+ "data-day": day.date.toLocaleDateString(),
103
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
104
+ "data-range-start": modifiers.range_start,
105
+ "data-range-end": modifiers.range_end,
106
+ "data-range-middle": modifiers.range_middle,
107
+ className: cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
108
+ ...props
109
+ });
110
+ }
111
+
112
+ //#endregion
113
+ export { CalendarDayButton as n, Calendar$1 as t };
@@ -0,0 +1,4 @@
1
+ import "../utils-Bfgoe-Gm.mjs";
2
+ import { a as CardDescription, i as CardContent, n as CardFooter, o as CardTitle, r as CardHeader, t as Card } from "../card-3Kd0VdNf.mjs";
3
+
4
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,63 @@
1
+ import { t as cn } from "./cn-DWCc1QRE.mjs";
2
+ import { t as cn$1 } from "./utils-Bfgoe-Gm.mjs";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region ../shadcn/ui/card.tsx
7
+ const CardTitle = ({ className, ...props }) => {
8
+ return /* @__PURE__ */ jsx("div", {
9
+ "data-slot": "card-title",
10
+ className: cn$1("leading-none font-semibold", className),
11
+ ...props
12
+ });
13
+ };
14
+ const CardDescription = ({ className, ...props }) => {
15
+ return /* @__PURE__ */ jsx("div", {
16
+ "data-slot": "card-description",
17
+ className: cn$1("text-muted-foreground text-sm", className),
18
+ ...props
19
+ });
20
+ };
21
+ const CardContent = ({ className, ...props }) => {
22
+ return /* @__PURE__ */ jsx("div", {
23
+ "data-slot": "card-content",
24
+ className: cn$1("px-6", className),
25
+ ...props
26
+ });
27
+ };
28
+
29
+ //#endregion
30
+ //#region src/components/base/card/card.tsx
31
+ /**
32
+ * Datum Card Component
33
+ * Extends shadcn Card with custom default className
34
+ *
35
+ * This component replaces the default className of shadcn Card without modifying
36
+ * the original shadcn component. All sub-components (CardHeader, CardTitle, etc.)
37
+ * are re-exported from shadcn as-is.
38
+ */
39
+ const DEFAULT_CARD_CLASSNAME = "bg-card text-card-foreground flex flex-col gap-4 rounded-xl border border-card-border py-6 shadow";
40
+ function Card({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "card",
43
+ className: cn(DEFAULT_CARD_CLASSNAME, className),
44
+ ...props
45
+ });
46
+ }
47
+ function CardHeader({ className, ...props }) {
48
+ return /* @__PURE__ */ jsx("div", {
49
+ "data-slot": "card-header",
50
+ className: cn("border-card-border flex flex-col gap-3 px-6", className),
51
+ ...props
52
+ });
53
+ }
54
+ function CardFooter({ className, ...props }) {
55
+ return /* @__PURE__ */ jsx("div", {
56
+ "data-slot": "card-footer",
57
+ className: cn("border-card-border px-6", className),
58
+ ...props
59
+ });
60
+ }
61
+
62
+ //#endregion
63
+ export { CardDescription as a, CardContent as i, CardFooter as n, CardTitle as o, CardHeader as r, Card as t };
@@ -0,0 +1,4 @@
1
+ import "../utils-Bfgoe-Gm.mjs";
2
+ import { a as ChartTooltip, i as ChartStyle, n as ChartLegend, o as ChartTooltipContent, r as ChartLegendContent, t as ChartContainer } from "../chart-BZqUKpkh.mjs";
3
+
4
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,143 @@
1
+ import { t as cn } from "./utils-Bfgoe-Gm.mjs";
2
+ import * as React$1 from "react";
3
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
4
+ import * as RechartsPrimitive from "recharts";
5
+
6
+ //#region ../shadcn/ui/chart.tsx
7
+ const THEMES = {
8
+ light: "",
9
+ dark: ".dark"
10
+ };
11
+ const ChartContext = React$1.createContext(null);
12
+ function useChart() {
13
+ const context = React$1.useContext(ChartContext);
14
+ if (!context) throw new Error("useChart must be used within a <ChartContainer />");
15
+ return context;
16
+ }
17
+ function ChartContainer({ id, className, children, config, ...props }) {
18
+ const uniqueId = React$1.useId();
19
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
20
+ return /* @__PURE__ */ jsx(ChartContext.Provider, {
21
+ value: { config },
22
+ children: /* @__PURE__ */ jsxs("div", {
23
+ "data-slot": "chart",
24
+ "data-chart": chartId,
25
+ className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
26
+ ...props,
27
+ children: [/* @__PURE__ */ jsx(ChartStyle, {
28
+ id: chartId,
29
+ config
30
+ }), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })]
31
+ })
32
+ });
33
+ }
34
+ const ChartStyle = ({ id, config }) => {
35
+ const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
36
+ if (!colorConfig.length) return null;
37
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
38
+ ${prefix} [data-chart=${id}] {
39
+ ${colorConfig.map(([key, itemConfig]) => {
40
+ const color = itemConfig.theme?.[theme] || itemConfig.color;
41
+ return color ? ` --color-${key}: ${color};` : null;
42
+ }).join("\n")}
43
+ }
44
+ `).join("\n") } });
45
+ };
46
+ const ChartTooltip = RechartsPrimitive.Tooltip;
47
+ function ChartTooltipContent({ active, payload, label, className, indicator = "dot", hideLabel = false, hideIndicator = false, labelFormatter, formatter, labelClassName, color, nameKey, labelKey }) {
48
+ const { config } = useChart();
49
+ const tooltipLabel = React$1.useMemo(() => {
50
+ if (hideLabel || !payload?.length) return null;
51
+ const [item] = payload;
52
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey || item?.dataKey || item?.name || "value"}`);
53
+ const value = (() => {
54
+ const v = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
55
+ return typeof v === "string" || typeof v === "number" ? v : void 0;
56
+ })();
57
+ if (labelFormatter) return /* @__PURE__ */ jsx("div", {
58
+ className: cn("font-medium", labelClassName),
59
+ children: labelFormatter(label, payload)
60
+ });
61
+ if (!value) return null;
62
+ return /* @__PURE__ */ jsx("div", {
63
+ className: cn("font-medium", labelClassName),
64
+ children: value
65
+ });
66
+ }, [
67
+ label,
68
+ labelFormatter,
69
+ payload,
70
+ hideLabel,
71
+ labelClassName,
72
+ config,
73
+ labelKey
74
+ ]);
75
+ if (!active || !payload?.length) return null;
76
+ const nestLabel = payload.length === 1 && indicator !== "dot";
77
+ return /* @__PURE__ */ jsxs("div", {
78
+ className: cn("border-border/50 bg-background z-50 grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className),
79
+ children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
80
+ className: "grid gap-1.5",
81
+ children: payload.map((item, index) => {
82
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.name || item.dataKey || "value"}`);
83
+ const indicatorColor = color || item.payload.fill || item.color;
84
+ return /* @__PURE__ */ jsx("div", {
85
+ className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center"),
86
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment$1, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
87
+ className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
88
+ "h-2.5 w-2.5": indicator === "dot",
89
+ "w-1": indicator === "line",
90
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
91
+ "my-0.5": nestLabel && indicator === "dashed"
92
+ }),
93
+ style: {
94
+ "--color-bg": indicatorColor,
95
+ "--color-border": indicatorColor
96
+ }
97
+ }), /* @__PURE__ */ jsxs("div", {
98
+ className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
99
+ children: [/* @__PURE__ */ jsxs("div", {
100
+ className: "grid gap-1.5",
101
+ children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
102
+ className: "text-muted-foreground",
103
+ children: itemConfig?.label || item.name
104
+ })]
105
+ }), item.value && /* @__PURE__ */ jsx("span", {
106
+ className: "text-foreground font-mono font-medium tabular-nums",
107
+ children: item.value.toLocaleString()
108
+ })]
109
+ })] })
110
+ }, item.dataKey);
111
+ })
112
+ })]
113
+ });
114
+ }
115
+ const ChartLegend = RechartsPrimitive.Legend;
116
+ function ChartLegendContent({ className, hideIcon = false, payload, nameKey }) {
117
+ const { config } = useChart();
118
+ if (!payload?.length) return null;
119
+ return /* @__PURE__ */ jsx("div", {
120
+ className: cn("flex flex-wrap items-center justify-center gap-2", className),
121
+ children: payload.map((item) => {
122
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.dataKey || "value"}`);
123
+ return /* @__PURE__ */ jsxs("div", {
124
+ className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
125
+ children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
126
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
127
+ style: { backgroundColor: item.color }
128
+ }), itemConfig?.label]
129
+ }, item.value);
130
+ })
131
+ });
132
+ }
133
+ function getPayloadConfigFromPayload(config, payload, key) {
134
+ if (typeof payload !== "object" || payload === null) return;
135
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
136
+ let configLabelKey = key;
137
+ if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
138
+ else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
139
+ return configLabelKey in config ? config[configLabelKey] : config[key];
140
+ }
141
+
142
+ //#endregion
143
+ export { ChartTooltip as a, ChartStyle as i, ChartLegend as n, ChartTooltipContent as o, ChartLegendContent as r, ChartContainer as t };
@@ -0,0 +1,4 @@
1
+ import "../utils-Bfgoe-Gm.mjs";
2
+ import { t as Checkbox } from "../checkbox-LG1OKTpG.mjs";
3
+
4
+ export { Checkbox };
@@ -0,0 +1,34 @@
1
+ import { t as cn } from "./cn-DWCc1QRE.mjs";
2
+ import { t as cn$1 } from "./utils-Bfgoe-Gm.mjs";
3
+ import { CheckIcon } from "lucide-react";
4
+ import "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
7
+
8
+ //#region ../shadcn/ui/checkbox.tsx
9
+ function Checkbox$1({ className, ...props }) {
10
+ return /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
11
+ "data-slot": "checkbox",
12
+ className: cn$1("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
15
+ "data-slot": "checkbox-indicator",
16
+ className: "flex items-center justify-center text-current transition-none",
17
+ children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
18
+ })
19
+ });
20
+ }
21
+
22
+ //#endregion
23
+ //#region src/components/base/checkbox/checkbox.tsx
24
+ function Checkbox({ ref, className, ...props }) {
25
+ return /* @__PURE__ */ jsx(Checkbox$1, {
26
+ ref,
27
+ className: cn(className),
28
+ ...props
29
+ });
30
+ }
31
+ Checkbox.displayName = "Checkbox";
32
+
33
+ //#endregion
34
+ export { Checkbox as t };
@@ -0,0 +1,184 @@
1
+ import { t as cn } from "./cn-DWCc1QRE.mjs";
2
+ import React, { use, useEffect, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/components/features/grid/constants/grid.constants.ts
6
+ const GRID_BREAKPOINTS = {
7
+ xs: 480,
8
+ sm: 576,
9
+ md: 768,
10
+ lg: 992,
11
+ xl: 1200,
12
+ xxl: 1600
13
+ };
14
+ const GRID_COLUMNS = 24;
15
+ const GRID_PREFIX = "grid";
16
+ const RESPONSIVE_ARRAY = [
17
+ "xxl",
18
+ "xl",
19
+ "lg",
20
+ "md",
21
+ "sm",
22
+ "xs"
23
+ ];
24
+ const RESPONSIVE_MAP = {
25
+ xs: "(max-width: 575px)",
26
+ sm: "(min-width: 576px)",
27
+ md: "(min-width: 768px)",
28
+ lg: "(min-width: 992px)",
29
+ xl: "(min-width: 1200px)",
30
+ xxl: "(min-width: 1600px)"
31
+ };
32
+
33
+ //#endregion
34
+ //#region src/components/features/grid/utils/responsive.ts
35
+ function registerMediaQuery(query, callback) {
36
+ const mediaQuery = window.matchMedia(query);
37
+ const handleChange = (event) => {
38
+ if (event.matches) callback.match();
39
+ else callback.unmatch();
40
+ };
41
+ if (mediaQuery.matches) callback.match();
42
+ mediaQuery.addEventListener("change", handleChange);
43
+ return () => {
44
+ mediaQuery.removeEventListener("change", handleChange);
45
+ };
46
+ }
47
+ function getGutter(gutter = 0, screens) {
48
+ const results = [0, 0];
49
+ (Array.isArray(gutter) ? gutter.slice(0, 2) : [gutter, 0]).forEach((g, index) => {
50
+ if (typeof g === "object") for (let i = 0; i < RESPONSIVE_ARRAY.length; i++) {
51
+ const breakpoint = RESPONSIVE_ARRAY[i];
52
+ if (screens[breakpoint] && g[breakpoint] !== void 0) {
53
+ results[index] = g[breakpoint];
54
+ break;
55
+ }
56
+ }
57
+ else results[index] = g || 0;
58
+ });
59
+ return results;
60
+ }
61
+ function getResponsiveValue(value, screens) {
62
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
63
+ const responsiveValue = value;
64
+ for (let i = 0; i < RESPONSIVE_ARRAY.length; i++) {
65
+ const breakpoint = RESPONSIVE_ARRAY[i];
66
+ if (screens[breakpoint] && responsiveValue[breakpoint] !== void 0) return responsiveValue[breakpoint];
67
+ }
68
+ }
69
+ return value;
70
+ }
71
+
72
+ //#endregion
73
+ //#region src/components/features/grid/components/row.tsx
74
+ const RowContext = React.createContext(null);
75
+ const Row = ({ type, align, justify, className, style, children, gutter = 0, prefixCls = GRID_PREFIX, ...rest }) => {
76
+ const [screens, setScreens] = useState({
77
+ xs: true,
78
+ sm: true,
79
+ md: true,
80
+ lg: true,
81
+ xl: true,
82
+ xxl: true
83
+ });
84
+ const [unRegisters, setUnRegisters] = useState([]);
85
+ useEffect(() => {
86
+ if (typeof gutter === "object" && !Array.isArray(gutter)) setUnRegisters(Object.keys(RESPONSIVE_MAP).map((screen) => registerMediaQuery(RESPONSIVE_MAP[screen], {
87
+ match: () => {
88
+ setScreens((prevState) => ({
89
+ ...prevState,
90
+ [screen]: true
91
+ }));
92
+ },
93
+ unmatch: () => {
94
+ setScreens((prevState) => ({
95
+ ...prevState,
96
+ [screen]: false
97
+ }));
98
+ }
99
+ })));
100
+ return () => {
101
+ unRegisters.forEach((unRegister) => unRegister());
102
+ };
103
+ }, [gutter]);
104
+ const gutters = getGutter(gutter, screens);
105
+ const prefix = `${prefixCls}-row`;
106
+ const classes = cn({
107
+ [prefix]: type !== "flex",
108
+ [`${prefix}-${type}`]: type,
109
+ [`${prefix}-${type}-${justify}`]: type && justify,
110
+ [`${prefix}-${type}-${align}`]: type && align
111
+ }, className);
112
+ const rowStyle = {
113
+ ...gutters[0] > 0 ? {
114
+ marginLeft: gutters[0] / -2,
115
+ marginRight: gutters[0] / -2
116
+ } : {},
117
+ ...gutters[1] > 0 ? {
118
+ marginTop: gutters[1] / -2,
119
+ marginBottom: gutters[1] / -2
120
+ } : {},
121
+ ...style
122
+ };
123
+ return /* @__PURE__ */ jsx(RowContext, {
124
+ value: { gutters },
125
+ children: /* @__PURE__ */ jsx("div", {
126
+ ...rest,
127
+ className: classes,
128
+ style: rowStyle,
129
+ children
130
+ })
131
+ });
132
+ };
133
+
134
+ //#endregion
135
+ //#region src/components/features/grid/components/col.tsx
136
+ const Col = ({ span, order, offset, push, pull, className, prefixCls = GRID_PREFIX, style, children, ...rest }) => {
137
+ const context = use(RowContext);
138
+ const prefix = `${prefixCls}-col`;
139
+ let sizeClassObj = {};
140
+ RESPONSIVE_ARRAY.forEach((size) => {
141
+ let sizeProps = {};
142
+ const sizeValue = rest[size];
143
+ if (typeof sizeValue === "number") sizeProps.span = sizeValue;
144
+ else if (typeof sizeValue === "object") sizeProps = sizeValue || {};
145
+ delete rest[size];
146
+ sizeClassObj = {
147
+ ...sizeClassObj,
148
+ [`${prefix}-${size}-${sizeProps.span}`]: sizeProps.span !== void 0,
149
+ [`${prefix}-${size}-order-${sizeProps.order}`]: sizeProps.order !== void 0,
150
+ [`${prefix}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset !== void 0,
151
+ [`${prefix}-${size}-push-${sizeProps.push}`]: sizeProps.push !== void 0,
152
+ [`${prefix}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull !== void 0
153
+ };
154
+ });
155
+ const classes = cn(prefix, {
156
+ [`${prefix}-${span}`]: span !== void 0,
157
+ [`${prefix}-order-${order}`]: order !== void 0,
158
+ [`${prefix}-offset-${offset}`]: offset !== void 0,
159
+ [`${prefix}-push-${push}`]: push !== void 0,
160
+ [`${prefix}-pull-${pull}`]: pull !== void 0,
161
+ ...sizeClassObj
162
+ }, className);
163
+ const colStyle = { ...style };
164
+ if (context && context.gutters) {
165
+ const [horizontalGutter, verticalGutter] = context.gutters;
166
+ if (horizontalGutter > 0) {
167
+ colStyle.paddingLeft = horizontalGutter / 2;
168
+ colStyle.paddingRight = horizontalGutter / 2;
169
+ }
170
+ if (verticalGutter > 0) {
171
+ colStyle.paddingTop = verticalGutter / 2;
172
+ colStyle.paddingBottom = verticalGutter / 2;
173
+ }
174
+ }
175
+ return /* @__PURE__ */ jsx("div", {
176
+ ...rest,
177
+ style: colStyle,
178
+ className: classes,
179
+ children
180
+ });
181
+ };
182
+
183
+ //#endregion
184
+ export { getResponsiveValue as a, GRID_COLUMNS as c, RESPONSIVE_MAP as d, getGutter as i, GRID_PREFIX as l, Row as n, registerMediaQuery as o, RowContext as r, GRID_BREAKPOINTS as s, Col as t, RESPONSIVE_ARRAY as u };
@@ -0,0 +1,3 @@
1
+ import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "../collapsible-Bt9UYfv3.mjs";
2
+
3
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -0,0 +1,9 @@
1
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
2
+
3
+ //#region ../shadcn/ui/collapsible.tsx
4
+ const Collapsible = CollapsiblePrimitive.Root;
5
+ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
6
+ const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
7
+
8
+ //#endregion
9
+ export { CollapsibleContent as n, CollapsibleTrigger as r, Collapsible as t };
@@ -0,0 +1,5 @@
1
+ import "../utils-Bfgoe-Gm.mjs";
2
+ import "../dialog-DXBaT9gA.mjs";
3
+ import { a as CommandInput, c as CommandSeparator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../command-s0Yv3abE.mjs";
4
+
5
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -0,0 +1,86 @@
1
+ import { t as cn } from "./utils-Bfgoe-Gm.mjs";
2
+ import { i as DialogDescription, l as DialogTitle, o as DialogHeader, r as DialogContent, t as Dialog } from "./dialog-DXBaT9gA.mjs";
3
+ import { SearchIcon } from "lucide-react";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Command } from "cmdk";
7
+
8
+ //#region ../shadcn/ui/command.tsx
9
+ const Command$1 = ({ className, ...props }) => {
10
+ return /* @__PURE__ */ jsx(Command, {
11
+ "data-slot": "command",
12
+ className: cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
13
+ ...props
14
+ });
15
+ };
16
+ const CommandDialog = ({ title = "Command Palette", description = "Search for a command to run...", children, ...props }) => {
17
+ return /* @__PURE__ */ jsxs(Dialog, {
18
+ ...props,
19
+ children: [/* @__PURE__ */ jsxs(DialogHeader, {
20
+ className: "sr-only",
21
+ children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: description })]
22
+ }), /* @__PURE__ */ jsx(DialogContent, {
23
+ className: "overflow-hidden p-0",
24
+ children: /* @__PURE__ */ jsx(Command$1, {
25
+ className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
26
+ children
27
+ })
28
+ })]
29
+ });
30
+ };
31
+ const CommandInput = ({ className, wrapperClassName, iconClassName, ...props }) => {
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ "data-slot": "command-input-wrapper",
34
+ className: cn("flex h-9 items-center gap-2 border-b px-3", wrapperClassName),
35
+ children: [/* @__PURE__ */ jsx(SearchIcon, { className: cn("size-4 shrink-0 opacity-50", iconClassName) }), /* @__PURE__ */ jsx(Command.Input, {
36
+ "data-slot": "command-input",
37
+ className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
38
+ ...props
39
+ })]
40
+ });
41
+ };
42
+ const CommandList = ({ className, ...props }) => {
43
+ return /* @__PURE__ */ jsx(Command.List, {
44
+ "data-slot": "command-list",
45
+ className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
46
+ ...props
47
+ });
48
+ };
49
+ const CommandEmpty = ({ ...props }) => {
50
+ return /* @__PURE__ */ jsx(Command.Empty, {
51
+ "data-slot": "command-empty",
52
+ className: "py-6 text-center text-sm",
53
+ ...props
54
+ });
55
+ };
56
+ const CommandGroup = ({ className, ...props }) => {
57
+ return /* @__PURE__ */ jsx(Command.Group, {
58
+ "data-slot": "command-group",
59
+ className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className),
60
+ ...props
61
+ });
62
+ };
63
+ const CommandSeparator = ({ className, ...props }) => {
64
+ return /* @__PURE__ */ jsx(Command.Separator, {
65
+ "data-slot": "command-separator",
66
+ className: cn("bg-border -mx-1 h-px", className),
67
+ ...props
68
+ });
69
+ };
70
+ const CommandItem = ({ className, ...props }) => {
71
+ return /* @__PURE__ */ jsx(Command.Item, {
72
+ "data-slot": "command-item",
73
+ className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
74
+ ...props
75
+ });
76
+ };
77
+ const CommandShortcut = ({ className, ...props }) => {
78
+ return /* @__PURE__ */ jsx("span", {
79
+ "data-slot": "command-shortcut",
80
+ className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
81
+ ...props
82
+ });
83
+ };
84
+
85
+ //#endregion
86
+ export { CommandInput as a, CommandSeparator as c, CommandGroup as i, CommandShortcut as l, CommandDialog as n, CommandItem as o, CommandEmpty as r, CommandList as s, Command$1 as t };
@@ -0,0 +1,3 @@
1
+ export * from '../calendar-date-picker';
2
+ export * from '../time-range-picker';
3
+ //# sourceMappingURL=index.d.ts.map