@algorithm-shift/design-system 1.2.44 → 1.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-QZ2QO7MJ.mjs +24 -0
- package/dist/chunk-QZ2QO7MJ.mjs.map +1 -0
- package/dist/client.d.mts +21 -8
- package/dist/client.d.ts +21 -8
- package/dist/client.js +100 -334
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +292 -4
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +3 -18
- package/dist/index.d.ts +3 -18
- package/dist/index.js +6 -301
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2785 -51
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-JFDQZCMW.mjs +0 -3130
- package/dist/chunk-JFDQZCMW.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,50 +1,2761 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import {
|
|
2
|
-
BarChart_default,
|
|
3
|
-
Breadcrumb_default,
|
|
4
|
-
Button_default,
|
|
5
|
-
Checkbox_default,
|
|
6
|
-
Container_default,
|
|
7
|
-
DatePicker,
|
|
8
|
-
DateRange_default,
|
|
9
|
-
Dropdown_default,
|
|
10
|
-
EmailComposer,
|
|
11
|
-
EmailInput_default,
|
|
12
|
-
FileInput_default,
|
|
13
|
-
Flex_default,
|
|
14
|
-
Form_default,
|
|
15
|
-
Grid_default,
|
|
16
|
-
Image_default,
|
|
17
|
-
Modal_default,
|
|
18
|
-
MultiCheckbox_default,
|
|
19
|
-
Navbar,
|
|
20
|
-
NumberInput_default,
|
|
21
|
-
Pagination_default,
|
|
22
|
-
PasswordInput_default,
|
|
23
|
-
PhoneInput_default,
|
|
24
|
-
PieChart_default,
|
|
25
|
-
RadioInput_default,
|
|
26
|
-
RichText,
|
|
27
|
-
SearchInput_default,
|
|
28
|
-
Shape_default,
|
|
29
|
-
Spacer_default,
|
|
30
|
-
SplitButton,
|
|
31
|
-
Stages_default,
|
|
32
|
-
StateProvider,
|
|
33
|
-
SwitchToggle_default,
|
|
34
|
-
Table_default,
|
|
35
|
-
Tabs_default,
|
|
36
|
-
TextInputGroup_default,
|
|
37
|
-
TextInput_default,
|
|
38
|
-
Textarea_default,
|
|
39
|
-
Typography_default,
|
|
40
|
-
UrlInput_default,
|
|
41
|
-
Wrapper_default,
|
|
42
3
|
cn,
|
|
43
|
-
getInitials
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} from "
|
|
4
|
+
getInitials
|
|
5
|
+
} from "./chunk-QZ2QO7MJ.mjs";
|
|
6
|
+
|
|
7
|
+
// src/components/Layout/Modal.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var Modal = ({
|
|
10
|
+
children,
|
|
11
|
+
onClose,
|
|
12
|
+
label,
|
|
13
|
+
className,
|
|
14
|
+
style
|
|
15
|
+
}) => {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className, style, children: /* @__PURE__ */ jsxs("div", { className: "min-h-80", children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center p-4 border-b border-gray-300 bg-gray-100", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("h4", { className: "text-[#000]", children: label || "Modal Title" }),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
className: "cursor-pointer text-[#000]",
|
|
23
|
+
role: "presentation",
|
|
24
|
+
onClick: onClose,
|
|
25
|
+
children: "X"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "h-90 overflow-y-auto p-4 custom-scroll", children })
|
|
30
|
+
] }) });
|
|
31
|
+
};
|
|
32
|
+
var Modal_default = Modal;
|
|
33
|
+
|
|
34
|
+
// src/components/Layout/Flex.tsx
|
|
35
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
36
|
+
var Flex = ({
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
...props
|
|
41
|
+
}) => {
|
|
42
|
+
return /* @__PURE__ */ jsx2("div", { ...props, className, style, children });
|
|
43
|
+
};
|
|
44
|
+
var Flex_default = Flex;
|
|
45
|
+
|
|
46
|
+
// src/components/Layout/Grid.tsx
|
|
47
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
48
|
+
var Grid = ({
|
|
49
|
+
children,
|
|
50
|
+
className,
|
|
51
|
+
style,
|
|
52
|
+
...props
|
|
53
|
+
}) => {
|
|
54
|
+
return /* @__PURE__ */ jsx3("div", { ...props, className, style, children });
|
|
55
|
+
};
|
|
56
|
+
var Grid_default = Grid;
|
|
57
|
+
|
|
58
|
+
// src/components/Layout/Container.tsx
|
|
59
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
60
|
+
var Container = ({
|
|
61
|
+
children,
|
|
62
|
+
className,
|
|
63
|
+
style,
|
|
64
|
+
...props
|
|
65
|
+
}) => {
|
|
66
|
+
return /* @__PURE__ */ jsx4("div", { ...props, className, style, children });
|
|
67
|
+
};
|
|
68
|
+
var Container_default = Container;
|
|
69
|
+
|
|
70
|
+
// src/components/ui/button.tsx
|
|
71
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
72
|
+
import { cva } from "class-variance-authority";
|
|
73
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
74
|
+
var buttonVariants = cva(
|
|
75
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
76
|
+
{
|
|
77
|
+
variants: {
|
|
78
|
+
variant: {
|
|
79
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
80
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
81
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
82
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
83
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
84
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
85
|
+
},
|
|
86
|
+
size: {
|
|
87
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
88
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
89
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
90
|
+
icon: "size-9"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
defaultVariants: {
|
|
94
|
+
variant: "default",
|
|
95
|
+
size: "default"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
function Button({
|
|
100
|
+
className,
|
|
101
|
+
variant,
|
|
102
|
+
size,
|
|
103
|
+
asChild = false,
|
|
104
|
+
...props
|
|
105
|
+
}) {
|
|
106
|
+
const Comp = asChild ? Slot : "button";
|
|
107
|
+
return /* @__PURE__ */ jsx5(
|
|
108
|
+
Comp,
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "button",
|
|
111
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
112
|
+
...props
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/components/Basic/Button/Button.tsx
|
|
118
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
119
|
+
var ButtonWrapper = ({
|
|
120
|
+
className,
|
|
121
|
+
style,
|
|
122
|
+
textContent = "Button",
|
|
123
|
+
...props
|
|
124
|
+
}) => {
|
|
125
|
+
return /* @__PURE__ */ jsx6(
|
|
126
|
+
Button,
|
|
127
|
+
{
|
|
128
|
+
...props,
|
|
129
|
+
className,
|
|
130
|
+
style,
|
|
131
|
+
children: textContent
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
var Button_default = ButtonWrapper;
|
|
136
|
+
|
|
137
|
+
// src/assets/image-placeholder.png
|
|
138
|
+
var image_placeholder_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAD25JREFUeJzt3XfwHGUdx/H3LyEJoQihJVITIEEQBUQHIQEBQaRMwApIyS8UQQREBQUZRaUXUQwwYoShSlWqQ5ci1ZE2YkIgEBIggNQEQgKk+Mf3t/7utt2ze7u35T6vmZ1M7vae57m7/fxu99nd5wERERERERERERERERERERERERERERERERERERERERERERERERERERERERGR7tJTdANiDAIOBDag3O2sm/eBS4Dnim6IxLsAWKKlkOVtYETrr6j+BhTdgBhfL7oBXWwYsH3RjSiDMgdkUNEN6HKDi25AGSxVdAMSeA14q+hG1FQPsFHRjZBk3qV5v/joYptTa0sTPA7pLbJBZVHmXSyRwikgIjEUEJEYCohIDAVEJIYCIhJDARGJoYCIxFBARGIoICIxqnQtVtYGAbsCewCfB9bELtB7G/gPcBdwBTC7qAaKxMnrWqweYC/gRVrfF/ERcB52+Xed6VqsCN22i7U0cBlwJbCOw/qDgMOAp4DP5dguKaluCshg4AZgnxSvXQu4F9sVky7STccgZwE7hTw+D7gFeBKYD4wEdgHG+NZbHrgR2AR4M7dWijjK8hhkLOHHGH8g/PiiB/g2FgT/ay5uox1lpWOQCsoyIHcS3AB+6vC6McB/fa9bDKzfRlvKSAGJkGQXa1ngCGwXJMp04FxggWOZawDfB1YKeW5ogrbFGQns4HvsZuAMh9c+C0zEdsE8PX2PHZ9F40psAvBF32PvAX/EfUigTwBHYl3oacwHLgSedlx/GWwbHRWzzgxgEvBByjZFuh63IWMudyxvCPCCY5nt/IJ8N6SszRK8vgd41Pf6f6VsS1mF/YJELW/g3u0d9suddJkLrO5Y37WOZV7nWF4iixwrn+tY3uaO5bUbkEm+cmalKON4XxkfUq8ewCQBWQLs7FDm0IRlxi3fcXwfCxzLW+hYXqIv2XXdxxzXm457mNqxaki9Sfl3KQYDK6RrTmLjgduws/ojO1RnnI9w2+VZAEzNoL7FWA+ji8cd1xvoWnk73byzsJ/bRtOAnzi+fg72l+gXwCohz29KgjeSQJr3HPaaRe02xMEE4CL6/zhtA2xHupAn9SLBYZbmAGcCLzm8fgmwO3Aabidlw8wDzgGmOK6/F3Zs6e9EWQ07l5Ur/8/UQTnXl1Uv1tm+ct4k+e7Rqb4y3if/8YInEL5b+xLZ96LVvRfrUILvz0md9qOj+H92VybYqxVnIPCtkDKdP+QU/L8cjdYE7qF+Xc2l1A0BuZ3gQdlpuA+teRiwnu+xm9ttVIxeosPhUUg6pBsC8gbW/ddoM2wjbHU8sjN2iUqjBcCl2TQtoBfr9/d/L09hu3WNFJKS+YDmfbi9c64vyzPpY7CuWf9+6MPAFgSPJ1YGTif8GOCkNtoRpzeivkewHrNx2Ik6//Mv035I6n4MMoHm9zYvj0pOb6hgOnaWNE9Z3w9yFMGNwFueBa7BJo65H+vKDFvvcWxjylov8eHw5BWSugdkGM33/5ySRyU92JwRe5N/OCD7gPRgXYZpT1Y9T/pLJuJMxC0cnjxCUveAAKyInXDclprMWJbHHYU9wDHAxyQLx73A8Azq90saDk/WIemGgNROntMffAa7ALFVMGZi53vy6MxIGw5PliFRQCqoE/ODrAv8ALvA8j7gIeAm7MTgl8nnTD60Hw5PViFRQCqorhPoHEA24fCMJTokox3LUEAqqI4BOQC7+C6rcHjaDYkCUkF1C0he4fC0ExIFpILqFJC8w+FJGxIFpILqEpBOhcOTJiQKSAXVISCdDodnLHYzmr/eVwgPiQKSgR7sJv7x2M3xeat6QIoKhydJSLohIMth4zBvkVcFv6b/w5vaV2GeqhyQAyk2HB7XkNQ9ICtgt0177+2EPCqZR/MHuFcelTTIKyDLYVd37o37PSFJlCUcHpeQ1D0g+9P83vy3DmTC/wFW5ZbbRsOxAQe8Mu8n21/CsoXD0yokdQ+Ibrl1MBz4O/Dphse2Bm4lm5AcCEwmeKXoo9iYwHMyqCOtB7Gbv97zPb46diGm6xn3rtMtAfHCsVHIc+NoPyQHUd5weB4Evkp4SO7qfHOqoRsCEhcOzzhs7Kk0ITkIG46zzOHwPER4SFYroC2VUPeADMfu2/aHYyHB/dCxJA9JlcLhiQqJhKhzQLxwbOh7/GNsGJ9DiA7J8g7lVzEcHoUkB1XqxRqOjcbnb/NH2Mkiz8GE9zo9QHxIol5XdG9VUlsR3rulXqwUqhIQ13B4ojb2BwkPSV3C4YkKSW+BbcqaAtInaTg8riGpWzg841BA2lb2gIwgXTg8rUJS13CAThRGqsskniOwrtyoA/IbHcqY3PfvBTQfeG+FTemwPuU4IF+nb/kn7jN5SUp16MXKIhyeyYT3bo2mHOGYiI3PdR82d+Kl2Iy8gzrYBolQxl2suN2q3duoO2p3qsjdqoFE9zi9iXU5b0e6P3raxcpA2QIyArvsPutweMp2zLEUwfGRw5bZ2AiSWyYoWwHJgH9jOSCPShrEBSTvcHj8ISn6gPw6WgekcZmBTfWwaYty6x4Qb7fZWxbnUcndNG+IeV8BGhWQuHCMz6EduwJ/Bk7G7Qx7nr5JsoA0LlOwG4XGhJRb94BsRP/lRUuAO/KoZBVsOrMrsLny8hYWkE6Ho2yGEjwOeR6bJCjJeMNPYHNJrt1Xbt0DAjar2DXA77DpLSrPH5Cz6O5weC6n+f2/j40RsCrwPayHy3XK7sXYdVk/Dnmut0PvR1LyByTsgLnbwgGwG8HPYU/fOmsAP8S6otPukvXm+zakXf6A+JcP6b5wgJ3zeJvmz+L6mPVHAcdh07glCchDwH4Uf9wlEeIC0q3h8PyJ5s9jAW6TGm0I/Ap4BvegzAf+gp10HZrlm5D2RAWk28MBsCPBz2VCwjI2w6bVezGkrKjlPayTZjd09r5wYQFROMxA4HWaP5tb2yhvS+zk4mzcw/I29ku2A/nNoyIx/AFROJqdR/Pn8zHtd18OwC5XuQC7fMU1LK8B52KXzddi/r8q8AfkV8U2p3S2JrihHpJh+UthQwVdgl2Q6RqWWcCZwOYZtkVCVHno0U7oAV6i+TO6J6e6hgBfA64mOMJm3PIscCLBK61rawD5DNcZRgFp7Tc0f0aLsHGu8rQsNmzrjdhur0tQFgNH5NwuF0PI8RaPnbB7EBZi+5t572sqIK19geDGeFQH618Ru0fF5VKXVzvYLr8B2O0Ai7DOjR3zqMT/c55LJQ0UEDfTaf6cHimgDSsCk4gPyLQC2uXxX30w0/WFSX5u1vT9f50Er5X8XO37/xbAyA7VvQp2lfNM4PCY9d6h2F0s/7a7duhaIap0T/qewMZFN6KE1gh5bC/sPpC8jMB+0Q/FjkmivAH8FuuSnptje0rB/5PZ6TsKtbgvT6b4vF2shR1/zm9R/yvYxZKdmInMRS1HNcnlrq8usQnWtTo1o/K8Cx4nEN+LORM4A7gQ6+GqvDKPavJQ0Q2ouKxmANsXO59xMNHhmI7NjzIaOJ+ahAPK/QvSC5yC/SXU5QutbYAdNHv2JJu5+H5J9HYyBfuOrsK6ULtap49BJJmjCX5Hm2VQbuOUdY3LEVTnD5emYBOuJvjF751BuUdjd276HY71Zkkf/YKU3wM0f0cvks1f+fGEX1YyDfhkBuXnTb8gAtixQKN1SDaAXJSbsDsK/b8kY7BJQKsQklQUkHq5luDBsmtv1vLE7zJ1bUhcaRerGu6i+Xt6ldZ/CPen/+TflcSf64ja3XqG8oaklmPzSjoHEfyuto9Zf2XsXvPG9W8k/p7zqoVEAZH/G4btBjV+V5Nj1j+R4Hdbt5AoINLkFpq/q7cI39hXIP6at7qEpCMBmeGrYNs8KpFM7Etwg9g1ZL2fhayXZUjKcp5kJ5rbNj2PSrYBXsDuST6F6pxF7UbLE5xL5DLfOstgl6M3rrOA8JDcQLVD0oMNJPEBFo6xxTZHysA/l8hcbBR3z48IbtBHASeFPF6HkIg0CZtL5Bt9zw0hOEjc6/Tfv6GQSO2FzSVyXd9zhxHciI/1vT7rkExFIZGS8c8l8gGwEsHxeN8ifBT3kwkPyfUoJFIDYXOJ3BHy2AkxZSgkUlthc4n4lznYycU4WYdkCpp3RErCP5eIfznVsZx2QhI2qNyBCd+HSC52IDoc87C5DV2dElHOX4kOSVh38hKC08aJFGIgNj1B2EZ6dorykoQkbHLQJdhcJppTRErjXIIb6QLSXy/lEpKwe+SXALfRfMKyNlbHxju6Gdil4LZIMuMIbqjnt1lmXEiOjXiuyHCMxy7inExOvWiN9zsvpIvmfKiBHqznqPF8iPP4tDFOJTwIZQvHJjRPI35fHpWoF6LaRgGXYrfOfinDcl1CcjvF7lYdEtKmzPkr0P0g4okLSdHhAI1qIgU7jvDR5O8Edsc6BCpJAZGsHEf/BY5gB8TjqXA4oNxj80r1/Byb6mw5shtZvlAKiGTtpaIbkCXtYonEUEBEYiggIjEUEJEYCohIDAVEJIYCIhJDARGJoYCIxEgSkHm+/8/JsiEiOXrf9/+5eVTSOBL4E/QPUylSdsvRPJ31MXlV9FlgR2xsV5EqWRr4CrBx0Q0RERERERERERERERERkZJLMgT9AGAPbNjKWdj4riJVMRzYD1gDeI4chh89j/5rWV7GJoMUqYJVgVfp337PyaMS/1xz++RRiUgOJtK87c53fWGSy90H+/4/NMFrRYrkv7jWeTBt3TAlEkMBEYmhgIjE6Emwrr9b7HXgXd9j04EjgRdalLUWMAn4VIL6Pc/11TGjxXpr99WxQYo6ngWOAGa2WG9kXx2jU9Qxra+OWS3WGwX8PmUdz2CfVas61u2rY/0UdUzF3sfLDnVMAtZLUccU4HBgdov1RmPvY5Tv8WHAar7Hkmz7TlznonvQoay7EpSXto572qzDZR67f7RZx90OdTTODZlXHQ+3WcftDnU80mYdf3Oo47EE5WVuoWPFLjfEN/ZJp1lcBox4o8063nKo450263i9JHW812Ydr3Sgjla/5mCT9biU9bFDWUCyY5BrHde7OsOyolyT0TpVqKMun1Un3odrHVe5VppkP2wINrPtujHrTAMupnVClwL2BzZKUH+aOiaQbrrqqcAl2K9mnEF9daQ5lpqCzTrrUkcv6Y6lktQxERiToo6ngcuARS3WG4y9jzR1/Bu43LGOA4g/lpoOXAR8lKIdIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIrX3Py2wAaYahY2rAAAAAElFTkSuQmCC";
|
|
139
|
+
|
|
140
|
+
// src/components/Basic/Image/Image.tsx
|
|
141
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
142
|
+
var ImageControl = ({
|
|
143
|
+
className,
|
|
144
|
+
style,
|
|
145
|
+
imageUrl,
|
|
146
|
+
imageUrlExternal,
|
|
147
|
+
altText = "Preview"
|
|
148
|
+
}) => {
|
|
149
|
+
const imageClass = cn(
|
|
150
|
+
"h-[200px] w-[200px] border-1",
|
|
151
|
+
"border-2 border-dashed border-gray-400 flex items-center justify-center cursor-pointer hover:border-blue-500 transition"
|
|
152
|
+
);
|
|
153
|
+
const defaultImgClass = cn(
|
|
154
|
+
"w-full h-full",
|
|
155
|
+
className
|
|
156
|
+
);
|
|
157
|
+
if (!imageUrl && !imageUrlExternal) {
|
|
158
|
+
return /* @__PURE__ */ jsx7("div", { className: imageClass, children: /* @__PURE__ */ jsx7("img", { src: image_placeholder_default, alt: altText, className: "opacity-50", width: 50, height: 50 }) });
|
|
159
|
+
}
|
|
160
|
+
const url = imageUrlExternal || imageUrl;
|
|
161
|
+
return /* @__PURE__ */ jsx7("img", { src: url, alt: altText, className: defaultImgClass, style });
|
|
162
|
+
};
|
|
163
|
+
var Image_default = ImageControl;
|
|
164
|
+
|
|
165
|
+
// src/components/Basic/Shape/Shape.tsx
|
|
166
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
167
|
+
var Shape = ({
|
|
168
|
+
children,
|
|
169
|
+
className,
|
|
170
|
+
style
|
|
171
|
+
}) => {
|
|
172
|
+
return /* @__PURE__ */ jsx8("div", { className, style, children });
|
|
173
|
+
};
|
|
174
|
+
var Shape_default = Shape;
|
|
175
|
+
|
|
176
|
+
// src/components/Basic/Typography/Typography.tsx
|
|
177
|
+
import React from "react";
|
|
178
|
+
var Typography = ({
|
|
179
|
+
className,
|
|
180
|
+
style,
|
|
181
|
+
tagName,
|
|
182
|
+
textContent
|
|
183
|
+
}) => {
|
|
184
|
+
const Tag = tagName || "h1";
|
|
185
|
+
return React.createElement(
|
|
186
|
+
Tag,
|
|
187
|
+
{
|
|
188
|
+
style,
|
|
189
|
+
className: cn(className, "pointer-events-auto")
|
|
190
|
+
},
|
|
191
|
+
[
|
|
192
|
+
React.createElement("span", {
|
|
193
|
+
key: "html",
|
|
194
|
+
className: "pointer-events-none",
|
|
195
|
+
dangerouslySetInnerHTML: { __html: textContent }
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
var Typography_default = Typography;
|
|
201
|
+
|
|
202
|
+
// node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
203
|
+
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
204
|
+
|
|
205
|
+
// node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
206
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
207
|
+
var toCamelCase = (string) => string.replace(
|
|
208
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
209
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
210
|
+
);
|
|
211
|
+
var toPascalCase = (string) => {
|
|
212
|
+
const camelCase = toCamelCase(string);
|
|
213
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
214
|
+
};
|
|
215
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
216
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
217
|
+
}).join(" ").trim();
|
|
218
|
+
var hasA11yProp = (props) => {
|
|
219
|
+
for (const prop in props) {
|
|
220
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// node_modules/lucide-react/dist/esm/Icon.js
|
|
227
|
+
import { forwardRef, createElement } from "react";
|
|
228
|
+
|
|
229
|
+
// node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
230
|
+
var defaultAttributes = {
|
|
231
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
232
|
+
width: 24,
|
|
233
|
+
height: 24,
|
|
234
|
+
viewBox: "0 0 24 24",
|
|
235
|
+
fill: "none",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
strokeWidth: 2,
|
|
238
|
+
strokeLinecap: "round",
|
|
239
|
+
strokeLinejoin: "round"
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// node_modules/lucide-react/dist/esm/Icon.js
|
|
243
|
+
var Icon = forwardRef(
|
|
244
|
+
({
|
|
245
|
+
color = "currentColor",
|
|
246
|
+
size = 24,
|
|
247
|
+
strokeWidth = 2,
|
|
248
|
+
absoluteStrokeWidth,
|
|
249
|
+
className = "",
|
|
250
|
+
children,
|
|
251
|
+
iconNode,
|
|
252
|
+
...rest
|
|
253
|
+
}, ref) => createElement(
|
|
254
|
+
"svg",
|
|
255
|
+
{
|
|
256
|
+
ref,
|
|
257
|
+
...defaultAttributes,
|
|
258
|
+
width: size,
|
|
259
|
+
height: size,
|
|
260
|
+
stroke: color,
|
|
261
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
262
|
+
className: mergeClasses("lucide", className),
|
|
263
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
264
|
+
...rest
|
|
265
|
+
},
|
|
266
|
+
[
|
|
267
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
268
|
+
...Array.isArray(children) ? children : [children]
|
|
269
|
+
]
|
|
270
|
+
)
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
// node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
274
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
275
|
+
const Component = forwardRef2(
|
|
276
|
+
({ className, ...props }, ref) => createElement2(Icon, {
|
|
277
|
+
ref,
|
|
278
|
+
iconNode,
|
|
279
|
+
className: mergeClasses(
|
|
280
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
281
|
+
`lucide-${iconName}`,
|
|
282
|
+
className
|
|
283
|
+
),
|
|
284
|
+
...props
|
|
285
|
+
})
|
|
286
|
+
);
|
|
287
|
+
Component.displayName = toPascalCase(iconName);
|
|
288
|
+
return Component;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// node_modules/lucide-react/dist/esm/icons/bell.js
|
|
292
|
+
var __iconNode = [
|
|
293
|
+
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
294
|
+
[
|
|
295
|
+
"path",
|
|
296
|
+
{
|
|
297
|
+
d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
|
|
298
|
+
key: "11g9vi"
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
];
|
|
302
|
+
var Bell = createLucideIcon("bell", __iconNode);
|
|
303
|
+
|
|
304
|
+
// node_modules/lucide-react/dist/esm/icons/calculator.js
|
|
305
|
+
var __iconNode2 = [
|
|
306
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
|
|
307
|
+
["line", { x1: "8", x2: "16", y1: "6", y2: "6", key: "x4nwl0" }],
|
|
308
|
+
["line", { x1: "16", x2: "16", y1: "14", y2: "18", key: "wjye3r" }],
|
|
309
|
+
["path", { d: "M16 10h.01", key: "1m94wz" }],
|
|
310
|
+
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
311
|
+
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
312
|
+
["path", { d: "M12 14h.01", key: "1etili" }],
|
|
313
|
+
["path", { d: "M8 14h.01", key: "6423bh" }],
|
|
314
|
+
["path", { d: "M12 18h.01", key: "mhygvu" }],
|
|
315
|
+
["path", { d: "M8 18h.01", key: "lrp35t" }]
|
|
316
|
+
];
|
|
317
|
+
var Calculator = createLucideIcon("calculator", __iconNode2);
|
|
318
|
+
|
|
319
|
+
// node_modules/lucide-react/dist/esm/icons/calendar.js
|
|
320
|
+
var __iconNode3 = [
|
|
321
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
322
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
323
|
+
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
324
|
+
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
325
|
+
];
|
|
326
|
+
var Calendar = createLucideIcon("calendar", __iconNode3);
|
|
327
|
+
|
|
328
|
+
// node_modules/lucide-react/dist/esm/icons/check.js
|
|
329
|
+
var __iconNode4 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
330
|
+
var Check = createLucideIcon("check", __iconNode4);
|
|
331
|
+
|
|
332
|
+
// node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
333
|
+
var __iconNode5 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
334
|
+
var ChevronDown = createLucideIcon("chevron-down", __iconNode5);
|
|
335
|
+
|
|
336
|
+
// node_modules/lucide-react/dist/esm/icons/chevron-left.js
|
|
337
|
+
var __iconNode6 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
338
|
+
var ChevronLeft = createLucideIcon("chevron-left", __iconNode6);
|
|
339
|
+
|
|
340
|
+
// node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
341
|
+
var __iconNode7 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
342
|
+
var ChevronRight = createLucideIcon("chevron-right", __iconNode7);
|
|
343
|
+
|
|
344
|
+
// node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
345
|
+
var __iconNode8 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
346
|
+
var ChevronUp = createLucideIcon("chevron-up", __iconNode8);
|
|
347
|
+
|
|
348
|
+
// node_modules/lucide-react/dist/esm/icons/circle.js
|
|
349
|
+
var __iconNode9 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
350
|
+
var Circle = createLucideIcon("circle", __iconNode9);
|
|
351
|
+
|
|
352
|
+
// node_modules/lucide-react/dist/esm/icons/ellipsis.js
|
|
353
|
+
var __iconNode10 = [
|
|
354
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
355
|
+
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
356
|
+
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
357
|
+
];
|
|
358
|
+
var Ellipsis = createLucideIcon("ellipsis", __iconNode10);
|
|
359
|
+
|
|
360
|
+
// node_modules/lucide-react/dist/esm/icons/mail.js
|
|
361
|
+
var __iconNode11 = [
|
|
362
|
+
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
363
|
+
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
364
|
+
];
|
|
365
|
+
var Mail = createLucideIcon("mail", __iconNode11);
|
|
366
|
+
|
|
367
|
+
// node_modules/lucide-react/dist/esm/icons/menu.js
|
|
368
|
+
var __iconNode12 = [
|
|
369
|
+
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
370
|
+
["path", { d: "M4 18h16", key: "19g7jn" }],
|
|
371
|
+
["path", { d: "M4 6h16", key: "1o0s65" }]
|
|
372
|
+
];
|
|
373
|
+
var Menu = createLucideIcon("menu", __iconNode12);
|
|
374
|
+
|
|
375
|
+
// node_modules/lucide-react/dist/esm/icons/scan-eye.js
|
|
376
|
+
var __iconNode13 = [
|
|
377
|
+
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
|
|
378
|
+
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
|
|
379
|
+
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
|
|
380
|
+
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
|
|
381
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
382
|
+
[
|
|
383
|
+
"path",
|
|
384
|
+
{
|
|
385
|
+
d: "M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",
|
|
386
|
+
key: "11ak4c"
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
];
|
|
390
|
+
var ScanEye = createLucideIcon("scan-eye", __iconNode13);
|
|
391
|
+
|
|
392
|
+
// node_modules/lucide-react/dist/esm/icons/search.js
|
|
393
|
+
var __iconNode14 = [
|
|
394
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
395
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
396
|
+
];
|
|
397
|
+
var Search = createLucideIcon("search", __iconNode14);
|
|
398
|
+
|
|
399
|
+
// src/components/Basic/Breadcrumb/Breadcrumb.tsx
|
|
400
|
+
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
401
|
+
var Breadcrumb = ({ list = [], className, style, LinkComponent }) => {
|
|
402
|
+
return /* @__PURE__ */ jsx9(
|
|
403
|
+
"nav",
|
|
404
|
+
{
|
|
405
|
+
"aria-label": "breadcrumb",
|
|
406
|
+
className: cn("flex items-center text-sm text-muted-foreground", className),
|
|
407
|
+
style,
|
|
408
|
+
children: list.map((item, index) => {
|
|
409
|
+
const isLast = index === list.length - 1;
|
|
410
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex items-center", children: [
|
|
411
|
+
item.url && !isLast && LinkComponent ? /* @__PURE__ */ jsx9(
|
|
412
|
+
LinkComponent,
|
|
413
|
+
{
|
|
414
|
+
href: item.url,
|
|
415
|
+
className: "hover:text-foreground transition-colors",
|
|
416
|
+
children: item.header
|
|
417
|
+
}
|
|
418
|
+
) : /* @__PURE__ */ jsx9("span", { className: "text-foreground font-medium", children: item.header }),
|
|
419
|
+
!isLast && /* @__PURE__ */ jsx9(ChevronRight, { className: "mx-2 h-4 w-4 text-muted-foreground" })
|
|
420
|
+
] }, item.id);
|
|
421
|
+
})
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
};
|
|
425
|
+
var Breadcrumb_default = Breadcrumb;
|
|
426
|
+
|
|
427
|
+
// src/components/ui/dropdown-menu.tsx
|
|
428
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
429
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
430
|
+
function DropdownMenu({
|
|
431
|
+
...props
|
|
432
|
+
}) {
|
|
433
|
+
return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
434
|
+
}
|
|
435
|
+
function DropdownMenuTrigger({
|
|
436
|
+
...props
|
|
437
|
+
}) {
|
|
438
|
+
return /* @__PURE__ */ jsx10(
|
|
439
|
+
DropdownMenuPrimitive.Trigger,
|
|
440
|
+
{
|
|
441
|
+
"data-slot": "dropdown-menu-trigger",
|
|
442
|
+
...props
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
function DropdownMenuContent({
|
|
447
|
+
className,
|
|
448
|
+
sideOffset = 4,
|
|
449
|
+
...props
|
|
450
|
+
}) {
|
|
451
|
+
return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
452
|
+
DropdownMenuPrimitive.Content,
|
|
453
|
+
{
|
|
454
|
+
"data-slot": "dropdown-menu-content",
|
|
455
|
+
sideOffset,
|
|
456
|
+
className: cn(
|
|
457
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
458
|
+
className
|
|
459
|
+
),
|
|
460
|
+
...props
|
|
461
|
+
}
|
|
462
|
+
) });
|
|
463
|
+
}
|
|
464
|
+
function DropdownMenuItem({
|
|
465
|
+
className,
|
|
466
|
+
inset,
|
|
467
|
+
variant = "default",
|
|
468
|
+
...props
|
|
469
|
+
}) {
|
|
470
|
+
return /* @__PURE__ */ jsx10(
|
|
471
|
+
DropdownMenuPrimitive.Item,
|
|
472
|
+
{
|
|
473
|
+
"data-slot": "dropdown-menu-item",
|
|
474
|
+
"data-inset": inset,
|
|
475
|
+
"data-variant": variant,
|
|
476
|
+
className: cn(
|
|
477
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
478
|
+
className
|
|
479
|
+
),
|
|
480
|
+
...props
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
function DropdownMenuLabel({
|
|
485
|
+
className,
|
|
486
|
+
inset,
|
|
487
|
+
...props
|
|
488
|
+
}) {
|
|
489
|
+
return /* @__PURE__ */ jsx10(
|
|
490
|
+
DropdownMenuPrimitive.Label,
|
|
491
|
+
{
|
|
492
|
+
"data-slot": "dropdown-menu-label",
|
|
493
|
+
"data-inset": inset,
|
|
494
|
+
className: cn(
|
|
495
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
496
|
+
className
|
|
497
|
+
),
|
|
498
|
+
...props
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
function DropdownMenuSeparator({
|
|
503
|
+
className,
|
|
504
|
+
...props
|
|
505
|
+
}) {
|
|
506
|
+
return /* @__PURE__ */ jsx10(
|
|
507
|
+
DropdownMenuPrimitive.Separator,
|
|
508
|
+
{
|
|
509
|
+
"data-slot": "dropdown-menu-separator",
|
|
510
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
511
|
+
...props
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
function DropdownMenuSub({
|
|
516
|
+
...props
|
|
517
|
+
}) {
|
|
518
|
+
return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
519
|
+
}
|
|
520
|
+
function DropdownMenuSubTrigger({
|
|
521
|
+
className,
|
|
522
|
+
inset,
|
|
523
|
+
children,
|
|
524
|
+
...props
|
|
525
|
+
}) {
|
|
526
|
+
return /* @__PURE__ */ jsxs3(
|
|
527
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
528
|
+
{
|
|
529
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
530
|
+
"data-inset": inset,
|
|
531
|
+
className: cn(
|
|
532
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
|
|
533
|
+
className
|
|
534
|
+
),
|
|
535
|
+
...props,
|
|
536
|
+
children: [
|
|
537
|
+
children,
|
|
538
|
+
/* @__PURE__ */ jsx10(ChevronRight, { className: "ml-auto size-4" })
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
function DropdownMenuSubContent({
|
|
544
|
+
className,
|
|
545
|
+
...props
|
|
546
|
+
}) {
|
|
547
|
+
return /* @__PURE__ */ jsx10(
|
|
548
|
+
DropdownMenuPrimitive.SubContent,
|
|
549
|
+
{
|
|
550
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
551
|
+
className: cn(
|
|
552
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
553
|
+
className
|
|
554
|
+
),
|
|
555
|
+
...props
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// src/components/Basic/ButtonGroup/ButtonGroup.tsx
|
|
561
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
562
|
+
function SplitButton({ style, textContent, className, list = [], LinkComponent }) {
|
|
563
|
+
const bgColor = style?.backgroundColor || "";
|
|
564
|
+
return /* @__PURE__ */ jsxs4("div", { className: "inline-flex rounded-md overflow-hidden border border-teal-200 bg-teal-700 items-center focus:ring-0", style: { backgroundColor: bgColor }, children: [
|
|
565
|
+
/* @__PURE__ */ jsx11(
|
|
566
|
+
Button,
|
|
567
|
+
{
|
|
568
|
+
className: `rounded-none border-r px-4 py-2 text-whit focus:ring-0 ${className || ""}`,
|
|
569
|
+
style: { backgroundColor: bgColor },
|
|
570
|
+
children: textContent || "Button"
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
/* @__PURE__ */ jsxs4(DropdownMenu, { children: [
|
|
574
|
+
/* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
575
|
+
Button,
|
|
576
|
+
{
|
|
577
|
+
className: "rounded-none bg-teal-700 px-4 py-2 text-white ring-0 shadow-none hover:bg-teal-600 focus:ring-0",
|
|
578
|
+
"aria-label": "Open Dropdown",
|
|
579
|
+
style: { backgroundColor: bgColor },
|
|
580
|
+
children: /* @__PURE__ */ jsx11(ChevronDown, { className: "w-4 h-4" })
|
|
581
|
+
}
|
|
582
|
+
) }),
|
|
583
|
+
/* @__PURE__ */ jsx11(DropdownMenuContent, { align: "end", className: "bg-white min-w-[120px]", children: list.map((item) => /* @__PURE__ */ jsx11(DropdownMenuItem, { className: "text-black", children: LinkComponent ? /* @__PURE__ */ jsx11(LinkComponent, { href: item.url || "#", children: item.header }) : item.header }, item.id)) })
|
|
584
|
+
] })
|
|
585
|
+
] });
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// src/components/ui/input.tsx
|
|
589
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
590
|
+
function Input({ className, type, ...props }) {
|
|
591
|
+
return /* @__PURE__ */ jsx12(
|
|
592
|
+
"input",
|
|
593
|
+
{
|
|
594
|
+
type,
|
|
595
|
+
"data-slot": "input",
|
|
596
|
+
className: cn(
|
|
597
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
598
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
599
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
600
|
+
className
|
|
601
|
+
),
|
|
602
|
+
...props
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// src/components/Inputs/TextInput/TextInput.tsx
|
|
608
|
+
import { Fragment, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
609
|
+
var TextInput = ({ className, style, ...props }) => {
|
|
610
|
+
const placeholder = props.placeholder || "Placeholder text";
|
|
611
|
+
const isEditable = props.isEditable ?? true;
|
|
612
|
+
const isDisabled = props.isDisabled ?? false;
|
|
613
|
+
const isReadonly = props.isReadonly ?? false;
|
|
614
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
615
|
+
const handleChange = (e) => {
|
|
616
|
+
props.onChange?.(e);
|
|
617
|
+
};
|
|
618
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
619
|
+
/* @__PURE__ */ jsx13(
|
|
620
|
+
Input,
|
|
621
|
+
{
|
|
622
|
+
type: "text",
|
|
623
|
+
name: props.name,
|
|
624
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
625
|
+
style: {
|
|
626
|
+
...style,
|
|
627
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
628
|
+
},
|
|
629
|
+
value: props.value,
|
|
630
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
631
|
+
placeholder,
|
|
632
|
+
onChange: handleChange,
|
|
633
|
+
disabled: isDisabled || !isEditable,
|
|
634
|
+
readOnly: isReadonly
|
|
635
|
+
}
|
|
636
|
+
),
|
|
637
|
+
props.errorMessage && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
638
|
+
] });
|
|
639
|
+
};
|
|
640
|
+
var TextInput_default = TextInput;
|
|
641
|
+
|
|
642
|
+
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
643
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
644
|
+
var NumberInput = ({ className, style, ...props }) => {
|
|
645
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
646
|
+
const isEditable = props.isEditable ?? true;
|
|
647
|
+
const isDisabled = props.isDisabled ?? false;
|
|
648
|
+
const isReadonly = props.isReadonly ?? false;
|
|
649
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
650
|
+
const handleChange = (e) => {
|
|
651
|
+
props.onChange?.(e);
|
|
652
|
+
};
|
|
653
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
654
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex justify-start items-center relative", children: [
|
|
655
|
+
/* @__PURE__ */ jsx14(Calculator, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
656
|
+
/* @__PURE__ */ jsx14(
|
|
657
|
+
Input,
|
|
658
|
+
{
|
|
659
|
+
type: "number",
|
|
660
|
+
id: props.name || "number-field",
|
|
661
|
+
name: props.name,
|
|
662
|
+
value: props.value,
|
|
663
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
664
|
+
style: {
|
|
665
|
+
...style,
|
|
666
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
667
|
+
},
|
|
668
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
669
|
+
placeholder,
|
|
670
|
+
onChange: handleChange,
|
|
671
|
+
disabled: isDisabled || !isEditable,
|
|
672
|
+
readOnly: isReadonly
|
|
673
|
+
}
|
|
674
|
+
)
|
|
675
|
+
] }),
|
|
676
|
+
props.errorMessage && /* @__PURE__ */ jsx14("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
677
|
+
] });
|
|
678
|
+
};
|
|
679
|
+
var NumberInput_default = NumberInput;
|
|
680
|
+
|
|
681
|
+
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
682
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
683
|
+
var EmailInput = ({ className, style, ...props }) => {
|
|
684
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
685
|
+
const isEditable = props.isEditable ?? true;
|
|
686
|
+
const isDisabled = props.isDisabled ?? false;
|
|
687
|
+
const isReadonly = props.isReadonly ?? false;
|
|
688
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
689
|
+
const handleChange = (e) => {
|
|
690
|
+
props.onChange?.(e);
|
|
691
|
+
};
|
|
692
|
+
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
693
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-start items-center relative", children: [
|
|
694
|
+
/* @__PURE__ */ jsx15(Mail, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
695
|
+
/* @__PURE__ */ jsx15(
|
|
696
|
+
Input,
|
|
697
|
+
{
|
|
698
|
+
type: "email",
|
|
699
|
+
name: props.name,
|
|
700
|
+
value: props.value,
|
|
701
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
702
|
+
style: {
|
|
703
|
+
...style,
|
|
704
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
705
|
+
},
|
|
706
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
707
|
+
placeholder,
|
|
708
|
+
onChange: handleChange,
|
|
709
|
+
disabled: isDisabled || !isEditable,
|
|
710
|
+
readOnly: isReadonly
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
] }),
|
|
714
|
+
props.errorMessage && /* @__PURE__ */ jsx15("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
715
|
+
] });
|
|
716
|
+
};
|
|
717
|
+
var EmailInput_default = EmailInput;
|
|
718
|
+
|
|
719
|
+
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
720
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
721
|
+
var PasswordInput = ({ className, style, ...props }) => {
|
|
722
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
723
|
+
const isEditable = props.isEditable ?? true;
|
|
724
|
+
const isDisabled = props.isDisabled ?? false;
|
|
725
|
+
const isReadonly = props.isReadonly ?? false;
|
|
726
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
727
|
+
const handleChange = (e) => {
|
|
728
|
+
props.onChange?.(e);
|
|
729
|
+
};
|
|
730
|
+
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
731
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex justify-start items-center relative", children: [
|
|
732
|
+
/* @__PURE__ */ jsx16(ScanEye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
733
|
+
/* @__PURE__ */ jsx16(
|
|
734
|
+
Input,
|
|
735
|
+
{
|
|
736
|
+
type: "password",
|
|
737
|
+
id: props.name || "password-field",
|
|
738
|
+
name: props.name,
|
|
739
|
+
value: props.value,
|
|
740
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
741
|
+
style: {
|
|
742
|
+
...style,
|
|
743
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
744
|
+
},
|
|
745
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
746
|
+
placeholder,
|
|
747
|
+
onChange: handleChange,
|
|
748
|
+
disabled: isDisabled || !isEditable,
|
|
749
|
+
readOnly: isReadonly
|
|
750
|
+
}
|
|
751
|
+
)
|
|
752
|
+
] }),
|
|
753
|
+
props.errorMessage && /* @__PURE__ */ jsx16("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
754
|
+
] });
|
|
755
|
+
};
|
|
756
|
+
var PasswordInput_default = PasswordInput;
|
|
757
|
+
|
|
758
|
+
// src/components/ui/textarea.tsx
|
|
759
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
760
|
+
function Textarea({ className, ...props }) {
|
|
761
|
+
return /* @__PURE__ */ jsx17(
|
|
762
|
+
"textarea",
|
|
763
|
+
{
|
|
764
|
+
"data-slot": "textarea",
|
|
765
|
+
className: cn(
|
|
766
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
767
|
+
className
|
|
768
|
+
),
|
|
769
|
+
...props
|
|
770
|
+
}
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// src/components/Inputs/Textarea/Textarea.tsx
|
|
775
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
776
|
+
var Textarea2 = ({ className, style, ...props }) => {
|
|
777
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
778
|
+
const isEditable = props.isEditable ?? true;
|
|
779
|
+
const isDisabled = props.isDisabled ?? false;
|
|
780
|
+
const isReadonly = props.isReadonly ?? false;
|
|
781
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
782
|
+
const handleChange = (e) => {
|
|
783
|
+
props.onChange?.(e);
|
|
784
|
+
};
|
|
785
|
+
return /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
786
|
+
/* @__PURE__ */ jsx18(
|
|
787
|
+
Textarea,
|
|
788
|
+
{
|
|
789
|
+
id: "textarea-field",
|
|
790
|
+
name: props.name,
|
|
791
|
+
value: props.value,
|
|
792
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
793
|
+
style: {
|
|
794
|
+
...style,
|
|
795
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
796
|
+
},
|
|
797
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
798
|
+
placeholder,
|
|
799
|
+
onChange: handleChange,
|
|
800
|
+
disabled: isDisabled || !isEditable,
|
|
801
|
+
readOnly: isReadonly
|
|
802
|
+
}
|
|
803
|
+
),
|
|
804
|
+
props.errorMessage && /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
805
|
+
] });
|
|
806
|
+
};
|
|
807
|
+
var Textarea_default = Textarea2;
|
|
808
|
+
|
|
809
|
+
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
810
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
811
|
+
var UrlInput = ({ className, style, ...props }) => {
|
|
812
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
813
|
+
const isEditable = props.isEditable ?? true;
|
|
814
|
+
const isDisabled = props.isDisabled ?? false;
|
|
815
|
+
const isReadonly = props.isReadonly ?? false;
|
|
816
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
817
|
+
const handleChange = (e) => {
|
|
818
|
+
props.onChange?.(e);
|
|
819
|
+
};
|
|
820
|
+
return /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
821
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex justify-start items-center relative", children: [
|
|
822
|
+
/* @__PURE__ */ jsx19("div", { className: "bg-[#E9E9E9] absolute px-10 text-center top-1/2 h-full justify-center items-center flex w-10 -translate-y-1/2 text-[#383838] font-[500] text-[12px]", children: "https://" }),
|
|
823
|
+
/* @__PURE__ */ jsx19(
|
|
824
|
+
Input,
|
|
825
|
+
{
|
|
826
|
+
id: "url-field",
|
|
827
|
+
type: "url",
|
|
828
|
+
name: props.name,
|
|
829
|
+
value: props.value,
|
|
830
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
831
|
+
style: {
|
|
832
|
+
...style,
|
|
833
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
834
|
+
},
|
|
835
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
836
|
+
placeholder,
|
|
837
|
+
onChange: handleChange,
|
|
838
|
+
disabled: isDisabled || !isEditable,
|
|
839
|
+
readOnly: isReadonly
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
] }),
|
|
843
|
+
props.errorMessage && /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
844
|
+
] });
|
|
845
|
+
};
|
|
846
|
+
var UrlInput_default = UrlInput;
|
|
847
|
+
|
|
848
|
+
// src/components/ui/checkbox.tsx
|
|
849
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
850
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
851
|
+
function Checkbox({
|
|
852
|
+
className,
|
|
853
|
+
...props
|
|
854
|
+
}) {
|
|
855
|
+
return /* @__PURE__ */ jsx20(
|
|
856
|
+
CheckboxPrimitive.Root,
|
|
857
|
+
{
|
|
858
|
+
"data-slot": "checkbox",
|
|
859
|
+
className: cn(
|
|
860
|
+
"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",
|
|
861
|
+
className
|
|
862
|
+
),
|
|
863
|
+
...props,
|
|
864
|
+
children: /* @__PURE__ */ jsx20(
|
|
865
|
+
CheckboxPrimitive.Indicator,
|
|
866
|
+
{
|
|
867
|
+
"data-slot": "checkbox-indicator",
|
|
868
|
+
className: "flex items-center justify-center text-current transition-none",
|
|
869
|
+
children: /* @__PURE__ */ jsx20(Check, { className: "size-3.5" })
|
|
870
|
+
}
|
|
871
|
+
)
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// src/components/ui/label.tsx
|
|
877
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
878
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
879
|
+
function Label2({
|
|
880
|
+
className,
|
|
881
|
+
...props
|
|
882
|
+
}) {
|
|
883
|
+
return /* @__PURE__ */ jsx21(
|
|
884
|
+
LabelPrimitive.Root,
|
|
885
|
+
{
|
|
886
|
+
"data-slot": "label",
|
|
887
|
+
className: cn(
|
|
888
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
889
|
+
className
|
|
890
|
+
),
|
|
891
|
+
...props
|
|
892
|
+
}
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
897
|
+
import { Fragment as Fragment7, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
898
|
+
var CheckboxInput = ({ className, style, ...props }) => {
|
|
899
|
+
const isEditable = props.isEditable ?? true;
|
|
900
|
+
const isDisabled = props.isDisabled ?? false;
|
|
901
|
+
const text = props.text ? props.text : "Subscribe";
|
|
902
|
+
const handleChange = (value) => {
|
|
903
|
+
props.onChange?.(value);
|
|
904
|
+
};
|
|
905
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
906
|
+
/* @__PURE__ */ jsx22("div", { className, style, children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center space-x-2", children: [
|
|
907
|
+
/* @__PURE__ */ jsx22(
|
|
908
|
+
Checkbox,
|
|
909
|
+
{
|
|
910
|
+
id: props.name || "checkbox",
|
|
911
|
+
checked: !!props.value,
|
|
912
|
+
onCheckedChange: handleChange,
|
|
913
|
+
disabled: !isEditable || isDisabled
|
|
914
|
+
}
|
|
915
|
+
),
|
|
916
|
+
/* @__PURE__ */ jsx22(Label2, { htmlFor: props.name || "checkbox", children: text })
|
|
917
|
+
] }) }),
|
|
918
|
+
props.errorMessage && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
919
|
+
] });
|
|
920
|
+
};
|
|
921
|
+
var Checkbox_default = CheckboxInput;
|
|
922
|
+
|
|
923
|
+
// src/components/ui/radio-group.tsx
|
|
924
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
925
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
926
|
+
function RadioGroup2({
|
|
927
|
+
className,
|
|
928
|
+
...props
|
|
929
|
+
}) {
|
|
930
|
+
return /* @__PURE__ */ jsx23(
|
|
931
|
+
RadioGroupPrimitive.Root,
|
|
932
|
+
{
|
|
933
|
+
"data-slot": "radio-group",
|
|
934
|
+
className: cn("grid gap-3", className),
|
|
935
|
+
...props
|
|
936
|
+
}
|
|
937
|
+
);
|
|
938
|
+
}
|
|
939
|
+
function RadioGroupItem({
|
|
940
|
+
className,
|
|
941
|
+
...props
|
|
942
|
+
}) {
|
|
943
|
+
return /* @__PURE__ */ jsx23(
|
|
944
|
+
RadioGroupPrimitive.Item,
|
|
945
|
+
{
|
|
946
|
+
"data-slot": "radio-group-item",
|
|
947
|
+
className: cn(
|
|
948
|
+
"border-input text-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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
949
|
+
className
|
|
950
|
+
),
|
|
951
|
+
...props,
|
|
952
|
+
children: /* @__PURE__ */ jsx23(
|
|
953
|
+
RadioGroupPrimitive.Indicator,
|
|
954
|
+
{
|
|
955
|
+
"data-slot": "radio-group-indicator",
|
|
956
|
+
className: "relative flex items-center justify-center",
|
|
957
|
+
children: /* @__PURE__ */ jsx23(Circle, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
958
|
+
}
|
|
959
|
+
)
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
965
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
966
|
+
var RadioInput = ({
|
|
967
|
+
className,
|
|
968
|
+
style,
|
|
969
|
+
defaultValue,
|
|
970
|
+
onChange,
|
|
971
|
+
data = [],
|
|
972
|
+
dataKey,
|
|
973
|
+
dataLabel,
|
|
974
|
+
...props
|
|
975
|
+
}) => {
|
|
976
|
+
const options = (data || []).map((item) => ({
|
|
977
|
+
value: item[dataKey || "value"],
|
|
978
|
+
label: item[dataLabel || "label"]
|
|
979
|
+
}));
|
|
980
|
+
const handleChange = (value) => {
|
|
981
|
+
onChange?.(value);
|
|
982
|
+
};
|
|
983
|
+
const resolvedDefaultValue = (typeof defaultValue === "string" ? defaultValue : void 0) ?? options[0]?.value;
|
|
984
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
985
|
+
/* @__PURE__ */ jsx24("div", { className, style, children: /* @__PURE__ */ jsxs12(
|
|
986
|
+
RadioGroup2,
|
|
987
|
+
{
|
|
988
|
+
defaultValue: resolvedDefaultValue,
|
|
989
|
+
onValueChange: handleChange,
|
|
990
|
+
children: [
|
|
991
|
+
options.length === 0 && /* @__PURE__ */ jsx24("div", { className: "text-sm text-gray-500", children: "No options available" }),
|
|
992
|
+
options.map((item) => /* @__PURE__ */ jsxs12("div", { className: "flex items-center space-x-2", children: [
|
|
993
|
+
/* @__PURE__ */ jsx24(RadioGroupItem, { value: item.value, id: `radio-${item.value}` }),
|
|
994
|
+
/* @__PURE__ */ jsx24(Label2, { htmlFor: `radio-${item.value}`, children: item.label })
|
|
995
|
+
] }, item.value))
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
) }),
|
|
999
|
+
props.errorMessage && /* @__PURE__ */ jsx24("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1000
|
+
] });
|
|
1001
|
+
};
|
|
1002
|
+
var RadioInput_default = RadioInput;
|
|
1003
|
+
|
|
1004
|
+
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
1005
|
+
import { useCallback, useState } from "react";
|
|
1006
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1007
|
+
var MultiCheckbox = ({
|
|
1008
|
+
className,
|
|
1009
|
+
style,
|
|
1010
|
+
data = [],
|
|
1011
|
+
dataKey = "value",
|
|
1012
|
+
dataLabel = "label",
|
|
1013
|
+
value: propValue = {},
|
|
1014
|
+
onChange,
|
|
1015
|
+
isEditable = true,
|
|
1016
|
+
isDisabled = false
|
|
1017
|
+
}) => {
|
|
1018
|
+
const [value, setValue] = useState(propValue);
|
|
1019
|
+
const options = (data || []).map((item) => ({
|
|
1020
|
+
value: item[dataKey || "value"],
|
|
1021
|
+
label: item[dataLabel || "label"]
|
|
1022
|
+
}));
|
|
1023
|
+
const handleChange = useCallback(
|
|
1024
|
+
(key, checked) => {
|
|
1025
|
+
setValue((prev) => {
|
|
1026
|
+
const newValue = { ...prev, [key]: checked };
|
|
1027
|
+
onChange?.(newValue);
|
|
1028
|
+
return newValue;
|
|
1029
|
+
});
|
|
1030
|
+
},
|
|
1031
|
+
[onChange]
|
|
1032
|
+
);
|
|
1033
|
+
return /* @__PURE__ */ jsxs13(
|
|
1034
|
+
"div",
|
|
1035
|
+
{
|
|
1036
|
+
className: cn("flex flex-col gap-3", className),
|
|
1037
|
+
style,
|
|
1038
|
+
children: [
|
|
1039
|
+
options.length === 0 && /* @__PURE__ */ jsx25("p", { className: "text-sm text-gray-500", children: "No options available." }),
|
|
1040
|
+
options.map((opt) => /* @__PURE__ */ jsxs13("div", { className: "flex items-center space-x-2", children: [
|
|
1041
|
+
/* @__PURE__ */ jsx25(
|
|
1042
|
+
Checkbox,
|
|
1043
|
+
{
|
|
1044
|
+
id: opt.value,
|
|
1045
|
+
checked: !!value[opt.value],
|
|
1046
|
+
onCheckedChange: (checked) => handleChange(opt.value, checked === true),
|
|
1047
|
+
disabled: !isEditable || isDisabled
|
|
1048
|
+
}
|
|
1049
|
+
),
|
|
1050
|
+
/* @__PURE__ */ jsx25(Label2, { htmlFor: opt.value, children: opt.label })
|
|
1051
|
+
] }, opt.value))
|
|
1052
|
+
]
|
|
1053
|
+
}
|
|
1054
|
+
);
|
|
1055
|
+
};
|
|
1056
|
+
var MultiCheckbox_default = MultiCheckbox;
|
|
1057
|
+
|
|
1058
|
+
// src/components/Global/TinyMceEditor.tsx
|
|
1059
|
+
import { useMemo, useRef } from "react";
|
|
1060
|
+
import { Editor } from "@tinymce/tinymce-react";
|
|
1061
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1062
|
+
function MyEditor({
|
|
1063
|
+
value,
|
|
1064
|
+
onChange,
|
|
1065
|
+
isDefault
|
|
1066
|
+
}) {
|
|
1067
|
+
const editorRef = useRef(null);
|
|
1068
|
+
function stripOuterP(html) {
|
|
1069
|
+
const trimmedHtml = html.trim();
|
|
1070
|
+
if (!trimmedHtml) return "";
|
|
1071
|
+
const div = document.createElement("div");
|
|
1072
|
+
div.innerHTML = trimmedHtml;
|
|
1073
|
+
const firstChild = div.firstElementChild;
|
|
1074
|
+
if (div.childElementCount === 1 && firstChild?.tagName === "P") {
|
|
1075
|
+
return firstChild.innerHTML;
|
|
1076
|
+
}
|
|
1077
|
+
return trimmedHtml;
|
|
1078
|
+
}
|
|
1079
|
+
const isDefaultToolbar = useMemo(() => {
|
|
1080
|
+
let toolbar = "undo redo | formatselect | bold italic forecolor";
|
|
1081
|
+
if (isDefault) {
|
|
1082
|
+
toolbar = "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help";
|
|
1083
|
+
}
|
|
1084
|
+
return toolbar;
|
|
1085
|
+
}, [isDefault]);
|
|
1086
|
+
return /* @__PURE__ */ jsx26(
|
|
1087
|
+
Editor,
|
|
1088
|
+
{
|
|
1089
|
+
apiKey: process.env.NEXT_PUBLIC_TINYMCE_API_KEY,
|
|
1090
|
+
tinymceScriptSrc: process.env.NEXT_PUBLIC_TINYMCE_SCRIPT_SRC,
|
|
1091
|
+
onInit: (_evt, editor) => editorRef.current = editor,
|
|
1092
|
+
value,
|
|
1093
|
+
licenseKey: "gpl",
|
|
1094
|
+
init: {
|
|
1095
|
+
height: 300,
|
|
1096
|
+
menubar: false,
|
|
1097
|
+
forced_root_block: false,
|
|
1098
|
+
plugins: [
|
|
1099
|
+
"advlist",
|
|
1100
|
+
"autolink",
|
|
1101
|
+
"lists",
|
|
1102
|
+
"link",
|
|
1103
|
+
"image",
|
|
1104
|
+
"charmap",
|
|
1105
|
+
"preview",
|
|
1106
|
+
"anchor",
|
|
1107
|
+
"searchreplace",
|
|
1108
|
+
"visualblocks",
|
|
1109
|
+
"code",
|
|
1110
|
+
"fullscreen",
|
|
1111
|
+
"insertdatetime",
|
|
1112
|
+
"media",
|
|
1113
|
+
"table",
|
|
1114
|
+
"help",
|
|
1115
|
+
"wordcount"
|
|
1116
|
+
],
|
|
1117
|
+
toolbar: isDefaultToolbar,
|
|
1118
|
+
content_style: `
|
|
1119
|
+
body {
|
|
1120
|
+
outline: none;
|
|
1121
|
+
}
|
|
1122
|
+
`
|
|
1123
|
+
},
|
|
1124
|
+
onEditorChange: (content) => onChange?.(stripOuterP(content))
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// src/components/Inputs/RichText/RichText.tsx
|
|
1130
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1131
|
+
function RichText({ className, style, ...props }) {
|
|
1132
|
+
return /* @__PURE__ */ jsxs14(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1136
|
+
style: {
|
|
1137
|
+
...style,
|
|
1138
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1139
|
+
},
|
|
1140
|
+
children: [
|
|
1141
|
+
/* @__PURE__ */ jsx27(MyEditor, { onChange: (content) => props.onChange?.(content), value: props.value, isDefault: true }),
|
|
1142
|
+
props.errorMessage && /* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1143
|
+
]
|
|
1144
|
+
}
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// src/components/ui/select.tsx
|
|
1149
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1150
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1151
|
+
function Select({
|
|
1152
|
+
...props
|
|
1153
|
+
}) {
|
|
1154
|
+
return /* @__PURE__ */ jsx28(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
1155
|
+
}
|
|
1156
|
+
function SelectValue({
|
|
1157
|
+
...props
|
|
1158
|
+
}) {
|
|
1159
|
+
return /* @__PURE__ */ jsx28(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
1160
|
+
}
|
|
1161
|
+
function SelectTrigger({
|
|
1162
|
+
className,
|
|
1163
|
+
size = "default",
|
|
1164
|
+
children,
|
|
1165
|
+
...props
|
|
1166
|
+
}) {
|
|
1167
|
+
return /* @__PURE__ */ jsxs15(
|
|
1168
|
+
SelectPrimitive.Trigger,
|
|
1169
|
+
{
|
|
1170
|
+
"data-slot": "select-trigger",
|
|
1171
|
+
"data-size": size,
|
|
1172
|
+
className: cn(
|
|
1173
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1174
|
+
className
|
|
1175
|
+
),
|
|
1176
|
+
...props,
|
|
1177
|
+
children: [
|
|
1178
|
+
children,
|
|
1179
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx28(ChevronDown, { className: "size-4 opacity-50" }) })
|
|
1180
|
+
]
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
function SelectContent({
|
|
1185
|
+
className,
|
|
1186
|
+
children,
|
|
1187
|
+
position = "popper",
|
|
1188
|
+
...props
|
|
1189
|
+
}) {
|
|
1190
|
+
return /* @__PURE__ */ jsx28(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs15(
|
|
1191
|
+
SelectPrimitive.Content,
|
|
1192
|
+
{
|
|
1193
|
+
"data-slot": "select-content",
|
|
1194
|
+
className: cn(
|
|
1195
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
1196
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1197
|
+
className
|
|
1198
|
+
),
|
|
1199
|
+
position,
|
|
1200
|
+
...props,
|
|
1201
|
+
children: [
|
|
1202
|
+
/* @__PURE__ */ jsx28(SelectScrollUpButton, {}),
|
|
1203
|
+
/* @__PURE__ */ jsx28(
|
|
1204
|
+
SelectPrimitive.Viewport,
|
|
1205
|
+
{
|
|
1206
|
+
className: cn(
|
|
1207
|
+
"p-1",
|
|
1208
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
1209
|
+
),
|
|
1210
|
+
children
|
|
1211
|
+
}
|
|
1212
|
+
),
|
|
1213
|
+
/* @__PURE__ */ jsx28(SelectScrollDownButton, {})
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
) });
|
|
1217
|
+
}
|
|
1218
|
+
function SelectItem({
|
|
1219
|
+
className,
|
|
1220
|
+
children,
|
|
1221
|
+
...props
|
|
1222
|
+
}) {
|
|
1223
|
+
return /* @__PURE__ */ jsxs15(
|
|
1224
|
+
SelectPrimitive.Item,
|
|
1225
|
+
{
|
|
1226
|
+
"data-slot": "select-item",
|
|
1227
|
+
className: cn(
|
|
1228
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1229
|
+
className
|
|
1230
|
+
),
|
|
1231
|
+
...props,
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsx28("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx28(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx28(Check, { className: "size-4" }) }) }),
|
|
1234
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.ItemText, { children })
|
|
1235
|
+
]
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
function SelectScrollUpButton({
|
|
1240
|
+
className,
|
|
1241
|
+
...props
|
|
1242
|
+
}) {
|
|
1243
|
+
return /* @__PURE__ */ jsx28(
|
|
1244
|
+
SelectPrimitive.ScrollUpButton,
|
|
1245
|
+
{
|
|
1246
|
+
"data-slot": "select-scroll-up-button",
|
|
1247
|
+
className: cn(
|
|
1248
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1249
|
+
className
|
|
1250
|
+
),
|
|
1251
|
+
...props,
|
|
1252
|
+
children: /* @__PURE__ */ jsx28(ChevronUp, { className: "size-4" })
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
function SelectScrollDownButton({
|
|
1257
|
+
className,
|
|
1258
|
+
...props
|
|
1259
|
+
}) {
|
|
1260
|
+
return /* @__PURE__ */ jsx28(
|
|
1261
|
+
SelectPrimitive.ScrollDownButton,
|
|
1262
|
+
{
|
|
1263
|
+
"data-slot": "select-scroll-down-button",
|
|
1264
|
+
className: cn(
|
|
1265
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1266
|
+
className
|
|
1267
|
+
),
|
|
1268
|
+
...props,
|
|
1269
|
+
children: /* @__PURE__ */ jsx28(ChevronDown, { className: "size-4" })
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
1275
|
+
import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1276
|
+
var Dropdown = ({ className, style, ...props }) => {
|
|
1277
|
+
const list = props.data || [];
|
|
1278
|
+
const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
|
|
1279
|
+
const isEditable = props.isEditable ?? true;
|
|
1280
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1281
|
+
const isReadonly = props.isReadonly ?? false;
|
|
1282
|
+
const handleChange = (value) => {
|
|
1283
|
+
props.onChange?.(value);
|
|
1284
|
+
};
|
|
1285
|
+
const dataKey = props.dataKey || "value";
|
|
1286
|
+
const dataLabel = props.dataLabel || "label";
|
|
1287
|
+
const options = list.map((item) => ({
|
|
1288
|
+
value: item[dataKey],
|
|
1289
|
+
label: item[dataLabel]
|
|
1290
|
+
}));
|
|
1291
|
+
return /* @__PURE__ */ jsxs16(Fragment9, { children: [
|
|
1292
|
+
/* @__PURE__ */ jsxs16(Select, { name: props.name, value: props.value, onValueChange: handleChange, disabled: isDisabled || !isEditable, children: [
|
|
1293
|
+
/* @__PURE__ */ jsx29(
|
|
1294
|
+
SelectTrigger,
|
|
1295
|
+
{
|
|
1296
|
+
id: props.name || "select-field",
|
|
1297
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1298
|
+
style: {
|
|
1299
|
+
...style,
|
|
1300
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1301
|
+
},
|
|
1302
|
+
"aria-readonly": isReadonly,
|
|
1303
|
+
children: /* @__PURE__ */ jsx29(SelectValue, { placeholder })
|
|
1304
|
+
}
|
|
1305
|
+
),
|
|
1306
|
+
/* @__PURE__ */ jsx29(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx29(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
1307
|
+
] }),
|
|
1308
|
+
props.errorMessage && /* @__PURE__ */ jsx29("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1309
|
+
] });
|
|
1310
|
+
};
|
|
1311
|
+
var Dropdown_default = Dropdown;
|
|
1312
|
+
|
|
1313
|
+
// src/components/ui/switch.tsx
|
|
1314
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
1315
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1316
|
+
function Switch({
|
|
1317
|
+
className,
|
|
1318
|
+
...props
|
|
1319
|
+
}) {
|
|
1320
|
+
return /* @__PURE__ */ jsx30(
|
|
1321
|
+
SwitchPrimitive.Root,
|
|
1322
|
+
{
|
|
1323
|
+
"data-slot": "switch",
|
|
1324
|
+
className: cn(
|
|
1325
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
1326
|
+
className
|
|
1327
|
+
),
|
|
1328
|
+
...props,
|
|
1329
|
+
children: /* @__PURE__ */ jsx30(
|
|
1330
|
+
SwitchPrimitive.Thumb,
|
|
1331
|
+
{
|
|
1332
|
+
"data-slot": "switch-thumb",
|
|
1333
|
+
className: cn(
|
|
1334
|
+
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
1335
|
+
)
|
|
1336
|
+
}
|
|
1337
|
+
)
|
|
1338
|
+
}
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
1343
|
+
import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1344
|
+
var SwitchToggle = ({ className, style, ...props }) => {
|
|
1345
|
+
const isEditable = props.isEditable ?? true;
|
|
1346
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1347
|
+
const handleChange = (value) => {
|
|
1348
|
+
props.onChange?.(value);
|
|
1349
|
+
};
|
|
1350
|
+
return /* @__PURE__ */ jsxs17(Fragment10, { children: [
|
|
1351
|
+
/* @__PURE__ */ jsx31("div", { className, style, children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
1352
|
+
/* @__PURE__ */ jsx31(
|
|
1353
|
+
Switch,
|
|
1354
|
+
{
|
|
1355
|
+
id: props.name || "switch",
|
|
1356
|
+
checked: !!props.value,
|
|
1357
|
+
onCheckedChange: handleChange,
|
|
1358
|
+
disabled: isDisabled || !isEditable
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
/* @__PURE__ */ jsx31(Label2, { htmlFor: props.name || "switch", children: props.text })
|
|
1362
|
+
] }) }),
|
|
1363
|
+
props.errorMessage && /* @__PURE__ */ jsx31("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1364
|
+
] });
|
|
1365
|
+
};
|
|
1366
|
+
var SwitchToggle_default = SwitchToggle;
|
|
1367
|
+
|
|
1368
|
+
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
1369
|
+
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
1370
|
+
import "react-international-phone/style.css";
|
|
1371
|
+
import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1372
|
+
var PhoneInput = ({ className, style, ...props }) => {
|
|
1373
|
+
const placeholder = props.placeholder ?? "Enter phone number";
|
|
1374
|
+
const isEditable = props.isEditable ?? true;
|
|
1375
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1376
|
+
const handleChange = (val) => {
|
|
1377
|
+
props.onChange?.(val);
|
|
1378
|
+
};
|
|
1379
|
+
return /* @__PURE__ */ jsxs18(Fragment11, { children: [
|
|
1380
|
+
/* @__PURE__ */ jsx32(
|
|
1381
|
+
PhoneInputField,
|
|
1382
|
+
{
|
|
1383
|
+
defaultCountry: "in",
|
|
1384
|
+
name: props.name,
|
|
1385
|
+
value: props.value,
|
|
1386
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1387
|
+
style: {
|
|
1388
|
+
...style,
|
|
1389
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1390
|
+
},
|
|
1391
|
+
onChange: (phone) => handleChange(phone),
|
|
1392
|
+
inputProps: {
|
|
1393
|
+
id: "phone-field"
|
|
1394
|
+
},
|
|
1395
|
+
placeholder,
|
|
1396
|
+
disabled: isDisabled || !isEditable
|
|
1397
|
+
}
|
|
1398
|
+
),
|
|
1399
|
+
props.errorMessage && /* @__PURE__ */ jsx32("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1400
|
+
] });
|
|
1401
|
+
};
|
|
1402
|
+
var PhoneInput_default = PhoneInput;
|
|
1403
|
+
|
|
1404
|
+
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
1405
|
+
import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1406
|
+
var SearchInput = ({ className, style, ...props }) => {
|
|
1407
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1408
|
+
const isEditable = props.isEditable ?? true;
|
|
1409
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1410
|
+
const isReadonly = props.isReadonly ?? false;
|
|
1411
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1412
|
+
const handleChange = (e) => {
|
|
1413
|
+
props.onChange?.(e);
|
|
1414
|
+
};
|
|
1415
|
+
return /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
1416
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-start items-center relative", children: [
|
|
1417
|
+
/* @__PURE__ */ jsx33(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
1418
|
+
/* @__PURE__ */ jsx33(
|
|
1419
|
+
Input,
|
|
1420
|
+
{
|
|
1421
|
+
type: "text",
|
|
1422
|
+
id: props.name || "text-field",
|
|
1423
|
+
name: props.name,
|
|
1424
|
+
value: props.value,
|
|
1425
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1426
|
+
style: {
|
|
1427
|
+
...style,
|
|
1428
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1429
|
+
},
|
|
1430
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
1431
|
+
placeholder,
|
|
1432
|
+
onChange: handleChange,
|
|
1433
|
+
disabled: isDisabled || !isEditable,
|
|
1434
|
+
readOnly: isReadonly
|
|
1435
|
+
}
|
|
1436
|
+
)
|
|
1437
|
+
] }),
|
|
1438
|
+
props.errorMessage && /* @__PURE__ */ jsx33("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1439
|
+
] });
|
|
1440
|
+
};
|
|
1441
|
+
var SearchInput_default = SearchInput;
|
|
1442
|
+
|
|
1443
|
+
// src/components/Inputs/FileInput/FileInput.tsx
|
|
1444
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1445
|
+
var FileInput = ({ className, style, ...props }) => {
|
|
1446
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1447
|
+
return /* @__PURE__ */ jsxs20("div", { className: "d-flex items-center relative align-middle", children: [
|
|
1448
|
+
/* @__PURE__ */ jsx34(
|
|
1449
|
+
Input,
|
|
1450
|
+
{
|
|
1451
|
+
type: "file",
|
|
1452
|
+
id: "file",
|
|
1453
|
+
name: props.name,
|
|
1454
|
+
value: props.value,
|
|
1455
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1456
|
+
style: {
|
|
1457
|
+
...style,
|
|
1458
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1459
|
+
},
|
|
1460
|
+
autoComplete: "off",
|
|
1461
|
+
placeholder,
|
|
1462
|
+
onChange: (e) => {
|
|
1463
|
+
props.onChange?.(e);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
),
|
|
1467
|
+
props.errorMessage && /* @__PURE__ */ jsx34("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1468
|
+
] });
|
|
1469
|
+
};
|
|
1470
|
+
var FileInput_default = FileInput;
|
|
1471
|
+
|
|
1472
|
+
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
1473
|
+
import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1474
|
+
function DatePicker({ className, style, ...props }) {
|
|
1475
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1476
|
+
const minimumDate = props.minimumDate ?? "none";
|
|
1477
|
+
const customMinimumDate = props.customMinimumDate ?? "";
|
|
1478
|
+
const maximumDate = props.maximumDate ?? "none";
|
|
1479
|
+
const customMaximumDate = props.customMaximumDate ?? "";
|
|
1480
|
+
const isEditable = props.isEditable ?? true;
|
|
1481
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1482
|
+
const isReadonly = props.isReadonly ?? false;
|
|
1483
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1484
|
+
const resolveDate = (option, customOption) => {
|
|
1485
|
+
if (!option) return void 0;
|
|
1486
|
+
switch (option) {
|
|
1487
|
+
case "today":
|
|
1488
|
+
return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
1489
|
+
case "custom":
|
|
1490
|
+
return customOption ?? void 0;
|
|
1491
|
+
case "none":
|
|
1492
|
+
default:
|
|
1493
|
+
return void 0;
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
1497
|
+
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
1498
|
+
const handleChange = (e) => {
|
|
1499
|
+
props.onChange?.(e);
|
|
1500
|
+
};
|
|
1501
|
+
return /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
1502
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-start items-center relative", children: [
|
|
1503
|
+
/* @__PURE__ */ jsx35(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
1504
|
+
/* @__PURE__ */ jsx35(
|
|
1505
|
+
Input,
|
|
1506
|
+
{
|
|
1507
|
+
type: "date",
|
|
1508
|
+
id: "date",
|
|
1509
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
1510
|
+
onChange: handleChange,
|
|
1511
|
+
disabled: isDisabled || !isEditable,
|
|
1512
|
+
name: props.name,
|
|
1513
|
+
value: props.value,
|
|
1514
|
+
className: cn(
|
|
1515
|
+
className,
|
|
1516
|
+
props.errorMessage ? "border-red-500" : "",
|
|
1517
|
+
"appearance-auto"
|
|
1518
|
+
),
|
|
1519
|
+
style: {
|
|
1520
|
+
...style,
|
|
1521
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1522
|
+
},
|
|
1523
|
+
readOnly: isReadonly,
|
|
1524
|
+
placeholder,
|
|
1525
|
+
min: minDate,
|
|
1526
|
+
max: maxDate
|
|
1527
|
+
}
|
|
1528
|
+
)
|
|
1529
|
+
] }),
|
|
1530
|
+
props.errorMessage && /* @__PURE__ */ jsx35("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1531
|
+
] });
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1535
|
+
import * as React3 from "react";
|
|
1536
|
+
import { addDays, format } from "date-fns";
|
|
1537
|
+
|
|
1538
|
+
// src/components/ui/calendar.tsx
|
|
1539
|
+
import * as React2 from "react";
|
|
1540
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
1541
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1542
|
+
function Calendar2({
|
|
1543
|
+
className,
|
|
1544
|
+
classNames,
|
|
1545
|
+
showOutsideDays = true,
|
|
1546
|
+
captionLayout = "label",
|
|
1547
|
+
buttonVariant = "ghost",
|
|
1548
|
+
formatters,
|
|
1549
|
+
components,
|
|
1550
|
+
...props
|
|
1551
|
+
}) {
|
|
1552
|
+
const defaultClassNames = getDefaultClassNames();
|
|
1553
|
+
return /* @__PURE__ */ jsx36(
|
|
1554
|
+
DayPicker,
|
|
1555
|
+
{
|
|
1556
|
+
showOutsideDays,
|
|
1557
|
+
className: cn(
|
|
1558
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
1559
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
1560
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
1561
|
+
className
|
|
1562
|
+
),
|
|
1563
|
+
captionLayout,
|
|
1564
|
+
formatters: {
|
|
1565
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
1566
|
+
...formatters
|
|
1567
|
+
},
|
|
1568
|
+
classNames: {
|
|
1569
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
1570
|
+
months: cn(
|
|
1571
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
1572
|
+
defaultClassNames.months
|
|
1573
|
+
),
|
|
1574
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
1575
|
+
nav: cn(
|
|
1576
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
1577
|
+
defaultClassNames.nav
|
|
1578
|
+
),
|
|
1579
|
+
button_previous: cn(
|
|
1580
|
+
buttonVariants({ variant: buttonVariant }),
|
|
1581
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
1582
|
+
defaultClassNames.button_previous
|
|
1583
|
+
),
|
|
1584
|
+
button_next: cn(
|
|
1585
|
+
buttonVariants({ variant: buttonVariant }),
|
|
1586
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
1587
|
+
defaultClassNames.button_next
|
|
1588
|
+
),
|
|
1589
|
+
month_caption: cn(
|
|
1590
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
1591
|
+
defaultClassNames.month_caption
|
|
1592
|
+
),
|
|
1593
|
+
dropdowns: cn(
|
|
1594
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
1595
|
+
defaultClassNames.dropdowns
|
|
1596
|
+
),
|
|
1597
|
+
dropdown_root: cn(
|
|
1598
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
1599
|
+
defaultClassNames.dropdown_root
|
|
1600
|
+
),
|
|
1601
|
+
dropdown: cn(
|
|
1602
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
1603
|
+
defaultClassNames.dropdown
|
|
1604
|
+
),
|
|
1605
|
+
caption_label: cn(
|
|
1606
|
+
"select-none font-medium",
|
|
1607
|
+
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",
|
|
1608
|
+
defaultClassNames.caption_label
|
|
1609
|
+
),
|
|
1610
|
+
table: "w-full border-collapse",
|
|
1611
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
1612
|
+
weekday: cn(
|
|
1613
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
1614
|
+
defaultClassNames.weekday
|
|
1615
|
+
),
|
|
1616
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
1617
|
+
week_number_header: cn(
|
|
1618
|
+
"select-none w-(--cell-size)",
|
|
1619
|
+
defaultClassNames.week_number_header
|
|
1620
|
+
),
|
|
1621
|
+
week_number: cn(
|
|
1622
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
1623
|
+
defaultClassNames.week_number
|
|
1624
|
+
),
|
|
1625
|
+
day: cn(
|
|
1626
|
+
"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",
|
|
1627
|
+
defaultClassNames.day
|
|
1628
|
+
),
|
|
1629
|
+
range_start: cn(
|
|
1630
|
+
"rounded-l-md bg-accent",
|
|
1631
|
+
defaultClassNames.range_start
|
|
1632
|
+
),
|
|
1633
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
1634
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
1635
|
+
today: cn(
|
|
1636
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
1637
|
+
defaultClassNames.today
|
|
1638
|
+
),
|
|
1639
|
+
outside: cn(
|
|
1640
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
1641
|
+
defaultClassNames.outside
|
|
1642
|
+
),
|
|
1643
|
+
disabled: cn(
|
|
1644
|
+
"text-muted-foreground opacity-50",
|
|
1645
|
+
defaultClassNames.disabled
|
|
1646
|
+
),
|
|
1647
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
1648
|
+
...classNames
|
|
1649
|
+
},
|
|
1650
|
+
components: {
|
|
1651
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
1652
|
+
return /* @__PURE__ */ jsx36(
|
|
1653
|
+
"div",
|
|
1654
|
+
{
|
|
1655
|
+
"data-slot": "calendar",
|
|
1656
|
+
ref: rootRef,
|
|
1657
|
+
className: cn(className2),
|
|
1658
|
+
...props2
|
|
1659
|
+
}
|
|
1660
|
+
);
|
|
1661
|
+
},
|
|
1662
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
1663
|
+
if (orientation === "left") {
|
|
1664
|
+
return /* @__PURE__ */ jsx36(ChevronLeft, { className: cn("size-4", className2), ...props2 });
|
|
1665
|
+
}
|
|
1666
|
+
if (orientation === "right") {
|
|
1667
|
+
return /* @__PURE__ */ jsx36(
|
|
1668
|
+
ChevronRight,
|
|
1669
|
+
{
|
|
1670
|
+
className: cn("size-4", className2),
|
|
1671
|
+
...props2
|
|
1672
|
+
}
|
|
1673
|
+
);
|
|
1674
|
+
}
|
|
1675
|
+
return /* @__PURE__ */ jsx36(ChevronDown, { className: cn("size-4", className2), ...props2 });
|
|
1676
|
+
},
|
|
1677
|
+
DayButton: CalendarDayButton,
|
|
1678
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
1679
|
+
return /* @__PURE__ */ jsx36("td", { ...props2, children: /* @__PURE__ */ jsx36("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
1680
|
+
},
|
|
1681
|
+
...components
|
|
1682
|
+
},
|
|
1683
|
+
...props
|
|
1684
|
+
}
|
|
1685
|
+
);
|
|
1686
|
+
}
|
|
1687
|
+
function CalendarDayButton({
|
|
1688
|
+
className,
|
|
1689
|
+
day,
|
|
1690
|
+
modifiers,
|
|
1691
|
+
...props
|
|
1692
|
+
}) {
|
|
1693
|
+
const defaultClassNames = getDefaultClassNames();
|
|
1694
|
+
const ref = React2.useRef(null);
|
|
1695
|
+
React2.useEffect(() => {
|
|
1696
|
+
if (modifiers.focused) ref.current?.focus();
|
|
1697
|
+
}, [modifiers.focused]);
|
|
1698
|
+
return /* @__PURE__ */ jsx36(
|
|
1699
|
+
Button,
|
|
1700
|
+
{
|
|
1701
|
+
ref,
|
|
1702
|
+
variant: "ghost",
|
|
1703
|
+
size: "icon",
|
|
1704
|
+
"data-day": day.date.toLocaleDateString(),
|
|
1705
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
1706
|
+
"data-range-start": modifiers.range_start,
|
|
1707
|
+
"data-range-end": modifiers.range_end,
|
|
1708
|
+
"data-range-middle": modifiers.range_middle,
|
|
1709
|
+
className: cn(
|
|
1710
|
+
"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",
|
|
1711
|
+
defaultClassNames.day,
|
|
1712
|
+
className
|
|
1713
|
+
),
|
|
1714
|
+
...props
|
|
1715
|
+
}
|
|
1716
|
+
);
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
// src/components/ui/popover.tsx
|
|
1720
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1721
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1722
|
+
function Popover({
|
|
1723
|
+
...props
|
|
1724
|
+
}) {
|
|
1725
|
+
return /* @__PURE__ */ jsx37(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
1726
|
+
}
|
|
1727
|
+
function PopoverTrigger({
|
|
1728
|
+
...props
|
|
1729
|
+
}) {
|
|
1730
|
+
return /* @__PURE__ */ jsx37(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
1731
|
+
}
|
|
1732
|
+
function PopoverContent({
|
|
1733
|
+
className,
|
|
1734
|
+
align = "center",
|
|
1735
|
+
sideOffset = 4,
|
|
1736
|
+
...props
|
|
1737
|
+
}) {
|
|
1738
|
+
return /* @__PURE__ */ jsx37(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx37(
|
|
1739
|
+
PopoverPrimitive.Content,
|
|
1740
|
+
{
|
|
1741
|
+
"data-slot": "popover-content",
|
|
1742
|
+
align,
|
|
1743
|
+
sideOffset,
|
|
1744
|
+
className: cn(
|
|
1745
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
1746
|
+
className
|
|
1747
|
+
),
|
|
1748
|
+
...props
|
|
1749
|
+
}
|
|
1750
|
+
) });
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1754
|
+
import { Fragment as Fragment14, jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1755
|
+
var DateRange = ({ className, style, ...props }) => {
|
|
1756
|
+
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
1757
|
+
const [date, setDate] = React3.useState(
|
|
1758
|
+
isDateRange(props.value) ? props.value : {
|
|
1759
|
+
from: /* @__PURE__ */ new Date(),
|
|
1760
|
+
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
1761
|
+
}
|
|
1762
|
+
);
|
|
1763
|
+
const handleChange = (value) => {
|
|
1764
|
+
setDate(value);
|
|
1765
|
+
if (value) {
|
|
1766
|
+
props.onChange?.(value);
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
return /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
1770
|
+
/* @__PURE__ */ jsx38("div", { className, style, children: /* @__PURE__ */ jsxs22(Popover, { children: [
|
|
1771
|
+
/* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
1772
|
+
Button,
|
|
1773
|
+
{
|
|
1774
|
+
id: "date",
|
|
1775
|
+
variant: "outline",
|
|
1776
|
+
className: cn(
|
|
1777
|
+
"w-[300px] justify-start text-left font-normal text-[11px]",
|
|
1778
|
+
!date && "text-muted-foreground"
|
|
1779
|
+
),
|
|
1780
|
+
children: date?.from ? date.to ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
1781
|
+
format(date.from, "LLL dd, y"),
|
|
1782
|
+
" -",
|
|
1783
|
+
" ",
|
|
1784
|
+
format(date.to, "LLL dd, y")
|
|
1785
|
+
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ jsx38("span", { children: "Pick a date range" })
|
|
1786
|
+
}
|
|
1787
|
+
) }),
|
|
1788
|
+
/* @__PURE__ */ jsx38(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx38(
|
|
1789
|
+
Calendar2,
|
|
1790
|
+
{
|
|
1791
|
+
mode: "range",
|
|
1792
|
+
defaultMonth: date?.from,
|
|
1793
|
+
selected: date,
|
|
1794
|
+
onSelect: handleChange,
|
|
1795
|
+
numberOfMonths: 2
|
|
1796
|
+
}
|
|
1797
|
+
) })
|
|
1798
|
+
] }) }),
|
|
1799
|
+
props.errorMessage && /* @__PURE__ */ jsx38("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1800
|
+
] });
|
|
1801
|
+
};
|
|
1802
|
+
var DateRange_default = DateRange;
|
|
1803
|
+
|
|
1804
|
+
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
1805
|
+
import { Fragment as Fragment15, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1806
|
+
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
1807
|
+
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1808
|
+
const isEditable = props.isEditable ?? true;
|
|
1809
|
+
const isDisabled = props.isDisabled ?? false;
|
|
1810
|
+
const isReadonly = props.isReadonly ?? false;
|
|
1811
|
+
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1812
|
+
const handleChange = (e) => {
|
|
1813
|
+
props.onChange?.(e);
|
|
1814
|
+
};
|
|
1815
|
+
return /* @__PURE__ */ jsxs23(Fragment15, { children: [
|
|
1816
|
+
/* @__PURE__ */ jsxs23(
|
|
1817
|
+
"div",
|
|
1818
|
+
{
|
|
1819
|
+
className: cn(
|
|
1820
|
+
"flex justify-start items-center relative border border-input rounded-md bg-transparent focus-within:ring-2 focus-within:ring-ring focus-within:border-primary",
|
|
1821
|
+
className,
|
|
1822
|
+
"p-0 m-0",
|
|
1823
|
+
props.errorMessage ? "border-red-500" : ""
|
|
1824
|
+
),
|
|
1825
|
+
children: [
|
|
1826
|
+
prepend && /* @__PURE__ */ jsx39("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
|
|
1827
|
+
/* @__PURE__ */ jsx39(
|
|
1828
|
+
Input,
|
|
1829
|
+
{
|
|
1830
|
+
id: props.name || "prepend-input",
|
|
1831
|
+
type: "url",
|
|
1832
|
+
name: props.name,
|
|
1833
|
+
value: props.value,
|
|
1834
|
+
className: cn(
|
|
1835
|
+
className,
|
|
1836
|
+
"rounded-none flex-1 border-none focus:ring-0"
|
|
1837
|
+
),
|
|
1838
|
+
style: {
|
|
1839
|
+
...style,
|
|
1840
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1841
|
+
},
|
|
1842
|
+
autoComplete: isAutocomplete ? "on" : "off",
|
|
1843
|
+
placeholder,
|
|
1844
|
+
onChange: handleChange,
|
|
1845
|
+
disabled: isDisabled || !isEditable,
|
|
1846
|
+
readOnly: isReadonly
|
|
1847
|
+
}
|
|
1848
|
+
),
|
|
1849
|
+
append && /* @__PURE__ */ jsx39("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-r-md", children: append })
|
|
1850
|
+
]
|
|
1851
|
+
}
|
|
1852
|
+
),
|
|
1853
|
+
props.errorMessage && /* @__PURE__ */ jsx39("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1854
|
+
] });
|
|
1855
|
+
};
|
|
1856
|
+
var TextInputGroup_default = TextInputGroup;
|
|
1857
|
+
|
|
1858
|
+
// src/components/ui/data-table.tsx
|
|
1859
|
+
import {
|
|
1860
|
+
flexRender,
|
|
1861
|
+
getCoreRowModel,
|
|
1862
|
+
useReactTable
|
|
1863
|
+
} from "@tanstack/react-table";
|
|
1864
|
+
|
|
1865
|
+
// src/components/ui/table.tsx
|
|
1866
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1867
|
+
function Table({ className, ...props }) {
|
|
1868
|
+
return /* @__PURE__ */ jsx40(
|
|
1869
|
+
"div",
|
|
1870
|
+
{
|
|
1871
|
+
"data-slot": "table-container",
|
|
1872
|
+
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
1873
|
+
children: /* @__PURE__ */ jsx40(
|
|
1874
|
+
"table",
|
|
1875
|
+
{
|
|
1876
|
+
"data-slot": "table",
|
|
1877
|
+
className: cn("w-full text-sm", className),
|
|
1878
|
+
...props
|
|
1879
|
+
}
|
|
1880
|
+
)
|
|
1881
|
+
}
|
|
1882
|
+
);
|
|
1883
|
+
}
|
|
1884
|
+
function TableHeader({ className, ...props }) {
|
|
1885
|
+
return /* @__PURE__ */ jsx40(
|
|
1886
|
+
"thead",
|
|
1887
|
+
{
|
|
1888
|
+
"data-slot": "table-header",
|
|
1889
|
+
className: cn(
|
|
1890
|
+
"bg-gray-100 text-gray-700 [&>tr]:border-b [&>tr]:border-gray-200 [&>tr>th]:border-r [&>tr>th]:border-gray-200 [&>tr>th]:last:border-r-0",
|
|
1891
|
+
className
|
|
1892
|
+
),
|
|
1893
|
+
...props
|
|
1894
|
+
}
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
function TableBody({ className, ...props }) {
|
|
1898
|
+
return /* @__PURE__ */ jsx40(
|
|
1899
|
+
"tbody",
|
|
1900
|
+
{
|
|
1901
|
+
"data-slot": "table-body",
|
|
1902
|
+
className: cn(
|
|
1903
|
+
"[&>tr]:border-b [&>tr]:border-gray-200 [&>tr:last-child]:border-0 [&>tr>td]:border-r [&>tr>td]:border-gray-200 [&>tr>td]:last:border-r-0",
|
|
1904
|
+
className
|
|
1905
|
+
),
|
|
1906
|
+
...props
|
|
1907
|
+
}
|
|
1908
|
+
);
|
|
1909
|
+
}
|
|
1910
|
+
function TableRow({ className, ...props }) {
|
|
1911
|
+
return /* @__PURE__ */ jsx40(
|
|
1912
|
+
"tr",
|
|
1913
|
+
{
|
|
1914
|
+
"data-slot": "table-row",
|
|
1915
|
+
className: cn(
|
|
1916
|
+
"border-b border-gray-200 hover:bg-gray-50 transition-colors",
|
|
1917
|
+
className
|
|
1918
|
+
),
|
|
1919
|
+
...props
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
}
|
|
1923
|
+
function TableHead({ className, ...props }) {
|
|
1924
|
+
return /* @__PURE__ */ jsx40(
|
|
1925
|
+
"th",
|
|
1926
|
+
{
|
|
1927
|
+
"data-slot": "table-head",
|
|
1928
|
+
className: cn(
|
|
1929
|
+
"h-12 px-6 text-left align-middle font-semibold whitespace-nowrap",
|
|
1930
|
+
className
|
|
1931
|
+
),
|
|
1932
|
+
...props
|
|
1933
|
+
}
|
|
1934
|
+
);
|
|
1935
|
+
}
|
|
1936
|
+
function TableCell({ className, ...props }) {
|
|
1937
|
+
return /* @__PURE__ */ jsx40(
|
|
1938
|
+
"td",
|
|
1939
|
+
{
|
|
1940
|
+
"data-slot": "table-cell",
|
|
1941
|
+
className: cn(
|
|
1942
|
+
"px-6 py-4 align-middle text-gray-700",
|
|
1943
|
+
className
|
|
1944
|
+
),
|
|
1945
|
+
...props
|
|
1946
|
+
}
|
|
1947
|
+
);
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
// src/components/ui/data-table.tsx
|
|
1951
|
+
import { Fragment as Fragment16, jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1952
|
+
function DataTable({
|
|
1953
|
+
columns,
|
|
1954
|
+
rowActions,
|
|
1955
|
+
data,
|
|
1956
|
+
loading,
|
|
1957
|
+
getRowSelection,
|
|
1958
|
+
onCellClick,
|
|
1959
|
+
cellClickEnabled = () => false
|
|
1960
|
+
}) {
|
|
1961
|
+
const table = useReactTable({
|
|
1962
|
+
data,
|
|
1963
|
+
columns,
|
|
1964
|
+
enableRowSelection: true,
|
|
1965
|
+
onRowSelectionChange: getRowSelection ? (updaterOrValue) => {
|
|
1966
|
+
const value = typeof updaterOrValue === "function" ? updaterOrValue(table.getState().rowSelection) : updaterOrValue;
|
|
1967
|
+
getRowSelection(value);
|
|
1968
|
+
} : void 0,
|
|
1969
|
+
getCoreRowModel: getCoreRowModel()
|
|
1970
|
+
});
|
|
1971
|
+
const handleCellClick = (rowData, columnId) => {
|
|
1972
|
+
if (onCellClick) {
|
|
1973
|
+
onCellClick(rowData, columnId);
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
return /* @__PURE__ */ jsx41("div", { className: "overflow-hidden rounded-md border w-full", children: /* @__PURE__ */ jsxs24(Table, { children: [
|
|
1977
|
+
/* @__PURE__ */ jsx41(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx41(TableRow, { children: headerGroup.headers.map((header) => {
|
|
1978
|
+
return /* @__PURE__ */ jsx41(TableHead, { children: header.isPlaceholder ? null : flexRender(
|
|
1979
|
+
header.column.columnDef.header,
|
|
1980
|
+
header.getContext()
|
|
1981
|
+
) }, header.id);
|
|
1982
|
+
}) }, headerGroup.id)) }),
|
|
1983
|
+
/* @__PURE__ */ jsx41(TableBody, { children: loading ? /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : /* @__PURE__ */ jsx41(Fragment16, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxs24(
|
|
1984
|
+
TableRow,
|
|
1985
|
+
{
|
|
1986
|
+
"data-state": row.getIsSelected() && "selected",
|
|
1987
|
+
className: "relative group",
|
|
1988
|
+
children: [
|
|
1989
|
+
row.getVisibleCells().map((cell) => {
|
|
1990
|
+
const isCellClickable = cellClickEnabled(row.original, cell.column.id);
|
|
1991
|
+
const dynamicClass = cell.column.columnDef.meta?.cellClass || "";
|
|
1992
|
+
const dynamicStyle = cell.column.columnDef.meta?.cellStyle || {};
|
|
1993
|
+
return /* @__PURE__ */ jsx41(
|
|
1994
|
+
TableCell,
|
|
1995
|
+
{
|
|
1996
|
+
className: `${dynamicClass} ${isCellClickable ? "underline cursor-pointer" : ""}`,
|
|
1997
|
+
style: dynamicStyle,
|
|
1998
|
+
onClick: () => {
|
|
1999
|
+
if (isCellClickable) {
|
|
2000
|
+
handleCellClick(row.original, cell.column.id);
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
2003
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
2004
|
+
},
|
|
2005
|
+
cell.id
|
|
2006
|
+
);
|
|
2007
|
+
}),
|
|
2008
|
+
rowActions.length > 0 && /* @__PURE__ */ jsx41("div", { className: "absolute top-0 right-0 bg-white py-3 min-w-[100px] z-50 shadow-md flex items-center justify-center gap-3 p-2 opacity-0 group-hover:opacity-100 duration-300 h-full", children: rowActions.map((action, index) => /* @__PURE__ */ jsx41("p", { className: "text-[#383838] text-[12px] cursor-pointer font-[400]", children: action.header }, index)) })
|
|
2009
|
+
]
|
|
2010
|
+
},
|
|
2011
|
+
row.id
|
|
2012
|
+
)) : /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) }) })
|
|
2013
|
+
] }) });
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
// src/components/ui/pagination.tsx
|
|
2017
|
+
import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2018
|
+
function Pagination({ className, ...props }) {
|
|
2019
|
+
return /* @__PURE__ */ jsx42(
|
|
2020
|
+
"nav",
|
|
2021
|
+
{
|
|
2022
|
+
role: "navigation",
|
|
2023
|
+
"aria-label": "pagination",
|
|
2024
|
+
"data-slot": "pagination",
|
|
2025
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
2026
|
+
...props
|
|
2027
|
+
}
|
|
2028
|
+
);
|
|
2029
|
+
}
|
|
2030
|
+
function PaginationContent({
|
|
2031
|
+
className,
|
|
2032
|
+
...props
|
|
2033
|
+
}) {
|
|
2034
|
+
return /* @__PURE__ */ jsx42(
|
|
2035
|
+
"ul",
|
|
2036
|
+
{
|
|
2037
|
+
"data-slot": "pagination-content",
|
|
2038
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
2039
|
+
...props
|
|
2040
|
+
}
|
|
2041
|
+
);
|
|
2042
|
+
}
|
|
2043
|
+
function PaginationItem({ ...props }) {
|
|
2044
|
+
return /* @__PURE__ */ jsx42("li", { "data-slot": "pagination-item", ...props });
|
|
2045
|
+
}
|
|
2046
|
+
function PaginationLink({
|
|
2047
|
+
className,
|
|
2048
|
+
isActive,
|
|
2049
|
+
size = "icon",
|
|
2050
|
+
...props
|
|
2051
|
+
}) {
|
|
2052
|
+
return /* @__PURE__ */ jsx42(
|
|
2053
|
+
"a",
|
|
2054
|
+
{
|
|
2055
|
+
"aria-current": isActive ? "page" : void 0,
|
|
2056
|
+
"data-slot": "pagination-link",
|
|
2057
|
+
"data-active": isActive,
|
|
2058
|
+
className: cn(
|
|
2059
|
+
buttonVariants({
|
|
2060
|
+
variant: isActive ? "outline" : "ghost",
|
|
2061
|
+
size
|
|
2062
|
+
}),
|
|
2063
|
+
className
|
|
2064
|
+
),
|
|
2065
|
+
...props
|
|
2066
|
+
}
|
|
2067
|
+
);
|
|
2068
|
+
}
|
|
2069
|
+
function PaginationPrevious({
|
|
2070
|
+
className,
|
|
2071
|
+
...props
|
|
2072
|
+
}) {
|
|
2073
|
+
return /* @__PURE__ */ jsxs25(
|
|
2074
|
+
PaginationLink,
|
|
2075
|
+
{
|
|
2076
|
+
"aria-label": "Go to previous page",
|
|
2077
|
+
size: "default",
|
|
2078
|
+
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
2079
|
+
...props,
|
|
2080
|
+
children: [
|
|
2081
|
+
/* @__PURE__ */ jsx42(ChevronLeft, {}),
|
|
2082
|
+
/* @__PURE__ */ jsx42("span", { className: "hidden sm:block", children: "Previous" })
|
|
2083
|
+
]
|
|
2084
|
+
}
|
|
2085
|
+
);
|
|
2086
|
+
}
|
|
2087
|
+
function PaginationNext({
|
|
2088
|
+
className,
|
|
2089
|
+
...props
|
|
2090
|
+
}) {
|
|
2091
|
+
return /* @__PURE__ */ jsxs25(
|
|
2092
|
+
PaginationLink,
|
|
2093
|
+
{
|
|
2094
|
+
"aria-label": "Go to next page",
|
|
2095
|
+
size: "default",
|
|
2096
|
+
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
2097
|
+
...props,
|
|
2098
|
+
children: [
|
|
2099
|
+
/* @__PURE__ */ jsx42("span", { className: "hidden sm:block", children: "Next" }),
|
|
2100
|
+
/* @__PURE__ */ jsx42(ChevronRight, {})
|
|
2101
|
+
]
|
|
2102
|
+
}
|
|
2103
|
+
);
|
|
2104
|
+
}
|
|
2105
|
+
function PaginationEllipsis({
|
|
2106
|
+
className,
|
|
2107
|
+
...props
|
|
2108
|
+
}) {
|
|
2109
|
+
return /* @__PURE__ */ jsxs25(
|
|
2110
|
+
"span",
|
|
2111
|
+
{
|
|
2112
|
+
"aria-hidden": true,
|
|
2113
|
+
"data-slot": "pagination-ellipsis",
|
|
2114
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
2115
|
+
...props,
|
|
2116
|
+
children: [
|
|
2117
|
+
/* @__PURE__ */ jsx42(Ellipsis, { className: "size-4" }),
|
|
2118
|
+
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "More pages" })
|
|
2119
|
+
]
|
|
2120
|
+
}
|
|
2121
|
+
);
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
2125
|
+
import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2126
|
+
var CustomPagination = ({
|
|
2127
|
+
totalPages,
|
|
2128
|
+
currentPage,
|
|
2129
|
+
onPageChange,
|
|
2130
|
+
maxVisiblePages = 5
|
|
2131
|
+
}) => {
|
|
2132
|
+
const getPageNumbers = () => {
|
|
2133
|
+
const pages = [];
|
|
2134
|
+
if (totalPages <= maxVisiblePages) {
|
|
2135
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
2136
|
+
}
|
|
2137
|
+
const leftSiblingIndex = Math.max(currentPage - 1, 1);
|
|
2138
|
+
const rightSiblingIndex = Math.min(currentPage + 1, totalPages);
|
|
2139
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
2140
|
+
const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
|
|
2141
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
2142
|
+
const leftRange = Array.from({ length: 3 }, (_, i) => i + 1);
|
|
2143
|
+
return [...leftRange, "...", totalPages];
|
|
2144
|
+
}
|
|
2145
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
2146
|
+
const rightRange = Array.from(
|
|
2147
|
+
{ length: 3 },
|
|
2148
|
+
(_, i) => totalPages - 2 + i
|
|
2149
|
+
);
|
|
2150
|
+
return [1, "...", ...rightRange];
|
|
2151
|
+
}
|
|
2152
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
2153
|
+
const middleRange = Array.from(
|
|
2154
|
+
{ length: 3 },
|
|
2155
|
+
(_, i) => leftSiblingIndex + i
|
|
2156
|
+
);
|
|
2157
|
+
return [1, "...", ...middleRange, "...", totalPages];
|
|
2158
|
+
}
|
|
2159
|
+
return pages;
|
|
2160
|
+
};
|
|
2161
|
+
const handlePageChange = (page) => {
|
|
2162
|
+
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
2163
|
+
onPageChange(page);
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
const pageNumbers = getPageNumbers();
|
|
2167
|
+
return /* @__PURE__ */ jsx43(Pagination, { children: /* @__PURE__ */ jsxs26(PaginationContent, { children: [
|
|
2168
|
+
/* @__PURE__ */ jsx43(PaginationItem, { children: /* @__PURE__ */ jsx43(
|
|
2169
|
+
PaginationPrevious,
|
|
2170
|
+
{
|
|
2171
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
2172
|
+
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
2173
|
+
}
|
|
2174
|
+
) }),
|
|
2175
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx43(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx43(PaginationEllipsis, {}) : /* @__PURE__ */ jsx43(
|
|
2176
|
+
PaginationLink,
|
|
2177
|
+
{
|
|
2178
|
+
onClick: () => handlePageChange(pageNumber),
|
|
2179
|
+
isActive: currentPage === pageNumber,
|
|
2180
|
+
className: "cursor-pointer",
|
|
2181
|
+
children: pageNumber
|
|
2182
|
+
}
|
|
2183
|
+
) }, index)),
|
|
2184
|
+
/* @__PURE__ */ jsx43(PaginationItem, { children: /* @__PURE__ */ jsx43(
|
|
2185
|
+
PaginationNext,
|
|
2186
|
+
{
|
|
2187
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
2188
|
+
className: currentPage === totalPages ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
2189
|
+
}
|
|
2190
|
+
) })
|
|
2191
|
+
] }) });
|
|
2192
|
+
};
|
|
2193
|
+
var Pagination_default = CustomPagination;
|
|
2194
|
+
|
|
2195
|
+
// src/components/DataDisplay/Table/Table.tsx
|
|
2196
|
+
import { useState as useState3 } from "react";
|
|
2197
|
+
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2198
|
+
var Table2 = ({
|
|
2199
|
+
columns,
|
|
2200
|
+
data,
|
|
2201
|
+
rowActions,
|
|
2202
|
+
className,
|
|
2203
|
+
style,
|
|
2204
|
+
pagination = false,
|
|
2205
|
+
itemsPerPage = 10,
|
|
2206
|
+
onPageChange,
|
|
2207
|
+
loading = false,
|
|
2208
|
+
totalRecords = 0,
|
|
2209
|
+
...props
|
|
2210
|
+
}) => {
|
|
2211
|
+
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2212
|
+
const rawData = Array.isArray(data) ? data : [];
|
|
2213
|
+
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
2214
|
+
const [currentPage, setCurrentPage] = useState3(1);
|
|
2215
|
+
const enablePagination = pagination && totalRecords > itemsPerPage;
|
|
2216
|
+
const handlePageChange = (page) => {
|
|
2217
|
+
setCurrentPage(page);
|
|
2218
|
+
onPageChange?.(page);
|
|
2219
|
+
};
|
|
2220
|
+
const paginatedData = enablePagination ? rawData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) : rawData;
|
|
2221
|
+
return /* @__PURE__ */ jsxs27("div", { className: `${className} space-y-3`, style, children: [
|
|
2222
|
+
/* @__PURE__ */ jsx44(
|
|
2223
|
+
DataTable,
|
|
2224
|
+
{
|
|
2225
|
+
...props,
|
|
2226
|
+
columns: rawColumns,
|
|
2227
|
+
data: paginatedData,
|
|
2228
|
+
rowActions: rawRowActions,
|
|
2229
|
+
loading
|
|
2230
|
+
}
|
|
2231
|
+
),
|
|
2232
|
+
enablePagination && /* @__PURE__ */ jsx44(
|
|
2233
|
+
Pagination_default,
|
|
2234
|
+
{
|
|
2235
|
+
totalPages: Math.ceil(totalRecords / itemsPerPage),
|
|
2236
|
+
currentPage,
|
|
2237
|
+
onPageChange: handlePageChange
|
|
2238
|
+
}
|
|
2239
|
+
)
|
|
2240
|
+
] });
|
|
2241
|
+
};
|
|
2242
|
+
var Table_default = Table2;
|
|
2243
|
+
|
|
2244
|
+
// src/components/Navigation/Tabs/Tabs.tsx
|
|
2245
|
+
import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2246
|
+
var Tabs = ({ className, style, tabs, verticalMenu, LinkComponent, pathname, canvasMode }) => {
|
|
2247
|
+
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
2248
|
+
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
2249
|
+
const activeClasses = "bg-white/10 text-white";
|
|
2250
|
+
const hoverClasses = "hover:bg-white/5";
|
|
2251
|
+
const isActive = (path) => {
|
|
2252
|
+
if (!path) return false;
|
|
2253
|
+
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
2254
|
+
};
|
|
2255
|
+
const renderDesktopTab = (tab, index) => {
|
|
2256
|
+
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
2257
|
+
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
2258
|
+
return /* @__PURE__ */ jsxs28(DropdownMenu, { children: [
|
|
2259
|
+
/* @__PURE__ */ jsxs28(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
2260
|
+
tab.header,
|
|
2261
|
+
/* @__PURE__ */ jsx45(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
2262
|
+
] }),
|
|
2263
|
+
/* @__PURE__ */ jsx45(
|
|
2264
|
+
DropdownMenuContent,
|
|
2265
|
+
{
|
|
2266
|
+
align: "start",
|
|
2267
|
+
sideOffset: 6,
|
|
2268
|
+
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
2269
|
+
children: tab.children.map((item) => /* @__PURE__ */ jsx45(
|
|
2270
|
+
DropdownMenuItem,
|
|
2271
|
+
{
|
|
2272
|
+
asChild: true,
|
|
2273
|
+
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
2274
|
+
children: LinkComponent ? /* @__PURE__ */ jsx45(LinkComponent, { href: item.url || "#", children: item.header }) : item.header
|
|
2275
|
+
},
|
|
2276
|
+
item.id
|
|
2277
|
+
))
|
|
2278
|
+
}
|
|
2279
|
+
)
|
|
2280
|
+
] }, index);
|
|
2281
|
+
}
|
|
2282
|
+
return tab.url && LinkComponent ? /* @__PURE__ */ jsx45(LinkComponent, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx45("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
2283
|
+
};
|
|
2284
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs28(DropdownMenu, { children: [
|
|
2285
|
+
/* @__PURE__ */ jsxs28(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
2286
|
+
/* @__PURE__ */ jsx45(Menu, { className: "h-4 w-4" }),
|
|
2287
|
+
"Menu"
|
|
2288
|
+
] }),
|
|
2289
|
+
/* @__PURE__ */ jsx45(
|
|
2290
|
+
DropdownMenuContent,
|
|
2291
|
+
{
|
|
2292
|
+
align: "start",
|
|
2293
|
+
sideOffset: 6,
|
|
2294
|
+
className: "z-50 w-56 rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
2295
|
+
children: rawTabs.map((tab, i) => {
|
|
2296
|
+
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
2297
|
+
if (hasChildren) {
|
|
2298
|
+
return /* @__PURE__ */ jsxs28(DropdownMenuSub, { children: [
|
|
2299
|
+
/* @__PURE__ */ jsx45(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
|
|
2300
|
+
/* @__PURE__ */ jsx45(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx45(
|
|
2301
|
+
DropdownMenuItem,
|
|
2302
|
+
{
|
|
2303
|
+
asChild: true,
|
|
2304
|
+
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
2305
|
+
children: LinkComponent && item.url ? /* @__PURE__ */ jsx45(LinkComponent, { href: item.url || "#", children: item.header }) : item.header
|
|
2306
|
+
},
|
|
2307
|
+
item.id
|
|
2308
|
+
)) })
|
|
2309
|
+
] }, i);
|
|
2310
|
+
}
|
|
2311
|
+
return /* @__PURE__ */ jsx45(
|
|
2312
|
+
DropdownMenuItem,
|
|
2313
|
+
{
|
|
2314
|
+
asChild: true,
|
|
2315
|
+
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
2316
|
+
children: LinkComponent && tab.url ? /* @__PURE__ */ jsx45(LinkComponent, { href: tab.url || "#", children: tab.header }) : tab.header
|
|
2317
|
+
},
|
|
2318
|
+
i
|
|
2319
|
+
);
|
|
2320
|
+
})
|
|
2321
|
+
}
|
|
2322
|
+
)
|
|
2323
|
+
] });
|
|
2324
|
+
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
2325
|
+
const forceDesktop = canvasMode === "desktop";
|
|
2326
|
+
return /* @__PURE__ */ jsxs28("div", { className, style, children: [
|
|
2327
|
+
forceDesktop && /* @__PURE__ */ jsx45("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx45("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
2328
|
+
forceMobile && /* @__PURE__ */ jsx45("div", { children: renderMobileMenu() }),
|
|
2329
|
+
/* @__PURE__ */ jsx45("div", { className: "md:hidden", children: renderMobileMenu() })
|
|
2330
|
+
] });
|
|
2331
|
+
};
|
|
2332
|
+
var Tabs_default = Tabs;
|
|
2333
|
+
|
|
2334
|
+
// src/components/Navigation/Stages/Stages.tsx
|
|
2335
|
+
import React4 from "react";
|
|
2336
|
+
import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2337
|
+
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
2338
|
+
return /* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between bg-gray-50 p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
2339
|
+
/* @__PURE__ */ jsx46("div", { className: "flex items-center", children: /* @__PURE__ */ jsx46("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx46("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx46("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
2340
|
+
/* @__PURE__ */ jsx46("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs29(React4.Fragment, { children: [
|
|
2341
|
+
/* @__PURE__ */ jsx46(
|
|
2342
|
+
"button",
|
|
2343
|
+
{
|
|
2344
|
+
className: `
|
|
2345
|
+
min-w-[120px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap ${stage.isActive ? "bg-[#034486] text-white shadow-md" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}`,
|
|
2346
|
+
children: stage.header
|
|
2347
|
+
}
|
|
2348
|
+
),
|
|
2349
|
+
index < stages.length - 1 && /* @__PURE__ */ jsx46("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
2350
|
+
] }, stage.id)) }),
|
|
2351
|
+
isShowBtn && /* @__PURE__ */ jsx46("div", { className: "flex items-center", children: /* @__PURE__ */ jsx46("button", { className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm", children: buttonText }) })
|
|
2352
|
+
] }) });
|
|
2353
|
+
};
|
|
2354
|
+
var Stages_default = StagesComponent;
|
|
2355
|
+
|
|
2356
|
+
// src/components/Navigation/Spacer/Spacer.tsx
|
|
2357
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2358
|
+
var Spacer = ({ className, style }) => {
|
|
2359
|
+
return /* @__PURE__ */ jsx47("div", { className: `${className}`, style });
|
|
2360
|
+
};
|
|
2361
|
+
var Spacer_default = Spacer;
|
|
2362
|
+
|
|
2363
|
+
// src/components/Navigation/Profile/Profile.tsx
|
|
2364
|
+
import { jsx as jsx48, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2365
|
+
|
|
2366
|
+
// src/components/Navigation/Notification/Notification.tsx
|
|
2367
|
+
import { jsx as jsx49, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2368
|
+
|
|
2369
|
+
// src/components/Navigation/Logo/Logo.tsx
|
|
2370
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2371
|
+
|
|
2372
|
+
// src/components/ui/avatar.tsx
|
|
2373
|
+
import * as React5 from "react";
|
|
2374
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2375
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2376
|
+
var Avatar = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2377
|
+
AvatarPrimitive.Root,
|
|
2378
|
+
{
|
|
2379
|
+
ref,
|
|
2380
|
+
className: cn(
|
|
2381
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
2382
|
+
className
|
|
2383
|
+
),
|
|
2384
|
+
...props
|
|
2385
|
+
}
|
|
2386
|
+
));
|
|
2387
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
2388
|
+
var AvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2389
|
+
AvatarPrimitive.Image,
|
|
2390
|
+
{
|
|
2391
|
+
ref,
|
|
2392
|
+
className: cn("aspect-square h-full w-full", className),
|
|
2393
|
+
...props
|
|
2394
|
+
}
|
|
2395
|
+
));
|
|
2396
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
2397
|
+
var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2398
|
+
AvatarPrimitive.Fallback,
|
|
2399
|
+
{
|
|
2400
|
+
ref,
|
|
2401
|
+
className: cn(
|
|
2402
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
2403
|
+
className
|
|
2404
|
+
),
|
|
2405
|
+
...props
|
|
2406
|
+
}
|
|
2407
|
+
));
|
|
2408
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2409
|
+
|
|
2410
|
+
// src/components/Navigation/Navbar/Navbar.tsx
|
|
2411
|
+
import { Fragment as Fragment17, jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2412
|
+
function Navbar({
|
|
2413
|
+
style,
|
|
2414
|
+
badgeType,
|
|
2415
|
+
badgeCount = 0,
|
|
2416
|
+
hideBadgeWhenZero,
|
|
2417
|
+
profileType,
|
|
2418
|
+
showName,
|
|
2419
|
+
imageUrl,
|
|
2420
|
+
altText = "Logo",
|
|
2421
|
+
canvasMode = "desktop",
|
|
2422
|
+
LinkComponent,
|
|
2423
|
+
ImageComponent,
|
|
2424
|
+
list = [],
|
|
2425
|
+
userName = "Guest User"
|
|
2426
|
+
}) {
|
|
2427
|
+
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
2428
|
+
return /* @__PURE__ */ jsx52("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs32("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-2", children: [
|
|
2429
|
+
LinkComponent && ImageComponent ? /* @__PURE__ */ jsx52(LinkComponent, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx52(ImageComponent, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx52("span", { className: "font-semibold text-blue-700", children: "Logo" }) }) : /* @__PURE__ */ jsx52("span", { className: "font-semibold text-blue-700", children: "Logo" }),
|
|
2430
|
+
!isMobileView && LinkComponent && /* @__PURE__ */ jsx52("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx52(
|
|
2431
|
+
LinkComponent,
|
|
2432
|
+
{
|
|
2433
|
+
href: item.url || "#",
|
|
2434
|
+
className: "text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors",
|
|
2435
|
+
children: item.header
|
|
2436
|
+
},
|
|
2437
|
+
item.id
|
|
2438
|
+
)) }),
|
|
2439
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center space-x-3", children: [
|
|
2440
|
+
!isMobileView ? /* @__PURE__ */ jsx52("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs32("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
2441
|
+
/* @__PURE__ */ jsx52(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
2442
|
+
/* @__PURE__ */ jsx52(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
2443
|
+
] }) }) : /* @__PURE__ */ jsx52(
|
|
2444
|
+
Button,
|
|
2445
|
+
{
|
|
2446
|
+
variant: "ghost",
|
|
2447
|
+
size: "icon",
|
|
2448
|
+
className: "border border-gray-400",
|
|
2449
|
+
children: /* @__PURE__ */ jsx52(Search, { className: "h-5 w-5 text-gray-400" })
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
/* @__PURE__ */ jsxs32("div", { className: "relative bg-[#E9E9E9] rounded-md", children: [
|
|
2453
|
+
/* @__PURE__ */ jsx52(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx52(Bell, { className: "h-5 w-5 text-[#1C1B1F]" }) }),
|
|
2454
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && badgeCount > 0 ? /* @__PURE__ */ jsx52("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx52("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
2455
|
+
] }),
|
|
2456
|
+
/* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
2457
|
+
/* @__PURE__ */ jsx52(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center space-x-2", children: [
|
|
2458
|
+
!isMobileView && showName && /* @__PURE__ */ jsx52("h4", { className: "text-[#000000] text-[13px] font-[500] mb-0", children: userName }),
|
|
2459
|
+
!isMobileView ? /* @__PURE__ */ jsxs32(Fragment17, { children: [
|
|
2460
|
+
/* @__PURE__ */ jsx52(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx52(
|
|
2461
|
+
AvatarImage,
|
|
2462
|
+
{
|
|
2463
|
+
src: "/images/appbuilder/toolset/profile.svg",
|
|
2464
|
+
alt: "Profile"
|
|
2465
|
+
}
|
|
2466
|
+
) : /* @__PURE__ */ jsx52("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
|
|
2467
|
+
/* @__PURE__ */ jsx52(
|
|
2468
|
+
Button,
|
|
2469
|
+
{
|
|
2470
|
+
variant: "ghost",
|
|
2471
|
+
size: "icon",
|
|
2472
|
+
className: "text-gray-900 md:hidden",
|
|
2473
|
+
children: /* @__PURE__ */ jsx52(Menu, { className: "h-6 w-6" })
|
|
2474
|
+
}
|
|
2475
|
+
)
|
|
2476
|
+
] }) : /* @__PURE__ */ jsx52(
|
|
2477
|
+
Button,
|
|
2478
|
+
{
|
|
2479
|
+
variant: "ghost",
|
|
2480
|
+
size: "icon",
|
|
2481
|
+
className: "text-gray-900",
|
|
2482
|
+
children: /* @__PURE__ */ jsx52(Menu, { className: "h-6 w-6" })
|
|
2483
|
+
}
|
|
2484
|
+
)
|
|
2485
|
+
] }) }),
|
|
2486
|
+
/* @__PURE__ */ jsxs32(DropdownMenuContent, { align: "end", className: "bg-white", children: [
|
|
2487
|
+
/* @__PURE__ */ jsx52(DropdownMenuLabel, { className: "text-black", children: "My Account" }),
|
|
2488
|
+
/* @__PURE__ */ jsx52(DropdownMenuSeparator, {}),
|
|
2489
|
+
LinkComponent && /* @__PURE__ */ jsxs32(Fragment17, { children: [
|
|
2490
|
+
/* @__PURE__ */ jsx52(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx52(LinkComponent, { href: "/profile", children: "Profile" }) }),
|
|
2491
|
+
/* @__PURE__ */ jsx52(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx52(LinkComponent, { href: "/settings", children: "Settings" }) }),
|
|
2492
|
+
/* @__PURE__ */ jsx52(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx52(LinkComponent, { href: "/logout", children: "Logout" }) }),
|
|
2493
|
+
list && list.length > 0 && /* @__PURE__ */ jsxs32(Fragment17, { children: [
|
|
2494
|
+
/* @__PURE__ */ jsx52("div", { className: "w-full bg-[#656565] opacity-30 h-[1px] my-2" }),
|
|
2495
|
+
/* @__PURE__ */ jsx52(DropdownMenuLabel, { className: "text-black", children: "Main Menu" }),
|
|
2496
|
+
list.map((item) => /* @__PURE__ */ jsx52(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx52(LinkComponent, { href: item.url || "#", children: item.header }) }, item.id))
|
|
2497
|
+
] })
|
|
2498
|
+
] })
|
|
2499
|
+
] })
|
|
2500
|
+
] })
|
|
2501
|
+
] })
|
|
2502
|
+
] }) });
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
// src/components/Chart/BarChart.tsx
|
|
2506
|
+
import { BarChart, Bar, Area, AreaChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts";
|
|
2507
|
+
import { jsx as jsx53, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2508
|
+
var ChartComponent = ({ className, style, ...props }) => {
|
|
2509
|
+
const data = Array.isArray(props?.data) ? props.data : [];
|
|
2510
|
+
const chartType = props.chartType || "bar";
|
|
2511
|
+
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
2512
|
+
return /* @__PURE__ */ jsx53("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx53(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs33(BarChart, { data, children: [
|
|
2513
|
+
/* @__PURE__ */ jsx53(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
2514
|
+
/* @__PURE__ */ jsx53(XAxis, { dataKey: "name" }),
|
|
2515
|
+
/* @__PURE__ */ jsx53(YAxis, {}),
|
|
2516
|
+
/* @__PURE__ */ jsx53(Tooltip, {}),
|
|
2517
|
+
/* @__PURE__ */ jsx53(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
2518
|
+
/* @__PURE__ */ jsx53(Bar, { dataKey: "value", fill: "#00695C" })
|
|
2519
|
+
] }) : /* @__PURE__ */ jsxs33(AreaChart, { data, children: [
|
|
2520
|
+
/* @__PURE__ */ jsx53("defs", { children: /* @__PURE__ */ jsxs33("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2521
|
+
/* @__PURE__ */ jsx53("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
2522
|
+
/* @__PURE__ */ jsx53("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
2523
|
+
] }) }),
|
|
2524
|
+
/* @__PURE__ */ jsx53(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
2525
|
+
/* @__PURE__ */ jsx53(XAxis, { dataKey: "name" }),
|
|
2526
|
+
/* @__PURE__ */ jsx53(YAxis, {}),
|
|
2527
|
+
/* @__PURE__ */ jsx53(Tooltip, {}),
|
|
2528
|
+
/* @__PURE__ */ jsx53(
|
|
2529
|
+
Area,
|
|
2530
|
+
{
|
|
2531
|
+
type: "monotone",
|
|
2532
|
+
dataKey: "value",
|
|
2533
|
+
stroke: "#00695C",
|
|
2534
|
+
fillOpacity: 1,
|
|
2535
|
+
fill: "url(#colorCount)"
|
|
2536
|
+
}
|
|
2537
|
+
)
|
|
2538
|
+
] }) }) });
|
|
2539
|
+
};
|
|
2540
|
+
var BarChart_default = ChartComponent;
|
|
2541
|
+
|
|
2542
|
+
// src/components/Chart/PieChart.tsx
|
|
2543
|
+
import { PieChart, Pie, Cell, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip2, LabelList } from "recharts";
|
|
2544
|
+
import { Fragment as Fragment18, jsx as jsx54, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2545
|
+
var DonutChart = ({ className, style, ...props }) => {
|
|
2546
|
+
const data = Array.isArray(props?.data) ? props.data : [];
|
|
2547
|
+
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
2548
|
+
const showPercentage = props.showPercentage ?? true;
|
|
2549
|
+
const showLegends = props.showLegends ?? true;
|
|
2550
|
+
const labelType = props.labelType || "inside";
|
|
2551
|
+
const canvasMode = props.canvasMode;
|
|
2552
|
+
const renderLabel = ({ value, x, y }) => {
|
|
2553
|
+
if (value == null) return null;
|
|
2554
|
+
const percentage = (Number(value) / total * 100).toFixed(0);
|
|
2555
|
+
return /* @__PURE__ */ jsxs34(
|
|
2556
|
+
"text",
|
|
2557
|
+
{
|
|
2558
|
+
x,
|
|
2559
|
+
y,
|
|
2560
|
+
textAnchor: "middle",
|
|
2561
|
+
dominantBaseline: "central",
|
|
2562
|
+
className: "text-[10px] font-semibold",
|
|
2563
|
+
fill: labelType === "inside" ? "#fff" : "#000",
|
|
2564
|
+
children: [
|
|
2565
|
+
value,
|
|
2566
|
+
"k ",
|
|
2567
|
+
showPercentage ? `(${percentage}%)` : ""
|
|
2568
|
+
]
|
|
2569
|
+
}
|
|
2570
|
+
);
|
|
2571
|
+
};
|
|
2572
|
+
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
2573
|
+
const forceDesktop = canvasMode === "desktop";
|
|
2574
|
+
const wrapperClass = canvasMode ? forceDesktop ? "flex-row" : "flex-col" : "flex-col md:flex-row";
|
|
2575
|
+
const renderLegends = () => {
|
|
2576
|
+
if (!showLegends) return null;
|
|
2577
|
+
return /* @__PURE__ */ jsx54(Fragment18, { children: data.map((d) => /* @__PURE__ */ jsxs34(
|
|
2578
|
+
"div",
|
|
2579
|
+
{
|
|
2580
|
+
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
2581
|
+
children: [
|
|
2582
|
+
/* @__PURE__ */ jsx54(
|
|
2583
|
+
"span",
|
|
2584
|
+
{
|
|
2585
|
+
className: "inline-block w-[16px] h-[16px] rounded",
|
|
2586
|
+
style: { backgroundColor: d.color }
|
|
2587
|
+
}
|
|
2588
|
+
),
|
|
2589
|
+
/* @__PURE__ */ jsx54("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
2590
|
+
]
|
|
2591
|
+
},
|
|
2592
|
+
d.name
|
|
2593
|
+
)) });
|
|
2594
|
+
};
|
|
2595
|
+
return /* @__PURE__ */ jsxs34(
|
|
2596
|
+
"div",
|
|
2597
|
+
{
|
|
2598
|
+
className: `relative flex items-center ${wrapperClass} ${className}`,
|
|
2599
|
+
style,
|
|
2600
|
+
children: [
|
|
2601
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
2602
|
+
data.length > 0 && /* @__PURE__ */ jsx54(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs34(PieChart, { children: [
|
|
2603
|
+
/* @__PURE__ */ jsxs34(
|
|
2604
|
+
Pie,
|
|
2605
|
+
{
|
|
2606
|
+
data,
|
|
2607
|
+
cx: "50%",
|
|
2608
|
+
cy: "50%",
|
|
2609
|
+
innerRadius: 70,
|
|
2610
|
+
outerRadius: 120,
|
|
2611
|
+
dataKey: "value",
|
|
2612
|
+
labelLine: false,
|
|
2613
|
+
isAnimationActive: false,
|
|
2614
|
+
children: [
|
|
2615
|
+
data.map((entry, index) => /* @__PURE__ */ jsx54(Cell, { fill: entry.color }, `cell-${index}`)),
|
|
2616
|
+
/* @__PURE__ */ jsx54(
|
|
2617
|
+
LabelList,
|
|
2618
|
+
{
|
|
2619
|
+
dataKey: "value",
|
|
2620
|
+
position: labelType === "inside" ? "inside" : "outside",
|
|
2621
|
+
content: renderLabel
|
|
2622
|
+
}
|
|
2623
|
+
)
|
|
2624
|
+
]
|
|
2625
|
+
}
|
|
2626
|
+
),
|
|
2627
|
+
/* @__PURE__ */ jsx54(Tooltip2, { formatter: (value, name) => [`${value}k`, name] })
|
|
2628
|
+
] }) }),
|
|
2629
|
+
/* @__PURE__ */ jsxs34("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-2xl md:text-4xl font-bold text-[#000]", children: [
|
|
2630
|
+
total,
|
|
2631
|
+
"k"
|
|
2632
|
+
] })
|
|
2633
|
+
] }),
|
|
2634
|
+
/* @__PURE__ */ jsx54("div", { className: `flex ${forceDesktop ? "flex-col ml-auto space-y-3" : "flex-wrap justify-center gap-2 mt-4"}
|
|
2635
|
+
w-full md:w-auto`, children: renderLegends() })
|
|
2636
|
+
]
|
|
2637
|
+
}
|
|
2638
|
+
);
|
|
2639
|
+
};
|
|
2640
|
+
var PieChart_default = DonutChart;
|
|
2641
|
+
|
|
2642
|
+
// src/components/Blocks/EmailComposer.tsx
|
|
2643
|
+
import { jsx as jsx55, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2644
|
+
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
2645
|
+
return /* @__PURE__ */ jsx55("div", { className, style, children: /* @__PURE__ */ jsxs35("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
2646
|
+
/* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
|
|
2647
|
+
"input",
|
|
2648
|
+
{
|
|
2649
|
+
type: "email",
|
|
2650
|
+
placeholder: "From",
|
|
2651
|
+
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]",
|
|
2652
|
+
required: true
|
|
2653
|
+
}
|
|
2654
|
+
) }),
|
|
2655
|
+
/* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2", children: [
|
|
2656
|
+
/* @__PURE__ */ jsx55(
|
|
2657
|
+
"input",
|
|
2658
|
+
{
|
|
2659
|
+
type: "email",
|
|
2660
|
+
value: to,
|
|
2661
|
+
onChange: (e) => setTo?.(e.target.value),
|
|
2662
|
+
placeholder: "To",
|
|
2663
|
+
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]",
|
|
2664
|
+
required: true
|
|
2665
|
+
}
|
|
2666
|
+
),
|
|
2667
|
+
!showCc && /* @__PURE__ */ jsx55(
|
|
2668
|
+
"button",
|
|
2669
|
+
{
|
|
2670
|
+
onClick: () => setShowCc?.(true),
|
|
2671
|
+
className: "px-3 py-1 border rounded-md text-sm hover:bg-gray-100 bg-[#E9E9E9] text-[#383838]",
|
|
2672
|
+
children: "Cc"
|
|
2673
|
+
}
|
|
2674
|
+
),
|
|
2675
|
+
!showBcc && /* @__PURE__ */ jsx55(
|
|
2676
|
+
"button",
|
|
2677
|
+
{
|
|
2678
|
+
onClick: () => setShowBcc?.(true),
|
|
2679
|
+
className: "px-3 py-1 border rounded-md text-sm hover:bg-gray-100 bg-[#E9E9E9] text-[#383838]",
|
|
2680
|
+
children: "Bcc"
|
|
2681
|
+
}
|
|
2682
|
+
)
|
|
2683
|
+
] }) }),
|
|
2684
|
+
showCc && /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
|
|
2685
|
+
"input",
|
|
2686
|
+
{
|
|
2687
|
+
type: "text",
|
|
2688
|
+
value: cc,
|
|
2689
|
+
onChange: (e) => setCc?.(e.target.value),
|
|
2690
|
+
placeholder: "Cc",
|
|
2691
|
+
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
2692
|
+
}
|
|
2693
|
+
) }),
|
|
2694
|
+
showBcc && /* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
|
|
2695
|
+
"input",
|
|
2696
|
+
{
|
|
2697
|
+
type: "text",
|
|
2698
|
+
value: bcc,
|
|
2699
|
+
onChange: (e) => setBcc?.(e.target.value),
|
|
2700
|
+
placeholder: "Bcc",
|
|
2701
|
+
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
2702
|
+
}
|
|
2703
|
+
) }),
|
|
2704
|
+
/* @__PURE__ */ jsx55("div", { className: "mb-3", children: /* @__PURE__ */ jsx55(
|
|
2705
|
+
"input",
|
|
2706
|
+
{
|
|
2707
|
+
type: "text",
|
|
2708
|
+
value: subject,
|
|
2709
|
+
onChange: (e) => setSubject?.(e.target.value),
|
|
2710
|
+
placeholder: "Subject",
|
|
2711
|
+
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
2712
|
+
}
|
|
2713
|
+
) }),
|
|
2714
|
+
/* @__PURE__ */ jsx55("div", { className: "mb-4", children: /* @__PURE__ */ jsx55(MyEditor, { value: body, onChange: setBody }) }),
|
|
2715
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex justify-end gap-2", children: [
|
|
2716
|
+
/* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
2717
|
+
/* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
2718
|
+
/* @__PURE__ */ jsx55("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
2719
|
+
] })
|
|
2720
|
+
] }) });
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
// src/components/ui/sonner-toast.tsx
|
|
2724
|
+
import { toast } from "sonner";
|
|
2725
|
+
function showSonnerToast({
|
|
2726
|
+
title,
|
|
2727
|
+
description,
|
|
2728
|
+
variant = "default",
|
|
2729
|
+
duration = 3e3,
|
|
2730
|
+
actionLabel,
|
|
2731
|
+
onAction
|
|
2732
|
+
}) {
|
|
2733
|
+
const options = {
|
|
2734
|
+
description,
|
|
2735
|
+
duration,
|
|
2736
|
+
action: actionLabel ? {
|
|
2737
|
+
label: actionLabel,
|
|
2738
|
+
onClick: onAction || (() => {
|
|
2739
|
+
})
|
|
2740
|
+
} : void 0
|
|
2741
|
+
};
|
|
2742
|
+
switch (variant) {
|
|
2743
|
+
case "success":
|
|
2744
|
+
toast.success(title, options);
|
|
2745
|
+
break;
|
|
2746
|
+
case "error":
|
|
2747
|
+
toast.error(title, options);
|
|
2748
|
+
break;
|
|
2749
|
+
case "info":
|
|
2750
|
+
toast.info(title, options);
|
|
2751
|
+
break;
|
|
2752
|
+
case "warning":
|
|
2753
|
+
toast.warning(title, options);
|
|
2754
|
+
break;
|
|
2755
|
+
default:
|
|
2756
|
+
toast(title, options);
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
48
2759
|
export {
|
|
49
2760
|
BarChart_default as BarChart,
|
|
50
2761
|
Breadcrumb_default as Breadcrumb,
|
|
@@ -59,8 +2770,6 @@ export {
|
|
|
59
2770
|
EmailComposer,
|
|
60
2771
|
FileInput_default as FileInput,
|
|
61
2772
|
Flex_default as FlexLayout,
|
|
62
|
-
Form_default as Form,
|
|
63
|
-
Wrapper_default as FormWrapper,
|
|
64
2773
|
Grid_default as GridLayout,
|
|
65
2774
|
Image_default as Image,
|
|
66
2775
|
Modal_default as Modal,
|
|
@@ -77,7 +2786,6 @@ export {
|
|
|
77
2786
|
Shape_default as Shape,
|
|
78
2787
|
Spacer_default as Spacer,
|
|
79
2788
|
Stages_default as Stages,
|
|
80
|
-
StateProvider,
|
|
81
2789
|
SwitchToggle_default as SwitchToggle,
|
|
82
2790
|
Table_default as Table,
|
|
83
2791
|
Tabs_default as Tabs,
|
|
@@ -88,8 +2796,34 @@ export {
|
|
|
88
2796
|
UrlInput_default as URL,
|
|
89
2797
|
cn,
|
|
90
2798
|
getInitials,
|
|
91
|
-
showSonnerToast
|
|
92
|
-
stateReducer,
|
|
93
|
-
useAppState
|
|
2799
|
+
showSonnerToast
|
|
94
2800
|
};
|
|
2801
|
+
/*! Bundled license information:
|
|
2802
|
+
|
|
2803
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
2804
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
2805
|
+
lucide-react/dist/esm/Icon.js:
|
|
2806
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
2807
|
+
lucide-react/dist/esm/icons/bell.js:
|
|
2808
|
+
lucide-react/dist/esm/icons/calculator.js:
|
|
2809
|
+
lucide-react/dist/esm/icons/calendar.js:
|
|
2810
|
+
lucide-react/dist/esm/icons/check.js:
|
|
2811
|
+
lucide-react/dist/esm/icons/chevron-down.js:
|
|
2812
|
+
lucide-react/dist/esm/icons/chevron-left.js:
|
|
2813
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
2814
|
+
lucide-react/dist/esm/icons/chevron-up.js:
|
|
2815
|
+
lucide-react/dist/esm/icons/circle.js:
|
|
2816
|
+
lucide-react/dist/esm/icons/ellipsis.js:
|
|
2817
|
+
lucide-react/dist/esm/icons/mail.js:
|
|
2818
|
+
lucide-react/dist/esm/icons/menu.js:
|
|
2819
|
+
lucide-react/dist/esm/icons/scan-eye.js:
|
|
2820
|
+
lucide-react/dist/esm/icons/search.js:
|
|
2821
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
2822
|
+
(**
|
|
2823
|
+
* @license lucide-react v0.542.0 - ISC
|
|
2824
|
+
*
|
|
2825
|
+
* This source code is licensed under the ISC license.
|
|
2826
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2827
|
+
*)
|
|
2828
|
+
*/
|
|
95
2829
|
//# sourceMappingURL=index.mjs.map
|