@northslopetech/altitude-ui 2.1.2 → 2.3.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 +4 -28
- package/dist/index.d.ts +4 -28
- package/dist/index.js +223 -329
- package/dist/index.mjs +229 -334
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -97,7 +97,6 @@ __export(index_exports, {
|
|
|
97
97
|
FieldTitle: () => FieldTitle,
|
|
98
98
|
Filter: () => Filter,
|
|
99
99
|
FilterDescending: () => FilterDescending,
|
|
100
|
-
FormField: () => FormField,
|
|
101
100
|
GenericTooltip: () => GenericTooltip,
|
|
102
101
|
GraphBar: () => GraphBar,
|
|
103
102
|
GraphDonut: () => GraphDonut,
|
|
@@ -1829,7 +1828,7 @@ var Logout = ({
|
|
|
1829
1828
|
// src/components/ui/select.tsx
|
|
1830
1829
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1831
1830
|
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",
|
|
1831
|
+
"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
1832
|
{
|
|
1834
1833
|
variants: {
|
|
1835
1834
|
width: {
|
|
@@ -1874,7 +1873,7 @@ var SelectTrigger = React3.forwardRef(({ className, children, style, width, ...p
|
|
|
1874
1873
|
ref,
|
|
1875
1874
|
className: cn(
|
|
1876
1875
|
selectTriggerVariants({ width }),
|
|
1877
|
-
"
|
|
1876
|
+
"data-[state=open]:[&_svg]:rotate-180 data-[placeholder]:text-secondary h-10 py-2",
|
|
1878
1877
|
className
|
|
1879
1878
|
),
|
|
1880
1879
|
style: tokenStyles,
|
|
@@ -1985,121 +1984,18 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1985
1984
|
));
|
|
1986
1985
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1987
1986
|
|
|
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
1987
|
// src/components/ui/field.tsx
|
|
2092
1988
|
var import_react = require("react");
|
|
2093
1989
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2094
1990
|
|
|
2095
1991
|
// src/components/ui/label.tsx
|
|
2096
1992
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
2097
|
-
var
|
|
1993
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2098
1994
|
function Label2({
|
|
2099
1995
|
className,
|
|
2100
1996
|
...props
|
|
2101
1997
|
}) {
|
|
2102
|
-
return /* @__PURE__ */ (0,
|
|
1998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2103
1999
|
LabelPrimitive.Root,
|
|
2104
2000
|
{
|
|
2105
2001
|
"data-slot": "label",
|
|
@@ -2114,14 +2010,14 @@ function Label2({
|
|
|
2114
2010
|
|
|
2115
2011
|
// src/components/ui/separator.tsx
|
|
2116
2012
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
2117
|
-
var
|
|
2013
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2118
2014
|
function Separator2({
|
|
2119
2015
|
className,
|
|
2120
2016
|
orientation = "horizontal",
|
|
2121
2017
|
decorative = true,
|
|
2122
2018
|
...props
|
|
2123
2019
|
}) {
|
|
2124
|
-
return /* @__PURE__ */ (0,
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2125
2021
|
SeparatorPrimitive.Root,
|
|
2126
2022
|
{
|
|
2127
2023
|
"data-slot": "separator",
|
|
@@ -2137,9 +2033,9 @@ function Separator2({
|
|
|
2137
2033
|
}
|
|
2138
2034
|
|
|
2139
2035
|
// src/components/ui/field.tsx
|
|
2140
|
-
var
|
|
2036
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2141
2037
|
function FieldSet({ className, ...props }) {
|
|
2142
|
-
return /* @__PURE__ */ (0,
|
|
2038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2143
2039
|
"fieldset",
|
|
2144
2040
|
{
|
|
2145
2041
|
"data-slot": "field-set",
|
|
@@ -2157,7 +2053,7 @@ function FieldLegend({
|
|
|
2157
2053
|
variant = "legend",
|
|
2158
2054
|
...props
|
|
2159
2055
|
}) {
|
|
2160
|
-
return /* @__PURE__ */ (0,
|
|
2056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2161
2057
|
"legend",
|
|
2162
2058
|
{
|
|
2163
2059
|
"data-slot": "field-legend",
|
|
@@ -2173,7 +2069,7 @@ function FieldLegend({
|
|
|
2173
2069
|
);
|
|
2174
2070
|
}
|
|
2175
2071
|
function FieldGroup({ className, ...props }) {
|
|
2176
|
-
return /* @__PURE__ */ (0,
|
|
2072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2177
2073
|
"div",
|
|
2178
2074
|
{
|
|
2179
2075
|
"data-slot": "field-group",
|
|
@@ -2213,7 +2109,7 @@ function Field({
|
|
|
2213
2109
|
orientation = "vertical",
|
|
2214
2110
|
...props
|
|
2215
2111
|
}) {
|
|
2216
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2217
2113
|
"div",
|
|
2218
2114
|
{
|
|
2219
2115
|
role: "group",
|
|
@@ -2225,7 +2121,7 @@ function Field({
|
|
|
2225
2121
|
);
|
|
2226
2122
|
}
|
|
2227
2123
|
function FieldContent({ className, ...props }) {
|
|
2228
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2229
2125
|
"div",
|
|
2230
2126
|
{
|
|
2231
2127
|
"data-slot": "field-content",
|
|
@@ -2241,7 +2137,7 @@ function FieldLabel({
|
|
|
2241
2137
|
className,
|
|
2242
2138
|
...props
|
|
2243
2139
|
}) {
|
|
2244
|
-
return /* @__PURE__ */ (0,
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2245
2141
|
Label2,
|
|
2246
2142
|
{
|
|
2247
2143
|
"data-slot": "field-label",
|
|
@@ -2256,7 +2152,7 @@ function FieldLabel({
|
|
|
2256
2152
|
);
|
|
2257
2153
|
}
|
|
2258
2154
|
function FieldTitle({ className, ...props }) {
|
|
2259
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2260
2156
|
"div",
|
|
2261
2157
|
{
|
|
2262
2158
|
"data-slot": "field-label",
|
|
@@ -2269,7 +2165,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
2269
2165
|
);
|
|
2270
2166
|
}
|
|
2271
2167
|
function FieldDescription({ className, ...props }) {
|
|
2272
|
-
return /* @__PURE__ */ (0,
|
|
2168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2273
2169
|
"p",
|
|
2274
2170
|
{
|
|
2275
2171
|
"data-slot": "field-description",
|
|
@@ -2288,7 +2184,7 @@ function FieldSeparator({
|
|
|
2288
2184
|
className,
|
|
2289
2185
|
...props
|
|
2290
2186
|
}) {
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2292
2188
|
"div",
|
|
2293
2189
|
{
|
|
2294
2190
|
"data-slot": "field-separator",
|
|
@@ -2299,8 +2195,8 @@ function FieldSeparator({
|
|
|
2299
2195
|
),
|
|
2300
2196
|
...props,
|
|
2301
2197
|
children: [
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2303
|
-
children && /* @__PURE__ */ (0,
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
2199
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2304
2200
|
"span",
|
|
2305
2201
|
{
|
|
2306
2202
|
className: "bg-light text-secondary relative mx-auto block w-fit px-2",
|
|
@@ -2328,14 +2224,14 @@ function FieldError({
|
|
|
2328
2224
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
2329
2225
|
return errors[0].message;
|
|
2330
2226
|
}
|
|
2331
|
-
return /* @__PURE__ */ (0,
|
|
2332
|
-
(error, index) => error?.message && /* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
2228
|
+
(error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: error.message }, index)
|
|
2333
2229
|
) });
|
|
2334
2230
|
}, [children, errors]);
|
|
2335
2231
|
if (!content) {
|
|
2336
2232
|
return null;
|
|
2337
2233
|
}
|
|
2338
|
-
return /* @__PURE__ */ (0,
|
|
2234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2339
2235
|
"div",
|
|
2340
2236
|
{
|
|
2341
2237
|
role: "alert",
|
|
@@ -2348,14 +2244,14 @@ function FieldError({
|
|
|
2348
2244
|
}
|
|
2349
2245
|
|
|
2350
2246
|
// src/components/ui/date-picker.tsx
|
|
2351
|
-
var
|
|
2247
|
+
var React5 = __toESM(require("react"));
|
|
2352
2248
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2353
2249
|
|
|
2354
2250
|
// 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 =
|
|
2251
|
+
var React4 = __toESM(require("react"));
|
|
2252
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2253
|
+
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";
|
|
2254
|
+
var Input = React4.forwardRef(
|
|
2359
2255
|
({
|
|
2360
2256
|
className,
|
|
2361
2257
|
style,
|
|
@@ -2366,7 +2262,7 @@ var Input = React5.forwardRef(
|
|
|
2366
2262
|
readOnly,
|
|
2367
2263
|
...props
|
|
2368
2264
|
}, ref) => {
|
|
2369
|
-
const [internalValue, setInternalValue] =
|
|
2265
|
+
const [internalValue, setInternalValue] = React4.useState(value || "");
|
|
2370
2266
|
const isControlled = value !== void 0;
|
|
2371
2267
|
const currentValue = isControlled ? value : internalValue;
|
|
2372
2268
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -2396,8 +2292,8 @@ var Input = React5.forwardRef(
|
|
|
2396
2292
|
}
|
|
2397
2293
|
onClear?.();
|
|
2398
2294
|
};
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2401
2297
|
"input",
|
|
2402
2298
|
{
|
|
2403
2299
|
className: cn(
|
|
@@ -2413,23 +2309,23 @@ var Input = React5.forwardRef(
|
|
|
2413
2309
|
...props
|
|
2414
2310
|
}
|
|
2415
2311
|
),
|
|
2416
|
-
showClear && /* @__PURE__ */ (0,
|
|
2312
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2417
2313
|
"button",
|
|
2418
2314
|
{
|
|
2419
2315
|
type: "button",
|
|
2420
2316
|
onClick: handleClear,
|
|
2421
2317
|
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,
|
|
2318
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(X, { className: "h-4 w-4" })
|
|
2423
2319
|
}
|
|
2424
2320
|
),
|
|
2425
|
-
showLock && /* @__PURE__ */ (0,
|
|
2321
|
+
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
2322
|
] });
|
|
2427
2323
|
}
|
|
2428
2324
|
);
|
|
2429
2325
|
Input.displayName = "Input";
|
|
2430
2326
|
|
|
2431
2327
|
// src/components/ui/date-picker.tsx
|
|
2432
|
-
var
|
|
2328
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2433
2329
|
var getDayNames = () => {
|
|
2434
2330
|
const days = [];
|
|
2435
2331
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2465,7 +2361,7 @@ var formatDateInput = (date) => {
|
|
|
2465
2361
|
day: "2-digit"
|
|
2466
2362
|
});
|
|
2467
2363
|
};
|
|
2468
|
-
var DatePicker =
|
|
2364
|
+
var DatePicker = React5.forwardRef(
|
|
2469
2365
|
({
|
|
2470
2366
|
value,
|
|
2471
2367
|
onValueChange,
|
|
@@ -2484,19 +2380,19 @@ var DatePicker = React6.forwardRef(
|
|
|
2484
2380
|
if (isNaN(parsed.getTime())) return void 0;
|
|
2485
2381
|
return parsed;
|
|
2486
2382
|
};
|
|
2487
|
-
const [selectedDate, setSelectedDate] =
|
|
2383
|
+
const [selectedDate, setSelectedDate] = React5.useState(
|
|
2488
2384
|
value || parseDate(defaultValue)
|
|
2489
2385
|
);
|
|
2490
|
-
const [currentMonth, setCurrentMonth] =
|
|
2386
|
+
const [currentMonth, setCurrentMonth] = React5.useState(() => {
|
|
2491
2387
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
2492
2388
|
return new Date(date.getFullYear(), date.getMonth());
|
|
2493
2389
|
});
|
|
2494
|
-
const [open, setOpen] =
|
|
2495
|
-
const [inputValue, setInputValue] =
|
|
2390
|
+
const [open, setOpen] = React5.useState(false);
|
|
2391
|
+
const [inputValue, setInputValue] = React5.useState(() => {
|
|
2496
2392
|
const initialDate = value || parseDate(defaultValue);
|
|
2497
2393
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
2498
2394
|
});
|
|
2499
|
-
|
|
2395
|
+
React5.useEffect(() => {
|
|
2500
2396
|
setSelectedDate(value);
|
|
2501
2397
|
if (value) {
|
|
2502
2398
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -2507,7 +2403,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2507
2403
|
setInputValue("");
|
|
2508
2404
|
}
|
|
2509
2405
|
}, [value]);
|
|
2510
|
-
|
|
2406
|
+
React5.useEffect(() => {
|
|
2511
2407
|
if (value) return;
|
|
2512
2408
|
const parsedDefault = parseDate(defaultValue);
|
|
2513
2409
|
if (!parsedDefault) return;
|
|
@@ -2630,14 +2526,14 @@ var DatePicker = React6.forwardRef(
|
|
|
2630
2526
|
const months = getMonthNames();
|
|
2631
2527
|
const dayNames = getDayNames();
|
|
2632
2528
|
const years = generateYears();
|
|
2633
|
-
return /* @__PURE__ */ (0,
|
|
2529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2634
2530
|
PopoverPrimitive.Root,
|
|
2635
2531
|
{
|
|
2636
2532
|
open: disabled ? false : open,
|
|
2637
2533
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
2638
2534
|
children: [
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2641
2537
|
Input,
|
|
2642
2538
|
{
|
|
2643
2539
|
ref,
|
|
@@ -2650,7 +2546,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2650
2546
|
...props
|
|
2651
2547
|
}
|
|
2652
2548
|
),
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2549
|
+
/* @__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
2550
|
Calendar,
|
|
2655
2551
|
{
|
|
2656
2552
|
className: cn(
|
|
@@ -2660,7 +2556,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2660
2556
|
}
|
|
2661
2557
|
) }) })
|
|
2662
2558
|
] }),
|
|
2663
|
-
/* @__PURE__ */ (0,
|
|
2559
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2664
2560
|
PopoverPrimitive.Content,
|
|
2665
2561
|
{
|
|
2666
2562
|
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 +2565,51 @@ var DatePicker = React6.forwardRef(
|
|
|
2669
2565
|
alignOffset: -12,
|
|
2670
2566
|
side: "bottom",
|
|
2671
2567
|
sticky: "always",
|
|
2672
|
-
children: /* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-4", children: [
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2675
2571
|
"button",
|
|
2676
2572
|
{
|
|
2677
2573
|
onClick: () => handleMonthChange("prev"),
|
|
2678
2574
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2679
|
-
children: /* @__PURE__ */ (0,
|
|
2575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronLeft, { className: "h-4 w-4" })
|
|
2680
2576
|
}
|
|
2681
2577
|
),
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2683
|
-
/* @__PURE__ */ (0,
|
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
2579
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2684
2580
|
Select,
|
|
2685
2581
|
{
|
|
2686
2582
|
value: currentMonth.getMonth().toString(),
|
|
2687
2583
|
onValueChange: handleMonthSelect,
|
|
2688
2584
|
children: [
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2690
|
-
/* @__PURE__ */ (0,
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, {}) }),
|
|
2586
|
+
/* @__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
2587
|
]
|
|
2692
2588
|
}
|
|
2693
2589
|
),
|
|
2694
|
-
/* @__PURE__ */ (0,
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2695
2591
|
Select,
|
|
2696
2592
|
{
|
|
2697
2593
|
value: currentMonth.getFullYear().toString(),
|
|
2698
2594
|
onValueChange: handleYearSelect,
|
|
2699
2595
|
children: [
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, {}) }),
|
|
2597
|
+
/* @__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
2598
|
]
|
|
2703
2599
|
}
|
|
2704
2600
|
)
|
|
2705
2601
|
] }),
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2707
2603
|
"button",
|
|
2708
2604
|
{
|
|
2709
2605
|
onClick: () => handleMonthChange("next"),
|
|
2710
2606
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2711
|
-
children: /* @__PURE__ */ (0,
|
|
2607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronRight, { className: "h-4 w-4" })
|
|
2712
2608
|
}
|
|
2713
2609
|
)
|
|
2714
2610
|
] }),
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1", children: [
|
|
2612
|
+
/* @__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
2613
|
Typography,
|
|
2718
2614
|
{
|
|
2719
2615
|
variant: "label-xs-bold",
|
|
@@ -2723,11 +2619,11 @@ var DatePicker = React6.forwardRef(
|
|
|
2723
2619
|
},
|
|
2724
2620
|
day
|
|
2725
2621
|
)) }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2622
|
+
/* @__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
2623
|
"div",
|
|
2728
2624
|
{
|
|
2729
2625
|
className: "h-8 w-8 flex items-center justify-center",
|
|
2730
|
-
children: date && /* @__PURE__ */ (0,
|
|
2626
|
+
children: date && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2731
2627
|
"button",
|
|
2732
2628
|
{
|
|
2733
2629
|
onClick: () => handleDateSelect(date),
|
|
@@ -2741,7 +2637,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2741
2637
|
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
2638
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2743
2639
|
),
|
|
2744
|
-
children: /* @__PURE__ */ (0,
|
|
2640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2745
2641
|
}
|
|
2746
2642
|
)
|
|
2747
2643
|
},
|
|
@@ -2759,9 +2655,9 @@ var DatePicker = React6.forwardRef(
|
|
|
2759
2655
|
DatePicker.displayName = "DatePicker";
|
|
2760
2656
|
|
|
2761
2657
|
// src/components/ui/upload.tsx
|
|
2762
|
-
var
|
|
2658
|
+
var React6 = __toESM(require("react"));
|
|
2763
2659
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2764
|
-
var
|
|
2660
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2765
2661
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2766
2662
|
var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
2767
2663
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -2785,7 +2681,7 @@ var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
|
2785
2681
|
}
|
|
2786
2682
|
}
|
|
2787
2683
|
);
|
|
2788
|
-
var Upload =
|
|
2684
|
+
var Upload = React6.forwardRef(
|
|
2789
2685
|
({
|
|
2790
2686
|
className,
|
|
2791
2687
|
onFileSelect,
|
|
@@ -2798,8 +2694,8 @@ var Upload = React7.forwardRef(
|
|
|
2798
2694
|
selectedFiles = [],
|
|
2799
2695
|
...props
|
|
2800
2696
|
}, ref) => {
|
|
2801
|
-
const fileInputRef =
|
|
2802
|
-
const [isDragOver, setIsDragOver] =
|
|
2697
|
+
const fileInputRef = React6.useRef(null);
|
|
2698
|
+
const [isDragOver, setIsDragOver] = React6.useState(false);
|
|
2803
2699
|
const getFileTypeDisplay = () => {
|
|
2804
2700
|
const typeMap = {
|
|
2805
2701
|
"application/pdf": "PDF",
|
|
@@ -2863,17 +2759,17 @@ var Upload = React7.forwardRef(
|
|
|
2863
2759
|
const renderContent = () => {
|
|
2864
2760
|
switch (effectiveState) {
|
|
2865
2761
|
case "error":
|
|
2866
|
-
return /* @__PURE__ */ (0,
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2867
2763
|
"div",
|
|
2868
2764
|
{
|
|
2869
2765
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2870
2766
|
style: { gap: "32px" },
|
|
2871
2767
|
children: [
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2769
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", children: "Upload fail" }),
|
|
2770
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2875
2771
|
] }),
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2877
2773
|
Button,
|
|
2878
2774
|
{
|
|
2879
2775
|
variant: "destructive",
|
|
@@ -2887,22 +2783,22 @@ var Upload = React7.forwardRef(
|
|
|
2887
2783
|
}
|
|
2888
2784
|
);
|
|
2889
2785
|
case "uploading":
|
|
2890
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2891
2787
|
"div",
|
|
2892
2788
|
{
|
|
2893
2789
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2894
2790
|
style: { gap: "32px" },
|
|
2895
2791
|
children: [
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Uploading files" }),
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2899
2795
|
"div",
|
|
2900
2796
|
{
|
|
2901
2797
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2902
2798
|
style: { width: `${progress}%` }
|
|
2903
2799
|
}
|
|
2904
2800
|
) }),
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2906
2802
|
Typography,
|
|
2907
2803
|
{
|
|
2908
2804
|
variant: "body-sm",
|
|
@@ -2918,29 +2814,29 @@ var Upload = React7.forwardRef(
|
|
|
2918
2814
|
}
|
|
2919
2815
|
);
|
|
2920
2816
|
case "success":
|
|
2921
|
-
return /* @__PURE__ */ (0,
|
|
2817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2922
2818
|
"div",
|
|
2923
2819
|
{
|
|
2924
2820
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2925
2821
|
style: { gap: "32px" },
|
|
2926
|
-
children: /* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
2928
|
-
selectedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
2822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-success", children: "Upload successful!" }),
|
|
2824
|
+
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
2825
|
] })
|
|
2930
2826
|
}
|
|
2931
2827
|
);
|
|
2932
2828
|
default:
|
|
2933
|
-
return /* @__PURE__ */ (0,
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2934
2830
|
"div",
|
|
2935
2831
|
{
|
|
2936
2832
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2937
2833
|
style: { gap: "32px" },
|
|
2938
2834
|
children: [
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2941
|
-
/* @__PURE__ */ (0,
|
|
2835
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Drag & drop files here" }),
|
|
2837
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2942
2838
|
] }),
|
|
2943
|
-
/* @__PURE__ */ (0,
|
|
2839
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2944
2840
|
Button,
|
|
2945
2841
|
{
|
|
2946
2842
|
variant: "default",
|
|
@@ -2954,10 +2850,10 @@ var Upload = React7.forwardRef(
|
|
|
2954
2850
|
children: "Choose files"
|
|
2955
2851
|
}
|
|
2956
2852
|
),
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2958
2854
|
"Supported file: ",
|
|
2959
2855
|
getFileTypeDisplay(),
|
|
2960
|
-
/* @__PURE__ */ (0,
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("br", {}),
|
|
2961
2857
|
"Max: ",
|
|
2962
2858
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2963
2859
|
" MB each"
|
|
@@ -2967,7 +2863,7 @@ var Upload = React7.forwardRef(
|
|
|
2967
2863
|
);
|
|
2968
2864
|
}
|
|
2969
2865
|
};
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2971
2867
|
"div",
|
|
2972
2868
|
{
|
|
2973
2869
|
ref,
|
|
@@ -2991,7 +2887,7 @@ var Upload = React7.forwardRef(
|
|
|
2991
2887
|
"aria-disabled": disabled,
|
|
2992
2888
|
...props,
|
|
2993
2889
|
children: [
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2995
2891
|
"input",
|
|
2996
2892
|
{
|
|
2997
2893
|
ref: fileInputRef,
|
|
@@ -3011,39 +2907,38 @@ var Upload = React7.forwardRef(
|
|
|
3011
2907
|
Upload.displayName = "Upload";
|
|
3012
2908
|
|
|
3013
2909
|
// src/components/ui/checkbox.tsx
|
|
3014
|
-
var
|
|
2910
|
+
var React7 = __toESM(require("react"));
|
|
3015
2911
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
3016
2912
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
3017
|
-
var
|
|
2913
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3018
2914
|
var checkboxVariants = (0, import_class_variance_authority7.cva)(
|
|
3019
|
-
"peer size-4 shrink-0 rounded-[4px] border
|
|
2915
|
+
"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
2916
|
);
|
|
3021
|
-
var Checkbox =
|
|
2917
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3022
2918
|
CheckboxPrimitive.Root,
|
|
3023
2919
|
{
|
|
3024
2920
|
ref,
|
|
3025
2921
|
className: cn(checkboxVariants(), className),
|
|
3026
2922
|
...props,
|
|
3027
|
-
children: /* @__PURE__ */ (0,
|
|
2923
|
+
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
2924
|
}
|
|
3029
2925
|
));
|
|
3030
2926
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
3031
2927
|
|
|
3032
2928
|
// src/components/ui/textarea.tsx
|
|
3033
|
-
var
|
|
3034
|
-
var
|
|
3035
|
-
var Textarea =
|
|
3036
|
-
({ className, style,
|
|
2929
|
+
var React8 = __toESM(require("react"));
|
|
2930
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2931
|
+
var Textarea = React8.forwardRef(
|
|
2932
|
+
({ className, style, ...props }, ref) => {
|
|
3037
2933
|
const tokenStyles = {
|
|
3038
2934
|
font: "var(--typography-label-md-regular)",
|
|
3039
2935
|
...style
|
|
3040
2936
|
};
|
|
3041
|
-
return /* @__PURE__ */ (0,
|
|
2937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3042
2938
|
"textarea",
|
|
3043
2939
|
{
|
|
3044
2940
|
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",
|
|
2941
|
+
"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
2942
|
className
|
|
3048
2943
|
),
|
|
3049
2944
|
style: tokenStyles,
|
|
@@ -3056,9 +2951,9 @@ var Textarea = React9.forwardRef(
|
|
|
3056
2951
|
Textarea.displayName = "Textarea";
|
|
3057
2952
|
|
|
3058
2953
|
// src/components/ui/badge.tsx
|
|
3059
|
-
var
|
|
2954
|
+
var React9 = __toESM(require("react"));
|
|
3060
2955
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
3061
|
-
var
|
|
2956
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3062
2957
|
var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
3063
2958
|
"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
2959
|
{
|
|
@@ -3081,7 +2976,7 @@ var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
|
3081
2976
|
function getBadgeTypographyStyles() {
|
|
3082
2977
|
return { font: "var(--typography-label-sm-bold)" };
|
|
3083
2978
|
}
|
|
3084
|
-
var Badge =
|
|
2979
|
+
var Badge = React9.forwardRef(
|
|
3085
2980
|
({ className, variant, style, ...props }, ref) => {
|
|
3086
2981
|
if (!variant) {
|
|
3087
2982
|
return null;
|
|
@@ -3091,7 +2986,7 @@ var Badge = React10.forwardRef(
|
|
|
3091
2986
|
...typographyStyles,
|
|
3092
2987
|
...style
|
|
3093
2988
|
};
|
|
3094
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3095
2990
|
"span",
|
|
3096
2991
|
{
|
|
3097
2992
|
className: cn(
|
|
@@ -3109,9 +3004,9 @@ var Badge = React10.forwardRef(
|
|
|
3109
3004
|
Badge.displayName = "Badge";
|
|
3110
3005
|
|
|
3111
3006
|
// src/components/ui/tabs.tsx
|
|
3112
|
-
var
|
|
3007
|
+
var React10 = __toESM(require("react"));
|
|
3113
3008
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3114
|
-
var
|
|
3009
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3115
3010
|
var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
3116
3011
|
"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
3012
|
{
|
|
@@ -3125,17 +3020,17 @@ var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3125
3020
|
}
|
|
3126
3021
|
}
|
|
3127
3022
|
);
|
|
3128
|
-
var TabsContext =
|
|
3023
|
+
var TabsContext = React10.createContext(
|
|
3129
3024
|
void 0
|
|
3130
3025
|
);
|
|
3131
3026
|
function useTabsContext() {
|
|
3132
|
-
const context =
|
|
3027
|
+
const context = React10.useContext(TabsContext);
|
|
3133
3028
|
if (!context) {
|
|
3134
3029
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3135
3030
|
}
|
|
3136
3031
|
return context;
|
|
3137
3032
|
}
|
|
3138
|
-
var Tabs =
|
|
3033
|
+
var Tabs = React10.forwardRef((props, ref) => {
|
|
3139
3034
|
const {
|
|
3140
3035
|
className,
|
|
3141
3036
|
value,
|
|
@@ -3144,7 +3039,7 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
3144
3039
|
children,
|
|
3145
3040
|
...restProps
|
|
3146
3041
|
} = props;
|
|
3147
|
-
const contextValue =
|
|
3042
|
+
const contextValue = React10.useMemo(
|
|
3148
3043
|
() => ({
|
|
3149
3044
|
activeTab: value,
|
|
3150
3045
|
setActiveTab: onValueChange,
|
|
@@ -3152,13 +3047,13 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
3152
3047
|
}),
|
|
3153
3048
|
[value, onValueChange, variant]
|
|
3154
3049
|
);
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
3156
3051
|
});
|
|
3157
3052
|
Tabs.displayName = "Tabs";
|
|
3158
|
-
var TabsList =
|
|
3053
|
+
var TabsList = React10.forwardRef(
|
|
3159
3054
|
(props, ref) => {
|
|
3160
3055
|
const { className, children, ...restProps } = props;
|
|
3161
|
-
return /* @__PURE__ */ (0,
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3162
3057
|
"div",
|
|
3163
3058
|
{
|
|
3164
3059
|
ref,
|
|
@@ -3174,7 +3069,7 @@ TabsList.displayName = "TabsList";
|
|
|
3174
3069
|
var getTabTypographyStyles = (isActive) => ({
|
|
3175
3070
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3176
3071
|
});
|
|
3177
|
-
var TabsTrigger =
|
|
3072
|
+
var TabsTrigger = React10.forwardRef(
|
|
3178
3073
|
(props, ref) => {
|
|
3179
3074
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3180
3075
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3182,22 +3077,22 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3182
3077
|
throw new Error("TabsTrigger must have a value prop");
|
|
3183
3078
|
}
|
|
3184
3079
|
const isActive = activeTab === value;
|
|
3185
|
-
const tokenStyles =
|
|
3080
|
+
const tokenStyles = React10.useMemo(
|
|
3186
3081
|
() => ({
|
|
3187
3082
|
...getTabTypographyStyles(isActive),
|
|
3188
3083
|
...style
|
|
3189
3084
|
}),
|
|
3190
3085
|
[isActive, style]
|
|
3191
3086
|
);
|
|
3192
|
-
const triggerClassName =
|
|
3087
|
+
const triggerClassName = React10.useMemo(
|
|
3193
3088
|
() => cn(tabsVariants({ variant }), className),
|
|
3194
3089
|
[variant, className]
|
|
3195
3090
|
);
|
|
3196
|
-
const handleClick =
|
|
3091
|
+
const handleClick = React10.useCallback(() => {
|
|
3197
3092
|
if (disabled) return;
|
|
3198
3093
|
setActiveTab(value);
|
|
3199
3094
|
}, [disabled, setActiveTab, value]);
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3201
3096
|
"button",
|
|
3202
3097
|
{
|
|
3203
3098
|
ref,
|
|
@@ -3211,13 +3106,13 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3211
3106
|
disabled,
|
|
3212
3107
|
onClick: handleClick,
|
|
3213
3108
|
...restProps,
|
|
3214
|
-
children: /* @__PURE__ */ (0,
|
|
3109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "pl-3 pr-6 py-2", children })
|
|
3215
3110
|
}
|
|
3216
3111
|
);
|
|
3217
3112
|
}
|
|
3218
3113
|
);
|
|
3219
3114
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3220
|
-
var TabsContent =
|
|
3115
|
+
var TabsContent = React10.forwardRef(
|
|
3221
3116
|
(props, ref) => {
|
|
3222
3117
|
const { className, value, children, ...restProps } = props;
|
|
3223
3118
|
const { activeTab } = useTabsContext();
|
|
@@ -3228,7 +3123,7 @@ var TabsContent = React11.forwardRef(
|
|
|
3228
3123
|
if (!isActive) {
|
|
3229
3124
|
return null;
|
|
3230
3125
|
}
|
|
3231
|
-
return /* @__PURE__ */ (0,
|
|
3126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3232
3127
|
"div",
|
|
3233
3128
|
{
|
|
3234
3129
|
ref,
|
|
@@ -3246,11 +3141,11 @@ var TabsContent = React11.forwardRef(
|
|
|
3246
3141
|
TabsContent.displayName = "TabsContent";
|
|
3247
3142
|
|
|
3248
3143
|
// src/components/ui/dropdown-menu.tsx
|
|
3249
|
-
var
|
|
3144
|
+
var React11 = __toESM(require("react"));
|
|
3250
3145
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3251
|
-
var
|
|
3146
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3252
3147
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3253
|
-
var DropdownMenuTrigger =
|
|
3148
|
+
var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3254
3149
|
DropdownMenuPrimitive.Trigger,
|
|
3255
3150
|
{
|
|
3256
3151
|
ref,
|
|
@@ -3260,7 +3155,7 @@ var DropdownMenuTrigger = React12.forwardRef(({ className, icon, children, ...pr
|
|
|
3260
3155
|
),
|
|
3261
3156
|
...props,
|
|
3262
3157
|
children: [
|
|
3263
|
-
icon || /* @__PURE__ */ (0,
|
|
3158
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MoreMenu, { className: "size-4" }),
|
|
3264
3159
|
children
|
|
3265
3160
|
]
|
|
3266
3161
|
}
|
|
@@ -3270,7 +3165,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3270
3165
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3271
3166
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3272
3167
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3273
|
-
var DropdownMenuSubTrigger =
|
|
3168
|
+
var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3274
3169
|
DropdownMenuPrimitive.SubTrigger,
|
|
3275
3170
|
{
|
|
3276
3171
|
ref,
|
|
@@ -3283,12 +3178,12 @@ var DropdownMenuSubTrigger = React12.forwardRef(({ className, inset, children, .
|
|
|
3283
3178
|
...props,
|
|
3284
3179
|
children: [
|
|
3285
3180
|
children,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight, { className: "ml-auto" })
|
|
3287
3182
|
]
|
|
3288
3183
|
}
|
|
3289
3184
|
));
|
|
3290
3185
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3291
|
-
var DropdownMenuSubContent =
|
|
3186
|
+
var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3292
3187
|
DropdownMenuPrimitive.SubContent,
|
|
3293
3188
|
{
|
|
3294
3189
|
ref,
|
|
@@ -3300,7 +3195,7 @@ var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) =
|
|
|
3300
3195
|
}
|
|
3301
3196
|
));
|
|
3302
3197
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3303
|
-
var DropdownMenuContent =
|
|
3198
|
+
var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3304
3199
|
DropdownMenuPrimitive.Content,
|
|
3305
3200
|
{
|
|
3306
3201
|
ref,
|
|
@@ -3314,7 +3209,7 @@ var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, align
|
|
|
3314
3209
|
}
|
|
3315
3210
|
) }));
|
|
3316
3211
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3317
|
-
var DropdownMenuItem =
|
|
3212
|
+
var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3318
3213
|
DropdownMenuPrimitive.Item,
|
|
3319
3214
|
{
|
|
3320
3215
|
ref,
|
|
@@ -3331,7 +3226,7 @@ var DropdownMenuItem = React12.forwardRef(({ className, inset, style, ...props }
|
|
|
3331
3226
|
}
|
|
3332
3227
|
));
|
|
3333
3228
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3334
|
-
var DropdownMenuCheckboxItem =
|
|
3229
|
+
var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3335
3230
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3336
3231
|
{
|
|
3337
3232
|
ref,
|
|
@@ -3346,7 +3241,7 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3346
3241
|
},
|
|
3347
3242
|
...props,
|
|
3348
3243
|
children: [
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3350
3245
|
Checkbox,
|
|
3351
3246
|
{
|
|
3352
3247
|
checked: checked === true,
|
|
@@ -3354,12 +3249,12 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3354
3249
|
"aria-hidden": "true"
|
|
3355
3250
|
}
|
|
3356
3251
|
),
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex-1", children })
|
|
3358
3253
|
]
|
|
3359
3254
|
}
|
|
3360
3255
|
));
|
|
3361
3256
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3362
|
-
var DropdownMenuRadioItem =
|
|
3257
|
+
var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3363
3258
|
DropdownMenuPrimitive.RadioItem,
|
|
3364
3259
|
{
|
|
3365
3260
|
ref,
|
|
@@ -3373,13 +3268,13 @@ var DropdownMenuRadioItem = React12.forwardRef(({ className, children, style, ..
|
|
|
3373
3268
|
},
|
|
3374
3269
|
...props,
|
|
3375
3270
|
children: [
|
|
3376
|
-
/* @__PURE__ */ (0,
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3377
3272
|
children
|
|
3378
3273
|
]
|
|
3379
3274
|
}
|
|
3380
3275
|
));
|
|
3381
3276
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3382
|
-
var DropdownMenuLabel =
|
|
3277
|
+
var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3383
3278
|
DropdownMenuPrimitive.Label,
|
|
3384
3279
|
{
|
|
3385
3280
|
ref,
|
|
@@ -3392,7 +3287,7 @@ var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3392
3287
|
}
|
|
3393
3288
|
));
|
|
3394
3289
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3395
|
-
var DropdownMenuSeparator =
|
|
3290
|
+
var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3396
3291
|
DropdownMenuPrimitive.Separator,
|
|
3397
3292
|
{
|
|
3398
3293
|
ref,
|
|
@@ -3405,7 +3300,7 @@ var DropdownMenuShortcut = ({
|
|
|
3405
3300
|
className,
|
|
3406
3301
|
...props
|
|
3407
3302
|
}) => {
|
|
3408
|
-
return /* @__PURE__ */ (0,
|
|
3303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3409
3304
|
"span",
|
|
3410
3305
|
{
|
|
3411
3306
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3416,21 +3311,21 @@ var DropdownMenuShortcut = ({
|
|
|
3416
3311
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3417
3312
|
|
|
3418
3313
|
// src/components/ui/charts/chart-legend.tsx
|
|
3419
|
-
var
|
|
3314
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3420
3315
|
function ChartLegend({
|
|
3421
3316
|
items,
|
|
3422
3317
|
x = 0,
|
|
3423
3318
|
y = 550,
|
|
3424
3319
|
className = ""
|
|
3425
3320
|
}) {
|
|
3426
|
-
return /* @__PURE__ */ (0,
|
|
3321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3427
3322
|
"div",
|
|
3428
3323
|
{
|
|
3429
3324
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
3430
3325
|
style: { height: "100%" },
|
|
3431
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0,
|
|
3432
|
-
/* @__PURE__ */ (0,
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3326
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
3328
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-xs", children: label || key })
|
|
3434
3329
|
] }, key))
|
|
3435
3330
|
}
|
|
3436
3331
|
) });
|
|
@@ -3548,12 +3443,12 @@ var formatLargeNumber = (value) => {
|
|
|
3548
3443
|
};
|
|
3549
3444
|
|
|
3550
3445
|
// src/components/ui/charts/chart-labels.tsx
|
|
3551
|
-
var
|
|
3446
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3552
3447
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
3553
3448
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
3554
3449
|
if (!viewBox) return null;
|
|
3555
3450
|
const { x, y, width } = viewBox;
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3557
3452
|
};
|
|
3558
3453
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
3559
3454
|
return CustomXAxisLabel;
|
|
@@ -3563,7 +3458,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
3563
3458
|
if (!viewBox) return null;
|
|
3564
3459
|
const { x, y, height } = viewBox;
|
|
3565
3460
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
3566
|
-
return /* @__PURE__ */ (0,
|
|
3461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3567
3462
|
};
|
|
3568
3463
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
3569
3464
|
return CustomYAxisLabel;
|
|
@@ -3572,14 +3467,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
3572
3467
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
3573
3468
|
if (!viewBox) return null;
|
|
3574
3469
|
const { x, y, width, height } = viewBox;
|
|
3575
|
-
return /* @__PURE__ */ (0,
|
|
3470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3576
3471
|
};
|
|
3577
3472
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
3578
3473
|
return CustomYAxisRightLabel;
|
|
3579
3474
|
};
|
|
3580
3475
|
var customXAxisTick = (props) => {
|
|
3581
3476
|
const { x, y, payload } = props;
|
|
3582
|
-
return /* @__PURE__ */ (0,
|
|
3477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3583
3478
|
"foreignObject",
|
|
3584
3479
|
{
|
|
3585
3480
|
x: -20,
|
|
@@ -3587,12 +3482,12 @@ var customXAxisTick = (props) => {
|
|
|
3587
3482
|
width: 40,
|
|
3588
3483
|
height: 20,
|
|
3589
3484
|
style: { overflow: "visible" },
|
|
3590
|
-
children: /* @__PURE__ */ (0,
|
|
3485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3591
3486
|
"div",
|
|
3592
3487
|
{
|
|
3593
3488
|
className: "flex items-start justify-center h-full",
|
|
3594
3489
|
style: { overflow: "visible" },
|
|
3595
|
-
children: /* @__PURE__ */ (0,
|
|
3490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3596
3491
|
Typography,
|
|
3597
3492
|
{
|
|
3598
3493
|
variant: "body-xs",
|
|
@@ -3607,7 +3502,7 @@ var customXAxisTick = (props) => {
|
|
|
3607
3502
|
};
|
|
3608
3503
|
var customXAxisTickRotated = (props) => {
|
|
3609
3504
|
const { x, y, payload } = props;
|
|
3610
|
-
return /* @__PURE__ */ (0,
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3611
3506
|
"text",
|
|
3612
3507
|
{
|
|
3613
3508
|
x: 0,
|
|
@@ -3626,25 +3521,25 @@ var customYAxisTick = (props) => {
|
|
|
3626
3521
|
const { x, y, payload } = props;
|
|
3627
3522
|
const text = String(payload.value);
|
|
3628
3523
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
3629
|
-
return /* @__PURE__ */ (0,
|
|
3524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3630
3525
|
"foreignObject",
|
|
3631
3526
|
{
|
|
3632
3527
|
x: x - estimatedWidth + 5,
|
|
3633
3528
|
y: y - 6,
|
|
3634
3529
|
width: estimatedWidth,
|
|
3635
3530
|
height: 15,
|
|
3636
|
-
children: /* @__PURE__ */ (0,
|
|
3531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
3637
3532
|
}
|
|
3638
3533
|
);
|
|
3639
3534
|
};
|
|
3640
3535
|
|
|
3641
3536
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
3642
|
-
var
|
|
3537
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3643
3538
|
function TooltipContainer({
|
|
3644
3539
|
children,
|
|
3645
3540
|
className = ""
|
|
3646
3541
|
}) {
|
|
3647
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3648
3543
|
"div",
|
|
3649
3544
|
{
|
|
3650
3545
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -3658,10 +3553,10 @@ function TooltipItem({
|
|
|
3658
3553
|
value,
|
|
3659
3554
|
className = ""
|
|
3660
3555
|
}) {
|
|
3661
|
-
return /* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
3557
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Typography, { variant: "label-sm", className, children: [
|
|
3559
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3665
3560
|
"span",
|
|
3666
3561
|
{
|
|
3667
3562
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -3679,9 +3574,9 @@ function GenericTooltip({
|
|
|
3679
3574
|
items,
|
|
3680
3575
|
className = ""
|
|
3681
3576
|
}) {
|
|
3682
|
-
return /* @__PURE__ */ (0,
|
|
3683
|
-
title && /* @__PURE__ */ (0,
|
|
3684
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
3577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TooltipContainer, { className, children: [
|
|
3578
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Typography, { variant: "label-sm-bold", children: title }),
|
|
3579
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3685
3580
|
TooltipItem,
|
|
3686
3581
|
{
|
|
3687
3582
|
color: item.color,
|
|
@@ -3696,7 +3591,7 @@ function GenericTooltip({
|
|
|
3696
3591
|
// src/components/ui/charts/bar-chart.tsx
|
|
3697
3592
|
var import_react2 = require("react");
|
|
3698
3593
|
var import_recharts = require("recharts");
|
|
3699
|
-
var
|
|
3594
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3700
3595
|
var BarChart = (0, import_react2.forwardRef)(
|
|
3701
3596
|
({
|
|
3702
3597
|
data,
|
|
@@ -3723,19 +3618,19 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3723
3618
|
};
|
|
3724
3619
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
3725
3620
|
const hasData = data && data.length > 0;
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3727
3622
|
"div",
|
|
3728
3623
|
{
|
|
3729
3624
|
ref,
|
|
3730
3625
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3731
3626
|
children: [
|
|
3732
|
-
/* @__PURE__ */ (0,
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3734
3629
|
import_recharts.ResponsiveContainer,
|
|
3735
3630
|
{
|
|
3736
3631
|
width: "100%",
|
|
3737
3632
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3738
|
-
children: /* @__PURE__ */ (0,
|
|
3633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3739
3634
|
import_recharts.BarChart,
|
|
3740
3635
|
{
|
|
3741
3636
|
data,
|
|
@@ -3747,7 +3642,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3747
3642
|
onClick: handleClick,
|
|
3748
3643
|
layout,
|
|
3749
3644
|
children: [
|
|
3750
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3751
3646
|
import_recharts.XAxis,
|
|
3752
3647
|
{
|
|
3753
3648
|
dataKey: xAxisKey,
|
|
@@ -3761,7 +3656,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3761
3656
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
3762
3657
|
}
|
|
3763
3658
|
),
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3659
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3765
3660
|
import_recharts.YAxis,
|
|
3766
3661
|
{
|
|
3767
3662
|
axisLine: false,
|
|
@@ -3772,7 +3667,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3772
3667
|
type: yAxisType
|
|
3773
3668
|
}
|
|
3774
3669
|
),
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3776
3671
|
import_recharts.Tooltip,
|
|
3777
3672
|
{
|
|
3778
3673
|
content: ({
|
|
@@ -3781,7 +3676,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3781
3676
|
label
|
|
3782
3677
|
}) => {
|
|
3783
3678
|
if (active && payload && payload.length) {
|
|
3784
|
-
return /* @__PURE__ */ (0,
|
|
3679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3785
3680
|
GenericTooltip,
|
|
3786
3681
|
{
|
|
3787
3682
|
title: label?.toString(),
|
|
@@ -3797,7 +3692,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3797
3692
|
}
|
|
3798
3693
|
}
|
|
3799
3694
|
),
|
|
3800
|
-
/* @__PURE__ */ (0,
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3801
3696
|
import_recharts.Bar,
|
|
3802
3697
|
{
|
|
3803
3698
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -3805,12 +3700,12 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3805
3700
|
name: barDataKey || yAxisKey
|
|
3806
3701
|
}
|
|
3807
3702
|
),
|
|
3808
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3703
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3809
3704
|
]
|
|
3810
3705
|
}
|
|
3811
3706
|
)
|
|
3812
3707
|
}
|
|
3813
|
-
) : /* @__PURE__ */ (0,
|
|
3708
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3814
3709
|
]
|
|
3815
3710
|
}
|
|
3816
3711
|
);
|
|
@@ -3821,7 +3716,7 @@ BarChart.displayName = "BarChart";
|
|
|
3821
3716
|
// src/components/ui/charts/line-chart.tsx
|
|
3822
3717
|
var import_react3 = require("react");
|
|
3823
3718
|
var import_recharts2 = require("recharts");
|
|
3824
|
-
var
|
|
3719
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3825
3720
|
var LineChart = (0, import_react3.forwardRef)(
|
|
3826
3721
|
({
|
|
3827
3722
|
data,
|
|
@@ -3850,19 +3745,19 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3850
3745
|
)
|
|
3851
3746
|
);
|
|
3852
3747
|
const hasData = data && data.length > 0;
|
|
3853
|
-
return /* @__PURE__ */ (0,
|
|
3748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3854
3749
|
"div",
|
|
3855
3750
|
{
|
|
3856
3751
|
ref,
|
|
3857
3752
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3858
3753
|
children: [
|
|
3859
|
-
/* @__PURE__ */ (0,
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3861
3756
|
import_recharts2.ResponsiveContainer,
|
|
3862
3757
|
{
|
|
3863
3758
|
width: "100%",
|
|
3864
3759
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3865
|
-
children: /* @__PURE__ */ (0,
|
|
3760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3866
3761
|
import_recharts2.LineChart,
|
|
3867
3762
|
{
|
|
3868
3763
|
data,
|
|
@@ -3873,7 +3768,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3873
3768
|
},
|
|
3874
3769
|
onClick: handleClick,
|
|
3875
3770
|
children: [
|
|
3876
|
-
/* @__PURE__ */ (0,
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3877
3772
|
import_recharts2.XAxis,
|
|
3878
3773
|
{
|
|
3879
3774
|
dataKey: xAxisKey,
|
|
@@ -3885,7 +3780,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3885
3780
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
3886
3781
|
}
|
|
3887
3782
|
),
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3889
3784
|
import_recharts2.YAxis,
|
|
3890
3785
|
{
|
|
3891
3786
|
axisLine: false,
|
|
@@ -3894,7 +3789,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3894
3789
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
3895
3790
|
}
|
|
3896
3791
|
),
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3898
3793
|
import_recharts2.Tooltip,
|
|
3899
3794
|
{
|
|
3900
3795
|
content: ({
|
|
@@ -3903,7 +3798,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3903
3798
|
label
|
|
3904
3799
|
}) => {
|
|
3905
3800
|
if (active && payload && payload.length) {
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3907
3802
|
GenericTooltip,
|
|
3908
3803
|
{
|
|
3909
3804
|
title: label?.toString(),
|
|
@@ -3919,7 +3814,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3919
3814
|
}
|
|
3920
3815
|
}
|
|
3921
3816
|
),
|
|
3922
|
-
series.map((s, index) => /* @__PURE__ */ (0,
|
|
3817
|
+
series.map((s, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3923
3818
|
import_recharts2.Line,
|
|
3924
3819
|
{
|
|
3925
3820
|
type: "monotone",
|
|
@@ -3931,12 +3826,12 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3931
3826
|
},
|
|
3932
3827
|
s.dataKey
|
|
3933
3828
|
)),
|
|
3934
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3829
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3935
3830
|
]
|
|
3936
3831
|
}
|
|
3937
3832
|
)
|
|
3938
3833
|
}
|
|
3939
|
-
) : /* @__PURE__ */ (0,
|
|
3834
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3940
3835
|
]
|
|
3941
3836
|
}
|
|
3942
3837
|
);
|
|
@@ -3947,7 +3842,7 @@ LineChart.displayName = "LineChart";
|
|
|
3947
3842
|
// src/components/ui/charts/pie-chart.tsx
|
|
3948
3843
|
var import_react4 = require("react");
|
|
3949
3844
|
var import_recharts3 = require("recharts");
|
|
3950
|
-
var
|
|
3845
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3951
3846
|
var PieChart = (0, import_react4.forwardRef)(
|
|
3952
3847
|
({
|
|
3953
3848
|
data,
|
|
@@ -3975,20 +3870,20 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3975
3870
|
)
|
|
3976
3871
|
);
|
|
3977
3872
|
const hasData = data && data.length > 0;
|
|
3978
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3979
3874
|
"div",
|
|
3980
3875
|
{
|
|
3981
3876
|
ref,
|
|
3982
3877
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3983
3878
|
children: [
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
3879
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3986
3881
|
import_recharts3.PieChart,
|
|
3987
3882
|
{
|
|
3988
3883
|
width: 600,
|
|
3989
3884
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
3990
3885
|
children: [
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3992
3887
|
import_recharts3.Pie,
|
|
3993
3888
|
{
|
|
3994
3889
|
data,
|
|
@@ -4000,7 +3895,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4000
3895
|
label: showLabels,
|
|
4001
3896
|
labelLine: false,
|
|
4002
3897
|
onClick: handleClick,
|
|
4003
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
3898
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4004
3899
|
import_recharts3.Cell,
|
|
4005
3900
|
{
|
|
4006
3901
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -4009,7 +3904,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4009
3904
|
))
|
|
4010
3905
|
}
|
|
4011
3906
|
),
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4013
3908
|
import_recharts3.Tooltip,
|
|
4014
3909
|
{
|
|
4015
3910
|
content: ({
|
|
@@ -4018,7 +3913,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4018
3913
|
}) => {
|
|
4019
3914
|
if (active && payload && payload.length && payload[0]) {
|
|
4020
3915
|
const data2 = payload[0].payload;
|
|
4021
|
-
return /* @__PURE__ */ (0,
|
|
3916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4022
3917
|
GenericTooltip,
|
|
4023
3918
|
{
|
|
4024
3919
|
title: data2.name,
|
|
@@ -4036,10 +3931,10 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4036
3931
|
}
|
|
4037
3932
|
}
|
|
4038
3933
|
),
|
|
4039
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3934
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
4040
3935
|
]
|
|
4041
3936
|
}
|
|
4042
|
-
) }) : /* @__PURE__ */ (0,
|
|
3937
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4043
3938
|
]
|
|
4044
3939
|
}
|
|
4045
3940
|
);
|
|
@@ -4050,7 +3945,7 @@ PieChart.displayName = "PieChart";
|
|
|
4050
3945
|
// src/components/ui/table.tsx
|
|
4051
3946
|
var import_react5 = require("react");
|
|
4052
3947
|
var import_react_table = require("@tanstack/react-table");
|
|
4053
|
-
var
|
|
3948
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4054
3949
|
function Table({
|
|
4055
3950
|
table,
|
|
4056
3951
|
className,
|
|
@@ -4080,15 +3975,15 @@ function Table({
|
|
|
4080
3975
|
},
|
|
4081
3976
|
[table]
|
|
4082
3977
|
);
|
|
4083
|
-
return /* @__PURE__ */ (0,
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
3979
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("table", { className: "min-w-full divide-y divide-border", children: [
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4086
3981
|
"div",
|
|
4087
3982
|
{
|
|
4088
3983
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
4089
3984
|
onClick: header.column.getToggleSortingHandler(),
|
|
4090
3985
|
children: [
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4092
3987
|
Typography,
|
|
4093
3988
|
{
|
|
4094
3989
|
variant: "label-xs",
|
|
@@ -4099,19 +3994,19 @@ function Table({
|
|
|
4099
3994
|
)
|
|
4100
3995
|
}
|
|
4101
3996
|
),
|
|
4102
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
4103
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0,
|
|
4104
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0,
|
|
3997
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "ml-1", children: [
|
|
3998
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronUp, { className: "w-4 h-4 text-light" }),
|
|
3999
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronDown, { className: "w-4 h-4 text-light" })
|
|
4105
4000
|
] })
|
|
4106
4001
|
]
|
|
4107
4002
|
}
|
|
4108
4003
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4109
|
-
/* @__PURE__ */ (0,
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "body-sm", children: (0, import_react_table.flexRender)(
|
|
4110
4005
|
cell.column.columnDef.cell,
|
|
4111
4006
|
cell.getContext()
|
|
4112
4007
|
) }) }, cell.id)) }, row.id)) })
|
|
4113
4008
|
] }) }),
|
|
4114
|
-
showPagination && /* @__PURE__ */ (0,
|
|
4009
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4115
4010
|
"div",
|
|
4116
4011
|
{
|
|
4117
4012
|
className: cn(
|
|
@@ -4119,9 +4014,9 @@ function Table({
|
|
|
4119
4014
|
paginationClassName
|
|
4120
4015
|
),
|
|
4121
4016
|
children: [
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4125
4020
|
Button,
|
|
4126
4021
|
{
|
|
4127
4022
|
variant: "ghost",
|
|
@@ -4129,7 +4024,7 @@ function Table({
|
|
|
4129
4024
|
onClick: handlePreviousPage,
|
|
4130
4025
|
disabled: !table.getCanPreviousPage(),
|
|
4131
4026
|
className: "p-2",
|
|
4132
|
-
children: /* @__PURE__ */ (0,
|
|
4027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronLeft, { className: "w-4 h-4" })
|
|
4133
4028
|
}
|
|
4134
4029
|
),
|
|
4135
4030
|
Array.from(
|
|
@@ -4146,7 +4041,7 @@ function Table({
|
|
|
4146
4041
|
pageNumber = currentPage - 2 + i;
|
|
4147
4042
|
}
|
|
4148
4043
|
const isActive = pageNumber === currentPage;
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
4044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4150
4045
|
Button,
|
|
4151
4046
|
{
|
|
4152
4047
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4159,11 +4054,11 @@ function Table({
|
|
|
4159
4054
|
);
|
|
4160
4055
|
}
|
|
4161
4056
|
),
|
|
4162
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0,
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4057
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
4058
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "px-1 text-secondary", children: "..." }),
|
|
4059
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4165
4060
|
] }),
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4167
4062
|
Button,
|
|
4168
4063
|
{
|
|
4169
4064
|
variant: "ghost",
|
|
@@ -4171,12 +4066,12 @@ function Table({
|
|
|
4171
4066
|
onClick: handleNextPage,
|
|
4172
4067
|
disabled: !table.getCanNextPage(),
|
|
4173
4068
|
className: "p-2",
|
|
4174
|
-
children: /* @__PURE__ */ (0,
|
|
4069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronRight, { className: "w-4 h-4" })
|
|
4175
4070
|
}
|
|
4176
4071
|
)
|
|
4177
4072
|
] }),
|
|
4178
|
-
/* @__PURE__ */ (0,
|
|
4179
|
-
/* @__PURE__ */ (0,
|
|
4073
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-3 w-48", children: [
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4180
4075
|
Typography,
|
|
4181
4076
|
{
|
|
4182
4077
|
variant: "body-sm",
|
|
@@ -4184,14 +4079,14 @@ function Table({
|
|
|
4184
4079
|
children: "Rows per page:"
|
|
4185
4080
|
}
|
|
4186
4081
|
),
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4188
4083
|
Select,
|
|
4189
4084
|
{
|
|
4190
4085
|
value: table.getState().pagination.pageSize.toString(),
|
|
4191
4086
|
onValueChange: handlePageSizeChange,
|
|
4192
4087
|
children: [
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectValue, {}) }),
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4195
4090
|
]
|
|
4196
4091
|
}
|
|
4197
4092
|
)
|
|
@@ -4270,7 +4165,6 @@ function Table({
|
|
|
4270
4165
|
FieldTitle,
|
|
4271
4166
|
Filter,
|
|
4272
4167
|
FilterDescending,
|
|
4273
|
-
FormField,
|
|
4274
4168
|
GenericTooltip,
|
|
4275
4169
|
GraphBar,
|
|
4276
4170
|
GraphDonut,
|