@douglasneuroinformatics/libui 3.4.2 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.ts +22 -8
- package/dist/components.js +425 -386
- package/dist/components.js.map +1 -1
- package/dist/douglasneuroinformatics-libui-3.5.1.tgz +0 -0
- package/package.json +2 -1
- package/src/components/FileDropzone/FileDropzone.spec.tsx +69 -0
- package/src/components/FileDropzone/FileDropzone.stories.tsx +33 -0
- package/src/components/FileDropzone/FileDropzone.tsx +52 -0
- package/src/components/FileDropzone/index.ts +1 -0
- package/src/components/Tooltip/TooltipRoot.tsx +14 -2
- package/src/components/index.ts +1 -0
- package/dist/douglasneuroinformatics-libui-3.4.2.tgz +0 -0
package/dist/components.js
CHANGED
|
@@ -1780,6 +1780,38 @@ var ErrorBoundary = ({ children }) => {
|
|
|
1780
1780
|
return /* @__PURE__ */ jsx87(ReactErrorBoundary, { FallbackComponent: ErrorFallback, children });
|
|
1781
1781
|
};
|
|
1782
1782
|
|
|
1783
|
+
// src/components/FileDropzone/FileDropzone.tsx
|
|
1784
|
+
import { useCallback } from "react";
|
|
1785
|
+
import { useDropzone } from "react-dropzone";
|
|
1786
|
+
import { jsx as jsx88, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1787
|
+
var FileDropzone = ({ acceptedFileTypes, file, setFile }) => {
|
|
1788
|
+
const { t } = useTranslation();
|
|
1789
|
+
const handleDrop = useCallback(
|
|
1790
|
+
(acceptedFiles, rejectedFiles) => {
|
|
1791
|
+
for (const { errors, file: file2 } of rejectedFiles) {
|
|
1792
|
+
console.error(errors, file2);
|
|
1793
|
+
}
|
|
1794
|
+
setFile(acceptedFiles[0]);
|
|
1795
|
+
},
|
|
1796
|
+
[setFile]
|
|
1797
|
+
);
|
|
1798
|
+
const { getInputProps, getRootProps, isDragActive } = useDropzone({
|
|
1799
|
+
accept: acceptedFileTypes,
|
|
1800
|
+
maxFiles: 1,
|
|
1801
|
+
onDrop: handleDrop
|
|
1802
|
+
});
|
|
1803
|
+
return /* @__PURE__ */ jsxs22("div", { "data-testid": "dropzone", ...getRootProps(), children: [
|
|
1804
|
+
/* @__PURE__ */ jsx88("p", { className: "mt-1 border border-dashed p-4 text-center text-sm", "data-testid": "dropzoneText", children: file ? file.name : isDragActive ? t({
|
|
1805
|
+
en: "File to upload",
|
|
1806
|
+
fr: "fichier \xE0 t\xE9l\xE9charger"
|
|
1807
|
+
}) : t({
|
|
1808
|
+
en: "Drag'n'drop files or click on box to upload",
|
|
1809
|
+
fr: "Glissez-d\xE9posez les fichiers ou cliquez sur la case pour les t\xE9l\xE9charger"
|
|
1810
|
+
}) }),
|
|
1811
|
+
/* @__PURE__ */ jsx88("input", { ...getInputProps() })
|
|
1812
|
+
] });
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1783
1815
|
// src/components/Form/Form.tsx
|
|
1784
1816
|
import { useEffect as useEffect9, useState as useState8 } from "react";
|
|
1785
1817
|
import "react";
|
|
@@ -1788,19 +1820,19 @@ import { twMerge } from "tailwind-merge";
|
|
|
1788
1820
|
import "zod";
|
|
1789
1821
|
|
|
1790
1822
|
// src/components/Heading/Heading.tsx
|
|
1791
|
-
import { jsx as
|
|
1823
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
1792
1824
|
var Heading = ({ children, className, variant }) => {
|
|
1793
1825
|
switch (variant) {
|
|
1794
1826
|
case "h1":
|
|
1795
|
-
return /* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ jsx89("h1", { className: cn("text-3xl font-bold tracking-tight", className), children });
|
|
1796
1828
|
case "h2":
|
|
1797
|
-
return /* @__PURE__ */
|
|
1829
|
+
return /* @__PURE__ */ jsx89("h2", { className: cn("text-2xl font-semibold tracking-tight", className), children });
|
|
1798
1830
|
case "h3":
|
|
1799
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ jsx89("h3", { className: cn("text-xl font-semibold tracking-tight", className), children });
|
|
1800
1832
|
case "h4":
|
|
1801
|
-
return /* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ jsx89("h4", { className: cn("text-lg font-semibold tracking-tight", className), children });
|
|
1802
1834
|
case "h5":
|
|
1803
|
-
return /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ jsx89("h5", { className: cn("text-base font-semibold tracking-tight", className), children });
|
|
1804
1836
|
default:
|
|
1805
1837
|
throw new Error(`Unhandled heading variant: ${variant}`);
|
|
1806
1838
|
}
|
|
@@ -1809,11 +1841,11 @@ var Heading = ({ children, className, variant }) => {
|
|
|
1809
1841
|
// src/components/Form/ErrorMessage.tsx
|
|
1810
1842
|
import "react";
|
|
1811
1843
|
import { CircleAlertIcon } from "lucide-react";
|
|
1812
|
-
import { jsx as
|
|
1844
|
+
import { jsx as jsx90, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1813
1845
|
var ErrorMessage = ({ error }) => {
|
|
1814
|
-
return error ? /* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1846
|
+
return error ? /* @__PURE__ */ jsx90("div", { className: "space-y-1.5", children: error.map((message) => /* @__PURE__ */ jsxs23("div", { className: "flex w-full items-center text-sm font-medium text-destructive", children: [
|
|
1847
|
+
/* @__PURE__ */ jsx90(CircleAlertIcon, { className: "mr-1", style: { strokeWidth: "2px" } }),
|
|
1848
|
+
/* @__PURE__ */ jsx90("span", { children: message })
|
|
1817
1849
|
] }, message)) ?? null }) : null;
|
|
1818
1850
|
};
|
|
1819
1851
|
|
|
@@ -1826,7 +1858,7 @@ import "react";
|
|
|
1826
1858
|
import { pick } from "lodash-es";
|
|
1827
1859
|
|
|
1828
1860
|
// src/components/Form/StaticField.tsx
|
|
1829
|
-
import { useCallback as
|
|
1861
|
+
import { useCallback as useCallback3 } from "react";
|
|
1830
1862
|
import "react";
|
|
1831
1863
|
import { match as match7 } from "ts-pattern";
|
|
1832
1864
|
|
|
@@ -1843,9 +1875,9 @@ import { parseNumber } from "@douglasneuroinformatics/libjs";
|
|
|
1843
1875
|
|
|
1844
1876
|
// src/components/Input/Input.tsx
|
|
1845
1877
|
import * as React25 from "react";
|
|
1846
|
-
import { jsx as
|
|
1878
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
1847
1879
|
var Input = React25.forwardRef(function Input2({ className, type, ...props }, ref) {
|
|
1848
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsx91(
|
|
1849
1881
|
"input",
|
|
1850
1882
|
{
|
|
1851
1883
|
autoComplete: "off",
|
|
@@ -1865,12 +1897,12 @@ var Input = React25.forwardRef(function Input2({ className, type, ...props }, re
|
|
|
1865
1897
|
import { forwardRef as forwardRef68 } from "react";
|
|
1866
1898
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1867
1899
|
import { cva as cva3 } from "class-variance-authority";
|
|
1868
|
-
import { jsx as
|
|
1900
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
1869
1901
|
var labelVariants = cva3(
|
|
1870
1902
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 aria-disabled:cursor-not-allowed aria-disabled:opacity-70"
|
|
1871
1903
|
);
|
|
1872
1904
|
var Label3 = forwardRef68(function Label4({ className, ...props }, ref) {
|
|
1873
|
-
return /* @__PURE__ */
|
|
1905
|
+
return /* @__PURE__ */ jsx92(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props });
|
|
1874
1906
|
});
|
|
1875
1907
|
|
|
1876
1908
|
// src/components/Form/FieldGroup/FieldGroupDescription.tsx
|
|
@@ -1883,10 +1915,10 @@ import { Root as PopoverRoot, Trigger as PopoverTrigger } from "@radix-ui/react-
|
|
|
1883
1915
|
// src/components/Popover/PopoverContent.tsx
|
|
1884
1916
|
import * as React26 from "react";
|
|
1885
1917
|
import { Content as Content7, Portal as Portal7 } from "@radix-ui/react-popover";
|
|
1886
|
-
import { jsx as
|
|
1918
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
1887
1919
|
var PopoverContent = React26.forwardRef(
|
|
1888
1920
|
function PopoverContent2({ align = "center", asChild, autofocus = true, className, collisionPadding = 0, sideOffset = 4, ...props }, ref) {
|
|
1889
|
-
return /* @__PURE__ */
|
|
1921
|
+
return /* @__PURE__ */ jsx93(Portal7, { children: /* @__PURE__ */ jsx93(
|
|
1890
1922
|
Content7,
|
|
1891
1923
|
{
|
|
1892
1924
|
align,
|
|
@@ -1912,21 +1944,21 @@ var Popover = Object.assign(PopoverRoot.bind(null), {
|
|
|
1912
1944
|
});
|
|
1913
1945
|
|
|
1914
1946
|
// src/components/Form/FieldGroup/FieldGroupDescription.tsx
|
|
1915
|
-
import { jsx as
|
|
1916
|
-
var FieldGroupDescription = ({ description }) => description ? /* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1947
|
+
import { jsx as jsx94, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1948
|
+
var FieldGroupDescription = ({ description }) => description ? /* @__PURE__ */ jsxs24(Popover, { children: [
|
|
1949
|
+
/* @__PURE__ */ jsx94(Popover.Trigger, { tabIndex: -1, children: /* @__PURE__ */ jsx94(CircleHelpIcon, { className: "text-muted-foreground" }) }),
|
|
1950
|
+
/* @__PURE__ */ jsx94(Popover.Content, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsx94("p", { children: description }) })
|
|
1919
1951
|
] }) : null;
|
|
1920
1952
|
|
|
1921
1953
|
// src/components/Form/FieldGroup/FieldGroupRoot.tsx
|
|
1922
1954
|
import "react";
|
|
1923
|
-
import { jsx as
|
|
1924
|
-
var FieldGroupRoot = ({ children, name }) => /* @__PURE__ */
|
|
1955
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
1956
|
+
var FieldGroupRoot = ({ children, name }) => /* @__PURE__ */ jsx95("div", { className: "flex flex-col gap-3 @container", "data-field-group": name, children });
|
|
1925
1957
|
|
|
1926
1958
|
// src/components/Form/FieldGroup/FieldGroupRow.tsx
|
|
1927
1959
|
import "react";
|
|
1928
|
-
import { jsx as
|
|
1929
|
-
var FieldGroupRow = ({ children }) => /* @__PURE__ */
|
|
1960
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
1961
|
+
var FieldGroupRow = ({ children }) => /* @__PURE__ */ jsx96("div", { className: "relative flex items-center gap-2", children });
|
|
1930
1962
|
|
|
1931
1963
|
// src/components/Form/FieldGroup/FieldGroup.tsx
|
|
1932
1964
|
var FieldGroup = Object.assign(FieldGroupRoot, {
|
|
@@ -1936,7 +1968,7 @@ var FieldGroup = Object.assign(FieldGroupRoot, {
|
|
|
1936
1968
|
});
|
|
1937
1969
|
|
|
1938
1970
|
// src/components/Form/NumberField/NumberFieldInput.tsx
|
|
1939
|
-
import { jsx as
|
|
1971
|
+
import { jsx as jsx97, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1940
1972
|
var NumberFieldInput = ({
|
|
1941
1973
|
description,
|
|
1942
1974
|
disabled,
|
|
@@ -1969,12 +2001,12 @@ var NumberFieldInput = ({
|
|
|
1969
2001
|
setValue(newValue);
|
|
1970
2002
|
}
|
|
1971
2003
|
};
|
|
1972
|
-
return /* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ jsxs25(FieldGroup, { name, children: [
|
|
2005
|
+
/* @__PURE__ */ jsxs25(FieldGroup.Row, { children: [
|
|
2006
|
+
/* @__PURE__ */ jsx97(Label3, { children: label }),
|
|
2007
|
+
/* @__PURE__ */ jsx97(FieldGroup.Description, { description })
|
|
1976
2008
|
] }),
|
|
1977
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx97(
|
|
1978
2010
|
Input,
|
|
1979
2011
|
{
|
|
1980
2012
|
disabled: disabled || readOnly,
|
|
@@ -1986,7 +2018,7 @@ var NumberFieldInput = ({
|
|
|
1986
2018
|
onChange: handleChange
|
|
1987
2019
|
}
|
|
1988
2020
|
),
|
|
1989
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsx97(FieldGroup.Error, { error })
|
|
1990
2022
|
] });
|
|
1991
2023
|
};
|
|
1992
2024
|
|
|
@@ -1998,9 +2030,9 @@ import * as RadioGroupPrimitive2 from "@radix-ui/react-radio-group";
|
|
|
1998
2030
|
import { forwardRef as forwardRef70 } from "react";
|
|
1999
2031
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
2000
2032
|
import { CircleIcon as CircleIcon3 } from "lucide-react";
|
|
2001
|
-
import { jsx as
|
|
2033
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
2002
2034
|
var RadioGroupItem = forwardRef70(function RadioGroupItem2({ className, ...props }, ref) {
|
|
2003
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ jsx98(
|
|
2004
2036
|
RadioGroupPrimitive.Item,
|
|
2005
2037
|
{
|
|
2006
2038
|
className: cn(
|
|
@@ -2009,7 +2041,7 @@ var RadioGroupItem = forwardRef70(function RadioGroupItem2({ className, ...props
|
|
|
2009
2041
|
),
|
|
2010
2042
|
ref,
|
|
2011
2043
|
...props,
|
|
2012
|
-
children: /* @__PURE__ */
|
|
2044
|
+
children: /* @__PURE__ */ jsx98(RadioGroupPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsx98(
|
|
2013
2045
|
CircleIcon3,
|
|
2014
2046
|
{
|
|
2015
2047
|
className: "fill-current text-current",
|
|
@@ -2021,16 +2053,16 @@ var RadioGroupItem = forwardRef70(function RadioGroupItem2({ className, ...props
|
|
|
2021
2053
|
});
|
|
2022
2054
|
|
|
2023
2055
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
2024
|
-
import { jsx as
|
|
2056
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
2025
2057
|
var RadioGroupRoot = React31.forwardRef(function RadioGroup3({ className, ...props }, ref) {
|
|
2026
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx99(RadioGroupPrimitive2.Root, { className: cn("grid gap-2", className), "data-testid": "radio-group", ...props, ref });
|
|
2027
2059
|
});
|
|
2028
2060
|
var RadioGroup4 = Object.assign(RadioGroupRoot, {
|
|
2029
2061
|
Item: RadioGroupItem
|
|
2030
2062
|
});
|
|
2031
2063
|
|
|
2032
2064
|
// src/components/Form/NumberField/NumberFieldRadio.tsx
|
|
2033
|
-
import { jsx as
|
|
2065
|
+
import { jsx as jsx100, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2034
2066
|
var NumberFieldRadio = ({
|
|
2035
2067
|
description,
|
|
2036
2068
|
disableAutoPrefix,
|
|
@@ -2044,12 +2076,12 @@ var NumberFieldRadio = ({
|
|
|
2044
2076
|
value
|
|
2045
2077
|
}) => {
|
|
2046
2078
|
const optionsCount = Object.keys(options).length;
|
|
2047
|
-
return /* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ jsxs26(FieldGroup, { name, children: [
|
|
2080
|
+
/* @__PURE__ */ jsxs26(FieldGroup.Row, { children: [
|
|
2081
|
+
/* @__PURE__ */ jsx100(Label3, { children: label }),
|
|
2082
|
+
/* @__PURE__ */ jsx100(FieldGroup.Description, { description })
|
|
2051
2083
|
] }),
|
|
2052
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsx100(
|
|
2053
2085
|
RadioGroup4,
|
|
2054
2086
|
{
|
|
2055
2087
|
className: cn(
|
|
@@ -2061,9 +2093,9 @@ var NumberFieldRadio = ({
|
|
|
2061
2093
|
onValueChange: (value2) => setValue(parseInt(value2)),
|
|
2062
2094
|
children: Object.keys(options).map((val) => parseInt(val)).toSorted((a, b) => a - b).map((val) => {
|
|
2063
2095
|
const text = (disableAutoPrefix ? "" : `${val} - `) + options[val];
|
|
2064
|
-
return /* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2096
|
+
return /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2", children: [
|
|
2097
|
+
/* @__PURE__ */ jsx100(RadioGroup4.Item, { disabled: disabled || readOnly, id: `${name}-${val}`, value: val.toString() }),
|
|
2098
|
+
/* @__PURE__ */ jsx100(
|
|
2067
2099
|
Label3,
|
|
2068
2100
|
{
|
|
2069
2101
|
"aria-disabled": disabled || readOnly,
|
|
@@ -2076,7 +2108,7 @@ var NumberFieldRadio = ({
|
|
|
2076
2108
|
})
|
|
2077
2109
|
}
|
|
2078
2110
|
),
|
|
2079
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ jsx100(FieldGroup.Error, { error })
|
|
2080
2112
|
] });
|
|
2081
2113
|
};
|
|
2082
2114
|
|
|
@@ -2091,15 +2123,15 @@ import * as SelectPrimitive3 from "@radix-ui/react-select";
|
|
|
2091
2123
|
import { forwardRef as forwardRef72 } from "react";
|
|
2092
2124
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2093
2125
|
import { ChevronDownIcon as ChevronDownIcon4 } from "lucide-react";
|
|
2094
|
-
import { jsx as
|
|
2126
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
2095
2127
|
var SelectScrollDownButton = forwardRef72(function SelectScrollDownButton2({ className, ...props }, ref) {
|
|
2096
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ jsx101(
|
|
2097
2129
|
SelectPrimitive.ScrollDownButton,
|
|
2098
2130
|
{
|
|
2099
2131
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
2100
2132
|
ref,
|
|
2101
2133
|
...props,
|
|
2102
|
-
children: /* @__PURE__ */
|
|
2134
|
+
children: /* @__PURE__ */ jsx101(ChevronDownIcon4, {})
|
|
2103
2135
|
}
|
|
2104
2136
|
);
|
|
2105
2137
|
});
|
|
@@ -2108,23 +2140,23 @@ var SelectScrollDownButton = forwardRef72(function SelectScrollDownButton2({ cla
|
|
|
2108
2140
|
import { forwardRef as forwardRef73 } from "react";
|
|
2109
2141
|
import * as SelectPrimitive2 from "@radix-ui/react-select";
|
|
2110
2142
|
import { ChevronUpIcon as ChevronUpIcon2 } from "lucide-react";
|
|
2111
|
-
import { jsx as
|
|
2143
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
2112
2144
|
var SelectScrollUpButton = forwardRef73(function SelectScrollUpButton2({ className, ...props }, ref) {
|
|
2113
|
-
return /* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ jsx102(
|
|
2114
2146
|
SelectPrimitive2.ScrollUpButton,
|
|
2115
2147
|
{
|
|
2116
2148
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
2117
2149
|
ref,
|
|
2118
2150
|
...props,
|
|
2119
|
-
children: /* @__PURE__ */
|
|
2151
|
+
children: /* @__PURE__ */ jsx102(ChevronUpIcon2, {})
|
|
2120
2152
|
}
|
|
2121
2153
|
);
|
|
2122
2154
|
});
|
|
2123
2155
|
|
|
2124
2156
|
// src/components/Select/SelectContent.tsx
|
|
2125
|
-
import { jsx as
|
|
2157
|
+
import { jsx as jsx103, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2126
2158
|
var SelectContent = forwardRef74(function SelectContent2({ children, className, position = "popper", ...props }, ref) {
|
|
2127
|
-
return /* @__PURE__ */
|
|
2159
|
+
return /* @__PURE__ */ jsx103(SelectPrimitive3.Portal, { children: /* @__PURE__ */ jsxs27(
|
|
2128
2160
|
SelectPrimitive3.Content,
|
|
2129
2161
|
{
|
|
2130
2162
|
className: cn(
|
|
@@ -2136,8 +2168,8 @@ var SelectContent = forwardRef74(function SelectContent2({ children, className,
|
|
|
2136
2168
|
ref,
|
|
2137
2169
|
...props,
|
|
2138
2170
|
children: [
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsx103(SelectScrollUpButton, {}),
|
|
2172
|
+
/* @__PURE__ */ jsx103(
|
|
2141
2173
|
SelectPrimitive3.Viewport,
|
|
2142
2174
|
{
|
|
2143
2175
|
className: cn(
|
|
@@ -2147,7 +2179,7 @@ var SelectContent = forwardRef74(function SelectContent2({ children, className,
|
|
|
2147
2179
|
children
|
|
2148
2180
|
}
|
|
2149
2181
|
),
|
|
2150
|
-
/* @__PURE__ */
|
|
2182
|
+
/* @__PURE__ */ jsx103(SelectScrollDownButton, {})
|
|
2151
2183
|
]
|
|
2152
2184
|
}
|
|
2153
2185
|
) });
|
|
@@ -2157,9 +2189,9 @@ var SelectContent = forwardRef74(function SelectContent2({ children, className,
|
|
|
2157
2189
|
import { forwardRef as forwardRef75 } from "react";
|
|
2158
2190
|
import * as SelectPrimitive4 from "@radix-ui/react-select";
|
|
2159
2191
|
import { CheckIcon as CheckIcon4 } from "lucide-react";
|
|
2160
|
-
import { jsx as
|
|
2192
|
+
import { jsx as jsx104, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2161
2193
|
var SelectItem = forwardRef75(function SelectItem2({ children, className, ...props }, ref) {
|
|
2162
|
-
return /* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ jsxs28(
|
|
2163
2195
|
SelectPrimitive4.Item,
|
|
2164
2196
|
{
|
|
2165
2197
|
className: cn(
|
|
@@ -2169,8 +2201,8 @@ var SelectItem = forwardRef75(function SelectItem2({ children, className, ...pro
|
|
|
2169
2201
|
ref,
|
|
2170
2202
|
...props,
|
|
2171
2203
|
children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx104("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx104(SelectPrimitive4.ItemIndicator, { children: /* @__PURE__ */ jsx104(CheckIcon4, { className: "h-4 w-4" }) }) }),
|
|
2205
|
+
/* @__PURE__ */ jsx104(SelectPrimitive4.ItemText, { children })
|
|
2174
2206
|
]
|
|
2175
2207
|
}
|
|
2176
2208
|
);
|
|
@@ -2179,25 +2211,25 @@ var SelectItem = forwardRef75(function SelectItem2({ children, className, ...pro
|
|
|
2179
2211
|
// src/components/Select/SelectLabel.tsx
|
|
2180
2212
|
import { forwardRef as forwardRef76 } from "react";
|
|
2181
2213
|
import * as SelectPrimitive5 from "@radix-ui/react-select";
|
|
2182
|
-
import { jsx as
|
|
2214
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
2183
2215
|
var SelectLabel = forwardRef76(function SelectLabel2({ className, ...props }, ref) {
|
|
2184
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ jsx105(SelectPrimitive5.Label, { className: cn("px-2 py-1.5 text-sm font-semibold", className), ref, ...props });
|
|
2185
2217
|
});
|
|
2186
2218
|
|
|
2187
2219
|
// src/components/Select/SelectSeparator.tsx
|
|
2188
2220
|
import { forwardRef as forwardRef77 } from "react";
|
|
2189
2221
|
import * as SelectPrimitive6 from "@radix-ui/react-select";
|
|
2190
|
-
import { jsx as
|
|
2222
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
2191
2223
|
var SelectSeparator = forwardRef77(function SelectSeparator2({ className, ...props }, ref) {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ jsx106(SelectPrimitive6.Separator, { className: cn("-mx-1 my-1 h-px bg-muted", className), ref, ...props });
|
|
2193
2225
|
});
|
|
2194
2226
|
|
|
2195
2227
|
// src/components/Select/SelectTrigger.tsx
|
|
2196
2228
|
import { forwardRef as forwardRef78 } from "react";
|
|
2197
2229
|
import * as SelectPrimitive7 from "@radix-ui/react-select";
|
|
2198
|
-
import { jsx as
|
|
2230
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
2199
2231
|
var SelectTrigger = forwardRef78(function SelectTrigger2({ children, className, ...props }, ref) {
|
|
2200
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsx107(SelectPrimitive7.Trigger, { asChild: true, className, ref, ...props, children: /* @__PURE__ */ jsx107(DropdownButton, { children }) });
|
|
2201
2233
|
});
|
|
2202
2234
|
|
|
2203
2235
|
// src/components/Select/Select.tsx
|
|
@@ -2214,7 +2246,7 @@ var Select = Object.assign(SelectPrimitive8.Root.bind(null), {
|
|
|
2214
2246
|
});
|
|
2215
2247
|
|
|
2216
2248
|
// src/components/Form/NumberField/NumberFieldSelect.tsx
|
|
2217
|
-
import { jsx as
|
|
2249
|
+
import { jsx as jsx108, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2218
2250
|
var NumberFieldSelect = ({
|
|
2219
2251
|
description,
|
|
2220
2252
|
disableAutoPrefix,
|
|
@@ -2227,29 +2259,29 @@ var NumberFieldSelect = ({
|
|
|
2227
2259
|
setValue,
|
|
2228
2260
|
value
|
|
2229
2261
|
}) => {
|
|
2230
|
-
return /* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2233
|
-
/* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ jsxs29(FieldGroup, { name, children: [
|
|
2263
|
+
/* @__PURE__ */ jsxs29(FieldGroup.Row, { children: [
|
|
2264
|
+
/* @__PURE__ */ jsx108(Label3, { children: label }),
|
|
2265
|
+
/* @__PURE__ */ jsx108(FieldGroup.Description, { description })
|
|
2234
2266
|
] }),
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ jsxs29(Select, { name, value: value?.toString() ?? "", onValueChange: (value2) => setValue(parseFloat(value2)), children: [
|
|
2268
|
+
/* @__PURE__ */ jsx108(Select.Trigger, { "data-testid": `${name}-select-trigger`, disabled: disabled || readOnly, children: /* @__PURE__ */ jsx108(Select.Value, {}) }),
|
|
2269
|
+
/* @__PURE__ */ jsx108(Select.Content, { "data-testid": `${name}-select-content`, children: Object.keys(options).map((option) => {
|
|
2238
2270
|
const text = (disableAutoPrefix ? "" : `${option} - `) + options[option];
|
|
2239
|
-
return /* @__PURE__ */
|
|
2271
|
+
return /* @__PURE__ */ jsx108(Select.Item, { "data-testid": `${name}-select-item-${option}`, value: option, children: text }, option);
|
|
2240
2272
|
}) })
|
|
2241
2273
|
] }),
|
|
2242
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsx108(FieldGroup.Error, { error })
|
|
2243
2275
|
] });
|
|
2244
2276
|
};
|
|
2245
2277
|
|
|
2246
2278
|
// src/components/Slider/Slider.tsx
|
|
2247
2279
|
import { forwardRef as forwardRef79 } from "react";
|
|
2248
2280
|
import { Range, Root as Root13, Thumb, Track } from "@radix-ui/react-slider";
|
|
2249
|
-
import { jsx as
|
|
2281
|
+
import { jsx as jsx109, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2250
2282
|
var Slider = forwardRef79(
|
|
2251
2283
|
function Slider2({ className, disabled, ...props }, ref) {
|
|
2252
|
-
return /* @__PURE__ */
|
|
2284
|
+
return /* @__PURE__ */ jsxs30(
|
|
2253
2285
|
Root13,
|
|
2254
2286
|
{
|
|
2255
2287
|
className: cn("relative flex w-full touch-none select-none items-center py-1.5", className),
|
|
@@ -2257,16 +2289,16 @@ var Slider = forwardRef79(
|
|
|
2257
2289
|
ref,
|
|
2258
2290
|
...props,
|
|
2259
2291
|
children: [
|
|
2260
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx109(
|
|
2261
2293
|
Track,
|
|
2262
2294
|
{
|
|
2263
2295
|
"aria-disabled": disabled,
|
|
2264
2296
|
className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary opacity-15 aria-disabled:cursor-not-allowed aria-disabled:opacity-10",
|
|
2265
2297
|
"data-testid": "slider-track",
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2298
|
+
children: /* @__PURE__ */ jsx109(Range, { className: "absolute h-full bg-primary" })
|
|
2267
2299
|
}
|
|
2268
2300
|
),
|
|
2269
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ jsx109(
|
|
2270
2302
|
Thumb,
|
|
2271
2303
|
{
|
|
2272
2304
|
"aria-disabled": disabled,
|
|
@@ -2281,7 +2313,7 @@ var Slider = forwardRef79(
|
|
|
2281
2313
|
);
|
|
2282
2314
|
|
|
2283
2315
|
// src/components/Form/NumberField/NumberFieldSlider.tsx
|
|
2284
|
-
import { jsx as
|
|
2316
|
+
import { jsx as jsx110, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2285
2317
|
var NumberFieldSlider = ({
|
|
2286
2318
|
description,
|
|
2287
2319
|
disabled,
|
|
@@ -2294,13 +2326,13 @@ var NumberFieldSlider = ({
|
|
|
2294
2326
|
setValue,
|
|
2295
2327
|
value
|
|
2296
2328
|
}) => {
|
|
2297
|
-
return /* @__PURE__ */
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsxs31(FieldGroup, { name, children: [
|
|
2330
|
+
/* @__PURE__ */ jsxs31(FieldGroup.Row, { children: [
|
|
2331
|
+
/* @__PURE__ */ jsx110(Label3, { children: label }),
|
|
2332
|
+
/* @__PURE__ */ jsx110(FieldGroup.Description, { description })
|
|
2301
2333
|
] }),
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsxs31(FieldGroup.Row, { children: [
|
|
2335
|
+
/* @__PURE__ */ jsx110(
|
|
2304
2336
|
Slider,
|
|
2305
2337
|
{
|
|
2306
2338
|
disabled: disabled || readOnly,
|
|
@@ -2311,20 +2343,20 @@ var NumberFieldSlider = ({
|
|
|
2311
2343
|
onValueChange: ([value2]) => setValue(value2)
|
|
2312
2344
|
}
|
|
2313
2345
|
),
|
|
2314
|
-
/* @__PURE__ */
|
|
2346
|
+
/* @__PURE__ */ jsx110("span", { className: "flex h-full w-8 items-center justify-center text-sm text-muted-foreground", children: value ?? "NA" })
|
|
2315
2347
|
] }),
|
|
2316
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx110(FieldGroup.Error, { error })
|
|
2317
2349
|
] });
|
|
2318
2350
|
};
|
|
2319
2351
|
|
|
2320
2352
|
// src/components/Form/NumberField/NumberField.tsx
|
|
2321
|
-
import { jsx as
|
|
2353
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
2322
2354
|
var NumberField = (props) => {
|
|
2323
|
-
return match2(props).with({ variant: "input" }, (props2) => /* @__PURE__ */
|
|
2355
|
+
return match2(props).with({ variant: "input" }, (props2) => /* @__PURE__ */ jsx111(NumberFieldInput, { ...props2 })).with({ variant: "slider" }, (props2) => /* @__PURE__ */ jsx111(NumberFieldSlider, { ...props2 })).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx111(NumberFieldRadio, { ...props2 })).with({ variant: "select" }, (props2) => /* @__PURE__ */ jsx111(NumberFieldSelect, { ...props2 })).exhaustive();
|
|
2324
2356
|
};
|
|
2325
2357
|
|
|
2326
2358
|
// src/components/Form/NumberRecordField.tsx
|
|
2327
|
-
import { jsx as
|
|
2359
|
+
import { jsx as jsx112, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2328
2360
|
var NumberRecordField = ({
|
|
2329
2361
|
disabled,
|
|
2330
2362
|
error: recordError,
|
|
@@ -2342,11 +2374,11 @@ var NumberRecordField = ({
|
|
|
2342
2374
|
if (!recordValue) {
|
|
2343
2375
|
return null;
|
|
2344
2376
|
}
|
|
2345
|
-
return /* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2347
|
-
/* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsxs32("div", { className: "space-y-4", children: [
|
|
2378
|
+
/* @__PURE__ */ jsx112(Heading, { className: "font-medium", variant: "h5", children: label }),
|
|
2379
|
+
/* @__PURE__ */ jsx112("div", { className: "space-y-6", children: Object.keys(items).map((name) => {
|
|
2348
2380
|
const item = items[name];
|
|
2349
|
-
return /* @__PURE__ */
|
|
2381
|
+
return /* @__PURE__ */ jsx112(
|
|
2350
2382
|
NumberField,
|
|
2351
2383
|
{
|
|
2352
2384
|
error: recordError?.[name],
|
|
@@ -2374,7 +2406,7 @@ import { MinusCircleIcon, PlusCircleIcon } from "lucide-react";
|
|
|
2374
2406
|
import { match as match4 } from "ts-pattern";
|
|
2375
2407
|
|
|
2376
2408
|
// src/components/Form/BooleanField/BooleanFieldCheckbox.tsx
|
|
2377
|
-
import { jsx as
|
|
2409
|
+
import { jsx as jsx113, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2378
2410
|
var BooleanFieldCheckbox = ({
|
|
2379
2411
|
disabled,
|
|
2380
2412
|
error,
|
|
@@ -2384,9 +2416,9 @@ var BooleanFieldCheckbox = ({
|
|
|
2384
2416
|
setValue,
|
|
2385
2417
|
value
|
|
2386
2418
|
}) => {
|
|
2387
|
-
return /* @__PURE__ */
|
|
2388
|
-
/* @__PURE__ */
|
|
2389
|
-
/* @__PURE__ */
|
|
2419
|
+
return /* @__PURE__ */ jsxs33(FieldGroup, { name, children: [
|
|
2420
|
+
/* @__PURE__ */ jsxs33(FieldGroup.Row, { children: [
|
|
2421
|
+
/* @__PURE__ */ jsx113(
|
|
2390
2422
|
Checkbox,
|
|
2391
2423
|
{
|
|
2392
2424
|
checked: value,
|
|
@@ -2400,16 +2432,16 @@ var BooleanFieldCheckbox = ({
|
|
|
2400
2432
|
}
|
|
2401
2433
|
}
|
|
2402
2434
|
),
|
|
2403
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ jsx113(Label3, { htmlFor: name, children: label })
|
|
2404
2436
|
] }),
|
|
2405
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ jsx113(FieldGroup.Error, { error })
|
|
2406
2438
|
] });
|
|
2407
2439
|
};
|
|
2408
2440
|
|
|
2409
2441
|
// src/components/Form/BooleanField/BooleanFieldRadio.tsx
|
|
2410
|
-
import { useCallback } from "react";
|
|
2442
|
+
import { useCallback as useCallback2 } from "react";
|
|
2411
2443
|
import { match as match3 } from "ts-pattern";
|
|
2412
|
-
import { jsx as
|
|
2444
|
+
import { jsx as jsx114, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2413
2445
|
var stringifyBoolean = (value) => match3(value).with(void 0, () => "").with(true, () => "true").with(false, () => "false").exhaustive();
|
|
2414
2446
|
var BooleanFieldRadio = ({
|
|
2415
2447
|
disabled,
|
|
@@ -2422,15 +2454,15 @@ var BooleanFieldRadio = ({
|
|
|
2422
2454
|
value
|
|
2423
2455
|
}) => {
|
|
2424
2456
|
const { t } = useTranslation("libui");
|
|
2425
|
-
const handleValueChange =
|
|
2457
|
+
const handleValueChange = useCallback2(
|
|
2426
2458
|
(value2) => {
|
|
2427
2459
|
match3(value2).with("", () => setValue(void 0)).with("true", () => setValue(true)).with("false", () => setValue(false)).otherwise((value3) => console.error(`Unexpected value for boolean field '${name}': ${value3}`));
|
|
2428
2460
|
},
|
|
2429
2461
|
[match3, setValue]
|
|
2430
2462
|
);
|
|
2431
|
-
return /* @__PURE__ */
|
|
2432
|
-
/* @__PURE__ */
|
|
2433
|
-
/* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsxs34(FieldGroup, { name, children: [
|
|
2464
|
+
/* @__PURE__ */ jsx114(Label3, { children: label }),
|
|
2465
|
+
/* @__PURE__ */ jsxs34(
|
|
2434
2466
|
RadioGroup4,
|
|
2435
2467
|
{
|
|
2436
2468
|
disabled: disabled || readOnly,
|
|
@@ -2438,9 +2470,9 @@ var BooleanFieldRadio = ({
|
|
|
2438
2470
|
value: stringifyBoolean(value),
|
|
2439
2471
|
onValueChange: handleValueChange,
|
|
2440
2472
|
children: [
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsxs34(FieldGroup.Row, { children: [
|
|
2474
|
+
/* @__PURE__ */ jsx114(RadioGroup4.Item, { id: `${name}-true`, value: "true" }),
|
|
2475
|
+
/* @__PURE__ */ jsx114(
|
|
2444
2476
|
Label3,
|
|
2445
2477
|
{
|
|
2446
2478
|
"aria-disabled": disabled || readOnly,
|
|
@@ -2450,9 +2482,9 @@ var BooleanFieldRadio = ({
|
|
|
2450
2482
|
}
|
|
2451
2483
|
)
|
|
2452
2484
|
] }),
|
|
2453
|
-
/* @__PURE__ */
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ jsxs34(FieldGroup.Row, { children: [
|
|
2486
|
+
/* @__PURE__ */ jsx114(RadioGroup4.Item, { id: `${name}-false`, value: "false" }),
|
|
2487
|
+
/* @__PURE__ */ jsx114(
|
|
2456
2488
|
Label3,
|
|
2457
2489
|
{
|
|
2458
2490
|
"aria-disabled": disabled || readOnly,
|
|
@@ -2465,20 +2497,20 @@ var BooleanFieldRadio = ({
|
|
|
2465
2497
|
]
|
|
2466
2498
|
}
|
|
2467
2499
|
),
|
|
2468
|
-
/* @__PURE__ */
|
|
2500
|
+
/* @__PURE__ */ jsx114(FieldGroup.Error, { error })
|
|
2469
2501
|
] });
|
|
2470
2502
|
};
|
|
2471
2503
|
|
|
2472
2504
|
// src/components/Form/BooleanField/BooleanField.tsx
|
|
2473
|
-
import { jsx as
|
|
2505
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
2474
2506
|
var BooleanField = (props) => {
|
|
2475
|
-
return match4(props).with({ variant: "radio" }, (props2) => /* @__PURE__ */
|
|
2507
|
+
return match4(props).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx115(BooleanFieldRadio, { ...props2 })).with({ variant: "checkbox" }, (props2) => /* @__PURE__ */ jsx115(BooleanFieldCheckbox, { ...props2 })).exhaustive();
|
|
2476
2508
|
};
|
|
2477
2509
|
|
|
2478
2510
|
// src/components/Form/DateField/DateField.tsx
|
|
2479
2511
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
2480
2512
|
import { toBasicISOString as toBasicISOString2 } from "@douglasneuroinformatics/libjs";
|
|
2481
|
-
import { jsx as
|
|
2513
|
+
import { jsx as jsx116, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2482
2514
|
var isValidDateString = (s) => /^(\d{4})-((0[1-9])|(1[0-2]))-((0[1-9])|([12])[0-9]|3[01])$/.test(s);
|
|
2483
2515
|
var DateField = ({ disabled, error, label, name, readOnly, setValue, value }) => {
|
|
2484
2516
|
const [isDatePickerOpen, setIsDatePickerOpen] = useState5(false);
|
|
@@ -2497,10 +2529,10 @@ var DateField = ({ disabled, error, label, name, readOnly, setValue, value }) =>
|
|
|
2497
2529
|
useEffect4(() => {
|
|
2498
2530
|
setInputValue(value ? toBasicISOString2(value) : "");
|
|
2499
2531
|
}, [value]);
|
|
2500
|
-
return /* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2503
|
-
/* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsxs35(FieldGroup, { name, children: [
|
|
2533
|
+
/* @__PURE__ */ jsx116(Label3, { htmlFor: name, children: label }),
|
|
2534
|
+
/* @__PURE__ */ jsxs35(Popover, { open: isDatePickerOpen, onOpenChange: setIsDatePickerOpen, children: [
|
|
2535
|
+
/* @__PURE__ */ jsx116(Popover.Trigger, { children: /* @__PURE__ */ jsx116(
|
|
2504
2536
|
Input,
|
|
2505
2537
|
{
|
|
2506
2538
|
autoComplete: "off",
|
|
@@ -2515,7 +2547,7 @@ var DateField = ({ disabled, error, label, name, readOnly, setValue, value }) =>
|
|
|
2515
2547
|
onFocus: () => setIsInputFocused(true)
|
|
2516
2548
|
}
|
|
2517
2549
|
) }),
|
|
2518
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ jsx116(Popover.Content, { asChild: true, align: "start", autofocus: false, className: "w-auto", children: /* @__PURE__ */ jsx116(
|
|
2519
2551
|
DatePicker,
|
|
2520
2552
|
{
|
|
2521
2553
|
onSelection: (value2) => {
|
|
@@ -2525,7 +2557,7 @@ var DateField = ({ disabled, error, label, name, readOnly, setValue, value }) =>
|
|
|
2525
2557
|
}
|
|
2526
2558
|
) })
|
|
2527
2559
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ jsx116(FieldGroup.Error, { error })
|
|
2529
2561
|
] });
|
|
2530
2562
|
};
|
|
2531
2563
|
|
|
@@ -2534,7 +2566,7 @@ import { useEffect as useEffect5 } from "react";
|
|
|
2534
2566
|
import { match as match5 } from "ts-pattern";
|
|
2535
2567
|
|
|
2536
2568
|
// src/components/Form/SetField/SetFieldListbox.tsx
|
|
2537
|
-
import { jsx as
|
|
2569
|
+
import { jsx as jsx117, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2538
2570
|
var SetFieldListbox = ({
|
|
2539
2571
|
description,
|
|
2540
2572
|
disabled,
|
|
@@ -2546,13 +2578,13 @@ var SetFieldListbox = ({
|
|
|
2546
2578
|
readOnly,
|
|
2547
2579
|
value
|
|
2548
2580
|
}) => {
|
|
2549
|
-
return /* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ jsxs36(FieldGroup, { name, children: [
|
|
2582
|
+
/* @__PURE__ */ jsxs36(FieldGroup.Row, { children: [
|
|
2583
|
+
/* @__PURE__ */ jsx117(Label3, { children: label }),
|
|
2584
|
+
/* @__PURE__ */ jsx117(FieldGroup.Description, { description })
|
|
2553
2585
|
] }),
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ jsx117("div", { className: "grid gap-2", children: Object.keys(options).map((option) => /* @__PURE__ */ jsxs36(FieldGroup.Row, { children: [
|
|
2587
|
+
/* @__PURE__ */ jsx117(
|
|
2556
2588
|
Checkbox,
|
|
2557
2589
|
{
|
|
2558
2590
|
checked: value?.has(option) ?? false,
|
|
@@ -2563,14 +2595,14 @@ var SetFieldListbox = ({
|
|
|
2563
2595
|
}
|
|
2564
2596
|
}
|
|
2565
2597
|
),
|
|
2566
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ jsx117(Label3, { className: "font-normal text-muted-foreground", htmlFor: `${name}-${option}`, children: options[option] })
|
|
2567
2599
|
] }, option)) }),
|
|
2568
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ jsx117(FieldGroup.Error, { error })
|
|
2569
2601
|
] });
|
|
2570
2602
|
};
|
|
2571
2603
|
|
|
2572
2604
|
// src/components/Form/SetField/SetFieldSelect.tsx
|
|
2573
|
-
import { jsx as
|
|
2605
|
+
import { jsx as jsx118, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2574
2606
|
var SetFieldSelect = ({
|
|
2575
2607
|
description,
|
|
2576
2608
|
disabled,
|
|
@@ -2582,16 +2614,16 @@ var SetFieldSelect = ({
|
|
|
2582
2614
|
readOnly,
|
|
2583
2615
|
value
|
|
2584
2616
|
}) => {
|
|
2585
|
-
return value ? /* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2617
|
+
return value ? /* @__PURE__ */ jsxs37(FieldGroup, { name, children: [
|
|
2618
|
+
/* @__PURE__ */ jsxs37(FieldGroup.Row, { children: [
|
|
2619
|
+
/* @__PURE__ */ jsx118(Label3, { children: label }),
|
|
2620
|
+
/* @__PURE__ */ jsx118(FieldGroup.Description, { description })
|
|
2589
2621
|
] }),
|
|
2590
|
-
/* @__PURE__ */
|
|
2591
|
-
/* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsxs37(DropdownMenu, { children: [
|
|
2623
|
+
/* @__PURE__ */ jsx118(DropdownMenu.Trigger, { asChild: true, className: "w-full", disabled: disabled || readOnly, children: /* @__PURE__ */ jsx118(DropdownButton, { children: value.size ? /* @__PURE__ */ jsx118("div", { className: "flex items-center gap-2", children: Array.from(value).map((option) => /* @__PURE__ */ jsx118(Badge, { className: "font-normal", variant: "outline", children: options[option] }, option)) }) : null }) }),
|
|
2624
|
+
/* @__PURE__ */ jsx118(DropdownMenu.Content, { widthFull: true, align: "start", children: Object.keys(options).map((option) => {
|
|
2593
2625
|
const checked = value.has(option);
|
|
2594
|
-
return /* @__PURE__ */
|
|
2626
|
+
return /* @__PURE__ */ jsx118(
|
|
2595
2627
|
DropdownMenu.CheckboxItem,
|
|
2596
2628
|
{
|
|
2597
2629
|
checked,
|
|
@@ -2605,12 +2637,12 @@ var SetFieldSelect = ({
|
|
|
2605
2637
|
);
|
|
2606
2638
|
}) })
|
|
2607
2639
|
] }),
|
|
2608
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ jsx118(FieldGroup.Error, { error })
|
|
2609
2641
|
] }) : null;
|
|
2610
2642
|
};
|
|
2611
2643
|
|
|
2612
2644
|
// src/components/Form/SetField/SetField.tsx
|
|
2613
|
-
import { jsx as
|
|
2645
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
2614
2646
|
var SetField = (props) => {
|
|
2615
2647
|
useEffect5(() => {
|
|
2616
2648
|
if (!props.value) {
|
|
@@ -2628,14 +2660,14 @@ var SetField = (props) => {
|
|
|
2628
2660
|
props.setValue(updatedValue);
|
|
2629
2661
|
}
|
|
2630
2662
|
};
|
|
2631
|
-
return match5(props).with({ variant: "select" }, (props2) => /* @__PURE__ */
|
|
2663
|
+
return match5(props).with({ variant: "select" }, (props2) => /* @__PURE__ */ jsx119(SetFieldSelect, { onCheckedChange: handleCheckedChange, ...props2 })).with({ variant: "listbox" }, (props2) => /* @__PURE__ */ jsx119(SetFieldListbox, { onCheckedChange: handleCheckedChange, ...props2 })).exhaustive();
|
|
2632
2664
|
};
|
|
2633
2665
|
|
|
2634
2666
|
// src/components/Form/StringField/StringField.tsx
|
|
2635
2667
|
import { match as match6 } from "ts-pattern";
|
|
2636
2668
|
|
|
2637
2669
|
// src/components/Form/StringField/StringFieldInput.tsx
|
|
2638
|
-
import { jsx as
|
|
2670
|
+
import { jsx as jsx120, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2639
2671
|
var StringFieldInput = ({
|
|
2640
2672
|
description,
|
|
2641
2673
|
disabled,
|
|
@@ -2647,12 +2679,12 @@ var StringFieldInput = ({
|
|
|
2647
2679
|
setValue,
|
|
2648
2680
|
value
|
|
2649
2681
|
}) => {
|
|
2650
|
-
return /* @__PURE__ */
|
|
2651
|
-
/* @__PURE__ */
|
|
2652
|
-
/* @__PURE__ */
|
|
2653
|
-
/* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ jsxs38(FieldGroup, { name, children: [
|
|
2683
|
+
/* @__PURE__ */ jsxs38(FieldGroup.Row, { children: [
|
|
2684
|
+
/* @__PURE__ */ jsx120(Label3, { htmlFor: name, children: label }),
|
|
2685
|
+
/* @__PURE__ */ jsx120(FieldGroup.Description, { description })
|
|
2654
2686
|
] }),
|
|
2655
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx120(
|
|
2656
2688
|
Input,
|
|
2657
2689
|
{
|
|
2658
2690
|
disabled: disabled || readOnly,
|
|
@@ -2664,7 +2696,7 @@ var StringFieldInput = ({
|
|
|
2664
2696
|
onChange: (event) => setValue(event.target.value)
|
|
2665
2697
|
}
|
|
2666
2698
|
),
|
|
2667
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsx120(FieldGroup.Error, { error })
|
|
2668
2700
|
] });
|
|
2669
2701
|
};
|
|
2670
2702
|
|
|
@@ -2672,7 +2704,7 @@ var StringFieldInput = ({
|
|
|
2672
2704
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
2673
2705
|
import { motion as motion4 } from "framer-motion";
|
|
2674
2706
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
2675
|
-
import { jsx as
|
|
2707
|
+
import { jsx as jsx121, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2676
2708
|
var StringFieldPassword = ({
|
|
2677
2709
|
calculateStrength,
|
|
2678
2710
|
description,
|
|
@@ -2691,13 +2723,13 @@ var StringFieldPassword = ({
|
|
|
2691
2723
|
setStrength(value ? calculateStrength(value) : 0);
|
|
2692
2724
|
}
|
|
2693
2725
|
}, [value]);
|
|
2694
|
-
return /* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ jsxs39(FieldGroup, { name, children: [
|
|
2727
|
+
/* @__PURE__ */ jsxs39(FieldGroup.Row, { children: [
|
|
2728
|
+
/* @__PURE__ */ jsx121(Label3, { htmlFor: name, children: label }),
|
|
2729
|
+
/* @__PURE__ */ jsx121(FieldGroup.Description, { description })
|
|
2698
2730
|
] }),
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsxs39(FieldGroup.Row, { children: [
|
|
2732
|
+
/* @__PURE__ */ jsx121(
|
|
2701
2733
|
Input,
|
|
2702
2734
|
{
|
|
2703
2735
|
disabled: disabled || readOnly,
|
|
@@ -2708,7 +2740,7 @@ var StringFieldPassword = ({
|
|
|
2708
2740
|
onChange: (event) => setValue(event.target.value)
|
|
2709
2741
|
}
|
|
2710
2742
|
),
|
|
2711
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsxs39(
|
|
2712
2744
|
"button",
|
|
2713
2745
|
{
|
|
2714
2746
|
className: "absolute right-0 flex h-full w-8 items-center justify-center text-muted-foreground",
|
|
@@ -2717,20 +2749,20 @@ var StringFieldPassword = ({
|
|
|
2717
2749
|
type: "button",
|
|
2718
2750
|
onClick: () => setShow(!show),
|
|
2719
2751
|
children: [
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2752
|
+
/* @__PURE__ */ jsx121(EyeIcon, { className: cn("absolute transition-all", show ? "-rotate-90 scale-0" : "rotate-0 scale-100") }),
|
|
2753
|
+
/* @__PURE__ */ jsx121(EyeOffIcon, { className: cn("absolute transition-all", !show ? "rotate-90 scale-0" : "rotate-0 scale-100") })
|
|
2722
2754
|
]
|
|
2723
2755
|
}
|
|
2724
2756
|
)
|
|
2725
2757
|
] }),
|
|
2726
|
-
strength !== null && /* @__PURE__ */
|
|
2758
|
+
strength !== null && /* @__PURE__ */ jsx121(
|
|
2727
2759
|
motion4.div,
|
|
2728
2760
|
{
|
|
2729
2761
|
animate: { width: `${Math.max(strength, value?.length ? 1 : 0) * 25}%` },
|
|
2730
2762
|
className: "h-1 w-full overflow-hidden rounded",
|
|
2731
2763
|
initial: { width: "0%" },
|
|
2732
2764
|
transition: { duration: 0.5 },
|
|
2733
|
-
children: /* @__PURE__ */
|
|
2765
|
+
children: /* @__PURE__ */ jsx121(
|
|
2734
2766
|
"div",
|
|
2735
2767
|
{
|
|
2736
2768
|
className: cn(
|
|
@@ -2743,13 +2775,13 @@ var StringFieldPassword = ({
|
|
|
2743
2775
|
)
|
|
2744
2776
|
}
|
|
2745
2777
|
),
|
|
2746
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx121(FieldGroup.Error, { error })
|
|
2747
2779
|
] });
|
|
2748
2780
|
};
|
|
2749
2781
|
|
|
2750
2782
|
// src/components/Form/BaseRadioField.tsx
|
|
2751
2783
|
import { cva as cva4 } from "class-variance-authority";
|
|
2752
|
-
import { jsx as
|
|
2784
|
+
import { jsx as jsx122, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2753
2785
|
var baseRadioFieldVariants = cva4("flex", {
|
|
2754
2786
|
defaultVariants: {
|
|
2755
2787
|
orientation: "vertical"
|
|
@@ -2774,21 +2806,21 @@ var BaseRadioField = ({
|
|
|
2774
2806
|
value
|
|
2775
2807
|
}) => {
|
|
2776
2808
|
const optionsCount = Object.keys(options).length;
|
|
2777
|
-
return /* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2809
|
+
return /* @__PURE__ */ jsxs40(FieldGroup, { name, children: [
|
|
2810
|
+
/* @__PURE__ */ jsxs40(FieldGroup.Row, { children: [
|
|
2811
|
+
/* @__PURE__ */ jsx122(Label3, { children: label }),
|
|
2812
|
+
/* @__PURE__ */ jsx122(FieldGroup.Description, { description })
|
|
2781
2813
|
] }),
|
|
2782
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx122(
|
|
2783
2815
|
RadioGroup4,
|
|
2784
2816
|
{
|
|
2785
2817
|
className: baseRadioFieldVariants({ orientation: optionsCount > 5 ? "vertical" : orientation }),
|
|
2786
2818
|
name,
|
|
2787
2819
|
value: value ?? "",
|
|
2788
2820
|
onValueChange: (value2) => setValue(value2),
|
|
2789
|
-
children: Object.keys(options).map((option) => /* @__PURE__ */
|
|
2790
|
-
/* @__PURE__ */
|
|
2791
|
-
/* @__PURE__ */
|
|
2821
|
+
children: Object.keys(options).map((option) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
2822
|
+
/* @__PURE__ */ jsx122(RadioGroup4.Item, { disabled: disabled || readOnly, id: `${name}-${option}`, value: option }),
|
|
2823
|
+
/* @__PURE__ */ jsx122(
|
|
2792
2824
|
Label3,
|
|
2793
2825
|
{
|
|
2794
2826
|
"aria-disabled": disabled || readOnly,
|
|
@@ -2800,18 +2832,18 @@ var BaseRadioField = ({
|
|
|
2800
2832
|
] }, option))
|
|
2801
2833
|
}
|
|
2802
2834
|
),
|
|
2803
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx122(FieldGroup.Error, { error })
|
|
2804
2836
|
] });
|
|
2805
2837
|
};
|
|
2806
2838
|
|
|
2807
2839
|
// src/components/Form/StringField/StringFieldRadio.tsx
|
|
2808
|
-
import { jsx as
|
|
2840
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
2809
2841
|
var StringFieldRadio = (props) => {
|
|
2810
|
-
return /* @__PURE__ */
|
|
2842
|
+
return /* @__PURE__ */ jsx123(BaseRadioField, { ...props });
|
|
2811
2843
|
};
|
|
2812
2844
|
|
|
2813
2845
|
// src/components/Form/StringField/StringFieldSelect.tsx
|
|
2814
|
-
import { jsx as
|
|
2846
|
+
import { jsx as jsx124, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2815
2847
|
var StringFieldSelect = ({
|
|
2816
2848
|
description,
|
|
2817
2849
|
disabled,
|
|
@@ -2823,24 +2855,24 @@ var StringFieldSelect = ({
|
|
|
2823
2855
|
setValue,
|
|
2824
2856
|
value
|
|
2825
2857
|
}) => {
|
|
2826
|
-
return /* @__PURE__ */
|
|
2827
|
-
/* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ jsxs41(FieldGroup, { name, children: [
|
|
2859
|
+
/* @__PURE__ */ jsxs41(FieldGroup.Row, { children: [
|
|
2860
|
+
/* @__PURE__ */ jsx124(Label3, { children: label }),
|
|
2861
|
+
/* @__PURE__ */ jsx124(FieldGroup.Description, { description })
|
|
2830
2862
|
] }),
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsxs41(Select, { name, value: value ?? "", onValueChange: (value2) => setValue(value2), children: [
|
|
2864
|
+
/* @__PURE__ */ jsx124(Select.Trigger, { "data-testid": `${name}-select-trigger`, disabled: disabled || readOnly, children: /* @__PURE__ */ jsx124(Select.Value, {}) }),
|
|
2865
|
+
/* @__PURE__ */ jsx124(Select.Content, { "data-testid": `${name}-select-content`, children: Object.keys(options).map((option) => /* @__PURE__ */ jsx124(Select.Item, { "data-testid": `${name}-select-item-${option}`, value: option, children: options[option] }, option)) })
|
|
2834
2866
|
] }),
|
|
2835
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsx124(FieldGroup.Error, { error })
|
|
2836
2868
|
] });
|
|
2837
2869
|
};
|
|
2838
2870
|
|
|
2839
2871
|
// src/components/TextArea/TextArea.tsx
|
|
2840
2872
|
import * as React32 from "react";
|
|
2841
|
-
import { jsx as
|
|
2873
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
2842
2874
|
var TextArea = React32.forwardRef(function TextArea2({ className, ...props }, ref) {
|
|
2843
|
-
return /* @__PURE__ */
|
|
2875
|
+
return /* @__PURE__ */ jsx125(
|
|
2844
2876
|
"textarea",
|
|
2845
2877
|
{
|
|
2846
2878
|
autoComplete: "off",
|
|
@@ -2856,7 +2888,7 @@ var TextArea = React32.forwardRef(function TextArea2({ className, ...props }, re
|
|
|
2856
2888
|
});
|
|
2857
2889
|
|
|
2858
2890
|
// src/components/Form/StringField/StringFieldTextArea.tsx
|
|
2859
|
-
import { jsx as
|
|
2891
|
+
import { jsx as jsx126, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2860
2892
|
var StringFieldTextArea = ({
|
|
2861
2893
|
description,
|
|
2862
2894
|
disabled,
|
|
@@ -2868,12 +2900,12 @@ var StringFieldTextArea = ({
|
|
|
2868
2900
|
setValue,
|
|
2869
2901
|
value
|
|
2870
2902
|
}) => {
|
|
2871
|
-
return /* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ jsxs42(FieldGroup, { name, children: [
|
|
2904
|
+
/* @__PURE__ */ jsxs42(FieldGroup.Row, { children: [
|
|
2905
|
+
/* @__PURE__ */ jsx126(Label3, { htmlFor: name, children: label }),
|
|
2906
|
+
/* @__PURE__ */ jsx126(FieldGroup.Description, { description })
|
|
2875
2907
|
] }),
|
|
2876
|
-
/* @__PURE__ */
|
|
2908
|
+
/* @__PURE__ */ jsx126(
|
|
2877
2909
|
TextArea,
|
|
2878
2910
|
{
|
|
2879
2911
|
disabled: disabled || readOnly,
|
|
@@ -2885,37 +2917,37 @@ var StringFieldTextArea = ({
|
|
|
2885
2917
|
onChange: (event) => setValue(event.target.value)
|
|
2886
2918
|
}
|
|
2887
2919
|
),
|
|
2888
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ jsx126(FieldGroup.Error, { error })
|
|
2889
2921
|
] });
|
|
2890
2922
|
};
|
|
2891
2923
|
|
|
2892
2924
|
// src/components/Form/StringField/StringField.tsx
|
|
2893
|
-
import { jsx as
|
|
2925
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
2894
2926
|
var StringField = (props) => {
|
|
2895
|
-
return match6(props).with({ variant: "textarea" }, (props2) => /* @__PURE__ */
|
|
2927
|
+
return match6(props).with({ variant: "textarea" }, (props2) => /* @__PURE__ */ jsx127(StringFieldTextArea, { ...props2 })).with({ variant: "password" }, (props2) => /* @__PURE__ */ jsx127(StringFieldPassword, { ...props2 })).with({ variant: "input" }, (props2) => /* @__PURE__ */ jsx127(StringFieldInput, { ...props2 })).with({ variant: "select" }, (props2) => /* @__PURE__ */ jsx127(StringFieldSelect, { ...props2 })).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx127(StringFieldRadio, { ...props2 })).exhaustive();
|
|
2896
2928
|
};
|
|
2897
2929
|
|
|
2898
2930
|
// src/components/Form/ScalarField.tsx
|
|
2899
|
-
import { jsx as
|
|
2931
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
2900
2932
|
var ScalarField = ({ field, ...props }) => {
|
|
2901
2933
|
switch (field.kind) {
|
|
2902
2934
|
case "string":
|
|
2903
|
-
return /* @__PURE__ */
|
|
2935
|
+
return /* @__PURE__ */ jsx128(StringField, { ...field, ...props });
|
|
2904
2936
|
case "number":
|
|
2905
|
-
return /* @__PURE__ */
|
|
2937
|
+
return /* @__PURE__ */ jsx128(NumberField, { ...field, ...props });
|
|
2906
2938
|
case "date":
|
|
2907
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ jsx128(DateField, { ...field, ...props });
|
|
2908
2940
|
case "boolean":
|
|
2909
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ jsx128(BooleanField, { ...field, ...props });
|
|
2910
2942
|
case "set":
|
|
2911
|
-
return /* @__PURE__ */
|
|
2943
|
+
return /* @__PURE__ */ jsx128(SetField, { ...field, ...props });
|
|
2912
2944
|
default:
|
|
2913
2945
|
throw new Error(`Unexpected value for kind: ${Reflect.get(field, "kind")}`);
|
|
2914
2946
|
}
|
|
2915
2947
|
};
|
|
2916
2948
|
|
|
2917
2949
|
// src/components/Form/RecordArrayField.tsx
|
|
2918
|
-
import { jsx as
|
|
2950
|
+
import { jsx as jsx129, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2919
2951
|
var RecordArrayField = memo(function RecordArrayField2({
|
|
2920
2952
|
disabled,
|
|
2921
2953
|
error: arrayError,
|
|
@@ -2942,17 +2974,17 @@ var RecordArrayField = memo(function RecordArrayField2({
|
|
|
2942
2974
|
setArrayValue(arrayValue.slice(0, arrayValue.length - 1));
|
|
2943
2975
|
}
|
|
2944
2976
|
};
|
|
2945
|
-
return /* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ jsxs43("div", { className: "space-y-4", children: [
|
|
2978
|
+
/* @__PURE__ */ jsx129(Heading, { className: "font-medium", variant: "h5", children: label }),
|
|
2979
|
+
/* @__PURE__ */ jsx129("div", { className: "space-y-6", children: arrayValue.map((fields, i) => /* @__PURE__ */ jsxs43("div", { className: "space-y-4", children: [
|
|
2980
|
+
/* @__PURE__ */ jsx129(Label3, { className: "font-semibold italic", children: label + " " + (i + 1) }),
|
|
2949
2981
|
Object.keys(fields).map((name) => {
|
|
2950
2982
|
const field = fieldset[name];
|
|
2951
2983
|
const fieldProps = field?.kind === "dynamic" ? field.render.call(void 0, fields) : field;
|
|
2952
2984
|
if (!fieldProps) {
|
|
2953
2985
|
return null;
|
|
2954
2986
|
}
|
|
2955
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ jsx129(
|
|
2956
2988
|
ScalarField,
|
|
2957
2989
|
{
|
|
2958
2990
|
error: arrayError?.[i]?.[name],
|
|
@@ -2981,21 +3013,21 @@ var RecordArrayField = memo(function RecordArrayField2({
|
|
|
2981
3013
|
);
|
|
2982
3014
|
})
|
|
2983
3015
|
] }, i)) }),
|
|
2984
|
-
/* @__PURE__ */
|
|
2985
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex gap-3", children: [
|
|
3017
|
+
/* @__PURE__ */ jsxs43(Button, { disabled: disabled || readOnly, type: "button", variant: "outline", onClick: appendField, children: [
|
|
2986
3018
|
t("form.append"),
|
|
2987
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ jsx129(PlusCircleIcon, { className: "ml-2" })
|
|
2988
3020
|
] }),
|
|
2989
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ jsxs43(Button, { disabled: disabled || readOnly, type: "button", variant: "outline", onClick: removeField, children: [
|
|
2990
3022
|
t("form.remove"),
|
|
2991
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsx129(MinusCircleIcon, { className: "ml-2" })
|
|
2992
3024
|
] })
|
|
2993
3025
|
] })
|
|
2994
3026
|
] });
|
|
2995
3027
|
});
|
|
2996
3028
|
|
|
2997
3029
|
// src/components/Form/StaticField.tsx
|
|
2998
|
-
import { jsx as
|
|
3030
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
2999
3031
|
var StaticField = ({
|
|
3000
3032
|
errors,
|
|
3001
3033
|
field,
|
|
@@ -3005,19 +3037,19 @@ var StaticField = ({
|
|
|
3005
3037
|
setValues,
|
|
3006
3038
|
values
|
|
3007
3039
|
}) => {
|
|
3008
|
-
const setError =
|
|
3040
|
+
const setError = useCallback3(
|
|
3009
3041
|
(error) => {
|
|
3010
3042
|
return setErrors((prevErrors) => ({ ...prevErrors, [name]: error }));
|
|
3011
3043
|
},
|
|
3012
3044
|
[setErrors]
|
|
3013
3045
|
);
|
|
3014
|
-
const setValue =
|
|
3046
|
+
const setValue = useCallback3(
|
|
3015
3047
|
(value) => {
|
|
3016
3048
|
return setValues((prevValues) => ({ ...prevValues, [name]: value }));
|
|
3017
3049
|
},
|
|
3018
3050
|
[setValues]
|
|
3019
3051
|
);
|
|
3020
|
-
return match7(field).with({ kind: "record-array" }, (field2) => /* @__PURE__ */
|
|
3052
|
+
return match7(field).with({ kind: "record-array" }, (field2) => /* @__PURE__ */ jsx130(
|
|
3021
3053
|
RecordArrayField,
|
|
3022
3054
|
{
|
|
3023
3055
|
...field2,
|
|
@@ -3028,7 +3060,7 @@ var StaticField = ({
|
|
|
3028
3060
|
setValue,
|
|
3029
3061
|
value: values[name]
|
|
3030
3062
|
}
|
|
3031
|
-
)).with({ kind: "number-record" }, (field2) => /* @__PURE__ */
|
|
3063
|
+
)).with({ kind: "number-record" }, (field2) => /* @__PURE__ */ jsx130(
|
|
3032
3064
|
NumberRecordField,
|
|
3033
3065
|
{
|
|
3034
3066
|
...field2,
|
|
@@ -3039,7 +3071,7 @@ var StaticField = ({
|
|
|
3039
3071
|
setValue,
|
|
3040
3072
|
value: values[name]
|
|
3041
3073
|
}
|
|
3042
|
-
)).otherwise((field2) => /* @__PURE__ */
|
|
3074
|
+
)).otherwise((field2) => /* @__PURE__ */ jsx130(
|
|
3043
3075
|
ScalarField,
|
|
3044
3076
|
{
|
|
3045
3077
|
error: errors[name],
|
|
@@ -3054,7 +3086,7 @@ var StaticField = ({
|
|
|
3054
3086
|
};
|
|
3055
3087
|
|
|
3056
3088
|
// src/components/Form/DynamicField.tsx
|
|
3057
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
3058
3090
|
var DynamicField = ({
|
|
3059
3091
|
field,
|
|
3060
3092
|
name,
|
|
@@ -3083,7 +3115,7 @@ var DynamicField = ({
|
|
|
3083
3115
|
if (!staticField) {
|
|
3084
3116
|
return null;
|
|
3085
3117
|
}
|
|
3086
|
-
return /* @__PURE__ */
|
|
3118
|
+
return /* @__PURE__ */ jsx131(StaticField, { ...props, field: staticField, name, readOnly, setValues, values });
|
|
3087
3119
|
};
|
|
3088
3120
|
|
|
3089
3121
|
// src/components/Form/FieldsComponent.tsx
|
|
@@ -3115,7 +3147,7 @@ function getInitialValues(values) {
|
|
|
3115
3147
|
}
|
|
3116
3148
|
|
|
3117
3149
|
// src/components/Form/Form.tsx
|
|
3118
|
-
import { jsx as
|
|
3150
|
+
import { jsx as jsx132, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3119
3151
|
var Form = ({
|
|
3120
3152
|
className,
|
|
3121
3153
|
content,
|
|
@@ -3189,7 +3221,7 @@ var Form = ({
|
|
|
3189
3221
|
useEffect9(() => {
|
|
3190
3222
|
revalidate();
|
|
3191
3223
|
}, [resolvedLanguage]);
|
|
3192
|
-
return /* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsxs44(
|
|
3193
3225
|
"form",
|
|
3194
3226
|
{
|
|
3195
3227
|
autoComplete: "off",
|
|
@@ -3200,12 +3232,12 @@ var Form = ({
|
|
|
3200
3232
|
...props,
|
|
3201
3233
|
children: [
|
|
3202
3234
|
isGrouped ? content.map((fieldGroup, i) => {
|
|
3203
|
-
return /* @__PURE__ */
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
fieldGroup.title && /* @__PURE__ */
|
|
3206
|
-
fieldGroup.description && /* @__PURE__ */
|
|
3235
|
+
return /* @__PURE__ */ jsxs44("div", { className: "flex flex-col space-y-6 [&:not(:first-child)]:pt-8", children: [
|
|
3236
|
+
/* @__PURE__ */ jsxs44("div", { className: "space-y-1", children: [
|
|
3237
|
+
fieldGroup.title && /* @__PURE__ */ jsx132(Heading, { className: "text-base", variant: "h4", children: fieldGroup.title }),
|
|
3238
|
+
fieldGroup.description && /* @__PURE__ */ jsx132("p", { className: "text-sm italic leading-tight text-muted-foreground", children: fieldGroup.description })
|
|
3207
3239
|
] }),
|
|
3208
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx132(
|
|
3209
3241
|
FieldsComponent,
|
|
3210
3242
|
{
|
|
3211
3243
|
errors,
|
|
@@ -3217,7 +3249,7 @@ var Form = ({
|
|
|
3217
3249
|
}
|
|
3218
3250
|
)
|
|
3219
3251
|
] }, i);
|
|
3220
|
-
}) : /* @__PURE__ */
|
|
3252
|
+
}) : /* @__PURE__ */ jsx132(
|
|
3221
3253
|
FieldsComponent,
|
|
3222
3254
|
{
|
|
3223
3255
|
errors,
|
|
@@ -3229,9 +3261,9 @@ var Form = ({
|
|
|
3229
3261
|
}
|
|
3230
3262
|
),
|
|
3231
3263
|
fieldsFooter,
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
resetBtn && /* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex w-full gap-3", children: [
|
|
3265
|
+
/* @__PURE__ */ jsx132(Button, { "aria-label": "Submit", className: "block w-full", disabled: readOnly, type: "submit", variant: "primary", children: submitBtnLabel ?? t("form.submit") }),
|
|
3266
|
+
resetBtn && /* @__PURE__ */ jsx132(
|
|
3235
3267
|
Button,
|
|
3236
3268
|
{
|
|
3237
3269
|
"aria-label": "Reset",
|
|
@@ -3244,7 +3276,7 @@ var Form = ({
|
|
|
3244
3276
|
}
|
|
3245
3277
|
)
|
|
3246
3278
|
] }),
|
|
3247
|
-
Boolean(rootErrors.length) && /* @__PURE__ */
|
|
3279
|
+
Boolean(rootErrors.length) && /* @__PURE__ */ jsx132(ErrorMessage, { error: rootErrors })
|
|
3248
3280
|
]
|
|
3249
3281
|
}
|
|
3250
3282
|
);
|
|
@@ -3256,9 +3288,9 @@ import { Root as Root14, Trigger as Trigger8 } from "@radix-ui/react-hover-card"
|
|
|
3256
3288
|
// src/components/HoverCard/HoverCardContent.tsx
|
|
3257
3289
|
import { forwardRef as forwardRef81 } from "react";
|
|
3258
3290
|
import { Content as Content9 } from "@radix-ui/react-hover-card";
|
|
3259
|
-
import { jsx as
|
|
3291
|
+
import { jsx as jsx133 } from "react/jsx-runtime";
|
|
3260
3292
|
var HoverCardContent = forwardRef81(function HoverCardContent2({ align = "center", className, sideOffset = 4, ...props }, ref) {
|
|
3261
|
-
return /* @__PURE__ */
|
|
3293
|
+
return /* @__PURE__ */ jsx133(
|
|
3262
3294
|
Content9,
|
|
3263
3295
|
{
|
|
3264
3296
|
align,
|
|
@@ -3281,7 +3313,7 @@ var HoverCard = Object.assign(Root14.bind(null), {
|
|
|
3281
3313
|
|
|
3282
3314
|
// src/components/LanguageToggle/LanguageToggle.tsx
|
|
3283
3315
|
import { LanguagesIcon } from "lucide-react";
|
|
3284
|
-
import { jsx as
|
|
3316
|
+
import { jsx as jsx134, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3285
3317
|
var LanguageToggle = ({
|
|
3286
3318
|
align = "start",
|
|
3287
3319
|
contentClassName,
|
|
@@ -3291,9 +3323,9 @@ var LanguageToggle = ({
|
|
|
3291
3323
|
variant = "outline"
|
|
3292
3324
|
}) => {
|
|
3293
3325
|
const { changeLanguage } = useTranslation("libui");
|
|
3294
|
-
return /* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ jsxs45(DropdownMenu, { children: [
|
|
3327
|
+
/* @__PURE__ */ jsx134(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx134(Button, { className: triggerClassName, size: "icon", variant, children: /* @__PURE__ */ jsx134(LanguagesIcon, {}) }) }),
|
|
3328
|
+
/* @__PURE__ */ jsx134(DropdownMenu.Content, { align, className: contentClassName, children: Object.keys(options).map((option) => /* @__PURE__ */ jsx134(
|
|
3297
3329
|
DropdownMenu.Item,
|
|
3298
3330
|
{
|
|
3299
3331
|
className: itemClassName,
|
|
@@ -3320,7 +3352,7 @@ import {
|
|
|
3320
3352
|
XAxis,
|
|
3321
3353
|
YAxis
|
|
3322
3354
|
} from "recharts";
|
|
3323
|
-
import { jsx as
|
|
3355
|
+
import { jsx as jsx135, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3324
3356
|
import { createElement as createElement2 } from "react";
|
|
3325
3357
|
var strokeColors = {
|
|
3326
3358
|
dark: "#cbd5e1",
|
|
@@ -3349,9 +3381,9 @@ function LineGraphComponent({
|
|
|
3349
3381
|
}) {
|
|
3350
3382
|
const { resolvedLanguage } = useTranslation("libui");
|
|
3351
3383
|
const [theme] = useTheme();
|
|
3352
|
-
return /* @__PURE__ */
|
|
3353
|
-
/* @__PURE__ */
|
|
3354
|
-
/* @__PURE__ */
|
|
3384
|
+
return /* @__PURE__ */ jsx135(ResponsiveContainer, { height: 400, width: "100%", children: /* @__PURE__ */ jsxs46(LineChart, { data: [...data], margin: { bottom: 5, left: 15, right: 15, top: 5 }, children: [
|
|
3385
|
+
/* @__PURE__ */ jsx135(CartesianGrid, { stroke: "#64748b", strokeDasharray: "5 5" }),
|
|
3386
|
+
/* @__PURE__ */ jsx135(
|
|
3355
3387
|
XAxis,
|
|
3356
3388
|
{
|
|
3357
3389
|
axisLine: { stroke: "#64748b" },
|
|
@@ -3366,10 +3398,10 @@ function LineGraphComponent({
|
|
|
3366
3398
|
tickMargin: 8,
|
|
3367
3399
|
tickSize: 8,
|
|
3368
3400
|
type: "number",
|
|
3369
|
-
children: /* @__PURE__ */
|
|
3401
|
+
children: /* @__PURE__ */ jsx135(Label6, { fill: strokeColors[theme], offset: 0, position: "insideBottom", value: xAxis?.label })
|
|
3370
3402
|
}
|
|
3371
3403
|
),
|
|
3372
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsx135(
|
|
3373
3405
|
YAxis,
|
|
3374
3406
|
{
|
|
3375
3407
|
axisLine: { stroke: "#64748b" },
|
|
@@ -3380,7 +3412,7 @@ function LineGraphComponent({
|
|
|
3380
3412
|
width: 40
|
|
3381
3413
|
}
|
|
3382
3414
|
),
|
|
3383
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ jsx135(
|
|
3384
3416
|
Tooltip,
|
|
3385
3417
|
{
|
|
3386
3418
|
contentStyle: tooltipStyles[theme],
|
|
@@ -3404,16 +3436,16 @@ function LineGraphComponent({
|
|
|
3404
3436
|
stroke: stroke ?? strokeColors[theme],
|
|
3405
3437
|
type: type ?? "linear"
|
|
3406
3438
|
},
|
|
3407
|
-
err && /* @__PURE__ */
|
|
3439
|
+
err && /* @__PURE__ */ jsx135(ErrorBar, { dataKey: err, stroke: "#64748b" })
|
|
3408
3440
|
)),
|
|
3409
|
-
/* @__PURE__ */
|
|
3441
|
+
/* @__PURE__ */ jsx135(Legend, { wrapperStyle: { paddingLeft: 40, paddingTop: 10 } })
|
|
3410
3442
|
] }) });
|
|
3411
3443
|
}
|
|
3412
3444
|
var LineGraph = React37.memo(LineGraphComponent);
|
|
3413
3445
|
|
|
3414
3446
|
// src/components/ListboxDropdown/ListboxDropdown.tsx
|
|
3415
3447
|
import "react";
|
|
3416
|
-
import { jsx as
|
|
3448
|
+
import { jsx as jsx136, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
3417
3449
|
var ListboxDropdown = ({
|
|
3418
3450
|
contentClassName,
|
|
3419
3451
|
disabled,
|
|
@@ -3424,11 +3456,11 @@ var ListboxDropdown = ({
|
|
|
3424
3456
|
triggerClassName,
|
|
3425
3457
|
widthFull
|
|
3426
3458
|
}) => {
|
|
3427
|
-
return /* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ jsxs47(DropdownMenu, { children: [
|
|
3460
|
+
/* @__PURE__ */ jsx136(DropdownMenu.Trigger, { asChild: true, className: cn("w-full", triggerClassName), disabled, children: /* @__PURE__ */ jsx136(DropdownButton, { children: title }) }),
|
|
3461
|
+
/* @__PURE__ */ jsx136(DropdownMenu.Content, { align: "start", className: contentClassName, widthFull, children: options.map((option) => {
|
|
3430
3462
|
const checked = Boolean(selected.find((selectedOption) => selectedOption.key === option.key));
|
|
3431
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsx136(
|
|
3432
3464
|
DropdownMenu.CheckboxItem,
|
|
3433
3465
|
{
|
|
3434
3466
|
checked,
|
|
@@ -3459,9 +3491,9 @@ import { Group as Group4, Menu, Portal as Portal10, RadioGroup as RadioGroup5, S
|
|
|
3459
3491
|
import { forwardRef as forwardRef82 } from "react";
|
|
3460
3492
|
import { CheckboxItem as CheckboxItem3, ItemIndicator as ItemIndicator6 } from "@radix-ui/react-menubar";
|
|
3461
3493
|
import { CheckIcon as CheckIcon5 } from "lucide-react";
|
|
3462
|
-
import { jsx as
|
|
3494
|
+
import { jsx as jsx137, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
3463
3495
|
var MenuBarCheckboxItem = forwardRef82(function MenuBarCheckboxItem2({ checked, children, className, ...props }, ref) {
|
|
3464
|
-
return /* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ jsxs48(
|
|
3465
3497
|
CheckboxItem3,
|
|
3466
3498
|
{
|
|
3467
3499
|
checked,
|
|
@@ -3472,7 +3504,7 @@ var MenuBarCheckboxItem = forwardRef82(function MenuBarCheckboxItem2({ checked,
|
|
|
3472
3504
|
ref,
|
|
3473
3505
|
...props,
|
|
3474
3506
|
children: [
|
|
3475
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsx137("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx137(ItemIndicator6, { children: /* @__PURE__ */ jsx137(CheckIcon5, { className: "h-4 w-4" }) }) }),
|
|
3476
3508
|
children
|
|
3477
3509
|
]
|
|
3478
3510
|
}
|
|
@@ -3482,9 +3514,9 @@ var MenuBarCheckboxItem = forwardRef82(function MenuBarCheckboxItem2({ checked,
|
|
|
3482
3514
|
// src/components/MenuBar/MenuBarContent.tsx
|
|
3483
3515
|
import { forwardRef as forwardRef83 } from "react";
|
|
3484
3516
|
import { Content as Content10, Portal as Portal9 } from "@radix-ui/react-menubar";
|
|
3485
|
-
import { jsx as
|
|
3517
|
+
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
3486
3518
|
var MenuBarContent = forwardRef83(function MenuBarContent2({ align = "start", alignOffset = -4, className, sideOffset = 8, ...props }, ref) {
|
|
3487
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsx138(Portal9, { children: /* @__PURE__ */ jsx138(
|
|
3488
3520
|
Content10,
|
|
3489
3521
|
{
|
|
3490
3522
|
align,
|
|
@@ -3503,9 +3535,9 @@ var MenuBarContent = forwardRef83(function MenuBarContent2({ align = "start", al
|
|
|
3503
3535
|
// src/components/MenuBar/MenuBarItem.tsx
|
|
3504
3536
|
import { forwardRef as forwardRef84 } from "react";
|
|
3505
3537
|
import { Item as Item6 } from "@radix-ui/react-menubar";
|
|
3506
|
-
import { jsx as
|
|
3538
|
+
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
3507
3539
|
var MenuBarItem = forwardRef84(function MenuBarItem2({ className, inset, ...props }, ref) {
|
|
3508
|
-
return /* @__PURE__ */
|
|
3540
|
+
return /* @__PURE__ */ jsx139(
|
|
3509
3541
|
Item6,
|
|
3510
3542
|
{
|
|
3511
3543
|
className: cn(
|
|
@@ -3522,18 +3554,18 @@ var MenuBarItem = forwardRef84(function MenuBarItem2({ className, inset, ...prop
|
|
|
3522
3554
|
// src/components/MenuBar/MenuBarLabel.tsx
|
|
3523
3555
|
import { forwardRef as forwardRef85 } from "react";
|
|
3524
3556
|
import { Label as Label7 } from "@radix-ui/react-menubar";
|
|
3525
|
-
import { jsx as
|
|
3557
|
+
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
3526
3558
|
var MenuBarLabel = forwardRef85(function MenuBarLabel2({ className, inset, ...props }, ref) {
|
|
3527
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx140(Label7, { className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ref, ...props });
|
|
3528
3560
|
});
|
|
3529
3561
|
|
|
3530
3562
|
// src/components/MenuBar/MenuBarRadioItem.tsx
|
|
3531
3563
|
import { forwardRef as forwardRef86 } from "react";
|
|
3532
3564
|
import { ItemIndicator as ItemIndicator7, RadioItem as RadioItem3 } from "@radix-ui/react-menubar";
|
|
3533
3565
|
import { CircleIcon as CircleIcon4 } from "lucide-react";
|
|
3534
|
-
import { jsx as
|
|
3566
|
+
import { jsx as jsx141, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
3535
3567
|
var MenuBarRadioItem = forwardRef86(function MenuBarRadioItem2({ children, className, ...props }, ref) {
|
|
3536
|
-
return /* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsxs49(
|
|
3537
3569
|
RadioItem3,
|
|
3538
3570
|
{
|
|
3539
3571
|
className: cn(
|
|
@@ -3543,7 +3575,7 @@ var MenuBarRadioItem = forwardRef86(function MenuBarRadioItem2({ children, class
|
|
|
3543
3575
|
ref,
|
|
3544
3576
|
...props,
|
|
3545
3577
|
children: [
|
|
3546
|
-
/* @__PURE__ */
|
|
3578
|
+
/* @__PURE__ */ jsx141("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx141(ItemIndicator7, { children: /* @__PURE__ */ jsx141(CircleIcon4, { className: "fill-current", style: { height: 8, width: 8 } }) }) }),
|
|
3547
3579
|
children
|
|
3548
3580
|
]
|
|
3549
3581
|
}
|
|
@@ -3553,10 +3585,10 @@ var MenuBarRadioItem = forwardRef86(function MenuBarRadioItem2({ children, class
|
|
|
3553
3585
|
// src/components/MenuBar/MenuBarRoot.tsx
|
|
3554
3586
|
import { forwardRef as forwardRef87 } from "react";
|
|
3555
3587
|
import { Root as Root15 } from "@radix-ui/react-menubar";
|
|
3556
|
-
import { jsx as
|
|
3588
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
3557
3589
|
var MenuBarRoot = forwardRef87(
|
|
3558
3590
|
function MenuBarRoot2({ className, ...props }, ref) {
|
|
3559
|
-
return /* @__PURE__ */
|
|
3591
|
+
return /* @__PURE__ */ jsx142(
|
|
3560
3592
|
Root15,
|
|
3561
3593
|
{
|
|
3562
3594
|
className: cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", className),
|
|
@@ -3570,24 +3602,24 @@ var MenuBarRoot = forwardRef87(
|
|
|
3570
3602
|
// src/components/MenuBar/MenuBarSeparator.tsx
|
|
3571
3603
|
import { forwardRef as forwardRef88 } from "react";
|
|
3572
3604
|
import { Separator as Separator4 } from "@radix-ui/react-menubar";
|
|
3573
|
-
import { jsx as
|
|
3605
|
+
import { jsx as jsx143 } from "react/jsx-runtime";
|
|
3574
3606
|
var MenuBarSeparator = forwardRef88(function MenuBarSeparator2({ className, ...props }, ref) {
|
|
3575
|
-
return /* @__PURE__ */
|
|
3607
|
+
return /* @__PURE__ */ jsx143(Separator4, { className: cn("-mx-1 my-1 h-px bg-muted", className), ref, ...props });
|
|
3576
3608
|
});
|
|
3577
3609
|
|
|
3578
3610
|
// src/components/MenuBar/MenuBarShortcut.tsx
|
|
3579
3611
|
import "react";
|
|
3580
|
-
import { jsx as
|
|
3612
|
+
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
3581
3613
|
var MenuBarShortcut = ({ className, ...props }) => {
|
|
3582
|
-
return /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsx144("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props });
|
|
3583
3615
|
};
|
|
3584
3616
|
|
|
3585
3617
|
// src/components/MenuBar/MenuBarSubContent.tsx
|
|
3586
3618
|
import { forwardRef as forwardRef89 } from "react";
|
|
3587
3619
|
import { SubContent as SubContent3 } from "@radix-ui/react-menubar";
|
|
3588
|
-
import { jsx as
|
|
3620
|
+
import { jsx as jsx145 } from "react/jsx-runtime";
|
|
3589
3621
|
var MenuBarSubContent = forwardRef89(function MenuBarSubContent2({ className, ...props }, ref) {
|
|
3590
|
-
return /* @__PURE__ */
|
|
3622
|
+
return /* @__PURE__ */ jsx145(
|
|
3591
3623
|
SubContent3,
|
|
3592
3624
|
{
|
|
3593
3625
|
className: cn(
|
|
@@ -3604,9 +3636,9 @@ var MenuBarSubContent = forwardRef89(function MenuBarSubContent2({ className, ..
|
|
|
3604
3636
|
import { forwardRef as forwardRef90 } from "react";
|
|
3605
3637
|
import { SubTrigger as SubTrigger3 } from "@radix-ui/react-menubar";
|
|
3606
3638
|
import { ChevronRightIcon as ChevronRightIcon4 } from "lucide-react";
|
|
3607
|
-
import { jsx as
|
|
3639
|
+
import { jsx as jsx146, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
3608
3640
|
var MenuBarSubTrigger = forwardRef90(function MenuBarSubTrigger2({ children, className, inset, ...props }, ref) {
|
|
3609
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ jsxs50(
|
|
3610
3642
|
SubTrigger3,
|
|
3611
3643
|
{
|
|
3612
3644
|
className: cn(
|
|
@@ -3618,7 +3650,7 @@ var MenuBarSubTrigger = forwardRef90(function MenuBarSubTrigger2({ children, cla
|
|
|
3618
3650
|
...props,
|
|
3619
3651
|
children: [
|
|
3620
3652
|
children,
|
|
3621
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ jsx146(ChevronRightIcon4, { className: "ml-auto h-4 w-4" })
|
|
3622
3654
|
]
|
|
3623
3655
|
}
|
|
3624
3656
|
);
|
|
@@ -3627,9 +3659,9 @@ var MenuBarSubTrigger = forwardRef90(function MenuBarSubTrigger2({ children, cla
|
|
|
3627
3659
|
// src/components/MenuBar/MenuBarTrigger.tsx
|
|
3628
3660
|
import { forwardRef as forwardRef91 } from "react";
|
|
3629
3661
|
import { Trigger as Trigger9 } from "@radix-ui/react-menubar";
|
|
3630
|
-
import { jsx as
|
|
3662
|
+
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
3631
3663
|
var MenuBarTrigger = forwardRef91(function MenuBarTrigger2({ className, ...props }, ref) {
|
|
3632
|
-
return /* @__PURE__ */
|
|
3664
|
+
return /* @__PURE__ */ jsx147(
|
|
3633
3665
|
Trigger9,
|
|
3634
3666
|
{
|
|
3635
3667
|
className: cn(
|
|
@@ -3667,26 +3699,26 @@ import { XIcon as XIcon2 } from "lucide-react";
|
|
|
3667
3699
|
|
|
3668
3700
|
// src/components/NotificationHub/NotificationIcon.tsx
|
|
3669
3701
|
import { CheckCircleIcon, ExclamationCircleIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/24/solid";
|
|
3670
|
-
import { jsx as
|
|
3702
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
3671
3703
|
var NotificationIcon = ({ type }) => {
|
|
3672
3704
|
switch (type) {
|
|
3673
3705
|
case "error":
|
|
3674
|
-
return /* @__PURE__ */
|
|
3706
|
+
return /* @__PURE__ */ jsx148(XCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-red-500" });
|
|
3675
3707
|
case "info":
|
|
3676
|
-
return /* @__PURE__ */
|
|
3708
|
+
return /* @__PURE__ */ jsx148(InformationCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-blue-500" });
|
|
3677
3709
|
case "success":
|
|
3678
|
-
return /* @__PURE__ */
|
|
3710
|
+
return /* @__PURE__ */ jsx148(CheckCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-green-500" });
|
|
3679
3711
|
case "warning":
|
|
3680
|
-
return /* @__PURE__ */
|
|
3712
|
+
return /* @__PURE__ */ jsx148(ExclamationCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-yellow-500" });
|
|
3681
3713
|
}
|
|
3682
3714
|
};
|
|
3683
3715
|
|
|
3684
3716
|
// src/components/NotificationHub/NotificationHub.tsx
|
|
3685
|
-
import { jsx as
|
|
3717
|
+
import { jsx as jsx149, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
3686
3718
|
var NotificationHub = ({ timeout = 5e3 }) => {
|
|
3687
3719
|
const { t } = useTranslation("libui");
|
|
3688
3720
|
const { dismissNotification, notifications } = useNotificationsStore();
|
|
3689
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsx149("div", { className: "fixed bottom-0 z-50 w-full print:hidden", children: /* @__PURE__ */ jsx149(AnimatePresence4, { children: notifications.map((item) => /* @__PURE__ */ jsx149(
|
|
3690
3722
|
motion5.div,
|
|
3691
3723
|
{
|
|
3692
3724
|
animate: { height: "auto", opacity: 1 },
|
|
@@ -3694,12 +3726,12 @@ var NotificationHub = ({ timeout = 5e3 }) => {
|
|
|
3694
3726
|
exit: { height: 0, opacity: 0 },
|
|
3695
3727
|
initial: { height: 0, opacity: 0 },
|
|
3696
3728
|
transition: { bounce: 0.1, type: "spring" },
|
|
3697
|
-
children: /* @__PURE__ */
|
|
3698
|
-
/* @__PURE__ */
|
|
3699
|
-
/* @__PURE__ */
|
|
3700
|
-
/* @__PURE__ */
|
|
3701
|
-
/* @__PURE__ */
|
|
3702
|
-
/* @__PURE__ */
|
|
3729
|
+
children: /* @__PURE__ */ jsx149("div", { className: "w-full p-2", children: /* @__PURE__ */ jsxs51(Card, { className: "w-full rounded-lg p-0", children: [
|
|
3730
|
+
/* @__PURE__ */ jsxs51("div", { className: "p-4", children: [
|
|
3731
|
+
/* @__PURE__ */ jsxs51("div", { className: "mb-2 flex items-center", children: [
|
|
3732
|
+
/* @__PURE__ */ jsx149(NotificationIcon, { type: item.type }),
|
|
3733
|
+
/* @__PURE__ */ jsx149("h5", { className: "ml-3 flex-grow font-medium text-slate-900 dark:text-slate-100", children: item.title ?? t(`notifications.types.${item.type}`) }),
|
|
3734
|
+
/* @__PURE__ */ jsx149(
|
|
3703
3735
|
"button",
|
|
3704
3736
|
{
|
|
3705
3737
|
className: "inline-flex rounded-md text-slate-400 hover:text-slate-500 focus:outline-none focus:ring-1 focus:ring-sky-500 dark:focus:ring-sky-600",
|
|
@@ -3707,13 +3739,13 @@ var NotificationHub = ({ timeout = 5e3 }) => {
|
|
|
3707
3739
|
onClick: () => {
|
|
3708
3740
|
dismissNotification(item.id);
|
|
3709
3741
|
},
|
|
3710
|
-
children: /* @__PURE__ */
|
|
3742
|
+
children: /* @__PURE__ */ jsx149(XIcon2, { "aria-hidden": "true", className: "h-5 w-5" })
|
|
3711
3743
|
}
|
|
3712
3744
|
)
|
|
3713
3745
|
] }),
|
|
3714
|
-
/* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ jsx149("p", { className: "my-2 text-muted-foreground", children: item.message })
|
|
3715
3747
|
] }),
|
|
3716
|
-
/* @__PURE__ */
|
|
3748
|
+
/* @__PURE__ */ jsx149(
|
|
3717
3749
|
motion5.div,
|
|
3718
3750
|
{
|
|
3719
3751
|
animate: { width: "100%" },
|
|
@@ -3733,27 +3765,27 @@ var NotificationHub = ({ timeout = 5e3 }) => {
|
|
|
3733
3765
|
|
|
3734
3766
|
// src/components/Pagination/PaginationContent.tsx
|
|
3735
3767
|
import "react";
|
|
3736
|
-
import { jsx as
|
|
3737
|
-
var PaginationContent = ({ className, ...props }) => /* @__PURE__ */
|
|
3768
|
+
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
3769
|
+
var PaginationContent = ({ className, ...props }) => /* @__PURE__ */ jsx150("ul", { className: cn("flex flex-row items-center gap-1", className), ...props });
|
|
3738
3770
|
|
|
3739
3771
|
// src/components/Pagination/PaginationEllipsis.tsx
|
|
3740
3772
|
import "react";
|
|
3741
3773
|
import { MoreHorizontalIcon as MoreHorizontalIcon2 } from "lucide-react";
|
|
3742
|
-
import { jsx as
|
|
3743
|
-
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */
|
|
3744
|
-
/* @__PURE__ */
|
|
3745
|
-
/* @__PURE__ */
|
|
3774
|
+
import { jsx as jsx151, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
3775
|
+
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs52("span", { "aria-hidden": true, className: cn("flex h-9 w-9 items-center justify-center", className), ...props, children: [
|
|
3776
|
+
/* @__PURE__ */ jsx151(MoreHorizontalIcon2, { className: "h-4 w-4" }),
|
|
3777
|
+
/* @__PURE__ */ jsx151("span", { className: "sr-only", children: "More pages" })
|
|
3746
3778
|
] });
|
|
3747
3779
|
|
|
3748
3780
|
// src/components/Pagination/PaginationItem.tsx
|
|
3749
3781
|
import "react";
|
|
3750
|
-
import { jsx as
|
|
3751
|
-
var PaginationItem = ({ className, ...props }) => /* @__PURE__ */
|
|
3782
|
+
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
3783
|
+
var PaginationItem = ({ className, ...props }) => /* @__PURE__ */ jsx152("li", { className, ...props });
|
|
3752
3784
|
|
|
3753
3785
|
// src/components/Pagination/PaginationLink.tsx
|
|
3754
3786
|
import "react";
|
|
3755
|
-
import { jsx as
|
|
3756
|
-
var PaginationLink = ({ children, className, isActive, size = "icon", ...props }) => /* @__PURE__ */
|
|
3787
|
+
import { jsx as jsx153 } from "react/jsx-runtime";
|
|
3788
|
+
var PaginationLink = ({ children, className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx153(
|
|
3757
3789
|
"a",
|
|
3758
3790
|
{
|
|
3759
3791
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3772,30 +3804,30 @@ var PaginationLink = ({ children, className, isActive, size = "icon", ...props }
|
|
|
3772
3804
|
// src/components/Pagination/PaginationNext.tsx
|
|
3773
3805
|
import "react";
|
|
3774
3806
|
import { ChevronRightIcon as ChevronRightIcon5 } from "lucide-react";
|
|
3775
|
-
import { jsx as
|
|
3807
|
+
import { jsx as jsx154, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
3776
3808
|
var PaginationNext = ({ className, ...props }) => {
|
|
3777
3809
|
const { t } = useTranslation("libui");
|
|
3778
|
-
return /* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
3780
|
-
/* @__PURE__ */
|
|
3810
|
+
return /* @__PURE__ */ jsxs53(PaginationLink, { "aria-label": "Go to next page", className: cn("gap-1 pr-2.5", className), size: "md", ...props, children: [
|
|
3811
|
+
/* @__PURE__ */ jsx154("span", { children: t("pagination.next") }),
|
|
3812
|
+
/* @__PURE__ */ jsx154(ChevronRightIcon5, { className: "h-4 w-4" })
|
|
3781
3813
|
] });
|
|
3782
3814
|
};
|
|
3783
3815
|
|
|
3784
3816
|
// src/components/Pagination/PaginationPrevious.tsx
|
|
3785
3817
|
import { ChevronLeftIcon } from "lucide-react";
|
|
3786
|
-
import { jsx as
|
|
3818
|
+
import { jsx as jsx155, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
3787
3819
|
var PaginationPrevious = ({ className, ...props }) => {
|
|
3788
3820
|
const { t } = useTranslation("libui");
|
|
3789
|
-
return /* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsxs54(PaginationLink, { "aria-label": "Go to previous page", className: cn("gap-1 pl-2.5", className), size: "md", ...props, children: [
|
|
3822
|
+
/* @__PURE__ */ jsx155(ChevronLeftIcon, { className: "h-4 w-4" }),
|
|
3823
|
+
/* @__PURE__ */ jsx155("span", { children: t("pagination.previous") })
|
|
3792
3824
|
] });
|
|
3793
3825
|
};
|
|
3794
3826
|
|
|
3795
3827
|
// src/components/Pagination/PaginationRoot.tsx
|
|
3796
3828
|
import "react";
|
|
3797
|
-
import { jsx as
|
|
3798
|
-
var PaginationRoot = ({ className, ...props }) => /* @__PURE__ */
|
|
3829
|
+
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
3830
|
+
var PaginationRoot = ({ className, ...props }) => /* @__PURE__ */ jsx156(
|
|
3799
3831
|
"nav",
|
|
3800
3832
|
{
|
|
3801
3833
|
"aria-label": "pagination",
|
|
@@ -3818,15 +3850,15 @@ var Pagination = Object.assign(PaginationRoot, {
|
|
|
3818
3850
|
// src/components/Progress/Progress.tsx
|
|
3819
3851
|
import { forwardRef as forwardRef92 } from "react";
|
|
3820
3852
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3821
|
-
import { jsx as
|
|
3853
|
+
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
3822
3854
|
var Progress = forwardRef92(function Progress2({ className, value, ...props }, ref) {
|
|
3823
|
-
return /* @__PURE__ */
|
|
3855
|
+
return /* @__PURE__ */ jsx157(
|
|
3824
3856
|
ProgressPrimitive.Root,
|
|
3825
3857
|
{
|
|
3826
3858
|
className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
|
|
3827
3859
|
ref,
|
|
3828
3860
|
...props,
|
|
3829
|
-
children: /* @__PURE__ */
|
|
3861
|
+
children: /* @__PURE__ */ jsx157(
|
|
3830
3862
|
ProgressPrimitive.Indicator,
|
|
3831
3863
|
{
|
|
3832
3864
|
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
@@ -3845,8 +3877,8 @@ import { Panel } from "react-resizable-panels";
|
|
|
3845
3877
|
import "react";
|
|
3846
3878
|
import { GripVertical } from "lucide-react";
|
|
3847
3879
|
import { PanelResizeHandle } from "react-resizable-panels";
|
|
3848
|
-
import { jsx as
|
|
3849
|
-
var ResizableHandle = ({ className, withHandle, ...props }) => /* @__PURE__ */
|
|
3880
|
+
import { jsx as jsx158 } from "react/jsx-runtime";
|
|
3881
|
+
var ResizableHandle = ({ className, withHandle, ...props }) => /* @__PURE__ */ jsx158(
|
|
3850
3882
|
PanelResizeHandle,
|
|
3851
3883
|
{
|
|
3852
3884
|
className: cn(
|
|
@@ -3854,15 +3886,15 @@ var ResizableHandle = ({ className, withHandle, ...props }) => /* @__PURE__ */ j
|
|
|
3854
3886
|
className
|
|
3855
3887
|
),
|
|
3856
3888
|
...props,
|
|
3857
|
-
children: withHandle && /* @__PURE__ */
|
|
3889
|
+
children: withHandle && /* @__PURE__ */ jsx158("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ jsx158(GripVertical, { className: "h-2.5 w-2.5" }) })
|
|
3858
3890
|
}
|
|
3859
3891
|
);
|
|
3860
3892
|
|
|
3861
3893
|
// src/components/Resizable/ResizablePanelGroup.tsx
|
|
3862
3894
|
import "react";
|
|
3863
3895
|
import { PanelGroup } from "react-resizable-panels";
|
|
3864
|
-
import { jsx as
|
|
3865
|
-
var ResizablePanelGroup = ({ className, ...props }) => /* @__PURE__ */
|
|
3896
|
+
import { jsx as jsx159 } from "react/jsx-runtime";
|
|
3897
|
+
var ResizablePanelGroup = ({ className, ...props }) => /* @__PURE__ */ jsx159(
|
|
3866
3898
|
PanelGroup,
|
|
3867
3899
|
{
|
|
3868
3900
|
className: cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className),
|
|
@@ -3871,8 +3903,8 @@ var ResizablePanelGroup = ({ className, ...props }) => /* @__PURE__ */ jsx158(
|
|
|
3871
3903
|
);
|
|
3872
3904
|
|
|
3873
3905
|
// src/components/Resizable/Resizable.tsx
|
|
3874
|
-
import { Fragment, jsx as
|
|
3875
|
-
var ResizableRoot = ({ children }) => /* @__PURE__ */
|
|
3906
|
+
import { Fragment, jsx as jsx160 } from "react/jsx-runtime";
|
|
3907
|
+
var ResizableRoot = ({ children }) => /* @__PURE__ */ jsx160(Fragment, { children });
|
|
3876
3908
|
var Resizable = Object.assign(ResizableRoot, {
|
|
3877
3909
|
Handle: ResizableHandle,
|
|
3878
3910
|
Panel,
|
|
@@ -3881,7 +3913,7 @@ var Resizable = Object.assign(ResizableRoot, {
|
|
|
3881
3913
|
|
|
3882
3914
|
// src/components/SearchBar/SearchBar.tsx
|
|
3883
3915
|
import { SearchIcon as SearchIcon2 } from "lucide-react";
|
|
3884
|
-
import { jsx as
|
|
3916
|
+
import { jsx as jsx161, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
3885
3917
|
var SearchBar = ({
|
|
3886
3918
|
className,
|
|
3887
3919
|
onClick,
|
|
@@ -3892,9 +3924,9 @@ var SearchBar = ({
|
|
|
3892
3924
|
...props
|
|
3893
3925
|
}) => {
|
|
3894
3926
|
const { t } = useTranslation("libui");
|
|
3895
|
-
return /* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ jsxs55("form", { className: cn("relative", className), ...props, children: [
|
|
3928
|
+
/* @__PURE__ */ jsx161(SearchIcon2, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
3929
|
+
/* @__PURE__ */ jsx161(
|
|
3898
3930
|
Input,
|
|
3899
3931
|
{
|
|
3900
3932
|
className: "pl-8",
|
|
@@ -3914,9 +3946,9 @@ var SearchBar = ({
|
|
|
3914
3946
|
// src/components/Separator/Separator.tsx
|
|
3915
3947
|
import { forwardRef as forwardRef93 } from "react";
|
|
3916
3948
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3917
|
-
import { jsx as
|
|
3949
|
+
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
3918
3950
|
var Separator5 = forwardRef93(function Separator6({ className, decorative = true, orientation = "horizontal", ...props }, ref) {
|
|
3919
|
-
return /* @__PURE__ */
|
|
3951
|
+
return /* @__PURE__ */ jsx162(
|
|
3920
3952
|
SeparatorPrimitive.Root,
|
|
3921
3953
|
{
|
|
3922
3954
|
className: cn(
|
|
@@ -3938,13 +3970,13 @@ import { Close as Close3, Portal as Portal12, Root as Root18, Trigger as Trigger
|
|
|
3938
3970
|
|
|
3939
3971
|
// src/components/Sheet/SheetBody.tsx
|
|
3940
3972
|
import "react";
|
|
3941
|
-
import { jsx as
|
|
3973
|
+
import { jsx as jsx163 } from "react/jsx-runtime";
|
|
3942
3974
|
var SheetBody = ({
|
|
3943
3975
|
children,
|
|
3944
3976
|
className,
|
|
3945
3977
|
...props
|
|
3946
3978
|
}) => {
|
|
3947
|
-
return /* @__PURE__ */
|
|
3979
|
+
return /* @__PURE__ */ jsx163("div", { className: cn("py-4", className), ...props, children });
|
|
3948
3980
|
};
|
|
3949
3981
|
|
|
3950
3982
|
// src/components/Sheet/SheetContent.tsx
|
|
@@ -3952,7 +3984,7 @@ import * as React50 from "react";
|
|
|
3952
3984
|
import { Close as Close2, Content as Content11, Overlay as Overlay3, Portal as Portal11 } from "@radix-ui/react-dialog";
|
|
3953
3985
|
import { cva as cva5 } from "class-variance-authority";
|
|
3954
3986
|
import { XIcon as XIcon3 } from "lucide-react";
|
|
3955
|
-
import { jsx as
|
|
3987
|
+
import { jsx as jsx164, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
3956
3988
|
var sheetVariants = cva5(
|
|
3957
3989
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
3958
3990
|
{
|
|
@@ -3970,13 +4002,13 @@ var sheetVariants = cva5(
|
|
|
3970
4002
|
}
|
|
3971
4003
|
);
|
|
3972
4004
|
var SheetContent = React50.forwardRef(function SheetContent2({ children, className, side = "right", ...props }, ref) {
|
|
3973
|
-
return /* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
4005
|
+
return /* @__PURE__ */ jsxs56(Portal11, { children: [
|
|
4006
|
+
/* @__PURE__ */ jsx164(Overlay3, {}),
|
|
4007
|
+
/* @__PURE__ */ jsxs56(Content11, { className: cn(sheetVariants({ side }), className), ref, ...props, children: [
|
|
3976
4008
|
children,
|
|
3977
|
-
/* @__PURE__ */
|
|
3978
|
-
/* @__PURE__ */
|
|
3979
|
-
/* @__PURE__ */
|
|
4009
|
+
/* @__PURE__ */ jsxs56(Close2, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
4010
|
+
/* @__PURE__ */ jsx164(XIcon3, { className: "h-4 w-4" }),
|
|
4011
|
+
/* @__PURE__ */ jsx164("span", { className: "sr-only", children: "Close" })
|
|
3980
4012
|
] })
|
|
3981
4013
|
] })
|
|
3982
4014
|
] });
|
|
@@ -3985,27 +4017,27 @@ var SheetContent = React50.forwardRef(function SheetContent2({ children, classNa
|
|
|
3985
4017
|
// src/components/Sheet/SheetDescription.tsx
|
|
3986
4018
|
import { forwardRef as forwardRef95 } from "react";
|
|
3987
4019
|
import { Description as Description3 } from "@radix-ui/react-dialog";
|
|
3988
|
-
import { jsx as
|
|
4020
|
+
import { jsx as jsx165 } from "react/jsx-runtime";
|
|
3989
4021
|
var SheetDescription = forwardRef95(function SheetDescription2({ className, ...props }, ref) {
|
|
3990
|
-
return /* @__PURE__ */
|
|
4022
|
+
return /* @__PURE__ */ jsx165(Description3, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
|
|
3991
4023
|
});
|
|
3992
4024
|
|
|
3993
4025
|
// src/components/Sheet/SheetFooter.tsx
|
|
3994
4026
|
import "react";
|
|
3995
|
-
import { jsx as
|
|
3996
|
-
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
4027
|
+
import { jsx as jsx166 } from "react/jsx-runtime";
|
|
4028
|
+
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx166("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
|
|
3997
4029
|
|
|
3998
4030
|
// src/components/Sheet/SheetHeader.tsx
|
|
3999
4031
|
import "react";
|
|
4000
|
-
import { jsx as
|
|
4001
|
-
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
4032
|
+
import { jsx as jsx167 } from "react/jsx-runtime";
|
|
4033
|
+
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx167("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
|
|
4002
4034
|
|
|
4003
4035
|
// src/components/Sheet/SheetOverlay.tsx
|
|
4004
4036
|
import { forwardRef as forwardRef96 } from "react";
|
|
4005
4037
|
import { Overlay as Overlay4 } from "@radix-ui/react-dialog";
|
|
4006
|
-
import { jsx as
|
|
4038
|
+
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
4007
4039
|
var SheetOverlay = forwardRef96(function SheetOverlay2({ className, ...props }, ref) {
|
|
4008
|
-
return /* @__PURE__ */
|
|
4040
|
+
return /* @__PURE__ */ jsx168(
|
|
4009
4041
|
Overlay4,
|
|
4010
4042
|
{
|
|
4011
4043
|
className: cn(
|
|
@@ -4021,10 +4053,10 @@ var SheetOverlay = forwardRef96(function SheetOverlay2({ className, ...props },
|
|
|
4021
4053
|
// src/components/Sheet/SheetTitle.tsx
|
|
4022
4054
|
import { forwardRef as forwardRef97 } from "react";
|
|
4023
4055
|
import { Title as Title3 } from "@radix-ui/react-dialog";
|
|
4024
|
-
import { jsx as
|
|
4056
|
+
import { jsx as jsx169 } from "react/jsx-runtime";
|
|
4025
4057
|
var SheetTitle = forwardRef97(
|
|
4026
4058
|
function SheetTitle2({ className, ...props }, ref) {
|
|
4027
|
-
return /* @__PURE__ */
|
|
4059
|
+
return /* @__PURE__ */ jsx169(Title3, { className: cn("text-lg font-semibold text-foreground", className), ref, ...props });
|
|
4028
4060
|
}
|
|
4029
4061
|
);
|
|
4030
4062
|
|
|
@@ -4043,9 +4075,9 @@ var Sheet = Object.assign(Root18.bind(null), {
|
|
|
4043
4075
|
});
|
|
4044
4076
|
|
|
4045
4077
|
// src/components/Spinner/Spinner.tsx
|
|
4046
|
-
import { jsx as
|
|
4078
|
+
import { jsx as jsx170 } from "react/jsx-runtime";
|
|
4047
4079
|
var Spinner = ({ className, ...props }) => {
|
|
4048
|
-
return /* @__PURE__ */
|
|
4080
|
+
return /* @__PURE__ */ jsx170("div", { className: cn("flex h-full w-full items-center justify-center", className), ...props, children: /* @__PURE__ */ jsx170(
|
|
4049
4081
|
"span",
|
|
4050
4082
|
{
|
|
4051
4083
|
className: "relative animate-spinner overflow-hidden text-slate-900 dark:text-slate-100",
|
|
@@ -4063,8 +4095,8 @@ var Spinner = ({ className, ...props }) => {
|
|
|
4063
4095
|
|
|
4064
4096
|
// src/components/SpinnerIcon/SpinnerIcon.tsx
|
|
4065
4097
|
import "react";
|
|
4066
|
-
import { jsx as
|
|
4067
|
-
var SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */
|
|
4098
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
4099
|
+
var SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */ jsx171(
|
|
4068
4100
|
"svg",
|
|
4069
4101
|
{
|
|
4070
4102
|
className: cn("animate-spin", className),
|
|
@@ -4078,25 +4110,25 @@ var SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */ jsx170(
|
|
|
4078
4110
|
width: "24",
|
|
4079
4111
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4080
4112
|
...props,
|
|
4081
|
-
children: /* @__PURE__ */
|
|
4113
|
+
children: /* @__PURE__ */ jsx171("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
4082
4114
|
}
|
|
4083
4115
|
);
|
|
4084
4116
|
|
|
4085
4117
|
// src/components/StatisticCard/StatisticCard.tsx
|
|
4086
4118
|
import { useEffect as useEffect10 } from "react";
|
|
4087
4119
|
import { motion as motion6, useSpring, useTransform } from "framer-motion";
|
|
4088
|
-
import { jsx as
|
|
4120
|
+
import { jsx as jsx172, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
4089
4121
|
var StatisticCard = ({ className, icon, label, value, ...props }) => {
|
|
4090
4122
|
const spring = useSpring(0, { bounce: 0 });
|
|
4091
4123
|
const rounded = useTransform(spring, (latest) => Math.floor(latest));
|
|
4092
4124
|
useEffect10(() => {
|
|
4093
4125
|
spring.set(value);
|
|
4094
4126
|
}, [spring, value]);
|
|
4095
|
-
return /* @__PURE__ */
|
|
4096
|
-
icon && /* @__PURE__ */
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
/* @__PURE__ */
|
|
4099
|
-
/* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ jsxs57(Card, { className: cn("flex w-full rounded-lg p-4", className), ...props, children: [
|
|
4128
|
+
icon && /* @__PURE__ */ jsx172("div", { className: "mr-2 flex items-center justify-center text-4xl", children: icon }),
|
|
4129
|
+
/* @__PURE__ */ jsxs57("div", { className: "w-full text-center", children: [
|
|
4130
|
+
/* @__PURE__ */ jsx172(motion6.h3, { className: "title-font text-2xl font-semibold text-slate-900 dark:text-slate-100 sm:text-3xl", children: rounded }),
|
|
4131
|
+
/* @__PURE__ */ jsx172("p", { className: "font-medium leading-relaxed", children: label })
|
|
4100
4132
|
] })
|
|
4101
4133
|
] });
|
|
4102
4134
|
};
|
|
@@ -4104,9 +4136,9 @@ var StatisticCard = ({ className, icon, label, value, ...props }) => {
|
|
|
4104
4136
|
// src/components/Switch/Switch.tsx
|
|
4105
4137
|
import { forwardRef as forwardRef98 } from "react";
|
|
4106
4138
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4107
|
-
import { jsx as
|
|
4139
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
4108
4140
|
var Switch = forwardRef98(function Switch2({ className, ...props }, ref) {
|
|
4109
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsx173(
|
|
4110
4142
|
SwitchPrimitives.Root,
|
|
4111
4143
|
{
|
|
4112
4144
|
className: cn(
|
|
@@ -4115,7 +4147,7 @@ var Switch = forwardRef98(function Switch2({ className, ...props }, ref) {
|
|
|
4115
4147
|
),
|
|
4116
4148
|
...props,
|
|
4117
4149
|
ref,
|
|
4118
|
-
children: /* @__PURE__ */
|
|
4150
|
+
children: /* @__PURE__ */ jsx173(
|
|
4119
4151
|
SwitchPrimitives.Thumb,
|
|
4120
4152
|
{
|
|
4121
4153
|
className: cn(
|
|
@@ -4130,9 +4162,9 @@ var Switch = forwardRef98(function Switch2({ className, ...props }, ref) {
|
|
|
4130
4162
|
// src/components/Tabs/TabsContent.tsx
|
|
4131
4163
|
import { forwardRef as forwardRef99 } from "react";
|
|
4132
4164
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4133
|
-
import { jsx as
|
|
4165
|
+
import { jsx as jsx174 } from "react/jsx-runtime";
|
|
4134
4166
|
var TabsContent = forwardRef99(function TabsContent2({ className, ...props }, ref) {
|
|
4135
|
-
return /* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ jsx174(
|
|
4136
4168
|
TabsPrimitive.Content,
|
|
4137
4169
|
{
|
|
4138
4170
|
className: cn(
|
|
@@ -4148,9 +4180,9 @@ var TabsContent = forwardRef99(function TabsContent2({ className, ...props }, re
|
|
|
4148
4180
|
// src/components/Tabs/TabsList.tsx
|
|
4149
4181
|
import { forwardRef as forwardRef100 } from "react";
|
|
4150
4182
|
import * as TabsPrimitive2 from "@radix-ui/react-tabs";
|
|
4151
|
-
import { jsx as
|
|
4183
|
+
import { jsx as jsx175 } from "react/jsx-runtime";
|
|
4152
4184
|
var TabsList = forwardRef100(function TabsList2({ className, ...props }, ref) {
|
|
4153
|
-
return /* @__PURE__ */
|
|
4185
|
+
return /* @__PURE__ */ jsx175(
|
|
4154
4186
|
TabsPrimitive2.List,
|
|
4155
4187
|
{
|
|
4156
4188
|
className: cn(
|
|
@@ -4166,19 +4198,19 @@ var TabsList = forwardRef100(function TabsList2({ className, ...props }, ref) {
|
|
|
4166
4198
|
// src/components/Tabs/TabsRoot.tsx
|
|
4167
4199
|
import { forwardRef as forwardRef101 } from "react";
|
|
4168
4200
|
import { Root as Root20 } from "@radix-ui/react-tabs";
|
|
4169
|
-
import { jsx as
|
|
4201
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
4170
4202
|
var TabsRoot = forwardRef101(
|
|
4171
4203
|
function TabsRoot2(props, ref) {
|
|
4172
|
-
return /* @__PURE__ */
|
|
4204
|
+
return /* @__PURE__ */ jsx176(Root20, { ref, ...props });
|
|
4173
4205
|
}
|
|
4174
4206
|
);
|
|
4175
4207
|
|
|
4176
4208
|
// src/components/Tabs/TabsTrigger.tsx
|
|
4177
4209
|
import { forwardRef as forwardRef102 } from "react";
|
|
4178
4210
|
import * as TabsPrimitive3 from "@radix-ui/react-tabs";
|
|
4179
|
-
import { jsx as
|
|
4211
|
+
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
4180
4212
|
var TabsTrigger = forwardRef102(function TabsTrigger2({ className, ...props }, ref) {
|
|
4181
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ jsx177(
|
|
4182
4214
|
TabsPrimitive3.Trigger,
|
|
4183
4215
|
{
|
|
4184
4216
|
className: cn(
|
|
@@ -4200,13 +4232,13 @@ var Tabs = Object.assign(TabsRoot, {
|
|
|
4200
4232
|
|
|
4201
4233
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
4202
4234
|
import { MoonIcon, SunIcon } from "lucide-react";
|
|
4203
|
-
import { jsx as
|
|
4235
|
+
import { jsx as jsx178, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4204
4236
|
var ThemeToggle = ({ onClick, variant = "outline", ...props }) => {
|
|
4205
4237
|
const [theme, setTheme] = useTheme();
|
|
4206
4238
|
const toggleTheme = () => {
|
|
4207
4239
|
setTheme(theme === "dark" ? "light" : "dark");
|
|
4208
4240
|
};
|
|
4209
|
-
return /* @__PURE__ */
|
|
4241
|
+
return /* @__PURE__ */ jsxs58(
|
|
4210
4242
|
Button,
|
|
4211
4243
|
{
|
|
4212
4244
|
size: "icon",
|
|
@@ -4217,8 +4249,8 @@ var ThemeToggle = ({ onClick, variant = "outline", ...props }) => {
|
|
|
4217
4249
|
},
|
|
4218
4250
|
...props,
|
|
4219
4251
|
children: [
|
|
4220
|
-
/* @__PURE__ */
|
|
4221
|
-
/* @__PURE__ */
|
|
4252
|
+
/* @__PURE__ */ jsx178(SunIcon, { className: "rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
4253
|
+
/* @__PURE__ */ jsx178(MoonIcon, { className: "absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
4222
4254
|
]
|
|
4223
4255
|
}
|
|
4224
4256
|
);
|
|
@@ -4227,10 +4259,10 @@ var ThemeToggle = ({ onClick, variant = "outline", ...props }) => {
|
|
|
4227
4259
|
// src/components/Tooltip/TooltipContent.tsx
|
|
4228
4260
|
import * as React54 from "react";
|
|
4229
4261
|
import { Content as Content13 } from "@radix-ui/react-tooltip";
|
|
4230
|
-
import { jsx as
|
|
4262
|
+
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
4231
4263
|
var TooltipContent = React54.forwardRef(
|
|
4232
4264
|
function TooltipContent2({ className, collisionPadding = 0, sideOffset = 4, ...props }, ref) {
|
|
4233
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx179(
|
|
4234
4266
|
Content13,
|
|
4235
4267
|
{
|
|
4236
4268
|
className: cn(
|
|
@@ -4249,17 +4281,23 @@ var TooltipContent = React54.forwardRef(
|
|
|
4249
4281
|
// src/components/Tooltip/TooltipRoot.tsx
|
|
4250
4282
|
import "react";
|
|
4251
4283
|
import { Provider, Root as Root21 } from "@radix-ui/react-tooltip";
|
|
4252
|
-
import { jsx as
|
|
4253
|
-
var TooltipRoot = ({
|
|
4254
|
-
|
|
4284
|
+
import { jsx as jsx180 } from "react/jsx-runtime";
|
|
4285
|
+
var TooltipRoot = ({
|
|
4286
|
+
children,
|
|
4287
|
+
delayDuration = 0,
|
|
4288
|
+
onOpenChange,
|
|
4289
|
+
open,
|
|
4290
|
+
skipDelayDuration = 300
|
|
4291
|
+
}) => {
|
|
4292
|
+
return /* @__PURE__ */ jsx180(Provider, { delayDuration, skipDelayDuration, children: /* @__PURE__ */ jsx180(Root21, { open, onOpenChange, children }) });
|
|
4255
4293
|
};
|
|
4256
4294
|
|
|
4257
4295
|
// src/components/Tooltip/TooltipTrigger.tsx
|
|
4258
4296
|
import { forwardRef as forwardRef104 } from "react";
|
|
4259
4297
|
import { Trigger as Trigger12 } from "@radix-ui/react-tooltip";
|
|
4260
|
-
import { jsx as
|
|
4298
|
+
import { jsx as jsx181 } from "react/jsx-runtime";
|
|
4261
4299
|
var TooltipTrigger = forwardRef104(function TooltipTrigger2({ variant = "outline", ...props }, ref) {
|
|
4262
|
-
return /* @__PURE__ */
|
|
4300
|
+
return /* @__PURE__ */ jsx181(Trigger12, { asChild: true, ref, children: /* @__PURE__ */ jsx181(Button, { variant, ...props }) });
|
|
4263
4301
|
});
|
|
4264
4302
|
|
|
4265
4303
|
// src/components/Tooltip/Tooltip.tsx
|
|
@@ -4291,6 +4329,7 @@ export {
|
|
|
4291
4329
|
DropdownMenu,
|
|
4292
4330
|
ErrorBoundary,
|
|
4293
4331
|
ErrorFallback,
|
|
4332
|
+
FileDropzone,
|
|
4294
4333
|
Form,
|
|
4295
4334
|
Heading,
|
|
4296
4335
|
HoverCard,
|