@northslopetech/altitude-ui 2.1.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -16
- package/dist/index.d.mts +118 -28
- package/dist/index.d.ts +118 -28
- package/dist/index.js +563 -329
- package/dist/index.mjs +564 -333
- package/dist/pdf.worker.min.mjs +28 -0
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -65,6 +65,7 @@ __export(index_exports, {
|
|
|
65
65
|
DatePicker: () => DatePicker,
|
|
66
66
|
Doc: () => Doc,
|
|
67
67
|
Dollar: () => Dollar,
|
|
68
|
+
Download: () => Download,
|
|
68
69
|
DropdownMenu: () => DropdownMenu,
|
|
69
70
|
DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
|
|
70
71
|
DropdownMenuContent: () => DropdownMenuContent,
|
|
@@ -97,7 +98,6 @@ __export(index_exports, {
|
|
|
97
98
|
FieldTitle: () => FieldTitle,
|
|
98
99
|
Filter: () => Filter,
|
|
99
100
|
FilterDescending: () => FilterDescending,
|
|
100
|
-
FormField: () => FormField,
|
|
101
101
|
GenericTooltip: () => GenericTooltip,
|
|
102
102
|
GraphBar: () => GraphBar,
|
|
103
103
|
GraphDonut: () => GraphDonut,
|
|
@@ -115,9 +115,11 @@ __export(index_exports, {
|
|
|
115
115
|
MagnifyingGlass: () => MagnifyingGlass,
|
|
116
116
|
Minus: () => Minus,
|
|
117
117
|
MoreMenu: () => MoreMenu,
|
|
118
|
+
PdfViewer: () => PdfViewer,
|
|
118
119
|
Phone: () => Phone,
|
|
119
120
|
PieChart: () => PieChart,
|
|
120
121
|
Plus: () => Plus,
|
|
122
|
+
Print: () => Print,
|
|
121
123
|
QuestionCircle: () => QuestionCircle,
|
|
122
124
|
Select: () => Select,
|
|
123
125
|
SelectContent: () => SelectContent,
|
|
@@ -166,6 +168,7 @@ __export(index_exports, {
|
|
|
166
168
|
getHeatmapColor: () => getHeatmapColor,
|
|
167
169
|
getPerformanceColor: () => getPerformanceColor,
|
|
168
170
|
getSeriesColor: () => getSeriesColor,
|
|
171
|
+
initializePdfWorker: () => initializePdfWorker,
|
|
169
172
|
selectTriggerVariants: () => selectTriggerVariants,
|
|
170
173
|
tabsVariants: () => tabsVariants,
|
|
171
174
|
typographyVariants: () => typographyVariants,
|
|
@@ -1825,11 +1828,59 @@ var Logout = ({
|
|
|
1825
1828
|
]
|
|
1826
1829
|
}
|
|
1827
1830
|
);
|
|
1831
|
+
var Print = ({
|
|
1832
|
+
className,
|
|
1833
|
+
variant = "dark",
|
|
1834
|
+
...props
|
|
1835
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1836
|
+
"svg",
|
|
1837
|
+
{
|
|
1838
|
+
width: "16",
|
|
1839
|
+
height: "16",
|
|
1840
|
+
viewBox: "0 0 16 16",
|
|
1841
|
+
fill: "none",
|
|
1842
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1843
|
+
className: cn(getVariantStyles(variant), className),
|
|
1844
|
+
...props,
|
|
1845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1846
|
+
"path",
|
|
1847
|
+
{
|
|
1848
|
+
d: "M12.9 5.33333H3.1C1.938 5.33333 1 6.22667 1 7.33333V11.3333H3.8V14H12.2V11.3333H15V7.33333C15 6.22667 14.062 5.33333 12.9 5.33333ZM10.8 12.6667H5.2V9.33333H10.8V12.6667ZM12.9 8C12.515 8 12.2 7.7 12.2 7.33333C12.2 6.96667 12.515 6.66667 12.9 6.66667C13.285 6.66667 13.6 6.96667 13.6 7.33333C13.6 7.7 13.285 8 12.9 8ZM12.2 2H3.8V4.66667H12.2V2Z",
|
|
1849
|
+
fill: "#161616"
|
|
1850
|
+
}
|
|
1851
|
+
)
|
|
1852
|
+
}
|
|
1853
|
+
);
|
|
1854
|
+
var Download = ({
|
|
1855
|
+
className,
|
|
1856
|
+
variant = "dark",
|
|
1857
|
+
...props
|
|
1858
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1859
|
+
"svg",
|
|
1860
|
+
{
|
|
1861
|
+
width: "16",
|
|
1862
|
+
height: "16",
|
|
1863
|
+
viewBox: "0 0 16 16",
|
|
1864
|
+
fill: "none",
|
|
1865
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1866
|
+
className: cn(getVariantStyles(variant), className),
|
|
1867
|
+
...props,
|
|
1868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1869
|
+
"path",
|
|
1870
|
+
{
|
|
1871
|
+
fillRule: "evenodd",
|
|
1872
|
+
clipRule: "evenodd",
|
|
1873
|
+
d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.1464 9.31042L8.3535 12.1033C8.15824 12.2986 7.84166 12.2986 7.6464 12.1033L4.8535 9.31042C4.53852 8.99543 4.76161 8.45686 5.20706 8.45686H6.99995V4.75C6.99995 4.19772 7.44767 3.75 7.99995 3.75C8.55224 3.75 8.99995 4.19772 8.99995 4.75V8.45686H10.7928C11.2383 8.45686 11.4614 8.99543 11.1464 9.31042Z",
|
|
1874
|
+
fill: "#161616"
|
|
1875
|
+
}
|
|
1876
|
+
)
|
|
1877
|
+
}
|
|
1878
|
+
);
|
|
1828
1879
|
|
|
1829
1880
|
// src/components/ui/select.tsx
|
|
1830
1881
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1831
1882
|
var selectTriggerVariants = (0, import_class_variance_authority4.cva)(
|
|
1832
|
-
"flex items-center justify-between border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 transition-colors rounded-md px-3",
|
|
1883
|
+
"flex items-center justify-between border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 transition-colors rounded-md px-3 border-secondary focus-visible:border-2 focus-visible:border-strong aria-invalid:border-error aria-invalid:focus-visible:border-error",
|
|
1833
1884
|
{
|
|
1834
1885
|
variants: {
|
|
1835
1886
|
width: {
|
|
@@ -1874,7 +1925,7 @@ var SelectTrigger = React3.forwardRef(({ className, children, style, width, ...p
|
|
|
1874
1925
|
ref,
|
|
1875
1926
|
className: cn(
|
|
1876
1927
|
selectTriggerVariants({ width }),
|
|
1877
|
-
"
|
|
1928
|
+
"data-[state=open]:[&_svg]:rotate-180 data-[placeholder]:text-secondary h-10 py-2",
|
|
1878
1929
|
className
|
|
1879
1930
|
),
|
|
1880
1931
|
style: tokenStyles,
|
|
@@ -1985,121 +2036,18 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1985
2036
|
));
|
|
1986
2037
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1987
2038
|
|
|
1988
|
-
// src/components/ui/form-field.tsx
|
|
1989
|
-
var React4 = __toESM(require("react"));
|
|
1990
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1991
|
-
var FormField = React4.forwardRef(
|
|
1992
|
-
({
|
|
1993
|
-
label,
|
|
1994
|
-
helperText,
|
|
1995
|
-
error = false,
|
|
1996
|
-
required = false,
|
|
1997
|
-
children,
|
|
1998
|
-
className,
|
|
1999
|
-
id,
|
|
2000
|
-
compact = false,
|
|
2001
|
-
...props
|
|
2002
|
-
}, ref) => {
|
|
2003
|
-
const generatedId = React4.useId();
|
|
2004
|
-
const fieldId = id || generatedId;
|
|
2005
|
-
const helperTextId = `${fieldId}-helper`;
|
|
2006
|
-
const labelId = `${fieldId}-label`;
|
|
2007
|
-
if (compact) {
|
|
2008
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("w-full space-y-2", className), ...props, children: [
|
|
2009
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
|
|
2010
|
-
React4.cloneElement(
|
|
2011
|
-
children,
|
|
2012
|
-
{
|
|
2013
|
-
id: fieldId,
|
|
2014
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
2015
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
2016
|
-
"aria-required": required,
|
|
2017
|
-
"aria-invalid": error,
|
|
2018
|
-
className: cn(
|
|
2019
|
-
"pt-7 pb-2 h-14 items-end",
|
|
2020
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
2021
|
-
children.props.className
|
|
2022
|
-
)
|
|
2023
|
-
}
|
|
2024
|
-
),
|
|
2025
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2026
|
-
"label",
|
|
2027
|
-
{
|
|
2028
|
-
id: labelId,
|
|
2029
|
-
htmlFor: fieldId,
|
|
2030
|
-
className: "absolute left-3 top-2 text-xs text-semantic-text-info [font:var(--typography-label-xs-bold)] pointer-events-none",
|
|
2031
|
-
children: label
|
|
2032
|
-
}
|
|
2033
|
-
)
|
|
2034
|
-
] }),
|
|
2035
|
-
helperText && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2036
|
-
Typography,
|
|
2037
|
-
{
|
|
2038
|
-
variant: "body-xs",
|
|
2039
|
-
id: helperTextId,
|
|
2040
|
-
className: cn(
|
|
2041
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
2042
|
-
),
|
|
2043
|
-
children: helperText
|
|
2044
|
-
}
|
|
2045
|
-
)
|
|
2046
|
-
] });
|
|
2047
|
-
}
|
|
2048
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("w-full space-y-3", className), ...props, children: [
|
|
2049
|
-
(label || required) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2050
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2051
|
-
"label",
|
|
2052
|
-
{
|
|
2053
|
-
id: labelId,
|
|
2054
|
-
htmlFor: fieldId,
|
|
2055
|
-
className: "text-semantic-text-primary [font:var(--typography-label-sm-regular)]",
|
|
2056
|
-
children: label
|
|
2057
|
-
}
|
|
2058
|
-
),
|
|
2059
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-semantic-text-secondary [font:var(--typography-label-xs-regular)]", children: "*required" })
|
|
2060
|
-
] }),
|
|
2061
|
-
React4.cloneElement(
|
|
2062
|
-
children,
|
|
2063
|
-
{
|
|
2064
|
-
id: fieldId,
|
|
2065
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
2066
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
2067
|
-
"aria-required": required,
|
|
2068
|
-
"aria-invalid": error,
|
|
2069
|
-
className: cn(
|
|
2070
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
2071
|
-
children.props.className
|
|
2072
|
-
)
|
|
2073
|
-
}
|
|
2074
|
-
),
|
|
2075
|
-
helperText && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2076
|
-
Typography,
|
|
2077
|
-
{
|
|
2078
|
-
variant: "body-xs",
|
|
2079
|
-
id: helperTextId,
|
|
2080
|
-
className: cn(
|
|
2081
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
2082
|
-
),
|
|
2083
|
-
children: helperText
|
|
2084
|
-
}
|
|
2085
|
-
)
|
|
2086
|
-
] });
|
|
2087
|
-
}
|
|
2088
|
-
);
|
|
2089
|
-
FormField.displayName = "FormField";
|
|
2090
|
-
|
|
2091
2039
|
// src/components/ui/field.tsx
|
|
2092
2040
|
var import_react = require("react");
|
|
2093
2041
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2094
2042
|
|
|
2095
2043
|
// src/components/ui/label.tsx
|
|
2096
2044
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
2097
|
-
var
|
|
2045
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2098
2046
|
function Label2({
|
|
2099
2047
|
className,
|
|
2100
2048
|
...props
|
|
2101
2049
|
}) {
|
|
2102
|
-
return /* @__PURE__ */ (0,
|
|
2050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2103
2051
|
LabelPrimitive.Root,
|
|
2104
2052
|
{
|
|
2105
2053
|
"data-slot": "label",
|
|
@@ -2114,14 +2062,14 @@ function Label2({
|
|
|
2114
2062
|
|
|
2115
2063
|
// src/components/ui/separator.tsx
|
|
2116
2064
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
2117
|
-
var
|
|
2065
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2118
2066
|
function Separator2({
|
|
2119
2067
|
className,
|
|
2120
2068
|
orientation = "horizontal",
|
|
2121
2069
|
decorative = true,
|
|
2122
2070
|
...props
|
|
2123
2071
|
}) {
|
|
2124
|
-
return /* @__PURE__ */ (0,
|
|
2072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2125
2073
|
SeparatorPrimitive.Root,
|
|
2126
2074
|
{
|
|
2127
2075
|
"data-slot": "separator",
|
|
@@ -2137,9 +2085,9 @@ function Separator2({
|
|
|
2137
2085
|
}
|
|
2138
2086
|
|
|
2139
2087
|
// src/components/ui/field.tsx
|
|
2140
|
-
var
|
|
2088
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2141
2089
|
function FieldSet({ className, ...props }) {
|
|
2142
|
-
return /* @__PURE__ */ (0,
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2143
2091
|
"fieldset",
|
|
2144
2092
|
{
|
|
2145
2093
|
"data-slot": "field-set",
|
|
@@ -2157,7 +2105,7 @@ function FieldLegend({
|
|
|
2157
2105
|
variant = "legend",
|
|
2158
2106
|
...props
|
|
2159
2107
|
}) {
|
|
2160
|
-
return /* @__PURE__ */ (0,
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2161
2109
|
"legend",
|
|
2162
2110
|
{
|
|
2163
2111
|
"data-slot": "field-legend",
|
|
@@ -2173,7 +2121,7 @@ function FieldLegend({
|
|
|
2173
2121
|
);
|
|
2174
2122
|
}
|
|
2175
2123
|
function FieldGroup({ className, ...props }) {
|
|
2176
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2177
2125
|
"div",
|
|
2178
2126
|
{
|
|
2179
2127
|
"data-slot": "field-group",
|
|
@@ -2213,7 +2161,7 @@ function Field({
|
|
|
2213
2161
|
orientation = "vertical",
|
|
2214
2162
|
...props
|
|
2215
2163
|
}) {
|
|
2216
|
-
return /* @__PURE__ */ (0,
|
|
2164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2217
2165
|
"div",
|
|
2218
2166
|
{
|
|
2219
2167
|
role: "group",
|
|
@@ -2225,7 +2173,7 @@ function Field({
|
|
|
2225
2173
|
);
|
|
2226
2174
|
}
|
|
2227
2175
|
function FieldContent({ className, ...props }) {
|
|
2228
|
-
return /* @__PURE__ */ (0,
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2229
2177
|
"div",
|
|
2230
2178
|
{
|
|
2231
2179
|
"data-slot": "field-content",
|
|
@@ -2241,7 +2189,7 @@ function FieldLabel({
|
|
|
2241
2189
|
className,
|
|
2242
2190
|
...props
|
|
2243
2191
|
}) {
|
|
2244
|
-
return /* @__PURE__ */ (0,
|
|
2192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2245
2193
|
Label2,
|
|
2246
2194
|
{
|
|
2247
2195
|
"data-slot": "field-label",
|
|
@@ -2256,7 +2204,7 @@ function FieldLabel({
|
|
|
2256
2204
|
);
|
|
2257
2205
|
}
|
|
2258
2206
|
function FieldTitle({ className, ...props }) {
|
|
2259
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2260
2208
|
"div",
|
|
2261
2209
|
{
|
|
2262
2210
|
"data-slot": "field-label",
|
|
@@ -2269,7 +2217,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
2269
2217
|
);
|
|
2270
2218
|
}
|
|
2271
2219
|
function FieldDescription({ className, ...props }) {
|
|
2272
|
-
return /* @__PURE__ */ (0,
|
|
2220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2273
2221
|
"p",
|
|
2274
2222
|
{
|
|
2275
2223
|
"data-slot": "field-description",
|
|
@@ -2288,7 +2236,7 @@ function FieldSeparator({
|
|
|
2288
2236
|
className,
|
|
2289
2237
|
...props
|
|
2290
2238
|
}) {
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2292
2240
|
"div",
|
|
2293
2241
|
{
|
|
2294
2242
|
"data-slot": "field-separator",
|
|
@@ -2299,8 +2247,8 @@ function FieldSeparator({
|
|
|
2299
2247
|
),
|
|
2300
2248
|
...props,
|
|
2301
2249
|
children: [
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2303
|
-
children && /* @__PURE__ */ (0,
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
2251
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2304
2252
|
"span",
|
|
2305
2253
|
{
|
|
2306
2254
|
className: "bg-light text-secondary relative mx-auto block w-fit px-2",
|
|
@@ -2328,14 +2276,14 @@ function FieldError({
|
|
|
2328
2276
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
2329
2277
|
return errors[0].message;
|
|
2330
2278
|
}
|
|
2331
|
-
return /* @__PURE__ */ (0,
|
|
2332
|
-
(error, index) => error?.message && /* @__PURE__ */ (0,
|
|
2279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
2280
|
+
(error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: error.message }, index)
|
|
2333
2281
|
) });
|
|
2334
2282
|
}, [children, errors]);
|
|
2335
2283
|
if (!content) {
|
|
2336
2284
|
return null;
|
|
2337
2285
|
}
|
|
2338
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2339
2287
|
"div",
|
|
2340
2288
|
{
|
|
2341
2289
|
role: "alert",
|
|
@@ -2348,14 +2296,14 @@ function FieldError({
|
|
|
2348
2296
|
}
|
|
2349
2297
|
|
|
2350
2298
|
// src/components/ui/date-picker.tsx
|
|
2351
|
-
var
|
|
2299
|
+
var React5 = __toESM(require("react"));
|
|
2352
2300
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2353
2301
|
|
|
2354
2302
|
// src/components/ui/input.tsx
|
|
2355
|
-
var
|
|
2356
|
-
var
|
|
2357
|
-
var inputBaseStyles = "flex h-10 py-2 w-full border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50
|
|
2358
|
-
var Input =
|
|
2303
|
+
var React4 = __toESM(require("react"));
|
|
2304
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2305
|
+
var inputBaseStyles = "flex h-10 py-2 w-full border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 transition-colors rounded-md px-3 min-w-80 placeholder:text-secondary read-only:bg-gray read-only:cursor-default read-only:border-transparent read-only:text-secondary read-only:focus-visible:border-transparent border-secondary focus-visible:border-2 focus-visible:border-strong disabled:border-secondary aria-invalid:border-error aria-invalid:focus-visible:border-error";
|
|
2306
|
+
var Input = React4.forwardRef(
|
|
2359
2307
|
({
|
|
2360
2308
|
className,
|
|
2361
2309
|
style,
|
|
@@ -2366,7 +2314,7 @@ var Input = React5.forwardRef(
|
|
|
2366
2314
|
readOnly,
|
|
2367
2315
|
...props
|
|
2368
2316
|
}, ref) => {
|
|
2369
|
-
const [internalValue, setInternalValue] =
|
|
2317
|
+
const [internalValue, setInternalValue] = React4.useState(value || "");
|
|
2370
2318
|
const isControlled = value !== void 0;
|
|
2371
2319
|
const currentValue = isControlled ? value : internalValue;
|
|
2372
2320
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -2396,8 +2344,8 @@ var Input = React5.forwardRef(
|
|
|
2396
2344
|
}
|
|
2397
2345
|
onClear?.();
|
|
2398
2346
|
};
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2401
2349
|
"input",
|
|
2402
2350
|
{
|
|
2403
2351
|
className: cn(
|
|
@@ -2413,23 +2361,23 @@ var Input = React5.forwardRef(
|
|
|
2413
2361
|
...props
|
|
2414
2362
|
}
|
|
2415
2363
|
),
|
|
2416
|
-
showClear && /* @__PURE__ */ (0,
|
|
2364
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2417
2365
|
"button",
|
|
2418
2366
|
{
|
|
2419
2367
|
type: "button",
|
|
2420
2368
|
onClick: handleClear,
|
|
2421
2369
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
2422
|
-
children: /* @__PURE__ */ (0,
|
|
2370
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(X, { className: "h-4 w-4" })
|
|
2423
2371
|
}
|
|
2424
2372
|
),
|
|
2425
|
-
showLock && /* @__PURE__ */ (0,
|
|
2373
|
+
showLock && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Lock, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary" })
|
|
2426
2374
|
] });
|
|
2427
2375
|
}
|
|
2428
2376
|
);
|
|
2429
2377
|
Input.displayName = "Input";
|
|
2430
2378
|
|
|
2431
2379
|
// src/components/ui/date-picker.tsx
|
|
2432
|
-
var
|
|
2380
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2433
2381
|
var getDayNames = () => {
|
|
2434
2382
|
const days = [];
|
|
2435
2383
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2465,7 +2413,7 @@ var formatDateInput = (date) => {
|
|
|
2465
2413
|
day: "2-digit"
|
|
2466
2414
|
});
|
|
2467
2415
|
};
|
|
2468
|
-
var DatePicker =
|
|
2416
|
+
var DatePicker = React5.forwardRef(
|
|
2469
2417
|
({
|
|
2470
2418
|
value,
|
|
2471
2419
|
onValueChange,
|
|
@@ -2484,19 +2432,19 @@ var DatePicker = React6.forwardRef(
|
|
|
2484
2432
|
if (isNaN(parsed.getTime())) return void 0;
|
|
2485
2433
|
return parsed;
|
|
2486
2434
|
};
|
|
2487
|
-
const [selectedDate, setSelectedDate] =
|
|
2435
|
+
const [selectedDate, setSelectedDate] = React5.useState(
|
|
2488
2436
|
value || parseDate(defaultValue)
|
|
2489
2437
|
);
|
|
2490
|
-
const [currentMonth, setCurrentMonth] =
|
|
2438
|
+
const [currentMonth, setCurrentMonth] = React5.useState(() => {
|
|
2491
2439
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
2492
2440
|
return new Date(date.getFullYear(), date.getMonth());
|
|
2493
2441
|
});
|
|
2494
|
-
const [open, setOpen] =
|
|
2495
|
-
const [inputValue, setInputValue] =
|
|
2442
|
+
const [open, setOpen] = React5.useState(false);
|
|
2443
|
+
const [inputValue, setInputValue] = React5.useState(() => {
|
|
2496
2444
|
const initialDate = value || parseDate(defaultValue);
|
|
2497
2445
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
2498
2446
|
});
|
|
2499
|
-
|
|
2447
|
+
React5.useEffect(() => {
|
|
2500
2448
|
setSelectedDate(value);
|
|
2501
2449
|
if (value) {
|
|
2502
2450
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -2507,7 +2455,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2507
2455
|
setInputValue("");
|
|
2508
2456
|
}
|
|
2509
2457
|
}, [value]);
|
|
2510
|
-
|
|
2458
|
+
React5.useEffect(() => {
|
|
2511
2459
|
if (value) return;
|
|
2512
2460
|
const parsedDefault = parseDate(defaultValue);
|
|
2513
2461
|
if (!parsedDefault) return;
|
|
@@ -2630,14 +2578,14 @@ var DatePicker = React6.forwardRef(
|
|
|
2630
2578
|
const months = getMonthNames();
|
|
2631
2579
|
const dayNames = getDayNames();
|
|
2632
2580
|
const years = generateYears();
|
|
2633
|
-
return /* @__PURE__ */ (0,
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2634
2582
|
PopoverPrimitive.Root,
|
|
2635
2583
|
{
|
|
2636
2584
|
open: disabled ? false : open,
|
|
2637
2585
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
2638
2586
|
children: [
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2641
2589
|
Input,
|
|
2642
2590
|
{
|
|
2643
2591
|
ref,
|
|
@@ -2650,7 +2598,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2650
2598
|
...props
|
|
2651
2599
|
}
|
|
2652
2600
|
),
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 hover:bg-gray rounded p-0.5 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2654
2602
|
Calendar,
|
|
2655
2603
|
{
|
|
2656
2604
|
className: cn(
|
|
@@ -2660,7 +2608,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2660
2608
|
}
|
|
2661
2609
|
) }) })
|
|
2662
2610
|
] }),
|
|
2663
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2664
2612
|
PopoverPrimitive.Content,
|
|
2665
2613
|
{
|
|
2666
2614
|
className: "z-50 w-80 rounded-lg border border-secondary bg-light text-dark shadow-lg animate-in fade-in-0 zoom-in-95 duration-200",
|
|
@@ -2669,51 +2617,51 @@ var DatePicker = React6.forwardRef(
|
|
|
2669
2617
|
alignOffset: -12,
|
|
2670
2618
|
side: "bottom",
|
|
2671
2619
|
sticky: "always",
|
|
2672
|
-
children: /* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-4", children: [
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
2622
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2675
2623
|
"button",
|
|
2676
2624
|
{
|
|
2677
2625
|
onClick: () => handleMonthChange("prev"),
|
|
2678
2626
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2679
|
-
children: /* @__PURE__ */ (0,
|
|
2627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronLeft, { className: "h-4 w-4" })
|
|
2680
2628
|
}
|
|
2681
2629
|
),
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2683
|
-
/* @__PURE__ */ (0,
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2684
2632
|
Select,
|
|
2685
2633
|
{
|
|
2686
2634
|
value: currentMonth.getMonth().toString(),
|
|
2687
2635
|
onValueChange: handleMonthSelect,
|
|
2688
2636
|
children: [
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2690
|
-
/* @__PURE__ */ (0,
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, {}) }),
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectContent, { children: months.map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectItem, { value: index.toString(), children: month }, month)) })
|
|
2691
2639
|
]
|
|
2692
2640
|
}
|
|
2693
2641
|
),
|
|
2694
|
-
/* @__PURE__ */ (0,
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2695
2643
|
Select,
|
|
2696
2644
|
{
|
|
2697
2645
|
value: currentMonth.getFullYear().toString(),
|
|
2698
2646
|
onValueChange: handleYearSelect,
|
|
2699
2647
|
children: [
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2648
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, {}) }),
|
|
2649
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectContent, { children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectItem, { value: year.toString(), children: year }, year)) })
|
|
2702
2650
|
]
|
|
2703
2651
|
}
|
|
2704
2652
|
)
|
|
2705
2653
|
] }),
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2707
2655
|
"button",
|
|
2708
2656
|
{
|
|
2709
2657
|
onClick: () => handleMonthChange("next"),
|
|
2710
2658
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2711
|
-
children: /* @__PURE__ */ (0,
|
|
2659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronRight, { className: "h-4 w-4" })
|
|
2712
2660
|
}
|
|
2713
2661
|
)
|
|
2714
2662
|
] }),
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1", children: [
|
|
2664
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2717
2665
|
Typography,
|
|
2718
2666
|
{
|
|
2719
2667
|
variant: "label-xs-bold",
|
|
@@ -2723,11 +2671,11 @@ var DatePicker = React6.forwardRef(
|
|
|
2723
2671
|
},
|
|
2724
2672
|
day
|
|
2725
2673
|
)) }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2674
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2727
2675
|
"div",
|
|
2728
2676
|
{
|
|
2729
2677
|
className: "h-8 w-8 flex items-center justify-center",
|
|
2730
|
-
children: date && /* @__PURE__ */ (0,
|
|
2678
|
+
children: date && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2731
2679
|
"button",
|
|
2732
2680
|
{
|
|
2733
2681
|
onClick: () => handleDateSelect(date),
|
|
@@ -2741,7 +2689,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2741
2689
|
isToday(date) && !isDateSelected(date) && !isDateDisabled(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full",
|
|
2742
2690
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2743
2691
|
),
|
|
2744
|
-
children: /* @__PURE__ */ (0,
|
|
2692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2745
2693
|
}
|
|
2746
2694
|
)
|
|
2747
2695
|
},
|
|
@@ -2759,9 +2707,9 @@ var DatePicker = React6.forwardRef(
|
|
|
2759
2707
|
DatePicker.displayName = "DatePicker";
|
|
2760
2708
|
|
|
2761
2709
|
// src/components/ui/upload.tsx
|
|
2762
|
-
var
|
|
2710
|
+
var React6 = __toESM(require("react"));
|
|
2763
2711
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2764
|
-
var
|
|
2712
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2765
2713
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2766
2714
|
var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
2767
2715
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -2785,7 +2733,7 @@ var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
|
2785
2733
|
}
|
|
2786
2734
|
}
|
|
2787
2735
|
);
|
|
2788
|
-
var Upload =
|
|
2736
|
+
var Upload = React6.forwardRef(
|
|
2789
2737
|
({
|
|
2790
2738
|
className,
|
|
2791
2739
|
onFileSelect,
|
|
@@ -2798,8 +2746,8 @@ var Upload = React7.forwardRef(
|
|
|
2798
2746
|
selectedFiles = [],
|
|
2799
2747
|
...props
|
|
2800
2748
|
}, ref) => {
|
|
2801
|
-
const fileInputRef =
|
|
2802
|
-
const [isDragOver, setIsDragOver] =
|
|
2749
|
+
const fileInputRef = React6.useRef(null);
|
|
2750
|
+
const [isDragOver, setIsDragOver] = React6.useState(false);
|
|
2803
2751
|
const getFileTypeDisplay = () => {
|
|
2804
2752
|
const typeMap = {
|
|
2805
2753
|
"application/pdf": "PDF",
|
|
@@ -2863,17 +2811,17 @@ var Upload = React7.forwardRef(
|
|
|
2863
2811
|
const renderContent = () => {
|
|
2864
2812
|
switch (effectiveState) {
|
|
2865
2813
|
case "error":
|
|
2866
|
-
return /* @__PURE__ */ (0,
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2867
2815
|
"div",
|
|
2868
2816
|
{
|
|
2869
2817
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2870
2818
|
style: { gap: "32px" },
|
|
2871
2819
|
children: [
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", children: "Upload fail" }),
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2875
2823
|
] }),
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2824
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2877
2825
|
Button,
|
|
2878
2826
|
{
|
|
2879
2827
|
variant: "destructive",
|
|
@@ -2887,22 +2835,22 @@ var Upload = React7.forwardRef(
|
|
|
2887
2835
|
}
|
|
2888
2836
|
);
|
|
2889
2837
|
case "uploading":
|
|
2890
|
-
return /* @__PURE__ */ (0,
|
|
2838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2891
2839
|
"div",
|
|
2892
2840
|
{
|
|
2893
2841
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2894
2842
|
style: { gap: "32px" },
|
|
2895
2843
|
children: [
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2844
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Uploading files" }),
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
2846
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2899
2847
|
"div",
|
|
2900
2848
|
{
|
|
2901
2849
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2902
2850
|
style: { width: `${progress}%` }
|
|
2903
2851
|
}
|
|
2904
2852
|
) }),
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2906
2854
|
Typography,
|
|
2907
2855
|
{
|
|
2908
2856
|
variant: "body-sm",
|
|
@@ -2918,29 +2866,29 @@ var Upload = React7.forwardRef(
|
|
|
2918
2866
|
}
|
|
2919
2867
|
);
|
|
2920
2868
|
case "success":
|
|
2921
|
-
return /* @__PURE__ */ (0,
|
|
2869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2922
2870
|
"div",
|
|
2923
2871
|
{
|
|
2924
2872
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2925
2873
|
style: { gap: "32px" },
|
|
2926
|
-
children: /* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
2928
|
-
selectedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
2874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-success", children: "Upload successful!" }),
|
|
2876
|
+
selectedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "body-sm", children: file.name }, index)) })
|
|
2929
2877
|
] })
|
|
2930
2878
|
}
|
|
2931
2879
|
);
|
|
2932
2880
|
default:
|
|
2933
|
-
return /* @__PURE__ */ (0,
|
|
2881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2934
2882
|
"div",
|
|
2935
2883
|
{
|
|
2936
2884
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2937
2885
|
style: { gap: "32px" },
|
|
2938
2886
|
children: [
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2941
|
-
/* @__PURE__ */ (0,
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2888
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Drag & drop files here" }),
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2942
2890
|
] }),
|
|
2943
|
-
/* @__PURE__ */ (0,
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2944
2892
|
Button,
|
|
2945
2893
|
{
|
|
2946
2894
|
variant: "default",
|
|
@@ -2954,10 +2902,10 @@ var Upload = React7.forwardRef(
|
|
|
2954
2902
|
children: "Choose files"
|
|
2955
2903
|
}
|
|
2956
2904
|
),
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2958
2906
|
"Supported file: ",
|
|
2959
2907
|
getFileTypeDisplay(),
|
|
2960
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("br", {}),
|
|
2961
2909
|
"Max: ",
|
|
2962
2910
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2963
2911
|
" MB each"
|
|
@@ -2967,7 +2915,7 @@ var Upload = React7.forwardRef(
|
|
|
2967
2915
|
);
|
|
2968
2916
|
}
|
|
2969
2917
|
};
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
2918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2971
2919
|
"div",
|
|
2972
2920
|
{
|
|
2973
2921
|
ref,
|
|
@@ -2991,7 +2939,7 @@ var Upload = React7.forwardRef(
|
|
|
2991
2939
|
"aria-disabled": disabled,
|
|
2992
2940
|
...props,
|
|
2993
2941
|
children: [
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2995
2943
|
"input",
|
|
2996
2944
|
{
|
|
2997
2945
|
ref: fileInputRef,
|
|
@@ -3011,39 +2959,38 @@ var Upload = React7.forwardRef(
|
|
|
3011
2959
|
Upload.displayName = "Upload";
|
|
3012
2960
|
|
|
3013
2961
|
// src/components/ui/checkbox.tsx
|
|
3014
|
-
var
|
|
2962
|
+
var React7 = __toESM(require("react"));
|
|
3015
2963
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
3016
2964
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
3017
|
-
var
|
|
2965
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3018
2966
|
var checkboxVariants = (0, import_class_variance_authority7.cva)(
|
|
3019
|
-
"peer size-4 shrink-0 rounded-[4px] border
|
|
2967
|
+
"peer size-4 shrink-0 rounded-[4px] border bg-light hover:bg-info-subtle transition-colors focus-visible:outline-none focus-visible:border-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-light [&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0 border-strong focus-visible:border-interactive aria-invalid:border-error aria-invalid:focus-visible:border-error"
|
|
3020
2968
|
);
|
|
3021
|
-
var Checkbox =
|
|
2969
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3022
2970
|
CheckboxPrimitive.Root,
|
|
3023
2971
|
{
|
|
3024
2972
|
ref,
|
|
3025
2973
|
className: cn(checkboxVariants(), className),
|
|
3026
2974
|
...props,
|
|
3027
|
-
children: /* @__PURE__ */ (0,
|
|
2975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckIcon, { variant: "light", className: "size-3" }) })
|
|
3028
2976
|
}
|
|
3029
2977
|
));
|
|
3030
2978
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
3031
2979
|
|
|
3032
2980
|
// src/components/ui/textarea.tsx
|
|
3033
|
-
var
|
|
3034
|
-
var
|
|
3035
|
-
var Textarea =
|
|
3036
|
-
({ className, style,
|
|
2981
|
+
var React8 = __toESM(require("react"));
|
|
2982
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2983
|
+
var Textarea = React8.forwardRef(
|
|
2984
|
+
({ className, style, ...props }, ref) => {
|
|
3037
2985
|
const tokenStyles = {
|
|
3038
2986
|
font: "var(--typography-label-md-regular)",
|
|
3039
2987
|
...style
|
|
3040
2988
|
};
|
|
3041
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3042
2990
|
"textarea",
|
|
3043
2991
|
{
|
|
3044
2992
|
className: cn(
|
|
3045
|
-
"flex min-h-[80px] w-full rounded-md border bg-light text-dark px-3 pt-3 pb-2 placeholder:text-secondary focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 transition-colors resize-y",
|
|
3046
|
-
error ? "border-error focus-visible:border-2 focus-visible:border-error" : "border-secondary focus-visible:border-2 focus-visible:border-strong disabled:border-secondary",
|
|
2993
|
+
"flex min-h-[80px] w-full rounded-md border bg-light text-dark px-3 pt-3 pb-2 placeholder:text-secondary focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 transition-colors resize-y border-secondary focus-visible:border-2 focus-visible:border-strong disabled:border-secondary aria-invalid:border-error aria-invalid:focus-visible:border-error",
|
|
3047
2994
|
className
|
|
3048
2995
|
),
|
|
3049
2996
|
style: tokenStyles,
|
|
@@ -3056,9 +3003,9 @@ var Textarea = React9.forwardRef(
|
|
|
3056
3003
|
Textarea.displayName = "Textarea";
|
|
3057
3004
|
|
|
3058
3005
|
// src/components/ui/badge.tsx
|
|
3059
|
-
var
|
|
3006
|
+
var React9 = __toESM(require("react"));
|
|
3060
3007
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
3061
|
-
var
|
|
3008
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3062
3009
|
var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
3063
3010
|
"inline-flex items-center justify-center gap-1 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
3064
3011
|
{
|
|
@@ -3081,7 +3028,7 @@ var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
|
3081
3028
|
function getBadgeTypographyStyles() {
|
|
3082
3029
|
return { font: "var(--typography-label-sm-bold)" };
|
|
3083
3030
|
}
|
|
3084
|
-
var Badge =
|
|
3031
|
+
var Badge = React9.forwardRef(
|
|
3085
3032
|
({ className, variant, style, ...props }, ref) => {
|
|
3086
3033
|
if (!variant) {
|
|
3087
3034
|
return null;
|
|
@@ -3091,7 +3038,7 @@ var Badge = React10.forwardRef(
|
|
|
3091
3038
|
...typographyStyles,
|
|
3092
3039
|
...style
|
|
3093
3040
|
};
|
|
3094
|
-
return /* @__PURE__ */ (0,
|
|
3041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3095
3042
|
"span",
|
|
3096
3043
|
{
|
|
3097
3044
|
className: cn(
|
|
@@ -3108,10 +3055,294 @@ var Badge = React10.forwardRef(
|
|
|
3108
3055
|
);
|
|
3109
3056
|
Badge.displayName = "Badge";
|
|
3110
3057
|
|
|
3111
|
-
// src/components/
|
|
3058
|
+
// src/components/pdf-viewer/index.tsx
|
|
3059
|
+
var React14 = __toESM(require("react"));
|
|
3060
|
+
var import_TextLayer = require("react-pdf/dist/Page/TextLayer.css");
|
|
3061
|
+
|
|
3062
|
+
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
3063
|
+
var React10 = __toESM(require("react"));
|
|
3064
|
+
var import_react_pdf = require("react-pdf");
|
|
3065
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3066
|
+
var PdfDocument = ({
|
|
3067
|
+
file,
|
|
3068
|
+
pageWidth,
|
|
3069
|
+
enableTextLayer,
|
|
3070
|
+
onLoadSuccess,
|
|
3071
|
+
onLoadError
|
|
3072
|
+
}) => {
|
|
3073
|
+
const [numPages, setNumPages] = React10.useState();
|
|
3074
|
+
function handleDocumentLoadSuccess({ numPages: numPages2 }) {
|
|
3075
|
+
setNumPages(numPages2);
|
|
3076
|
+
onLoadSuccess?.(numPages2);
|
|
3077
|
+
}
|
|
3078
|
+
if (!file) {
|
|
3079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No PDF available" }) });
|
|
3080
|
+
}
|
|
3081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3082
|
+
import_react_pdf.Document,
|
|
3083
|
+
{
|
|
3084
|
+
file,
|
|
3085
|
+
onLoadSuccess: handleDocumentLoadSuccess,
|
|
3086
|
+
onLoadError,
|
|
3087
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "Rendering PDF..." }) }),
|
|
3088
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Typography, { variant: "body-md", className: "text-error", children: "Failed to render PDF" }) }),
|
|
3089
|
+
className: "flex flex-col items-center p-4",
|
|
3090
|
+
children: numPages && pageWidth > 0 && Array.from(new Array(numPages), (_, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3091
|
+
import_react_pdf.Page,
|
|
3092
|
+
{
|
|
3093
|
+
pageNumber: index + 1,
|
|
3094
|
+
width: pageWidth,
|
|
3095
|
+
className: "mb-4 shadow-sm",
|
|
3096
|
+
renderTextLayer: enableTextLayer,
|
|
3097
|
+
renderAnnotationLayer: false
|
|
3098
|
+
},
|
|
3099
|
+
`page_${index + 1}`
|
|
3100
|
+
))
|
|
3101
|
+
}
|
|
3102
|
+
);
|
|
3103
|
+
};
|
|
3104
|
+
PdfDocument.displayName = "PdfDocument";
|
|
3105
|
+
|
|
3106
|
+
// src/components/pdf-viewer/components/PdfHeader.tsx
|
|
3107
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3108
|
+
var PdfHeader = ({
|
|
3109
|
+
title,
|
|
3110
|
+
onDownload,
|
|
3111
|
+
onPrint
|
|
3112
|
+
}) => {
|
|
3113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 py-3 bg-neutral-400 border-b border-subtle", children: [
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex-shrink min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3115
|
+
Typography,
|
|
3116
|
+
{
|
|
3117
|
+
variant: "label-md-bold",
|
|
3118
|
+
className: "text-dark truncate",
|
|
3119
|
+
title,
|
|
3120
|
+
children: title || "Untitled Document"
|
|
3121
|
+
}
|
|
3122
|
+
) }),
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3125
|
+
"button",
|
|
3126
|
+
{
|
|
3127
|
+
onClick: onDownload,
|
|
3128
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
3129
|
+
"aria-label": "Download PDF",
|
|
3130
|
+
type: "button",
|
|
3131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Download, { variant: "dark", className: "w-5 h-5" })
|
|
3132
|
+
}
|
|
3133
|
+
),
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3135
|
+
"button",
|
|
3136
|
+
{
|
|
3137
|
+
onClick: onPrint,
|
|
3138
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
3139
|
+
"aria-label": "Print PDF",
|
|
3140
|
+
type: "button",
|
|
3141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Print, { variant: "dark", className: "w-5 h-5" })
|
|
3142
|
+
}
|
|
3143
|
+
)
|
|
3144
|
+
] })
|
|
3145
|
+
] });
|
|
3146
|
+
};
|
|
3147
|
+
PdfHeader.displayName = "PdfHeader";
|
|
3148
|
+
|
|
3149
|
+
// src/components/pdf-viewer/hooks/useContainerWidth.ts
|
|
3112
3150
|
var React11 = __toESM(require("react"));
|
|
3151
|
+
function useContainerWidth(padding = 32) {
|
|
3152
|
+
const [containerWidth, setContainerWidth] = React11.useState(0);
|
|
3153
|
+
const containerRef = React11.useRef(null);
|
|
3154
|
+
const lastWidthRef = React11.useRef(0);
|
|
3155
|
+
React11.useEffect(() => {
|
|
3156
|
+
const element = containerRef.current;
|
|
3157
|
+
if (!element) return;
|
|
3158
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
3159
|
+
for (const entry of entries) {
|
|
3160
|
+
const newWidth = entry.contentRect.width - padding;
|
|
3161
|
+
if (Math.abs(newWidth - lastWidthRef.current) > 1) {
|
|
3162
|
+
lastWidthRef.current = newWidth;
|
|
3163
|
+
setContainerWidth(newWidth);
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
});
|
|
3167
|
+
resizeObserver.observe(element);
|
|
3168
|
+
const initialWidth = element.offsetWidth - padding;
|
|
3169
|
+
lastWidthRef.current = initialWidth;
|
|
3170
|
+
setContainerWidth(initialWidth);
|
|
3171
|
+
return () => {
|
|
3172
|
+
resizeObserver.disconnect();
|
|
3173
|
+
};
|
|
3174
|
+
}, [padding]);
|
|
3175
|
+
return { containerWidth, containerRef };
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
// src/components/pdf-viewer/hooks/usePdfDownload.ts
|
|
3179
|
+
var React12 = __toESM(require("react"));
|
|
3180
|
+
function usePdfDownload(file, title) {
|
|
3181
|
+
const download = React12.useCallback(async () => {
|
|
3182
|
+
if (!file) return;
|
|
3183
|
+
try {
|
|
3184
|
+
let blob;
|
|
3185
|
+
let filename;
|
|
3186
|
+
if (typeof file === "string") {
|
|
3187
|
+
const response = await fetch(file);
|
|
3188
|
+
blob = await response.blob();
|
|
3189
|
+
filename = title || "document.pdf";
|
|
3190
|
+
} else {
|
|
3191
|
+
blob = file;
|
|
3192
|
+
filename = title || file.name || "document.pdf";
|
|
3193
|
+
}
|
|
3194
|
+
const url = URL.createObjectURL(blob);
|
|
3195
|
+
const link = document.createElement("a");
|
|
3196
|
+
link.href = url;
|
|
3197
|
+
link.download = filename;
|
|
3198
|
+
link.style.display = "none";
|
|
3199
|
+
document.body.appendChild(link);
|
|
3200
|
+
link.click();
|
|
3201
|
+
setTimeout(() => {
|
|
3202
|
+
document.body.removeChild(link);
|
|
3203
|
+
URL.revokeObjectURL(url);
|
|
3204
|
+
}, 100);
|
|
3205
|
+
} catch (error) {
|
|
3206
|
+
console.error("Failed to download PDF:", error);
|
|
3207
|
+
}
|
|
3208
|
+
}, [file, title]);
|
|
3209
|
+
return download;
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
// src/components/pdf-viewer/hooks/usePdfPrint.ts
|
|
3213
|
+
var React13 = __toESM(require("react"));
|
|
3214
|
+
function usePdfPrint(file) {
|
|
3215
|
+
const [printBlobUrl, setPrintBlobUrl] = React13.useState(null);
|
|
3216
|
+
const printFrameRef = React13.useRef(null);
|
|
3217
|
+
const preparePrint = React13.useCallback(async () => {
|
|
3218
|
+
if (!file) return;
|
|
3219
|
+
try {
|
|
3220
|
+
let blob;
|
|
3221
|
+
if (typeof file === "string") {
|
|
3222
|
+
const response = await fetch(file);
|
|
3223
|
+
blob = await response.blob();
|
|
3224
|
+
} else {
|
|
3225
|
+
blob = file;
|
|
3226
|
+
}
|
|
3227
|
+
const url = URL.createObjectURL(blob);
|
|
3228
|
+
setPrintBlobUrl(url);
|
|
3229
|
+
} catch (error) {
|
|
3230
|
+
console.error("Failed to prepare PDF for printing:", error);
|
|
3231
|
+
}
|
|
3232
|
+
}, [file]);
|
|
3233
|
+
React13.useEffect(() => {
|
|
3234
|
+
return () => {
|
|
3235
|
+
if (printBlobUrl) {
|
|
3236
|
+
URL.revokeObjectURL(printBlobUrl);
|
|
3237
|
+
}
|
|
3238
|
+
};
|
|
3239
|
+
}, [printBlobUrl]);
|
|
3240
|
+
const print = React13.useCallback(() => {
|
|
3241
|
+
if (printFrameRef.current?.contentWindow) {
|
|
3242
|
+
printFrameRef.current.contentWindow.print();
|
|
3243
|
+
}
|
|
3244
|
+
}, []);
|
|
3245
|
+
return { printFrameRef, printBlobUrl, preparePrint, print };
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
// src/components/pdf-viewer/utils/pdfWorker.ts
|
|
3249
|
+
var import_react_pdf2 = require("react-pdf");
|
|
3250
|
+
function initializePdfWorker(workerUrl) {
|
|
3251
|
+
import_react_pdf2.pdfjs.GlobalWorkerOptions.workerSrc = workerUrl;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
// src/components/pdf-viewer/index.tsx
|
|
3255
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3256
|
+
var PdfViewer = React14.forwardRef(
|
|
3257
|
+
({
|
|
3258
|
+
file,
|
|
3259
|
+
title,
|
|
3260
|
+
pageWidth,
|
|
3261
|
+
onDownload,
|
|
3262
|
+
onPrint,
|
|
3263
|
+
onLoadSuccess,
|
|
3264
|
+
onError,
|
|
3265
|
+
enableTextLayer = false,
|
|
3266
|
+
className,
|
|
3267
|
+
...props
|
|
3268
|
+
}, ref) => {
|
|
3269
|
+
const { containerWidth, containerRef } = useContainerWidth();
|
|
3270
|
+
const { printFrameRef, printBlobUrl, preparePrint, print } = usePdfPrint(file);
|
|
3271
|
+
const download = usePdfDownload(file, title);
|
|
3272
|
+
const effectiveWidth = pageWidth || containerWidth;
|
|
3273
|
+
const handleLoadSuccess = React14.useCallback(
|
|
3274
|
+
async (numPages) => {
|
|
3275
|
+
onLoadSuccess?.(numPages);
|
|
3276
|
+
await preparePrint();
|
|
3277
|
+
},
|
|
3278
|
+
[onLoadSuccess, preparePrint]
|
|
3279
|
+
);
|
|
3280
|
+
const handleDownload = React14.useCallback(() => {
|
|
3281
|
+
if (onDownload) {
|
|
3282
|
+
onDownload();
|
|
3283
|
+
return;
|
|
3284
|
+
}
|
|
3285
|
+
download();
|
|
3286
|
+
}, [onDownload, download]);
|
|
3287
|
+
const handlePrint = React14.useCallback(() => {
|
|
3288
|
+
if (onPrint) {
|
|
3289
|
+
onPrint();
|
|
3290
|
+
return;
|
|
3291
|
+
}
|
|
3292
|
+
print();
|
|
3293
|
+
}, [onPrint, print]);
|
|
3294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3295
|
+
"div",
|
|
3296
|
+
{
|
|
3297
|
+
ref,
|
|
3298
|
+
className: cn("h-full flex flex-col", className),
|
|
3299
|
+
...props,
|
|
3300
|
+
children: [
|
|
3301
|
+
printBlobUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3302
|
+
"iframe",
|
|
3303
|
+
{
|
|
3304
|
+
ref: printFrameRef,
|
|
3305
|
+
src: printBlobUrl,
|
|
3306
|
+
style: { display: "none" },
|
|
3307
|
+
title: "PDF for printing"
|
|
3308
|
+
}
|
|
3309
|
+
),
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3311
|
+
PdfHeader,
|
|
3312
|
+
{
|
|
3313
|
+
title,
|
|
3314
|
+
onDownload: handleDownload,
|
|
3315
|
+
onPrint: handlePrint
|
|
3316
|
+
}
|
|
3317
|
+
),
|
|
3318
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3319
|
+
"div",
|
|
3320
|
+
{
|
|
3321
|
+
ref: containerRef,
|
|
3322
|
+
className: "flex-1 overflow-y-auto overflow-x-hidden bg-neutral-300",
|
|
3323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3324
|
+
PdfDocument,
|
|
3325
|
+
{
|
|
3326
|
+
file,
|
|
3327
|
+
pageWidth: effectiveWidth,
|
|
3328
|
+
enableTextLayer,
|
|
3329
|
+
onLoadSuccess: handleLoadSuccess,
|
|
3330
|
+
onLoadError: onError
|
|
3331
|
+
}
|
|
3332
|
+
)
|
|
3333
|
+
}
|
|
3334
|
+
)
|
|
3335
|
+
]
|
|
3336
|
+
}
|
|
3337
|
+
);
|
|
3338
|
+
}
|
|
3339
|
+
);
|
|
3340
|
+
PdfViewer.displayName = "PdfViewer";
|
|
3341
|
+
|
|
3342
|
+
// src/components/ui/tabs.tsx
|
|
3343
|
+
var React15 = __toESM(require("react"));
|
|
3113
3344
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3114
|
-
var
|
|
3345
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3115
3346
|
var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
3116
3347
|
"inline-flex items-center justify-start whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-interactive focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10",
|
|
3117
3348
|
{
|
|
@@ -3125,17 +3356,17 @@ var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3125
3356
|
}
|
|
3126
3357
|
}
|
|
3127
3358
|
);
|
|
3128
|
-
var TabsContext =
|
|
3359
|
+
var TabsContext = React15.createContext(
|
|
3129
3360
|
void 0
|
|
3130
3361
|
);
|
|
3131
3362
|
function useTabsContext() {
|
|
3132
|
-
const context =
|
|
3363
|
+
const context = React15.useContext(TabsContext);
|
|
3133
3364
|
if (!context) {
|
|
3134
3365
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3135
3366
|
}
|
|
3136
3367
|
return context;
|
|
3137
3368
|
}
|
|
3138
|
-
var Tabs =
|
|
3369
|
+
var Tabs = React15.forwardRef((props, ref) => {
|
|
3139
3370
|
const {
|
|
3140
3371
|
className,
|
|
3141
3372
|
value,
|
|
@@ -3144,7 +3375,7 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
3144
3375
|
children,
|
|
3145
3376
|
...restProps
|
|
3146
3377
|
} = props;
|
|
3147
|
-
const contextValue =
|
|
3378
|
+
const contextValue = React15.useMemo(
|
|
3148
3379
|
() => ({
|
|
3149
3380
|
activeTab: value,
|
|
3150
3381
|
setActiveTab: onValueChange,
|
|
@@ -3152,13 +3383,13 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
3152
3383
|
}),
|
|
3153
3384
|
[value, onValueChange, variant]
|
|
3154
3385
|
);
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
3156
3387
|
});
|
|
3157
3388
|
Tabs.displayName = "Tabs";
|
|
3158
|
-
var TabsList =
|
|
3389
|
+
var TabsList = React15.forwardRef(
|
|
3159
3390
|
(props, ref) => {
|
|
3160
3391
|
const { className, children, ...restProps } = props;
|
|
3161
|
-
return /* @__PURE__ */ (0,
|
|
3392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3162
3393
|
"div",
|
|
3163
3394
|
{
|
|
3164
3395
|
ref,
|
|
@@ -3174,7 +3405,7 @@ TabsList.displayName = "TabsList";
|
|
|
3174
3405
|
var getTabTypographyStyles = (isActive) => ({
|
|
3175
3406
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3176
3407
|
});
|
|
3177
|
-
var TabsTrigger =
|
|
3408
|
+
var TabsTrigger = React15.forwardRef(
|
|
3178
3409
|
(props, ref) => {
|
|
3179
3410
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3180
3411
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3182,22 +3413,22 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3182
3413
|
throw new Error("TabsTrigger must have a value prop");
|
|
3183
3414
|
}
|
|
3184
3415
|
const isActive = activeTab === value;
|
|
3185
|
-
const tokenStyles =
|
|
3416
|
+
const tokenStyles = React15.useMemo(
|
|
3186
3417
|
() => ({
|
|
3187
3418
|
...getTabTypographyStyles(isActive),
|
|
3188
3419
|
...style
|
|
3189
3420
|
}),
|
|
3190
3421
|
[isActive, style]
|
|
3191
3422
|
);
|
|
3192
|
-
const triggerClassName =
|
|
3423
|
+
const triggerClassName = React15.useMemo(
|
|
3193
3424
|
() => cn(tabsVariants({ variant }), className),
|
|
3194
3425
|
[variant, className]
|
|
3195
3426
|
);
|
|
3196
|
-
const handleClick =
|
|
3427
|
+
const handleClick = React15.useCallback(() => {
|
|
3197
3428
|
if (disabled) return;
|
|
3198
3429
|
setActiveTab(value);
|
|
3199
3430
|
}, [disabled, setActiveTab, value]);
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3201
3432
|
"button",
|
|
3202
3433
|
{
|
|
3203
3434
|
ref,
|
|
@@ -3211,13 +3442,13 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3211
3442
|
disabled,
|
|
3212
3443
|
onClick: handleClick,
|
|
3213
3444
|
...restProps,
|
|
3214
|
-
children: /* @__PURE__ */ (0,
|
|
3445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "pl-3 pr-6 py-2", children })
|
|
3215
3446
|
}
|
|
3216
3447
|
);
|
|
3217
3448
|
}
|
|
3218
3449
|
);
|
|
3219
3450
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3220
|
-
var TabsContent =
|
|
3451
|
+
var TabsContent = React15.forwardRef(
|
|
3221
3452
|
(props, ref) => {
|
|
3222
3453
|
const { className, value, children, ...restProps } = props;
|
|
3223
3454
|
const { activeTab } = useTabsContext();
|
|
@@ -3228,7 +3459,7 @@ var TabsContent = React11.forwardRef(
|
|
|
3228
3459
|
if (!isActive) {
|
|
3229
3460
|
return null;
|
|
3230
3461
|
}
|
|
3231
|
-
return /* @__PURE__ */ (0,
|
|
3462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3232
3463
|
"div",
|
|
3233
3464
|
{
|
|
3234
3465
|
ref,
|
|
@@ -3246,11 +3477,11 @@ var TabsContent = React11.forwardRef(
|
|
|
3246
3477
|
TabsContent.displayName = "TabsContent";
|
|
3247
3478
|
|
|
3248
3479
|
// src/components/ui/dropdown-menu.tsx
|
|
3249
|
-
var
|
|
3480
|
+
var React16 = __toESM(require("react"));
|
|
3250
3481
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3251
|
-
var
|
|
3482
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3252
3483
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3253
|
-
var DropdownMenuTrigger =
|
|
3484
|
+
var DropdownMenuTrigger = React16.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3254
3485
|
DropdownMenuPrimitive.Trigger,
|
|
3255
3486
|
{
|
|
3256
3487
|
ref,
|
|
@@ -3260,7 +3491,7 @@ var DropdownMenuTrigger = React12.forwardRef(({ className, icon, children, ...pr
|
|
|
3260
3491
|
),
|
|
3261
3492
|
...props,
|
|
3262
3493
|
children: [
|
|
3263
|
-
icon || /* @__PURE__ */ (0,
|
|
3494
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MoreMenu, { className: "size-4" }),
|
|
3264
3495
|
children
|
|
3265
3496
|
]
|
|
3266
3497
|
}
|
|
@@ -3270,7 +3501,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3270
3501
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3271
3502
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3272
3503
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3273
|
-
var DropdownMenuSubTrigger =
|
|
3504
|
+
var DropdownMenuSubTrigger = React16.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3274
3505
|
DropdownMenuPrimitive.SubTrigger,
|
|
3275
3506
|
{
|
|
3276
3507
|
ref,
|
|
@@ -3283,12 +3514,12 @@ var DropdownMenuSubTrigger = React12.forwardRef(({ className, inset, children, .
|
|
|
3283
3514
|
...props,
|
|
3284
3515
|
children: [
|
|
3285
3516
|
children,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronRight, { className: "ml-auto" })
|
|
3287
3518
|
]
|
|
3288
3519
|
}
|
|
3289
3520
|
));
|
|
3290
3521
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3291
|
-
var DropdownMenuSubContent =
|
|
3522
|
+
var DropdownMenuSubContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3292
3523
|
DropdownMenuPrimitive.SubContent,
|
|
3293
3524
|
{
|
|
3294
3525
|
ref,
|
|
@@ -3300,7 +3531,7 @@ var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) =
|
|
|
3300
3531
|
}
|
|
3301
3532
|
));
|
|
3302
3533
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3303
|
-
var DropdownMenuContent =
|
|
3534
|
+
var DropdownMenuContent = React16.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3304
3535
|
DropdownMenuPrimitive.Content,
|
|
3305
3536
|
{
|
|
3306
3537
|
ref,
|
|
@@ -3314,7 +3545,7 @@ var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, align
|
|
|
3314
3545
|
}
|
|
3315
3546
|
) }));
|
|
3316
3547
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3317
|
-
var DropdownMenuItem =
|
|
3548
|
+
var DropdownMenuItem = React16.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3318
3549
|
DropdownMenuPrimitive.Item,
|
|
3319
3550
|
{
|
|
3320
3551
|
ref,
|
|
@@ -3331,7 +3562,7 @@ var DropdownMenuItem = React12.forwardRef(({ className, inset, style, ...props }
|
|
|
3331
3562
|
}
|
|
3332
3563
|
));
|
|
3333
3564
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3334
|
-
var DropdownMenuCheckboxItem =
|
|
3565
|
+
var DropdownMenuCheckboxItem = React16.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3335
3566
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3336
3567
|
{
|
|
3337
3568
|
ref,
|
|
@@ -3346,7 +3577,7 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3346
3577
|
},
|
|
3347
3578
|
...props,
|
|
3348
3579
|
children: [
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3350
3581
|
Checkbox,
|
|
3351
3582
|
{
|
|
3352
3583
|
checked: checked === true,
|
|
@@ -3354,12 +3585,12 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3354
3585
|
"aria-hidden": "true"
|
|
3355
3586
|
}
|
|
3356
3587
|
),
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3588
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex-1", children })
|
|
3358
3589
|
]
|
|
3359
3590
|
}
|
|
3360
3591
|
));
|
|
3361
3592
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3362
|
-
var DropdownMenuRadioItem =
|
|
3593
|
+
var DropdownMenuRadioItem = React16.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3363
3594
|
DropdownMenuPrimitive.RadioItem,
|
|
3364
3595
|
{
|
|
3365
3596
|
ref,
|
|
@@ -3373,13 +3604,13 @@ var DropdownMenuRadioItem = React12.forwardRef(({ className, children, style, ..
|
|
|
3373
3604
|
},
|
|
3374
3605
|
...props,
|
|
3375
3606
|
children: [
|
|
3376
|
-
/* @__PURE__ */ (0,
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3377
3608
|
children
|
|
3378
3609
|
]
|
|
3379
3610
|
}
|
|
3380
3611
|
));
|
|
3381
3612
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3382
|
-
var DropdownMenuLabel =
|
|
3613
|
+
var DropdownMenuLabel = React16.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3383
3614
|
DropdownMenuPrimitive.Label,
|
|
3384
3615
|
{
|
|
3385
3616
|
ref,
|
|
@@ -3392,7 +3623,7 @@ var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3392
3623
|
}
|
|
3393
3624
|
));
|
|
3394
3625
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3395
|
-
var DropdownMenuSeparator =
|
|
3626
|
+
var DropdownMenuSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3396
3627
|
DropdownMenuPrimitive.Separator,
|
|
3397
3628
|
{
|
|
3398
3629
|
ref,
|
|
@@ -3405,7 +3636,7 @@ var DropdownMenuShortcut = ({
|
|
|
3405
3636
|
className,
|
|
3406
3637
|
...props
|
|
3407
3638
|
}) => {
|
|
3408
|
-
return /* @__PURE__ */ (0,
|
|
3639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3409
3640
|
"span",
|
|
3410
3641
|
{
|
|
3411
3642
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3416,21 +3647,21 @@ var DropdownMenuShortcut = ({
|
|
|
3416
3647
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3417
3648
|
|
|
3418
3649
|
// src/components/ui/charts/chart-legend.tsx
|
|
3419
|
-
var
|
|
3650
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3420
3651
|
function ChartLegend({
|
|
3421
3652
|
items,
|
|
3422
3653
|
x = 0,
|
|
3423
3654
|
y = 550,
|
|
3424
3655
|
className = ""
|
|
3425
3656
|
}) {
|
|
3426
|
-
return /* @__PURE__ */ (0,
|
|
3657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3427
3658
|
"div",
|
|
3428
3659
|
{
|
|
3429
3660
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
3430
3661
|
style: { height: "100%" },
|
|
3431
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0,
|
|
3432
|
-
/* @__PURE__ */ (0,
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3662
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Typography, { variant: "body-xs", children: label || key })
|
|
3434
3665
|
] }, key))
|
|
3435
3666
|
}
|
|
3436
3667
|
) });
|
|
@@ -3548,12 +3779,12 @@ var formatLargeNumber = (value) => {
|
|
|
3548
3779
|
};
|
|
3549
3780
|
|
|
3550
3781
|
// src/components/ui/charts/chart-labels.tsx
|
|
3551
|
-
var
|
|
3782
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3552
3783
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
3553
3784
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
3554
3785
|
if (!viewBox) return null;
|
|
3555
3786
|
const { x, y, width } = viewBox;
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3557
3788
|
};
|
|
3558
3789
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
3559
3790
|
return CustomXAxisLabel;
|
|
@@ -3563,7 +3794,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
3563
3794
|
if (!viewBox) return null;
|
|
3564
3795
|
const { x, y, height } = viewBox;
|
|
3565
3796
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
3566
|
-
return /* @__PURE__ */ (0,
|
|
3797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3567
3798
|
};
|
|
3568
3799
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
3569
3800
|
return CustomYAxisLabel;
|
|
@@ -3572,14 +3803,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
3572
3803
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
3573
3804
|
if (!viewBox) return null;
|
|
3574
3805
|
const { x, y, width, height } = viewBox;
|
|
3575
|
-
return /* @__PURE__ */ (0,
|
|
3806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3576
3807
|
};
|
|
3577
3808
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
3578
3809
|
return CustomYAxisRightLabel;
|
|
3579
3810
|
};
|
|
3580
3811
|
var customXAxisTick = (props) => {
|
|
3581
3812
|
const { x, y, payload } = props;
|
|
3582
|
-
return /* @__PURE__ */ (0,
|
|
3813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3583
3814
|
"foreignObject",
|
|
3584
3815
|
{
|
|
3585
3816
|
x: -20,
|
|
@@ -3587,12 +3818,12 @@ var customXAxisTick = (props) => {
|
|
|
3587
3818
|
width: 40,
|
|
3588
3819
|
height: 20,
|
|
3589
3820
|
style: { overflow: "visible" },
|
|
3590
|
-
children: /* @__PURE__ */ (0,
|
|
3821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3591
3822
|
"div",
|
|
3592
3823
|
{
|
|
3593
3824
|
className: "flex items-start justify-center h-full",
|
|
3594
3825
|
style: { overflow: "visible" },
|
|
3595
|
-
children: /* @__PURE__ */ (0,
|
|
3826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3596
3827
|
Typography,
|
|
3597
3828
|
{
|
|
3598
3829
|
variant: "body-xs",
|
|
@@ -3607,7 +3838,7 @@ var customXAxisTick = (props) => {
|
|
|
3607
3838
|
};
|
|
3608
3839
|
var customXAxisTickRotated = (props) => {
|
|
3609
3840
|
const { x, y, payload } = props;
|
|
3610
|
-
return /* @__PURE__ */ (0,
|
|
3841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3611
3842
|
"text",
|
|
3612
3843
|
{
|
|
3613
3844
|
x: 0,
|
|
@@ -3626,25 +3857,25 @@ var customYAxisTick = (props) => {
|
|
|
3626
3857
|
const { x, y, payload } = props;
|
|
3627
3858
|
const text = String(payload.value);
|
|
3628
3859
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
3629
|
-
return /* @__PURE__ */ (0,
|
|
3860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3630
3861
|
"foreignObject",
|
|
3631
3862
|
{
|
|
3632
3863
|
x: x - estimatedWidth + 5,
|
|
3633
3864
|
y: y - 6,
|
|
3634
3865
|
width: estimatedWidth,
|
|
3635
3866
|
height: 15,
|
|
3636
|
-
children: /* @__PURE__ */ (0,
|
|
3867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
3637
3868
|
}
|
|
3638
3869
|
);
|
|
3639
3870
|
};
|
|
3640
3871
|
|
|
3641
3872
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
3642
|
-
var
|
|
3873
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3643
3874
|
function TooltipContainer({
|
|
3644
3875
|
children,
|
|
3645
3876
|
className = ""
|
|
3646
3877
|
}) {
|
|
3647
|
-
return /* @__PURE__ */ (0,
|
|
3878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3648
3879
|
"div",
|
|
3649
3880
|
{
|
|
3650
3881
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -3658,10 +3889,10 @@ function TooltipItem({
|
|
|
3658
3889
|
value,
|
|
3659
3890
|
className = ""
|
|
3660
3891
|
}) {
|
|
3661
|
-
return /* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("br", {}),
|
|
3894
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Typography, { variant: "label-sm", className, children: [
|
|
3895
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3665
3896
|
"span",
|
|
3666
3897
|
{
|
|
3667
3898
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -3679,9 +3910,9 @@ function GenericTooltip({
|
|
|
3679
3910
|
items,
|
|
3680
3911
|
className = ""
|
|
3681
3912
|
}) {
|
|
3682
|
-
return /* @__PURE__ */ (0,
|
|
3683
|
-
title && /* @__PURE__ */ (0,
|
|
3684
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
3913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(TooltipContainer, { className, children: [
|
|
3914
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Typography, { variant: "label-sm-bold", children: title }),
|
|
3915
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3685
3916
|
TooltipItem,
|
|
3686
3917
|
{
|
|
3687
3918
|
color: item.color,
|
|
@@ -3696,7 +3927,7 @@ function GenericTooltip({
|
|
|
3696
3927
|
// src/components/ui/charts/bar-chart.tsx
|
|
3697
3928
|
var import_react2 = require("react");
|
|
3698
3929
|
var import_recharts = require("recharts");
|
|
3699
|
-
var
|
|
3930
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3700
3931
|
var BarChart = (0, import_react2.forwardRef)(
|
|
3701
3932
|
({
|
|
3702
3933
|
data,
|
|
@@ -3723,19 +3954,19 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3723
3954
|
};
|
|
3724
3955
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
3725
3956
|
const hasData = data && data.length > 0;
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3727
3958
|
"div",
|
|
3728
3959
|
{
|
|
3729
3960
|
ref,
|
|
3730
3961
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3731
3962
|
children: [
|
|
3732
|
-
/* @__PURE__ */ (0,
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
3963
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3964
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3734
3965
|
import_recharts.ResponsiveContainer,
|
|
3735
3966
|
{
|
|
3736
3967
|
width: "100%",
|
|
3737
3968
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3738
|
-
children: /* @__PURE__ */ (0,
|
|
3969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3739
3970
|
import_recharts.BarChart,
|
|
3740
3971
|
{
|
|
3741
3972
|
data,
|
|
@@ -3747,7 +3978,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3747
3978
|
onClick: handleClick,
|
|
3748
3979
|
layout,
|
|
3749
3980
|
children: [
|
|
3750
|
-
/* @__PURE__ */ (0,
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3751
3982
|
import_recharts.XAxis,
|
|
3752
3983
|
{
|
|
3753
3984
|
dataKey: xAxisKey,
|
|
@@ -3761,7 +3992,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3761
3992
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
3762
3993
|
}
|
|
3763
3994
|
),
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3995
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3765
3996
|
import_recharts.YAxis,
|
|
3766
3997
|
{
|
|
3767
3998
|
axisLine: false,
|
|
@@ -3772,7 +4003,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3772
4003
|
type: yAxisType
|
|
3773
4004
|
}
|
|
3774
4005
|
),
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3776
4007
|
import_recharts.Tooltip,
|
|
3777
4008
|
{
|
|
3778
4009
|
content: ({
|
|
@@ -3781,7 +4012,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3781
4012
|
label
|
|
3782
4013
|
}) => {
|
|
3783
4014
|
if (active && payload && payload.length) {
|
|
3784
|
-
return /* @__PURE__ */ (0,
|
|
4015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3785
4016
|
GenericTooltip,
|
|
3786
4017
|
{
|
|
3787
4018
|
title: label?.toString(),
|
|
@@ -3797,7 +4028,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3797
4028
|
}
|
|
3798
4029
|
}
|
|
3799
4030
|
),
|
|
3800
|
-
/* @__PURE__ */ (0,
|
|
4031
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3801
4032
|
import_recharts.Bar,
|
|
3802
4033
|
{
|
|
3803
4034
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -3805,12 +4036,12 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3805
4036
|
name: barDataKey || yAxisKey
|
|
3806
4037
|
}
|
|
3807
4038
|
),
|
|
3808
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4039
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3809
4040
|
]
|
|
3810
4041
|
}
|
|
3811
4042
|
)
|
|
3812
4043
|
}
|
|
3813
|
-
) : /* @__PURE__ */ (0,
|
|
4044
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3814
4045
|
]
|
|
3815
4046
|
}
|
|
3816
4047
|
);
|
|
@@ -3821,7 +4052,7 @@ BarChart.displayName = "BarChart";
|
|
|
3821
4052
|
// src/components/ui/charts/line-chart.tsx
|
|
3822
4053
|
var import_react3 = require("react");
|
|
3823
4054
|
var import_recharts2 = require("recharts");
|
|
3824
|
-
var
|
|
4055
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3825
4056
|
var LineChart = (0, import_react3.forwardRef)(
|
|
3826
4057
|
({
|
|
3827
4058
|
data,
|
|
@@ -3850,19 +4081,19 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3850
4081
|
)
|
|
3851
4082
|
);
|
|
3852
4083
|
const hasData = data && data.length > 0;
|
|
3853
|
-
return /* @__PURE__ */ (0,
|
|
4084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3854
4085
|
"div",
|
|
3855
4086
|
{
|
|
3856
4087
|
ref,
|
|
3857
4088
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3858
4089
|
children: [
|
|
3859
|
-
/* @__PURE__ */ (0,
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
4090
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3861
4092
|
import_recharts2.ResponsiveContainer,
|
|
3862
4093
|
{
|
|
3863
4094
|
width: "100%",
|
|
3864
4095
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3865
|
-
children: /* @__PURE__ */ (0,
|
|
4096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3866
4097
|
import_recharts2.LineChart,
|
|
3867
4098
|
{
|
|
3868
4099
|
data,
|
|
@@ -3873,7 +4104,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3873
4104
|
},
|
|
3874
4105
|
onClick: handleClick,
|
|
3875
4106
|
children: [
|
|
3876
|
-
/* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3877
4108
|
import_recharts2.XAxis,
|
|
3878
4109
|
{
|
|
3879
4110
|
dataKey: xAxisKey,
|
|
@@ -3885,7 +4116,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3885
4116
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
3886
4117
|
}
|
|
3887
4118
|
),
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
4119
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3889
4120
|
import_recharts2.YAxis,
|
|
3890
4121
|
{
|
|
3891
4122
|
axisLine: false,
|
|
@@ -3894,7 +4125,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3894
4125
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
3895
4126
|
}
|
|
3896
4127
|
),
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3898
4129
|
import_recharts2.Tooltip,
|
|
3899
4130
|
{
|
|
3900
4131
|
content: ({
|
|
@@ -3903,7 +4134,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3903
4134
|
label
|
|
3904
4135
|
}) => {
|
|
3905
4136
|
if (active && payload && payload.length) {
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
4137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3907
4138
|
GenericTooltip,
|
|
3908
4139
|
{
|
|
3909
4140
|
title: label?.toString(),
|
|
@@ -3919,7 +4150,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3919
4150
|
}
|
|
3920
4151
|
}
|
|
3921
4152
|
),
|
|
3922
|
-
series.map((s, index) => /* @__PURE__ */ (0,
|
|
4153
|
+
series.map((s, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3923
4154
|
import_recharts2.Line,
|
|
3924
4155
|
{
|
|
3925
4156
|
type: "monotone",
|
|
@@ -3931,12 +4162,12 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3931
4162
|
},
|
|
3932
4163
|
s.dataKey
|
|
3933
4164
|
)),
|
|
3934
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4165
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3935
4166
|
]
|
|
3936
4167
|
}
|
|
3937
4168
|
)
|
|
3938
4169
|
}
|
|
3939
|
-
) : /* @__PURE__ */ (0,
|
|
4170
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3940
4171
|
]
|
|
3941
4172
|
}
|
|
3942
4173
|
);
|
|
@@ -3947,7 +4178,7 @@ LineChart.displayName = "LineChart";
|
|
|
3947
4178
|
// src/components/ui/charts/pie-chart.tsx
|
|
3948
4179
|
var import_react4 = require("react");
|
|
3949
4180
|
var import_recharts3 = require("recharts");
|
|
3950
|
-
var
|
|
4181
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3951
4182
|
var PieChart = (0, import_react4.forwardRef)(
|
|
3952
4183
|
({
|
|
3953
4184
|
data,
|
|
@@ -3975,20 +4206,20 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3975
4206
|
)
|
|
3976
4207
|
);
|
|
3977
4208
|
const hasData = data && data.length > 0;
|
|
3978
|
-
return /* @__PURE__ */ (0,
|
|
4209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3979
4210
|
"div",
|
|
3980
4211
|
{
|
|
3981
4212
|
ref,
|
|
3982
4213
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3983
4214
|
children: [
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
4215
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3986
4217
|
import_recharts3.PieChart,
|
|
3987
4218
|
{
|
|
3988
4219
|
width: 600,
|
|
3989
4220
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
3990
4221
|
children: [
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3992
4223
|
import_recharts3.Pie,
|
|
3993
4224
|
{
|
|
3994
4225
|
data,
|
|
@@ -4000,7 +4231,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4000
4231
|
label: showLabels,
|
|
4001
4232
|
labelLine: false,
|
|
4002
4233
|
onClick: handleClick,
|
|
4003
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
4234
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4004
4235
|
import_recharts3.Cell,
|
|
4005
4236
|
{
|
|
4006
4237
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -4009,7 +4240,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4009
4240
|
))
|
|
4010
4241
|
}
|
|
4011
4242
|
),
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4013
4244
|
import_recharts3.Tooltip,
|
|
4014
4245
|
{
|
|
4015
4246
|
content: ({
|
|
@@ -4018,7 +4249,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4018
4249
|
}) => {
|
|
4019
4250
|
if (active && payload && payload.length && payload[0]) {
|
|
4020
4251
|
const data2 = payload[0].payload;
|
|
4021
|
-
return /* @__PURE__ */ (0,
|
|
4252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4022
4253
|
GenericTooltip,
|
|
4023
4254
|
{
|
|
4024
4255
|
title: data2.name,
|
|
@@ -4036,10 +4267,10 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4036
4267
|
}
|
|
4037
4268
|
}
|
|
4038
4269
|
),
|
|
4039
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4270
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
4040
4271
|
]
|
|
4041
4272
|
}
|
|
4042
|
-
) }) : /* @__PURE__ */ (0,
|
|
4273
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4043
4274
|
]
|
|
4044
4275
|
}
|
|
4045
4276
|
);
|
|
@@ -4050,7 +4281,7 @@ PieChart.displayName = "PieChart";
|
|
|
4050
4281
|
// src/components/ui/table.tsx
|
|
4051
4282
|
var import_react5 = require("react");
|
|
4052
4283
|
var import_react_table = require("@tanstack/react-table");
|
|
4053
|
-
var
|
|
4284
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4054
4285
|
function Table({
|
|
4055
4286
|
table,
|
|
4056
4287
|
className,
|
|
@@ -4080,15 +4311,15 @@ function Table({
|
|
|
4080
4311
|
},
|
|
4081
4312
|
[table]
|
|
4082
4313
|
);
|
|
4083
|
-
return /* @__PURE__ */ (0,
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("table", { className: "min-w-full divide-y divide-border", children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4086
4317
|
"div",
|
|
4087
4318
|
{
|
|
4088
4319
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
4089
4320
|
onClick: header.column.getToggleSortingHandler(),
|
|
4090
4321
|
children: [
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4092
4323
|
Typography,
|
|
4093
4324
|
{
|
|
4094
4325
|
variant: "label-xs",
|
|
@@ -4099,19 +4330,19 @@ function Table({
|
|
|
4099
4330
|
)
|
|
4100
4331
|
}
|
|
4101
4332
|
),
|
|
4102
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
4103
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0,
|
|
4104
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0,
|
|
4333
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "ml-1", children: [
|
|
4334
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronUp, { className: "w-4 h-4 text-light" }),
|
|
4335
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronDown, { className: "w-4 h-4 text-light" })
|
|
4105
4336
|
] })
|
|
4106
4337
|
]
|
|
4107
4338
|
}
|
|
4108
4339
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4109
|
-
/* @__PURE__ */ (0,
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-sm", children: (0, import_react_table.flexRender)(
|
|
4110
4341
|
cell.column.columnDef.cell,
|
|
4111
4342
|
cell.getContext()
|
|
4112
4343
|
) }) }, cell.id)) }, row.id)) })
|
|
4113
4344
|
] }) }),
|
|
4114
|
-
showPagination && /* @__PURE__ */ (0,
|
|
4345
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4115
4346
|
"div",
|
|
4116
4347
|
{
|
|
4117
4348
|
className: cn(
|
|
@@ -4119,9 +4350,9 @@ function Table({
|
|
|
4119
4350
|
paginationClassName
|
|
4120
4351
|
),
|
|
4121
4352
|
children: [
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
4354
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4125
4356
|
Button,
|
|
4126
4357
|
{
|
|
4127
4358
|
variant: "ghost",
|
|
@@ -4129,7 +4360,7 @@ function Table({
|
|
|
4129
4360
|
onClick: handlePreviousPage,
|
|
4130
4361
|
disabled: !table.getCanPreviousPage(),
|
|
4131
4362
|
className: "p-2",
|
|
4132
|
-
children: /* @__PURE__ */ (0,
|
|
4363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronLeft, { className: "w-4 h-4" })
|
|
4133
4364
|
}
|
|
4134
4365
|
),
|
|
4135
4366
|
Array.from(
|
|
@@ -4146,7 +4377,7 @@ function Table({
|
|
|
4146
4377
|
pageNumber = currentPage - 2 + i;
|
|
4147
4378
|
}
|
|
4148
4379
|
const isActive = pageNumber === currentPage;
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
4380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4150
4381
|
Button,
|
|
4151
4382
|
{
|
|
4152
4383
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4159,11 +4390,11 @@ function Table({
|
|
|
4159
4390
|
);
|
|
4160
4391
|
}
|
|
4161
4392
|
),
|
|
4162
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0,
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4393
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4394
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "px-1 text-secondary", children: "..." }),
|
|
4395
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4165
4396
|
] }),
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4397
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4167
4398
|
Button,
|
|
4168
4399
|
{
|
|
4169
4400
|
variant: "ghost",
|
|
@@ -4171,12 +4402,12 @@ function Table({
|
|
|
4171
4402
|
onClick: handleNextPage,
|
|
4172
4403
|
disabled: !table.getCanNextPage(),
|
|
4173
4404
|
className: "p-2",
|
|
4174
|
-
children: /* @__PURE__ */ (0,
|
|
4405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronRight, { className: "w-4 h-4" })
|
|
4175
4406
|
}
|
|
4176
4407
|
)
|
|
4177
4408
|
] }),
|
|
4178
|
-
/* @__PURE__ */ (0,
|
|
4179
|
-
/* @__PURE__ */ (0,
|
|
4409
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-3 w-48", children: [
|
|
4410
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4180
4411
|
Typography,
|
|
4181
4412
|
{
|
|
4182
4413
|
variant: "body-sm",
|
|
@@ -4184,14 +4415,14 @@ function Table({
|
|
|
4184
4415
|
children: "Rows per page:"
|
|
4185
4416
|
}
|
|
4186
4417
|
),
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4418
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4188
4419
|
Select,
|
|
4189
4420
|
{
|
|
4190
4421
|
value: table.getState().pagination.pageSize.toString(),
|
|
4191
4422
|
onValueChange: handlePageSizeChange,
|
|
4192
4423
|
children: [
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, {}) }),
|
|
4425
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4195
4426
|
]
|
|
4196
4427
|
}
|
|
4197
4428
|
)
|
|
@@ -4238,6 +4469,7 @@ function Table({
|
|
|
4238
4469
|
DatePicker,
|
|
4239
4470
|
Doc,
|
|
4240
4471
|
Dollar,
|
|
4472
|
+
Download,
|
|
4241
4473
|
DropdownMenu,
|
|
4242
4474
|
DropdownMenuCheckboxItem,
|
|
4243
4475
|
DropdownMenuContent,
|
|
@@ -4270,7 +4502,6 @@ function Table({
|
|
|
4270
4502
|
FieldTitle,
|
|
4271
4503
|
Filter,
|
|
4272
4504
|
FilterDescending,
|
|
4273
|
-
FormField,
|
|
4274
4505
|
GenericTooltip,
|
|
4275
4506
|
GraphBar,
|
|
4276
4507
|
GraphDonut,
|
|
@@ -4288,9 +4519,11 @@ function Table({
|
|
|
4288
4519
|
MagnifyingGlass,
|
|
4289
4520
|
Minus,
|
|
4290
4521
|
MoreMenu,
|
|
4522
|
+
PdfViewer,
|
|
4291
4523
|
Phone,
|
|
4292
4524
|
PieChart,
|
|
4293
4525
|
Plus,
|
|
4526
|
+
Print,
|
|
4294
4527
|
QuestionCircle,
|
|
4295
4528
|
Select,
|
|
4296
4529
|
SelectContent,
|
|
@@ -4339,6 +4572,7 @@ function Table({
|
|
|
4339
4572
|
getHeatmapColor,
|
|
4340
4573
|
getPerformanceColor,
|
|
4341
4574
|
getSeriesColor,
|
|
4575
|
+
initializePdfWorker,
|
|
4342
4576
|
selectTriggerVariants,
|
|
4343
4577
|
tabsVariants,
|
|
4344
4578
|
typographyVariants,
|