@northslopetech/altitude-ui 2.0.17 → 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 +164 -176
- package/dist/index.d.ts +164 -176
- package/dist/index.js +506 -367
- package/dist/index.mjs +444 -316
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -85,9 +85,18 @@ __export(index_exports, {
|
|
|
85
85
|
Exclamation: () => Exclamation,
|
|
86
86
|
EyeClosed: () => EyeClosed,
|
|
87
87
|
EyeOpen: () => EyeOpen,
|
|
88
|
+
Field: () => Field,
|
|
89
|
+
FieldContent: () => FieldContent,
|
|
90
|
+
FieldDescription: () => FieldDescription,
|
|
91
|
+
FieldError: () => FieldError,
|
|
92
|
+
FieldGroup: () => FieldGroup,
|
|
93
|
+
FieldLabel: () => FieldLabel,
|
|
94
|
+
FieldLegend: () => FieldLegend,
|
|
95
|
+
FieldSeparator: () => FieldSeparator,
|
|
96
|
+
FieldSet: () => FieldSet,
|
|
97
|
+
FieldTitle: () => FieldTitle,
|
|
88
98
|
Filter: () => Filter,
|
|
89
99
|
FilterDescending: () => FilterDescending,
|
|
90
|
-
FormField: () => FormField,
|
|
91
100
|
GenericTooltip: () => GenericTooltip,
|
|
92
101
|
GraphBar: () => GraphBar,
|
|
93
102
|
GraphDonut: () => GraphDonut,
|
|
@@ -96,7 +105,8 @@ __export(index_exports, {
|
|
|
96
105
|
HamburgerMenu: () => HamburgerMenu,
|
|
97
106
|
Home: () => Home,
|
|
98
107
|
Information: () => Information,
|
|
99
|
-
Input: () =>
|
|
108
|
+
Input: () => Input,
|
|
109
|
+
Label: () => Label2,
|
|
100
110
|
LineChart: () => LineChart,
|
|
101
111
|
Location: () => Location,
|
|
102
112
|
Lock: () => Lock,
|
|
@@ -118,6 +128,7 @@ __export(index_exports, {
|
|
|
118
128
|
SelectSeparator: () => SelectSeparator,
|
|
119
129
|
SelectTrigger: () => SelectTrigger,
|
|
120
130
|
SelectValue: () => SelectValue,
|
|
131
|
+
Separator: () => Separator2,
|
|
121
132
|
Share: () => Share,
|
|
122
133
|
Star: () => Star,
|
|
123
134
|
Statement: () => Statement,
|
|
@@ -127,6 +138,7 @@ __export(index_exports, {
|
|
|
127
138
|
TabsContent: () => TabsContent,
|
|
128
139
|
TabsList: () => TabsList,
|
|
129
140
|
TabsTrigger: () => TabsTrigger,
|
|
141
|
+
Textarea: () => Textarea,
|
|
130
142
|
TooltipContainer: () => TooltipContainer,
|
|
131
143
|
TooltipItem: () => TooltipItem,
|
|
132
144
|
Trash: () => Trash,
|
|
@@ -153,7 +165,6 @@ __export(index_exports, {
|
|
|
153
165
|
getHeatmapColor: () => getHeatmapColor,
|
|
154
166
|
getPerformanceColor: () => getPerformanceColor,
|
|
155
167
|
getSeriesColor: () => getSeriesColor,
|
|
156
|
-
inputVariants: () => inputVariants,
|
|
157
168
|
selectTriggerVariants: () => selectTriggerVariants,
|
|
158
169
|
tabsVariants: () => tabsVariants,
|
|
159
170
|
typographyVariants: () => typographyVariants,
|
|
@@ -1817,7 +1828,7 @@ var Logout = ({
|
|
|
1817
1828
|
// src/components/ui/select.tsx
|
|
1818
1829
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1819
1830
|
var selectTriggerVariants = (0, import_class_variance_authority4.cva)(
|
|
1820
|
-
"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",
|
|
1821
1832
|
{
|
|
1822
1833
|
variants: {
|
|
1823
1834
|
width: {
|
|
@@ -1862,7 +1873,7 @@ var SelectTrigger = React3.forwardRef(({ className, children, style, width, ...p
|
|
|
1862
1873
|
ref,
|
|
1863
1874
|
className: cn(
|
|
1864
1875
|
selectTriggerVariants({ width }),
|
|
1865
|
-
"
|
|
1876
|
+
"data-[state=open]:[&_svg]:rotate-180 data-[placeholder]:text-secondary h-10 py-2",
|
|
1866
1877
|
className
|
|
1867
1878
|
),
|
|
1868
1879
|
style: tokenStyles,
|
|
@@ -1973,135 +1984,276 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1973
1984
|
));
|
|
1974
1985
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1975
1986
|
|
|
1976
|
-
// src/components/ui/
|
|
1977
|
-
var
|
|
1987
|
+
// src/components/ui/field.tsx
|
|
1988
|
+
var import_react = require("react");
|
|
1989
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1990
|
+
|
|
1991
|
+
// src/components/ui/label.tsx
|
|
1992
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
1978
1993
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
}, ref) => {
|
|
1991
|
-
const generatedId = React4.useId();
|
|
1992
|
-
const fieldId = id || generatedId;
|
|
1993
|
-
const helperTextId = `${fieldId}-helper`;
|
|
1994
|
-
const labelId = `${fieldId}-label`;
|
|
1995
|
-
if (compact) {
|
|
1996
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("w-full space-y-2", className), ...props, children: [
|
|
1997
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
|
|
1998
|
-
React4.cloneElement(
|
|
1999
|
-
children,
|
|
2000
|
-
{
|
|
2001
|
-
id: fieldId,
|
|
2002
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
2003
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
2004
|
-
"aria-required": required,
|
|
2005
|
-
"aria-invalid": error,
|
|
2006
|
-
className: cn(
|
|
2007
|
-
"pt-7 pb-2 h-14 items-end",
|
|
2008
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
2009
|
-
children.props.className
|
|
2010
|
-
)
|
|
2011
|
-
}
|
|
2012
|
-
),
|
|
2013
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2014
|
-
"label",
|
|
2015
|
-
{
|
|
2016
|
-
id: labelId,
|
|
2017
|
-
htmlFor: fieldId,
|
|
2018
|
-
className: "absolute left-3 top-2 text-xs text-semantic-text-info [font:var(--typography-label-xs-bold)] pointer-events-none",
|
|
2019
|
-
children: label
|
|
2020
|
-
}
|
|
2021
|
-
)
|
|
2022
|
-
] }),
|
|
2023
|
-
helperText && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2024
|
-
Typography,
|
|
2025
|
-
{
|
|
2026
|
-
variant: "body-xs",
|
|
2027
|
-
id: helperTextId,
|
|
2028
|
-
className: cn(
|
|
2029
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
2030
|
-
),
|
|
2031
|
-
children: helperText
|
|
2032
|
-
}
|
|
2033
|
-
)
|
|
2034
|
-
] });
|
|
2035
|
-
}
|
|
2036
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("w-full space-y-3", className), ...props, children: [
|
|
2037
|
-
(label || required) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2038
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2039
|
-
"label",
|
|
2040
|
-
{
|
|
2041
|
-
id: labelId,
|
|
2042
|
-
htmlFor: fieldId,
|
|
2043
|
-
className: "text-semantic-text-primary [font:var(--typography-label-sm-regular)]",
|
|
2044
|
-
children: label
|
|
2045
|
-
}
|
|
2046
|
-
),
|
|
2047
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-semantic-text-secondary [font:var(--typography-label-xs-regular)]", children: "*required" })
|
|
2048
|
-
] }),
|
|
2049
|
-
React4.cloneElement(
|
|
2050
|
-
children,
|
|
2051
|
-
{
|
|
2052
|
-
id: fieldId,
|
|
2053
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
2054
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
2055
|
-
"aria-required": required,
|
|
2056
|
-
"aria-invalid": error,
|
|
2057
|
-
className: cn(
|
|
2058
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
2059
|
-
children.props.className
|
|
2060
|
-
)
|
|
2061
|
-
}
|
|
1994
|
+
function Label2({
|
|
1995
|
+
className,
|
|
1996
|
+
...props
|
|
1997
|
+
}) {
|
|
1998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1999
|
+
LabelPrimitive.Root,
|
|
2000
|
+
{
|
|
2001
|
+
"data-slot": "label",
|
|
2002
|
+
className: cn(
|
|
2003
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
2004
|
+
className
|
|
2062
2005
|
),
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
id: helperTextId,
|
|
2068
|
-
className: cn(
|
|
2069
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
2070
|
-
),
|
|
2071
|
-
children: helperText
|
|
2072
|
-
}
|
|
2073
|
-
)
|
|
2074
|
-
] });
|
|
2075
|
-
}
|
|
2076
|
-
);
|
|
2077
|
-
FormField.displayName = "FormField";
|
|
2078
|
-
|
|
2079
|
-
// src/components/ui/date-picker.tsx
|
|
2080
|
-
var React6 = __toESM(require("react"));
|
|
2081
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2006
|
+
...props
|
|
2007
|
+
}
|
|
2008
|
+
);
|
|
2009
|
+
}
|
|
2082
2010
|
|
|
2083
|
-
// src/components/ui/
|
|
2084
|
-
var
|
|
2085
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2011
|
+
// src/components/ui/separator.tsx
|
|
2012
|
+
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
2086
2013
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2087
|
-
|
|
2088
|
-
|
|
2014
|
+
function Separator2({
|
|
2015
|
+
className,
|
|
2016
|
+
orientation = "horizontal",
|
|
2017
|
+
decorative = true,
|
|
2018
|
+
...props
|
|
2019
|
+
}) {
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2021
|
+
SeparatorPrimitive.Root,
|
|
2022
|
+
{
|
|
2023
|
+
"data-slot": "separator",
|
|
2024
|
+
decorative,
|
|
2025
|
+
orientation,
|
|
2026
|
+
className: cn(
|
|
2027
|
+
"bg-subtle shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
2028
|
+
className
|
|
2029
|
+
),
|
|
2030
|
+
...props
|
|
2031
|
+
}
|
|
2032
|
+
);
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
// src/components/ui/field.tsx
|
|
2036
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2037
|
+
function FieldSet({ className, ...props }) {
|
|
2038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2039
|
+
"fieldset",
|
|
2040
|
+
{
|
|
2041
|
+
"data-slot": "field-set",
|
|
2042
|
+
className: cn(
|
|
2043
|
+
"flex flex-col gap-6",
|
|
2044
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
2045
|
+
className
|
|
2046
|
+
),
|
|
2047
|
+
...props
|
|
2048
|
+
}
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
function FieldLegend({
|
|
2052
|
+
className,
|
|
2053
|
+
variant = "legend",
|
|
2054
|
+
...props
|
|
2055
|
+
}) {
|
|
2056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2057
|
+
"legend",
|
|
2058
|
+
{
|
|
2059
|
+
"data-slot": "field-legend",
|
|
2060
|
+
"data-variant": variant,
|
|
2061
|
+
className: cn(
|
|
2062
|
+
"mb-3 font-medium",
|
|
2063
|
+
"data-[variant=legend]:text-base",
|
|
2064
|
+
"data-[variant=label]:text-sm",
|
|
2065
|
+
className
|
|
2066
|
+
),
|
|
2067
|
+
...props
|
|
2068
|
+
}
|
|
2069
|
+
);
|
|
2070
|
+
}
|
|
2071
|
+
function FieldGroup({ className, ...props }) {
|
|
2072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2073
|
+
"div",
|
|
2074
|
+
{
|
|
2075
|
+
"data-slot": "field-group",
|
|
2076
|
+
className: cn(
|
|
2077
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
2078
|
+
className
|
|
2079
|
+
),
|
|
2080
|
+
...props
|
|
2081
|
+
}
|
|
2082
|
+
);
|
|
2083
|
+
}
|
|
2084
|
+
var fieldVariants = (0, import_class_variance_authority5.cva)(
|
|
2085
|
+
"group/field data-[invalid=true]:text-error flex w-full gap-3",
|
|
2089
2086
|
{
|
|
2090
2087
|
variants: {
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2088
|
+
orientation: {
|
|
2089
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
2090
|
+
horizontal: [
|
|
2091
|
+
"flex-row items-center",
|
|
2092
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
2093
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
2094
|
+
],
|
|
2095
|
+
responsive: [
|
|
2096
|
+
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
2097
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
2098
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
2099
|
+
]
|
|
2094
2100
|
}
|
|
2095
2101
|
},
|
|
2096
2102
|
defaultVariants: {
|
|
2097
|
-
|
|
2103
|
+
orientation: "vertical"
|
|
2098
2104
|
}
|
|
2099
2105
|
}
|
|
2100
2106
|
);
|
|
2101
|
-
|
|
2107
|
+
function Field({
|
|
2108
|
+
className,
|
|
2109
|
+
orientation = "vertical",
|
|
2110
|
+
...props
|
|
2111
|
+
}) {
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2113
|
+
"div",
|
|
2114
|
+
{
|
|
2115
|
+
role: "group",
|
|
2116
|
+
"data-slot": "field",
|
|
2117
|
+
"data-orientation": orientation,
|
|
2118
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
2119
|
+
...props
|
|
2120
|
+
}
|
|
2121
|
+
);
|
|
2122
|
+
}
|
|
2123
|
+
function FieldContent({ className, ...props }) {
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2125
|
+
"div",
|
|
2126
|
+
{
|
|
2127
|
+
"data-slot": "field-content",
|
|
2128
|
+
className: cn(
|
|
2129
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
2130
|
+
className
|
|
2131
|
+
),
|
|
2132
|
+
...props
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
}
|
|
2136
|
+
function FieldLabel({
|
|
2137
|
+
className,
|
|
2138
|
+
...props
|
|
2139
|
+
}) {
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2141
|
+
Label2,
|
|
2142
|
+
{
|
|
2143
|
+
"data-slot": "field-label",
|
|
2144
|
+
className: cn(
|
|
2145
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
2146
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
|
|
2147
|
+
"has-data-[state=checked]:bg-gray has-data-[state=checked]:border-dark",
|
|
2148
|
+
className
|
|
2149
|
+
),
|
|
2150
|
+
...props
|
|
2151
|
+
}
|
|
2152
|
+
);
|
|
2153
|
+
}
|
|
2154
|
+
function FieldTitle({ className, ...props }) {
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2156
|
+
"div",
|
|
2157
|
+
{
|
|
2158
|
+
"data-slot": "field-label",
|
|
2159
|
+
className: cn(
|
|
2160
|
+
"flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
2161
|
+
className
|
|
2162
|
+
),
|
|
2163
|
+
...props
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
function FieldDescription({ className, ...props }) {
|
|
2168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2169
|
+
"p",
|
|
2170
|
+
{
|
|
2171
|
+
"data-slot": "field-description",
|
|
2172
|
+
className: cn(
|
|
2173
|
+
"text-secondary text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
2174
|
+
"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
|
|
2175
|
+
"[&>a:hover]:text-dark [&>a]:underline [&>a]:underline-offset-4",
|
|
2176
|
+
className
|
|
2177
|
+
),
|
|
2178
|
+
...props
|
|
2179
|
+
}
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2182
|
+
function FieldSeparator({
|
|
2183
|
+
children,
|
|
2184
|
+
className,
|
|
2185
|
+
...props
|
|
2186
|
+
}) {
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2188
|
+
"div",
|
|
2189
|
+
{
|
|
2190
|
+
"data-slot": "field-separator",
|
|
2191
|
+
"data-content": !!children,
|
|
2192
|
+
className: cn(
|
|
2193
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
2194
|
+
className
|
|
2195
|
+
),
|
|
2196
|
+
...props,
|
|
2197
|
+
children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
2199
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2200
|
+
"span",
|
|
2201
|
+
{
|
|
2202
|
+
className: "bg-light text-secondary relative mx-auto block w-fit px-2",
|
|
2203
|
+
"data-slot": "field-separator-content",
|
|
2204
|
+
children
|
|
2205
|
+
}
|
|
2206
|
+
)
|
|
2207
|
+
]
|
|
2208
|
+
}
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
function FieldError({
|
|
2212
|
+
className,
|
|
2213
|
+
children,
|
|
2214
|
+
errors,
|
|
2215
|
+
...props
|
|
2216
|
+
}) {
|
|
2217
|
+
const content = (0, import_react.useMemo)(() => {
|
|
2218
|
+
if (children) {
|
|
2219
|
+
return children;
|
|
2220
|
+
}
|
|
2221
|
+
if (!errors) {
|
|
2222
|
+
return null;
|
|
2223
|
+
}
|
|
2224
|
+
if (errors?.length === 1 && errors[0]?.message) {
|
|
2225
|
+
return errors[0].message;
|
|
2226
|
+
}
|
|
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)
|
|
2229
|
+
) });
|
|
2230
|
+
}, [children, errors]);
|
|
2231
|
+
if (!content) {
|
|
2232
|
+
return null;
|
|
2233
|
+
}
|
|
2234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2235
|
+
"div",
|
|
2236
|
+
{
|
|
2237
|
+
role: "alert",
|
|
2238
|
+
"data-slot": "field-error",
|
|
2239
|
+
className: cn("text-error text-sm font-normal", className),
|
|
2240
|
+
...props,
|
|
2241
|
+
children: content
|
|
2242
|
+
}
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
// src/components/ui/date-picker.tsx
|
|
2247
|
+
var React5 = __toESM(require("react"));
|
|
2248
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2249
|
+
|
|
2250
|
+
// src/components/ui/input.tsx
|
|
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(
|
|
2102
2255
|
({
|
|
2103
2256
|
className,
|
|
2104
|
-
variant = "input",
|
|
2105
2257
|
style,
|
|
2106
2258
|
value,
|
|
2107
2259
|
onChange,
|
|
@@ -2110,7 +2262,7 @@ var Input = React5.forwardRef(
|
|
|
2110
2262
|
readOnly,
|
|
2111
2263
|
...props
|
|
2112
2264
|
}, ref) => {
|
|
2113
|
-
const [internalValue, setInternalValue] =
|
|
2265
|
+
const [internalValue, setInternalValue] = React4.useState(value || "");
|
|
2114
2266
|
const isControlled = value !== void 0;
|
|
2115
2267
|
const currentValue = isControlled ? value : internalValue;
|
|
2116
2268
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -2123,15 +2275,7 @@ var Input = React5.forwardRef(
|
|
|
2123
2275
|
if (!isControlled) {
|
|
2124
2276
|
setInternalValue(e.target.value);
|
|
2125
2277
|
}
|
|
2126
|
-
if (
|
|
2127
|
-
onChange(e);
|
|
2128
|
-
}
|
|
2129
|
-
};
|
|
2130
|
-
const handleTextareaChange = (e) => {
|
|
2131
|
-
if (!isControlled) {
|
|
2132
|
-
setInternalValue(e.target.value);
|
|
2133
|
-
}
|
|
2134
|
-
if (variant === "textarea" && onChange) {
|
|
2278
|
+
if (onChange) {
|
|
2135
2279
|
onChange(e);
|
|
2136
2280
|
}
|
|
2137
2281
|
};
|
|
@@ -2140,60 +2284,20 @@ var Input = React5.forwardRef(
|
|
|
2140
2284
|
setInternalValue("");
|
|
2141
2285
|
}
|
|
2142
2286
|
if (onChange) {
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
onChange(inputEvent);
|
|
2149
|
-
} else {
|
|
2150
|
-
const textareaEvent = {
|
|
2151
|
-
target: { value: "" },
|
|
2152
|
-
currentTarget: { value: "" }
|
|
2153
|
-
};
|
|
2154
|
-
onChange(
|
|
2155
|
-
textareaEvent
|
|
2156
|
-
);
|
|
2157
|
-
}
|
|
2287
|
+
const inputEvent = {
|
|
2288
|
+
target: { value: "" },
|
|
2289
|
+
currentTarget: { value: "" }
|
|
2290
|
+
};
|
|
2291
|
+
onChange(inputEvent);
|
|
2158
2292
|
}
|
|
2159
2293
|
onClear?.();
|
|
2160
2294
|
};
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2164
|
-
"textarea",
|
|
2165
|
-
{
|
|
2166
|
-
className: cn(
|
|
2167
|
-
inputVariants({ variant }),
|
|
2168
|
-
(showClear || showLock) && "pr-10",
|
|
2169
|
-
className
|
|
2170
|
-
),
|
|
2171
|
-
style: tokenStyles,
|
|
2172
|
-
ref,
|
|
2173
|
-
value: currentValue,
|
|
2174
|
-
onChange: handleTextareaChange,
|
|
2175
|
-
readOnly,
|
|
2176
|
-
...props
|
|
2177
|
-
}
|
|
2178
|
-
),
|
|
2179
|
-
showClear && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2180
|
-
"button",
|
|
2181
|
-
{
|
|
2182
|
-
type: "button",
|
|
2183
|
-
onClick: handleClear,
|
|
2184
|
-
className: "absolute right-3 top-3 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
2185
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(X, { className: "h-4 w-4" })
|
|
2186
|
-
}
|
|
2187
|
-
),
|
|
2188
|
-
showLock && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Lock, { className: "absolute right-3 top-3 h-4 w-4 text-secondary" })
|
|
2189
|
-
] });
|
|
2190
|
-
}
|
|
2191
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative", children: [
|
|
2192
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2193
2297
|
"input",
|
|
2194
2298
|
{
|
|
2195
2299
|
className: cn(
|
|
2196
|
-
|
|
2300
|
+
inputBaseStyles,
|
|
2197
2301
|
(showClear || showLock) && "pr-10",
|
|
2198
2302
|
className
|
|
2199
2303
|
),
|
|
@@ -2205,24 +2309,23 @@ var Input = React5.forwardRef(
|
|
|
2205
2309
|
...props
|
|
2206
2310
|
}
|
|
2207
2311
|
),
|
|
2208
|
-
showClear && /* @__PURE__ */ (0,
|
|
2312
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2209
2313
|
"button",
|
|
2210
2314
|
{
|
|
2211
2315
|
type: "button",
|
|
2212
2316
|
onClick: handleClear,
|
|
2213
2317
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
2214
|
-
children: /* @__PURE__ */ (0,
|
|
2318
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(X, { className: "h-4 w-4" })
|
|
2215
2319
|
}
|
|
2216
2320
|
),
|
|
2217
|
-
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" })
|
|
2218
2322
|
] });
|
|
2219
2323
|
}
|
|
2220
2324
|
);
|
|
2221
2325
|
Input.displayName = "Input";
|
|
2222
|
-
var TypedInput = Input;
|
|
2223
2326
|
|
|
2224
2327
|
// src/components/ui/date-picker.tsx
|
|
2225
|
-
var
|
|
2328
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2226
2329
|
var getDayNames = () => {
|
|
2227
2330
|
const days = [];
|
|
2228
2331
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2258,7 +2361,7 @@ var formatDateInput = (date) => {
|
|
|
2258
2361
|
day: "2-digit"
|
|
2259
2362
|
});
|
|
2260
2363
|
};
|
|
2261
|
-
var DatePicker =
|
|
2364
|
+
var DatePicker = React5.forwardRef(
|
|
2262
2365
|
({
|
|
2263
2366
|
value,
|
|
2264
2367
|
onValueChange,
|
|
@@ -2277,19 +2380,19 @@ var DatePicker = React6.forwardRef(
|
|
|
2277
2380
|
if (isNaN(parsed.getTime())) return void 0;
|
|
2278
2381
|
return parsed;
|
|
2279
2382
|
};
|
|
2280
|
-
const [selectedDate, setSelectedDate] =
|
|
2383
|
+
const [selectedDate, setSelectedDate] = React5.useState(
|
|
2281
2384
|
value || parseDate(defaultValue)
|
|
2282
2385
|
);
|
|
2283
|
-
const [currentMonth, setCurrentMonth] =
|
|
2386
|
+
const [currentMonth, setCurrentMonth] = React5.useState(() => {
|
|
2284
2387
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
2285
2388
|
return new Date(date.getFullYear(), date.getMonth());
|
|
2286
2389
|
});
|
|
2287
|
-
const [open, setOpen] =
|
|
2288
|
-
const [inputValue, setInputValue] =
|
|
2390
|
+
const [open, setOpen] = React5.useState(false);
|
|
2391
|
+
const [inputValue, setInputValue] = React5.useState(() => {
|
|
2289
2392
|
const initialDate = value || parseDate(defaultValue);
|
|
2290
2393
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
2291
2394
|
});
|
|
2292
|
-
|
|
2395
|
+
React5.useEffect(() => {
|
|
2293
2396
|
setSelectedDate(value);
|
|
2294
2397
|
if (value) {
|
|
2295
2398
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -2300,7 +2403,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2300
2403
|
setInputValue("");
|
|
2301
2404
|
}
|
|
2302
2405
|
}, [value]);
|
|
2303
|
-
|
|
2406
|
+
React5.useEffect(() => {
|
|
2304
2407
|
if (value) return;
|
|
2305
2408
|
const parsedDefault = parseDate(defaultValue);
|
|
2306
2409
|
if (!parsedDefault) return;
|
|
@@ -2423,15 +2526,15 @@ var DatePicker = React6.forwardRef(
|
|
|
2423
2526
|
const months = getMonthNames();
|
|
2424
2527
|
const dayNames = getDayNames();
|
|
2425
2528
|
const years = generateYears();
|
|
2426
|
-
return /* @__PURE__ */ (0,
|
|
2529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2427
2530
|
PopoverPrimitive.Root,
|
|
2428
2531
|
{
|
|
2429
2532
|
open: disabled ? false : open,
|
|
2430
2533
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
2431
2534
|
children: [
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2434
|
-
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2537
|
+
Input,
|
|
2435
2538
|
{
|
|
2436
2539
|
ref,
|
|
2437
2540
|
value: inputValue,
|
|
@@ -2443,7 +2546,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2443
2546
|
...props
|
|
2444
2547
|
}
|
|
2445
2548
|
),
|
|
2446
|
-
/* @__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)(
|
|
2447
2550
|
Calendar,
|
|
2448
2551
|
{
|
|
2449
2552
|
className: cn(
|
|
@@ -2453,7 +2556,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2453
2556
|
}
|
|
2454
2557
|
) }) })
|
|
2455
2558
|
] }),
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2559
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2457
2560
|
PopoverPrimitive.Content,
|
|
2458
2561
|
{
|
|
2459
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",
|
|
@@ -2462,51 +2565,51 @@ var DatePicker = React6.forwardRef(
|
|
|
2462
2565
|
alignOffset: -12,
|
|
2463
2566
|
side: "bottom",
|
|
2464
2567
|
sticky: "always",
|
|
2465
|
-
children: /* @__PURE__ */ (0,
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2467
|
-
/* @__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)(
|
|
2468
2571
|
"button",
|
|
2469
2572
|
{
|
|
2470
2573
|
onClick: () => handleMonthChange("prev"),
|
|
2471
2574
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2472
|
-
children: /* @__PURE__ */ (0,
|
|
2575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronLeft, { className: "h-4 w-4" })
|
|
2473
2576
|
}
|
|
2474
2577
|
),
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
2476
|
-
/* @__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)(
|
|
2477
2580
|
Select,
|
|
2478
2581
|
{
|
|
2479
2582
|
value: currentMonth.getMonth().toString(),
|
|
2480
2583
|
onValueChange: handleMonthSelect,
|
|
2481
2584
|
children: [
|
|
2482
|
-
/* @__PURE__ */ (0,
|
|
2483
|
-
/* @__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)) })
|
|
2484
2587
|
]
|
|
2485
2588
|
}
|
|
2486
2589
|
),
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2488
2591
|
Select,
|
|
2489
2592
|
{
|
|
2490
2593
|
value: currentMonth.getFullYear().toString(),
|
|
2491
2594
|
onValueChange: handleYearSelect,
|
|
2492
2595
|
children: [
|
|
2493
|
-
/* @__PURE__ */ (0,
|
|
2494
|
-
/* @__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)) })
|
|
2495
2598
|
]
|
|
2496
2599
|
}
|
|
2497
2600
|
)
|
|
2498
2601
|
] }),
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2500
2603
|
"button",
|
|
2501
2604
|
{
|
|
2502
2605
|
onClick: () => handleMonthChange("next"),
|
|
2503
2606
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2504
|
-
children: /* @__PURE__ */ (0,
|
|
2607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronRight, { className: "h-4 w-4" })
|
|
2505
2608
|
}
|
|
2506
2609
|
)
|
|
2507
2610
|
] }),
|
|
2508
|
-
/* @__PURE__ */ (0,
|
|
2509
|
-
/* @__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)(
|
|
2510
2613
|
Typography,
|
|
2511
2614
|
{
|
|
2512
2615
|
variant: "label-xs-bold",
|
|
@@ -2516,11 +2619,11 @@ var DatePicker = React6.forwardRef(
|
|
|
2516
2619
|
},
|
|
2517
2620
|
day
|
|
2518
2621
|
)) }),
|
|
2519
|
-
/* @__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)(
|
|
2520
2623
|
"div",
|
|
2521
2624
|
{
|
|
2522
2625
|
className: "h-8 w-8 flex items-center justify-center",
|
|
2523
|
-
children: date && /* @__PURE__ */ (0,
|
|
2626
|
+
children: date && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2524
2627
|
"button",
|
|
2525
2628
|
{
|
|
2526
2629
|
onClick: () => handleDateSelect(date),
|
|
@@ -2534,7 +2637,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2534
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",
|
|
2535
2638
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2536
2639
|
),
|
|
2537
|
-
children: /* @__PURE__ */ (0,
|
|
2640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2538
2641
|
}
|
|
2539
2642
|
)
|
|
2540
2643
|
},
|
|
@@ -2552,9 +2655,9 @@ var DatePicker = React6.forwardRef(
|
|
|
2552
2655
|
DatePicker.displayName = "DatePicker";
|
|
2553
2656
|
|
|
2554
2657
|
// src/components/ui/upload.tsx
|
|
2555
|
-
var
|
|
2658
|
+
var React6 = __toESM(require("react"));
|
|
2556
2659
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2557
|
-
var
|
|
2660
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2558
2661
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2559
2662
|
var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
2560
2663
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -2578,7 +2681,7 @@ var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
|
2578
2681
|
}
|
|
2579
2682
|
}
|
|
2580
2683
|
);
|
|
2581
|
-
var Upload =
|
|
2684
|
+
var Upload = React6.forwardRef(
|
|
2582
2685
|
({
|
|
2583
2686
|
className,
|
|
2584
2687
|
onFileSelect,
|
|
@@ -2591,8 +2694,8 @@ var Upload = React7.forwardRef(
|
|
|
2591
2694
|
selectedFiles = [],
|
|
2592
2695
|
...props
|
|
2593
2696
|
}, ref) => {
|
|
2594
|
-
const fileInputRef =
|
|
2595
|
-
const [isDragOver, setIsDragOver] =
|
|
2697
|
+
const fileInputRef = React6.useRef(null);
|
|
2698
|
+
const [isDragOver, setIsDragOver] = React6.useState(false);
|
|
2596
2699
|
const getFileTypeDisplay = () => {
|
|
2597
2700
|
const typeMap = {
|
|
2598
2701
|
"application/pdf": "PDF",
|
|
@@ -2656,17 +2759,17 @@ var Upload = React7.forwardRef(
|
|
|
2656
2759
|
const renderContent = () => {
|
|
2657
2760
|
switch (effectiveState) {
|
|
2658
2761
|
case "error":
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2660
2763
|
"div",
|
|
2661
2764
|
{
|
|
2662
2765
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2663
2766
|
style: { gap: "32px" },
|
|
2664
2767
|
children: [
|
|
2665
|
-
/* @__PURE__ */ (0,
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2667
|
-
/* @__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 })
|
|
2668
2771
|
] }),
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2670
2773
|
Button,
|
|
2671
2774
|
{
|
|
2672
2775
|
variant: "destructive",
|
|
@@ -2680,22 +2783,22 @@ var Upload = React7.forwardRef(
|
|
|
2680
2783
|
}
|
|
2681
2784
|
);
|
|
2682
2785
|
case "uploading":
|
|
2683
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2684
2787
|
"div",
|
|
2685
2788
|
{
|
|
2686
2789
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2687
2790
|
style: { gap: "32px" },
|
|
2688
2791
|
children: [
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2690
|
-
/* @__PURE__ */ (0,
|
|
2691
|
-
/* @__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)(
|
|
2692
2795
|
"div",
|
|
2693
2796
|
{
|
|
2694
2797
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2695
2798
|
style: { width: `${progress}%` }
|
|
2696
2799
|
}
|
|
2697
2800
|
) }),
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2699
2802
|
Typography,
|
|
2700
2803
|
{
|
|
2701
2804
|
variant: "body-sm",
|
|
@@ -2711,29 +2814,29 @@ var Upload = React7.forwardRef(
|
|
|
2711
2814
|
}
|
|
2712
2815
|
);
|
|
2713
2816
|
case "success":
|
|
2714
|
-
return /* @__PURE__ */ (0,
|
|
2817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2715
2818
|
"div",
|
|
2716
2819
|
{
|
|
2717
2820
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2718
2821
|
style: { gap: "32px" },
|
|
2719
|
-
children: /* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
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)) })
|
|
2722
2825
|
] })
|
|
2723
2826
|
}
|
|
2724
2827
|
);
|
|
2725
2828
|
default:
|
|
2726
|
-
return /* @__PURE__ */ (0,
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2727
2830
|
"div",
|
|
2728
2831
|
{
|
|
2729
2832
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2730
2833
|
style: { gap: "32px" },
|
|
2731
2834
|
children: [
|
|
2732
|
-
/* @__PURE__ */ (0,
|
|
2733
|
-
/* @__PURE__ */ (0,
|
|
2734
|
-
/* @__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" })
|
|
2735
2838
|
] }),
|
|
2736
|
-
/* @__PURE__ */ (0,
|
|
2839
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2737
2840
|
Button,
|
|
2738
2841
|
{
|
|
2739
2842
|
variant: "default",
|
|
@@ -2747,10 +2850,10 @@ var Upload = React7.forwardRef(
|
|
|
2747
2850
|
children: "Choose files"
|
|
2748
2851
|
}
|
|
2749
2852
|
),
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2751
2854
|
"Supported file: ",
|
|
2752
2855
|
getFileTypeDisplay(),
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("br", {}),
|
|
2754
2857
|
"Max: ",
|
|
2755
2858
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2756
2859
|
" MB each"
|
|
@@ -2760,7 +2863,7 @@ var Upload = React7.forwardRef(
|
|
|
2760
2863
|
);
|
|
2761
2864
|
}
|
|
2762
2865
|
};
|
|
2763
|
-
return /* @__PURE__ */ (0,
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2764
2867
|
"div",
|
|
2765
2868
|
{
|
|
2766
2869
|
ref,
|
|
@@ -2784,7 +2887,7 @@ var Upload = React7.forwardRef(
|
|
|
2784
2887
|
"aria-disabled": disabled,
|
|
2785
2888
|
...props,
|
|
2786
2889
|
children: [
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2788
2891
|
"input",
|
|
2789
2892
|
{
|
|
2790
2893
|
ref: fileInputRef,
|
|
@@ -2804,28 +2907,53 @@ var Upload = React7.forwardRef(
|
|
|
2804
2907
|
Upload.displayName = "Upload";
|
|
2805
2908
|
|
|
2806
2909
|
// src/components/ui/checkbox.tsx
|
|
2807
|
-
var
|
|
2910
|
+
var React7 = __toESM(require("react"));
|
|
2808
2911
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
2809
2912
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
2810
|
-
var
|
|
2913
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2811
2914
|
var checkboxVariants = (0, import_class_variance_authority7.cva)(
|
|
2812
|
-
"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"
|
|
2813
2916
|
);
|
|
2814
|
-
var Checkbox =
|
|
2917
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2815
2918
|
CheckboxPrimitive.Root,
|
|
2816
2919
|
{
|
|
2817
2920
|
ref,
|
|
2818
2921
|
className: cn(checkboxVariants(), className),
|
|
2819
2922
|
...props,
|
|
2820
|
-
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" }) })
|
|
2821
2924
|
}
|
|
2822
2925
|
));
|
|
2823
2926
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2824
2927
|
|
|
2928
|
+
// src/components/ui/textarea.tsx
|
|
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) => {
|
|
2933
|
+
const tokenStyles = {
|
|
2934
|
+
font: "var(--typography-label-md-regular)",
|
|
2935
|
+
...style
|
|
2936
|
+
};
|
|
2937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2938
|
+
"textarea",
|
|
2939
|
+
{
|
|
2940
|
+
className: cn(
|
|
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",
|
|
2942
|
+
className
|
|
2943
|
+
),
|
|
2944
|
+
style: tokenStyles,
|
|
2945
|
+
ref,
|
|
2946
|
+
...props
|
|
2947
|
+
}
|
|
2948
|
+
);
|
|
2949
|
+
}
|
|
2950
|
+
);
|
|
2951
|
+
Textarea.displayName = "Textarea";
|
|
2952
|
+
|
|
2825
2953
|
// src/components/ui/badge.tsx
|
|
2826
2954
|
var React9 = __toESM(require("react"));
|
|
2827
2955
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2828
|
-
var
|
|
2956
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2829
2957
|
var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
2830
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",
|
|
2831
2959
|
{
|
|
@@ -2858,7 +2986,7 @@ var Badge = React9.forwardRef(
|
|
|
2858
2986
|
...typographyStyles,
|
|
2859
2987
|
...style
|
|
2860
2988
|
};
|
|
2861
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2862
2990
|
"span",
|
|
2863
2991
|
{
|
|
2864
2992
|
className: cn(
|
|
@@ -2878,7 +3006,7 @@ Badge.displayName = "Badge";
|
|
|
2878
3006
|
// src/components/ui/tabs.tsx
|
|
2879
3007
|
var React10 = __toESM(require("react"));
|
|
2880
3008
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
2881
|
-
var
|
|
3009
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2882
3010
|
var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
2883
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",
|
|
2884
3012
|
{
|
|
@@ -2919,13 +3047,13 @@ var Tabs = React10.forwardRef((props, ref) => {
|
|
|
2919
3047
|
}),
|
|
2920
3048
|
[value, onValueChange, variant]
|
|
2921
3049
|
);
|
|
2922
|
-
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 }) });
|
|
2923
3051
|
});
|
|
2924
3052
|
Tabs.displayName = "Tabs";
|
|
2925
3053
|
var TabsList = React10.forwardRef(
|
|
2926
3054
|
(props, ref) => {
|
|
2927
3055
|
const { className, children, ...restProps } = props;
|
|
2928
|
-
return /* @__PURE__ */ (0,
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2929
3057
|
"div",
|
|
2930
3058
|
{
|
|
2931
3059
|
ref,
|
|
@@ -2964,7 +3092,7 @@ var TabsTrigger = React10.forwardRef(
|
|
|
2964
3092
|
if (disabled) return;
|
|
2965
3093
|
setActiveTab(value);
|
|
2966
3094
|
}, [disabled, setActiveTab, value]);
|
|
2967
|
-
return /* @__PURE__ */ (0,
|
|
3095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2968
3096
|
"button",
|
|
2969
3097
|
{
|
|
2970
3098
|
ref,
|
|
@@ -2978,7 +3106,7 @@ var TabsTrigger = React10.forwardRef(
|
|
|
2978
3106
|
disabled,
|
|
2979
3107
|
onClick: handleClick,
|
|
2980
3108
|
...restProps,
|
|
2981
|
-
children: /* @__PURE__ */ (0,
|
|
3109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "pl-3 pr-6 py-2", children })
|
|
2982
3110
|
}
|
|
2983
3111
|
);
|
|
2984
3112
|
}
|
|
@@ -2995,7 +3123,7 @@ var TabsContent = React10.forwardRef(
|
|
|
2995
3123
|
if (!isActive) {
|
|
2996
3124
|
return null;
|
|
2997
3125
|
}
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
3126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2999
3127
|
"div",
|
|
3000
3128
|
{
|
|
3001
3129
|
ref,
|
|
@@ -3015,9 +3143,9 @@ TabsContent.displayName = "TabsContent";
|
|
|
3015
3143
|
// src/components/ui/dropdown-menu.tsx
|
|
3016
3144
|
var React11 = __toESM(require("react"));
|
|
3017
3145
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3018
|
-
var
|
|
3146
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3019
3147
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3020
|
-
var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3148
|
+
var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3021
3149
|
DropdownMenuPrimitive.Trigger,
|
|
3022
3150
|
{
|
|
3023
3151
|
ref,
|
|
@@ -3027,7 +3155,7 @@ var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...pr
|
|
|
3027
3155
|
),
|
|
3028
3156
|
...props,
|
|
3029
3157
|
children: [
|
|
3030
|
-
icon || /* @__PURE__ */ (0,
|
|
3158
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MoreMenu, { className: "size-4" }),
|
|
3031
3159
|
children
|
|
3032
3160
|
]
|
|
3033
3161
|
}
|
|
@@ -3037,7 +3165,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3037
3165
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3038
3166
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3039
3167
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3040
|
-
var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3168
|
+
var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3041
3169
|
DropdownMenuPrimitive.SubTrigger,
|
|
3042
3170
|
{
|
|
3043
3171
|
ref,
|
|
@@ -3050,12 +3178,12 @@ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, .
|
|
|
3050
3178
|
...props,
|
|
3051
3179
|
children: [
|
|
3052
3180
|
children,
|
|
3053
|
-
/* @__PURE__ */ (0,
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronRight, { className: "ml-auto" })
|
|
3054
3182
|
]
|
|
3055
3183
|
}
|
|
3056
3184
|
));
|
|
3057
3185
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3058
|
-
var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3186
|
+
var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3059
3187
|
DropdownMenuPrimitive.SubContent,
|
|
3060
3188
|
{
|
|
3061
3189
|
ref,
|
|
@@ -3067,7 +3195,7 @@ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) =
|
|
|
3067
3195
|
}
|
|
3068
3196
|
));
|
|
3069
3197
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3070
|
-
var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0,
|
|
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)(
|
|
3071
3199
|
DropdownMenuPrimitive.Content,
|
|
3072
3200
|
{
|
|
3073
3201
|
ref,
|
|
@@ -3081,7 +3209,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align
|
|
|
3081
3209
|
}
|
|
3082
3210
|
) }));
|
|
3083
3211
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3084
|
-
var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3212
|
+
var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3085
3213
|
DropdownMenuPrimitive.Item,
|
|
3086
3214
|
{
|
|
3087
3215
|
ref,
|
|
@@ -3098,7 +3226,7 @@ var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }
|
|
|
3098
3226
|
}
|
|
3099
3227
|
));
|
|
3100
3228
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3101
|
-
var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3229
|
+
var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3102
3230
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3103
3231
|
{
|
|
3104
3232
|
ref,
|
|
@@ -3113,7 +3241,7 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style,
|
|
|
3113
3241
|
},
|
|
3114
3242
|
...props,
|
|
3115
3243
|
children: [
|
|
3116
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3117
3245
|
Checkbox,
|
|
3118
3246
|
{
|
|
3119
3247
|
checked: checked === true,
|
|
@@ -3121,12 +3249,12 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style,
|
|
|
3121
3249
|
"aria-hidden": "true"
|
|
3122
3250
|
}
|
|
3123
3251
|
),
|
|
3124
|
-
/* @__PURE__ */ (0,
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex-1", children })
|
|
3125
3253
|
]
|
|
3126
3254
|
}
|
|
3127
3255
|
));
|
|
3128
3256
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3129
|
-
var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3257
|
+
var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3130
3258
|
DropdownMenuPrimitive.RadioItem,
|
|
3131
3259
|
{
|
|
3132
3260
|
ref,
|
|
@@ -3140,13 +3268,13 @@ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ..
|
|
|
3140
3268
|
},
|
|
3141
3269
|
...props,
|
|
3142
3270
|
children: [
|
|
3143
|
-
/* @__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" }) }) }),
|
|
3144
3272
|
children
|
|
3145
3273
|
]
|
|
3146
3274
|
}
|
|
3147
3275
|
));
|
|
3148
3276
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3149
|
-
var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3277
|
+
var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3150
3278
|
DropdownMenuPrimitive.Label,
|
|
3151
3279
|
{
|
|
3152
3280
|
ref,
|
|
@@ -3159,7 +3287,7 @@ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3159
3287
|
}
|
|
3160
3288
|
));
|
|
3161
3289
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3162
|
-
var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3290
|
+
var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3163
3291
|
DropdownMenuPrimitive.Separator,
|
|
3164
3292
|
{
|
|
3165
3293
|
ref,
|
|
@@ -3172,7 +3300,7 @@ var DropdownMenuShortcut = ({
|
|
|
3172
3300
|
className,
|
|
3173
3301
|
...props
|
|
3174
3302
|
}) => {
|
|
3175
|
-
return /* @__PURE__ */ (0,
|
|
3303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3176
3304
|
"span",
|
|
3177
3305
|
{
|
|
3178
3306
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3183,21 +3311,21 @@ var DropdownMenuShortcut = ({
|
|
|
3183
3311
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3184
3312
|
|
|
3185
3313
|
// src/components/ui/charts/chart-legend.tsx
|
|
3186
|
-
var
|
|
3314
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3187
3315
|
function ChartLegend({
|
|
3188
3316
|
items,
|
|
3189
3317
|
x = 0,
|
|
3190
3318
|
y = 550,
|
|
3191
3319
|
className = ""
|
|
3192
3320
|
}) {
|
|
3193
|
-
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)(
|
|
3194
3322
|
"div",
|
|
3195
3323
|
{
|
|
3196
3324
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
3197
3325
|
style: { height: "100%" },
|
|
3198
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3200
|
-
/* @__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 })
|
|
3201
3329
|
] }, key))
|
|
3202
3330
|
}
|
|
3203
3331
|
) });
|
|
@@ -3315,12 +3443,12 @@ var formatLargeNumber = (value) => {
|
|
|
3315
3443
|
};
|
|
3316
3444
|
|
|
3317
3445
|
// src/components/ui/charts/chart-labels.tsx
|
|
3318
|
-
var
|
|
3446
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3319
3447
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
3320
3448
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
3321
3449
|
if (!viewBox) return null;
|
|
3322
3450
|
const { x, y, width } = viewBox;
|
|
3323
|
-
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 }) }) }) });
|
|
3324
3452
|
};
|
|
3325
3453
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
3326
3454
|
return CustomXAxisLabel;
|
|
@@ -3330,7 +3458,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
3330
3458
|
if (!viewBox) return null;
|
|
3331
3459
|
const { x, y, height } = viewBox;
|
|
3332
3460
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
3333
|
-
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 }) }) }) });
|
|
3334
3462
|
};
|
|
3335
3463
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
3336
3464
|
return CustomYAxisLabel;
|
|
@@ -3339,14 +3467,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
3339
3467
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
3340
3468
|
if (!viewBox) return null;
|
|
3341
3469
|
const { x, y, width, height } = viewBox;
|
|
3342
|
-
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 }) }) }) });
|
|
3343
3471
|
};
|
|
3344
3472
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
3345
3473
|
return CustomYAxisRightLabel;
|
|
3346
3474
|
};
|
|
3347
3475
|
var customXAxisTick = (props) => {
|
|
3348
3476
|
const { x, y, payload } = props;
|
|
3349
|
-
return /* @__PURE__ */ (0,
|
|
3477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3350
3478
|
"foreignObject",
|
|
3351
3479
|
{
|
|
3352
3480
|
x: -20,
|
|
@@ -3354,12 +3482,12 @@ var customXAxisTick = (props) => {
|
|
|
3354
3482
|
width: 40,
|
|
3355
3483
|
height: 20,
|
|
3356
3484
|
style: { overflow: "visible" },
|
|
3357
|
-
children: /* @__PURE__ */ (0,
|
|
3485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3358
3486
|
"div",
|
|
3359
3487
|
{
|
|
3360
3488
|
className: "flex items-start justify-center h-full",
|
|
3361
3489
|
style: { overflow: "visible" },
|
|
3362
|
-
children: /* @__PURE__ */ (0,
|
|
3490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3363
3491
|
Typography,
|
|
3364
3492
|
{
|
|
3365
3493
|
variant: "body-xs",
|
|
@@ -3374,7 +3502,7 @@ var customXAxisTick = (props) => {
|
|
|
3374
3502
|
};
|
|
3375
3503
|
var customXAxisTickRotated = (props) => {
|
|
3376
3504
|
const { x, y, payload } = props;
|
|
3377
|
-
return /* @__PURE__ */ (0,
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3378
3506
|
"text",
|
|
3379
3507
|
{
|
|
3380
3508
|
x: 0,
|
|
@@ -3393,25 +3521,25 @@ var customYAxisTick = (props) => {
|
|
|
3393
3521
|
const { x, y, payload } = props;
|
|
3394
3522
|
const text = String(payload.value);
|
|
3395
3523
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
3396
|
-
return /* @__PURE__ */ (0,
|
|
3524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3397
3525
|
"foreignObject",
|
|
3398
3526
|
{
|
|
3399
3527
|
x: x - estimatedWidth + 5,
|
|
3400
3528
|
y: y - 6,
|
|
3401
3529
|
width: estimatedWidth,
|
|
3402
3530
|
height: 15,
|
|
3403
|
-
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 }) })
|
|
3404
3532
|
}
|
|
3405
3533
|
);
|
|
3406
3534
|
};
|
|
3407
3535
|
|
|
3408
3536
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
3409
|
-
var
|
|
3537
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3410
3538
|
function TooltipContainer({
|
|
3411
3539
|
children,
|
|
3412
3540
|
className = ""
|
|
3413
3541
|
}) {
|
|
3414
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3415
3543
|
"div",
|
|
3416
3544
|
{
|
|
3417
3545
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -3425,10 +3553,10 @@ function TooltipItem({
|
|
|
3425
3553
|
value,
|
|
3426
3554
|
className = ""
|
|
3427
3555
|
}) {
|
|
3428
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3431
|
-
/* @__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)(
|
|
3432
3560
|
"span",
|
|
3433
3561
|
{
|
|
3434
3562
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -3446,9 +3574,9 @@ function GenericTooltip({
|
|
|
3446
3574
|
items,
|
|
3447
3575
|
className = ""
|
|
3448
3576
|
}) {
|
|
3449
|
-
return /* @__PURE__ */ (0,
|
|
3450
|
-
title && /* @__PURE__ */ (0,
|
|
3451
|
-
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)(
|
|
3452
3580
|
TooltipItem,
|
|
3453
3581
|
{
|
|
3454
3582
|
color: item.color,
|
|
@@ -3461,10 +3589,10 @@ function GenericTooltip({
|
|
|
3461
3589
|
}
|
|
3462
3590
|
|
|
3463
3591
|
// src/components/ui/charts/bar-chart.tsx
|
|
3464
|
-
var
|
|
3592
|
+
var import_react2 = require("react");
|
|
3465
3593
|
var import_recharts = require("recharts");
|
|
3466
|
-
var
|
|
3467
|
-
var BarChart = (0,
|
|
3594
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3595
|
+
var BarChart = (0, import_react2.forwardRef)(
|
|
3468
3596
|
({
|
|
3469
3597
|
data,
|
|
3470
3598
|
xAxisKey,
|
|
@@ -3490,19 +3618,19 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3490
3618
|
};
|
|
3491
3619
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
3492
3620
|
const hasData = data && data.length > 0;
|
|
3493
|
-
return /* @__PURE__ */ (0,
|
|
3621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3494
3622
|
"div",
|
|
3495
3623
|
{
|
|
3496
3624
|
ref,
|
|
3497
3625
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3498
3626
|
children: [
|
|
3499
|
-
/* @__PURE__ */ (0,
|
|
3500
|
-
/* @__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)(
|
|
3501
3629
|
import_recharts.ResponsiveContainer,
|
|
3502
3630
|
{
|
|
3503
3631
|
width: "100%",
|
|
3504
3632
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3505
|
-
children: /* @__PURE__ */ (0,
|
|
3633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3506
3634
|
import_recharts.BarChart,
|
|
3507
3635
|
{
|
|
3508
3636
|
data,
|
|
@@ -3514,7 +3642,7 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3514
3642
|
onClick: handleClick,
|
|
3515
3643
|
layout,
|
|
3516
3644
|
children: [
|
|
3517
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3518
3646
|
import_recharts.XAxis,
|
|
3519
3647
|
{
|
|
3520
3648
|
dataKey: xAxisKey,
|
|
@@ -3528,7 +3656,7 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3528
3656
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
3529
3657
|
}
|
|
3530
3658
|
),
|
|
3531
|
-
/* @__PURE__ */ (0,
|
|
3659
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3532
3660
|
import_recharts.YAxis,
|
|
3533
3661
|
{
|
|
3534
3662
|
axisLine: false,
|
|
@@ -3539,7 +3667,7 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3539
3667
|
type: yAxisType
|
|
3540
3668
|
}
|
|
3541
3669
|
),
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3543
3671
|
import_recharts.Tooltip,
|
|
3544
3672
|
{
|
|
3545
3673
|
content: ({
|
|
@@ -3548,7 +3676,7 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3548
3676
|
label
|
|
3549
3677
|
}) => {
|
|
3550
3678
|
if (active && payload && payload.length) {
|
|
3551
|
-
return /* @__PURE__ */ (0,
|
|
3679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3552
3680
|
GenericTooltip,
|
|
3553
3681
|
{
|
|
3554
3682
|
title: label?.toString(),
|
|
@@ -3564,7 +3692,7 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3564
3692
|
}
|
|
3565
3693
|
}
|
|
3566
3694
|
),
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3568
3696
|
import_recharts.Bar,
|
|
3569
3697
|
{
|
|
3570
3698
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -3572,12 +3700,12 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3572
3700
|
name: barDataKey || yAxisKey
|
|
3573
3701
|
}
|
|
3574
3702
|
),
|
|
3575
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3703
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3576
3704
|
]
|
|
3577
3705
|
}
|
|
3578
3706
|
)
|
|
3579
3707
|
}
|
|
3580
|
-
) : /* @__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" }) }) })
|
|
3581
3709
|
]
|
|
3582
3710
|
}
|
|
3583
3711
|
);
|
|
@@ -3586,10 +3714,10 @@ var BarChart = (0, import_react.forwardRef)(
|
|
|
3586
3714
|
BarChart.displayName = "BarChart";
|
|
3587
3715
|
|
|
3588
3716
|
// src/components/ui/charts/line-chart.tsx
|
|
3589
|
-
var
|
|
3717
|
+
var import_react3 = require("react");
|
|
3590
3718
|
var import_recharts2 = require("recharts");
|
|
3591
|
-
var
|
|
3592
|
-
var LineChart = (0,
|
|
3719
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3720
|
+
var LineChart = (0, import_react3.forwardRef)(
|
|
3593
3721
|
({
|
|
3594
3722
|
data,
|
|
3595
3723
|
xAxisKey,
|
|
@@ -3617,19 +3745,19 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3617
3745
|
)
|
|
3618
3746
|
);
|
|
3619
3747
|
const hasData = data && data.length > 0;
|
|
3620
|
-
return /* @__PURE__ */ (0,
|
|
3748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3621
3749
|
"div",
|
|
3622
3750
|
{
|
|
3623
3751
|
ref,
|
|
3624
3752
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3625
3753
|
children: [
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3627
|
-
/* @__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)(
|
|
3628
3756
|
import_recharts2.ResponsiveContainer,
|
|
3629
3757
|
{
|
|
3630
3758
|
width: "100%",
|
|
3631
3759
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3632
|
-
children: /* @__PURE__ */ (0,
|
|
3760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3633
3761
|
import_recharts2.LineChart,
|
|
3634
3762
|
{
|
|
3635
3763
|
data,
|
|
@@ -3640,7 +3768,7 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3640
3768
|
},
|
|
3641
3769
|
onClick: handleClick,
|
|
3642
3770
|
children: [
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3644
3772
|
import_recharts2.XAxis,
|
|
3645
3773
|
{
|
|
3646
3774
|
dataKey: xAxisKey,
|
|
@@ -3652,7 +3780,7 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3652
3780
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
3653
3781
|
}
|
|
3654
3782
|
),
|
|
3655
|
-
/* @__PURE__ */ (0,
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3656
3784
|
import_recharts2.YAxis,
|
|
3657
3785
|
{
|
|
3658
3786
|
axisLine: false,
|
|
@@ -3661,7 +3789,7 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3661
3789
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
3662
3790
|
}
|
|
3663
3791
|
),
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3665
3793
|
import_recharts2.Tooltip,
|
|
3666
3794
|
{
|
|
3667
3795
|
content: ({
|
|
@@ -3670,7 +3798,7 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3670
3798
|
label
|
|
3671
3799
|
}) => {
|
|
3672
3800
|
if (active && payload && payload.length) {
|
|
3673
|
-
return /* @__PURE__ */ (0,
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3674
3802
|
GenericTooltip,
|
|
3675
3803
|
{
|
|
3676
3804
|
title: label?.toString(),
|
|
@@ -3686,7 +3814,7 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3686
3814
|
}
|
|
3687
3815
|
}
|
|
3688
3816
|
),
|
|
3689
|
-
series.map((s, index) => /* @__PURE__ */ (0,
|
|
3817
|
+
series.map((s, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3690
3818
|
import_recharts2.Line,
|
|
3691
3819
|
{
|
|
3692
3820
|
type: "monotone",
|
|
@@ -3698,12 +3826,12 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3698
3826
|
},
|
|
3699
3827
|
s.dataKey
|
|
3700
3828
|
)),
|
|
3701
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3829
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3702
3830
|
]
|
|
3703
3831
|
}
|
|
3704
3832
|
)
|
|
3705
3833
|
}
|
|
3706
|
-
) : /* @__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" }) }) })
|
|
3707
3835
|
]
|
|
3708
3836
|
}
|
|
3709
3837
|
);
|
|
@@ -3712,10 +3840,10 @@ var LineChart = (0, import_react2.forwardRef)(
|
|
|
3712
3840
|
LineChart.displayName = "LineChart";
|
|
3713
3841
|
|
|
3714
3842
|
// src/components/ui/charts/pie-chart.tsx
|
|
3715
|
-
var
|
|
3843
|
+
var import_react4 = require("react");
|
|
3716
3844
|
var import_recharts3 = require("recharts");
|
|
3717
|
-
var
|
|
3718
|
-
var PieChart = (0,
|
|
3845
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3846
|
+
var PieChart = (0, import_react4.forwardRef)(
|
|
3719
3847
|
({
|
|
3720
3848
|
data,
|
|
3721
3849
|
title,
|
|
@@ -3742,20 +3870,20 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3742
3870
|
)
|
|
3743
3871
|
);
|
|
3744
3872
|
const hasData = data && data.length > 0;
|
|
3745
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3746
3874
|
"div",
|
|
3747
3875
|
{
|
|
3748
3876
|
ref,
|
|
3749
3877
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3750
3878
|
children: [
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3752
|
-
/* @__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)(
|
|
3753
3881
|
import_recharts3.PieChart,
|
|
3754
3882
|
{
|
|
3755
3883
|
width: 600,
|
|
3756
3884
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
3757
3885
|
children: [
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3759
3887
|
import_recharts3.Pie,
|
|
3760
3888
|
{
|
|
3761
3889
|
data,
|
|
@@ -3767,7 +3895,7 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3767
3895
|
label: showLabels,
|
|
3768
3896
|
labelLine: false,
|
|
3769
3897
|
onClick: handleClick,
|
|
3770
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
3898
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3771
3899
|
import_recharts3.Cell,
|
|
3772
3900
|
{
|
|
3773
3901
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -3776,7 +3904,7 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3776
3904
|
))
|
|
3777
3905
|
}
|
|
3778
3906
|
),
|
|
3779
|
-
/* @__PURE__ */ (0,
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3780
3908
|
import_recharts3.Tooltip,
|
|
3781
3909
|
{
|
|
3782
3910
|
content: ({
|
|
@@ -3785,7 +3913,7 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3785
3913
|
}) => {
|
|
3786
3914
|
if (active && payload && payload.length && payload[0]) {
|
|
3787
3915
|
const data2 = payload[0].payload;
|
|
3788
|
-
return /* @__PURE__ */ (0,
|
|
3916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3789
3917
|
GenericTooltip,
|
|
3790
3918
|
{
|
|
3791
3919
|
title: data2.name,
|
|
@@ -3803,10 +3931,10 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3803
3931
|
}
|
|
3804
3932
|
}
|
|
3805
3933
|
),
|
|
3806
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
3934
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
3807
3935
|
]
|
|
3808
3936
|
}
|
|
3809
|
-
) }) : /* @__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" }) }) })
|
|
3810
3938
|
]
|
|
3811
3939
|
}
|
|
3812
3940
|
);
|
|
@@ -3815,9 +3943,9 @@ var PieChart = (0, import_react3.forwardRef)(
|
|
|
3815
3943
|
PieChart.displayName = "PieChart";
|
|
3816
3944
|
|
|
3817
3945
|
// src/components/ui/table.tsx
|
|
3818
|
-
var
|
|
3946
|
+
var import_react5 = require("react");
|
|
3819
3947
|
var import_react_table = require("@tanstack/react-table");
|
|
3820
|
-
var
|
|
3948
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3821
3949
|
function Table({
|
|
3822
3950
|
table,
|
|
3823
3951
|
className,
|
|
@@ -3829,33 +3957,33 @@ function Table({
|
|
|
3829
3957
|
const totalPages = table.getPageCount();
|
|
3830
3958
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
3831
3959
|
const showingText = totalRows > 0 ? "Showing " + (currentPage * pageSize + 1) + "-" + Math.min((currentPage + 1) * pageSize, totalRows) + " of " + totalRows + " results" : "No results found";
|
|
3832
|
-
const handlePreviousPage = (0,
|
|
3960
|
+
const handlePreviousPage = (0, import_react5.useCallback)(() => {
|
|
3833
3961
|
table.previousPage();
|
|
3834
3962
|
}, [table]);
|
|
3835
|
-
const handleNextPage = (0,
|
|
3963
|
+
const handleNextPage = (0, import_react5.useCallback)(() => {
|
|
3836
3964
|
table.nextPage();
|
|
3837
3965
|
}, [table]);
|
|
3838
|
-
const handlePageChange = (0,
|
|
3966
|
+
const handlePageChange = (0, import_react5.useCallback)(
|
|
3839
3967
|
(pageIndex) => {
|
|
3840
3968
|
table.setPageIndex(pageIndex);
|
|
3841
3969
|
},
|
|
3842
3970
|
[table]
|
|
3843
3971
|
);
|
|
3844
|
-
const handlePageSizeChange = (0,
|
|
3972
|
+
const handlePageSizeChange = (0, import_react5.useCallback)(
|
|
3845
3973
|
(value) => {
|
|
3846
3974
|
table.setPageSize(Number(value));
|
|
3847
3975
|
},
|
|
3848
3976
|
[table]
|
|
3849
3977
|
);
|
|
3850
|
-
return /* @__PURE__ */ (0,
|
|
3851
|
-
/* @__PURE__ */ (0,
|
|
3852
|
-
/* @__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)(
|
|
3853
3981
|
"div",
|
|
3854
3982
|
{
|
|
3855
3983
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
3856
3984
|
onClick: header.column.getToggleSortingHandler(),
|
|
3857
3985
|
children: [
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3859
3987
|
Typography,
|
|
3860
3988
|
{
|
|
3861
3989
|
variant: "label-xs",
|
|
@@ -3866,19 +3994,19 @@ function Table({
|
|
|
3866
3994
|
)
|
|
3867
3995
|
}
|
|
3868
3996
|
),
|
|
3869
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
3870
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0,
|
|
3871
|
-
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" })
|
|
3872
4000
|
] })
|
|
3873
4001
|
]
|
|
3874
4002
|
}
|
|
3875
4003
|
) }, header.id)) }, headerGroup.id)) }),
|
|
3876
|
-
/* @__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)(
|
|
3877
4005
|
cell.column.columnDef.cell,
|
|
3878
4006
|
cell.getContext()
|
|
3879
4007
|
) }) }, cell.id)) }, row.id)) })
|
|
3880
4008
|
] }) }),
|
|
3881
|
-
showPagination && /* @__PURE__ */ (0,
|
|
4009
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3882
4010
|
"div",
|
|
3883
4011
|
{
|
|
3884
4012
|
className: cn(
|
|
@@ -3886,9 +4014,9 @@ function Table({
|
|
|
3886
4014
|
paginationClassName
|
|
3887
4015
|
),
|
|
3888
4016
|
children: [
|
|
3889
|
-
/* @__PURE__ */ (0,
|
|
3890
|
-
/* @__PURE__ */ (0,
|
|
3891
|
-
/* @__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)(
|
|
3892
4020
|
Button,
|
|
3893
4021
|
{
|
|
3894
4022
|
variant: "ghost",
|
|
@@ -3896,7 +4024,7 @@ function Table({
|
|
|
3896
4024
|
onClick: handlePreviousPage,
|
|
3897
4025
|
disabled: !table.getCanPreviousPage(),
|
|
3898
4026
|
className: "p-2",
|
|
3899
|
-
children: /* @__PURE__ */ (0,
|
|
4027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronLeft, { className: "w-4 h-4" })
|
|
3900
4028
|
}
|
|
3901
4029
|
),
|
|
3902
4030
|
Array.from(
|
|
@@ -3913,7 +4041,7 @@ function Table({
|
|
|
3913
4041
|
pageNumber = currentPage - 2 + i;
|
|
3914
4042
|
}
|
|
3915
4043
|
const isActive = pageNumber === currentPage;
|
|
3916
|
-
return /* @__PURE__ */ (0,
|
|
4044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3917
4045
|
Button,
|
|
3918
4046
|
{
|
|
3919
4047
|
variant: isActive ? "default" : "ghost",
|
|
@@ -3926,11 +4054,11 @@ function Table({
|
|
|
3926
4054
|
);
|
|
3927
4055
|
}
|
|
3928
4056
|
),
|
|
3929
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0,
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
3931
|
-
/* @__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 })
|
|
3932
4060
|
] }),
|
|
3933
|
-
/* @__PURE__ */ (0,
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3934
4062
|
Button,
|
|
3935
4063
|
{
|
|
3936
4064
|
variant: "ghost",
|
|
@@ -3938,12 +4066,12 @@ function Table({
|
|
|
3938
4066
|
onClick: handleNextPage,
|
|
3939
4067
|
disabled: !table.getCanNextPage(),
|
|
3940
4068
|
className: "p-2",
|
|
3941
|
-
children: /* @__PURE__ */ (0,
|
|
4069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronRight, { className: "w-4 h-4" })
|
|
3942
4070
|
}
|
|
3943
4071
|
)
|
|
3944
4072
|
] }),
|
|
3945
|
-
/* @__PURE__ */ (0,
|
|
3946
|
-
/* @__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)(
|
|
3947
4075
|
Typography,
|
|
3948
4076
|
{
|
|
3949
4077
|
variant: "body-sm",
|
|
@@ -3951,14 +4079,14 @@ function Table({
|
|
|
3951
4079
|
children: "Rows per page:"
|
|
3952
4080
|
}
|
|
3953
4081
|
),
|
|
3954
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3955
4083
|
Select,
|
|
3956
4084
|
{
|
|
3957
4085
|
value: table.getState().pagination.pageSize.toString(),
|
|
3958
4086
|
onValueChange: handlePageSizeChange,
|
|
3959
4087
|
children: [
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
3961
|
-
/* @__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)) })
|
|
3962
4090
|
]
|
|
3963
4091
|
}
|
|
3964
4092
|
)
|
|
@@ -4025,9 +4153,18 @@ function Table({
|
|
|
4025
4153
|
Exclamation,
|
|
4026
4154
|
EyeClosed,
|
|
4027
4155
|
EyeOpen,
|
|
4156
|
+
Field,
|
|
4157
|
+
FieldContent,
|
|
4158
|
+
FieldDescription,
|
|
4159
|
+
FieldError,
|
|
4160
|
+
FieldGroup,
|
|
4161
|
+
FieldLabel,
|
|
4162
|
+
FieldLegend,
|
|
4163
|
+
FieldSeparator,
|
|
4164
|
+
FieldSet,
|
|
4165
|
+
FieldTitle,
|
|
4028
4166
|
Filter,
|
|
4029
4167
|
FilterDescending,
|
|
4030
|
-
FormField,
|
|
4031
4168
|
GenericTooltip,
|
|
4032
4169
|
GraphBar,
|
|
4033
4170
|
GraphDonut,
|
|
@@ -4037,6 +4174,7 @@ function Table({
|
|
|
4037
4174
|
Home,
|
|
4038
4175
|
Information,
|
|
4039
4176
|
Input,
|
|
4177
|
+
Label,
|
|
4040
4178
|
LineChart,
|
|
4041
4179
|
Location,
|
|
4042
4180
|
Lock,
|
|
@@ -4058,6 +4196,7 @@ function Table({
|
|
|
4058
4196
|
SelectSeparator,
|
|
4059
4197
|
SelectTrigger,
|
|
4060
4198
|
SelectValue,
|
|
4199
|
+
Separator,
|
|
4061
4200
|
Share,
|
|
4062
4201
|
Star,
|
|
4063
4202
|
Statement,
|
|
@@ -4067,6 +4206,7 @@ function Table({
|
|
|
4067
4206
|
TabsContent,
|
|
4068
4207
|
TabsList,
|
|
4069
4208
|
TabsTrigger,
|
|
4209
|
+
Textarea,
|
|
4070
4210
|
TooltipContainer,
|
|
4071
4211
|
TooltipItem,
|
|
4072
4212
|
Trash,
|
|
@@ -4093,7 +4233,6 @@ function Table({
|
|
|
4093
4233
|
getHeatmapColor,
|
|
4094
4234
|
getPerformanceColor,
|
|
4095
4235
|
getSeriesColor,
|
|
4096
|
-
inputVariants,
|
|
4097
4236
|
selectTriggerVariants,
|
|
4098
4237
|
tabsVariants,
|
|
4099
4238
|
typographyVariants,
|