@northslopetech/altitude-ui 2.1.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -16
- package/dist/index.d.mts +118 -28
- package/dist/index.d.ts +118 -28
- package/dist/index.js +563 -329
- package/dist/index.mjs +564 -333
- package/dist/pdf.worker.min.mjs +28 -0
- package/package.json +6 -3
package/dist/index.mjs
CHANGED
|
@@ -1650,11 +1650,59 @@ var Logout = ({
|
|
|
1650
1650
|
]
|
|
1651
1651
|
}
|
|
1652
1652
|
);
|
|
1653
|
+
var Print = ({
|
|
1654
|
+
className,
|
|
1655
|
+
variant = "dark",
|
|
1656
|
+
...props
|
|
1657
|
+
}) => /* @__PURE__ */ jsx2(
|
|
1658
|
+
"svg",
|
|
1659
|
+
{
|
|
1660
|
+
width: "16",
|
|
1661
|
+
height: "16",
|
|
1662
|
+
viewBox: "0 0 16 16",
|
|
1663
|
+
fill: "none",
|
|
1664
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1665
|
+
className: cn(getVariantStyles(variant), className),
|
|
1666
|
+
...props,
|
|
1667
|
+
children: /* @__PURE__ */ jsx2(
|
|
1668
|
+
"path",
|
|
1669
|
+
{
|
|
1670
|
+
d: "M12.9 5.33333H3.1C1.938 5.33333 1 6.22667 1 7.33333V11.3333H3.8V14H12.2V11.3333H15V7.33333C15 6.22667 14.062 5.33333 12.9 5.33333ZM10.8 12.6667H5.2V9.33333H10.8V12.6667ZM12.9 8C12.515 8 12.2 7.7 12.2 7.33333C12.2 6.96667 12.515 6.66667 12.9 6.66667C13.285 6.66667 13.6 6.96667 13.6 7.33333C13.6 7.7 13.285 8 12.9 8ZM12.2 2H3.8V4.66667H12.2V2Z",
|
|
1671
|
+
fill: "#161616"
|
|
1672
|
+
}
|
|
1673
|
+
)
|
|
1674
|
+
}
|
|
1675
|
+
);
|
|
1676
|
+
var Download = ({
|
|
1677
|
+
className,
|
|
1678
|
+
variant = "dark",
|
|
1679
|
+
...props
|
|
1680
|
+
}) => /* @__PURE__ */ jsx2(
|
|
1681
|
+
"svg",
|
|
1682
|
+
{
|
|
1683
|
+
width: "16",
|
|
1684
|
+
height: "16",
|
|
1685
|
+
viewBox: "0 0 16 16",
|
|
1686
|
+
fill: "none",
|
|
1687
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1688
|
+
className: cn(getVariantStyles(variant), className),
|
|
1689
|
+
...props,
|
|
1690
|
+
children: /* @__PURE__ */ jsx2(
|
|
1691
|
+
"path",
|
|
1692
|
+
{
|
|
1693
|
+
fillRule: "evenodd",
|
|
1694
|
+
clipRule: "evenodd",
|
|
1695
|
+
d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.1464 9.31042L8.3535 12.1033C8.15824 12.2986 7.84166 12.2986 7.6464 12.1033L4.8535 9.31042C4.53852 8.99543 4.76161 8.45686 5.20706 8.45686H6.99995V4.75C6.99995 4.19772 7.44767 3.75 7.99995 3.75C8.55224 3.75 8.99995 4.19772 8.99995 4.75V8.45686H10.7928C11.2383 8.45686 11.4614 8.99543 11.1464 9.31042Z",
|
|
1696
|
+
fill: "#161616"
|
|
1697
|
+
}
|
|
1698
|
+
)
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1653
1701
|
|
|
1654
1702
|
// src/components/ui/select.tsx
|
|
1655
1703
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1656
1704
|
var selectTriggerVariants = cva4(
|
|
1657
|
-
"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",
|
|
1705
|
+
"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",
|
|
1658
1706
|
{
|
|
1659
1707
|
variants: {
|
|
1660
1708
|
width: {
|
|
@@ -1699,7 +1747,7 @@ var SelectTrigger = React3.forwardRef(({ className, children, style, width, ...p
|
|
|
1699
1747
|
ref,
|
|
1700
1748
|
className: cn(
|
|
1701
1749
|
selectTriggerVariants({ width }),
|
|
1702
|
-
"
|
|
1750
|
+
"data-[state=open]:[&_svg]:rotate-180 data-[placeholder]:text-secondary h-10 py-2",
|
|
1703
1751
|
className
|
|
1704
1752
|
),
|
|
1705
1753
|
style: tokenStyles,
|
|
@@ -1810,121 +1858,18 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1810
1858
|
));
|
|
1811
1859
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1812
1860
|
|
|
1813
|
-
// src/components/ui/form-field.tsx
|
|
1814
|
-
import * as React4 from "react";
|
|
1815
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1816
|
-
var FormField = React4.forwardRef(
|
|
1817
|
-
({
|
|
1818
|
-
label,
|
|
1819
|
-
helperText,
|
|
1820
|
-
error = false,
|
|
1821
|
-
required = false,
|
|
1822
|
-
children,
|
|
1823
|
-
className,
|
|
1824
|
-
id,
|
|
1825
|
-
compact = false,
|
|
1826
|
-
...props
|
|
1827
|
-
}, ref) => {
|
|
1828
|
-
const generatedId = React4.useId();
|
|
1829
|
-
const fieldId = id || generatedId;
|
|
1830
|
-
const helperTextId = `${fieldId}-helper`;
|
|
1831
|
-
const labelId = `${fieldId}-label`;
|
|
1832
|
-
if (compact) {
|
|
1833
|
-
return /* @__PURE__ */ jsxs4("div", { ref, className: cn("w-full space-y-2", className), ...props, children: [
|
|
1834
|
-
/* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
1835
|
-
React4.cloneElement(
|
|
1836
|
-
children,
|
|
1837
|
-
{
|
|
1838
|
-
id: fieldId,
|
|
1839
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
1840
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
1841
|
-
"aria-required": required,
|
|
1842
|
-
"aria-invalid": error,
|
|
1843
|
-
className: cn(
|
|
1844
|
-
"pt-7 pb-2 h-14 items-end",
|
|
1845
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
1846
|
-
children.props.className
|
|
1847
|
-
)
|
|
1848
|
-
}
|
|
1849
|
-
),
|
|
1850
|
-
label && /* @__PURE__ */ jsx4(
|
|
1851
|
-
"label",
|
|
1852
|
-
{
|
|
1853
|
-
id: labelId,
|
|
1854
|
-
htmlFor: fieldId,
|
|
1855
|
-
className: "absolute left-3 top-2 text-xs text-semantic-text-info [font:var(--typography-label-xs-bold)] pointer-events-none",
|
|
1856
|
-
children: label
|
|
1857
|
-
}
|
|
1858
|
-
)
|
|
1859
|
-
] }),
|
|
1860
|
-
helperText && /* @__PURE__ */ jsx4(
|
|
1861
|
-
Typography,
|
|
1862
|
-
{
|
|
1863
|
-
variant: "body-xs",
|
|
1864
|
-
id: helperTextId,
|
|
1865
|
-
className: cn(
|
|
1866
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
1867
|
-
),
|
|
1868
|
-
children: helperText
|
|
1869
|
-
}
|
|
1870
|
-
)
|
|
1871
|
-
] });
|
|
1872
|
-
}
|
|
1873
|
-
return /* @__PURE__ */ jsxs4("div", { ref, className: cn("w-full space-y-3", className), ...props, children: [
|
|
1874
|
-
(label || required) && /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between", children: [
|
|
1875
|
-
label && /* @__PURE__ */ jsx4(
|
|
1876
|
-
"label",
|
|
1877
|
-
{
|
|
1878
|
-
id: labelId,
|
|
1879
|
-
htmlFor: fieldId,
|
|
1880
|
-
className: "text-semantic-text-primary [font:var(--typography-label-sm-regular)]",
|
|
1881
|
-
children: label
|
|
1882
|
-
}
|
|
1883
|
-
),
|
|
1884
|
-
required && /* @__PURE__ */ jsx4("span", { className: "text-semantic-text-secondary [font:var(--typography-label-xs-regular)]", children: "*required" })
|
|
1885
|
-
] }),
|
|
1886
|
-
React4.cloneElement(
|
|
1887
|
-
children,
|
|
1888
|
-
{
|
|
1889
|
-
id: fieldId,
|
|
1890
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
1891
|
-
"aria-describedby": helperText ? helperTextId : void 0,
|
|
1892
|
-
"aria-required": required,
|
|
1893
|
-
"aria-invalid": error,
|
|
1894
|
-
className: cn(
|
|
1895
|
-
error ? "border-2 border-error-500 focus:border-error-500" : "",
|
|
1896
|
-
children.props.className
|
|
1897
|
-
)
|
|
1898
|
-
}
|
|
1899
|
-
),
|
|
1900
|
-
helperText && /* @__PURE__ */ jsx4(
|
|
1901
|
-
Typography,
|
|
1902
|
-
{
|
|
1903
|
-
variant: "body-xs",
|
|
1904
|
-
id: helperTextId,
|
|
1905
|
-
className: cn(
|
|
1906
|
-
error ? "text-semantic-text-error" : "text-semantic-text-secondary"
|
|
1907
|
-
),
|
|
1908
|
-
children: helperText
|
|
1909
|
-
}
|
|
1910
|
-
)
|
|
1911
|
-
] });
|
|
1912
|
-
}
|
|
1913
|
-
);
|
|
1914
|
-
FormField.displayName = "FormField";
|
|
1915
|
-
|
|
1916
1861
|
// src/components/ui/field.tsx
|
|
1917
1862
|
import { useMemo } from "react";
|
|
1918
1863
|
import { cva as cva5 } from "class-variance-authority";
|
|
1919
1864
|
|
|
1920
1865
|
// src/components/ui/label.tsx
|
|
1921
1866
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1922
|
-
import { jsx as
|
|
1867
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1923
1868
|
function Label2({
|
|
1924
1869
|
className,
|
|
1925
1870
|
...props
|
|
1926
1871
|
}) {
|
|
1927
|
-
return /* @__PURE__ */
|
|
1872
|
+
return /* @__PURE__ */ jsx4(
|
|
1928
1873
|
LabelPrimitive.Root,
|
|
1929
1874
|
{
|
|
1930
1875
|
"data-slot": "label",
|
|
@@ -1939,14 +1884,14 @@ function Label2({
|
|
|
1939
1884
|
|
|
1940
1885
|
// src/components/ui/separator.tsx
|
|
1941
1886
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1942
|
-
import { jsx as
|
|
1887
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1943
1888
|
function Separator2({
|
|
1944
1889
|
className,
|
|
1945
1890
|
orientation = "horizontal",
|
|
1946
1891
|
decorative = true,
|
|
1947
1892
|
...props
|
|
1948
1893
|
}) {
|
|
1949
|
-
return /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsx5(
|
|
1950
1895
|
SeparatorPrimitive.Root,
|
|
1951
1896
|
{
|
|
1952
1897
|
"data-slot": "separator",
|
|
@@ -1962,9 +1907,9 @@ function Separator2({
|
|
|
1962
1907
|
}
|
|
1963
1908
|
|
|
1964
1909
|
// src/components/ui/field.tsx
|
|
1965
|
-
import { jsx as
|
|
1910
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1966
1911
|
function FieldSet({ className, ...props }) {
|
|
1967
|
-
return /* @__PURE__ */
|
|
1912
|
+
return /* @__PURE__ */ jsx6(
|
|
1968
1913
|
"fieldset",
|
|
1969
1914
|
{
|
|
1970
1915
|
"data-slot": "field-set",
|
|
@@ -1982,7 +1927,7 @@ function FieldLegend({
|
|
|
1982
1927
|
variant = "legend",
|
|
1983
1928
|
...props
|
|
1984
1929
|
}) {
|
|
1985
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ jsx6(
|
|
1986
1931
|
"legend",
|
|
1987
1932
|
{
|
|
1988
1933
|
"data-slot": "field-legend",
|
|
@@ -1998,7 +1943,7 @@ function FieldLegend({
|
|
|
1998
1943
|
);
|
|
1999
1944
|
}
|
|
2000
1945
|
function FieldGroup({ className, ...props }) {
|
|
2001
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsx6(
|
|
2002
1947
|
"div",
|
|
2003
1948
|
{
|
|
2004
1949
|
"data-slot": "field-group",
|
|
@@ -2038,7 +1983,7 @@ function Field({
|
|
|
2038
1983
|
orientation = "vertical",
|
|
2039
1984
|
...props
|
|
2040
1985
|
}) {
|
|
2041
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ jsx6(
|
|
2042
1987
|
"div",
|
|
2043
1988
|
{
|
|
2044
1989
|
role: "group",
|
|
@@ -2050,7 +1995,7 @@ function Field({
|
|
|
2050
1995
|
);
|
|
2051
1996
|
}
|
|
2052
1997
|
function FieldContent({ className, ...props }) {
|
|
2053
|
-
return /* @__PURE__ */
|
|
1998
|
+
return /* @__PURE__ */ jsx6(
|
|
2054
1999
|
"div",
|
|
2055
2000
|
{
|
|
2056
2001
|
"data-slot": "field-content",
|
|
@@ -2066,7 +2011,7 @@ function FieldLabel({
|
|
|
2066
2011
|
className,
|
|
2067
2012
|
...props
|
|
2068
2013
|
}) {
|
|
2069
|
-
return /* @__PURE__ */
|
|
2014
|
+
return /* @__PURE__ */ jsx6(
|
|
2070
2015
|
Label2,
|
|
2071
2016
|
{
|
|
2072
2017
|
"data-slot": "field-label",
|
|
@@ -2081,7 +2026,7 @@ function FieldLabel({
|
|
|
2081
2026
|
);
|
|
2082
2027
|
}
|
|
2083
2028
|
function FieldTitle({ className, ...props }) {
|
|
2084
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsx6(
|
|
2085
2030
|
"div",
|
|
2086
2031
|
{
|
|
2087
2032
|
"data-slot": "field-label",
|
|
@@ -2094,7 +2039,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
2094
2039
|
);
|
|
2095
2040
|
}
|
|
2096
2041
|
function FieldDescription({ className, ...props }) {
|
|
2097
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ jsx6(
|
|
2098
2043
|
"p",
|
|
2099
2044
|
{
|
|
2100
2045
|
"data-slot": "field-description",
|
|
@@ -2113,7 +2058,7 @@ function FieldSeparator({
|
|
|
2113
2058
|
className,
|
|
2114
2059
|
...props
|
|
2115
2060
|
}) {
|
|
2116
|
-
return /* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ jsxs4(
|
|
2117
2062
|
"div",
|
|
2118
2063
|
{
|
|
2119
2064
|
"data-slot": "field-separator",
|
|
@@ -2124,8 +2069,8 @@ function FieldSeparator({
|
|
|
2124
2069
|
),
|
|
2125
2070
|
...props,
|
|
2126
2071
|
children: [
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
children && /* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ jsx6(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
2073
|
+
children && /* @__PURE__ */ jsx6(
|
|
2129
2074
|
"span",
|
|
2130
2075
|
{
|
|
2131
2076
|
className: "bg-light text-secondary relative mx-auto block w-fit px-2",
|
|
@@ -2153,14 +2098,14 @@ function FieldError({
|
|
|
2153
2098
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
2154
2099
|
return errors[0].message;
|
|
2155
2100
|
}
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
(error, index) => error?.message && /* @__PURE__ */
|
|
2101
|
+
return /* @__PURE__ */ jsx6("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
2102
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx6("li", { children: error.message }, index)
|
|
2158
2103
|
) });
|
|
2159
2104
|
}, [children, errors]);
|
|
2160
2105
|
if (!content) {
|
|
2161
2106
|
return null;
|
|
2162
2107
|
}
|
|
2163
|
-
return /* @__PURE__ */
|
|
2108
|
+
return /* @__PURE__ */ jsx6(
|
|
2164
2109
|
"div",
|
|
2165
2110
|
{
|
|
2166
2111
|
role: "alert",
|
|
@@ -2173,14 +2118,14 @@ function FieldError({
|
|
|
2173
2118
|
}
|
|
2174
2119
|
|
|
2175
2120
|
// src/components/ui/date-picker.tsx
|
|
2176
|
-
import * as
|
|
2121
|
+
import * as React5 from "react";
|
|
2177
2122
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2178
2123
|
|
|
2179
2124
|
// src/components/ui/input.tsx
|
|
2180
|
-
import * as
|
|
2181
|
-
import { jsx as
|
|
2182
|
-
var inputBaseStyles = "flex h-10 py-2 w-full border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50
|
|
2183
|
-
var Input =
|
|
2125
|
+
import * as React4 from "react";
|
|
2126
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2127
|
+
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";
|
|
2128
|
+
var Input = React4.forwardRef(
|
|
2184
2129
|
({
|
|
2185
2130
|
className,
|
|
2186
2131
|
style,
|
|
@@ -2191,7 +2136,7 @@ var Input = React5.forwardRef(
|
|
|
2191
2136
|
readOnly,
|
|
2192
2137
|
...props
|
|
2193
2138
|
}, ref) => {
|
|
2194
|
-
const [internalValue, setInternalValue] =
|
|
2139
|
+
const [internalValue, setInternalValue] = React4.useState(value || "");
|
|
2195
2140
|
const isControlled = value !== void 0;
|
|
2196
2141
|
const currentValue = isControlled ? value : internalValue;
|
|
2197
2142
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -2221,8 +2166,8 @@ var Input = React5.forwardRef(
|
|
|
2221
2166
|
}
|
|
2222
2167
|
onClear?.();
|
|
2223
2168
|
};
|
|
2224
|
-
return /* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
2170
|
+
/* @__PURE__ */ jsx7(
|
|
2226
2171
|
"input",
|
|
2227
2172
|
{
|
|
2228
2173
|
className: cn(
|
|
@@ -2238,23 +2183,23 @@ var Input = React5.forwardRef(
|
|
|
2238
2183
|
...props
|
|
2239
2184
|
}
|
|
2240
2185
|
),
|
|
2241
|
-
showClear && /* @__PURE__ */
|
|
2186
|
+
showClear && /* @__PURE__ */ jsx7(
|
|
2242
2187
|
"button",
|
|
2243
2188
|
{
|
|
2244
2189
|
type: "button",
|
|
2245
2190
|
onClick: handleClear,
|
|
2246
2191
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
2247
|
-
children: /* @__PURE__ */
|
|
2192
|
+
children: /* @__PURE__ */ jsx7(X, { className: "h-4 w-4" })
|
|
2248
2193
|
}
|
|
2249
2194
|
),
|
|
2250
|
-
showLock && /* @__PURE__ */
|
|
2195
|
+
showLock && /* @__PURE__ */ jsx7(Lock, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary" })
|
|
2251
2196
|
] });
|
|
2252
2197
|
}
|
|
2253
2198
|
);
|
|
2254
2199
|
Input.displayName = "Input";
|
|
2255
2200
|
|
|
2256
2201
|
// src/components/ui/date-picker.tsx
|
|
2257
|
-
import { jsx as
|
|
2202
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2258
2203
|
var getDayNames = () => {
|
|
2259
2204
|
const days = [];
|
|
2260
2205
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2290,7 +2235,7 @@ var formatDateInput = (date) => {
|
|
|
2290
2235
|
day: "2-digit"
|
|
2291
2236
|
});
|
|
2292
2237
|
};
|
|
2293
|
-
var DatePicker =
|
|
2238
|
+
var DatePicker = React5.forwardRef(
|
|
2294
2239
|
({
|
|
2295
2240
|
value,
|
|
2296
2241
|
onValueChange,
|
|
@@ -2309,19 +2254,19 @@ var DatePicker = React6.forwardRef(
|
|
|
2309
2254
|
if (isNaN(parsed.getTime())) return void 0;
|
|
2310
2255
|
return parsed;
|
|
2311
2256
|
};
|
|
2312
|
-
const [selectedDate, setSelectedDate] =
|
|
2257
|
+
const [selectedDate, setSelectedDate] = React5.useState(
|
|
2313
2258
|
value || parseDate(defaultValue)
|
|
2314
2259
|
);
|
|
2315
|
-
const [currentMonth, setCurrentMonth] =
|
|
2260
|
+
const [currentMonth, setCurrentMonth] = React5.useState(() => {
|
|
2316
2261
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
2317
2262
|
return new Date(date.getFullYear(), date.getMonth());
|
|
2318
2263
|
});
|
|
2319
|
-
const [open, setOpen] =
|
|
2320
|
-
const [inputValue, setInputValue] =
|
|
2264
|
+
const [open, setOpen] = React5.useState(false);
|
|
2265
|
+
const [inputValue, setInputValue] = React5.useState(() => {
|
|
2321
2266
|
const initialDate = value || parseDate(defaultValue);
|
|
2322
2267
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
2323
2268
|
});
|
|
2324
|
-
|
|
2269
|
+
React5.useEffect(() => {
|
|
2325
2270
|
setSelectedDate(value);
|
|
2326
2271
|
if (value) {
|
|
2327
2272
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -2332,7 +2277,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2332
2277
|
setInputValue("");
|
|
2333
2278
|
}
|
|
2334
2279
|
}, [value]);
|
|
2335
|
-
|
|
2280
|
+
React5.useEffect(() => {
|
|
2336
2281
|
if (value) return;
|
|
2337
2282
|
const parsedDefault = parseDate(defaultValue);
|
|
2338
2283
|
if (!parsedDefault) return;
|
|
@@ -2455,14 +2400,14 @@ var DatePicker = React6.forwardRef(
|
|
|
2455
2400
|
const months = getMonthNames();
|
|
2456
2401
|
const dayNames = getDayNames();
|
|
2457
2402
|
const years = generateYears();
|
|
2458
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ jsxs6(
|
|
2459
2404
|
PopoverPrimitive.Root,
|
|
2460
2405
|
{
|
|
2461
2406
|
open: disabled ? false : open,
|
|
2462
2407
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
2463
2408
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
2410
|
+
/* @__PURE__ */ jsx8(
|
|
2466
2411
|
Input,
|
|
2467
2412
|
{
|
|
2468
2413
|
ref,
|
|
@@ -2475,7 +2420,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2475
2420
|
...props
|
|
2476
2421
|
}
|
|
2477
2422
|
),
|
|
2478
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx8(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx8("button", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 hover:bg-gray rounded p-0.5 transition-colors", children: /* @__PURE__ */ jsx8(
|
|
2479
2424
|
Calendar,
|
|
2480
2425
|
{
|
|
2481
2426
|
className: cn(
|
|
@@ -2485,7 +2430,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2485
2430
|
}
|
|
2486
2431
|
) }) })
|
|
2487
2432
|
] }),
|
|
2488
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx8(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx8(
|
|
2489
2434
|
PopoverPrimitive.Content,
|
|
2490
2435
|
{
|
|
2491
2436
|
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",
|
|
@@ -2494,51 +2439,51 @@ var DatePicker = React6.forwardRef(
|
|
|
2494
2439
|
alignOffset: -12,
|
|
2495
2440
|
side: "bottom",
|
|
2496
2441
|
sticky: "always",
|
|
2497
|
-
children: /* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2442
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "p-4", children: [
|
|
2443
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
2444
|
+
/* @__PURE__ */ jsx8(
|
|
2500
2445
|
"button",
|
|
2501
2446
|
{
|
|
2502
2447
|
onClick: () => handleMonthChange("prev"),
|
|
2503
2448
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ jsx8(ChevronLeft, { className: "h-4 w-4" })
|
|
2505
2450
|
}
|
|
2506
2451
|
),
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
2453
|
+
/* @__PURE__ */ jsxs6(
|
|
2509
2454
|
Select,
|
|
2510
2455
|
{
|
|
2511
2456
|
value: currentMonth.getMonth().toString(),
|
|
2512
2457
|
onValueChange: handleMonthSelect,
|
|
2513
2458
|
children: [
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx8(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
|
|
2460
|
+
/* @__PURE__ */ jsx8(SelectContent, { children: months.map((month, index) => /* @__PURE__ */ jsx8(SelectItem, { value: index.toString(), children: month }, month)) })
|
|
2516
2461
|
]
|
|
2517
2462
|
}
|
|
2518
2463
|
),
|
|
2519
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsxs6(
|
|
2520
2465
|
Select,
|
|
2521
2466
|
{
|
|
2522
2467
|
value: currentMonth.getFullYear().toString(),
|
|
2523
2468
|
onValueChange: handleYearSelect,
|
|
2524
2469
|
children: [
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ jsx8(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
|
|
2471
|
+
/* @__PURE__ */ jsx8(SelectContent, { children: years.map((year) => /* @__PURE__ */ jsx8(SelectItem, { value: year.toString(), children: year }, year)) })
|
|
2527
2472
|
]
|
|
2528
2473
|
}
|
|
2529
2474
|
)
|
|
2530
2475
|
] }),
|
|
2531
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsx8(
|
|
2532
2477
|
"button",
|
|
2533
2478
|
{
|
|
2534
2479
|
onClick: () => handleMonthChange("next"),
|
|
2535
2480
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2536
|
-
children: /* @__PURE__ */
|
|
2481
|
+
children: /* @__PURE__ */ jsx8(ChevronRight, { className: "h-4 w-4" })
|
|
2537
2482
|
}
|
|
2538
2483
|
)
|
|
2539
2484
|
] }),
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
|
|
2486
|
+
/* @__PURE__ */ jsx8("div", { className: "grid grid-cols-7 gap-1 mb-2", children: dayNames.map((day) => /* @__PURE__ */ jsx8(
|
|
2542
2487
|
Typography,
|
|
2543
2488
|
{
|
|
2544
2489
|
variant: "label-xs-bold",
|
|
@@ -2548,11 +2493,11 @@ var DatePicker = React6.forwardRef(
|
|
|
2548
2493
|
},
|
|
2549
2494
|
day
|
|
2550
2495
|
)) }),
|
|
2551
|
-
/* @__PURE__ */
|
|
2496
|
+
/* @__PURE__ */ jsx8("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => /* @__PURE__ */ jsx8(
|
|
2552
2497
|
"div",
|
|
2553
2498
|
{
|
|
2554
2499
|
className: "h-8 w-8 flex items-center justify-center",
|
|
2555
|
-
children: date && /* @__PURE__ */
|
|
2500
|
+
children: date && /* @__PURE__ */ jsx8(
|
|
2556
2501
|
"button",
|
|
2557
2502
|
{
|
|
2558
2503
|
onClick: () => handleDateSelect(date),
|
|
@@ -2566,7 +2511,7 @@ var DatePicker = React6.forwardRef(
|
|
|
2566
2511
|
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",
|
|
2567
2512
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2568
2513
|
),
|
|
2569
|
-
children: /* @__PURE__ */
|
|
2514
|
+
children: /* @__PURE__ */ jsx8(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2570
2515
|
}
|
|
2571
2516
|
)
|
|
2572
2517
|
},
|
|
@@ -2584,9 +2529,9 @@ var DatePicker = React6.forwardRef(
|
|
|
2584
2529
|
DatePicker.displayName = "DatePicker";
|
|
2585
2530
|
|
|
2586
2531
|
// src/components/ui/upload.tsx
|
|
2587
|
-
import * as
|
|
2532
|
+
import * as React6 from "react";
|
|
2588
2533
|
import { cva as cva6 } from "class-variance-authority";
|
|
2589
|
-
import { jsx as
|
|
2534
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2590
2535
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2591
2536
|
var uploadVariants = cva6(
|
|
2592
2537
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -2610,7 +2555,7 @@ var uploadVariants = cva6(
|
|
|
2610
2555
|
}
|
|
2611
2556
|
}
|
|
2612
2557
|
);
|
|
2613
|
-
var Upload =
|
|
2558
|
+
var Upload = React6.forwardRef(
|
|
2614
2559
|
({
|
|
2615
2560
|
className,
|
|
2616
2561
|
onFileSelect,
|
|
@@ -2623,8 +2568,8 @@ var Upload = React7.forwardRef(
|
|
|
2623
2568
|
selectedFiles = [],
|
|
2624
2569
|
...props
|
|
2625
2570
|
}, ref) => {
|
|
2626
|
-
const fileInputRef =
|
|
2627
|
-
const [isDragOver, setIsDragOver] =
|
|
2571
|
+
const fileInputRef = React6.useRef(null);
|
|
2572
|
+
const [isDragOver, setIsDragOver] = React6.useState(false);
|
|
2628
2573
|
const getFileTypeDisplay = () => {
|
|
2629
2574
|
const typeMap = {
|
|
2630
2575
|
"application/pdf": "PDF",
|
|
@@ -2688,17 +2633,17 @@ var Upload = React7.forwardRef(
|
|
|
2688
2633
|
const renderContent = () => {
|
|
2689
2634
|
switch (effectiveState) {
|
|
2690
2635
|
case "error":
|
|
2691
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ jsxs7(
|
|
2692
2637
|
"div",
|
|
2693
2638
|
{
|
|
2694
2639
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2695
2640
|
style: { gap: "32px" },
|
|
2696
2641
|
children: [
|
|
2697
|
-
/* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
2699
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
2643
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "heading-sm", children: "Upload fail" }),
|
|
2644
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2700
2645
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ jsx9(
|
|
2702
2647
|
Button,
|
|
2703
2648
|
{
|
|
2704
2649
|
variant: "destructive",
|
|
@@ -2712,22 +2657,22 @@ var Upload = React7.forwardRef(
|
|
|
2712
2657
|
}
|
|
2713
2658
|
);
|
|
2714
2659
|
case "uploading":
|
|
2715
|
-
return /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsxs7(
|
|
2716
2661
|
"div",
|
|
2717
2662
|
{
|
|
2718
2663
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2719
2664
|
style: { gap: "32px" },
|
|
2720
2665
|
children: [
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "heading-sm", className: "text-dark", children: "Uploading files" }),
|
|
2667
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
2668
|
+
/* @__PURE__ */ jsx9("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ jsx9(
|
|
2724
2669
|
"div",
|
|
2725
2670
|
{
|
|
2726
2671
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2727
2672
|
style: { width: `${progress}%` }
|
|
2728
2673
|
}
|
|
2729
2674
|
) }),
|
|
2730
|
-
/* @__PURE__ */
|
|
2675
|
+
/* @__PURE__ */ jsxs7(
|
|
2731
2676
|
Typography,
|
|
2732
2677
|
{
|
|
2733
2678
|
variant: "body-sm",
|
|
@@ -2743,29 +2688,29 @@ var Upload = React7.forwardRef(
|
|
|
2743
2688
|
}
|
|
2744
2689
|
);
|
|
2745
2690
|
case "success":
|
|
2746
|
-
return /* @__PURE__ */
|
|
2691
|
+
return /* @__PURE__ */ jsx9(
|
|
2747
2692
|
"div",
|
|
2748
2693
|
{
|
|
2749
2694
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2750
2695
|
style: { gap: "32px" },
|
|
2751
|
-
children: /* @__PURE__ */
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
selectedFiles.length > 0 && /* @__PURE__ */
|
|
2696
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
2697
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "heading-sm", className: "text-success", children: "Upload successful!" }),
|
|
2698
|
+
selectedFiles.length > 0 && /* @__PURE__ */ jsx9("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ jsx9(Typography, { variant: "body-sm", children: file.name }, index)) })
|
|
2754
2699
|
] })
|
|
2755
2700
|
}
|
|
2756
2701
|
);
|
|
2757
2702
|
default:
|
|
2758
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ jsxs7(
|
|
2759
2704
|
"div",
|
|
2760
2705
|
{
|
|
2761
2706
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2762
2707
|
style: { gap: "32px" },
|
|
2763
2708
|
children: [
|
|
2764
|
-
/* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
2710
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "heading-sm", className: "text-dark", children: "Drag & drop files here" }),
|
|
2711
|
+
/* @__PURE__ */ jsx9(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2767
2712
|
] }),
|
|
2768
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ jsx9(
|
|
2769
2714
|
Button,
|
|
2770
2715
|
{
|
|
2771
2716
|
variant: "default",
|
|
@@ -2779,10 +2724,10 @@ var Upload = React7.forwardRef(
|
|
|
2779
2724
|
children: "Choose files"
|
|
2780
2725
|
}
|
|
2781
2726
|
),
|
|
2782
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsxs7(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2783
2728
|
"Supported file: ",
|
|
2784
2729
|
getFileTypeDisplay(),
|
|
2785
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx9("br", {}),
|
|
2786
2731
|
"Max: ",
|
|
2787
2732
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2788
2733
|
" MB each"
|
|
@@ -2792,7 +2737,7 @@ var Upload = React7.forwardRef(
|
|
|
2792
2737
|
);
|
|
2793
2738
|
}
|
|
2794
2739
|
};
|
|
2795
|
-
return /* @__PURE__ */
|
|
2740
|
+
return /* @__PURE__ */ jsxs7(
|
|
2796
2741
|
"div",
|
|
2797
2742
|
{
|
|
2798
2743
|
ref,
|
|
@@ -2816,7 +2761,7 @@ var Upload = React7.forwardRef(
|
|
|
2816
2761
|
"aria-disabled": disabled,
|
|
2817
2762
|
...props,
|
|
2818
2763
|
children: [
|
|
2819
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsx9(
|
|
2820
2765
|
"input",
|
|
2821
2766
|
{
|
|
2822
2767
|
ref: fileInputRef,
|
|
@@ -2836,39 +2781,38 @@ var Upload = React7.forwardRef(
|
|
|
2836
2781
|
Upload.displayName = "Upload";
|
|
2837
2782
|
|
|
2838
2783
|
// src/components/ui/checkbox.tsx
|
|
2839
|
-
import * as
|
|
2784
|
+
import * as React7 from "react";
|
|
2840
2785
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2841
2786
|
import { cva as cva7 } from "class-variance-authority";
|
|
2842
|
-
import { jsx as
|
|
2787
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2843
2788
|
var checkboxVariants = cva7(
|
|
2844
|
-
"peer size-4 shrink-0 rounded-[4px] border
|
|
2789
|
+
"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"
|
|
2845
2790
|
);
|
|
2846
|
-
var Checkbox =
|
|
2791
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
2847
2792
|
CheckboxPrimitive.Root,
|
|
2848
2793
|
{
|
|
2849
2794
|
ref,
|
|
2850
2795
|
className: cn(checkboxVariants(), className),
|
|
2851
2796
|
...props,
|
|
2852
|
-
children: /* @__PURE__ */
|
|
2797
|
+
children: /* @__PURE__ */ jsx10(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx10(CheckIcon, { variant: "light", className: "size-3" }) })
|
|
2853
2798
|
}
|
|
2854
2799
|
));
|
|
2855
2800
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2856
2801
|
|
|
2857
2802
|
// src/components/ui/textarea.tsx
|
|
2858
|
-
import * as
|
|
2859
|
-
import { jsx as
|
|
2860
|
-
var Textarea =
|
|
2861
|
-
({ className, style,
|
|
2803
|
+
import * as React8 from "react";
|
|
2804
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2805
|
+
var Textarea = React8.forwardRef(
|
|
2806
|
+
({ className, style, ...props }, ref) => {
|
|
2862
2807
|
const tokenStyles = {
|
|
2863
2808
|
font: "var(--typography-label-md-regular)",
|
|
2864
2809
|
...style
|
|
2865
2810
|
};
|
|
2866
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ jsx11(
|
|
2867
2812
|
"textarea",
|
|
2868
2813
|
{
|
|
2869
2814
|
className: cn(
|
|
2870
|
-
"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",
|
|
2871
|
-
error ? "border-error focus-visible:border-2 focus-visible:border-error" : "border-secondary focus-visible:border-2 focus-visible:border-strong disabled:border-secondary",
|
|
2815
|
+
"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",
|
|
2872
2816
|
className
|
|
2873
2817
|
),
|
|
2874
2818
|
style: tokenStyles,
|
|
@@ -2881,9 +2825,9 @@ var Textarea = React9.forwardRef(
|
|
|
2881
2825
|
Textarea.displayName = "Textarea";
|
|
2882
2826
|
|
|
2883
2827
|
// src/components/ui/badge.tsx
|
|
2884
|
-
import * as
|
|
2828
|
+
import * as React9 from "react";
|
|
2885
2829
|
import { cva as cva8 } from "class-variance-authority";
|
|
2886
|
-
import { jsx as
|
|
2830
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2887
2831
|
var badgeVariants = cva8(
|
|
2888
2832
|
"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",
|
|
2889
2833
|
{
|
|
@@ -2906,7 +2850,7 @@ var badgeVariants = cva8(
|
|
|
2906
2850
|
function getBadgeTypographyStyles() {
|
|
2907
2851
|
return { font: "var(--typography-label-sm-bold)" };
|
|
2908
2852
|
}
|
|
2909
|
-
var Badge =
|
|
2853
|
+
var Badge = React9.forwardRef(
|
|
2910
2854
|
({ className, variant, style, ...props }, ref) => {
|
|
2911
2855
|
if (!variant) {
|
|
2912
2856
|
return null;
|
|
@@ -2916,7 +2860,7 @@ var Badge = React10.forwardRef(
|
|
|
2916
2860
|
...typographyStyles,
|
|
2917
2861
|
...style
|
|
2918
2862
|
};
|
|
2919
|
-
return /* @__PURE__ */
|
|
2863
|
+
return /* @__PURE__ */ jsx12(
|
|
2920
2864
|
"span",
|
|
2921
2865
|
{
|
|
2922
2866
|
className: cn(
|
|
@@ -2933,10 +2877,294 @@ var Badge = React10.forwardRef(
|
|
|
2933
2877
|
);
|
|
2934
2878
|
Badge.displayName = "Badge";
|
|
2935
2879
|
|
|
2936
|
-
// src/components/
|
|
2880
|
+
// src/components/pdf-viewer/index.tsx
|
|
2881
|
+
import * as React14 from "react";
|
|
2882
|
+
import "react-pdf/dist/Page/TextLayer.css";
|
|
2883
|
+
|
|
2884
|
+
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
2885
|
+
import * as React10 from "react";
|
|
2886
|
+
import { Document, Page } from "react-pdf";
|
|
2887
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2888
|
+
var PdfDocument = ({
|
|
2889
|
+
file,
|
|
2890
|
+
pageWidth,
|
|
2891
|
+
enableTextLayer,
|
|
2892
|
+
onLoadSuccess,
|
|
2893
|
+
onLoadError
|
|
2894
|
+
}) => {
|
|
2895
|
+
const [numPages, setNumPages] = React10.useState();
|
|
2896
|
+
function handleDocumentLoadSuccess({ numPages: numPages2 }) {
|
|
2897
|
+
setNumPages(numPages2);
|
|
2898
|
+
onLoadSuccess?.(numPages2);
|
|
2899
|
+
}
|
|
2900
|
+
if (!file) {
|
|
2901
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx13(Typography, { variant: "body-md", className: "text-secondary", children: "No PDF available" }) });
|
|
2902
|
+
}
|
|
2903
|
+
return /* @__PURE__ */ jsx13(
|
|
2904
|
+
Document,
|
|
2905
|
+
{
|
|
2906
|
+
file,
|
|
2907
|
+
onLoadSuccess: handleDocumentLoadSuccess,
|
|
2908
|
+
onLoadError,
|
|
2909
|
+
loading: /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx13(Typography, { variant: "body-md", className: "text-secondary", children: "Rendering PDF..." }) }),
|
|
2910
|
+
error: /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx13(Typography, { variant: "body-md", className: "text-error", children: "Failed to render PDF" }) }),
|
|
2911
|
+
className: "flex flex-col items-center p-4",
|
|
2912
|
+
children: numPages && pageWidth > 0 && Array.from(new Array(numPages), (_, index) => /* @__PURE__ */ jsx13(
|
|
2913
|
+
Page,
|
|
2914
|
+
{
|
|
2915
|
+
pageNumber: index + 1,
|
|
2916
|
+
width: pageWidth,
|
|
2917
|
+
className: "mb-4 shadow-sm",
|
|
2918
|
+
renderTextLayer: enableTextLayer,
|
|
2919
|
+
renderAnnotationLayer: false
|
|
2920
|
+
},
|
|
2921
|
+
`page_${index + 1}`
|
|
2922
|
+
))
|
|
2923
|
+
}
|
|
2924
|
+
);
|
|
2925
|
+
};
|
|
2926
|
+
PdfDocument.displayName = "PdfDocument";
|
|
2927
|
+
|
|
2928
|
+
// src/components/pdf-viewer/components/PdfHeader.tsx
|
|
2929
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2930
|
+
var PdfHeader = ({
|
|
2931
|
+
title,
|
|
2932
|
+
onDownload,
|
|
2933
|
+
onPrint
|
|
2934
|
+
}) => {
|
|
2935
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between gap-4 px-4 py-3 bg-neutral-400 border-b border-subtle", children: [
|
|
2936
|
+
/* @__PURE__ */ jsx14("div", { className: "flex-shrink min-w-0", children: /* @__PURE__ */ jsx14(
|
|
2937
|
+
Typography,
|
|
2938
|
+
{
|
|
2939
|
+
variant: "label-md-bold",
|
|
2940
|
+
className: "text-dark truncate",
|
|
2941
|
+
title,
|
|
2942
|
+
children: title || "Untitled Document"
|
|
2943
|
+
}
|
|
2944
|
+
) }),
|
|
2945
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
2946
|
+
/* @__PURE__ */ jsx14(
|
|
2947
|
+
"button",
|
|
2948
|
+
{
|
|
2949
|
+
onClick: onDownload,
|
|
2950
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
2951
|
+
"aria-label": "Download PDF",
|
|
2952
|
+
type: "button",
|
|
2953
|
+
children: /* @__PURE__ */ jsx14(Download, { variant: "dark", className: "w-5 h-5" })
|
|
2954
|
+
}
|
|
2955
|
+
),
|
|
2956
|
+
/* @__PURE__ */ jsx14(
|
|
2957
|
+
"button",
|
|
2958
|
+
{
|
|
2959
|
+
onClick: onPrint,
|
|
2960
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
2961
|
+
"aria-label": "Print PDF",
|
|
2962
|
+
type: "button",
|
|
2963
|
+
children: /* @__PURE__ */ jsx14(Print, { variant: "dark", className: "w-5 h-5" })
|
|
2964
|
+
}
|
|
2965
|
+
)
|
|
2966
|
+
] })
|
|
2967
|
+
] });
|
|
2968
|
+
};
|
|
2969
|
+
PdfHeader.displayName = "PdfHeader";
|
|
2970
|
+
|
|
2971
|
+
// src/components/pdf-viewer/hooks/useContainerWidth.ts
|
|
2937
2972
|
import * as React11 from "react";
|
|
2973
|
+
function useContainerWidth(padding = 32) {
|
|
2974
|
+
const [containerWidth, setContainerWidth] = React11.useState(0);
|
|
2975
|
+
const containerRef = React11.useRef(null);
|
|
2976
|
+
const lastWidthRef = React11.useRef(0);
|
|
2977
|
+
React11.useEffect(() => {
|
|
2978
|
+
const element = containerRef.current;
|
|
2979
|
+
if (!element) return;
|
|
2980
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
2981
|
+
for (const entry of entries) {
|
|
2982
|
+
const newWidth = entry.contentRect.width - padding;
|
|
2983
|
+
if (Math.abs(newWidth - lastWidthRef.current) > 1) {
|
|
2984
|
+
lastWidthRef.current = newWidth;
|
|
2985
|
+
setContainerWidth(newWidth);
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
resizeObserver.observe(element);
|
|
2990
|
+
const initialWidth = element.offsetWidth - padding;
|
|
2991
|
+
lastWidthRef.current = initialWidth;
|
|
2992
|
+
setContainerWidth(initialWidth);
|
|
2993
|
+
return () => {
|
|
2994
|
+
resizeObserver.disconnect();
|
|
2995
|
+
};
|
|
2996
|
+
}, [padding]);
|
|
2997
|
+
return { containerWidth, containerRef };
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
// src/components/pdf-viewer/hooks/usePdfDownload.ts
|
|
3001
|
+
import * as React12 from "react";
|
|
3002
|
+
function usePdfDownload(file, title) {
|
|
3003
|
+
const download = React12.useCallback(async () => {
|
|
3004
|
+
if (!file) return;
|
|
3005
|
+
try {
|
|
3006
|
+
let blob;
|
|
3007
|
+
let filename;
|
|
3008
|
+
if (typeof file === "string") {
|
|
3009
|
+
const response = await fetch(file);
|
|
3010
|
+
blob = await response.blob();
|
|
3011
|
+
filename = title || "document.pdf";
|
|
3012
|
+
} else {
|
|
3013
|
+
blob = file;
|
|
3014
|
+
filename = title || file.name || "document.pdf";
|
|
3015
|
+
}
|
|
3016
|
+
const url = URL.createObjectURL(blob);
|
|
3017
|
+
const link = document.createElement("a");
|
|
3018
|
+
link.href = url;
|
|
3019
|
+
link.download = filename;
|
|
3020
|
+
link.style.display = "none";
|
|
3021
|
+
document.body.appendChild(link);
|
|
3022
|
+
link.click();
|
|
3023
|
+
setTimeout(() => {
|
|
3024
|
+
document.body.removeChild(link);
|
|
3025
|
+
URL.revokeObjectURL(url);
|
|
3026
|
+
}, 100);
|
|
3027
|
+
} catch (error) {
|
|
3028
|
+
console.error("Failed to download PDF:", error);
|
|
3029
|
+
}
|
|
3030
|
+
}, [file, title]);
|
|
3031
|
+
return download;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
// src/components/pdf-viewer/hooks/usePdfPrint.ts
|
|
3035
|
+
import * as React13 from "react";
|
|
3036
|
+
function usePdfPrint(file) {
|
|
3037
|
+
const [printBlobUrl, setPrintBlobUrl] = React13.useState(null);
|
|
3038
|
+
const printFrameRef = React13.useRef(null);
|
|
3039
|
+
const preparePrint = React13.useCallback(async () => {
|
|
3040
|
+
if (!file) return;
|
|
3041
|
+
try {
|
|
3042
|
+
let blob;
|
|
3043
|
+
if (typeof file === "string") {
|
|
3044
|
+
const response = await fetch(file);
|
|
3045
|
+
blob = await response.blob();
|
|
3046
|
+
} else {
|
|
3047
|
+
blob = file;
|
|
3048
|
+
}
|
|
3049
|
+
const url = URL.createObjectURL(blob);
|
|
3050
|
+
setPrintBlobUrl(url);
|
|
3051
|
+
} catch (error) {
|
|
3052
|
+
console.error("Failed to prepare PDF for printing:", error);
|
|
3053
|
+
}
|
|
3054
|
+
}, [file]);
|
|
3055
|
+
React13.useEffect(() => {
|
|
3056
|
+
return () => {
|
|
3057
|
+
if (printBlobUrl) {
|
|
3058
|
+
URL.revokeObjectURL(printBlobUrl);
|
|
3059
|
+
}
|
|
3060
|
+
};
|
|
3061
|
+
}, [printBlobUrl]);
|
|
3062
|
+
const print = React13.useCallback(() => {
|
|
3063
|
+
if (printFrameRef.current?.contentWindow) {
|
|
3064
|
+
printFrameRef.current.contentWindow.print();
|
|
3065
|
+
}
|
|
3066
|
+
}, []);
|
|
3067
|
+
return { printFrameRef, printBlobUrl, preparePrint, print };
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3070
|
+
// src/components/pdf-viewer/utils/pdfWorker.ts
|
|
3071
|
+
import { pdfjs } from "react-pdf";
|
|
3072
|
+
function initializePdfWorker(workerUrl) {
|
|
3073
|
+
pdfjs.GlobalWorkerOptions.workerSrc = workerUrl;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
// src/components/pdf-viewer/index.tsx
|
|
3077
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3078
|
+
var PdfViewer = React14.forwardRef(
|
|
3079
|
+
({
|
|
3080
|
+
file,
|
|
3081
|
+
title,
|
|
3082
|
+
pageWidth,
|
|
3083
|
+
onDownload,
|
|
3084
|
+
onPrint,
|
|
3085
|
+
onLoadSuccess,
|
|
3086
|
+
onError,
|
|
3087
|
+
enableTextLayer = false,
|
|
3088
|
+
className,
|
|
3089
|
+
...props
|
|
3090
|
+
}, ref) => {
|
|
3091
|
+
const { containerWidth, containerRef } = useContainerWidth();
|
|
3092
|
+
const { printFrameRef, printBlobUrl, preparePrint, print } = usePdfPrint(file);
|
|
3093
|
+
const download = usePdfDownload(file, title);
|
|
3094
|
+
const effectiveWidth = pageWidth || containerWidth;
|
|
3095
|
+
const handleLoadSuccess = React14.useCallback(
|
|
3096
|
+
async (numPages) => {
|
|
3097
|
+
onLoadSuccess?.(numPages);
|
|
3098
|
+
await preparePrint();
|
|
3099
|
+
},
|
|
3100
|
+
[onLoadSuccess, preparePrint]
|
|
3101
|
+
);
|
|
3102
|
+
const handleDownload = React14.useCallback(() => {
|
|
3103
|
+
if (onDownload) {
|
|
3104
|
+
onDownload();
|
|
3105
|
+
return;
|
|
3106
|
+
}
|
|
3107
|
+
download();
|
|
3108
|
+
}, [onDownload, download]);
|
|
3109
|
+
const handlePrint = React14.useCallback(() => {
|
|
3110
|
+
if (onPrint) {
|
|
3111
|
+
onPrint();
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
print();
|
|
3115
|
+
}, [onPrint, print]);
|
|
3116
|
+
return /* @__PURE__ */ jsxs9(
|
|
3117
|
+
"div",
|
|
3118
|
+
{
|
|
3119
|
+
ref,
|
|
3120
|
+
className: cn("h-full flex flex-col", className),
|
|
3121
|
+
...props,
|
|
3122
|
+
children: [
|
|
3123
|
+
printBlobUrl && /* @__PURE__ */ jsx15(
|
|
3124
|
+
"iframe",
|
|
3125
|
+
{
|
|
3126
|
+
ref: printFrameRef,
|
|
3127
|
+
src: printBlobUrl,
|
|
3128
|
+
style: { display: "none" },
|
|
3129
|
+
title: "PDF for printing"
|
|
3130
|
+
}
|
|
3131
|
+
),
|
|
3132
|
+
/* @__PURE__ */ jsx15(
|
|
3133
|
+
PdfHeader,
|
|
3134
|
+
{
|
|
3135
|
+
title,
|
|
3136
|
+
onDownload: handleDownload,
|
|
3137
|
+
onPrint: handlePrint
|
|
3138
|
+
}
|
|
3139
|
+
),
|
|
3140
|
+
/* @__PURE__ */ jsx15(
|
|
3141
|
+
"div",
|
|
3142
|
+
{
|
|
3143
|
+
ref: containerRef,
|
|
3144
|
+
className: "flex-1 overflow-y-auto overflow-x-hidden bg-neutral-300",
|
|
3145
|
+
children: /* @__PURE__ */ jsx15(
|
|
3146
|
+
PdfDocument,
|
|
3147
|
+
{
|
|
3148
|
+
file,
|
|
3149
|
+
pageWidth: effectiveWidth,
|
|
3150
|
+
enableTextLayer,
|
|
3151
|
+
onLoadSuccess: handleLoadSuccess,
|
|
3152
|
+
onLoadError: onError
|
|
3153
|
+
}
|
|
3154
|
+
)
|
|
3155
|
+
}
|
|
3156
|
+
)
|
|
3157
|
+
]
|
|
3158
|
+
}
|
|
3159
|
+
);
|
|
3160
|
+
}
|
|
3161
|
+
);
|
|
3162
|
+
PdfViewer.displayName = "PdfViewer";
|
|
3163
|
+
|
|
3164
|
+
// src/components/ui/tabs.tsx
|
|
3165
|
+
import * as React15 from "react";
|
|
2938
3166
|
import { cva as cva9 } from "class-variance-authority";
|
|
2939
|
-
import { jsx as
|
|
3167
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2940
3168
|
var tabsVariants = cva9(
|
|
2941
3169
|
"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",
|
|
2942
3170
|
{
|
|
@@ -2950,17 +3178,17 @@ var tabsVariants = cva9(
|
|
|
2950
3178
|
}
|
|
2951
3179
|
}
|
|
2952
3180
|
);
|
|
2953
|
-
var TabsContext =
|
|
3181
|
+
var TabsContext = React15.createContext(
|
|
2954
3182
|
void 0
|
|
2955
3183
|
);
|
|
2956
3184
|
function useTabsContext() {
|
|
2957
|
-
const context =
|
|
3185
|
+
const context = React15.useContext(TabsContext);
|
|
2958
3186
|
if (!context) {
|
|
2959
3187
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
2960
3188
|
}
|
|
2961
3189
|
return context;
|
|
2962
3190
|
}
|
|
2963
|
-
var Tabs =
|
|
3191
|
+
var Tabs = React15.forwardRef((props, ref) => {
|
|
2964
3192
|
const {
|
|
2965
3193
|
className,
|
|
2966
3194
|
value,
|
|
@@ -2969,7 +3197,7 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
2969
3197
|
children,
|
|
2970
3198
|
...restProps
|
|
2971
3199
|
} = props;
|
|
2972
|
-
const contextValue =
|
|
3200
|
+
const contextValue = React15.useMemo(
|
|
2973
3201
|
() => ({
|
|
2974
3202
|
activeTab: value,
|
|
2975
3203
|
setActiveTab: onValueChange,
|
|
@@ -2977,13 +3205,13 @@ var Tabs = React11.forwardRef((props, ref) => {
|
|
|
2977
3205
|
}),
|
|
2978
3206
|
[value, onValueChange, variant]
|
|
2979
3207
|
);
|
|
2980
|
-
return /* @__PURE__ */
|
|
3208
|
+
return /* @__PURE__ */ jsx16(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx16("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
2981
3209
|
});
|
|
2982
3210
|
Tabs.displayName = "Tabs";
|
|
2983
|
-
var TabsList =
|
|
3211
|
+
var TabsList = React15.forwardRef(
|
|
2984
3212
|
(props, ref) => {
|
|
2985
3213
|
const { className, children, ...restProps } = props;
|
|
2986
|
-
return /* @__PURE__ */
|
|
3214
|
+
return /* @__PURE__ */ jsx16(
|
|
2987
3215
|
"div",
|
|
2988
3216
|
{
|
|
2989
3217
|
ref,
|
|
@@ -2999,7 +3227,7 @@ TabsList.displayName = "TabsList";
|
|
|
2999
3227
|
var getTabTypographyStyles = (isActive) => ({
|
|
3000
3228
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3001
3229
|
});
|
|
3002
|
-
var TabsTrigger =
|
|
3230
|
+
var TabsTrigger = React15.forwardRef(
|
|
3003
3231
|
(props, ref) => {
|
|
3004
3232
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3005
3233
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3007,22 +3235,22 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3007
3235
|
throw new Error("TabsTrigger must have a value prop");
|
|
3008
3236
|
}
|
|
3009
3237
|
const isActive = activeTab === value;
|
|
3010
|
-
const tokenStyles =
|
|
3238
|
+
const tokenStyles = React15.useMemo(
|
|
3011
3239
|
() => ({
|
|
3012
3240
|
...getTabTypographyStyles(isActive),
|
|
3013
3241
|
...style
|
|
3014
3242
|
}),
|
|
3015
3243
|
[isActive, style]
|
|
3016
3244
|
);
|
|
3017
|
-
const triggerClassName =
|
|
3245
|
+
const triggerClassName = React15.useMemo(
|
|
3018
3246
|
() => cn(tabsVariants({ variant }), className),
|
|
3019
3247
|
[variant, className]
|
|
3020
3248
|
);
|
|
3021
|
-
const handleClick =
|
|
3249
|
+
const handleClick = React15.useCallback(() => {
|
|
3022
3250
|
if (disabled) return;
|
|
3023
3251
|
setActiveTab(value);
|
|
3024
3252
|
}, [disabled, setActiveTab, value]);
|
|
3025
|
-
return /* @__PURE__ */
|
|
3253
|
+
return /* @__PURE__ */ jsx16(
|
|
3026
3254
|
"button",
|
|
3027
3255
|
{
|
|
3028
3256
|
ref,
|
|
@@ -3036,13 +3264,13 @@ var TabsTrigger = React11.forwardRef(
|
|
|
3036
3264
|
disabled,
|
|
3037
3265
|
onClick: handleClick,
|
|
3038
3266
|
...restProps,
|
|
3039
|
-
children: /* @__PURE__ */
|
|
3267
|
+
children: /* @__PURE__ */ jsx16("span", { className: "pl-3 pr-6 py-2", children })
|
|
3040
3268
|
}
|
|
3041
3269
|
);
|
|
3042
3270
|
}
|
|
3043
3271
|
);
|
|
3044
3272
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3045
|
-
var TabsContent =
|
|
3273
|
+
var TabsContent = React15.forwardRef(
|
|
3046
3274
|
(props, ref) => {
|
|
3047
3275
|
const { className, value, children, ...restProps } = props;
|
|
3048
3276
|
const { activeTab } = useTabsContext();
|
|
@@ -3053,7 +3281,7 @@ var TabsContent = React11.forwardRef(
|
|
|
3053
3281
|
if (!isActive) {
|
|
3054
3282
|
return null;
|
|
3055
3283
|
}
|
|
3056
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ jsx16(
|
|
3057
3285
|
"div",
|
|
3058
3286
|
{
|
|
3059
3287
|
ref,
|
|
@@ -3071,11 +3299,11 @@ var TabsContent = React11.forwardRef(
|
|
|
3071
3299
|
TabsContent.displayName = "TabsContent";
|
|
3072
3300
|
|
|
3073
3301
|
// src/components/ui/dropdown-menu.tsx
|
|
3074
|
-
import * as
|
|
3302
|
+
import * as React16 from "react";
|
|
3075
3303
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3076
|
-
import { jsx as
|
|
3304
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3077
3305
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3078
|
-
var DropdownMenuTrigger =
|
|
3306
|
+
var DropdownMenuTrigger = React16.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
3079
3307
|
DropdownMenuPrimitive.Trigger,
|
|
3080
3308
|
{
|
|
3081
3309
|
ref,
|
|
@@ -3085,7 +3313,7 @@ var DropdownMenuTrigger = React12.forwardRef(({ className, icon, children, ...pr
|
|
|
3085
3313
|
),
|
|
3086
3314
|
...props,
|
|
3087
3315
|
children: [
|
|
3088
|
-
icon || /* @__PURE__ */
|
|
3316
|
+
icon || /* @__PURE__ */ jsx17(MoreMenu, { className: "size-4" }),
|
|
3089
3317
|
children
|
|
3090
3318
|
]
|
|
3091
3319
|
}
|
|
@@ -3095,7 +3323,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3095
3323
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3096
3324
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3097
3325
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3098
|
-
var DropdownMenuSubTrigger =
|
|
3326
|
+
var DropdownMenuSubTrigger = React16.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
3099
3327
|
DropdownMenuPrimitive.SubTrigger,
|
|
3100
3328
|
{
|
|
3101
3329
|
ref,
|
|
@@ -3108,12 +3336,12 @@ var DropdownMenuSubTrigger = React12.forwardRef(({ className, inset, children, .
|
|
|
3108
3336
|
...props,
|
|
3109
3337
|
children: [
|
|
3110
3338
|
children,
|
|
3111
|
-
/* @__PURE__ */
|
|
3339
|
+
/* @__PURE__ */ jsx17(ChevronRight, { className: "ml-auto" })
|
|
3112
3340
|
]
|
|
3113
3341
|
}
|
|
3114
3342
|
));
|
|
3115
3343
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3116
|
-
var DropdownMenuSubContent =
|
|
3344
|
+
var DropdownMenuSubContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
3117
3345
|
DropdownMenuPrimitive.SubContent,
|
|
3118
3346
|
{
|
|
3119
3347
|
ref,
|
|
@@ -3125,7 +3353,7 @@ var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) =
|
|
|
3125
3353
|
}
|
|
3126
3354
|
));
|
|
3127
3355
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3128
|
-
var DropdownMenuContent =
|
|
3356
|
+
var DropdownMenuContent = React16.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ jsx17(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx17(
|
|
3129
3357
|
DropdownMenuPrimitive.Content,
|
|
3130
3358
|
{
|
|
3131
3359
|
ref,
|
|
@@ -3139,7 +3367,7 @@ var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, align
|
|
|
3139
3367
|
}
|
|
3140
3368
|
) }));
|
|
3141
3369
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3142
|
-
var DropdownMenuItem =
|
|
3370
|
+
var DropdownMenuItem = React16.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
3143
3371
|
DropdownMenuPrimitive.Item,
|
|
3144
3372
|
{
|
|
3145
3373
|
ref,
|
|
@@ -3156,7 +3384,7 @@ var DropdownMenuItem = React12.forwardRef(({ className, inset, style, ...props }
|
|
|
3156
3384
|
}
|
|
3157
3385
|
));
|
|
3158
3386
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3159
|
-
var DropdownMenuCheckboxItem =
|
|
3387
|
+
var DropdownMenuCheckboxItem = React16.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
3160
3388
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3161
3389
|
{
|
|
3162
3390
|
ref,
|
|
@@ -3171,7 +3399,7 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3171
3399
|
},
|
|
3172
3400
|
...props,
|
|
3173
3401
|
children: [
|
|
3174
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ jsx17(
|
|
3175
3403
|
Checkbox,
|
|
3176
3404
|
{
|
|
3177
3405
|
checked: checked === true,
|
|
@@ -3179,12 +3407,12 @@ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, style,
|
|
|
3179
3407
|
"aria-hidden": "true"
|
|
3180
3408
|
}
|
|
3181
3409
|
),
|
|
3182
|
-
/* @__PURE__ */
|
|
3410
|
+
/* @__PURE__ */ jsx17("span", { className: "flex-1", children })
|
|
3183
3411
|
]
|
|
3184
3412
|
}
|
|
3185
3413
|
));
|
|
3186
3414
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3187
|
-
var DropdownMenuRadioItem =
|
|
3415
|
+
var DropdownMenuRadioItem = React16.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
3188
3416
|
DropdownMenuPrimitive.RadioItem,
|
|
3189
3417
|
{
|
|
3190
3418
|
ref,
|
|
@@ -3198,13 +3426,13 @@ var DropdownMenuRadioItem = React12.forwardRef(({ className, children, style, ..
|
|
|
3198
3426
|
},
|
|
3199
3427
|
...props,
|
|
3200
3428
|
children: [
|
|
3201
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx17("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx17(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx17("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3202
3430
|
children
|
|
3203
3431
|
]
|
|
3204
3432
|
}
|
|
3205
3433
|
));
|
|
3206
3434
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3207
|
-
var DropdownMenuLabel =
|
|
3435
|
+
var DropdownMenuLabel = React16.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
3208
3436
|
DropdownMenuPrimitive.Label,
|
|
3209
3437
|
{
|
|
3210
3438
|
ref,
|
|
@@ -3217,7 +3445,7 @@ var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3217
3445
|
}
|
|
3218
3446
|
));
|
|
3219
3447
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3220
|
-
var DropdownMenuSeparator =
|
|
3448
|
+
var DropdownMenuSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
3221
3449
|
DropdownMenuPrimitive.Separator,
|
|
3222
3450
|
{
|
|
3223
3451
|
ref,
|
|
@@ -3230,7 +3458,7 @@ var DropdownMenuShortcut = ({
|
|
|
3230
3458
|
className,
|
|
3231
3459
|
...props
|
|
3232
3460
|
}) => {
|
|
3233
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsx17(
|
|
3234
3462
|
"span",
|
|
3235
3463
|
{
|
|
3236
3464
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3241,21 +3469,21 @@ var DropdownMenuShortcut = ({
|
|
|
3241
3469
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3242
3470
|
|
|
3243
3471
|
// src/components/ui/charts/chart-legend.tsx
|
|
3244
|
-
import { jsx as
|
|
3472
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3245
3473
|
function ChartLegend({
|
|
3246
3474
|
items,
|
|
3247
3475
|
x = 0,
|
|
3248
3476
|
y = 550,
|
|
3249
3477
|
className = ""
|
|
3250
3478
|
}) {
|
|
3251
|
-
return /* @__PURE__ */
|
|
3479
|
+
return /* @__PURE__ */ jsx18("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ jsx18(
|
|
3252
3480
|
"div",
|
|
3253
3481
|
{
|
|
3254
3482
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
3255
3483
|
style: { height: "100%" },
|
|
3256
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */
|
|
3257
|
-
/* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3484
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
3485
|
+
/* @__PURE__ */ jsx18("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
3486
|
+
/* @__PURE__ */ jsx18(Typography, { variant: "body-xs", children: label || key })
|
|
3259
3487
|
] }, key))
|
|
3260
3488
|
}
|
|
3261
3489
|
) });
|
|
@@ -3373,12 +3601,12 @@ var formatLargeNumber = (value) => {
|
|
|
3373
3601
|
};
|
|
3374
3602
|
|
|
3375
3603
|
// src/components/ui/charts/chart-labels.tsx
|
|
3376
|
-
import { jsx as
|
|
3604
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3377
3605
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
3378
3606
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
3379
3607
|
if (!viewBox) return null;
|
|
3380
3608
|
const { x, y, width } = viewBox;
|
|
3381
|
-
return /* @__PURE__ */
|
|
3609
|
+
return /* @__PURE__ */ jsx19("g", { children: /* @__PURE__ */ jsx19("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ jsx19("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsx19(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3382
3610
|
};
|
|
3383
3611
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
3384
3612
|
return CustomXAxisLabel;
|
|
@@ -3388,7 +3616,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
3388
3616
|
if (!viewBox) return null;
|
|
3389
3617
|
const { x, y, height } = viewBox;
|
|
3390
3618
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
3391
|
-
return /* @__PURE__ */
|
|
3619
|
+
return /* @__PURE__ */ jsx19("g", { children: /* @__PURE__ */ jsx19("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ jsx19(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3392
3620
|
};
|
|
3393
3621
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
3394
3622
|
return CustomYAxisLabel;
|
|
@@ -3397,14 +3625,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
3397
3625
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
3398
3626
|
if (!viewBox) return null;
|
|
3399
3627
|
const { x, y, width, height } = viewBox;
|
|
3400
|
-
return /* @__PURE__ */
|
|
3628
|
+
return /* @__PURE__ */ jsx19("g", { children: /* @__PURE__ */ jsx19("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ jsx19(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3401
3629
|
};
|
|
3402
3630
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
3403
3631
|
return CustomYAxisRightLabel;
|
|
3404
3632
|
};
|
|
3405
3633
|
var customXAxisTick = (props) => {
|
|
3406
3634
|
const { x, y, payload } = props;
|
|
3407
|
-
return /* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsx19("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ jsx19(
|
|
3408
3636
|
"foreignObject",
|
|
3409
3637
|
{
|
|
3410
3638
|
x: -20,
|
|
@@ -3412,12 +3640,12 @@ var customXAxisTick = (props) => {
|
|
|
3412
3640
|
width: 40,
|
|
3413
3641
|
height: 20,
|
|
3414
3642
|
style: { overflow: "visible" },
|
|
3415
|
-
children: /* @__PURE__ */
|
|
3643
|
+
children: /* @__PURE__ */ jsx19(
|
|
3416
3644
|
"div",
|
|
3417
3645
|
{
|
|
3418
3646
|
className: "flex items-start justify-center h-full",
|
|
3419
3647
|
style: { overflow: "visible" },
|
|
3420
|
-
children: /* @__PURE__ */
|
|
3648
|
+
children: /* @__PURE__ */ jsx19(
|
|
3421
3649
|
Typography,
|
|
3422
3650
|
{
|
|
3423
3651
|
variant: "body-xs",
|
|
@@ -3432,7 +3660,7 @@ var customXAxisTick = (props) => {
|
|
|
3432
3660
|
};
|
|
3433
3661
|
var customXAxisTickRotated = (props) => {
|
|
3434
3662
|
const { x, y, payload } = props;
|
|
3435
|
-
return /* @__PURE__ */
|
|
3663
|
+
return /* @__PURE__ */ jsx19("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ jsx19(
|
|
3436
3664
|
"text",
|
|
3437
3665
|
{
|
|
3438
3666
|
x: 0,
|
|
@@ -3451,25 +3679,25 @@ var customYAxisTick = (props) => {
|
|
|
3451
3679
|
const { x, y, payload } = props;
|
|
3452
3680
|
const text = String(payload.value);
|
|
3453
3681
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
3454
|
-
return /* @__PURE__ */
|
|
3682
|
+
return /* @__PURE__ */ jsx19(
|
|
3455
3683
|
"foreignObject",
|
|
3456
3684
|
{
|
|
3457
3685
|
x: x - estimatedWidth + 5,
|
|
3458
3686
|
y: y - 6,
|
|
3459
3687
|
width: estimatedWidth,
|
|
3460
3688
|
height: 15,
|
|
3461
|
-
children: /* @__PURE__ */
|
|
3689
|
+
children: /* @__PURE__ */ jsx19("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ jsx19(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
3462
3690
|
}
|
|
3463
3691
|
);
|
|
3464
3692
|
};
|
|
3465
3693
|
|
|
3466
3694
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
3467
|
-
import { Fragment, jsx as
|
|
3695
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3468
3696
|
function TooltipContainer({
|
|
3469
3697
|
children,
|
|
3470
3698
|
className = ""
|
|
3471
3699
|
}) {
|
|
3472
|
-
return /* @__PURE__ */
|
|
3700
|
+
return /* @__PURE__ */ jsx20(
|
|
3473
3701
|
"div",
|
|
3474
3702
|
{
|
|
3475
3703
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -3483,10 +3711,10 @@ function TooltipItem({
|
|
|
3483
3711
|
value,
|
|
3484
3712
|
className = ""
|
|
3485
3713
|
}) {
|
|
3486
|
-
return /* @__PURE__ */
|
|
3487
|
-
/* @__PURE__ */
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
3715
|
+
/* @__PURE__ */ jsx20("br", {}),
|
|
3716
|
+
/* @__PURE__ */ jsxs12(Typography, { variant: "label-sm", className, children: [
|
|
3717
|
+
/* @__PURE__ */ jsx20(
|
|
3490
3718
|
"span",
|
|
3491
3719
|
{
|
|
3492
3720
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -3504,9 +3732,9 @@ function GenericTooltip({
|
|
|
3504
3732
|
items,
|
|
3505
3733
|
className = ""
|
|
3506
3734
|
}) {
|
|
3507
|
-
return /* @__PURE__ */
|
|
3508
|
-
title && /* @__PURE__ */
|
|
3509
|
-
items.map((item, index) => /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ jsxs12(TooltipContainer, { className, children: [
|
|
3736
|
+
title && /* @__PURE__ */ jsx20(Typography, { variant: "label-sm-bold", children: title }),
|
|
3737
|
+
items.map((item, index) => /* @__PURE__ */ jsx20(
|
|
3510
3738
|
TooltipItem,
|
|
3511
3739
|
{
|
|
3512
3740
|
color: item.color,
|
|
@@ -3528,7 +3756,7 @@ import {
|
|
|
3528
3756
|
Tooltip,
|
|
3529
3757
|
ResponsiveContainer
|
|
3530
3758
|
} from "recharts";
|
|
3531
|
-
import { jsx as
|
|
3759
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3532
3760
|
var BarChart = forwardRef13(
|
|
3533
3761
|
({
|
|
3534
3762
|
data,
|
|
@@ -3555,19 +3783,19 @@ var BarChart = forwardRef13(
|
|
|
3555
3783
|
};
|
|
3556
3784
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
3557
3785
|
const hasData = data && data.length > 0;
|
|
3558
|
-
return /* @__PURE__ */
|
|
3786
|
+
return /* @__PURE__ */ jsxs13(
|
|
3559
3787
|
"div",
|
|
3560
3788
|
{
|
|
3561
3789
|
ref,
|
|
3562
3790
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3563
3791
|
children: [
|
|
3564
|
-
/* @__PURE__ */
|
|
3565
|
-
/* @__PURE__ */
|
|
3792
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx21(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3793
|
+
/* @__PURE__ */ jsx21("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx21(
|
|
3566
3794
|
ResponsiveContainer,
|
|
3567
3795
|
{
|
|
3568
3796
|
width: "100%",
|
|
3569
3797
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3570
|
-
children: /* @__PURE__ */
|
|
3798
|
+
children: /* @__PURE__ */ jsxs13(
|
|
3571
3799
|
RechartsBarChart,
|
|
3572
3800
|
{
|
|
3573
3801
|
data,
|
|
@@ -3579,7 +3807,7 @@ var BarChart = forwardRef13(
|
|
|
3579
3807
|
onClick: handleClick,
|
|
3580
3808
|
layout,
|
|
3581
3809
|
children: [
|
|
3582
|
-
/* @__PURE__ */
|
|
3810
|
+
/* @__PURE__ */ jsx21(
|
|
3583
3811
|
XAxis,
|
|
3584
3812
|
{
|
|
3585
3813
|
dataKey: xAxisKey,
|
|
@@ -3593,7 +3821,7 @@ var BarChart = forwardRef13(
|
|
|
3593
3821
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
3594
3822
|
}
|
|
3595
3823
|
),
|
|
3596
|
-
/* @__PURE__ */
|
|
3824
|
+
/* @__PURE__ */ jsx21(
|
|
3597
3825
|
YAxis,
|
|
3598
3826
|
{
|
|
3599
3827
|
axisLine: false,
|
|
@@ -3604,7 +3832,7 @@ var BarChart = forwardRef13(
|
|
|
3604
3832
|
type: yAxisType
|
|
3605
3833
|
}
|
|
3606
3834
|
),
|
|
3607
|
-
/* @__PURE__ */
|
|
3835
|
+
/* @__PURE__ */ jsx21(
|
|
3608
3836
|
Tooltip,
|
|
3609
3837
|
{
|
|
3610
3838
|
content: ({
|
|
@@ -3613,7 +3841,7 @@ var BarChart = forwardRef13(
|
|
|
3613
3841
|
label
|
|
3614
3842
|
}) => {
|
|
3615
3843
|
if (active && payload && payload.length) {
|
|
3616
|
-
return /* @__PURE__ */
|
|
3844
|
+
return /* @__PURE__ */ jsx21(
|
|
3617
3845
|
GenericTooltip,
|
|
3618
3846
|
{
|
|
3619
3847
|
title: label?.toString(),
|
|
@@ -3629,7 +3857,7 @@ var BarChart = forwardRef13(
|
|
|
3629
3857
|
}
|
|
3630
3858
|
}
|
|
3631
3859
|
),
|
|
3632
|
-
/* @__PURE__ */
|
|
3860
|
+
/* @__PURE__ */ jsx21(
|
|
3633
3861
|
Bar,
|
|
3634
3862
|
{
|
|
3635
3863
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -3637,12 +3865,12 @@ var BarChart = forwardRef13(
|
|
|
3637
3865
|
name: barDataKey || yAxisKey
|
|
3638
3866
|
}
|
|
3639
3867
|
),
|
|
3640
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
3868
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx21(ChartLegend, { items: defaultLegendItems })
|
|
3641
3869
|
]
|
|
3642
3870
|
}
|
|
3643
3871
|
)
|
|
3644
3872
|
}
|
|
3645
|
-
) : /* @__PURE__ */
|
|
3873
|
+
) : /* @__PURE__ */ jsx21("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx21(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3646
3874
|
]
|
|
3647
3875
|
}
|
|
3648
3876
|
);
|
|
@@ -3660,7 +3888,7 @@ import {
|
|
|
3660
3888
|
Tooltip as Tooltip2,
|
|
3661
3889
|
ResponsiveContainer as ResponsiveContainer2
|
|
3662
3890
|
} from "recharts";
|
|
3663
|
-
import { jsx as
|
|
3891
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3664
3892
|
var LineChart = forwardRef14(
|
|
3665
3893
|
({
|
|
3666
3894
|
data,
|
|
@@ -3689,19 +3917,19 @@ var LineChart = forwardRef14(
|
|
|
3689
3917
|
)
|
|
3690
3918
|
);
|
|
3691
3919
|
const hasData = data && data.length > 0;
|
|
3692
|
-
return /* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ jsxs14(
|
|
3693
3921
|
"div",
|
|
3694
3922
|
{
|
|
3695
3923
|
ref,
|
|
3696
3924
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3697
3925
|
children: [
|
|
3698
|
-
/* @__PURE__ */
|
|
3699
|
-
/* @__PURE__ */
|
|
3926
|
+
/* @__PURE__ */ jsx22("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx22(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
3927
|
+
/* @__PURE__ */ jsx22("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx22(
|
|
3700
3928
|
ResponsiveContainer2,
|
|
3701
3929
|
{
|
|
3702
3930
|
width: "100%",
|
|
3703
3931
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3704
|
-
children: /* @__PURE__ */
|
|
3932
|
+
children: /* @__PURE__ */ jsxs14(
|
|
3705
3933
|
RechartsLineChart,
|
|
3706
3934
|
{
|
|
3707
3935
|
data,
|
|
@@ -3712,7 +3940,7 @@ var LineChart = forwardRef14(
|
|
|
3712
3940
|
},
|
|
3713
3941
|
onClick: handleClick,
|
|
3714
3942
|
children: [
|
|
3715
|
-
/* @__PURE__ */
|
|
3943
|
+
/* @__PURE__ */ jsx22(
|
|
3716
3944
|
XAxis2,
|
|
3717
3945
|
{
|
|
3718
3946
|
dataKey: xAxisKey,
|
|
@@ -3724,7 +3952,7 @@ var LineChart = forwardRef14(
|
|
|
3724
3952
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
3725
3953
|
}
|
|
3726
3954
|
),
|
|
3727
|
-
/* @__PURE__ */
|
|
3955
|
+
/* @__PURE__ */ jsx22(
|
|
3728
3956
|
YAxis2,
|
|
3729
3957
|
{
|
|
3730
3958
|
axisLine: false,
|
|
@@ -3733,7 +3961,7 @@ var LineChart = forwardRef14(
|
|
|
3733
3961
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
3734
3962
|
}
|
|
3735
3963
|
),
|
|
3736
|
-
/* @__PURE__ */
|
|
3964
|
+
/* @__PURE__ */ jsx22(
|
|
3737
3965
|
Tooltip2,
|
|
3738
3966
|
{
|
|
3739
3967
|
content: ({
|
|
@@ -3742,7 +3970,7 @@ var LineChart = forwardRef14(
|
|
|
3742
3970
|
label
|
|
3743
3971
|
}) => {
|
|
3744
3972
|
if (active && payload && payload.length) {
|
|
3745
|
-
return /* @__PURE__ */
|
|
3973
|
+
return /* @__PURE__ */ jsx22(
|
|
3746
3974
|
GenericTooltip,
|
|
3747
3975
|
{
|
|
3748
3976
|
title: label?.toString(),
|
|
@@ -3758,7 +3986,7 @@ var LineChart = forwardRef14(
|
|
|
3758
3986
|
}
|
|
3759
3987
|
}
|
|
3760
3988
|
),
|
|
3761
|
-
series.map((s, index) => /* @__PURE__ */
|
|
3989
|
+
series.map((s, index) => /* @__PURE__ */ jsx22(
|
|
3762
3990
|
Line,
|
|
3763
3991
|
{
|
|
3764
3992
|
type: "monotone",
|
|
@@ -3770,12 +3998,12 @@ var LineChart = forwardRef14(
|
|
|
3770
3998
|
},
|
|
3771
3999
|
s.dataKey
|
|
3772
4000
|
)),
|
|
3773
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
4001
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx22(ChartLegend, { items: defaultLegendItems })
|
|
3774
4002
|
]
|
|
3775
4003
|
}
|
|
3776
4004
|
)
|
|
3777
4005
|
}
|
|
3778
|
-
) : /* @__PURE__ */
|
|
4006
|
+
) : /* @__PURE__ */ jsx22("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx22(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3779
4007
|
]
|
|
3780
4008
|
}
|
|
3781
4009
|
);
|
|
@@ -3786,7 +4014,7 @@ LineChart.displayName = "LineChart";
|
|
|
3786
4014
|
// src/components/ui/charts/pie-chart.tsx
|
|
3787
4015
|
import { forwardRef as forwardRef15 } from "react";
|
|
3788
4016
|
import { PieChart as RechartsPieChart, Pie, Cell, Tooltip as Tooltip3 } from "recharts";
|
|
3789
|
-
import { jsx as
|
|
4017
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3790
4018
|
var PieChart = forwardRef15(
|
|
3791
4019
|
({
|
|
3792
4020
|
data,
|
|
@@ -3814,20 +4042,20 @@ var PieChart = forwardRef15(
|
|
|
3814
4042
|
)
|
|
3815
4043
|
);
|
|
3816
4044
|
const hasData = data && data.length > 0;
|
|
3817
|
-
return /* @__PURE__ */
|
|
4045
|
+
return /* @__PURE__ */ jsxs15(
|
|
3818
4046
|
"div",
|
|
3819
4047
|
{
|
|
3820
4048
|
ref,
|
|
3821
4049
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3822
4050
|
children: [
|
|
3823
|
-
/* @__PURE__ */
|
|
3824
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsx23("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx23(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4052
|
+
/* @__PURE__ */ jsx23("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx23("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs15(
|
|
3825
4053
|
RechartsPieChart,
|
|
3826
4054
|
{
|
|
3827
4055
|
width: 600,
|
|
3828
4056
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
3829
4057
|
children: [
|
|
3830
|
-
/* @__PURE__ */
|
|
4058
|
+
/* @__PURE__ */ jsx23(
|
|
3831
4059
|
Pie,
|
|
3832
4060
|
{
|
|
3833
4061
|
data,
|
|
@@ -3839,7 +4067,7 @@ var PieChart = forwardRef15(
|
|
|
3839
4067
|
label: showLabels,
|
|
3840
4068
|
labelLine: false,
|
|
3841
4069
|
onClick: handleClick,
|
|
3842
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
4070
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx23(
|
|
3843
4071
|
Cell,
|
|
3844
4072
|
{
|
|
3845
4073
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -3848,7 +4076,7 @@ var PieChart = forwardRef15(
|
|
|
3848
4076
|
))
|
|
3849
4077
|
}
|
|
3850
4078
|
),
|
|
3851
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ jsx23(
|
|
3852
4080
|
Tooltip3,
|
|
3853
4081
|
{
|
|
3854
4082
|
content: ({
|
|
@@ -3857,7 +4085,7 @@ var PieChart = forwardRef15(
|
|
|
3857
4085
|
}) => {
|
|
3858
4086
|
if (active && payload && payload.length && payload[0]) {
|
|
3859
4087
|
const data2 = payload[0].payload;
|
|
3860
|
-
return /* @__PURE__ */
|
|
4088
|
+
return /* @__PURE__ */ jsx23(
|
|
3861
4089
|
GenericTooltip,
|
|
3862
4090
|
{
|
|
3863
4091
|
title: data2.name,
|
|
@@ -3875,10 +4103,10 @@ var PieChart = forwardRef15(
|
|
|
3875
4103
|
}
|
|
3876
4104
|
}
|
|
3877
4105
|
),
|
|
3878
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
4106
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx23(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
3879
4107
|
]
|
|
3880
4108
|
}
|
|
3881
|
-
) }) : /* @__PURE__ */
|
|
4109
|
+
) }) : /* @__PURE__ */ jsx23("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx23(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3882
4110
|
]
|
|
3883
4111
|
}
|
|
3884
4112
|
);
|
|
@@ -3887,11 +4115,11 @@ var PieChart = forwardRef15(
|
|
|
3887
4115
|
PieChart.displayName = "PieChart";
|
|
3888
4116
|
|
|
3889
4117
|
// src/components/ui/table.tsx
|
|
3890
|
-
import { useCallback as
|
|
4118
|
+
import { useCallback as useCallback5 } from "react";
|
|
3891
4119
|
import {
|
|
3892
4120
|
flexRender
|
|
3893
4121
|
} from "@tanstack/react-table";
|
|
3894
|
-
import { Fragment as Fragment2, jsx as
|
|
4122
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3895
4123
|
function Table({
|
|
3896
4124
|
table,
|
|
3897
4125
|
className,
|
|
@@ -3903,33 +4131,33 @@ function Table({
|
|
|
3903
4131
|
const totalPages = table.getPageCount();
|
|
3904
4132
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
3905
4133
|
const showingText = totalRows > 0 ? "Showing " + (currentPage * pageSize + 1) + "-" + Math.min((currentPage + 1) * pageSize, totalRows) + " of " + totalRows + " results" : "No results found";
|
|
3906
|
-
const handlePreviousPage =
|
|
4134
|
+
const handlePreviousPage = useCallback5(() => {
|
|
3907
4135
|
table.previousPage();
|
|
3908
4136
|
}, [table]);
|
|
3909
|
-
const handleNextPage =
|
|
4137
|
+
const handleNextPage = useCallback5(() => {
|
|
3910
4138
|
table.nextPage();
|
|
3911
4139
|
}, [table]);
|
|
3912
|
-
const handlePageChange =
|
|
4140
|
+
const handlePageChange = useCallback5(
|
|
3913
4141
|
(pageIndex) => {
|
|
3914
4142
|
table.setPageIndex(pageIndex);
|
|
3915
4143
|
},
|
|
3916
4144
|
[table]
|
|
3917
4145
|
);
|
|
3918
|
-
const handlePageSizeChange =
|
|
4146
|
+
const handlePageSizeChange = useCallback5(
|
|
3919
4147
|
(value) => {
|
|
3920
4148
|
table.setPageSize(Number(value));
|
|
3921
4149
|
},
|
|
3922
4150
|
[table]
|
|
3923
4151
|
);
|
|
3924
|
-
return /* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
3926
|
-
/* @__PURE__ */
|
|
4152
|
+
return /* @__PURE__ */ jsxs16("div", { children: [
|
|
4153
|
+
/* @__PURE__ */ jsx24("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ jsxs16("table", { className: "min-w-full divide-y divide-border", children: [
|
|
4154
|
+
/* @__PURE__ */ jsx24("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx24("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx24("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ jsxs16(
|
|
3927
4155
|
"div",
|
|
3928
4156
|
{
|
|
3929
4157
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
3930
4158
|
onClick: header.column.getToggleSortingHandler(),
|
|
3931
4159
|
children: [
|
|
3932
|
-
/* @__PURE__ */
|
|
4160
|
+
/* @__PURE__ */ jsx24(
|
|
3933
4161
|
Typography,
|
|
3934
4162
|
{
|
|
3935
4163
|
variant: "label-xs",
|
|
@@ -3940,19 +4168,19 @@ function Table({
|
|
|
3940
4168
|
)
|
|
3941
4169
|
}
|
|
3942
4170
|
),
|
|
3943
|
-
header.column.getCanSort() && /* @__PURE__ */
|
|
3944
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */
|
|
3945
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */
|
|
4171
|
+
header.column.getCanSort() && /* @__PURE__ */ jsxs16("span", { className: "ml-1", children: [
|
|
4172
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ jsx24(ChevronUp, { className: "w-4 h-4 text-light" }),
|
|
4173
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ jsx24(ChevronDown, { className: "w-4 h-4 text-light" })
|
|
3946
4174
|
] })
|
|
3947
4175
|
]
|
|
3948
4176
|
}
|
|
3949
4177
|
) }, header.id)) }, headerGroup.id)) }),
|
|
3950
|
-
/* @__PURE__ */
|
|
4178
|
+
/* @__PURE__ */ jsx24("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx24("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx24("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx24(Typography, { variant: "body-sm", children: flexRender(
|
|
3951
4179
|
cell.column.columnDef.cell,
|
|
3952
4180
|
cell.getContext()
|
|
3953
4181
|
) }) }, cell.id)) }, row.id)) })
|
|
3954
4182
|
] }) }),
|
|
3955
|
-
showPagination && /* @__PURE__ */
|
|
4183
|
+
showPagination && /* @__PURE__ */ jsxs16(
|
|
3956
4184
|
"div",
|
|
3957
4185
|
{
|
|
3958
4186
|
className: cn(
|
|
@@ -3960,9 +4188,9 @@ function Table({
|
|
|
3960
4188
|
paginationClassName
|
|
3961
4189
|
),
|
|
3962
4190
|
children: [
|
|
3963
|
-
/* @__PURE__ */
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ jsx24("div", { className: "flex items-center", children: /* @__PURE__ */ jsx24(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
4192
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center space-x-1", children: [
|
|
4193
|
+
/* @__PURE__ */ jsx24(
|
|
3966
4194
|
Button,
|
|
3967
4195
|
{
|
|
3968
4196
|
variant: "ghost",
|
|
@@ -3970,7 +4198,7 @@ function Table({
|
|
|
3970
4198
|
onClick: handlePreviousPage,
|
|
3971
4199
|
disabled: !table.getCanPreviousPage(),
|
|
3972
4200
|
className: "p-2",
|
|
3973
|
-
children: /* @__PURE__ */
|
|
4201
|
+
children: /* @__PURE__ */ jsx24(ChevronLeft, { className: "w-4 h-4" })
|
|
3974
4202
|
}
|
|
3975
4203
|
),
|
|
3976
4204
|
Array.from(
|
|
@@ -3987,7 +4215,7 @@ function Table({
|
|
|
3987
4215
|
pageNumber = currentPage - 2 + i;
|
|
3988
4216
|
}
|
|
3989
4217
|
const isActive = pageNumber === currentPage;
|
|
3990
|
-
return /* @__PURE__ */
|
|
4218
|
+
return /* @__PURE__ */ jsx24(
|
|
3991
4219
|
Button,
|
|
3992
4220
|
{
|
|
3993
4221
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4000,11 +4228,11 @@ function Table({
|
|
|
4000
4228
|
);
|
|
4001
4229
|
}
|
|
4002
4230
|
),
|
|
4003
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4231
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4232
|
+
/* @__PURE__ */ jsx24("span", { className: "px-1 text-secondary", children: "..." }),
|
|
4233
|
+
/* @__PURE__ */ jsx24(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4006
4234
|
] }),
|
|
4007
|
-
/* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx24(
|
|
4008
4236
|
Button,
|
|
4009
4237
|
{
|
|
4010
4238
|
variant: "ghost",
|
|
@@ -4012,12 +4240,12 @@ function Table({
|
|
|
4012
4240
|
onClick: handleNextPage,
|
|
4013
4241
|
disabled: !table.getCanNextPage(),
|
|
4014
4242
|
className: "p-2",
|
|
4015
|
-
children: /* @__PURE__ */
|
|
4243
|
+
children: /* @__PURE__ */ jsx24(ChevronRight, { className: "w-4 h-4" })
|
|
4016
4244
|
}
|
|
4017
4245
|
)
|
|
4018
4246
|
] }),
|
|
4019
|
-
/* @__PURE__ */
|
|
4020
|
-
/* @__PURE__ */
|
|
4247
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3 w-48", children: [
|
|
4248
|
+
/* @__PURE__ */ jsx24(
|
|
4021
4249
|
Typography,
|
|
4022
4250
|
{
|
|
4023
4251
|
variant: "body-sm",
|
|
@@ -4025,14 +4253,14 @@ function Table({
|
|
|
4025
4253
|
children: "Rows per page:"
|
|
4026
4254
|
}
|
|
4027
4255
|
),
|
|
4028
|
-
/* @__PURE__ */
|
|
4256
|
+
/* @__PURE__ */ jsxs16(
|
|
4029
4257
|
Select,
|
|
4030
4258
|
{
|
|
4031
4259
|
value: table.getState().pagination.pageSize.toString(),
|
|
4032
4260
|
onValueChange: handlePageSizeChange,
|
|
4033
4261
|
children: [
|
|
4034
|
-
/* @__PURE__ */
|
|
4035
|
-
/* @__PURE__ */
|
|
4262
|
+
/* @__PURE__ */ jsx24(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ jsx24(SelectValue, {}) }),
|
|
4263
|
+
/* @__PURE__ */ jsx24(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ jsx24(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4036
4264
|
]
|
|
4037
4265
|
}
|
|
4038
4266
|
)
|
|
@@ -4078,6 +4306,7 @@ export {
|
|
|
4078
4306
|
DatePicker,
|
|
4079
4307
|
Doc,
|
|
4080
4308
|
Dollar,
|
|
4309
|
+
Download,
|
|
4081
4310
|
DropdownMenu,
|
|
4082
4311
|
DropdownMenuCheckboxItem,
|
|
4083
4312
|
DropdownMenuContent,
|
|
@@ -4110,7 +4339,6 @@ export {
|
|
|
4110
4339
|
FieldTitle,
|
|
4111
4340
|
Filter,
|
|
4112
4341
|
FilterDescending,
|
|
4113
|
-
FormField,
|
|
4114
4342
|
GenericTooltip,
|
|
4115
4343
|
GraphBar,
|
|
4116
4344
|
GraphDonut,
|
|
@@ -4128,9 +4356,11 @@ export {
|
|
|
4128
4356
|
MagnifyingGlass,
|
|
4129
4357
|
Minus,
|
|
4130
4358
|
MoreMenu,
|
|
4359
|
+
PdfViewer,
|
|
4131
4360
|
Phone,
|
|
4132
4361
|
PieChart,
|
|
4133
4362
|
Plus,
|
|
4363
|
+
Print,
|
|
4134
4364
|
QuestionCircle,
|
|
4135
4365
|
Select,
|
|
4136
4366
|
SelectContent,
|
|
@@ -4179,6 +4409,7 @@ export {
|
|
|
4179
4409
|
getHeatmapColor,
|
|
4180
4410
|
getPerformanceColor,
|
|
4181
4411
|
getSeriesColor,
|
|
4412
|
+
initializePdfWorker,
|
|
4182
4413
|
selectTriggerVariants,
|
|
4183
4414
|
tabsVariants,
|
|
4184
4415
|
typographyVariants,
|