@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.16 → 0.1.0-alpha.17
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/index.cjs +744 -597
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +679 -532
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1824,7 +1824,7 @@ var AdsCheckbox = React17.forwardRef(({ checkboxClassName, className, descriptio
|
|
|
1824
1824
|
AdsCheckbox.displayName = "AdsCheckbox";
|
|
1825
1825
|
|
|
1826
1826
|
// src/components/AdsCalendar/index.tsx
|
|
1827
|
-
var
|
|
1827
|
+
var React24 = __toESM(require("react"), 1);
|
|
1828
1828
|
var import_date_fns = require("date-fns");
|
|
1829
1829
|
var import_lucide_react8 = require("lucide-react");
|
|
1830
1830
|
|
|
@@ -1850,36 +1850,149 @@ var Input = React18.forwardRef(
|
|
|
1850
1850
|
Input.displayName = "Input";
|
|
1851
1851
|
|
|
1852
1852
|
// src/components/AdsPopover/index.tsx
|
|
1853
|
-
var
|
|
1853
|
+
var React21 = __toESM(require("react"), 1);
|
|
1854
1854
|
|
|
1855
1855
|
// src/primitives/popover.tsx
|
|
1856
|
-
var
|
|
1856
|
+
var React20 = __toESM(require("react"), 1);
|
|
1857
1857
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
1858
|
+
|
|
1859
|
+
// src/lib/nestedDismissableLayer.tsx
|
|
1860
|
+
var React19 = __toESM(require("react"), 1);
|
|
1858
1861
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1862
|
+
var NestedDismissableLayerContext = React19.createContext(null);
|
|
1863
|
+
function useNestedDismissableLayerCoordinator() {
|
|
1864
|
+
const activeLayersRef = React19.useRef(/* @__PURE__ */ new Map());
|
|
1865
|
+
const registerNestedLayer = React19.useCallback(
|
|
1866
|
+
(id, dismiss) => {
|
|
1867
|
+
const activeLayers = activeLayersRef.current;
|
|
1868
|
+
activeLayers.delete(id);
|
|
1869
|
+
activeLayers.set(id, dismiss);
|
|
1870
|
+
return () => {
|
|
1871
|
+
if (activeLayers.get(id) === dismiss) {
|
|
1872
|
+
activeLayers.delete(id);
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
},
|
|
1876
|
+
[]
|
|
1877
|
+
);
|
|
1878
|
+
const hasActiveNestedLayer = React19.useCallback(
|
|
1879
|
+
() => activeLayersRef.current.size > 0,
|
|
1880
|
+
[]
|
|
1881
|
+
);
|
|
1882
|
+
const dismissTopNestedLayer = React19.useCallback(() => {
|
|
1883
|
+
const activeLayers = [...activeLayersRef.current.values()];
|
|
1884
|
+
activeLayers.at(-1)?.();
|
|
1885
|
+
}, []);
|
|
1886
|
+
return React19.useMemo(
|
|
1887
|
+
() => ({
|
|
1888
|
+
dismissTopNestedLayer,
|
|
1889
|
+
hasActiveNestedLayer,
|
|
1890
|
+
registerNestedLayer
|
|
1891
|
+
}),
|
|
1892
|
+
[dismissTopNestedLayer, hasActiveNestedLayer, registerNestedLayer]
|
|
1893
|
+
);
|
|
1894
|
+
}
|
|
1895
|
+
function NestedDismissableLayerProvider({
|
|
1896
|
+
children,
|
|
1897
|
+
coordinator
|
|
1898
|
+
}) {
|
|
1899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NestedDismissableLayerContext.Provider, { value: coordinator, children });
|
|
1900
|
+
}
|
|
1901
|
+
function useNestedDismissableLayer(active, dismiss) {
|
|
1902
|
+
const coordinator = React19.useContext(NestedDismissableLayerContext);
|
|
1903
|
+
const idRef = React19.useRef(/* @__PURE__ */ Symbol("ads-nested-dismissable-layer"));
|
|
1904
|
+
React19.useEffect(() => {
|
|
1905
|
+
if (!active || !coordinator) return;
|
|
1906
|
+
return coordinator.registerNestedLayer(idRef.current, dismiss);
|
|
1907
|
+
}, [active, coordinator, dismiss]);
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
// src/primitives/popover.tsx
|
|
1911
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1859
1912
|
var Popover = PopoverPrimitive.Root;
|
|
1860
1913
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1861
|
-
var
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
className
|
|
1870
|
-
),
|
|
1914
|
+
var PopoverContentImpl = React20.forwardRef(
|
|
1915
|
+
({
|
|
1916
|
+
className,
|
|
1917
|
+
align = "center",
|
|
1918
|
+
onEscapeKeyDown,
|
|
1919
|
+
onFocusOutside,
|
|
1920
|
+
onPointerDownOutside,
|
|
1921
|
+
sideOffset = 4,
|
|
1871
1922
|
...props
|
|
1923
|
+
}, ref) => {
|
|
1924
|
+
const coordinator = useNestedDismissableLayerCoordinator();
|
|
1925
|
+
const shieldNextFocusOutsideRef = React20.useRef(false);
|
|
1926
|
+
const handlePointerDownOutside = React20.useCallback(
|
|
1927
|
+
(event) => {
|
|
1928
|
+
onPointerDownOutside?.(event);
|
|
1929
|
+
if (event.defaultPrevented) return;
|
|
1930
|
+
if (!coordinator.hasActiveNestedLayer()) {
|
|
1931
|
+
shieldNextFocusOutsideRef.current = false;
|
|
1932
|
+
return;
|
|
1933
|
+
}
|
|
1934
|
+
shieldNextFocusOutsideRef.current = true;
|
|
1935
|
+
coordinator.dismissTopNestedLayer();
|
|
1936
|
+
event.preventDefault();
|
|
1937
|
+
},
|
|
1938
|
+
[coordinator, onPointerDownOutside]
|
|
1939
|
+
);
|
|
1940
|
+
const handleFocusOutside = React20.useCallback(
|
|
1941
|
+
(event) => {
|
|
1942
|
+
onFocusOutside?.(event);
|
|
1943
|
+
if (event.defaultPrevented) return;
|
|
1944
|
+
const followsShieldedPointer = shieldNextFocusOutsideRef.current;
|
|
1945
|
+
shieldNextFocusOutsideRef.current = false;
|
|
1946
|
+
if (followsShieldedPointer) {
|
|
1947
|
+
event.preventDefault();
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
if (!coordinator.hasActiveNestedLayer()) return;
|
|
1951
|
+
coordinator.dismissTopNestedLayer();
|
|
1952
|
+
event.preventDefault();
|
|
1953
|
+
},
|
|
1954
|
+
[coordinator, onFocusOutside]
|
|
1955
|
+
);
|
|
1956
|
+
const handleEscapeKeyDown = React20.useCallback(
|
|
1957
|
+
(event) => {
|
|
1958
|
+
onEscapeKeyDown?.(event);
|
|
1959
|
+
if (event.defaultPrevented || !coordinator.hasActiveNestedLayer()) {
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1962
|
+
coordinator.dismissTopNestedLayer();
|
|
1963
|
+
event.preventDefault();
|
|
1964
|
+
},
|
|
1965
|
+
[coordinator, onEscapeKeyDown]
|
|
1966
|
+
);
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(NestedDismissableLayerProvider, { coordinator, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1968
|
+
PopoverPrimitive.Content,
|
|
1969
|
+
{
|
|
1970
|
+
ref,
|
|
1971
|
+
align,
|
|
1972
|
+
sideOffset,
|
|
1973
|
+
className: cn(
|
|
1974
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
|
|
1975
|
+
className
|
|
1976
|
+
),
|
|
1977
|
+
onEscapeKeyDown: handleEscapeKeyDown,
|
|
1978
|
+
onFocusOutside: handleFocusOutside,
|
|
1979
|
+
onPointerDownOutside: handlePointerDownOutside,
|
|
1980
|
+
...props
|
|
1981
|
+
}
|
|
1982
|
+
) });
|
|
1872
1983
|
}
|
|
1873
|
-
)
|
|
1984
|
+
);
|
|
1985
|
+
PopoverContentImpl.displayName = "PopoverContentImpl";
|
|
1986
|
+
var PopoverContent = React20.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverContentImpl, { ...props, ref }) }));
|
|
1874
1987
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1875
1988
|
|
|
1876
1989
|
// src/components/AdsPopover/index.tsx
|
|
1877
|
-
var
|
|
1990
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1878
1991
|
var popoverContentClassName = "z-50 w-[320px] rounded-radius-lg border border-border bg-popover p-lg text-popover-foreground shadow-[0px_2px_4px_-2px_rgba(0,0,0,0.1),0px_4px_6px_-1px_rgba(0,0,0,0.1)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]";
|
|
1879
1992
|
var AdsPopover = Popover;
|
|
1880
1993
|
var AdsPopoverTrigger = PopoverTrigger;
|
|
1881
|
-
var AdsPopoverContent =
|
|
1882
|
-
({ align = "center", className, inset = false, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1994
|
+
var AdsPopoverContent = React21.forwardRef(
|
|
1995
|
+
({ align = "center", className, inset = false, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1883
1996
|
PopoverContent,
|
|
1884
1997
|
{
|
|
1885
1998
|
align,
|
|
@@ -1895,10 +2008,10 @@ var AdsPopoverContent = React20.forwardRef(
|
|
|
1895
2008
|
)
|
|
1896
2009
|
);
|
|
1897
2010
|
AdsPopoverContent.displayName = "AdsPopoverContent";
|
|
1898
|
-
var AdsPopoverHeader =
|
|
2011
|
+
var AdsPopoverHeader = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("flex flex-col gap-sm", className), ref, ...props }));
|
|
1899
2012
|
AdsPopoverHeader.displayName = "AdsPopoverHeader";
|
|
1900
|
-
var AdsPopoverBody =
|
|
1901
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2013
|
+
var AdsPopoverBody = React21.forwardRef(
|
|
2014
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1902
2015
|
"div",
|
|
1903
2016
|
{
|
|
1904
2017
|
className: cn("mt-md flex flex-col gap-md", className),
|
|
@@ -1908,7 +2021,7 @@ var AdsPopoverBody = React20.forwardRef(
|
|
|
1908
2021
|
)
|
|
1909
2022
|
);
|
|
1910
2023
|
AdsPopoverBody.displayName = "AdsPopoverBody";
|
|
1911
|
-
var AdsPopoverTitle =
|
|
2024
|
+
var AdsPopoverTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1912
2025
|
"h4",
|
|
1913
2026
|
{
|
|
1914
2027
|
className: cn(
|
|
@@ -1921,7 +2034,7 @@ var AdsPopoverTitle = React20.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1921
2034
|
}
|
|
1922
2035
|
));
|
|
1923
2036
|
AdsPopoverTitle.displayName = "AdsPopoverTitle";
|
|
1924
|
-
var AdsPopoverDescription =
|
|
2037
|
+
var AdsPopoverDescription = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1925
2038
|
"p",
|
|
1926
2039
|
{
|
|
1927
2040
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -1932,21 +2045,55 @@ var AdsPopoverDescription = React20.forwardRef(({ className, ...props }, ref) =>
|
|
|
1932
2045
|
AdsPopoverDescription.displayName = "AdsPopoverDescription";
|
|
1933
2046
|
|
|
1934
2047
|
// src/primitives/calendar.tsx
|
|
1935
|
-
var
|
|
2048
|
+
var React23 = __toESM(require("react"), 1);
|
|
1936
2049
|
var import_react2 = require("@daypicker/react");
|
|
1937
2050
|
var import_hijri = require("@daypicker/hijri");
|
|
1938
2051
|
var import_persian = require("@daypicker/persian");
|
|
1939
2052
|
|
|
1940
2053
|
// src/primitives/select.tsx
|
|
1941
|
-
var
|
|
2054
|
+
var React22 = __toESM(require("react"), 1);
|
|
1942
2055
|
var DismissableLayerPrimitive = __toESM(require("@radix-ui/react-dismissable-layer"), 1);
|
|
1943
2056
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
1944
2057
|
var import_lucide_react7 = require("lucide-react");
|
|
1945
|
-
var
|
|
1946
|
-
|
|
2058
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2059
|
+
function Select({
|
|
2060
|
+
defaultOpen,
|
|
2061
|
+
onOpenChange,
|
|
2062
|
+
open: openProp,
|
|
2063
|
+
...props
|
|
2064
|
+
}) {
|
|
2065
|
+
const isControlled = openProp !== void 0;
|
|
2066
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React22.useState(
|
|
2067
|
+
defaultOpen ?? false
|
|
2068
|
+
);
|
|
2069
|
+
const resolvedOpen = isControlled ? openProp : uncontrolledOpen;
|
|
2070
|
+
const handleOpenChange = React22.useCallback(
|
|
2071
|
+
(nextOpen) => {
|
|
2072
|
+
if (!isControlled) {
|
|
2073
|
+
setUncontrolledOpen(nextOpen);
|
|
2074
|
+
}
|
|
2075
|
+
onOpenChange?.(nextOpen);
|
|
2076
|
+
},
|
|
2077
|
+
[isControlled, onOpenChange]
|
|
2078
|
+
);
|
|
2079
|
+
const handleNestedDismiss = React22.useCallback(() => {
|
|
2080
|
+
handleOpenChange(false);
|
|
2081
|
+
}, [handleOpenChange]);
|
|
2082
|
+
useNestedDismissableLayer(resolvedOpen, handleNestedDismiss);
|
|
2083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2084
|
+
SelectPrimitive.Root,
|
|
2085
|
+
{
|
|
2086
|
+
...props,
|
|
2087
|
+
defaultOpen,
|
|
2088
|
+
onOpenChange: handleOpenChange,
|
|
2089
|
+
open: openProp
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
}
|
|
2093
|
+
Select.displayName = SelectPrimitive.Root.displayName;
|
|
1947
2094
|
var SelectGroup = SelectPrimitive.Group;
|
|
1948
2095
|
var SelectValue = SelectPrimitive.Value;
|
|
1949
|
-
var SelectTrigger =
|
|
2096
|
+
var SelectTrigger = React22.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1950
2097
|
SelectPrimitive.Trigger,
|
|
1951
2098
|
{
|
|
1952
2099
|
ref,
|
|
@@ -1957,12 +2104,12 @@ var SelectTrigger = React21.forwardRef(({ className, children, ...props }, ref)
|
|
|
1957
2104
|
...props,
|
|
1958
2105
|
children: [
|
|
1959
2106
|
children,
|
|
1960
|
-
/* @__PURE__ */ (0,
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
1961
2108
|
]
|
|
1962
2109
|
}
|
|
1963
2110
|
));
|
|
1964
2111
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1965
|
-
var SelectScrollUpButton =
|
|
2112
|
+
var SelectScrollUpButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1966
2113
|
SelectPrimitive.ScrollUpButton,
|
|
1967
2114
|
{
|
|
1968
2115
|
ref,
|
|
@@ -1971,11 +2118,11 @@ var SelectScrollUpButton = React21.forwardRef(({ className, ...props }, ref) =>
|
|
|
1971
2118
|
className
|
|
1972
2119
|
),
|
|
1973
2120
|
...props,
|
|
1974
|
-
children: /* @__PURE__ */ (0,
|
|
2121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.ChevronUp, { className: "h-4 w-4" })
|
|
1975
2122
|
}
|
|
1976
2123
|
));
|
|
1977
2124
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1978
|
-
var SelectScrollDownButton =
|
|
2125
|
+
var SelectScrollDownButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1979
2126
|
SelectPrimitive.ScrollDownButton,
|
|
1980
2127
|
{
|
|
1981
2128
|
ref,
|
|
@@ -1984,11 +2131,11 @@ var SelectScrollDownButton = React21.forwardRef(({ className, ...props }, ref) =
|
|
|
1984
2131
|
className
|
|
1985
2132
|
),
|
|
1986
2133
|
...props,
|
|
1987
|
-
children: /* @__PURE__ */ (0,
|
|
2134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.ChevronDown, { className: "h-4 w-4" })
|
|
1988
2135
|
}
|
|
1989
2136
|
));
|
|
1990
2137
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1991
|
-
var SelectContent =
|
|
2138
|
+
var SelectContent = React22.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DismissableLayerPrimitive.Branch, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1992
2139
|
SelectPrimitive.Content,
|
|
1993
2140
|
{
|
|
1994
2141
|
ref,
|
|
@@ -2000,8 +2147,8 @@ var SelectContent = React21.forwardRef(({ className, children, position = "poppe
|
|
|
2000
2147
|
position,
|
|
2001
2148
|
...props,
|
|
2002
2149
|
children: [
|
|
2003
|
-
/* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollUpButton, {}),
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2005
2152
|
SelectPrimitive.Viewport,
|
|
2006
2153
|
{
|
|
2007
2154
|
className: cn(
|
|
@@ -2011,12 +2158,12 @@ var SelectContent = React21.forwardRef(({ className, children, position = "poppe
|
|
|
2011
2158
|
children
|
|
2012
2159
|
}
|
|
2013
2160
|
),
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollDownButton, {})
|
|
2015
2162
|
]
|
|
2016
2163
|
}
|
|
2017
2164
|
) }) }));
|
|
2018
2165
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2019
|
-
var SelectLabel =
|
|
2166
|
+
var SelectLabel = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2020
2167
|
SelectPrimitive.Label,
|
|
2021
2168
|
{
|
|
2022
2169
|
ref,
|
|
@@ -2025,7 +2172,7 @@ var SelectLabel = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2025
2172
|
}
|
|
2026
2173
|
));
|
|
2027
2174
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2028
|
-
var SelectItem =
|
|
2175
|
+
var SelectItem = React22.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2029
2176
|
SelectPrimitive.Item,
|
|
2030
2177
|
{
|
|
2031
2178
|
ref,
|
|
@@ -2035,13 +2182,13 @@ var SelectItem = React21.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2035
2182
|
),
|
|
2036
2183
|
...props,
|
|
2037
2184
|
children: [
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
2039
|
-
/* @__PURE__ */ (0,
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.Check, { className: "h-4 w-4" }) }) }),
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemText, { children })
|
|
2040
2187
|
]
|
|
2041
2188
|
}
|
|
2042
2189
|
));
|
|
2043
2190
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2044
|
-
var SelectSeparator =
|
|
2191
|
+
var SelectSeparator = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2045
2192
|
SelectPrimitive.Separator,
|
|
2046
2193
|
{
|
|
2047
2194
|
ref,
|
|
@@ -2052,7 +2199,7 @@ var SelectSeparator = React21.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
2052
2199
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2053
2200
|
|
|
2054
2201
|
// src/primitives/calendar.tsx
|
|
2055
|
-
var
|
|
2202
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2056
2203
|
var cellSizeClasses = {
|
|
2057
2204
|
md: {
|
|
2058
2205
|
cell: "size-8",
|
|
@@ -2121,13 +2268,13 @@ function CalendarDropdown({
|
|
|
2121
2268
|
}) {
|
|
2122
2269
|
const { classNames, styles } = (0, import_react2.useDayPicker)();
|
|
2123
2270
|
const selectedValue = value?.toString();
|
|
2124
|
-
return /* @__PURE__ */ (0,
|
|
2271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2125
2272
|
"span",
|
|
2126
2273
|
{
|
|
2127
2274
|
className: classNames[import_react2.UI.DropdownRoot],
|
|
2128
2275
|
"data-disabled": disabled,
|
|
2129
2276
|
style: styles?.[import_react2.UI.DropdownRoot],
|
|
2130
|
-
children: /* @__PURE__ */ (0,
|
|
2277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2131
2278
|
Select,
|
|
2132
2279
|
{
|
|
2133
2280
|
disabled,
|
|
@@ -2138,7 +2285,7 @@ function CalendarDropdown({
|
|
|
2138
2285
|
},
|
|
2139
2286
|
value: selectedValue,
|
|
2140
2287
|
children: [
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2142
2289
|
SelectTrigger,
|
|
2143
2290
|
{
|
|
2144
2291
|
"aria-label": ariaLabel,
|
|
@@ -2148,10 +2295,10 @@ function CalendarDropdown({
|
|
|
2148
2295
|
className
|
|
2149
2296
|
),
|
|
2150
2297
|
style,
|
|
2151
|
-
children: /* @__PURE__ */ (0,
|
|
2298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, {})
|
|
2152
2299
|
}
|
|
2153
2300
|
),
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectContent, { className: "rounded-radius-md border-border bg-popover text-popover-foreground shadow-[0px_8px_24px_rgba(0,0,0,0.22)]", children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2155
2302
|
SelectItem,
|
|
2156
2303
|
{
|
|
2157
2304
|
disabled: option.disabled,
|
|
@@ -2166,7 +2313,7 @@ function CalendarDropdown({
|
|
|
2166
2313
|
}
|
|
2167
2314
|
);
|
|
2168
2315
|
}
|
|
2169
|
-
var Calendar =
|
|
2316
|
+
var Calendar = React23.forwardRef(
|
|
2170
2317
|
({
|
|
2171
2318
|
captionLayout,
|
|
2172
2319
|
calendarSystem = "gregorian",
|
|
@@ -2178,7 +2325,7 @@ var Calendar = React22.forwardRef(
|
|
|
2178
2325
|
showOutsideDays = true,
|
|
2179
2326
|
...props
|
|
2180
2327
|
}, ref) => {
|
|
2181
|
-
const mergedClassNames =
|
|
2328
|
+
const mergedClassNames = React23.useMemo(
|
|
2182
2329
|
() => ({
|
|
2183
2330
|
...getCalendarClassNames(cellSize, captionLayout?.startsWith("dropdown") ?? false),
|
|
2184
2331
|
...classNames
|
|
@@ -2199,7 +2346,7 @@ var Calendar = React22.forwardRef(
|
|
|
2199
2346
|
showOutsideDays
|
|
2200
2347
|
};
|
|
2201
2348
|
if (calendarSystem === "persian") {
|
|
2202
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2203
2350
|
import_persian.DayPicker,
|
|
2204
2351
|
{
|
|
2205
2352
|
...sharedProps,
|
|
@@ -2210,7 +2357,7 @@ var Calendar = React22.forwardRef(
|
|
|
2210
2357
|
) });
|
|
2211
2358
|
}
|
|
2212
2359
|
if (calendarSystem === "hijri") {
|
|
2213
|
-
return /* @__PURE__ */ (0,
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2214
2361
|
import_hijri.DayPicker,
|
|
2215
2362
|
{
|
|
2216
2363
|
...sharedProps,
|
|
@@ -2220,13 +2367,13 @@ var Calendar = React22.forwardRef(
|
|
|
2220
2367
|
}
|
|
2221
2368
|
) });
|
|
2222
2369
|
}
|
|
2223
|
-
return /* @__PURE__ */ (0,
|
|
2370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react2.DayPicker, { ...sharedProps }) });
|
|
2224
2371
|
}
|
|
2225
2372
|
);
|
|
2226
2373
|
Calendar.displayName = "Calendar";
|
|
2227
2374
|
|
|
2228
2375
|
// src/components/AdsCalendar/index.tsx
|
|
2229
|
-
var
|
|
2376
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2230
2377
|
var dateTriggerClassName = "flex h-9 w-full items-center justify-between gap-2 rounded-radius-md border border-border bg-card px-md py-2 text-left text-sm leading-5 text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)] transition-colors hover:border-border-focus focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] disabled:cursor-not-allowed disabled:opacity-50";
|
|
2231
2378
|
var timeInputClassName = "flex h-9 w-full rounded-radius-md border border-border bg-card px-md py-2 text-center text-sm leading-5 text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)]";
|
|
2232
2379
|
function useControllableDate({
|
|
@@ -2234,12 +2381,12 @@ function useControllableDate({
|
|
|
2234
2381
|
onSelect,
|
|
2235
2382
|
selected
|
|
2236
2383
|
}) {
|
|
2237
|
-
const [internalSelected, setInternalSelected] =
|
|
2384
|
+
const [internalSelected, setInternalSelected] = React24.useState(
|
|
2238
2385
|
defaultSelected
|
|
2239
2386
|
);
|
|
2240
2387
|
const isControlled = selected !== void 0;
|
|
2241
2388
|
const value = isControlled ? selected : internalSelected;
|
|
2242
|
-
const handleSelect =
|
|
2389
|
+
const handleSelect = React24.useCallback(
|
|
2243
2390
|
(nextValue) => {
|
|
2244
2391
|
if (!isControlled) {
|
|
2245
2392
|
setInternalSelected(nextValue);
|
|
@@ -2256,11 +2403,11 @@ function getDateLabel(value, formatter) {
|
|
|
2256
2403
|
}
|
|
2257
2404
|
return formatter ? formatter(value) : (0, import_date_fns.format)(value, "MMM d, yyyy");
|
|
2258
2405
|
}
|
|
2259
|
-
var AdsCalendar =
|
|
2260
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2406
|
+
var AdsCalendar = React24.forwardRef(
|
|
2407
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Calendar, { className: cn(className), ref, ...props })
|
|
2261
2408
|
);
|
|
2262
2409
|
AdsCalendar.displayName = "AdsCalendar";
|
|
2263
|
-
var AdsDatePicker =
|
|
2410
|
+
var AdsDatePicker = React24.forwardRef(
|
|
2264
2411
|
({
|
|
2265
2412
|
className,
|
|
2266
2413
|
defaultSelected,
|
|
@@ -2273,7 +2420,7 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2273
2420
|
triggerClassName,
|
|
2274
2421
|
...calendarProps
|
|
2275
2422
|
}, ref) => {
|
|
2276
|
-
const [open, setOpen] =
|
|
2423
|
+
const [open, setOpen] = React24.useState(false);
|
|
2277
2424
|
const [value, handleSelect] = useControllableDate({
|
|
2278
2425
|
defaultSelected,
|
|
2279
2426
|
onSelect,
|
|
@@ -2281,17 +2428,17 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2281
2428
|
});
|
|
2282
2429
|
const description = useAdsFieldDescription({ id });
|
|
2283
2430
|
const labelText = getDateLabel(value, formatDateLabel) ?? placeholder;
|
|
2284
|
-
const onCalendarSelect =
|
|
2431
|
+
const onCalendarSelect = React24.useCallback(
|
|
2285
2432
|
(nextValue) => {
|
|
2286
2433
|
handleSelect(nextValue);
|
|
2287
2434
|
setOpen(false);
|
|
2288
2435
|
},
|
|
2289
2436
|
[handleSelect]
|
|
2290
2437
|
);
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
2292
|
-
label ? /* @__PURE__ */ (0,
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2294
|
-
/* @__PURE__ */ (0,
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AdsFieldItem, { className: cn("gap-3", className), ref, children: [
|
|
2439
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
2440
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AdsPopover, { onOpenChange: setOpen, open, children: [
|
|
2441
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2295
2442
|
Button,
|
|
2296
2443
|
{
|
|
2297
2444
|
"aria-label": labelText,
|
|
@@ -2304,12 +2451,12 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2304
2451
|
id: description.inputId,
|
|
2305
2452
|
type: "button",
|
|
2306
2453
|
children: [
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: labelText }),
|
|
2455
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react8.ChevronDown, { "aria-hidden": true, className: "size-4 shrink-0 text-icon-muted" })
|
|
2309
2456
|
]
|
|
2310
2457
|
}
|
|
2311
2458
|
) }),
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdsPopoverContent, { className: "w-auto p-0", inset: true, sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2313
2460
|
AdsCalendar,
|
|
2314
2461
|
{
|
|
2315
2462
|
...calendarProps,
|
|
@@ -2323,18 +2470,18 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2323
2470
|
}
|
|
2324
2471
|
);
|
|
2325
2472
|
AdsDatePicker.displayName = "AdsDatePicker";
|
|
2326
|
-
var AdsDateTimePicker =
|
|
2473
|
+
var AdsDateTimePicker = React24.forwardRef(
|
|
2327
2474
|
({
|
|
2328
2475
|
className,
|
|
2329
2476
|
timeLabel = "Time",
|
|
2330
2477
|
timeValue = "",
|
|
2331
2478
|
onTimeChange,
|
|
2332
2479
|
...props
|
|
2333
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2480
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: cn("flex flex-wrap items-start gap-4", className), ref, children: [
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdsDatePicker, { className: "w-[min(100%,135px)]", ...props }),
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AdsFieldItem, { className: "w-[91px] gap-3", children: [
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdsFieldLabel, { children: timeLabel }),
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2338
2485
|
Input,
|
|
2339
2486
|
{
|
|
2340
2487
|
className: timeInputClassName,
|
|
@@ -2350,13 +2497,13 @@ var AdsDateTimePicker = React23.forwardRef(
|
|
|
2350
2497
|
AdsDateTimePicker.displayName = "AdsDateTimePicker";
|
|
2351
2498
|
|
|
2352
2499
|
// src/components/AdsButtonGroup/index.tsx
|
|
2353
|
-
var
|
|
2500
|
+
var React25 = __toESM(require("react"), 1);
|
|
2354
2501
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
2355
2502
|
|
|
2356
2503
|
// src/primitives/button-group.tsx
|
|
2357
2504
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
2358
2505
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2359
|
-
var
|
|
2506
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2360
2507
|
var buttonGroupVariants = (0, import_class_variance_authority8.cva)(
|
|
2361
2508
|
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
2362
2509
|
{
|
|
@@ -2376,7 +2523,7 @@ function ButtonGroupSeparator({
|
|
|
2376
2523
|
orientation = "vertical",
|
|
2377
2524
|
...props
|
|
2378
2525
|
}) {
|
|
2379
|
-
return /* @__PURE__ */ (0,
|
|
2526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2380
2527
|
Separator,
|
|
2381
2528
|
{
|
|
2382
2529
|
"data-slot": "button-group-separator",
|
|
@@ -2395,7 +2542,7 @@ function ButtonGroupSeparator({
|
|
|
2395
2542
|
}
|
|
2396
2543
|
|
|
2397
2544
|
// src/components/AdsButtonGroup/index.tsx
|
|
2398
|
-
var
|
|
2545
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2399
2546
|
var buttonGroupPressClassName = "[&_button]:transition-[background-color,box-shadow,filter] [&_button]:active:translate-y-0 [&_button]:active:brightness-95";
|
|
2400
2547
|
var segmentSizeClassName = {
|
|
2401
2548
|
sm: "h-8 px-md text-sm",
|
|
@@ -2403,14 +2550,14 @@ var segmentSizeClassName = {
|
|
|
2403
2550
|
lg: "h-10 px-xl text-base"
|
|
2404
2551
|
};
|
|
2405
2552
|
function isAdsButtonElement(child) {
|
|
2406
|
-
return
|
|
2553
|
+
return React25.isValidElement(child) && child.type === AdsButton;
|
|
2407
2554
|
}
|
|
2408
2555
|
function enhanceChildren(children, attached, size, surface) {
|
|
2409
|
-
return
|
|
2556
|
+
return React25.Children.map(children, (child) => {
|
|
2410
2557
|
if (!isAdsButtonElement(child)) {
|
|
2411
2558
|
return child;
|
|
2412
2559
|
}
|
|
2413
|
-
return
|
|
2560
|
+
return React25.cloneElement(child, {
|
|
2414
2561
|
className: cn(
|
|
2415
2562
|
attached && "rounded-none shadow-none",
|
|
2416
2563
|
attached && surface === "secondary" && "bg-secondary hover:bg-secondary/90",
|
|
@@ -2420,7 +2567,7 @@ function enhanceChildren(children, attached, size, surface) {
|
|
|
2420
2567
|
});
|
|
2421
2568
|
});
|
|
2422
2569
|
}
|
|
2423
|
-
var AdsButtonGroup =
|
|
2570
|
+
var AdsButtonGroup = React25.forwardRef(
|
|
2424
2571
|
({
|
|
2425
2572
|
attached = true,
|
|
2426
2573
|
children,
|
|
@@ -2439,7 +2586,7 @@ var AdsButtonGroup = React24.forwardRef(
|
|
|
2439
2586
|
buttonGroupVariants({ orientation }),
|
|
2440
2587
|
surface === "pill" ? "rounded-full" : "rounded-radius-md"
|
|
2441
2588
|
);
|
|
2442
|
-
return /* @__PURE__ */ (0,
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2443
2590
|
"div",
|
|
2444
2591
|
{
|
|
2445
2592
|
"aria-orientation": orientation,
|
|
@@ -2481,7 +2628,7 @@ var inputSizeClassName = {
|
|
|
2481
2628
|
md: "h-9 text-sm leading-5",
|
|
2482
2629
|
lg: "h-10 text-base leading-6"
|
|
2483
2630
|
};
|
|
2484
|
-
var AdsButtonGroupText =
|
|
2631
|
+
var AdsButtonGroupText = React25.forwardRef(
|
|
2485
2632
|
({
|
|
2486
2633
|
align = "start",
|
|
2487
2634
|
asChild = false,
|
|
@@ -2492,7 +2639,7 @@ var AdsButtonGroupText = React24.forwardRef(
|
|
|
2492
2639
|
...props
|
|
2493
2640
|
}, ref) => {
|
|
2494
2641
|
const Comp = asChild ? import_react_slot4.Slot : "div";
|
|
2495
|
-
return /* @__PURE__ */ (0,
|
|
2642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2496
2643
|
Comp,
|
|
2497
2644
|
{
|
|
2498
2645
|
className: cn(
|
|
@@ -2512,7 +2659,7 @@ var AdsButtonGroupText = React24.forwardRef(
|
|
|
2512
2659
|
}
|
|
2513
2660
|
);
|
|
2514
2661
|
AdsButtonGroupText.displayName = "AdsButtonGroupText";
|
|
2515
|
-
var AdsButtonGroupInput =
|
|
2662
|
+
var AdsButtonGroupInput = React25.forwardRef(({ className, size = "md", type = "text", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2516
2663
|
Input,
|
|
2517
2664
|
{
|
|
2518
2665
|
className: cn(
|
|
@@ -2529,13 +2676,13 @@ AdsButtonGroupInput.displayName = "AdsButtonGroupInput";
|
|
|
2529
2676
|
var AdsButtonGroupSeparator = ButtonGroupSeparator;
|
|
2530
2677
|
|
|
2531
2678
|
// src/components/AdsSeparator/index.tsx
|
|
2532
|
-
var
|
|
2533
|
-
var
|
|
2679
|
+
var React26 = __toESM(require("react"), 1);
|
|
2680
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2534
2681
|
var toneClassName2 = {
|
|
2535
2682
|
default: "bg-border",
|
|
2536
2683
|
muted: "bg-border-muted"
|
|
2537
2684
|
};
|
|
2538
|
-
var AdsSeparator =
|
|
2685
|
+
var AdsSeparator = React26.forwardRef(({ className, orientation = "horizontal", tone = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2539
2686
|
Separator,
|
|
2540
2687
|
{
|
|
2541
2688
|
className: cn(
|
|
@@ -2552,13 +2699,13 @@ var AdsSeparator = React25.forwardRef(({ className, orientation = "horizontal",
|
|
|
2552
2699
|
AdsSeparator.displayName = "AdsSeparator";
|
|
2553
2700
|
|
|
2554
2701
|
// src/components/AdsSkeleton/index.tsx
|
|
2555
|
-
var
|
|
2702
|
+
var React28 = __toESM(require("react"), 1);
|
|
2556
2703
|
|
|
2557
2704
|
// src/primitives/skeleton.tsx
|
|
2558
|
-
var
|
|
2559
|
-
var
|
|
2560
|
-
var Skeleton =
|
|
2561
|
-
({ animated = true, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2705
|
+
var React27 = __toESM(require("react"), 1);
|
|
2706
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2707
|
+
var Skeleton = React27.forwardRef(
|
|
2708
|
+
({ animated = true, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2562
2709
|
"div",
|
|
2563
2710
|
{
|
|
2564
2711
|
className: cn(
|
|
@@ -2574,7 +2721,7 @@ var Skeleton = React26.forwardRef(
|
|
|
2574
2721
|
Skeleton.displayName = "Skeleton";
|
|
2575
2722
|
|
|
2576
2723
|
// src/components/AdsSkeleton/index.tsx
|
|
2577
|
-
var
|
|
2724
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2578
2725
|
var shapeClassName = {
|
|
2579
2726
|
default: "rounded-radius-md",
|
|
2580
2727
|
line: "h-4 w-full rounded-full",
|
|
@@ -2584,8 +2731,8 @@ var toneClassName3 = {
|
|
|
2584
2731
|
default: "bg-secondary",
|
|
2585
2732
|
muted: "bg-accent"
|
|
2586
2733
|
};
|
|
2587
|
-
var AdsSkeleton =
|
|
2588
|
-
({ className, shape = "default", tone = "default", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2734
|
+
var AdsSkeleton = React28.forwardRef(
|
|
2735
|
+
({ className, shape = "default", tone = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2589
2736
|
Skeleton,
|
|
2590
2737
|
{
|
|
2591
2738
|
className: cn(shapeClassName[shape], toneClassName3[tone], className),
|
|
@@ -2597,28 +2744,28 @@ var AdsSkeleton = React27.forwardRef(
|
|
|
2597
2744
|
AdsSkeleton.displayName = "AdsSkeleton";
|
|
2598
2745
|
|
|
2599
2746
|
// src/components/AdsInput/index.tsx
|
|
2600
|
-
var
|
|
2747
|
+
var React30 = __toESM(require("react"), 1);
|
|
2601
2748
|
var import_lucide_react10 = require("lucide-react");
|
|
2602
2749
|
|
|
2603
2750
|
// src/lib/adsClearButton.tsx
|
|
2604
|
-
var
|
|
2751
|
+
var React29 = __toESM(require("react"), 1);
|
|
2605
2752
|
var import_lucide_react9 = require("lucide-react");
|
|
2606
|
-
var
|
|
2753
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2607
2754
|
var adsClearButtonClassName = "inline-flex min-w-0 shrink-0 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-icon-muted shadow-none transition-colors hover:bg-transparent hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50";
|
|
2608
|
-
var AdsClearButton =
|
|
2755
|
+
var AdsClearButton = React29.forwardRef(({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2609
2756
|
"button",
|
|
2610
2757
|
{
|
|
2611
2758
|
...props,
|
|
2612
2759
|
className: cn(adsClearButtonClassName, "h-4 w-4", className),
|
|
2613
2760
|
ref,
|
|
2614
2761
|
type,
|
|
2615
|
-
children: /* @__PURE__ */ (0,
|
|
2762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react9.X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
2616
2763
|
}
|
|
2617
2764
|
));
|
|
2618
2765
|
AdsClearButton.displayName = "AdsClearButton";
|
|
2619
2766
|
|
|
2620
2767
|
// src/components/AdsInput/index.tsx
|
|
2621
|
-
var
|
|
2768
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2622
2769
|
var inputBaseClassName = "flex w-full rounded-md border border-border bg-card px-3 py-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-[var(--card-foreground)] placeholder:text-[var(--muted-foreground)] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm";
|
|
2623
2770
|
var inputSizeClasses = {
|
|
2624
2771
|
sm: "h-8 text-sm leading-5",
|
|
@@ -2652,8 +2799,8 @@ function renderFileTriggerIcon(icon) {
|
|
|
2652
2799
|
if (!icon) {
|
|
2653
2800
|
return null;
|
|
2654
2801
|
}
|
|
2655
|
-
if (
|
|
2656
|
-
return
|
|
2802
|
+
if (React30.isValidElement(icon)) {
|
|
2803
|
+
return React30.cloneElement(icon, {
|
|
2657
2804
|
className: cn("!h-4 !w-4 h-4 w-4", icon.props.className)
|
|
2658
2805
|
});
|
|
2659
2806
|
}
|
|
@@ -2676,7 +2823,7 @@ function getInputSurfaceClassName({
|
|
|
2676
2823
|
className
|
|
2677
2824
|
);
|
|
2678
2825
|
}
|
|
2679
|
-
var AdsInput =
|
|
2826
|
+
var AdsInput = React30.forwardRef(
|
|
2680
2827
|
({
|
|
2681
2828
|
action,
|
|
2682
2829
|
className,
|
|
@@ -2685,7 +2832,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2685
2832
|
descriptionPlacement = "below",
|
|
2686
2833
|
emptyFileLabel,
|
|
2687
2834
|
errorText,
|
|
2688
|
-
fileTriggerIcon = /* @__PURE__ */ (0,
|
|
2835
|
+
fileTriggerIcon = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react10.Upload, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
2689
2836
|
fileTriggerLabel,
|
|
2690
2837
|
helperText,
|
|
2691
2838
|
id,
|
|
@@ -2699,9 +2846,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2699
2846
|
...props
|
|
2700
2847
|
}, ref) => {
|
|
2701
2848
|
const { messages } = useAdsI18n();
|
|
2702
|
-
const inputRef =
|
|
2703
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2704
|
-
const [currentValue, setCurrentValue] =
|
|
2849
|
+
const inputRef = React30.useRef(null);
|
|
2850
|
+
const [selectedFiles, setSelectedFiles] = React30.useState([]);
|
|
2851
|
+
const [currentValue, setCurrentValue] = React30.useState(
|
|
2705
2852
|
() => getTextInputValue(props.value ?? props.defaultValue)
|
|
2706
2853
|
);
|
|
2707
2854
|
const description = useAdsFieldDescription({
|
|
@@ -2710,7 +2857,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2710
2857
|
helperText,
|
|
2711
2858
|
id
|
|
2712
2859
|
});
|
|
2713
|
-
|
|
2860
|
+
React30.useEffect(() => {
|
|
2714
2861
|
if (props.value !== void 0) {
|
|
2715
2862
|
setCurrentValue(getTextInputValue(props.value));
|
|
2716
2863
|
}
|
|
@@ -2728,7 +2875,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2728
2875
|
const resolvedFileTriggerLabel = fileTriggerLabel ?? messages.input.chooseFile;
|
|
2729
2876
|
const resolvedFileTriggerIcon = renderFileTriggerIcon(fileTriggerIcon);
|
|
2730
2877
|
const resolvedEmptyFileLabel = emptyFileLabel ?? messages.input.noFileChosen;
|
|
2731
|
-
const handleChange =
|
|
2878
|
+
const handleChange = React30.useCallback(
|
|
2732
2879
|
(event) => {
|
|
2733
2880
|
setCurrentValue(event.target.value);
|
|
2734
2881
|
if (isFileInput) {
|
|
@@ -2740,7 +2887,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2740
2887
|
},
|
|
2741
2888
|
[isFileInput, onChange]
|
|
2742
2889
|
);
|
|
2743
|
-
const handleClear =
|
|
2890
|
+
const handleClear = React30.useCallback(() => {
|
|
2744
2891
|
const element = inputRef.current;
|
|
2745
2892
|
if (!element) {
|
|
2746
2893
|
return;
|
|
@@ -2755,10 +2902,10 @@ var AdsInput = React29.forwardRef(
|
|
|
2755
2902
|
onClear?.();
|
|
2756
2903
|
}, [onClear]);
|
|
2757
2904
|
const fileNameText = selectedFiles.length > 0 ? selectedFiles.join(", ") : resolvedEmptyFileLabel;
|
|
2758
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
2759
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
2760
|
-
const inputNode = isFileInput ? /* @__PURE__ */ (0,
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
2905
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
2906
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
2907
|
+
const inputNode = isFileInput ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "group relative flex w-full min-w-0 flex-1 items-center focus-within:[&_[data-ads-file-trigger]]:ring-2 focus-within:[&_[data-ads-file-trigger]]:ring-ring focus-within:[&_[data-ads-file-trigger]]:ring-offset-2 focus-within:[&_[data-ads-file-trigger]]:ring-offset-background", children: [
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2762
2909
|
Input,
|
|
2763
2910
|
{
|
|
2764
2911
|
"aria-describedby": description.describedBy,
|
|
@@ -2778,7 +2925,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2778
2925
|
...props
|
|
2779
2926
|
}
|
|
2780
2927
|
),
|
|
2781
|
-
/* @__PURE__ */ (0,
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2782
2929
|
"div",
|
|
2783
2930
|
{
|
|
2784
2931
|
"aria-hidden": "true",
|
|
@@ -2787,7 +2934,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2787
2934
|
props.disabled ? "cursor-not-allowed opacity-50" : void 0
|
|
2788
2935
|
),
|
|
2789
2936
|
children: [
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2791
2938
|
"span",
|
|
2792
2939
|
{
|
|
2793
2940
|
"data-ads-file-trigger": "",
|
|
@@ -2797,12 +2944,12 @@ var AdsInput = React29.forwardRef(
|
|
|
2797
2944
|
adsTextColorClassName.primary
|
|
2798
2945
|
),
|
|
2799
2946
|
children: [
|
|
2800
|
-
resolvedFileTriggerIcon ? /* @__PURE__ */ (0,
|
|
2947
|
+
resolvedFileTriggerIcon ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center [&>svg]:!h-4 [&>svg]:!w-4", children: resolvedFileTriggerIcon }) : null,
|
|
2801
2948
|
resolvedFileTriggerLabel
|
|
2802
2949
|
]
|
|
2803
2950
|
}
|
|
2804
2951
|
),
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2952
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2806
2953
|
"span",
|
|
2807
2954
|
{
|
|
2808
2955
|
className: cn(
|
|
@@ -2815,9 +2962,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2815
2962
|
]
|
|
2816
2963
|
}
|
|
2817
2964
|
)
|
|
2818
|
-
] }) : /* @__PURE__ */ (0,
|
|
2819
|
-
prefix ? /* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2965
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2966
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pointer-events-none absolute left-md inline-flex text-icon-muted", children: prefix }) : null,
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2821
2968
|
Input,
|
|
2822
2969
|
{
|
|
2823
2970
|
"aria-describedby": description.describedBy,
|
|
@@ -2833,9 +2980,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2833
2980
|
...props
|
|
2834
2981
|
}
|
|
2835
2982
|
),
|
|
2836
|
-
canClear || suffix ? /* @__PURE__ */ (0,
|
|
2837
|
-
suffix ? /* @__PURE__ */ (0,
|
|
2838
|
-
canClear ? /* @__PURE__ */ (0,
|
|
2983
|
+
canClear || suffix ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "absolute right-md inline-flex items-center gap-xs text-icon-muted", children: [
|
|
2984
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "inline-flex items-center", children: suffix }) : null,
|
|
2985
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2839
2986
|
AdsClearButton,
|
|
2840
2987
|
{
|
|
2841
2988
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -2844,12 +2991,12 @@ var AdsInput = React29.forwardRef(
|
|
|
2844
2991
|
) : null
|
|
2845
2992
|
] }) : null
|
|
2846
2993
|
] });
|
|
2847
|
-
return /* @__PURE__ */ (0,
|
|
2848
|
-
label ? /* @__PURE__ */ (0,
|
|
2994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(AdsFieldItem, { children: [
|
|
2995
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
2849
2996
|
descriptionPlacement === "above" ? helperNode : null,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex w-full items-center gap-sm", children: [
|
|
2851
2998
|
inputNode,
|
|
2852
|
-
action ? /* @__PURE__ */ (0,
|
|
2999
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
2853
3000
|
] }),
|
|
2854
3001
|
descriptionPlacement === "below" ? helperNode : null,
|
|
2855
3002
|
errorNode
|
|
@@ -2859,13 +3006,13 @@ var AdsInput = React29.forwardRef(
|
|
|
2859
3006
|
AdsInput.displayName = "AdsInput";
|
|
2860
3007
|
|
|
2861
3008
|
// src/components/AdsInputGroup/index.tsx
|
|
2862
|
-
var
|
|
3009
|
+
var React32 = __toESM(require("react"), 1);
|
|
2863
3010
|
|
|
2864
3011
|
// src/primitives/textarea.tsx
|
|
2865
|
-
var
|
|
2866
|
-
var
|
|
2867
|
-
var Textarea =
|
|
2868
|
-
return /* @__PURE__ */ (0,
|
|
3012
|
+
var React31 = __toESM(require("react"), 1);
|
|
3013
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3014
|
+
var Textarea = React31.forwardRef(({ className, ...props }, ref) => {
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2869
3016
|
"textarea",
|
|
2870
3017
|
{
|
|
2871
3018
|
className: cn(
|
|
@@ -2880,7 +3027,7 @@ var Textarea = React30.forwardRef(({ className, ...props }, ref) => {
|
|
|
2880
3027
|
Textarea.displayName = "Textarea";
|
|
2881
3028
|
|
|
2882
3029
|
// src/components/AdsInputGroup/index.tsx
|
|
2883
|
-
var
|
|
3030
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2884
3031
|
function useAdsInputGroupDescription(describedBy, helperText, errorText, idBase) {
|
|
2885
3032
|
const helperId = helperText ? `${idBase}-helper` : void 0;
|
|
2886
3033
|
const errorId = errorText ? `${idBase}-error` : void 0;
|
|
@@ -2899,11 +3046,11 @@ function AdsInputGroupChrome({
|
|
|
2899
3046
|
helperText,
|
|
2900
3047
|
label
|
|
2901
3048
|
}) {
|
|
2902
|
-
return /* @__PURE__ */ (0,
|
|
2903
|
-
label ? /* @__PURE__ */ (0,
|
|
3049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex w-full flex-col gap-md", children: [
|
|
3050
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }) : null,
|
|
2904
3051
|
children,
|
|
2905
|
-
helperText ? /* @__PURE__ */ (0,
|
|
2906
|
-
errorText ? /* @__PURE__ */ (0,
|
|
3052
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
3053
|
+
errorText ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
2907
3054
|
] });
|
|
2908
3055
|
}
|
|
2909
3056
|
var addonBaseClassName = "flex shrink-0 items-center self-stretch bg-secondary px-lg text-sm leading-5 text-foreground";
|
|
@@ -2942,21 +3089,21 @@ function AdsInputGroup({
|
|
|
2942
3089
|
trailingAddon,
|
|
2943
3090
|
trailingAddonClassName
|
|
2944
3091
|
}) {
|
|
2945
|
-
const generatedId =
|
|
3092
|
+
const generatedId = React32.useId();
|
|
2946
3093
|
const description = useAdsInputGroupDescription(
|
|
2947
3094
|
void 0,
|
|
2948
3095
|
helperText,
|
|
2949
3096
|
errorText,
|
|
2950
3097
|
id ?? generatedId
|
|
2951
3098
|
);
|
|
2952
|
-
return /* @__PURE__ */ (0,
|
|
3099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2953
3100
|
AdsInputGroupChrome,
|
|
2954
3101
|
{
|
|
2955
3102
|
errorText,
|
|
2956
3103
|
helperText,
|
|
2957
3104
|
label,
|
|
2958
3105
|
...description,
|
|
2959
|
-
children: /* @__PURE__ */ (0,
|
|
3106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2960
3107
|
"div",
|
|
2961
3108
|
{
|
|
2962
3109
|
className: cn(
|
|
@@ -2966,9 +3113,9 @@ function AdsInputGroup({
|
|
|
2966
3113
|
surfaceClassName
|
|
2967
3114
|
),
|
|
2968
3115
|
children: [
|
|
2969
|
-
header ? /* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
leadingAddon ? /* @__PURE__ */ (0,
|
|
3116
|
+
header ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "border-b border-border px-md py-md text-sm text-foreground", children: header }) : null,
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-h-11 w-full items-stretch", children: [
|
|
3118
|
+
leadingAddon ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2972
3119
|
"div",
|
|
2973
3120
|
{
|
|
2974
3121
|
className: cn(
|
|
@@ -2979,7 +3126,7 @@ function AdsInputGroup({
|
|
|
2979
3126
|
children: leadingAddon
|
|
2980
3127
|
}
|
|
2981
3128
|
) : null,
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
3129
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2983
3130
|
"div",
|
|
2984
3131
|
{
|
|
2985
3132
|
className: cn(
|
|
@@ -2989,7 +3136,7 @@ function AdsInputGroup({
|
|
|
2989
3136
|
children
|
|
2990
3137
|
}
|
|
2991
3138
|
),
|
|
2992
|
-
trailingAddon ? /* @__PURE__ */ (0,
|
|
3139
|
+
trailingAddon ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2993
3140
|
"div",
|
|
2994
3141
|
{
|
|
2995
3142
|
className: cn(
|
|
@@ -3001,33 +3148,33 @@ function AdsInputGroup({
|
|
|
3001
3148
|
}
|
|
3002
3149
|
) : null
|
|
3003
3150
|
] }),
|
|
3004
|
-
footer ? /* @__PURE__ */ (0,
|
|
3151
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "border-t border-border px-md py-sm text-sm text-muted-foreground", children: footer }) : null
|
|
3005
3152
|
]
|
|
3006
3153
|
}
|
|
3007
3154
|
) })
|
|
3008
3155
|
}
|
|
3009
3156
|
);
|
|
3010
3157
|
}
|
|
3011
|
-
var AdsInputGroupInput =
|
|
3158
|
+
var AdsInputGroupInput = React32.forwardRef(({ className, clearable = false, clearButtonLabel, onChange, onClear, ...props }, ref) => {
|
|
3012
3159
|
const { messages } = useAdsI18n();
|
|
3013
|
-
const inputRef =
|
|
3014
|
-
const [currentValue, setCurrentValue] =
|
|
3160
|
+
const inputRef = React32.useRef(null);
|
|
3161
|
+
const [currentValue, setCurrentValue] = React32.useState(
|
|
3015
3162
|
() => getInputGroupValue(props.value ?? props.defaultValue)
|
|
3016
3163
|
);
|
|
3017
|
-
|
|
3164
|
+
React32.useEffect(() => {
|
|
3018
3165
|
if (props.value !== void 0) {
|
|
3019
3166
|
setCurrentValue(getInputGroupValue(props.value));
|
|
3020
3167
|
}
|
|
3021
3168
|
}, [props.value]);
|
|
3022
3169
|
const canClear = clearable && !props.disabled && !props.readOnly && currentValue.length > 0;
|
|
3023
|
-
const handleChange =
|
|
3170
|
+
const handleChange = React32.useCallback(
|
|
3024
3171
|
(event) => {
|
|
3025
3172
|
setCurrentValue(event.target.value);
|
|
3026
3173
|
onChange?.(event);
|
|
3027
3174
|
},
|
|
3028
3175
|
[onChange]
|
|
3029
3176
|
);
|
|
3030
|
-
const handleClear =
|
|
3177
|
+
const handleClear = React32.useCallback(() => {
|
|
3031
3178
|
const element = inputRef.current;
|
|
3032
3179
|
if (!element) {
|
|
3033
3180
|
return;
|
|
@@ -3041,8 +3188,8 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3041
3188
|
element.focus();
|
|
3042
3189
|
onClear?.();
|
|
3043
3190
|
}, [onClear]);
|
|
3044
|
-
return /* @__PURE__ */ (0,
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3046
3193
|
Input,
|
|
3047
3194
|
{
|
|
3048
3195
|
className: cn(
|
|
@@ -3059,7 +3206,7 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3059
3206
|
...props
|
|
3060
3207
|
}
|
|
3061
3208
|
),
|
|
3062
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3209
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3063
3210
|
AdsClearButton,
|
|
3064
3211
|
{
|
|
3065
3212
|
"aria-label": clearButtonLabel ?? messages.input.clear,
|
|
@@ -3070,7 +3217,7 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3070
3217
|
] });
|
|
3071
3218
|
});
|
|
3072
3219
|
AdsInputGroupInput.displayName = "AdsInputGroupInput";
|
|
3073
|
-
var AdsInputGroupTextarea =
|
|
3220
|
+
var AdsInputGroupTextarea = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3074
3221
|
Textarea,
|
|
3075
3222
|
{
|
|
3076
3223
|
className: cn(
|
|
@@ -3085,14 +3232,14 @@ var AdsInputGroupTextarea = React31.forwardRef(({ className, ...props }, ref) =>
|
|
|
3085
3232
|
AdsInputGroupTextarea.displayName = "AdsInputGroupTextarea";
|
|
3086
3233
|
|
|
3087
3234
|
// src/components/AdsInputOTP/index.tsx
|
|
3088
|
-
var
|
|
3235
|
+
var React34 = __toESM(require("react"), 1);
|
|
3089
3236
|
|
|
3090
3237
|
// src/primitives/input-otp.tsx
|
|
3091
|
-
var
|
|
3238
|
+
var React33 = __toESM(require("react"), 1);
|
|
3092
3239
|
var import_input_otp = require("input-otp");
|
|
3093
3240
|
var import_lucide_react11 = require("lucide-react");
|
|
3094
|
-
var
|
|
3095
|
-
var InputOTP =
|
|
3241
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3242
|
+
var InputOTP = React33.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3096
3243
|
import_input_otp.OTPInput,
|
|
3097
3244
|
{
|
|
3098
3245
|
ref,
|
|
@@ -3105,12 +3252,12 @@ var InputOTP = React32.forwardRef(({ className, containerClassName, ...props },
|
|
|
3105
3252
|
}
|
|
3106
3253
|
));
|
|
3107
3254
|
InputOTP.displayName = "InputOTP";
|
|
3108
|
-
var InputOTPGroup =
|
|
3255
|
+
var InputOTPGroup = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
3109
3256
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
3110
|
-
var InputOTPSlot =
|
|
3111
|
-
const inputOTPContext =
|
|
3257
|
+
var InputOTPSlot = React33.forwardRef(({ index, className, ...props }, ref) => {
|
|
3258
|
+
const inputOTPContext = React33.useContext(import_input_otp.OTPInputContext);
|
|
3112
3259
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
3113
|
-
return /* @__PURE__ */ (0,
|
|
3260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3114
3261
|
"div",
|
|
3115
3262
|
{
|
|
3116
3263
|
ref,
|
|
@@ -3122,19 +3269,19 @@ var InputOTPSlot = React32.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
3122
3269
|
...props,
|
|
3123
3270
|
children: [
|
|
3124
3271
|
char,
|
|
3125
|
-
hasFakeCaret && /* @__PURE__ */ (0,
|
|
3272
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
3126
3273
|
]
|
|
3127
3274
|
}
|
|
3128
3275
|
);
|
|
3129
3276
|
});
|
|
3130
3277
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
3131
|
-
var InputOTPSeparator =
|
|
3278
|
+
var InputOTPSeparator = React33.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react11.Dot, {}) }));
|
|
3132
3279
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3133
3280
|
|
|
3134
3281
|
// src/components/AdsInputOTP/index.tsx
|
|
3135
|
-
var
|
|
3282
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3136
3283
|
function useFieldDescription(id, describedBy, helperText, errorText) {
|
|
3137
|
-
const generatedId =
|
|
3284
|
+
const generatedId = React34.useId();
|
|
3138
3285
|
const inputId = id ?? generatedId;
|
|
3139
3286
|
const helperId = helperText ? `${inputId}-helper` : void 0;
|
|
3140
3287
|
const errorId = errorText ? `${inputId}-error` : void 0;
|
|
@@ -3155,21 +3302,21 @@ function AdsInputOTPChrome({
|
|
|
3155
3302
|
inputId,
|
|
3156
3303
|
label
|
|
3157
3304
|
}) {
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3159
|
-
label ? /* @__PURE__ */ (0,
|
|
3305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex w-full flex-col gap-md", children: [
|
|
3306
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("label", { className: "text-sm font-medium leading-5 text-foreground", htmlFor: inputId, children: label }) : null,
|
|
3160
3307
|
children,
|
|
3161
|
-
helperText ? /* @__PURE__ */ (0,
|
|
3162
|
-
errorText ? /* @__PURE__ */ (0,
|
|
3308
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
3309
|
+
errorText ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
3163
3310
|
] });
|
|
3164
3311
|
}
|
|
3165
3312
|
function buildSeparator(node, key) {
|
|
3166
3313
|
if (node === void 0) {
|
|
3167
|
-
return /* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AdsInputOTPSeparator, {}, key);
|
|
3168
3315
|
}
|
|
3169
|
-
if (
|
|
3170
|
-
return
|
|
3316
|
+
if (React34.isValidElement(node)) {
|
|
3317
|
+
return React34.cloneElement(node, { key });
|
|
3171
3318
|
}
|
|
3172
|
-
return /* @__PURE__ */ (0,
|
|
3319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: node }, key);
|
|
3173
3320
|
}
|
|
3174
3321
|
function buildOtpChildren(groups, separator) {
|
|
3175
3322
|
const defaultGroup = groups.length > 0 ? groups : [6];
|
|
@@ -3177,7 +3324,7 @@ function buildOtpChildren(groups, separator) {
|
|
|
3177
3324
|
let index = 0;
|
|
3178
3325
|
defaultGroup.forEach((size, indexOfGroup) => {
|
|
3179
3326
|
items.push(
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AdsInputOTPGroup, { children: Array.from({ length: size }, (_, slotOffset) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3181
3328
|
AdsInputOTPSlot,
|
|
3182
3329
|
{
|
|
3183
3330
|
index: index + slotOffset
|
|
@@ -3192,11 +3339,11 @@ function buildOtpChildren(groups, separator) {
|
|
|
3192
3339
|
});
|
|
3193
3340
|
return items;
|
|
3194
3341
|
}
|
|
3195
|
-
var AdsInputOTP =
|
|
3342
|
+
var AdsInputOTP = React34.forwardRef(({ action, errorText, groups, helperText, label, separator, children, id, ...props }, ref) => {
|
|
3196
3343
|
const totalSlots = groups && groups.length > 0 ? groups.reduce((sum, value) => sum + value, 0) : 6;
|
|
3197
3344
|
const description = useFieldDescription(id, props["aria-describedby"], helperText, errorText);
|
|
3198
3345
|
const otpChildren = children ?? buildOtpChildren(groups ?? [], separator);
|
|
3199
|
-
return /* @__PURE__ */ (0,
|
|
3346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3200
3347
|
AdsInputOTPChrome,
|
|
3201
3348
|
{
|
|
3202
3349
|
errorText,
|
|
@@ -3205,8 +3352,8 @@ var AdsInputOTP = React33.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3205
3352
|
helperId: description.helperId,
|
|
3206
3353
|
inputId: description.inputId,
|
|
3207
3354
|
label,
|
|
3208
|
-
children: /* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex w-full items-center gap-sm", children: [
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3210
3357
|
InputOTP,
|
|
3211
3358
|
{
|
|
3212
3359
|
"aria-describedby": description.describedBy,
|
|
@@ -3218,15 +3365,15 @@ var AdsInputOTP = React33.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3218
3365
|
children: otpChildren
|
|
3219
3366
|
}
|
|
3220
3367
|
),
|
|
3221
|
-
action ? /* @__PURE__ */ (0,
|
|
3368
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "shrink-0", children: action }) : null
|
|
3222
3369
|
] })
|
|
3223
3370
|
}
|
|
3224
3371
|
);
|
|
3225
3372
|
});
|
|
3226
3373
|
AdsInputOTP.displayName = "AdsInputOTP";
|
|
3227
|
-
var AdsInputOTPGroup =
|
|
3374
|
+
var AdsInputOTPGroup = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(InputOTPGroup, { className, ref, ...props }));
|
|
3228
3375
|
AdsInputOTPGroup.displayName = "AdsInputOTPGroup";
|
|
3229
|
-
var AdsInputOTPSeparator =
|
|
3376
|
+
var AdsInputOTPSeparator = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3230
3377
|
InputOTPSeparator,
|
|
3231
3378
|
{
|
|
3232
3379
|
className: className ?? "h-px w-6 shrink-0 bg-border text-transparent [&_svg]:hidden",
|
|
@@ -3235,7 +3382,7 @@ var AdsInputOTPSeparator = React33.forwardRef(({ className, ...props }, ref) =>
|
|
|
3235
3382
|
}
|
|
3236
3383
|
));
|
|
3237
3384
|
AdsInputOTPSeparator.displayName = "AdsInputOTPSeparator";
|
|
3238
|
-
var AdsInputOTPSlot =
|
|
3385
|
+
var AdsInputOTPSlot = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3239
3386
|
InputOTPSlot,
|
|
3240
3387
|
{
|
|
3241
3388
|
className: [
|
|
@@ -3252,17 +3399,17 @@ var AdsInputOTPSlot = React33.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3252
3399
|
AdsInputOTPSlot.displayName = "AdsInputOTPSlot";
|
|
3253
3400
|
|
|
3254
3401
|
// src/components/AdsDataPagination/index.tsx
|
|
3255
|
-
var
|
|
3402
|
+
var React38 = __toESM(require("react"), 1);
|
|
3256
3403
|
|
|
3257
3404
|
// src/components/AdsPagination/index.tsx
|
|
3258
|
-
var
|
|
3405
|
+
var React36 = __toESM(require("react"), 1);
|
|
3259
3406
|
var import_lucide_react13 = require("lucide-react");
|
|
3260
3407
|
|
|
3261
3408
|
// src/primitives/pagination.tsx
|
|
3262
|
-
var
|
|
3409
|
+
var React35 = __toESM(require("react"), 1);
|
|
3263
3410
|
var import_lucide_react12 = require("lucide-react");
|
|
3264
|
-
var
|
|
3265
|
-
var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
3411
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3412
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3266
3413
|
"nav",
|
|
3267
3414
|
{
|
|
3268
3415
|
role: "navigation",
|
|
@@ -3272,7 +3419,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
3272
3419
|
}
|
|
3273
3420
|
);
|
|
3274
3421
|
Pagination.displayName = "Pagination";
|
|
3275
|
-
var PaginationContent =
|
|
3422
|
+
var PaginationContent = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3276
3423
|
"ul",
|
|
3277
3424
|
{
|
|
3278
3425
|
ref,
|
|
@@ -3281,14 +3428,14 @@ var PaginationContent = React34.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3281
3428
|
}
|
|
3282
3429
|
));
|
|
3283
3430
|
PaginationContent.displayName = "PaginationContent";
|
|
3284
|
-
var PaginationItem =
|
|
3431
|
+
var PaginationItem = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, className: cn("", className), ...props }));
|
|
3285
3432
|
PaginationItem.displayName = "PaginationItem";
|
|
3286
3433
|
var PaginationLink = ({
|
|
3287
3434
|
className,
|
|
3288
3435
|
isActive,
|
|
3289
3436
|
size = "icon",
|
|
3290
3437
|
...props
|
|
3291
|
-
}) => /* @__PURE__ */ (0,
|
|
3438
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3292
3439
|
"a",
|
|
3293
3440
|
{
|
|
3294
3441
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3306,7 +3453,7 @@ PaginationLink.displayName = "PaginationLink";
|
|
|
3306
3453
|
var PaginationPrevious = ({
|
|
3307
3454
|
className,
|
|
3308
3455
|
...props
|
|
3309
|
-
}) => /* @__PURE__ */ (0,
|
|
3456
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3310
3457
|
PaginationLink,
|
|
3311
3458
|
{
|
|
3312
3459
|
"aria-label": "Go to previous page",
|
|
@@ -3314,8 +3461,8 @@ var PaginationPrevious = ({
|
|
|
3314
3461
|
className: cn("gap-1 pl-2.5", className),
|
|
3315
3462
|
...props,
|
|
3316
3463
|
children: [
|
|
3317
|
-
/* @__PURE__ */ (0,
|
|
3318
|
-
/* @__PURE__ */ (0,
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.ChevronLeft, { className: "h-4 w-4" }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Previous" })
|
|
3319
3466
|
]
|
|
3320
3467
|
}
|
|
3321
3468
|
);
|
|
@@ -3323,7 +3470,7 @@ PaginationPrevious.displayName = "PaginationPrevious";
|
|
|
3323
3470
|
var PaginationNext = ({
|
|
3324
3471
|
className,
|
|
3325
3472
|
...props
|
|
3326
|
-
}) => /* @__PURE__ */ (0,
|
|
3473
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3327
3474
|
PaginationLink,
|
|
3328
3475
|
{
|
|
3329
3476
|
"aria-label": "Go to next page",
|
|
@@ -3331,8 +3478,8 @@ var PaginationNext = ({
|
|
|
3331
3478
|
className: cn("gap-1 pr-2.5", className),
|
|
3332
3479
|
...props,
|
|
3333
3480
|
children: [
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Next" }),
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.ChevronRight, { className: "h-4 w-4" })
|
|
3336
3483
|
]
|
|
3337
3484
|
}
|
|
3338
3485
|
);
|
|
@@ -3340,27 +3487,27 @@ PaginationNext.displayName = "PaginationNext";
|
|
|
3340
3487
|
var PaginationEllipsis = ({
|
|
3341
3488
|
className,
|
|
3342
3489
|
...props
|
|
3343
|
-
}) => /* @__PURE__ */ (0,
|
|
3490
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3344
3491
|
"span",
|
|
3345
3492
|
{
|
|
3346
3493
|
"aria-hidden": true,
|
|
3347
3494
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3348
3495
|
...props,
|
|
3349
3496
|
children: [
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3351
|
-
/* @__PURE__ */ (0,
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3498
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
3352
3499
|
]
|
|
3353
3500
|
}
|
|
3354
3501
|
);
|
|
3355
3502
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3356
3503
|
|
|
3357
3504
|
// src/components/AdsPagination/index.tsx
|
|
3358
|
-
var
|
|
3505
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3359
3506
|
var paginationLinkBaseClassName = "inline-flex h-9 min-w-9 items-center justify-center rounded-radius-md border text-sm font-medium leading-5 tracking-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
|
3360
3507
|
var paginationLinkInactiveClassName = "border-transparent bg-transparent px-[10px] text-foreground shadow-none hover:bg-accent hover:shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3361
3508
|
var paginationLinkActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3362
3509
|
function AdsPagination({ className, ...props }) {
|
|
3363
|
-
return /* @__PURE__ */ (0,
|
|
3510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3364
3511
|
Pagination,
|
|
3365
3512
|
{
|
|
3366
3513
|
className: cn("mx-0 w-auto justify-start", className),
|
|
@@ -3369,14 +3516,14 @@ function AdsPagination({ className, ...props }) {
|
|
|
3369
3516
|
);
|
|
3370
3517
|
}
|
|
3371
3518
|
AdsPagination.displayName = "AdsPagination";
|
|
3372
|
-
var AdsPaginationContent =
|
|
3519
|
+
var AdsPaginationContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginationContent, { ref, className: cn("gap-1", className), ...props }));
|
|
3373
3520
|
AdsPaginationContent.displayName = "AdsPaginationContent";
|
|
3374
|
-
var AdsPaginationItem =
|
|
3375
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3521
|
+
var AdsPaginationItem = React36.forwardRef(
|
|
3522
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginationItem, { ref, className, ...props })
|
|
3376
3523
|
);
|
|
3377
3524
|
AdsPaginationItem.displayName = "AdsPaginationItem";
|
|
3378
|
-
var AdsPaginationLink =
|
|
3379
|
-
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3525
|
+
var AdsPaginationLink = React36.forwardRef(
|
|
3526
|
+
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3380
3527
|
"a",
|
|
3381
3528
|
{
|
|
3382
3529
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3391,10 +3538,10 @@ var AdsPaginationLink = React35.forwardRef(
|
|
|
3391
3538
|
)
|
|
3392
3539
|
);
|
|
3393
3540
|
AdsPaginationLink.displayName = "AdsPaginationLink";
|
|
3394
|
-
var AdsPaginationPrevious =
|
|
3541
|
+
var AdsPaginationPrevious = React36.forwardRef(({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3395
3542
|
const { messages } = useAdsI18n();
|
|
3396
3543
|
const label = children ?? messages.pagination.previous;
|
|
3397
|
-
return /* @__PURE__ */ (0,
|
|
3544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3398
3545
|
AdsPaginationLink,
|
|
3399
3546
|
{
|
|
3400
3547
|
"aria-label": ariaLabel ?? messages.pagination.previous,
|
|
@@ -3402,18 +3549,18 @@ var AdsPaginationPrevious = React35.forwardRef(({ "aria-label": ariaLabel, child
|
|
|
3402
3549
|
ref,
|
|
3403
3550
|
...props,
|
|
3404
3551
|
children: [
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3406
|
-
/* @__PURE__ */ (0,
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react13.ChevronLeft, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: label })
|
|
3407
3554
|
]
|
|
3408
3555
|
}
|
|
3409
3556
|
);
|
|
3410
3557
|
});
|
|
3411
3558
|
AdsPaginationPrevious.displayName = "AdsPaginationPrevious";
|
|
3412
|
-
var AdsPaginationNext =
|
|
3559
|
+
var AdsPaginationNext = React36.forwardRef(
|
|
3413
3560
|
({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3414
3561
|
const { messages } = useAdsI18n();
|
|
3415
3562
|
const label = children ?? messages.pagination.next;
|
|
3416
|
-
return /* @__PURE__ */ (0,
|
|
3563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3417
3564
|
AdsPaginationLink,
|
|
3418
3565
|
{
|
|
3419
3566
|
"aria-label": ariaLabel ?? messages.pagination.next,
|
|
@@ -3421,8 +3568,8 @@ var AdsPaginationNext = React35.forwardRef(
|
|
|
3421
3568
|
ref,
|
|
3422
3569
|
...props,
|
|
3423
3570
|
children: [
|
|
3424
|
-
/* @__PURE__ */ (0,
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: label }),
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true, className: "h-4 w-4" })
|
|
3426
3573
|
]
|
|
3427
3574
|
}
|
|
3428
3575
|
);
|
|
@@ -3436,7 +3583,7 @@ function AdsPaginationEllipsis({
|
|
|
3436
3583
|
}) {
|
|
3437
3584
|
const { messages } = useAdsI18n();
|
|
3438
3585
|
const resolvedLabel = label ?? messages.pagination.morePages;
|
|
3439
|
-
return /* @__PURE__ */ (0,
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3440
3587
|
"span",
|
|
3441
3588
|
{
|
|
3442
3589
|
"aria-hidden": true,
|
|
@@ -3446,8 +3593,8 @@ function AdsPaginationEllipsis({
|
|
|
3446
3593
|
),
|
|
3447
3594
|
...props,
|
|
3448
3595
|
children: [
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
3596
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react13.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: resolvedLabel })
|
|
3451
3598
|
]
|
|
3452
3599
|
}
|
|
3453
3600
|
);
|
|
@@ -3455,8 +3602,8 @@ function AdsPaginationEllipsis({
|
|
|
3455
3602
|
AdsPaginationEllipsis.displayName = "AdsPaginationEllipsis";
|
|
3456
3603
|
|
|
3457
3604
|
// src/components/AdsSelect/index.tsx
|
|
3458
|
-
var
|
|
3459
|
-
var
|
|
3605
|
+
var React37 = __toESM(require("react"), 1);
|
|
3606
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3460
3607
|
var selectTriggerBaseClassName = "h-9 rounded-radius-md border border-border bg-card px-md py-2 text-sm leading-5 shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus:border-border-focus focus:ring-[3px] focus:ring-[rgba(161,161,161,0.5)] focus:ring-offset-0 data-[placeholder]:text-[var(--muted-foreground)]";
|
|
3461
3608
|
var selectContentBaseClassName = "rounded-radius-md border-border bg-popover text-popover-foreground shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
3462
3609
|
function AdsSelect({
|
|
@@ -3481,7 +3628,7 @@ function AdsSelect({
|
|
|
3481
3628
|
}) {
|
|
3482
3629
|
const { messages } = useAdsI18n();
|
|
3483
3630
|
const isControlled = value !== void 0;
|
|
3484
|
-
const [internalValue, setInternalValue] =
|
|
3631
|
+
const [internalValue, setInternalValue] = React37.useState(
|
|
3485
3632
|
defaultValue
|
|
3486
3633
|
);
|
|
3487
3634
|
const resolvedValue = isControlled ? value : internalValue;
|
|
@@ -3495,8 +3642,8 @@ function AdsSelect({
|
|
|
3495
3642
|
});
|
|
3496
3643
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.select.clear;
|
|
3497
3644
|
const resolvedEmptyText = emptyText ?? messages.select.noOptionsAvailable;
|
|
3498
|
-
const hasOptions =
|
|
3499
|
-
const handleValueChange =
|
|
3645
|
+
const hasOptions = React37.Children.toArray(children).length > 0;
|
|
3646
|
+
const handleValueChange = React37.useCallback(
|
|
3500
3647
|
(nextValue) => {
|
|
3501
3648
|
if (!isControlled) {
|
|
3502
3649
|
setInternalValue(nextValue);
|
|
@@ -3505,7 +3652,7 @@ function AdsSelect({
|
|
|
3505
3652
|
},
|
|
3506
3653
|
[isControlled, onValueChange]
|
|
3507
3654
|
);
|
|
3508
|
-
const handleClear =
|
|
3655
|
+
const handleClear = React37.useCallback(
|
|
3509
3656
|
(event) => {
|
|
3510
3657
|
event.preventDefault();
|
|
3511
3658
|
event.stopPropagation();
|
|
@@ -3517,12 +3664,12 @@ function AdsSelect({
|
|
|
3517
3664
|
},
|
|
3518
3665
|
[isControlled, onClear, onValueChange]
|
|
3519
3666
|
);
|
|
3520
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
3521
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
3522
|
-
return /* @__PURE__ */ (0,
|
|
3523
|
-
label ? /* @__PURE__ */ (0,
|
|
3667
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
3668
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
3669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(AdsFieldItem, { children: [
|
|
3670
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
3524
3671
|
descriptionPlacement === "above" ? helperNode : null,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3526
3673
|
Select,
|
|
3527
3674
|
{
|
|
3528
3675
|
...props,
|
|
@@ -3530,8 +3677,8 @@ function AdsSelect({
|
|
|
3530
3677
|
onValueChange: handleValueChange,
|
|
3531
3678
|
...resolvedValue !== void 0 ? { value: resolvedValue } : {},
|
|
3532
3679
|
children: [
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3535
3682
|
SelectTrigger,
|
|
3536
3683
|
{
|
|
3537
3684
|
"aria-describedby": description.describedBy,
|
|
@@ -3543,10 +3690,10 @@ function AdsSelect({
|
|
|
3543
3690
|
triggerClassName
|
|
3544
3691
|
),
|
|
3545
3692
|
id: description.inputId,
|
|
3546
|
-
children: /* @__PURE__ */ (0,
|
|
3693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder })
|
|
3547
3694
|
}
|
|
3548
3695
|
),
|
|
3549
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3696
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3550
3697
|
AdsClearButton,
|
|
3551
3698
|
{
|
|
3552
3699
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -3555,11 +3702,11 @@ function AdsSelect({
|
|
|
3555
3702
|
}
|
|
3556
3703
|
) : null
|
|
3557
3704
|
] }),
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3559
3706
|
SelectContent,
|
|
3560
3707
|
{
|
|
3561
3708
|
className: cn(selectContentBaseClassName, contentClassName3),
|
|
3562
|
-
children: hasOptions ? children : /* @__PURE__ */ (0,
|
|
3709
|
+
children: hasOptions ? children : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3563
3710
|
"div",
|
|
3564
3711
|
{
|
|
3565
3712
|
"aria-live": "polite",
|
|
@@ -3582,7 +3729,7 @@ function AdsSelect({
|
|
|
3582
3729
|
}
|
|
3583
3730
|
|
|
3584
3731
|
// src/components/AdsDataPagination/index.tsx
|
|
3585
|
-
var
|
|
3732
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3586
3733
|
var paginationButtonBaseClassName = "inline-flex h-9 min-w-9 items-center justify-center rounded-radius-md border text-sm font-medium leading-5 tracking-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50";
|
|
3587
3734
|
var paginationButtonInactiveClassName = "border-transparent bg-transparent px-[10px] text-foreground shadow-none hover:bg-accent hover:shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3588
3735
|
var paginationButtonActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
@@ -3658,9 +3805,9 @@ function AdsDataPagination({
|
|
|
3658
3805
|
ariaLabel
|
|
3659
3806
|
}) {
|
|
3660
3807
|
const { messages } = useAdsI18n();
|
|
3661
|
-
const [internalCurrent, setInternalCurrent] =
|
|
3662
|
-
const [internalPageSize, setInternalPageSize] =
|
|
3663
|
-
const [quickJumpValue, setQuickJumpValue] =
|
|
3808
|
+
const [internalCurrent, setInternalCurrent] = React38.useState(defaultCurrent);
|
|
3809
|
+
const [internalPageSize, setInternalPageSize] = React38.useState(defaultPageSize);
|
|
3810
|
+
const [quickJumpValue, setQuickJumpValue] = React38.useState("");
|
|
3664
3811
|
const isCurrentControlled = current !== void 0;
|
|
3665
3812
|
const isPageSizeControlled = pageSize !== void 0;
|
|
3666
3813
|
const mergedPageSize = Math.max(1, isPageSizeControlled ? pageSize : internalPageSize);
|
|
@@ -3681,20 +3828,20 @@ function AdsDataPagination({
|
|
|
3681
3828
|
new Set(pageSizeOptions.filter((option) => Number.isFinite(option) && option > 0))
|
|
3682
3829
|
);
|
|
3683
3830
|
const resolvedPageSizeOptions = pageSizeValues.length > 0 ? pageSizeValues : [10, 20, 50, 100];
|
|
3684
|
-
|
|
3831
|
+
React38.useEffect(() => {
|
|
3685
3832
|
if (!isCurrentControlled && internalCurrent !== mergedCurrent) {
|
|
3686
3833
|
setInternalCurrent(mergedCurrent);
|
|
3687
3834
|
}
|
|
3688
3835
|
}, [internalCurrent, isCurrentControlled, mergedCurrent]);
|
|
3689
|
-
|
|
3836
|
+
React38.useEffect(() => {
|
|
3690
3837
|
if (!isPageSizeControlled && internalPageSize !== mergedPageSize) {
|
|
3691
3838
|
setInternalPageSize(mergedPageSize);
|
|
3692
3839
|
}
|
|
3693
3840
|
}, [internalPageSize, isPageSizeControlled, mergedPageSize]);
|
|
3694
|
-
|
|
3841
|
+
React38.useEffect(() => {
|
|
3695
3842
|
setQuickJumpValue(String(mergedCurrent));
|
|
3696
3843
|
}, [mergedCurrent]);
|
|
3697
|
-
const commitPageChange =
|
|
3844
|
+
const commitPageChange = React38.useCallback(
|
|
3698
3845
|
(nextPage, nextPageSize = mergedPageSize) => {
|
|
3699
3846
|
const clampedPage = clampPage(nextPage, Math.max(1, Math.ceil(Math.max(total, 0) / nextPageSize)));
|
|
3700
3847
|
if (!isCurrentControlled) {
|
|
@@ -3708,7 +3855,7 @@ function AdsDataPagination({
|
|
|
3708
3855
|
},
|
|
3709
3856
|
[isCurrentControlled, mergedCurrent, mergedPageSize, onChange, total]
|
|
3710
3857
|
);
|
|
3711
|
-
const handlePageSizeChange =
|
|
3858
|
+
const handlePageSizeChange = React38.useCallback(
|
|
3712
3859
|
(nextValue) => {
|
|
3713
3860
|
const nextPageSize = Number(nextValue);
|
|
3714
3861
|
if (!Number.isFinite(nextPageSize) || nextPageSize <= 0 || nextPageSize === mergedPageSize) {
|
|
@@ -3733,7 +3880,7 @@ function AdsDataPagination({
|
|
|
3733
3880
|
total
|
|
3734
3881
|
]
|
|
3735
3882
|
);
|
|
3736
|
-
const handleQuickJumpSubmit =
|
|
3883
|
+
const handleQuickJumpSubmit = React38.useCallback(() => {
|
|
3737
3884
|
const trimmedValue = quickJumpValue.trim();
|
|
3738
3885
|
if (!trimmedValue) {
|
|
3739
3886
|
setQuickJumpValue(String(mergedCurrent));
|
|
@@ -3767,8 +3914,8 @@ function AdsDataPagination({
|
|
|
3767
3914
|
);
|
|
3768
3915
|
const renderPageNavigation = () => {
|
|
3769
3916
|
if (variant === "compact") {
|
|
3770
|
-
return /* @__PURE__ */ (0,
|
|
3771
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-wrap items-center gap-sm", children: [
|
|
3918
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3772
3919
|
Button,
|
|
3773
3920
|
{
|
|
3774
3921
|
"aria-label": messages.pagination.first,
|
|
@@ -3781,7 +3928,7 @@ function AdsDataPagination({
|
|
|
3781
3928
|
children: messages.pagination.first
|
|
3782
3929
|
}
|
|
3783
3930
|
) : null,
|
|
3784
|
-
/* @__PURE__ */ (0,
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3785
3932
|
Button,
|
|
3786
3933
|
{
|
|
3787
3934
|
"aria-label": messages.pagination.previous,
|
|
@@ -3794,7 +3941,7 @@ function AdsDataPagination({
|
|
|
3794
3941
|
children: messages.pagination.previous
|
|
3795
3942
|
}
|
|
3796
3943
|
),
|
|
3797
|
-
/* @__PURE__ */ (0,
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3798
3945
|
"span",
|
|
3799
3946
|
{
|
|
3800
3947
|
"aria-current": "page",
|
|
@@ -3802,7 +3949,7 @@ function AdsDataPagination({
|
|
|
3802
3949
|
children: pageStatus
|
|
3803
3950
|
}
|
|
3804
3951
|
),
|
|
3805
|
-
/* @__PURE__ */ (0,
|
|
3952
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3806
3953
|
Button,
|
|
3807
3954
|
{
|
|
3808
3955
|
"aria-label": messages.pagination.next,
|
|
@@ -3815,7 +3962,7 @@ function AdsDataPagination({
|
|
|
3815
3962
|
children: messages.pagination.next
|
|
3816
3963
|
}
|
|
3817
3964
|
),
|
|
3818
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3965
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3819
3966
|
Button,
|
|
3820
3967
|
{
|
|
3821
3968
|
"aria-label": messages.pagination.last,
|
|
@@ -3830,8 +3977,8 @@ function AdsDataPagination({
|
|
|
3830
3977
|
) : null
|
|
3831
3978
|
] });
|
|
3832
3979
|
}
|
|
3833
|
-
return /* @__PURE__ */ (0,
|
|
3834
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPagination, { "aria-label": navigationLabel, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(AdsPaginationContent, { children: [
|
|
3981
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3835
3982
|
Button,
|
|
3836
3983
|
{
|
|
3837
3984
|
"aria-label": messages.pagination.first,
|
|
@@ -3844,7 +3991,7 @@ function AdsDataPagination({
|
|
|
3844
3991
|
children: messages.pagination.first
|
|
3845
3992
|
}
|
|
3846
3993
|
) }) : null,
|
|
3847
|
-
/* @__PURE__ */ (0,
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3848
3995
|
Button,
|
|
3849
3996
|
{
|
|
3850
3997
|
"aria-label": messages.pagination.previous,
|
|
@@ -3858,7 +4005,7 @@ function AdsDataPagination({
|
|
|
3858
4005
|
}
|
|
3859
4006
|
) }),
|
|
3860
4007
|
paginationRange.map(
|
|
3861
|
-
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0,
|
|
4008
|
+
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationEllipsis, { label: messages.pagination.morePages }) }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3862
4009
|
Button,
|
|
3863
4010
|
{
|
|
3864
4011
|
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
@@ -3875,7 +4022,7 @@ function AdsDataPagination({
|
|
|
3875
4022
|
}
|
|
3876
4023
|
) }, token)
|
|
3877
4024
|
),
|
|
3878
|
-
/* @__PURE__ */ (0,
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3879
4026
|
Button,
|
|
3880
4027
|
{
|
|
3881
4028
|
"aria-label": messages.pagination.next,
|
|
@@ -3888,7 +4035,7 @@ function AdsDataPagination({
|
|
|
3888
4035
|
children: messages.pagination.next
|
|
3889
4036
|
}
|
|
3890
4037
|
) }),
|
|
3891
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
4038
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3892
4039
|
Button,
|
|
3893
4040
|
{
|
|
3894
4041
|
"aria-label": messages.pagination.last,
|
|
@@ -3903,7 +4050,7 @@ function AdsDataPagination({
|
|
|
3903
4050
|
) }) : null
|
|
3904
4051
|
] }) });
|
|
3905
4052
|
};
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3907
4054
|
"div",
|
|
3908
4055
|
{
|
|
3909
4056
|
"data-slot": "ads-data-pagination",
|
|
@@ -3913,34 +4060,34 @@ function AdsDataPagination({
|
|
|
3913
4060
|
className
|
|
3914
4061
|
),
|
|
3915
4062
|
children: [
|
|
3916
|
-
/* @__PURE__ */ (0,
|
|
3917
|
-
variant === "compact" ? /* @__PURE__ */ (0,
|
|
3918
|
-
showSizeChanger ? /* @__PURE__ */ (0,
|
|
3919
|
-
/* @__PURE__ */ (0,
|
|
3920
|
-
/* @__PURE__ */ (0,
|
|
4063
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-wrap items-center gap-md text-sm leading-5 text-muted-foreground", children: [
|
|
4064
|
+
variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: classNames?.total, children: compactTotalContent }) : totalContent ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: classNames?.total, children: totalContent }) : null,
|
|
4065
|
+
showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("flex items-center gap-sm", classNames?.pageSizeChanger), children: [
|
|
4066
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: messages.pagination.itemsPerPage }),
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3921
4068
|
Select,
|
|
3922
4069
|
{
|
|
3923
4070
|
disabled,
|
|
3924
4071
|
onValueChange: handlePageSizeChange,
|
|
3925
4072
|
value: String(mergedPageSize),
|
|
3926
4073
|
children: [
|
|
3927
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3928
4075
|
SelectTrigger,
|
|
3929
4076
|
{
|
|
3930
4077
|
"aria-label": messages.pagination.itemsPerPage,
|
|
3931
4078
|
className: cn(inlineControlClassName, "w-[132px] px-sm"),
|
|
3932
|
-
children: /* @__PURE__ */ (0,
|
|
4079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectValue, {})
|
|
3933
4080
|
}
|
|
3934
4081
|
),
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectContent, { children: resolvedPageSizeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectItem, { value: String(option), children: interpolate(messages.pagination.itemsPerPageOption, { value: option }) }, option)) })
|
|
3936
4083
|
]
|
|
3937
4084
|
}
|
|
3938
4085
|
)
|
|
3939
4086
|
] }) : null
|
|
3940
4087
|
] }),
|
|
3941
|
-
/* @__PURE__ */ (0,
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-md sm:flex-row sm:items-center sm:justify-end", children: [
|
|
3942
4089
|
renderPageNavigation(),
|
|
3943
|
-
showQuickJumper ? /* @__PURE__ */ (0,
|
|
4090
|
+
showQuickJumper ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3944
4091
|
"label",
|
|
3945
4092
|
{
|
|
3946
4093
|
className: cn(
|
|
@@ -3948,8 +4095,8 @@ function AdsDataPagination({
|
|
|
3948
4095
|
classNames?.quickJumper
|
|
3949
4096
|
),
|
|
3950
4097
|
children: [
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: messages.pagination.jumpTo }),
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3953
4100
|
Input,
|
|
3954
4101
|
{
|
|
3955
4102
|
"aria-label": messages.pagination.jumpTo,
|
|
@@ -3977,12 +4124,12 @@ function AdsDataPagination({
|
|
|
3977
4124
|
}
|
|
3978
4125
|
|
|
3979
4126
|
// src/components/AdsDataTable/index.tsx
|
|
3980
|
-
var
|
|
4127
|
+
var React43 = __toESM(require("react"), 1);
|
|
3981
4128
|
var import_lucide_react16 = require("lucide-react");
|
|
3982
4129
|
|
|
3983
4130
|
// src/components/AdsEmpty/index.tsx
|
|
3984
4131
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3985
|
-
var
|
|
4132
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3986
4133
|
var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
3987
4134
|
"flex w-full flex-col items-center justify-center gap-6 p-12 text-center",
|
|
3988
4135
|
{
|
|
@@ -3999,7 +4146,7 @@ var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3999
4146
|
}
|
|
4000
4147
|
);
|
|
4001
4148
|
function AdsEmpty({ className, variant, ...props }) {
|
|
4002
|
-
return /* @__PURE__ */ (0,
|
|
4149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4003
4150
|
"div",
|
|
4004
4151
|
{
|
|
4005
4152
|
"data-slot": "ads-empty",
|
|
@@ -4009,7 +4156,7 @@ function AdsEmpty({ className, variant, ...props }) {
|
|
|
4009
4156
|
);
|
|
4010
4157
|
}
|
|
4011
4158
|
function AdsEmptyHeader({ className, ...props }) {
|
|
4012
|
-
return /* @__PURE__ */ (0,
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4013
4160
|
"div",
|
|
4014
4161
|
{
|
|
4015
4162
|
"data-slot": "ads-empty-header",
|
|
@@ -4019,7 +4166,7 @@ function AdsEmptyHeader({ className, ...props }) {
|
|
|
4019
4166
|
);
|
|
4020
4167
|
}
|
|
4021
4168
|
function AdsEmptyMedia({ className, ...props }) {
|
|
4022
|
-
return /* @__PURE__ */ (0,
|
|
4169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4023
4170
|
"div",
|
|
4024
4171
|
{
|
|
4025
4172
|
"data-slot": "ads-empty-media",
|
|
@@ -4033,7 +4180,7 @@ function AdsEmptyMedia({ className, ...props }) {
|
|
|
4033
4180
|
);
|
|
4034
4181
|
}
|
|
4035
4182
|
function AdsEmptyTitle({ className, ...props }) {
|
|
4036
|
-
return /* @__PURE__ */ (0,
|
|
4183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4037
4184
|
"div",
|
|
4038
4185
|
{
|
|
4039
4186
|
"data-slot": "ads-empty-title",
|
|
@@ -4043,7 +4190,7 @@ function AdsEmptyTitle({ className, ...props }) {
|
|
|
4043
4190
|
);
|
|
4044
4191
|
}
|
|
4045
4192
|
function AdsEmptyDescription({ className, ...props }) {
|
|
4046
|
-
return /* @__PURE__ */ (0,
|
|
4193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4047
4194
|
"p",
|
|
4048
4195
|
{
|
|
4049
4196
|
"data-slot": "ads-empty-description",
|
|
@@ -4053,7 +4200,7 @@ function AdsEmptyDescription({ className, ...props }) {
|
|
|
4053
4200
|
);
|
|
4054
4201
|
}
|
|
4055
4202
|
function AdsEmptyContent({ className, ...props }) {
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4057
4204
|
"div",
|
|
4058
4205
|
{
|
|
4059
4206
|
"data-slot": "ads-empty-content",
|
|
@@ -4063,7 +4210,7 @@ function AdsEmptyContent({ className, ...props }) {
|
|
|
4063
4210
|
);
|
|
4064
4211
|
}
|
|
4065
4212
|
function AdsEmptyActions({ className, ...props }) {
|
|
4066
|
-
return /* @__PURE__ */ (0,
|
|
4213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4067
4214
|
"div",
|
|
4068
4215
|
{
|
|
4069
4216
|
"data-slot": "ads-empty-actions",
|
|
@@ -4073,7 +4220,7 @@ function AdsEmptyActions({ className, ...props }) {
|
|
|
4073
4220
|
);
|
|
4074
4221
|
}
|
|
4075
4222
|
function AdsEmptyFooter({ className, ...props }) {
|
|
4076
|
-
return /* @__PURE__ */ (0,
|
|
4223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4077
4224
|
"div",
|
|
4078
4225
|
{
|
|
4079
4226
|
"data-slot": "ads-empty-footer",
|
|
@@ -4084,19 +4231,19 @@ function AdsEmptyFooter({ className, ...props }) {
|
|
|
4084
4231
|
}
|
|
4085
4232
|
|
|
4086
4233
|
// src/components/AdsTable/index.tsx
|
|
4087
|
-
var
|
|
4234
|
+
var React42 = __toESM(require("react"), 1);
|
|
4088
4235
|
var import_lucide_react15 = require("lucide-react");
|
|
4089
4236
|
|
|
4090
4237
|
// src/components/AdsRadioGroup/index.tsx
|
|
4091
|
-
var
|
|
4238
|
+
var React40 = __toESM(require("react"), 1);
|
|
4092
4239
|
|
|
4093
4240
|
// src/primitives/radio-group.tsx
|
|
4094
|
-
var
|
|
4241
|
+
var React39 = __toESM(require("react"), 1);
|
|
4095
4242
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
4096
4243
|
var import_lucide_react14 = require("lucide-react");
|
|
4097
|
-
var
|
|
4098
|
-
var RadioGroup =
|
|
4099
|
-
return /* @__PURE__ */ (0,
|
|
4244
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4245
|
+
var RadioGroup = React39.forwardRef(({ className, ...props }, ref) => {
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4100
4247
|
RadioGroupPrimitive.Root,
|
|
4101
4248
|
{
|
|
4102
4249
|
className: cn("grid gap-2", className),
|
|
@@ -4106,8 +4253,8 @@ var RadioGroup = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
4106
4253
|
);
|
|
4107
4254
|
});
|
|
4108
4255
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4109
|
-
var RadioGroupItem =
|
|
4110
|
-
return /* @__PURE__ */ (0,
|
|
4256
|
+
var RadioGroupItem = React39.forwardRef(({ className, ...props }, ref) => {
|
|
4257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4111
4258
|
RadioGroupPrimitive.Item,
|
|
4112
4259
|
{
|
|
4113
4260
|
ref,
|
|
@@ -4116,19 +4263,19 @@ var RadioGroupItem = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
4116
4263
|
className
|
|
4117
4264
|
),
|
|
4118
4265
|
...props,
|
|
4119
|
-
children: /* @__PURE__ */ (0,
|
|
4266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react14.Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
4120
4267
|
}
|
|
4121
4268
|
);
|
|
4122
4269
|
});
|
|
4123
4270
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
4124
4271
|
|
|
4125
4272
|
// src/components/AdsRadioGroup/index.tsx
|
|
4126
|
-
var
|
|
4273
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4127
4274
|
var radioGroupBaseClassName = "gap-3";
|
|
4128
4275
|
var radioItemBaseClassName = "h-4 w-4 border-border bg-card text-primary shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0";
|
|
4129
|
-
var RadioGroup2 =
|
|
4276
|
+
var RadioGroup2 = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroup, { className: cn(radioGroupBaseClassName, className), ref, ...props }));
|
|
4130
4277
|
RadioGroup2.displayName = "RadioGroup";
|
|
4131
|
-
var RadioGroupItem2 =
|
|
4278
|
+
var RadioGroupItem2 = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4132
4279
|
RadioGroupItem,
|
|
4133
4280
|
{
|
|
4134
4281
|
className: cn(radioItemBaseClassName, className),
|
|
@@ -4137,7 +4284,7 @@ var RadioGroupItem2 = React39.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4137
4284
|
}
|
|
4138
4285
|
));
|
|
4139
4286
|
RadioGroupItem2.displayName = "RadioGroupItem";
|
|
4140
|
-
var AdsRadioGroup =
|
|
4287
|
+
var AdsRadioGroup = React40.forwardRef(
|
|
4141
4288
|
({
|
|
4142
4289
|
children,
|
|
4143
4290
|
className,
|
|
@@ -4153,12 +4300,12 @@ var AdsRadioGroup = React39.forwardRef(
|
|
|
4153
4300
|
helperText,
|
|
4154
4301
|
id
|
|
4155
4302
|
});
|
|
4156
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
4157
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
4158
|
-
return /* @__PURE__ */ (0,
|
|
4159
|
-
label ? /* @__PURE__ */ (0,
|
|
4303
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
4304
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
4305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(AdsFieldItem, { children: [
|
|
4306
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
4160
4307
|
descriptionPlacement === "above" ? helperNode : null,
|
|
4161
|
-
/* @__PURE__ */ (0,
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4162
4309
|
RadioGroup2,
|
|
4163
4310
|
{
|
|
4164
4311
|
"aria-describedby": description.describedBy,
|
|
@@ -4174,11 +4321,11 @@ var AdsRadioGroup = React39.forwardRef(
|
|
|
4174
4321
|
}
|
|
4175
4322
|
);
|
|
4176
4323
|
AdsRadioGroup.displayName = "AdsRadioGroup";
|
|
4177
|
-
var AdsRadioGroupOption =
|
|
4178
|
-
const generatedId =
|
|
4324
|
+
var AdsRadioGroupOption = React40.forwardRef(({ className, description, id, label, value, ...props }, ref) => {
|
|
4325
|
+
const generatedId = React40.useId();
|
|
4179
4326
|
const inputId = id ?? generatedId;
|
|
4180
|
-
return /* @__PURE__ */ (0,
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex w-full cursor-pointer items-start gap-2", htmlFor: inputId, children: [
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4182
4329
|
RadioGroupItem2,
|
|
4183
4330
|
{
|
|
4184
4331
|
className: cn(className),
|
|
@@ -4188,20 +4335,20 @@ var AdsRadioGroupOption = React39.forwardRef(({ className, description, id, labe
|
|
|
4188
4335
|
...props
|
|
4189
4336
|
}
|
|
4190
4337
|
),
|
|
4191
|
-
/* @__PURE__ */ (0,
|
|
4192
|
-
/* @__PURE__ */ (0,
|
|
4193
|
-
description ? /* @__PURE__ */ (0,
|
|
4338
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4339
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "text-sm leading-5 text-foreground", children: label }),
|
|
4340
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
4194
4341
|
] })
|
|
4195
4342
|
] });
|
|
4196
4343
|
});
|
|
4197
4344
|
AdsRadioGroupOption.displayName = "AdsRadioGroupOption";
|
|
4198
|
-
var AdsRadioGroupCardOption =
|
|
4199
|
-
const generatedId =
|
|
4345
|
+
var AdsRadioGroupCardOption = React40.forwardRef(({ className, description, disabled, id, label, value, ...props }, ref) => {
|
|
4346
|
+
const generatedId = React40.useId();
|
|
4200
4347
|
const inputId = id ?? generatedId;
|
|
4201
4348
|
const titleId = `${inputId}-label`;
|
|
4202
4349
|
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
4203
|
-
return /* @__PURE__ */ (0,
|
|
4204
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative", children: [
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4205
4352
|
RadioGroupItem2,
|
|
4206
4353
|
{
|
|
4207
4354
|
"aria-describedby": descriptionId,
|
|
@@ -4214,7 +4361,7 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4214
4361
|
...props
|
|
4215
4362
|
}
|
|
4216
4363
|
),
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4218
4365
|
"div",
|
|
4219
4366
|
{
|
|
4220
4367
|
className: cn(
|
|
@@ -4223,16 +4370,16 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4223
4370
|
className
|
|
4224
4371
|
),
|
|
4225
4372
|
children: [
|
|
4226
|
-
/* @__PURE__ */ (0,
|
|
4227
|
-
/* @__PURE__ */ (0,
|
|
4228
|
-
description ? /* @__PURE__ */ (0,
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", id: titleId, children: label }),
|
|
4375
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(AdsFieldDescription, { className: "text-xs leading-4", id: descriptionId, children: description }) : null
|
|
4229
4376
|
] }),
|
|
4230
|
-
/* @__PURE__ */ (0,
|
|
4377
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex h-full shrink-0 items-start justify-center pt-px", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4231
4378
|
"div",
|
|
4232
4379
|
{
|
|
4233
4380
|
className: "grid h-4 w-4 place-content-center rounded-full border bg-card shadow-[0px_1px_2px_rgba(0,0,0,0.1)]",
|
|
4234
4381
|
"data-indicator": true,
|
|
4235
|
-
children: /* @__PURE__ */ (0,
|
|
4382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4236
4383
|
"span",
|
|
4237
4384
|
{
|
|
4238
4385
|
className: "h-2 w-2 rounded-full bg-primary transition-opacity",
|
|
@@ -4249,9 +4396,9 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4249
4396
|
AdsRadioGroupCardOption.displayName = "AdsRadioGroupCardOption";
|
|
4250
4397
|
|
|
4251
4398
|
// src/primitives/table.tsx
|
|
4252
|
-
var
|
|
4253
|
-
var
|
|
4254
|
-
var Table =
|
|
4399
|
+
var React41 = __toESM(require("react"), 1);
|
|
4400
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4401
|
+
var Table = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4255
4402
|
"table",
|
|
4256
4403
|
{
|
|
4257
4404
|
ref,
|
|
@@ -4260,7 +4407,7 @@ var Table = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
4260
4407
|
}
|
|
4261
4408
|
));
|
|
4262
4409
|
Table.displayName = "Table";
|
|
4263
|
-
var TableScrollArea =
|
|
4410
|
+
var TableScrollArea = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4264
4411
|
"div",
|
|
4265
4412
|
{
|
|
4266
4413
|
ref,
|
|
@@ -4269,9 +4416,9 @@ var TableScrollArea = React40.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4269
4416
|
}
|
|
4270
4417
|
));
|
|
4271
4418
|
TableScrollArea.displayName = "TableScrollArea";
|
|
4272
|
-
var TableHeader =
|
|
4419
|
+
var TableHeader = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
4273
4420
|
TableHeader.displayName = "TableHeader";
|
|
4274
|
-
var TableBody =
|
|
4421
|
+
var TableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4275
4422
|
"tbody",
|
|
4276
4423
|
{
|
|
4277
4424
|
ref,
|
|
@@ -4280,7 +4427,7 @@ var TableBody = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4280
4427
|
}
|
|
4281
4428
|
));
|
|
4282
4429
|
TableBody.displayName = "TableBody";
|
|
4283
|
-
var TableFooter =
|
|
4430
|
+
var TableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4284
4431
|
"tfoot",
|
|
4285
4432
|
{
|
|
4286
4433
|
ref,
|
|
@@ -4292,7 +4439,7 @@ var TableFooter = React40.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4292
4439
|
}
|
|
4293
4440
|
));
|
|
4294
4441
|
TableFooter.displayName = "TableFooter";
|
|
4295
|
-
var TableRow =
|
|
4442
|
+
var TableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4296
4443
|
"tr",
|
|
4297
4444
|
{
|
|
4298
4445
|
ref,
|
|
@@ -4304,7 +4451,7 @@ var TableRow = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4304
4451
|
}
|
|
4305
4452
|
));
|
|
4306
4453
|
TableRow.displayName = "TableRow";
|
|
4307
|
-
var TableHead =
|
|
4454
|
+
var TableHead = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4308
4455
|
"th",
|
|
4309
4456
|
{
|
|
4310
4457
|
ref,
|
|
@@ -4316,7 +4463,7 @@ var TableHead = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4316
4463
|
}
|
|
4317
4464
|
));
|
|
4318
4465
|
TableHead.displayName = "TableHead";
|
|
4319
|
-
var TableCell =
|
|
4466
|
+
var TableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4320
4467
|
"td",
|
|
4321
4468
|
{
|
|
4322
4469
|
ref,
|
|
@@ -4325,7 +4472,7 @@ var TableCell = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4325
4472
|
}
|
|
4326
4473
|
));
|
|
4327
4474
|
TableCell.displayName = "TableCell";
|
|
4328
|
-
var TableCaption =
|
|
4475
|
+
var TableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4329
4476
|
"caption",
|
|
4330
4477
|
{
|
|
4331
4478
|
ref,
|
|
@@ -4334,21 +4481,21 @@ var TableCaption = React40.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4334
4481
|
}
|
|
4335
4482
|
));
|
|
4336
4483
|
TableCaption.displayName = "TableCaption";
|
|
4337
|
-
var TableColGroup =
|
|
4484
|
+
var TableColGroup = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("colgroup", { ref, className: cn(className), ...props }));
|
|
4338
4485
|
TableColGroup.displayName = "TableColGroup";
|
|
4339
|
-
var TableCol =
|
|
4486
|
+
var TableCol = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("col", { ref, className: cn(className), ...props }));
|
|
4340
4487
|
TableCol.displayName = "TableCol";
|
|
4341
4488
|
|
|
4342
4489
|
// src/components/AdsTable/index.tsx
|
|
4343
|
-
var
|
|
4344
|
-
var AdsTableStickyHeaderContext =
|
|
4490
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4491
|
+
var AdsTableStickyHeaderContext = React42.createContext(false);
|
|
4345
4492
|
function resolveLength(value) {
|
|
4346
4493
|
if (value === void 0) {
|
|
4347
4494
|
return void 0;
|
|
4348
4495
|
}
|
|
4349
4496
|
return typeof value === "number" ? `${value}px` : value;
|
|
4350
4497
|
}
|
|
4351
|
-
var AdsTableSurface =
|
|
4498
|
+
var AdsTableSurface = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4352
4499
|
"div",
|
|
4353
4500
|
{
|
|
4354
4501
|
ref,
|
|
@@ -4360,8 +4507,8 @@ var AdsTableSurface = React41.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4360
4507
|
}
|
|
4361
4508
|
));
|
|
4362
4509
|
AdsTableSurface.displayName = "AdsTableSurface";
|
|
4363
|
-
var AdsTableRoot =
|
|
4364
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4510
|
+
var AdsTableRoot = React42.forwardRef(
|
|
4511
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4365
4512
|
Table,
|
|
4366
4513
|
{
|
|
4367
4514
|
ref,
|
|
@@ -4376,7 +4523,7 @@ var AdsTableRoot = React41.forwardRef(
|
|
|
4376
4523
|
)
|
|
4377
4524
|
);
|
|
4378
4525
|
AdsTableRoot.displayName = "AdsTableRoot";
|
|
4379
|
-
var AdsTableScrollArea =
|
|
4526
|
+
var AdsTableScrollArea = React42.forwardRef(
|
|
4380
4527
|
({
|
|
4381
4528
|
children,
|
|
4382
4529
|
className,
|
|
@@ -4386,7 +4533,7 @@ var AdsTableScrollArea = React41.forwardRef(
|
|
|
4386
4533
|
x,
|
|
4387
4534
|
y,
|
|
4388
4535
|
...props
|
|
4389
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
4536
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableStickyHeaderContext.Provider, { value: stickyHeader, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4390
4537
|
TableScrollArea,
|
|
4391
4538
|
{
|
|
4392
4539
|
ref,
|
|
@@ -4408,15 +4555,15 @@ var AdsTableScrollArea = React41.forwardRef(
|
|
|
4408
4555
|
) })
|
|
4409
4556
|
);
|
|
4410
4557
|
AdsTableScrollArea.displayName = "AdsTableScrollArea";
|
|
4411
|
-
var AdsTable =
|
|
4412
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4558
|
+
var AdsTable = React42.forwardRef(
|
|
4559
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableSurface, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableRoot, { ref, className, ...props }) }) })
|
|
4413
4560
|
);
|
|
4414
4561
|
AdsTable.displayName = "AdsTable";
|
|
4415
|
-
var AdsTableColGroup =
|
|
4562
|
+
var AdsTableColGroup = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableColGroup, { ref, className, ...props }));
|
|
4416
4563
|
AdsTableColGroup.displayName = "AdsTableColGroup";
|
|
4417
|
-
var AdsTableCol =
|
|
4564
|
+
var AdsTableCol = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCol, { ref, className, ...props }));
|
|
4418
4565
|
AdsTableCol.displayName = "AdsTableCol";
|
|
4419
|
-
var AdsTableHeader =
|
|
4566
|
+
var AdsTableHeader = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4420
4567
|
TableHeader,
|
|
4421
4568
|
{
|
|
4422
4569
|
ref,
|
|
@@ -4425,7 +4572,7 @@ var AdsTableHeader = React41.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4425
4572
|
}
|
|
4426
4573
|
));
|
|
4427
4574
|
AdsTableHeader.displayName = "AdsTableHeader";
|
|
4428
|
-
var AdsTableBody =
|
|
4575
|
+
var AdsTableBody = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4429
4576
|
TableBody,
|
|
4430
4577
|
{
|
|
4431
4578
|
ref,
|
|
@@ -4434,7 +4581,7 @@ var AdsTableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4434
4581
|
}
|
|
4435
4582
|
));
|
|
4436
4583
|
AdsTableBody.displayName = "AdsTableBody";
|
|
4437
|
-
var AdsTableFooter =
|
|
4584
|
+
var AdsTableFooter = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4438
4585
|
TableFooter,
|
|
4439
4586
|
{
|
|
4440
4587
|
ref,
|
|
@@ -4447,7 +4594,7 @@ var AdsTableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4447
4594
|
}
|
|
4448
4595
|
));
|
|
4449
4596
|
AdsTableFooter.displayName = "AdsTableFooter";
|
|
4450
|
-
var AdsTableRow =
|
|
4597
|
+
var AdsTableRow = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4451
4598
|
TableRow,
|
|
4452
4599
|
{
|
|
4453
4600
|
ref,
|
|
@@ -4459,9 +4606,9 @@ var AdsTableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4459
4606
|
}
|
|
4460
4607
|
));
|
|
4461
4608
|
AdsTableRow.displayName = "AdsTableRow";
|
|
4462
|
-
var AdsTableHead =
|
|
4463
|
-
const stickyHeader =
|
|
4464
|
-
return /* @__PURE__ */ (0,
|
|
4609
|
+
var AdsTableHead = React42.forwardRef(({ className, ...props }, ref) => {
|
|
4610
|
+
const stickyHeader = React42.useContext(AdsTableStickyHeaderContext);
|
|
4611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4465
4612
|
TableHead,
|
|
4466
4613
|
{
|
|
4467
4614
|
ref,
|
|
@@ -4476,7 +4623,7 @@ var AdsTableHead = React41.forwardRef(({ className, ...props }, ref) => {
|
|
|
4476
4623
|
);
|
|
4477
4624
|
});
|
|
4478
4625
|
AdsTableHead.displayName = "AdsTableHead";
|
|
4479
|
-
var AdsTableCell =
|
|
4626
|
+
var AdsTableCell = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4480
4627
|
TableCell,
|
|
4481
4628
|
{
|
|
4482
4629
|
ref,
|
|
@@ -4489,7 +4636,7 @@ var AdsTableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4489
4636
|
}
|
|
4490
4637
|
));
|
|
4491
4638
|
AdsTableCell.displayName = "AdsTableCell";
|
|
4492
|
-
var AdsTableCaption =
|
|
4639
|
+
var AdsTableCaption = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4493
4640
|
TableCaption,
|
|
4494
4641
|
{
|
|
4495
4642
|
ref,
|
|
@@ -4498,12 +4645,12 @@ var AdsTableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4498
4645
|
}
|
|
4499
4646
|
));
|
|
4500
4647
|
AdsTableCaption.displayName = "AdsTableCaption";
|
|
4501
|
-
var AdsTableSortHeader =
|
|
4648
|
+
var AdsTableSortHeader = React42.forwardRef(
|
|
4502
4649
|
({ className, disabled = false, onToggleSort, sortOrder, title, ...props }, ref) => {
|
|
4503
4650
|
const { messages } = useAdsI18n();
|
|
4504
4651
|
const nextOrder = sortOrder === null ? "ascend" : sortOrder === "ascend" ? "descend" : null;
|
|
4505
4652
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
4506
|
-
return /* @__PURE__ */ (0,
|
|
4653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableHead, { ref, className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4507
4654
|
Button,
|
|
4508
4655
|
{
|
|
4509
4656
|
"aria-label": `${title} ${actionLabel}`,
|
|
@@ -4519,15 +4666,15 @@ var AdsTableSortHeader = React41.forwardRef(
|
|
|
4519
4666
|
type: "button",
|
|
4520
4667
|
variant: "ghost",
|
|
4521
4668
|
children: [
|
|
4522
|
-
/* @__PURE__ */ (0,
|
|
4523
|
-
/* @__PURE__ */ (0,
|
|
4669
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: title }),
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: sortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 rotate-180" }) : sortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
4524
4671
|
]
|
|
4525
4672
|
}
|
|
4526
4673
|
) });
|
|
4527
4674
|
}
|
|
4528
4675
|
);
|
|
4529
4676
|
AdsTableSortHeader.displayName = "AdsTableSortHeader";
|
|
4530
|
-
var AdsTableSelectionCell =
|
|
4677
|
+
var AdsTableSelectionCell = React42.forwardRef(
|
|
4531
4678
|
({
|
|
4532
4679
|
checked = false,
|
|
4533
4680
|
className,
|
|
@@ -4538,7 +4685,7 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4538
4685
|
...props
|
|
4539
4686
|
}, ref) => {
|
|
4540
4687
|
const { messages } = useAdsI18n();
|
|
4541
|
-
return /* @__PURE__ */ (0,
|
|
4688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center justify-center", children: type === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4542
4689
|
RadioGroupItem2,
|
|
4543
4690
|
{
|
|
4544
4691
|
"aria-label": messages.table.selectRow,
|
|
@@ -4550,7 +4697,7 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4550
4697
|
},
|
|
4551
4698
|
value
|
|
4552
4699
|
}
|
|
4553
|
-
) : /* @__PURE__ */ (0,
|
|
4700
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4554
4701
|
Checkbox2,
|
|
4555
4702
|
{
|
|
4556
4703
|
"aria-label": messages.table.selectRow,
|
|
@@ -4564,10 +4711,10 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4564
4711
|
}
|
|
4565
4712
|
);
|
|
4566
4713
|
AdsTableSelectionCell.displayName = "AdsTableSelectionCell";
|
|
4567
|
-
var AdsTableExpandCell =
|
|
4714
|
+
var AdsTableExpandCell = React42.forwardRef(
|
|
4568
4715
|
({ className, disabled = false, expanded = false, onToggle, ...props }, ref) => {
|
|
4569
4716
|
const { messages } = useAdsI18n();
|
|
4570
|
-
return /* @__PURE__ */ (0,
|
|
4717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4571
4718
|
Button,
|
|
4572
4719
|
{
|
|
4573
4720
|
"aria-label": expanded ? messages.table.collapseRow : messages.table.expandRow,
|
|
@@ -4584,7 +4731,7 @@ var AdsTableExpandCell = React41.forwardRef(
|
|
|
4584
4731
|
size: "sm",
|
|
4585
4732
|
type: "button",
|
|
4586
4733
|
variant: "ghost",
|
|
4587
|
-
children: expanded ? /* @__PURE__ */ (0,
|
|
4734
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronRight, { className: "h-4 w-4" })
|
|
4588
4735
|
}
|
|
4589
4736
|
) }) });
|
|
4590
4737
|
}
|
|
@@ -4592,7 +4739,7 @@ var AdsTableExpandCell = React41.forwardRef(
|
|
|
4592
4739
|
AdsTableExpandCell.displayName = "AdsTableExpandCell";
|
|
4593
4740
|
|
|
4594
4741
|
// src/components/AdsDataTable/index.tsx
|
|
4595
|
-
var
|
|
4742
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4596
4743
|
var SKELETON_ROW_COUNT = 4;
|
|
4597
4744
|
var FLEX_WIDTH_UNIT = 160;
|
|
4598
4745
|
var sizeClassNames = {
|
|
@@ -4729,7 +4876,7 @@ function getCellStyle(column, overrideWidth) {
|
|
|
4729
4876
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
4730
4877
|
}
|
|
4731
4878
|
function renderCellValue(value, ellipsis) {
|
|
4732
|
-
if (
|
|
4879
|
+
if (React43.isValidElement(value)) {
|
|
4733
4880
|
return value;
|
|
4734
4881
|
}
|
|
4735
4882
|
if (value === null || value === void 0) {
|
|
@@ -4739,7 +4886,7 @@ function renderCellValue(value, ellipsis) {
|
|
|
4739
4886
|
if (ellipsis) {
|
|
4740
4887
|
const shouldShowTitle = typeof ellipsis === "object" ? ellipsis.showTitle !== false : true;
|
|
4741
4888
|
const maxWidth = typeof ellipsis === "object" ? ellipsis.maxWidth : void 0;
|
|
4742
|
-
return /* @__PURE__ */ (0,
|
|
4889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4743
4890
|
"div",
|
|
4744
4891
|
{
|
|
4745
4892
|
className: "truncate",
|
|
@@ -4854,48 +5001,48 @@ function AdsDataTable({
|
|
|
4854
5001
|
suppressRowClickSelection = true
|
|
4855
5002
|
}) {
|
|
4856
5003
|
const { messages } = useAdsI18n();
|
|
4857
|
-
const resolvedColumns =
|
|
4858
|
-
const [internalSortState, setInternalSortState] =
|
|
5004
|
+
const resolvedColumns = React43.useMemo(() => columns.filter(Boolean), [columns]);
|
|
5005
|
+
const [internalSortState, setInternalSortState] = React43.useState(
|
|
4859
5006
|
() => getInitialSortState(resolvedColumns)
|
|
4860
5007
|
);
|
|
4861
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
5008
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = React43.useState(
|
|
4862
5009
|
rowSelection?.defaultSelectedRowKeys ?? rowSelection?.selectedRowKeys ?? []
|
|
4863
5010
|
);
|
|
4864
|
-
const [internalFilterValues, setInternalFilterValues] =
|
|
5011
|
+
const [internalFilterValues, setInternalFilterValues] = React43.useState(
|
|
4865
5012
|
() => getInitialFilterValues(resolvedColumns)
|
|
4866
5013
|
);
|
|
4867
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
5014
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = React43.useState(
|
|
4868
5015
|
expandable?.defaultExpandedRowKeys ?? expandable?.expandedRowKeys ?? []
|
|
4869
5016
|
);
|
|
4870
|
-
const [internalColumnWidths, setInternalColumnWidths] =
|
|
4871
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
5017
|
+
const [internalColumnWidths, setInternalColumnWidths] = React43.useState({});
|
|
5018
|
+
const [internalCurrentPage, setInternalCurrentPage] = React43.useState(
|
|
4872
5019
|
pagination !== false ? pagination.defaultCurrent ?? pagination.current ?? 1 : 1
|
|
4873
5020
|
);
|
|
4874
|
-
const [internalPageSize, setInternalPageSize] =
|
|
5021
|
+
const [internalPageSize, setInternalPageSize] = React43.useState(
|
|
4875
5022
|
pagination !== false ? pagination.defaultPageSize ?? pagination.pageSize ?? 10 : 10
|
|
4876
5023
|
);
|
|
4877
|
-
const [activeResize, setActiveResize] =
|
|
4878
|
-
|
|
5024
|
+
const [activeResize, setActiveResize] = React43.useState(null);
|
|
5025
|
+
React43.useEffect(() => {
|
|
4879
5026
|
if (rowSelection?.selectedRowKeys !== void 0) {
|
|
4880
5027
|
setInternalSelectedKeys(rowSelection.selectedRowKeys);
|
|
4881
5028
|
}
|
|
4882
5029
|
}, [rowSelection?.selectedRowKeys]);
|
|
4883
|
-
|
|
5030
|
+
React43.useEffect(() => {
|
|
4884
5031
|
if (expandable?.expandedRowKeys !== void 0) {
|
|
4885
5032
|
setInternalExpandedKeys(expandable.expandedRowKeys);
|
|
4886
5033
|
}
|
|
4887
5034
|
}, [expandable?.expandedRowKeys]);
|
|
4888
|
-
|
|
5035
|
+
React43.useEffect(() => {
|
|
4889
5036
|
if (pagination !== false && pagination.current !== void 0) {
|
|
4890
5037
|
setInternalCurrentPage(pagination.current);
|
|
4891
5038
|
}
|
|
4892
5039
|
}, [pagination]);
|
|
4893
|
-
|
|
5040
|
+
React43.useEffect(() => {
|
|
4894
5041
|
if (pagination !== false && pagination.pageSize !== void 0) {
|
|
4895
5042
|
setInternalPageSize(pagination.pageSize);
|
|
4896
5043
|
}
|
|
4897
5044
|
}, [pagination]);
|
|
4898
|
-
|
|
5045
|
+
React43.useEffect(() => {
|
|
4899
5046
|
setInternalFilterValues((previous) => {
|
|
4900
5047
|
const next = { ...previous };
|
|
4901
5048
|
let hasChanged = false;
|
|
@@ -4916,7 +5063,7 @@ function AdsDataTable({
|
|
|
4916
5063
|
return hasChanged ? next : previous;
|
|
4917
5064
|
});
|
|
4918
5065
|
}, [resolvedColumns]);
|
|
4919
|
-
const controlledSortState =
|
|
5066
|
+
const controlledSortState = React43.useMemo(() => {
|
|
4920
5067
|
const columnIndex = resolvedColumns.findIndex((column2) => column2.sortOrder !== void 0);
|
|
4921
5068
|
if (columnIndex === -1) {
|
|
4922
5069
|
return null;
|
|
@@ -4937,12 +5084,12 @@ function AdsDataTable({
|
|
|
4937
5084
|
const columnCount = resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn);
|
|
4938
5085
|
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
4939
5086
|
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
4940
|
-
const spinnerLoadingHeight =
|
|
5087
|
+
const spinnerLoadingHeight = React43.useMemo(
|
|
4941
5088
|
() => getSpinnerLoadingHeight(scroll?.y, density),
|
|
4942
5089
|
[density, scroll?.y]
|
|
4943
5090
|
);
|
|
4944
5091
|
const expandedRowContentClassName = expandedRowSurface === "plain" ? "bg-transparent p-4" : expandedRowSurface === "subtle" ? "mx-6 my-4 rounded-[20px] border border-border bg-transparent p-4" : "border-t border-border bg-popover/40 p-4";
|
|
4945
|
-
const filterValues =
|
|
5092
|
+
const filterValues = React43.useMemo(
|
|
4946
5093
|
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
4947
5094
|
const columnKey = getColumnKey(column, index);
|
|
4948
5095
|
accumulator[columnKey] = column.filterValue ?? internalFilterValues[columnKey] ?? "";
|
|
@@ -4950,7 +5097,7 @@ function AdsDataTable({
|
|
|
4950
5097
|
}, {}),
|
|
4951
5098
|
[internalFilterValues, resolvedColumns]
|
|
4952
5099
|
);
|
|
4953
|
-
const filteredData =
|
|
5100
|
+
const filteredData = React43.useMemo(() => {
|
|
4954
5101
|
const filterableColumns = resolvedColumns.filter((column) => column.filter);
|
|
4955
5102
|
if (filterableColumns.length === 0) {
|
|
4956
5103
|
return dataSource;
|
|
@@ -4970,7 +5117,7 @@ function AdsDataTable({
|
|
|
4970
5117
|
})
|
|
4971
5118
|
);
|
|
4972
5119
|
}, [dataSource, filterValues, resolvedColumns]);
|
|
4973
|
-
const sortedData =
|
|
5120
|
+
const sortedData = React43.useMemo(() => {
|
|
4974
5121
|
if (!sortState || !sortState.column || sortState.order === null) {
|
|
4975
5122
|
return filteredData;
|
|
4976
5123
|
}
|
|
@@ -4997,7 +5144,7 @@ function AdsDataTable({
|
|
|
4997
5144
|
Math.max(1, pagination.current ?? internalCurrentPage),
|
|
4998
5145
|
totalPages
|
|
4999
5146
|
);
|
|
5000
|
-
|
|
5147
|
+
React43.useEffect(() => {
|
|
5001
5148
|
if (pagination === false || pagination.current !== void 0) {
|
|
5002
5149
|
return;
|
|
5003
5150
|
}
|
|
@@ -5005,14 +5152,14 @@ function AdsDataTable({
|
|
|
5005
5152
|
setInternalCurrentPage(currentPage);
|
|
5006
5153
|
}
|
|
5007
5154
|
}, [currentPage, internalCurrentPage, pagination]);
|
|
5008
|
-
const paginatedData =
|
|
5155
|
+
const paginatedData = React43.useMemo(() => {
|
|
5009
5156
|
if (pagination === false || paginationMode === "server") {
|
|
5010
5157
|
return sortedData;
|
|
5011
5158
|
}
|
|
5012
5159
|
const start = (currentPage - 1) * currentPageSize;
|
|
5013
5160
|
return sortedData.slice(start, start + currentPageSize);
|
|
5014
5161
|
}, [currentPage, currentPageSize, pagination, paginationMode, sortedData]);
|
|
5015
|
-
const handleSortChange =
|
|
5162
|
+
const handleSortChange = React43.useCallback(
|
|
5016
5163
|
(column, columnKey, nextOrder) => {
|
|
5017
5164
|
const nextSortState = nextOrder === null ? null : {
|
|
5018
5165
|
column,
|
|
@@ -5026,7 +5173,7 @@ function AdsDataTable({
|
|
|
5026
5173
|
},
|
|
5027
5174
|
[controlledSortState, onSortChange]
|
|
5028
5175
|
);
|
|
5029
|
-
const handleFilterChange =
|
|
5176
|
+
const handleFilterChange = React43.useCallback(
|
|
5030
5177
|
(column, columnKey, nextValue) => {
|
|
5031
5178
|
if (column.filterValue === void 0) {
|
|
5032
5179
|
setInternalFilterValues((previous) => ({
|
|
@@ -5041,7 +5188,7 @@ function AdsDataTable({
|
|
|
5041
5188
|
},
|
|
5042
5189
|
[pagination]
|
|
5043
5190
|
);
|
|
5044
|
-
const updateSelection =
|
|
5191
|
+
const updateSelection = React43.useCallback(
|
|
5045
5192
|
(nextKeys) => {
|
|
5046
5193
|
if (!rowSelection) {
|
|
5047
5194
|
return;
|
|
@@ -5056,7 +5203,7 @@ function AdsDataTable({
|
|
|
5056
5203
|
},
|
|
5057
5204
|
[dataSource, rowKey, rowSelection]
|
|
5058
5205
|
);
|
|
5059
|
-
const toggleSelectionFromRowClick =
|
|
5206
|
+
const toggleSelectionFromRowClick = React43.useCallback(
|
|
5060
5207
|
(record, recordKey) => {
|
|
5061
5208
|
if (!allowsRowSelectionByClick || !rowSelection) {
|
|
5062
5209
|
return;
|
|
@@ -5070,7 +5217,7 @@ function AdsDataTable({
|
|
|
5070
5217
|
},
|
|
5071
5218
|
[allowsRowSelectionByClick, rowSelection, selectedKeys, updateSelection]
|
|
5072
5219
|
);
|
|
5073
|
-
const toggleExpanded =
|
|
5220
|
+
const toggleExpanded = React43.useCallback(
|
|
5074
5221
|
(record, recordKey) => {
|
|
5075
5222
|
if (!expandable?.expandedRowRender) {
|
|
5076
5223
|
return;
|
|
@@ -5087,11 +5234,11 @@ function AdsDataTable({
|
|
|
5087
5234
|
},
|
|
5088
5235
|
[expandable, expandedKeys]
|
|
5089
5236
|
);
|
|
5090
|
-
const renderedEmptyState = emptyState ?? /* @__PURE__ */ (0,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5092
|
-
typeof emptyText === "string" ? null : /* @__PURE__ */ (0,
|
|
5237
|
+
const renderedEmptyState = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsEmpty, { className: "min-h-[220px] py-12", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsEmptyContent, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsEmptyHeader, { children: [
|
|
5238
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsEmptyTitle, { children: emptyText ?? messages.table.noDataAvailable }),
|
|
5239
|
+
typeof emptyText === "string" ? null : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsEmptyDescription, { children: messages.table.noDataAvailable })
|
|
5093
5240
|
] }) }) });
|
|
5094
|
-
const handlePaginationChange =
|
|
5241
|
+
const handlePaginationChange = React43.useCallback(
|
|
5095
5242
|
(page, nextPageSize) => {
|
|
5096
5243
|
if (pagination === false) {
|
|
5097
5244
|
return;
|
|
@@ -5106,7 +5253,7 @@ function AdsDataTable({
|
|
|
5106
5253
|
},
|
|
5107
5254
|
[currentPageSize, pagination]
|
|
5108
5255
|
);
|
|
5109
|
-
const handlePageSizeChange =
|
|
5256
|
+
const handlePageSizeChange = React43.useCallback(
|
|
5110
5257
|
(nextPageSize, page) => {
|
|
5111
5258
|
if (pagination === false) {
|
|
5112
5259
|
return;
|
|
@@ -5121,28 +5268,28 @@ function AdsDataTable({
|
|
|
5121
5268
|
},
|
|
5122
5269
|
[pagination]
|
|
5123
5270
|
);
|
|
5124
|
-
const visibleRowEntries =
|
|
5271
|
+
const visibleRowEntries = React43.useMemo(
|
|
5125
5272
|
() => paginatedData.map((record, index) => ({
|
|
5126
5273
|
key: resolveRowKey(record, index, rowKey),
|
|
5127
5274
|
record
|
|
5128
5275
|
})),
|
|
5129
5276
|
[paginatedData, rowKey]
|
|
5130
5277
|
);
|
|
5131
|
-
const visibleSelectableKeys =
|
|
5278
|
+
const visibleSelectableKeys = React43.useMemo(
|
|
5132
5279
|
() => visibleRowEntries.map((entry) => entry.key),
|
|
5133
5280
|
[visibleRowEntries]
|
|
5134
5281
|
);
|
|
5135
|
-
const selectedVisibleCount =
|
|
5282
|
+
const selectedVisibleCount = React43.useMemo(
|
|
5136
5283
|
() => visibleSelectableKeys.filter((key) => selectedKeys.includes(key)).length,
|
|
5137
5284
|
[selectedKeys, visibleSelectableKeys]
|
|
5138
5285
|
);
|
|
5139
5286
|
const allVisibleRowsSelected = visibleSelectableKeys.length > 0 && selectedVisibleCount === visibleSelectableKeys.length;
|
|
5140
5287
|
const someVisibleRowsSelected = selectedVisibleCount > 0 && selectedVisibleCount < visibleSelectableKeys.length;
|
|
5141
|
-
const getColumnWidthOverride =
|
|
5288
|
+
const getColumnWidthOverride = React43.useCallback(
|
|
5142
5289
|
(column, columnKey) => internalColumnWidths[columnKey] ?? getResolvedColumnWidth(column),
|
|
5143
5290
|
[internalColumnWidths]
|
|
5144
5291
|
);
|
|
5145
|
-
const startColumnResize =
|
|
5292
|
+
const startColumnResize = React43.useCallback(
|
|
5146
5293
|
(event, column, columnKey) => {
|
|
5147
5294
|
event.preventDefault();
|
|
5148
5295
|
event.stopPropagation();
|
|
@@ -5173,7 +5320,7 @@ function AdsDataTable({
|
|
|
5173
5320
|
},
|
|
5174
5321
|
[internalColumnWidths]
|
|
5175
5322
|
);
|
|
5176
|
-
const renderColumnHeader =
|
|
5323
|
+
const renderColumnHeader = React43.useCallback(
|
|
5177
5324
|
(column, columnKey, columnSortOrder) => {
|
|
5178
5325
|
const headerTitle = getColumnHeader(column, columnKey);
|
|
5179
5326
|
const hasSorter = Boolean(column.sorter);
|
|
@@ -5184,9 +5331,9 @@ function AdsDataTable({
|
|
|
5184
5331
|
}
|
|
5185
5332
|
const nextOrder = columnSortOrder === null ? "ascend" : columnSortOrder === "ascend" ? "descend" : null;
|
|
5186
5333
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
5187
|
-
return /* @__PURE__ */ (0,
|
|
5188
|
-
/* @__PURE__ */ (0,
|
|
5189
|
-
hasSorter ? /* @__PURE__ */ (0,
|
|
5334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "relative flex min-w-0 items-center gap-2 pr-3", children: [
|
|
5335
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
5336
|
+
hasSorter ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5190
5337
|
Button,
|
|
5191
5338
|
{
|
|
5192
5339
|
"aria-label": `${headerTitle} ${actionLabel}`,
|
|
@@ -5199,13 +5346,13 @@ function AdsDataTable({
|
|
|
5199
5346
|
type: "button",
|
|
5200
5347
|
variant: "ghost",
|
|
5201
5348
|
children: [
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5203
|
-
/* @__PURE__ */ (0,
|
|
5349
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5350
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.ChevronDown, { className: "h-4 w-4 rotate-180" }) : columnSortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
5204
5351
|
]
|
|
5205
5352
|
}
|
|
5206
|
-
) : /* @__PURE__ */ (0,
|
|
5207
|
-
hasFilter ? /* @__PURE__ */ (0,
|
|
5208
|
-
/* @__PURE__ */ (0,
|
|
5353
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5354
|
+
hasFilter ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsPopover, { children: [
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5209
5356
|
Button,
|
|
5210
5357
|
{
|
|
5211
5358
|
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
@@ -5217,10 +5364,10 @@ function AdsDataTable({
|
|
|
5217
5364
|
size: "sm",
|
|
5218
5365
|
type: "button",
|
|
5219
5366
|
variant: "ghost",
|
|
5220
|
-
children: /* @__PURE__ */ (0,
|
|
5367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Filter, { className: "h-3.5 w-3.5" })
|
|
5221
5368
|
}
|
|
5222
5369
|
) }),
|
|
5223
|
-
/* @__PURE__ */ (0,
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5224
5371
|
AdsInput,
|
|
5225
5372
|
{
|
|
5226
5373
|
clearable: true,
|
|
@@ -5233,7 +5380,7 @@ function AdsDataTable({
|
|
|
5233
5380
|
) })
|
|
5234
5381
|
] }) : null
|
|
5235
5382
|
] }),
|
|
5236
|
-
hasResizeHandle ? /* @__PURE__ */ (0,
|
|
5383
|
+
hasResizeHandle ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5237
5384
|
"span",
|
|
5238
5385
|
{
|
|
5239
5386
|
"aria-label": `Resize ${headerTitle} column`,
|
|
@@ -5251,12 +5398,12 @@ function AdsDataTable({
|
|
|
5251
5398
|
},
|
|
5252
5399
|
[activeResize?.columnKey, filterValues, handleFilterChange, handleSortChange, messages.table, startColumnResize]
|
|
5253
5400
|
);
|
|
5254
|
-
const tableNode = /* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5256
|
-
/* @__PURE__ */ (0,
|
|
5257
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5258
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5259
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */ (0,
|
|
5401
|
+
const tableNode = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableSurface, { className: cn("flex min-h-0 flex-1 flex-col", className), children: [
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableScrollArea, { fill, stickyHeader: sticky, x: scroll?.x, y: scroll?.y, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableRoot, { className: tableClassName, children: [
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableColGroup, { children: [
|
|
5404
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCol, { style: { width: rowSelection?.columnWidth ?? 48 } }) : null,
|
|
5405
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCol, { style: { width: 48 } }) : null,
|
|
5406
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5260
5407
|
AdsTableCol,
|
|
5261
5408
|
{
|
|
5262
5409
|
style: getCellStyle(column, getColumnWidthOverride(column, getColumnKey(column, index)))
|
|
@@ -5264,8 +5411,8 @@ function AdsDataTable({
|
|
|
5264
5411
|
getColumnKey(column, index)
|
|
5265
5412
|
))
|
|
5266
5413
|
] }),
|
|
5267
|
-
/* @__PURE__ */ (0,
|
|
5268
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableRow, { children: [
|
|
5415
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableHead, { className: "w-12 p-2", children: rowSelection?.type !== "radio" && !rowSelection?.hideSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5269
5416
|
Checkbox2,
|
|
5270
5417
|
{
|
|
5271
5418
|
"aria-label": messages.table.selectAllRows,
|
|
@@ -5282,11 +5429,11 @@ function AdsDataTable({
|
|
|
5282
5429
|
onClick: (event) => event.stopPropagation()
|
|
5283
5430
|
}
|
|
5284
5431
|
) }) : null }) : null,
|
|
5285
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5432
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableHead, { className: "w-12 p-2" }) : null,
|
|
5286
5433
|
resolvedColumns.map((column, index) => {
|
|
5287
5434
|
const columnKey = getColumnKey(column, index);
|
|
5288
5435
|
const columnSortOrder = sortState?.columnKey === columnKey ? sortState.order : column.sortOrder ?? null;
|
|
5289
|
-
return /* @__PURE__ */ (0,
|
|
5436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5290
5437
|
AdsTableHead,
|
|
5291
5438
|
{
|
|
5292
5439
|
className: cn(density.head, column.className, column.headerClassName),
|
|
@@ -5297,13 +5444,13 @@ function AdsDataTable({
|
|
|
5297
5444
|
);
|
|
5298
5445
|
})
|
|
5299
5446
|
] }) }),
|
|
5300
|
-
/* @__PURE__ */ (0,
|
|
5301
|
-
/* @__PURE__ */ (0,
|
|
5447
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableBody, { children: loading && loadingVariant === "spinner" ? [
|
|
5448
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5302
5449
|
AdsTableCell,
|
|
5303
5450
|
{
|
|
5304
5451
|
className: "p-0",
|
|
5305
5452
|
colSpan: columnCount,
|
|
5306
|
-
children: /* @__PURE__ */ (0,
|
|
5453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5307
5454
|
"div",
|
|
5308
5455
|
{
|
|
5309
5456
|
"aria-label": messages.table.loadingRows,
|
|
@@ -5311,19 +5458,19 @@ function AdsDataTable({
|
|
|
5311
5458
|
className: "flex items-center justify-center px-6 py-8 text-foreground",
|
|
5312
5459
|
role: "status",
|
|
5313
5460
|
style: { minHeight: spinnerLoadingHeight },
|
|
5314
|
-
children: /* @__PURE__ */ (0,
|
|
5461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSpinner, { size: "lg", tone: "foreground" })
|
|
5315
5462
|
}
|
|
5316
5463
|
)
|
|
5317
5464
|
}
|
|
5318
5465
|
) }, "spinner-row")
|
|
5319
|
-
] : loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0,
|
|
5320
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5321
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5322
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */ (0,
|
|
5466
|
+
] : loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableRow, { children: [
|
|
5467
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5468
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5469
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5323
5470
|
AdsTableCell,
|
|
5324
5471
|
{
|
|
5325
5472
|
className: cn(density.cell, column.className),
|
|
5326
|
-
children: /* @__PURE__ */ (0,
|
|
5473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-full rounded" })
|
|
5327
5474
|
},
|
|
5328
5475
|
`${getColumnKey(column, index)}-${skeletonIndex}`
|
|
5329
5476
|
))
|
|
@@ -5332,7 +5479,7 @@ function AdsDataTable({
|
|
|
5332
5479
|
const isExpanded = expandedKeys.includes(recordKey);
|
|
5333
5480
|
const canExpand = !!expandable?.expandedRowRender && (!expandable.rowExpandable || expandable.rowExpandable(record));
|
|
5334
5481
|
const dataRowClassName = typeof rowClassName === "function" ? rowClassName(record, index) : rowClassName;
|
|
5335
|
-
const row = /* @__PURE__ */ (0,
|
|
5482
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5336
5483
|
AdsTableRow,
|
|
5337
5484
|
{
|
|
5338
5485
|
className: cn(
|
|
@@ -5355,7 +5502,7 @@ function AdsDataTable({
|
|
|
5355
5502
|
toggleSelectionFromRowClick(record, recordKey);
|
|
5356
5503
|
},
|
|
5357
5504
|
children: [
|
|
5358
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5505
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5359
5506
|
AdsTableSelectionCell,
|
|
5360
5507
|
{
|
|
5361
5508
|
checked: selectedKeys.includes(recordKey),
|
|
@@ -5371,7 +5518,7 @@ function AdsDataTable({
|
|
|
5371
5518
|
value: String(recordKey)
|
|
5372
5519
|
}
|
|
5373
5520
|
) : null,
|
|
5374
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5521
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5375
5522
|
AdsTableExpandCell,
|
|
5376
5523
|
{
|
|
5377
5524
|
disabled: !canExpand,
|
|
@@ -5384,7 +5531,7 @@ function AdsDataTable({
|
|
|
5384
5531
|
resolveRenderedCellContent(column, record, index),
|
|
5385
5532
|
column.ellipsis
|
|
5386
5533
|
);
|
|
5387
|
-
return /* @__PURE__ */ (0,
|
|
5534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5388
5535
|
AdsTableCell,
|
|
5389
5536
|
{
|
|
5390
5537
|
className: cn(
|
|
@@ -5410,12 +5557,12 @@ function AdsDataTable({
|
|
|
5410
5557
|
}
|
|
5411
5558
|
return [
|
|
5412
5559
|
row,
|
|
5413
|
-
/* @__PURE__ */ (0,
|
|
5560
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5414
5561
|
AdsTableCell,
|
|
5415
5562
|
{
|
|
5416
5563
|
className: "p-0",
|
|
5417
5564
|
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5418
|
-
children: /* @__PURE__ */ (0,
|
|
5565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5419
5566
|
"div",
|
|
5420
5567
|
{
|
|
5421
5568
|
className: cn(
|
|
@@ -5429,7 +5576,7 @@ function AdsDataTable({
|
|
|
5429
5576
|
) }, `${String(recordKey)}-expanded`)
|
|
5430
5577
|
];
|
|
5431
5578
|
}) : [
|
|
5432
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5433
5580
|
AdsTableCell,
|
|
5434
5581
|
{
|
|
5435
5582
|
colSpan: columnCount,
|
|
@@ -5439,8 +5586,8 @@ function AdsDataTable({
|
|
|
5439
5586
|
) }, "empty-row")
|
|
5440
5587
|
] })
|
|
5441
5588
|
] }) }),
|
|
5442
|
-
footer ? /* @__PURE__ */ (0,
|
|
5443
|
-
pagination !== false ? /* @__PURE__ */ (0,
|
|
5589
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "border-t border-border p-3", children: footer }) : null,
|
|
5590
|
+
pagination !== false ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("border-t border-border p-3", classNames?.paginationContainer), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5444
5591
|
AdsDataPagination,
|
|
5445
5592
|
{
|
|
5446
5593
|
ariaLabel: messages.pagination.navigation,
|
|
@@ -5462,7 +5609,7 @@ function AdsDataTable({
|
|
|
5462
5609
|
) }) : null
|
|
5463
5610
|
] });
|
|
5464
5611
|
if (rowSelection?.type === "radio") {
|
|
5465
|
-
return /* @__PURE__ */ (0,
|
|
5612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5466
5613
|
RadioGroup2,
|
|
5467
5614
|
{
|
|
5468
5615
|
onValueChange: (value) => {
|
|
@@ -5483,7 +5630,7 @@ function AdsDataTable({
|
|
|
5483
5630
|
}
|
|
5484
5631
|
|
|
5485
5632
|
// src/components/AdsDataTableToolbar/index.tsx
|
|
5486
|
-
var
|
|
5633
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5487
5634
|
function AdsDataTableToolbar({
|
|
5488
5635
|
action,
|
|
5489
5636
|
className,
|
|
@@ -5495,7 +5642,7 @@ function AdsDataTableToolbar({
|
|
|
5495
5642
|
onSearchChange,
|
|
5496
5643
|
onSearchClear
|
|
5497
5644
|
}) {
|
|
5498
|
-
return /* @__PURE__ */ (0,
|
|
5645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5499
5646
|
"div",
|
|
5500
5647
|
{
|
|
5501
5648
|
className: cn(
|
|
@@ -5503,9 +5650,9 @@ function AdsDataTableToolbar({
|
|
|
5503
5650
|
className
|
|
5504
5651
|
),
|
|
5505
5652
|
children: [
|
|
5506
|
-
/* @__PURE__ */ (0,
|
|
5507
|
-
/* @__PURE__ */ (0,
|
|
5508
|
-
/* @__PURE__ */ (0,
|
|
5653
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "min-w-0 flex-1", children: title ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h2", { className: cn("truncate text-xl font-medium text-white", titleClassName), children: title }) : null }),
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-full flex-col gap-sm md:min-w-0 md:flex-1 md:flex-row md:items-center md:justify-end", children: [
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "min-w-0 md:max-w-[440px] md:flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5509
5656
|
AdsInput,
|
|
5510
5657
|
{
|
|
5511
5658
|
className: cn(
|
|
@@ -5519,7 +5666,7 @@ function AdsDataTableToolbar({
|
|
|
5519
5666
|
value: searchValue
|
|
5520
5667
|
}
|
|
5521
5668
|
) }),
|
|
5522
|
-
action ? /* @__PURE__ */ (0,
|
|
5669
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
5523
5670
|
] })
|
|
5524
5671
|
]
|
|
5525
5672
|
}
|
|
@@ -5527,7 +5674,7 @@ function AdsDataTableToolbar({
|
|
|
5527
5674
|
}
|
|
5528
5675
|
|
|
5529
5676
|
// src/components/AdsViewCustomersDataTable/index.tsx
|
|
5530
|
-
var
|
|
5677
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5531
5678
|
function resolveHeight(value) {
|
|
5532
5679
|
if (value === void 0) {
|
|
5533
5680
|
return 500;
|
|
@@ -5559,13 +5706,13 @@ function AdsViewCustomersDataTable({
|
|
|
5559
5706
|
...props
|
|
5560
5707
|
}) {
|
|
5561
5708
|
const tableHeight = resolveHeight(height);
|
|
5562
|
-
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0,
|
|
5563
|
-
/* @__PURE__ */ (0,
|
|
5564
|
-
/* @__PURE__ */ (0,
|
|
5565
|
-
onRetry ? /* @__PURE__ */ (0,
|
|
5709
|
+
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-h-[500px] flex-col items-center justify-center gap-3 px-6 py-12 text-center", children: [
|
|
5710
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-sm font-medium text-white", children: errorTitle }),
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "max-w-md text-sm text-[#848484]", children: errorDescription }),
|
|
5712
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AdsButton, { intent: "primary", onClick: onRetry, children: retryLabel }) : null
|
|
5566
5713
|
] });
|
|
5567
|
-
return /* @__PURE__ */ (0,
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
5714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "overflow-hidden rounded-xl border border-[#27282F] bg-[#1B1C21]", children: [
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5569
5716
|
AdsDataTableToolbar,
|
|
5570
5717
|
{
|
|
5571
5718
|
action: toolbarAction,
|
|
@@ -5577,7 +5724,7 @@ function AdsViewCustomersDataTable({
|
|
|
5577
5724
|
}
|
|
5578
5725
|
),
|
|
5579
5726
|
error ? resolvedErrorState : null,
|
|
5580
|
-
!error ? /* @__PURE__ */ (0,
|
|
5727
|
+
!error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5581
5728
|
AdsDataTable,
|
|
5582
5729
|
{
|
|
5583
5730
|
...props,
|
|
@@ -5612,20 +5759,20 @@ function AdsViewCustomersDataTable({
|
|
|
5612
5759
|
}
|
|
5613
5760
|
|
|
5614
5761
|
// src/components/AdsProgress/index.tsx
|
|
5615
|
-
var
|
|
5762
|
+
var React45 = __toESM(require("react"), 1);
|
|
5616
5763
|
|
|
5617
5764
|
// src/primitives/progress.tsx
|
|
5618
|
-
var
|
|
5765
|
+
var React44 = __toESM(require("react"), 1);
|
|
5619
5766
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
5620
|
-
var
|
|
5621
|
-
var Progress =
|
|
5767
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5768
|
+
var Progress = React44.forwardRef(({ className, indicatorClassName, value, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5622
5769
|
ProgressPrimitive.Root,
|
|
5623
5770
|
{
|
|
5624
5771
|
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
5625
5772
|
ref,
|
|
5626
5773
|
value,
|
|
5627
5774
|
...props,
|
|
5628
|
-
children: /* @__PURE__ */ (0,
|
|
5775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5629
5776
|
ProgressPrimitive.Indicator,
|
|
5630
5777
|
{
|
|
5631
5778
|
className: cn("h-full w-full flex-1 bg-primary transition-all", indicatorClassName),
|
|
@@ -5637,13 +5784,13 @@ var Progress = React43.forwardRef(({ className, indicatorClassName, value, ...pr
|
|
|
5637
5784
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
5638
5785
|
|
|
5639
5786
|
// src/components/AdsProgress/index.tsx
|
|
5640
|
-
var
|
|
5787
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5641
5788
|
var progressBaseClassName = "h-2 rounded-radius-full bg-[color:color-mix(in_srgb,var(--primary)_20%,transparent)]";
|
|
5642
5789
|
var progressIndicatorVariantClassName = {
|
|
5643
5790
|
ai: "bg-brand-gradient",
|
|
5644
5791
|
default: "bg-primary"
|
|
5645
5792
|
};
|
|
5646
|
-
var Progress2 =
|
|
5793
|
+
var Progress2 = React45.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5647
5794
|
Progress,
|
|
5648
5795
|
{
|
|
5649
5796
|
className: cn(progressBaseClassName, className),
|
|
@@ -5653,7 +5800,7 @@ var Progress2 = React44.forwardRef(({ className, indicatorClassName, ...props },
|
|
|
5653
5800
|
}
|
|
5654
5801
|
));
|
|
5655
5802
|
Progress2.displayName = "Progress";
|
|
5656
|
-
var AdsProgress =
|
|
5803
|
+
var AdsProgress = React45.forwardRef(
|
|
5657
5804
|
({
|
|
5658
5805
|
className,
|
|
5659
5806
|
descriptionPlacement = "above",
|
|
@@ -5672,12 +5819,12 @@ var AdsProgress = React44.forwardRef(
|
|
|
5672
5819
|
id
|
|
5673
5820
|
});
|
|
5674
5821
|
const labelId = label ? `${description.inputId}-label` : void 0;
|
|
5675
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5676
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5677
|
-
return /* @__PURE__ */ (0,
|
|
5678
|
-
label ? /* @__PURE__ */ (0,
|
|
5822
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5823
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(AdsFieldItem, { children: [
|
|
5825
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldLabel, { id: labelId, children: label }) : null,
|
|
5679
5826
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5680
|
-
/* @__PURE__ */ (0,
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5681
5828
|
Progress,
|
|
5682
5829
|
{
|
|
5683
5830
|
"aria-describedby": description.describedBy,
|
|
@@ -5701,13 +5848,13 @@ var AdsProgress = React44.forwardRef(
|
|
|
5701
5848
|
AdsProgress.displayName = "AdsProgress";
|
|
5702
5849
|
|
|
5703
5850
|
// src/components/AdsSlider/index.tsx
|
|
5704
|
-
var
|
|
5851
|
+
var React47 = __toESM(require("react"), 1);
|
|
5705
5852
|
|
|
5706
5853
|
// src/primitives/slider.tsx
|
|
5707
|
-
var
|
|
5854
|
+
var React46 = __toESM(require("react"), 1);
|
|
5708
5855
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
5709
|
-
var
|
|
5710
|
-
var Slider =
|
|
5856
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5857
|
+
var Slider = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5711
5858
|
SliderPrimitive.Root,
|
|
5712
5859
|
{
|
|
5713
5860
|
ref,
|
|
@@ -5717,10 +5864,10 @@ var Slider = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5717
5864
|
),
|
|
5718
5865
|
...props,
|
|
5719
5866
|
children: [
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5867
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
5721
5868
|
Array.from({
|
|
5722
5869
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5723
|
-
}).map((_, index) => /* @__PURE__ */ (0,
|
|
5870
|
+
}).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5724
5871
|
SliderPrimitive.Thumb,
|
|
5725
5872
|
{
|
|
5726
5873
|
className: "block h-5 w-5 rounded-full border border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
@@ -5733,11 +5880,11 @@ var Slider = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5733
5880
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5734
5881
|
|
|
5735
5882
|
// src/components/AdsSlider/index.tsx
|
|
5736
|
-
var
|
|
5883
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5737
5884
|
var sliderBaseClassName = "py-1";
|
|
5738
|
-
var Slider2 =
|
|
5885
|
+
var Slider2 = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5739
5886
|
Slider2.displayName = "Slider";
|
|
5740
|
-
var AdsSlider =
|
|
5887
|
+
var AdsSlider = React47.forwardRef(
|
|
5741
5888
|
({
|
|
5742
5889
|
className,
|
|
5743
5890
|
descriptionPlacement = "above",
|
|
@@ -5752,12 +5899,12 @@ var AdsSlider = React46.forwardRef(
|
|
|
5752
5899
|
helperText,
|
|
5753
5900
|
id
|
|
5754
5901
|
});
|
|
5755
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5756
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5757
|
-
return /* @__PURE__ */ (0,
|
|
5758
|
-
label ? /* @__PURE__ */ (0,
|
|
5902
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5903
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(AdsFieldItem, { children: [
|
|
5905
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
5759
5906
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5760
|
-
/* @__PURE__ */ (0,
|
|
5907
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5761
5908
|
Slider2,
|
|
5762
5909
|
{
|
|
5763
5910
|
"aria-describedby": description.describedBy,
|
|
@@ -5774,13 +5921,13 @@ var AdsSlider = React46.forwardRef(
|
|
|
5774
5921
|
AdsSlider.displayName = "AdsSlider";
|
|
5775
5922
|
|
|
5776
5923
|
// src/components/AdsSwitch/index.tsx
|
|
5777
|
-
var
|
|
5924
|
+
var React49 = __toESM(require("react"), 1);
|
|
5778
5925
|
|
|
5779
5926
|
// src/primitives/switch.tsx
|
|
5780
|
-
var
|
|
5927
|
+
var React48 = __toESM(require("react"), 1);
|
|
5781
5928
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
5782
|
-
var
|
|
5783
|
-
var Switch =
|
|
5929
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5930
|
+
var Switch = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5784
5931
|
SwitchPrimitives.Root,
|
|
5785
5932
|
{
|
|
5786
5933
|
className: cn(
|
|
@@ -5789,7 +5936,7 @@ var Switch = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5789
5936
|
),
|
|
5790
5937
|
...props,
|
|
5791
5938
|
ref,
|
|
5792
|
-
children: /* @__PURE__ */ (0,
|
|
5939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5793
5940
|
SwitchPrimitives.Thumb,
|
|
5794
5941
|
{
|
|
5795
5942
|
className: cn(
|
|
@@ -5802,15 +5949,15 @@ var Switch = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5802
5949
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5803
5950
|
|
|
5804
5951
|
// src/components/AdsSwitch/index.tsx
|
|
5805
|
-
var
|
|
5952
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5806
5953
|
var switchBaseClassName = "h-6 w-11 border border-transparent bg-muted shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted";
|
|
5807
|
-
var Switch2 =
|
|
5954
|
+
var Switch2 = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
5808
5955
|
Switch2.displayName = "Switch";
|
|
5809
|
-
var AdsSwitch =
|
|
5810
|
-
const generatedId =
|
|
5956
|
+
var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
5957
|
+
const generatedId = React49.useId();
|
|
5811
5958
|
const inputId = id ?? generatedId;
|
|
5812
5959
|
if (!label) {
|
|
5813
|
-
return /* @__PURE__ */ (0,
|
|
5960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5814
5961
|
Switch2,
|
|
5815
5962
|
{
|
|
5816
5963
|
className: cn(className, switchClassName),
|
|
@@ -5820,12 +5967,12 @@ var AdsSwitch = React48.forwardRef(({ className, description, id, label, switchC
|
|
|
5820
5967
|
}
|
|
5821
5968
|
);
|
|
5822
5969
|
}
|
|
5823
|
-
return /* @__PURE__ */ (0,
|
|
5824
|
-
/* @__PURE__ */ (0,
|
|
5825
|
-
/* @__PURE__ */ (0,
|
|
5826
|
-
description ? /* @__PURE__ */ (0,
|
|
5970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex w-full items-start gap-3", children: [
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5 pt-0.5", children: [
|
|
5972
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }),
|
|
5973
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
5827
5974
|
] }),
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5975
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5829
5976
|
Switch2,
|
|
5830
5977
|
{
|
|
5831
5978
|
className: cn(className, switchClassName),
|
|
@@ -5839,14 +5986,14 @@ var AdsSwitch = React48.forwardRef(({ className, description, id, label, switchC
|
|
|
5839
5986
|
AdsSwitch.displayName = "AdsSwitch";
|
|
5840
5987
|
|
|
5841
5988
|
// src/components/AdsTabs/index.tsx
|
|
5842
|
-
var
|
|
5989
|
+
var React51 = __toESM(require("react"), 1);
|
|
5843
5990
|
|
|
5844
5991
|
// src/primitives/tabs.tsx
|
|
5845
|
-
var
|
|
5992
|
+
var React50 = __toESM(require("react"), 1);
|
|
5846
5993
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
5847
|
-
var
|
|
5994
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5848
5995
|
var Tabs = TabsPrimitive.Root;
|
|
5849
|
-
var TabsList =
|
|
5996
|
+
var TabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5850
5997
|
TabsPrimitive.List,
|
|
5851
5998
|
{
|
|
5852
5999
|
className: cn("inline-flex items-center", className),
|
|
@@ -5855,7 +6002,7 @@ var TabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5855
6002
|
}
|
|
5856
6003
|
));
|
|
5857
6004
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5858
|
-
var TabsTrigger =
|
|
6005
|
+
var TabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5859
6006
|
TabsPrimitive.Trigger,
|
|
5860
6007
|
{
|
|
5861
6008
|
className: cn(
|
|
@@ -5867,7 +6014,7 @@ var TabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5867
6014
|
}
|
|
5868
6015
|
));
|
|
5869
6016
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5870
|
-
var TabsContent =
|
|
6017
|
+
var TabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5871
6018
|
TabsPrimitive.Content,
|
|
5872
6019
|
{
|
|
5873
6020
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -5878,9 +6025,9 @@ var TabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5878
6025
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5879
6026
|
|
|
5880
6027
|
// src/components/AdsTabs/index.tsx
|
|
5881
|
-
var
|
|
6028
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5882
6029
|
var AdsTabs = Tabs;
|
|
5883
|
-
var AdsTabsList =
|
|
6030
|
+
var AdsTabsList = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5884
6031
|
TabsList,
|
|
5885
6032
|
{
|
|
5886
6033
|
className: cn(
|
|
@@ -5892,7 +6039,7 @@ var AdsTabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5892
6039
|
}
|
|
5893
6040
|
));
|
|
5894
6041
|
AdsTabsList.displayName = "AdsTabsList";
|
|
5895
|
-
var AdsTabsTrigger =
|
|
6042
|
+
var AdsTabsTrigger = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5896
6043
|
TabsTrigger,
|
|
5897
6044
|
{
|
|
5898
6045
|
className: cn(
|
|
@@ -5904,7 +6051,7 @@ var AdsTabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5904
6051
|
}
|
|
5905
6052
|
));
|
|
5906
6053
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
5907
|
-
var AdsTabsContent =
|
|
6054
|
+
var AdsTabsContent = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5908
6055
|
TabsContent,
|
|
5909
6056
|
{
|
|
5910
6057
|
className: cn(
|
|
@@ -5918,13 +6065,13 @@ var AdsTabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5918
6065
|
AdsTabsContent.displayName = "AdsTabsContent";
|
|
5919
6066
|
|
|
5920
6067
|
// src/components/AdsToggle/index.tsx
|
|
5921
|
-
var
|
|
6068
|
+
var React53 = __toESM(require("react"), 1);
|
|
5922
6069
|
|
|
5923
6070
|
// src/primitives/toggle.tsx
|
|
5924
|
-
var
|
|
6071
|
+
var React52 = __toESM(require("react"), 1);
|
|
5925
6072
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
5926
|
-
var
|
|
5927
|
-
var Toggle =
|
|
6073
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6074
|
+
var Toggle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5928
6075
|
TogglePrimitive.Root,
|
|
5929
6076
|
{
|
|
5930
6077
|
className: cn(
|
|
@@ -5938,7 +6085,7 @@ var Toggle = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5938
6085
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5939
6086
|
|
|
5940
6087
|
// src/components/AdsToggle/index.tsx
|
|
5941
|
-
var
|
|
6088
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5942
6089
|
var sizeClassName3 = {
|
|
5943
6090
|
sm: "!h-8 px-[6px] text-sm",
|
|
5944
6091
|
md: "!h-9 px-md text-sm",
|
|
@@ -5953,10 +6100,10 @@ var variantClassName = {
|
|
|
5953
6100
|
default: "border border-transparent bg-transparent text-foreground shadow-none hover:bg-muted/70 data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]",
|
|
5954
6101
|
outline: "border border-border bg-transparent text-foreground shadow-none hover:bg-muted/70 data-[state=on]:border-transparent data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]"
|
|
5955
6102
|
};
|
|
5956
|
-
var AdsToggle =
|
|
5957
|
-
const childCount =
|
|
5958
|
-
const isIconOnly = childCount === 1 &&
|
|
5959
|
-
return /* @__PURE__ */ (0,
|
|
6103
|
+
var AdsToggle = React53.forwardRef(({ children, className, size = "md", variant = "default", ...props }, ref) => {
|
|
6104
|
+
const childCount = React53.Children.count(children);
|
|
6105
|
+
const isIconOnly = childCount === 1 && React53.isValidElement(children);
|
|
6106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5960
6107
|
Toggle,
|
|
5961
6108
|
{
|
|
5962
6109
|
className: cn(
|
|
@@ -5975,13 +6122,13 @@ var AdsToggle = React52.forwardRef(({ children, className, size = "md", variant
|
|
|
5975
6122
|
AdsToggle.displayName = "AdsToggle";
|
|
5976
6123
|
|
|
5977
6124
|
// src/components/AdsToggleGroup/index.tsx
|
|
5978
|
-
var
|
|
6125
|
+
var React55 = __toESM(require("react"), 1);
|
|
5979
6126
|
|
|
5980
6127
|
// src/primitives/toggle-group.tsx
|
|
5981
|
-
var
|
|
6128
|
+
var React54 = __toESM(require("react"), 1);
|
|
5982
6129
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
5983
|
-
var
|
|
5984
|
-
var ToggleGroup =
|
|
6130
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6131
|
+
var ToggleGroup = React54.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5985
6132
|
ToggleGroupPrimitive.Root,
|
|
5986
6133
|
{
|
|
5987
6134
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -5990,7 +6137,7 @@ var ToggleGroup = React53.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5990
6137
|
}
|
|
5991
6138
|
));
|
|
5992
6139
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
5993
|
-
var ToggleGroupItem =
|
|
6140
|
+
var ToggleGroupItem = React54.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5994
6141
|
ToggleGroupPrimitive.Item,
|
|
5995
6142
|
{
|
|
5996
6143
|
className: cn(
|
|
@@ -6004,7 +6151,7 @@ var ToggleGroupItem = React53.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
6004
6151
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
6005
6152
|
|
|
6006
6153
|
// src/components/AdsToggleGroup/index.tsx
|
|
6007
|
-
var
|
|
6154
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6008
6155
|
var sizeClassName4 = {
|
|
6009
6156
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
6010
6157
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -6014,8 +6161,8 @@ var variantClassName2 = {
|
|
|
6014
6161
|
default: "border-transparent bg-transparent text-foreground hover:bg-muted/70 data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]",
|
|
6015
6162
|
outline: "border border-border bg-transparent text-foreground hover:bg-muted/70 data-[state=on]:border-transparent data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]"
|
|
6016
6163
|
};
|
|
6017
|
-
var AdsToggleGroupContext =
|
|
6018
|
-
var AdsToggleGroup =
|
|
6164
|
+
var AdsToggleGroupContext = React55.createContext(null);
|
|
6165
|
+
var AdsToggleGroup = React55.forwardRef(
|
|
6019
6166
|
({
|
|
6020
6167
|
children,
|
|
6021
6168
|
className,
|
|
@@ -6023,7 +6170,7 @@ var AdsToggleGroup = React54.forwardRef(
|
|
|
6023
6170
|
size = "md",
|
|
6024
6171
|
variant = "default",
|
|
6025
6172
|
...props
|
|
6026
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
6173
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6027
6174
|
ToggleGroup,
|
|
6028
6175
|
{
|
|
6029
6176
|
className: cn(
|
|
@@ -6039,12 +6186,12 @@ var AdsToggleGroup = React54.forwardRef(
|
|
|
6039
6186
|
) })
|
|
6040
6187
|
);
|
|
6041
6188
|
AdsToggleGroup.displayName = "AdsToggleGroup";
|
|
6042
|
-
var AdsToggleGroupItem =
|
|
6043
|
-
const context =
|
|
6189
|
+
var AdsToggleGroupItem = React55.forwardRef(({ className, size, variant, ...props }, ref) => {
|
|
6190
|
+
const context = React55.useContext(AdsToggleGroupContext);
|
|
6044
6191
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
6045
6192
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
6046
6193
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
6047
|
-
return /* @__PURE__ */ (0,
|
|
6194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6048
6195
|
ToggleGroupItem,
|
|
6049
6196
|
{
|
|
6050
6197
|
className: cn(
|
|
@@ -6062,10 +6209,10 @@ var AdsToggleGroupItem = React54.forwardRef(({ className, size, variant, ...prop
|
|
|
6062
6209
|
AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
6063
6210
|
|
|
6064
6211
|
// src/components/AdsTextarea/index.tsx
|
|
6065
|
-
var
|
|
6066
|
-
var
|
|
6212
|
+
var React56 = __toESM(require("react"), 1);
|
|
6213
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6067
6214
|
var textareaBaseClassName = "w-full rounded-radius-md border border-border bg-card px-md py-md text-base leading-6 shadow-[0px_1px_2px_rgba(0,0,0,0.1)] placeholder:text-[var(--muted-foreground)] focus-visible:border-border-focus focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50";
|
|
6068
|
-
var AdsTextarea =
|
|
6215
|
+
var AdsTextarea = React56.forwardRef(
|
|
6069
6216
|
({
|
|
6070
6217
|
action,
|
|
6071
6218
|
className,
|
|
@@ -6084,12 +6231,12 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6084
6231
|
helperText,
|
|
6085
6232
|
id
|
|
6086
6233
|
});
|
|
6087
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
6088
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
6089
|
-
return /* @__PURE__ */ (0,
|
|
6090
|
-
label ? /* @__PURE__ */ (0,
|
|
6234
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6235
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(AdsFieldItem, { children: [
|
|
6237
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
6091
6238
|
descriptionPlacement === "above" ? helperNode : null,
|
|
6092
|
-
/* @__PURE__ */ (0,
|
|
6239
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6093
6240
|
Textarea,
|
|
6094
6241
|
{
|
|
6095
6242
|
"aria-describedby": description.describedBy,
|
|
@@ -6107,7 +6254,7 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6107
6254
|
...props
|
|
6108
6255
|
}
|
|
6109
6256
|
),
|
|
6110
|
-
action ? /* @__PURE__ */ (0,
|
|
6257
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
6111
6258
|
descriptionPlacement === "below" ? helperNode : null,
|
|
6112
6259
|
errorNode
|
|
6113
6260
|
] });
|
|
@@ -6116,17 +6263,17 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6116
6263
|
AdsTextarea.displayName = "AdsTextarea";
|
|
6117
6264
|
|
|
6118
6265
|
// src/components/AdsTooltip/index.tsx
|
|
6119
|
-
var
|
|
6266
|
+
var React58 = __toESM(require("react"), 1);
|
|
6120
6267
|
|
|
6121
6268
|
// src/primitives/tooltip.tsx
|
|
6122
|
-
var
|
|
6269
|
+
var React57 = __toESM(require("react"), 1);
|
|
6123
6270
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
6124
|
-
var
|
|
6271
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6125
6272
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6126
6273
|
var Tooltip = TooltipPrimitive.Root;
|
|
6127
6274
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6128
6275
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
6129
|
-
var TooltipContent =
|
|
6276
|
+
var TooltipContent = React57.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6130
6277
|
TooltipPrimitive.Content,
|
|
6131
6278
|
{
|
|
6132
6279
|
className: cn(
|
|
@@ -6141,12 +6288,12 @@ var TooltipContent = React56.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
6141
6288
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6142
6289
|
|
|
6143
6290
|
// src/components/AdsTooltip/index.tsx
|
|
6144
|
-
var
|
|
6291
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6145
6292
|
var tooltipContentClassName = "z-50 rounded-[6px] border-0 bg-[#844fff] px-3 py-2 text-sm font-normal leading-5 text-[#fdfdfd] shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
6146
6293
|
var AdsTooltipProvider = TooltipProvider;
|
|
6147
6294
|
var AdsTooltip = Tooltip;
|
|
6148
6295
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
6149
|
-
var AdsTooltipContent =
|
|
6296
|
+
var AdsTooltipContent = React58.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6150
6297
|
TooltipContent,
|
|
6151
6298
|
{
|
|
6152
6299
|
align,
|
|
@@ -6157,7 +6304,7 @@ var AdsTooltipContent = React57.forwardRef(({ align = "center", className, sideO
|
|
|
6157
6304
|
}
|
|
6158
6305
|
));
|
|
6159
6306
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
6160
|
-
var AdsTooltipArrow =
|
|
6307
|
+
var AdsTooltipArrow = React58.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6161
6308
|
TooltipArrow,
|
|
6162
6309
|
{
|
|
6163
6310
|
className: cn("fill-[#844fff]", className),
|
|
@@ -6170,10 +6317,10 @@ var AdsTooltipArrow = React57.forwardRef(({ className, height = 5, width = 10, .
|
|
|
6170
6317
|
AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
6171
6318
|
|
|
6172
6319
|
// src/components/AdsToast/index.tsx
|
|
6173
|
-
var
|
|
6320
|
+
var React59 = __toESM(require("react"), 1);
|
|
6174
6321
|
var import_lucide_react17 = require("lucide-react");
|
|
6175
6322
|
var import_sonner = require("sonner");
|
|
6176
|
-
var
|
|
6323
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6177
6324
|
var adsToastIconMap = {
|
|
6178
6325
|
success: import_lucide_react17.CircleCheck,
|
|
6179
6326
|
info: import_lucide_react17.Info,
|
|
@@ -6189,7 +6336,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6189
6336
|
return null;
|
|
6190
6337
|
}
|
|
6191
6338
|
const Icon2 = adsToastIconMap[intent];
|
|
6192
|
-
return /* @__PURE__ */ (0,
|
|
6339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6193
6340
|
Icon2,
|
|
6194
6341
|
{
|
|
6195
6342
|
"aria-hidden": true,
|
|
@@ -6202,7 +6349,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6202
6349
|
}
|
|
6203
6350
|
);
|
|
6204
6351
|
}
|
|
6205
|
-
var AdsToast =
|
|
6352
|
+
var AdsToast = React59.forwardRef(
|
|
6206
6353
|
({
|
|
6207
6354
|
action,
|
|
6208
6355
|
className,
|
|
@@ -6213,7 +6360,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6213
6360
|
...props
|
|
6214
6361
|
}, ref) => {
|
|
6215
6362
|
const resolvedIcon = resolveToastIcon(intent, icon);
|
|
6216
|
-
return /* @__PURE__ */ (0,
|
|
6363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6217
6364
|
"div",
|
|
6218
6365
|
{
|
|
6219
6366
|
className: cn(
|
|
@@ -6228,8 +6375,8 @@ var AdsToast = React58.forwardRef(
|
|
|
6228
6375
|
...props,
|
|
6229
6376
|
children: [
|
|
6230
6377
|
resolvedIcon,
|
|
6231
|
-
/* @__PURE__ */ (0,
|
|
6232
|
-
/* @__PURE__ */ (0,
|
|
6378
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6379
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6233
6380
|
"p",
|
|
6234
6381
|
{
|
|
6235
6382
|
className: cn(
|
|
@@ -6239,7 +6386,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6239
6386
|
children: title
|
|
6240
6387
|
}
|
|
6241
6388
|
),
|
|
6242
|
-
description ? /* @__PURE__ */ (0,
|
|
6389
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6243
6390
|
"p",
|
|
6244
6391
|
{
|
|
6245
6392
|
className: cn(
|
|
@@ -6250,7 +6397,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6250
6397
|
}
|
|
6251
6398
|
) : null
|
|
6252
6399
|
] }),
|
|
6253
|
-
action ? /* @__PURE__ */ (0,
|
|
6400
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6254
6401
|
AdsButton,
|
|
6255
6402
|
{
|
|
6256
6403
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -6276,7 +6423,7 @@ function AdsToaster({
|
|
|
6276
6423
|
...props
|
|
6277
6424
|
}) {
|
|
6278
6425
|
const { messages } = useAdsI18n();
|
|
6279
|
-
return /* @__PURE__ */ (0,
|
|
6426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6280
6427
|
import_sonner.Toaster,
|
|
6281
6428
|
{
|
|
6282
6429
|
closeButton: false,
|
|
@@ -6294,7 +6441,7 @@ function AdsToaster({
|
|
|
6294
6441
|
);
|
|
6295
6442
|
}
|
|
6296
6443
|
function toStageNode(intent, title, options) {
|
|
6297
|
-
return /* @__PURE__ */ (0,
|
|
6444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6298
6445
|
AdsToast,
|
|
6299
6446
|
{
|
|
6300
6447
|
action: options?.action,
|
|
@@ -6308,7 +6455,7 @@ function toStageNode(intent, title, options) {
|
|
|
6308
6455
|
function showAdsToast(intent, title, options) {
|
|
6309
6456
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
6310
6457
|
return import_sonner.toast.custom(
|
|
6311
|
-
(id) => /* @__PURE__ */ (0,
|
|
6458
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6312
6459
|
AdsToast,
|
|
6313
6460
|
{
|
|
6314
6461
|
action: action ? {
|
|
@@ -6362,10 +6509,10 @@ var AdsToastManager = Object.assign(
|
|
|
6362
6509
|
);
|
|
6363
6510
|
|
|
6364
6511
|
// src/components/AdsDialog/index.tsx
|
|
6365
|
-
var
|
|
6512
|
+
var React60 = __toESM(require("react"), 1);
|
|
6366
6513
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
6367
6514
|
var import_lucide_react18 = require("lucide-react");
|
|
6368
|
-
var
|
|
6515
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6369
6516
|
var overlayClassName2 = "fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
|
|
6370
6517
|
var contentClassName2 = "fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-[423px] -translate-x-1/2 -translate-y-1/2 flex-col gap-lg overflow-hidden rounded-radius-md border border-border bg-card p-xl shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.1),0px_10px_15px_-3px_rgba(0,0,0,0.1)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]";
|
|
6371
6518
|
var bodyClassName = "min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]";
|
|
@@ -6373,7 +6520,7 @@ var closeButtonClassName = "absolute right-xl top-xl inline-flex h-6 w-6 items-c
|
|
|
6373
6520
|
var Dialog = DialogPrimitive.Root;
|
|
6374
6521
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
6375
6522
|
var DialogPortal = DialogPrimitive.Portal;
|
|
6376
|
-
var DialogOverlay =
|
|
6523
|
+
var DialogOverlay = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6377
6524
|
DialogPrimitive.Overlay,
|
|
6378
6525
|
{
|
|
6379
6526
|
className: cn(overlayClassName2, className),
|
|
@@ -6382,7 +6529,7 @@ var DialogOverlay = React59.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
6382
6529
|
}
|
|
6383
6530
|
));
|
|
6384
6531
|
DialogOverlay.displayName = "DialogOverlay";
|
|
6385
|
-
var DialogClose =
|
|
6532
|
+
var DialogClose = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6386
6533
|
DialogPrimitive.Close,
|
|
6387
6534
|
{
|
|
6388
6535
|
className: cn(
|
|
@@ -6396,8 +6543,8 @@ var DialogClose = React59.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6396
6543
|
DialogClose.displayName = "DialogClose";
|
|
6397
6544
|
function flattenDialogChildren(children) {
|
|
6398
6545
|
const nodes = [];
|
|
6399
|
-
|
|
6400
|
-
if (
|
|
6546
|
+
React60.Children.forEach(children, (child) => {
|
|
6547
|
+
if (React60.isValidElement(child) && child.type === React60.Fragment) {
|
|
6401
6548
|
nodes.push(...flattenDialogChildren(child.props.children));
|
|
6402
6549
|
return;
|
|
6403
6550
|
}
|
|
@@ -6406,10 +6553,10 @@ function flattenDialogChildren(children) {
|
|
|
6406
6553
|
return nodes;
|
|
6407
6554
|
}
|
|
6408
6555
|
function isDialogSlotElement(child, component) {
|
|
6409
|
-
return
|
|
6556
|
+
return React60.isValidElement(child) && child.type === component;
|
|
6410
6557
|
}
|
|
6411
|
-
var DialogBody =
|
|
6412
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6558
|
+
var DialogBody = React60.forwardRef(
|
|
6559
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6413
6560
|
"div",
|
|
6414
6561
|
{
|
|
6415
6562
|
className: cn(bodyClassName, className),
|
|
@@ -6420,7 +6567,7 @@ var DialogBody = React59.forwardRef(
|
|
|
6420
6567
|
)
|
|
6421
6568
|
);
|
|
6422
6569
|
DialogBody.displayName = "DialogBody";
|
|
6423
|
-
var DialogContent =
|
|
6570
|
+
var DialogContent = React60.forwardRef(
|
|
6424
6571
|
({ children, className, closeLabel, hideCloseButton = false, ...props }, ref) => {
|
|
6425
6572
|
const { messages } = useAdsI18n();
|
|
6426
6573
|
const resolvedCloseLabel = closeLabel ?? messages.dialog.close;
|
|
@@ -6465,9 +6612,9 @@ var DialogContent = React59.forwardRef(
|
|
|
6465
6612
|
const looseBodyNodes = bodyNodes.filter(
|
|
6466
6613
|
(child) => !isDialogSlotElement(child, DialogBody)
|
|
6467
6614
|
);
|
|
6468
|
-
return /* @__PURE__ */ (0,
|
|
6469
|
-
/* @__PURE__ */ (0,
|
|
6470
|
-
/* @__PURE__ */ (0,
|
|
6615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DialogPortal, { children: [
|
|
6616
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogOverlay, {}),
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6471
6618
|
DialogPrimitive.Content,
|
|
6472
6619
|
{
|
|
6473
6620
|
"data-slot": "ads-dialog-content",
|
|
@@ -6480,18 +6627,18 @@ var DialogContent = React59.forwardRef(
|
|
|
6480
6627
|
...props,
|
|
6481
6628
|
children: [
|
|
6482
6629
|
headerNode,
|
|
6483
|
-
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6630
|
+
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogHeader, { children: generatedHeaderNodes }) : null,
|
|
6484
6631
|
explicitBodyNodes.length > 0 ? explicitBodyNodes : null,
|
|
6485
|
-
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6632
|
+
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogBody, { children: looseBodyNodes }) : null,
|
|
6486
6633
|
footerNode,
|
|
6487
|
-
!hideCloseButton ? /* @__PURE__ */ (0,
|
|
6634
|
+
!hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6488
6635
|
DialogPrimitive.Close,
|
|
6489
6636
|
{
|
|
6490
6637
|
"aria-label": resolvedCloseLabel,
|
|
6491
6638
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
6492
6639
|
children: [
|
|
6493
|
-
/* @__PURE__ */ (0,
|
|
6494
|
-
/* @__PURE__ */ (0,
|
|
6640
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react18.X, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
6641
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "sr-only", children: resolvedCloseLabel })
|
|
6495
6642
|
]
|
|
6496
6643
|
}
|
|
6497
6644
|
) : null
|
|
@@ -6502,8 +6649,8 @@ var DialogContent = React59.forwardRef(
|
|
|
6502
6649
|
}
|
|
6503
6650
|
);
|
|
6504
6651
|
DialogContent.displayName = "DialogContent";
|
|
6505
|
-
var DialogHeader =
|
|
6506
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6652
|
+
var DialogHeader = React60.forwardRef(
|
|
6653
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6507
6654
|
"div",
|
|
6508
6655
|
{
|
|
6509
6656
|
"data-slot": "ads-dialog-header",
|
|
@@ -6514,8 +6661,8 @@ var DialogHeader = React59.forwardRef(
|
|
|
6514
6661
|
)
|
|
6515
6662
|
);
|
|
6516
6663
|
DialogHeader.displayName = "DialogHeader";
|
|
6517
|
-
var DialogFooter =
|
|
6518
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6664
|
+
var DialogFooter = React60.forwardRef(
|
|
6665
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6519
6666
|
"div",
|
|
6520
6667
|
{
|
|
6521
6668
|
"data-slot": "ads-dialog-footer",
|
|
@@ -6529,7 +6676,7 @@ var DialogFooter = React59.forwardRef(
|
|
|
6529
6676
|
)
|
|
6530
6677
|
);
|
|
6531
6678
|
DialogFooter.displayName = "DialogFooter";
|
|
6532
|
-
var DialogTitle =
|
|
6679
|
+
var DialogTitle = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6533
6680
|
DialogPrimitive.Title,
|
|
6534
6681
|
{
|
|
6535
6682
|
className: cn(
|
|
@@ -6542,7 +6689,7 @@ var DialogTitle = React59.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6542
6689
|
}
|
|
6543
6690
|
));
|
|
6544
6691
|
DialogTitle.displayName = "DialogTitle";
|
|
6545
|
-
var DialogDescription =
|
|
6692
|
+
var DialogDescription = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6546
6693
|
DialogPrimitive.Description,
|
|
6547
6694
|
{
|
|
6548
6695
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -6565,7 +6712,7 @@ var AdsDialogDescription = DialogDescription;
|
|
|
6565
6712
|
|
|
6566
6713
|
// src/components/AdsMasonry/index.tsx
|
|
6567
6714
|
var import_masonic = require("masonic");
|
|
6568
|
-
var
|
|
6715
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6569
6716
|
var DEFAULT_COLUMN_WIDTH = 240;
|
|
6570
6717
|
var DEFAULT_GAP = 16;
|
|
6571
6718
|
var DEFAULT_ITEM_HEIGHT_ESTIMATE = 280;
|
|
@@ -6601,7 +6748,7 @@ function AdsMasonry({
|
|
|
6601
6748
|
{ length: loadingItemCount },
|
|
6602
6749
|
(_, index) => index
|
|
6603
6750
|
);
|
|
6604
|
-
return /* @__PURE__ */ (0,
|
|
6751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6605
6752
|
"div",
|
|
6606
6753
|
{
|
|
6607
6754
|
className: cn(
|
|
@@ -6613,20 +6760,20 @@ function AdsMasonry({
|
|
|
6613
6760
|
const mediaHeight = LOADING_MEDIA_HEIGHT_PATTERN[index % LOADING_MEDIA_HEIGHT_PATTERN.length];
|
|
6614
6761
|
const titleWidth = LOADING_TITLE_WIDTH_PATTERN[index % LOADING_TITLE_WIDTH_PATTERN.length];
|
|
6615
6762
|
const bodyWidth = LOADING_BODY_WIDTH_PATTERN[index % LOADING_BODY_WIDTH_PATTERN.length];
|
|
6616
|
-
return /* @__PURE__ */ (0,
|
|
6763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
6617
6764
|
"article",
|
|
6618
6765
|
{
|
|
6619
6766
|
className: "overflow-hidden rounded-radius-lg border border-border bg-card shadow-showcase",
|
|
6620
6767
|
"data-slot": "ads-masonry-loading-card",
|
|
6621
6768
|
"data-testid": "ads-masonry-loading-card",
|
|
6622
6769
|
children: [
|
|
6623
|
-
/* @__PURE__ */ (0,
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6624
6771
|
"div",
|
|
6625
6772
|
{
|
|
6626
6773
|
className: "border-b border-border/60 bg-surface-inset/50",
|
|
6627
6774
|
"data-slot": "ads-masonry-skeleton-preview",
|
|
6628
6775
|
"data-testid": "ads-masonry-skeleton-preview",
|
|
6629
|
-
children: /* @__PURE__ */ (0,
|
|
6776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6630
6777
|
AdsSkeleton,
|
|
6631
6778
|
{
|
|
6632
6779
|
className: cn("w-full rounded-none", classNames?.skeleton),
|
|
@@ -6637,10 +6784,10 @@ function AdsMasonry({
|
|
|
6637
6784
|
)
|
|
6638
6785
|
}
|
|
6639
6786
|
),
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6641
|
-
/* @__PURE__ */ (0,
|
|
6642
|
-
/* @__PURE__ */ (0,
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6787
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-4 p-lg", children: [
|
|
6788
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
6790
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6644
6791
|
AdsSkeleton,
|
|
6645
6792
|
{
|
|
6646
6793
|
className: cn("h-3 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6648,7 +6795,7 @@ function AdsMasonry({
|
|
|
6648
6795
|
"data-testid": "ads-masonry-skeleton"
|
|
6649
6796
|
}
|
|
6650
6797
|
),
|
|
6651
|
-
/* @__PURE__ */ (0,
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6652
6799
|
AdsSkeleton,
|
|
6653
6800
|
{
|
|
6654
6801
|
className: cn("h-6 rounded-full", classNames?.skeleton),
|
|
@@ -6658,7 +6805,7 @@ function AdsMasonry({
|
|
|
6658
6805
|
}
|
|
6659
6806
|
)
|
|
6660
6807
|
] }),
|
|
6661
|
-
/* @__PURE__ */ (0,
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6662
6809
|
AdsSkeleton,
|
|
6663
6810
|
{
|
|
6664
6811
|
className: cn("h-6 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6667,7 +6814,7 @@ function AdsMasonry({
|
|
|
6667
6814
|
}
|
|
6668
6815
|
)
|
|
6669
6816
|
] }),
|
|
6670
|
-
/* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6671
6818
|
AdsSkeleton,
|
|
6672
6819
|
{
|
|
6673
6820
|
className: cn("h-4 rounded-full", classNames?.skeleton),
|
|
@@ -6686,7 +6833,7 @@ function AdsMasonry({
|
|
|
6686
6833
|
);
|
|
6687
6834
|
}
|
|
6688
6835
|
if (items.length === 0) {
|
|
6689
|
-
return emptyState ? /* @__PURE__ */ (0,
|
|
6836
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6690
6837
|
"div",
|
|
6691
6838
|
{
|
|
6692
6839
|
className: cn(rootClassName, classNames?.empty),
|
|
@@ -6695,7 +6842,7 @@ function AdsMasonry({
|
|
|
6695
6842
|
}
|
|
6696
6843
|
) : null;
|
|
6697
6844
|
}
|
|
6698
|
-
return /* @__PURE__ */ (0,
|
|
6845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6699
6846
|
import_masonic.Masonry,
|
|
6700
6847
|
{
|
|
6701
6848
|
className: rootClassName,
|
|
@@ -6707,7 +6854,7 @@ function AdsMasonry({
|
|
|
6707
6854
|
maxColumnCount,
|
|
6708
6855
|
onRender,
|
|
6709
6856
|
overscanBy,
|
|
6710
|
-
render: ({ data, index, width }) => /* @__PURE__ */ (0,
|
|
6857
|
+
render: ({ data, index, width }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6711
6858
|
"div",
|
|
6712
6859
|
{
|
|
6713
6860
|
className: cn("pb-0", classNames?.item, itemClassName),
|