@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.15 → 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 +760 -598
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +695 -533
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -208,7 +208,8 @@ var adsDefaultMessages = {
|
|
|
208
208
|
optional: "Optional"
|
|
209
209
|
},
|
|
210
210
|
select: {
|
|
211
|
-
clear: "Clear selection"
|
|
211
|
+
clear: "Clear selection",
|
|
212
|
+
noOptionsAvailable: "No options available"
|
|
212
213
|
},
|
|
213
214
|
toast: {
|
|
214
215
|
notifications: "Notifications"
|
|
@@ -258,7 +259,8 @@ var adsDefaultMessages = {
|
|
|
258
259
|
optional: "\u53EF\u9009"
|
|
259
260
|
},
|
|
260
261
|
select: {
|
|
261
|
-
clear: "\u6E05\u9664\u9009\u62E9"
|
|
262
|
+
clear: "\u6E05\u9664\u9009\u62E9",
|
|
263
|
+
noOptionsAvailable: "\u6682\u65E0\u53EF\u9009\u9879"
|
|
262
264
|
},
|
|
263
265
|
toast: {
|
|
264
266
|
notifications: "\u901A\u77E5"
|
|
@@ -1822,7 +1824,7 @@ var AdsCheckbox = React17.forwardRef(({ checkboxClassName, className, descriptio
|
|
|
1822
1824
|
AdsCheckbox.displayName = "AdsCheckbox";
|
|
1823
1825
|
|
|
1824
1826
|
// src/components/AdsCalendar/index.tsx
|
|
1825
|
-
var
|
|
1827
|
+
var React24 = __toESM(require("react"), 1);
|
|
1826
1828
|
var import_date_fns = require("date-fns");
|
|
1827
1829
|
var import_lucide_react8 = require("lucide-react");
|
|
1828
1830
|
|
|
@@ -1848,36 +1850,149 @@ var Input = React18.forwardRef(
|
|
|
1848
1850
|
Input.displayName = "Input";
|
|
1849
1851
|
|
|
1850
1852
|
// src/components/AdsPopover/index.tsx
|
|
1851
|
-
var
|
|
1853
|
+
var React21 = __toESM(require("react"), 1);
|
|
1852
1854
|
|
|
1853
1855
|
// src/primitives/popover.tsx
|
|
1854
|
-
var
|
|
1856
|
+
var React20 = __toESM(require("react"), 1);
|
|
1855
1857
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
1858
|
+
|
|
1859
|
+
// src/lib/nestedDismissableLayer.tsx
|
|
1860
|
+
var React19 = __toESM(require("react"), 1);
|
|
1856
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");
|
|
1857
1912
|
var Popover = PopoverPrimitive.Root;
|
|
1858
1913
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1859
|
-
var
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
className
|
|
1868
|
-
),
|
|
1914
|
+
var PopoverContentImpl = React20.forwardRef(
|
|
1915
|
+
({
|
|
1916
|
+
className,
|
|
1917
|
+
align = "center",
|
|
1918
|
+
onEscapeKeyDown,
|
|
1919
|
+
onFocusOutside,
|
|
1920
|
+
onPointerDownOutside,
|
|
1921
|
+
sideOffset = 4,
|
|
1869
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
|
+
) });
|
|
1870
1983
|
}
|
|
1871
|
-
)
|
|
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 }) }));
|
|
1872
1987
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1873
1988
|
|
|
1874
1989
|
// src/components/AdsPopover/index.tsx
|
|
1875
|
-
var
|
|
1990
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1876
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]";
|
|
1877
1992
|
var AdsPopover = Popover;
|
|
1878
1993
|
var AdsPopoverTrigger = PopoverTrigger;
|
|
1879
|
-
var AdsPopoverContent =
|
|
1880
|
-
({ 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)(
|
|
1881
1996
|
PopoverContent,
|
|
1882
1997
|
{
|
|
1883
1998
|
align,
|
|
@@ -1893,10 +2008,10 @@ var AdsPopoverContent = React20.forwardRef(
|
|
|
1893
2008
|
)
|
|
1894
2009
|
);
|
|
1895
2010
|
AdsPopoverContent.displayName = "AdsPopoverContent";
|
|
1896
|
-
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 }));
|
|
1897
2012
|
AdsPopoverHeader.displayName = "AdsPopoverHeader";
|
|
1898
|
-
var AdsPopoverBody =
|
|
1899
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2013
|
+
var AdsPopoverBody = React21.forwardRef(
|
|
2014
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1900
2015
|
"div",
|
|
1901
2016
|
{
|
|
1902
2017
|
className: cn("mt-md flex flex-col gap-md", className),
|
|
@@ -1906,7 +2021,7 @@ var AdsPopoverBody = React20.forwardRef(
|
|
|
1906
2021
|
)
|
|
1907
2022
|
);
|
|
1908
2023
|
AdsPopoverBody.displayName = "AdsPopoverBody";
|
|
1909
|
-
var AdsPopoverTitle =
|
|
2024
|
+
var AdsPopoverTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1910
2025
|
"h4",
|
|
1911
2026
|
{
|
|
1912
2027
|
className: cn(
|
|
@@ -1919,7 +2034,7 @@ var AdsPopoverTitle = React20.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1919
2034
|
}
|
|
1920
2035
|
));
|
|
1921
2036
|
AdsPopoverTitle.displayName = "AdsPopoverTitle";
|
|
1922
|
-
var AdsPopoverDescription =
|
|
2037
|
+
var AdsPopoverDescription = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1923
2038
|
"p",
|
|
1924
2039
|
{
|
|
1925
2040
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -1930,21 +2045,55 @@ var AdsPopoverDescription = React20.forwardRef(({ className, ...props }, ref) =>
|
|
|
1930
2045
|
AdsPopoverDescription.displayName = "AdsPopoverDescription";
|
|
1931
2046
|
|
|
1932
2047
|
// src/primitives/calendar.tsx
|
|
1933
|
-
var
|
|
2048
|
+
var React23 = __toESM(require("react"), 1);
|
|
1934
2049
|
var import_react2 = require("@daypicker/react");
|
|
1935
2050
|
var import_hijri = require("@daypicker/hijri");
|
|
1936
2051
|
var import_persian = require("@daypicker/persian");
|
|
1937
2052
|
|
|
1938
2053
|
// src/primitives/select.tsx
|
|
1939
|
-
var
|
|
2054
|
+
var React22 = __toESM(require("react"), 1);
|
|
1940
2055
|
var DismissableLayerPrimitive = __toESM(require("@radix-ui/react-dismissable-layer"), 1);
|
|
1941
2056
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
1942
2057
|
var import_lucide_react7 = require("lucide-react");
|
|
1943
|
-
var
|
|
1944
|
-
|
|
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;
|
|
1945
2094
|
var SelectGroup = SelectPrimitive.Group;
|
|
1946
2095
|
var SelectValue = SelectPrimitive.Value;
|
|
1947
|
-
var SelectTrigger =
|
|
2096
|
+
var SelectTrigger = React22.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1948
2097
|
SelectPrimitive.Trigger,
|
|
1949
2098
|
{
|
|
1950
2099
|
ref,
|
|
@@ -1955,12 +2104,12 @@ var SelectTrigger = React21.forwardRef(({ className, children, ...props }, ref)
|
|
|
1955
2104
|
...props,
|
|
1956
2105
|
children: [
|
|
1957
2106
|
children,
|
|
1958
|
-
/* @__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" }) })
|
|
1959
2108
|
]
|
|
1960
2109
|
}
|
|
1961
2110
|
));
|
|
1962
2111
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1963
|
-
var SelectScrollUpButton =
|
|
2112
|
+
var SelectScrollUpButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1964
2113
|
SelectPrimitive.ScrollUpButton,
|
|
1965
2114
|
{
|
|
1966
2115
|
ref,
|
|
@@ -1969,11 +2118,11 @@ var SelectScrollUpButton = React21.forwardRef(({ className, ...props }, ref) =>
|
|
|
1969
2118
|
className
|
|
1970
2119
|
),
|
|
1971
2120
|
...props,
|
|
1972
|
-
children: /* @__PURE__ */ (0,
|
|
2121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.ChevronUp, { className: "h-4 w-4" })
|
|
1973
2122
|
}
|
|
1974
2123
|
));
|
|
1975
2124
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1976
|
-
var SelectScrollDownButton =
|
|
2125
|
+
var SelectScrollDownButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1977
2126
|
SelectPrimitive.ScrollDownButton,
|
|
1978
2127
|
{
|
|
1979
2128
|
ref,
|
|
@@ -1982,11 +2131,11 @@ var SelectScrollDownButton = React21.forwardRef(({ className, ...props }, ref) =
|
|
|
1982
2131
|
className
|
|
1983
2132
|
),
|
|
1984
2133
|
...props,
|
|
1985
|
-
children: /* @__PURE__ */ (0,
|
|
2134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react7.ChevronDown, { className: "h-4 w-4" })
|
|
1986
2135
|
}
|
|
1987
2136
|
));
|
|
1988
2137
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1989
|
-
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)(
|
|
1990
2139
|
SelectPrimitive.Content,
|
|
1991
2140
|
{
|
|
1992
2141
|
ref,
|
|
@@ -1998,8 +2147,8 @@ var SelectContent = React21.forwardRef(({ className, children, position = "poppe
|
|
|
1998
2147
|
position,
|
|
1999
2148
|
...props,
|
|
2000
2149
|
children: [
|
|
2001
|
-
/* @__PURE__ */ (0,
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollUpButton, {}),
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2003
2152
|
SelectPrimitive.Viewport,
|
|
2004
2153
|
{
|
|
2005
2154
|
className: cn(
|
|
@@ -2009,12 +2158,12 @@ var SelectContent = React21.forwardRef(({ className, children, position = "poppe
|
|
|
2009
2158
|
children
|
|
2010
2159
|
}
|
|
2011
2160
|
),
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollDownButton, {})
|
|
2013
2162
|
]
|
|
2014
2163
|
}
|
|
2015
2164
|
) }) }));
|
|
2016
2165
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2017
|
-
var SelectLabel =
|
|
2166
|
+
var SelectLabel = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2018
2167
|
SelectPrimitive.Label,
|
|
2019
2168
|
{
|
|
2020
2169
|
ref,
|
|
@@ -2023,7 +2172,7 @@ var SelectLabel = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2023
2172
|
}
|
|
2024
2173
|
));
|
|
2025
2174
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2026
|
-
var SelectItem =
|
|
2175
|
+
var SelectItem = React22.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2027
2176
|
SelectPrimitive.Item,
|
|
2028
2177
|
{
|
|
2029
2178
|
ref,
|
|
@@ -2033,13 +2182,13 @@ var SelectItem = React21.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2033
2182
|
),
|
|
2034
2183
|
...props,
|
|
2035
2184
|
children: [
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2037
|
-
/* @__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 })
|
|
2038
2187
|
]
|
|
2039
2188
|
}
|
|
2040
2189
|
));
|
|
2041
2190
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2042
|
-
var SelectSeparator =
|
|
2191
|
+
var SelectSeparator = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2043
2192
|
SelectPrimitive.Separator,
|
|
2044
2193
|
{
|
|
2045
2194
|
ref,
|
|
@@ -2050,7 +2199,7 @@ var SelectSeparator = React21.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
2050
2199
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2051
2200
|
|
|
2052
2201
|
// src/primitives/calendar.tsx
|
|
2053
|
-
var
|
|
2202
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2054
2203
|
var cellSizeClasses = {
|
|
2055
2204
|
md: {
|
|
2056
2205
|
cell: "size-8",
|
|
@@ -2119,13 +2268,13 @@ function CalendarDropdown({
|
|
|
2119
2268
|
}) {
|
|
2120
2269
|
const { classNames, styles } = (0, import_react2.useDayPicker)();
|
|
2121
2270
|
const selectedValue = value?.toString();
|
|
2122
|
-
return /* @__PURE__ */ (0,
|
|
2271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2123
2272
|
"span",
|
|
2124
2273
|
{
|
|
2125
2274
|
className: classNames[import_react2.UI.DropdownRoot],
|
|
2126
2275
|
"data-disabled": disabled,
|
|
2127
2276
|
style: styles?.[import_react2.UI.DropdownRoot],
|
|
2128
|
-
children: /* @__PURE__ */ (0,
|
|
2277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2129
2278
|
Select,
|
|
2130
2279
|
{
|
|
2131
2280
|
disabled,
|
|
@@ -2136,7 +2285,7 @@ function CalendarDropdown({
|
|
|
2136
2285
|
},
|
|
2137
2286
|
value: selectedValue,
|
|
2138
2287
|
children: [
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2140
2289
|
SelectTrigger,
|
|
2141
2290
|
{
|
|
2142
2291
|
"aria-label": ariaLabel,
|
|
@@ -2146,10 +2295,10 @@ function CalendarDropdown({
|
|
|
2146
2295
|
className
|
|
2147
2296
|
),
|
|
2148
2297
|
style,
|
|
2149
|
-
children: /* @__PURE__ */ (0,
|
|
2298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, {})
|
|
2150
2299
|
}
|
|
2151
2300
|
),
|
|
2152
|
-
/* @__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)(
|
|
2153
2302
|
SelectItem,
|
|
2154
2303
|
{
|
|
2155
2304
|
disabled: option.disabled,
|
|
@@ -2164,7 +2313,7 @@ function CalendarDropdown({
|
|
|
2164
2313
|
}
|
|
2165
2314
|
);
|
|
2166
2315
|
}
|
|
2167
|
-
var Calendar =
|
|
2316
|
+
var Calendar = React23.forwardRef(
|
|
2168
2317
|
({
|
|
2169
2318
|
captionLayout,
|
|
2170
2319
|
calendarSystem = "gregorian",
|
|
@@ -2176,7 +2325,7 @@ var Calendar = React22.forwardRef(
|
|
|
2176
2325
|
showOutsideDays = true,
|
|
2177
2326
|
...props
|
|
2178
2327
|
}, ref) => {
|
|
2179
|
-
const mergedClassNames =
|
|
2328
|
+
const mergedClassNames = React23.useMemo(
|
|
2180
2329
|
() => ({
|
|
2181
2330
|
...getCalendarClassNames(cellSize, captionLayout?.startsWith("dropdown") ?? false),
|
|
2182
2331
|
...classNames
|
|
@@ -2197,7 +2346,7 @@ var Calendar = React22.forwardRef(
|
|
|
2197
2346
|
showOutsideDays
|
|
2198
2347
|
};
|
|
2199
2348
|
if (calendarSystem === "persian") {
|
|
2200
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2201
2350
|
import_persian.DayPicker,
|
|
2202
2351
|
{
|
|
2203
2352
|
...sharedProps,
|
|
@@ -2208,7 +2357,7 @@ var Calendar = React22.forwardRef(
|
|
|
2208
2357
|
) });
|
|
2209
2358
|
}
|
|
2210
2359
|
if (calendarSystem === "hijri") {
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2212
2361
|
import_hijri.DayPicker,
|
|
2213
2362
|
{
|
|
2214
2363
|
...sharedProps,
|
|
@@ -2218,13 +2367,13 @@ var Calendar = React22.forwardRef(
|
|
|
2218
2367
|
}
|
|
2219
2368
|
) });
|
|
2220
2369
|
}
|
|
2221
|
-
return /* @__PURE__ */ (0,
|
|
2370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react2.DayPicker, { ...sharedProps }) });
|
|
2222
2371
|
}
|
|
2223
2372
|
);
|
|
2224
2373
|
Calendar.displayName = "Calendar";
|
|
2225
2374
|
|
|
2226
2375
|
// src/components/AdsCalendar/index.tsx
|
|
2227
|
-
var
|
|
2376
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2228
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";
|
|
2229
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)]";
|
|
2230
2379
|
function useControllableDate({
|
|
@@ -2232,12 +2381,12 @@ function useControllableDate({
|
|
|
2232
2381
|
onSelect,
|
|
2233
2382
|
selected
|
|
2234
2383
|
}) {
|
|
2235
|
-
const [internalSelected, setInternalSelected] =
|
|
2384
|
+
const [internalSelected, setInternalSelected] = React24.useState(
|
|
2236
2385
|
defaultSelected
|
|
2237
2386
|
);
|
|
2238
2387
|
const isControlled = selected !== void 0;
|
|
2239
2388
|
const value = isControlled ? selected : internalSelected;
|
|
2240
|
-
const handleSelect =
|
|
2389
|
+
const handleSelect = React24.useCallback(
|
|
2241
2390
|
(nextValue) => {
|
|
2242
2391
|
if (!isControlled) {
|
|
2243
2392
|
setInternalSelected(nextValue);
|
|
@@ -2254,11 +2403,11 @@ function getDateLabel(value, formatter) {
|
|
|
2254
2403
|
}
|
|
2255
2404
|
return formatter ? formatter(value) : (0, import_date_fns.format)(value, "MMM d, yyyy");
|
|
2256
2405
|
}
|
|
2257
|
-
var AdsCalendar =
|
|
2258
|
-
({ 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 })
|
|
2259
2408
|
);
|
|
2260
2409
|
AdsCalendar.displayName = "AdsCalendar";
|
|
2261
|
-
var AdsDatePicker =
|
|
2410
|
+
var AdsDatePicker = React24.forwardRef(
|
|
2262
2411
|
({
|
|
2263
2412
|
className,
|
|
2264
2413
|
defaultSelected,
|
|
@@ -2271,7 +2420,7 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2271
2420
|
triggerClassName,
|
|
2272
2421
|
...calendarProps
|
|
2273
2422
|
}, ref) => {
|
|
2274
|
-
const [open, setOpen] =
|
|
2423
|
+
const [open, setOpen] = React24.useState(false);
|
|
2275
2424
|
const [value, handleSelect] = useControllableDate({
|
|
2276
2425
|
defaultSelected,
|
|
2277
2426
|
onSelect,
|
|
@@ -2279,17 +2428,17 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2279
2428
|
});
|
|
2280
2429
|
const description = useAdsFieldDescription({ id });
|
|
2281
2430
|
const labelText = getDateLabel(value, formatDateLabel) ?? placeholder;
|
|
2282
|
-
const onCalendarSelect =
|
|
2431
|
+
const onCalendarSelect = React24.useCallback(
|
|
2283
2432
|
(nextValue) => {
|
|
2284
2433
|
handleSelect(nextValue);
|
|
2285
2434
|
setOpen(false);
|
|
2286
2435
|
},
|
|
2287
2436
|
[handleSelect]
|
|
2288
2437
|
);
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2290
|
-
label ? /* @__PURE__ */ (0,
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2292
|
-
/* @__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)(
|
|
2293
2442
|
Button,
|
|
2294
2443
|
{
|
|
2295
2444
|
"aria-label": labelText,
|
|
@@ -2302,12 +2451,12 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2302
2451
|
id: description.inputId,
|
|
2303
2452
|
type: "button",
|
|
2304
2453
|
children: [
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2306
|
-
/* @__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" })
|
|
2307
2456
|
]
|
|
2308
2457
|
}
|
|
2309
2458
|
) }),
|
|
2310
|
-
/* @__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)(
|
|
2311
2460
|
AdsCalendar,
|
|
2312
2461
|
{
|
|
2313
2462
|
...calendarProps,
|
|
@@ -2321,18 +2470,18 @@ var AdsDatePicker = React23.forwardRef(
|
|
|
2321
2470
|
}
|
|
2322
2471
|
);
|
|
2323
2472
|
AdsDatePicker.displayName = "AdsDatePicker";
|
|
2324
|
-
var AdsDateTimePicker =
|
|
2473
|
+
var AdsDateTimePicker = React24.forwardRef(
|
|
2325
2474
|
({
|
|
2326
2475
|
className,
|
|
2327
2476
|
timeLabel = "Time",
|
|
2328
2477
|
timeValue = "",
|
|
2329
2478
|
onTimeChange,
|
|
2330
2479
|
...props
|
|
2331
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
2332
|
-
/* @__PURE__ */ (0,
|
|
2333
|
-
/* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
/* @__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)(
|
|
2336
2485
|
Input,
|
|
2337
2486
|
{
|
|
2338
2487
|
className: timeInputClassName,
|
|
@@ -2348,13 +2497,13 @@ var AdsDateTimePicker = React23.forwardRef(
|
|
|
2348
2497
|
AdsDateTimePicker.displayName = "AdsDateTimePicker";
|
|
2349
2498
|
|
|
2350
2499
|
// src/components/AdsButtonGroup/index.tsx
|
|
2351
|
-
var
|
|
2500
|
+
var React25 = __toESM(require("react"), 1);
|
|
2352
2501
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
2353
2502
|
|
|
2354
2503
|
// src/primitives/button-group.tsx
|
|
2355
2504
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
2356
2505
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2357
|
-
var
|
|
2506
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2358
2507
|
var buttonGroupVariants = (0, import_class_variance_authority8.cva)(
|
|
2359
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",
|
|
2360
2509
|
{
|
|
@@ -2374,7 +2523,7 @@ function ButtonGroupSeparator({
|
|
|
2374
2523
|
orientation = "vertical",
|
|
2375
2524
|
...props
|
|
2376
2525
|
}) {
|
|
2377
|
-
return /* @__PURE__ */ (0,
|
|
2526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2378
2527
|
Separator,
|
|
2379
2528
|
{
|
|
2380
2529
|
"data-slot": "button-group-separator",
|
|
@@ -2393,7 +2542,7 @@ function ButtonGroupSeparator({
|
|
|
2393
2542
|
}
|
|
2394
2543
|
|
|
2395
2544
|
// src/components/AdsButtonGroup/index.tsx
|
|
2396
|
-
var
|
|
2545
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2397
2546
|
var buttonGroupPressClassName = "[&_button]:transition-[background-color,box-shadow,filter] [&_button]:active:translate-y-0 [&_button]:active:brightness-95";
|
|
2398
2547
|
var segmentSizeClassName = {
|
|
2399
2548
|
sm: "h-8 px-md text-sm",
|
|
@@ -2401,14 +2550,14 @@ var segmentSizeClassName = {
|
|
|
2401
2550
|
lg: "h-10 px-xl text-base"
|
|
2402
2551
|
};
|
|
2403
2552
|
function isAdsButtonElement(child) {
|
|
2404
|
-
return
|
|
2553
|
+
return React25.isValidElement(child) && child.type === AdsButton;
|
|
2405
2554
|
}
|
|
2406
2555
|
function enhanceChildren(children, attached, size, surface) {
|
|
2407
|
-
return
|
|
2556
|
+
return React25.Children.map(children, (child) => {
|
|
2408
2557
|
if (!isAdsButtonElement(child)) {
|
|
2409
2558
|
return child;
|
|
2410
2559
|
}
|
|
2411
|
-
return
|
|
2560
|
+
return React25.cloneElement(child, {
|
|
2412
2561
|
className: cn(
|
|
2413
2562
|
attached && "rounded-none shadow-none",
|
|
2414
2563
|
attached && surface === "secondary" && "bg-secondary hover:bg-secondary/90",
|
|
@@ -2418,7 +2567,7 @@ function enhanceChildren(children, attached, size, surface) {
|
|
|
2418
2567
|
});
|
|
2419
2568
|
});
|
|
2420
2569
|
}
|
|
2421
|
-
var AdsButtonGroup =
|
|
2570
|
+
var AdsButtonGroup = React25.forwardRef(
|
|
2422
2571
|
({
|
|
2423
2572
|
attached = true,
|
|
2424
2573
|
children,
|
|
@@ -2437,7 +2586,7 @@ var AdsButtonGroup = React24.forwardRef(
|
|
|
2437
2586
|
buttonGroupVariants({ orientation }),
|
|
2438
2587
|
surface === "pill" ? "rounded-full" : "rounded-radius-md"
|
|
2439
2588
|
);
|
|
2440
|
-
return /* @__PURE__ */ (0,
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2441
2590
|
"div",
|
|
2442
2591
|
{
|
|
2443
2592
|
"aria-orientation": orientation,
|
|
@@ -2479,7 +2628,7 @@ var inputSizeClassName = {
|
|
|
2479
2628
|
md: "h-9 text-sm leading-5",
|
|
2480
2629
|
lg: "h-10 text-base leading-6"
|
|
2481
2630
|
};
|
|
2482
|
-
var AdsButtonGroupText =
|
|
2631
|
+
var AdsButtonGroupText = React25.forwardRef(
|
|
2483
2632
|
({
|
|
2484
2633
|
align = "start",
|
|
2485
2634
|
asChild = false,
|
|
@@ -2490,7 +2639,7 @@ var AdsButtonGroupText = React24.forwardRef(
|
|
|
2490
2639
|
...props
|
|
2491
2640
|
}, ref) => {
|
|
2492
2641
|
const Comp = asChild ? import_react_slot4.Slot : "div";
|
|
2493
|
-
return /* @__PURE__ */ (0,
|
|
2642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2494
2643
|
Comp,
|
|
2495
2644
|
{
|
|
2496
2645
|
className: cn(
|
|
@@ -2510,7 +2659,7 @@ var AdsButtonGroupText = React24.forwardRef(
|
|
|
2510
2659
|
}
|
|
2511
2660
|
);
|
|
2512
2661
|
AdsButtonGroupText.displayName = "AdsButtonGroupText";
|
|
2513
|
-
var AdsButtonGroupInput =
|
|
2662
|
+
var AdsButtonGroupInput = React25.forwardRef(({ className, size = "md", type = "text", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2514
2663
|
Input,
|
|
2515
2664
|
{
|
|
2516
2665
|
className: cn(
|
|
@@ -2527,13 +2676,13 @@ AdsButtonGroupInput.displayName = "AdsButtonGroupInput";
|
|
|
2527
2676
|
var AdsButtonGroupSeparator = ButtonGroupSeparator;
|
|
2528
2677
|
|
|
2529
2678
|
// src/components/AdsSeparator/index.tsx
|
|
2530
|
-
var
|
|
2531
|
-
var
|
|
2679
|
+
var React26 = __toESM(require("react"), 1);
|
|
2680
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2532
2681
|
var toneClassName2 = {
|
|
2533
2682
|
default: "bg-border",
|
|
2534
2683
|
muted: "bg-border-muted"
|
|
2535
2684
|
};
|
|
2536
|
-
var AdsSeparator =
|
|
2685
|
+
var AdsSeparator = React26.forwardRef(({ className, orientation = "horizontal", tone = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2537
2686
|
Separator,
|
|
2538
2687
|
{
|
|
2539
2688
|
className: cn(
|
|
@@ -2550,13 +2699,13 @@ var AdsSeparator = React25.forwardRef(({ className, orientation = "horizontal",
|
|
|
2550
2699
|
AdsSeparator.displayName = "AdsSeparator";
|
|
2551
2700
|
|
|
2552
2701
|
// src/components/AdsSkeleton/index.tsx
|
|
2553
|
-
var
|
|
2702
|
+
var React28 = __toESM(require("react"), 1);
|
|
2554
2703
|
|
|
2555
2704
|
// src/primitives/skeleton.tsx
|
|
2556
|
-
var
|
|
2557
|
-
var
|
|
2558
|
-
var Skeleton =
|
|
2559
|
-
({ 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)(
|
|
2560
2709
|
"div",
|
|
2561
2710
|
{
|
|
2562
2711
|
className: cn(
|
|
@@ -2572,7 +2721,7 @@ var Skeleton = React26.forwardRef(
|
|
|
2572
2721
|
Skeleton.displayName = "Skeleton";
|
|
2573
2722
|
|
|
2574
2723
|
// src/components/AdsSkeleton/index.tsx
|
|
2575
|
-
var
|
|
2724
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2576
2725
|
var shapeClassName = {
|
|
2577
2726
|
default: "rounded-radius-md",
|
|
2578
2727
|
line: "h-4 w-full rounded-full",
|
|
@@ -2582,8 +2731,8 @@ var toneClassName3 = {
|
|
|
2582
2731
|
default: "bg-secondary",
|
|
2583
2732
|
muted: "bg-accent"
|
|
2584
2733
|
};
|
|
2585
|
-
var AdsSkeleton =
|
|
2586
|
-
({ 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)(
|
|
2587
2736
|
Skeleton,
|
|
2588
2737
|
{
|
|
2589
2738
|
className: cn(shapeClassName[shape], toneClassName3[tone], className),
|
|
@@ -2595,28 +2744,28 @@ var AdsSkeleton = React27.forwardRef(
|
|
|
2595
2744
|
AdsSkeleton.displayName = "AdsSkeleton";
|
|
2596
2745
|
|
|
2597
2746
|
// src/components/AdsInput/index.tsx
|
|
2598
|
-
var
|
|
2747
|
+
var React30 = __toESM(require("react"), 1);
|
|
2599
2748
|
var import_lucide_react10 = require("lucide-react");
|
|
2600
2749
|
|
|
2601
2750
|
// src/lib/adsClearButton.tsx
|
|
2602
|
-
var
|
|
2751
|
+
var React29 = __toESM(require("react"), 1);
|
|
2603
2752
|
var import_lucide_react9 = require("lucide-react");
|
|
2604
|
-
var
|
|
2753
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2605
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";
|
|
2606
|
-
var AdsClearButton =
|
|
2755
|
+
var AdsClearButton = React29.forwardRef(({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2607
2756
|
"button",
|
|
2608
2757
|
{
|
|
2609
2758
|
...props,
|
|
2610
2759
|
className: cn(adsClearButtonClassName, "h-4 w-4", className),
|
|
2611
2760
|
ref,
|
|
2612
2761
|
type,
|
|
2613
|
-
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" })
|
|
2614
2763
|
}
|
|
2615
2764
|
));
|
|
2616
2765
|
AdsClearButton.displayName = "AdsClearButton";
|
|
2617
2766
|
|
|
2618
2767
|
// src/components/AdsInput/index.tsx
|
|
2619
|
-
var
|
|
2768
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2620
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";
|
|
2621
2770
|
var inputSizeClasses = {
|
|
2622
2771
|
sm: "h-8 text-sm leading-5",
|
|
@@ -2650,8 +2799,8 @@ function renderFileTriggerIcon(icon) {
|
|
|
2650
2799
|
if (!icon) {
|
|
2651
2800
|
return null;
|
|
2652
2801
|
}
|
|
2653
|
-
if (
|
|
2654
|
-
return
|
|
2802
|
+
if (React30.isValidElement(icon)) {
|
|
2803
|
+
return React30.cloneElement(icon, {
|
|
2655
2804
|
className: cn("!h-4 !w-4 h-4 w-4", icon.props.className)
|
|
2656
2805
|
});
|
|
2657
2806
|
}
|
|
@@ -2674,7 +2823,7 @@ function getInputSurfaceClassName({
|
|
|
2674
2823
|
className
|
|
2675
2824
|
);
|
|
2676
2825
|
}
|
|
2677
|
-
var AdsInput =
|
|
2826
|
+
var AdsInput = React30.forwardRef(
|
|
2678
2827
|
({
|
|
2679
2828
|
action,
|
|
2680
2829
|
className,
|
|
@@ -2683,7 +2832,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2683
2832
|
descriptionPlacement = "below",
|
|
2684
2833
|
emptyFileLabel,
|
|
2685
2834
|
errorText,
|
|
2686
|
-
fileTriggerIcon = /* @__PURE__ */ (0,
|
|
2835
|
+
fileTriggerIcon = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react10.Upload, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
2687
2836
|
fileTriggerLabel,
|
|
2688
2837
|
helperText,
|
|
2689
2838
|
id,
|
|
@@ -2697,9 +2846,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2697
2846
|
...props
|
|
2698
2847
|
}, ref) => {
|
|
2699
2848
|
const { messages } = useAdsI18n();
|
|
2700
|
-
const inputRef =
|
|
2701
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2702
|
-
const [currentValue, setCurrentValue] =
|
|
2849
|
+
const inputRef = React30.useRef(null);
|
|
2850
|
+
const [selectedFiles, setSelectedFiles] = React30.useState([]);
|
|
2851
|
+
const [currentValue, setCurrentValue] = React30.useState(
|
|
2703
2852
|
() => getTextInputValue(props.value ?? props.defaultValue)
|
|
2704
2853
|
);
|
|
2705
2854
|
const description = useAdsFieldDescription({
|
|
@@ -2708,7 +2857,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2708
2857
|
helperText,
|
|
2709
2858
|
id
|
|
2710
2859
|
});
|
|
2711
|
-
|
|
2860
|
+
React30.useEffect(() => {
|
|
2712
2861
|
if (props.value !== void 0) {
|
|
2713
2862
|
setCurrentValue(getTextInputValue(props.value));
|
|
2714
2863
|
}
|
|
@@ -2726,7 +2875,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2726
2875
|
const resolvedFileTriggerLabel = fileTriggerLabel ?? messages.input.chooseFile;
|
|
2727
2876
|
const resolvedFileTriggerIcon = renderFileTriggerIcon(fileTriggerIcon);
|
|
2728
2877
|
const resolvedEmptyFileLabel = emptyFileLabel ?? messages.input.noFileChosen;
|
|
2729
|
-
const handleChange =
|
|
2878
|
+
const handleChange = React30.useCallback(
|
|
2730
2879
|
(event) => {
|
|
2731
2880
|
setCurrentValue(event.target.value);
|
|
2732
2881
|
if (isFileInput) {
|
|
@@ -2738,7 +2887,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2738
2887
|
},
|
|
2739
2888
|
[isFileInput, onChange]
|
|
2740
2889
|
);
|
|
2741
|
-
const handleClear =
|
|
2890
|
+
const handleClear = React30.useCallback(() => {
|
|
2742
2891
|
const element = inputRef.current;
|
|
2743
2892
|
if (!element) {
|
|
2744
2893
|
return;
|
|
@@ -2753,10 +2902,10 @@ var AdsInput = React29.forwardRef(
|
|
|
2753
2902
|
onClear?.();
|
|
2754
2903
|
}, [onClear]);
|
|
2755
2904
|
const fileNameText = selectedFiles.length > 0 ? selectedFiles.join(", ") : resolvedEmptyFileLabel;
|
|
2756
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
2757
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
2758
|
-
const inputNode = isFileInput ? /* @__PURE__ */ (0,
|
|
2759
|
-
/* @__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)(
|
|
2760
2909
|
Input,
|
|
2761
2910
|
{
|
|
2762
2911
|
"aria-describedby": description.describedBy,
|
|
@@ -2776,7 +2925,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2776
2925
|
...props
|
|
2777
2926
|
}
|
|
2778
2927
|
),
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2780
2929
|
"div",
|
|
2781
2930
|
{
|
|
2782
2931
|
"aria-hidden": "true",
|
|
@@ -2785,7 +2934,7 @@ var AdsInput = React29.forwardRef(
|
|
|
2785
2934
|
props.disabled ? "cursor-not-allowed opacity-50" : void 0
|
|
2786
2935
|
),
|
|
2787
2936
|
children: [
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2789
2938
|
"span",
|
|
2790
2939
|
{
|
|
2791
2940
|
"data-ads-file-trigger": "",
|
|
@@ -2795,12 +2944,12 @@ var AdsInput = React29.forwardRef(
|
|
|
2795
2944
|
adsTextColorClassName.primary
|
|
2796
2945
|
),
|
|
2797
2946
|
children: [
|
|
2798
|
-
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,
|
|
2799
2948
|
resolvedFileTriggerLabel
|
|
2800
2949
|
]
|
|
2801
2950
|
}
|
|
2802
2951
|
),
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2952
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2804
2953
|
"span",
|
|
2805
2954
|
{
|
|
2806
2955
|
className: cn(
|
|
@@ -2813,9 +2962,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2813
2962
|
]
|
|
2814
2963
|
}
|
|
2815
2964
|
)
|
|
2816
|
-
] }) : /* @__PURE__ */ (0,
|
|
2817
|
-
prefix ? /* @__PURE__ */ (0,
|
|
2818
|
-
/* @__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)(
|
|
2819
2968
|
Input,
|
|
2820
2969
|
{
|
|
2821
2970
|
"aria-describedby": description.describedBy,
|
|
@@ -2831,9 +2980,9 @@ var AdsInput = React29.forwardRef(
|
|
|
2831
2980
|
...props
|
|
2832
2981
|
}
|
|
2833
2982
|
),
|
|
2834
|
-
canClear || suffix ? /* @__PURE__ */ (0,
|
|
2835
|
-
suffix ? /* @__PURE__ */ (0,
|
|
2836
|
-
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)(
|
|
2837
2986
|
AdsClearButton,
|
|
2838
2987
|
{
|
|
2839
2988
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -2842,12 +2991,12 @@ var AdsInput = React29.forwardRef(
|
|
|
2842
2991
|
) : null
|
|
2843
2992
|
] }) : null
|
|
2844
2993
|
] });
|
|
2845
|
-
return /* @__PURE__ */ (0,
|
|
2846
|
-
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,
|
|
2847
2996
|
descriptionPlacement === "above" ? helperNode : null,
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex w-full items-center gap-sm", children: [
|
|
2849
2998
|
inputNode,
|
|
2850
|
-
action ? /* @__PURE__ */ (0,
|
|
2999
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
2851
3000
|
] }),
|
|
2852
3001
|
descriptionPlacement === "below" ? helperNode : null,
|
|
2853
3002
|
errorNode
|
|
@@ -2857,13 +3006,13 @@ var AdsInput = React29.forwardRef(
|
|
|
2857
3006
|
AdsInput.displayName = "AdsInput";
|
|
2858
3007
|
|
|
2859
3008
|
// src/components/AdsInputGroup/index.tsx
|
|
2860
|
-
var
|
|
3009
|
+
var React32 = __toESM(require("react"), 1);
|
|
2861
3010
|
|
|
2862
3011
|
// src/primitives/textarea.tsx
|
|
2863
|
-
var
|
|
2864
|
-
var
|
|
2865
|
-
var Textarea =
|
|
2866
|
-
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)(
|
|
2867
3016
|
"textarea",
|
|
2868
3017
|
{
|
|
2869
3018
|
className: cn(
|
|
@@ -2878,7 +3027,7 @@ var Textarea = React30.forwardRef(({ className, ...props }, ref) => {
|
|
|
2878
3027
|
Textarea.displayName = "Textarea";
|
|
2879
3028
|
|
|
2880
3029
|
// src/components/AdsInputGroup/index.tsx
|
|
2881
|
-
var
|
|
3030
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2882
3031
|
function useAdsInputGroupDescription(describedBy, helperText, errorText, idBase) {
|
|
2883
3032
|
const helperId = helperText ? `${idBase}-helper` : void 0;
|
|
2884
3033
|
const errorId = errorText ? `${idBase}-error` : void 0;
|
|
@@ -2897,11 +3046,11 @@ function AdsInputGroupChrome({
|
|
|
2897
3046
|
helperText,
|
|
2898
3047
|
label
|
|
2899
3048
|
}) {
|
|
2900
|
-
return /* @__PURE__ */ (0,
|
|
2901
|
-
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,
|
|
2902
3051
|
children,
|
|
2903
|
-
helperText ? /* @__PURE__ */ (0,
|
|
2904
|
-
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
|
|
2905
3054
|
] });
|
|
2906
3055
|
}
|
|
2907
3056
|
var addonBaseClassName = "flex shrink-0 items-center self-stretch bg-secondary px-lg text-sm leading-5 text-foreground";
|
|
@@ -2940,21 +3089,21 @@ function AdsInputGroup({
|
|
|
2940
3089
|
trailingAddon,
|
|
2941
3090
|
trailingAddonClassName
|
|
2942
3091
|
}) {
|
|
2943
|
-
const generatedId =
|
|
3092
|
+
const generatedId = React32.useId();
|
|
2944
3093
|
const description = useAdsInputGroupDescription(
|
|
2945
3094
|
void 0,
|
|
2946
3095
|
helperText,
|
|
2947
3096
|
errorText,
|
|
2948
3097
|
id ?? generatedId
|
|
2949
3098
|
);
|
|
2950
|
-
return /* @__PURE__ */ (0,
|
|
3099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2951
3100
|
AdsInputGroupChrome,
|
|
2952
3101
|
{
|
|
2953
3102
|
errorText,
|
|
2954
3103
|
helperText,
|
|
2955
3104
|
label,
|
|
2956
3105
|
...description,
|
|
2957
|
-
children: /* @__PURE__ */ (0,
|
|
3106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2958
3107
|
"div",
|
|
2959
3108
|
{
|
|
2960
3109
|
className: cn(
|
|
@@ -2964,9 +3113,9 @@ function AdsInputGroup({
|
|
|
2964
3113
|
surfaceClassName
|
|
2965
3114
|
),
|
|
2966
3115
|
children: [
|
|
2967
|
-
header ? /* @__PURE__ */ (0,
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2969
|
-
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)(
|
|
2970
3119
|
"div",
|
|
2971
3120
|
{
|
|
2972
3121
|
className: cn(
|
|
@@ -2977,7 +3126,7 @@ function AdsInputGroup({
|
|
|
2977
3126
|
children: leadingAddon
|
|
2978
3127
|
}
|
|
2979
3128
|
) : null,
|
|
2980
|
-
/* @__PURE__ */ (0,
|
|
3129
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2981
3130
|
"div",
|
|
2982
3131
|
{
|
|
2983
3132
|
className: cn(
|
|
@@ -2987,7 +3136,7 @@ function AdsInputGroup({
|
|
|
2987
3136
|
children
|
|
2988
3137
|
}
|
|
2989
3138
|
),
|
|
2990
|
-
trailingAddon ? /* @__PURE__ */ (0,
|
|
3139
|
+
trailingAddon ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2991
3140
|
"div",
|
|
2992
3141
|
{
|
|
2993
3142
|
className: cn(
|
|
@@ -2999,33 +3148,33 @@ function AdsInputGroup({
|
|
|
2999
3148
|
}
|
|
3000
3149
|
) : null
|
|
3001
3150
|
] }),
|
|
3002
|
-
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
|
|
3003
3152
|
]
|
|
3004
3153
|
}
|
|
3005
3154
|
) })
|
|
3006
3155
|
}
|
|
3007
3156
|
);
|
|
3008
3157
|
}
|
|
3009
|
-
var AdsInputGroupInput =
|
|
3158
|
+
var AdsInputGroupInput = React32.forwardRef(({ className, clearable = false, clearButtonLabel, onChange, onClear, ...props }, ref) => {
|
|
3010
3159
|
const { messages } = useAdsI18n();
|
|
3011
|
-
const inputRef =
|
|
3012
|
-
const [currentValue, setCurrentValue] =
|
|
3160
|
+
const inputRef = React32.useRef(null);
|
|
3161
|
+
const [currentValue, setCurrentValue] = React32.useState(
|
|
3013
3162
|
() => getInputGroupValue(props.value ?? props.defaultValue)
|
|
3014
3163
|
);
|
|
3015
|
-
|
|
3164
|
+
React32.useEffect(() => {
|
|
3016
3165
|
if (props.value !== void 0) {
|
|
3017
3166
|
setCurrentValue(getInputGroupValue(props.value));
|
|
3018
3167
|
}
|
|
3019
3168
|
}, [props.value]);
|
|
3020
3169
|
const canClear = clearable && !props.disabled && !props.readOnly && currentValue.length > 0;
|
|
3021
|
-
const handleChange =
|
|
3170
|
+
const handleChange = React32.useCallback(
|
|
3022
3171
|
(event) => {
|
|
3023
3172
|
setCurrentValue(event.target.value);
|
|
3024
3173
|
onChange?.(event);
|
|
3025
3174
|
},
|
|
3026
3175
|
[onChange]
|
|
3027
3176
|
);
|
|
3028
|
-
const handleClear =
|
|
3177
|
+
const handleClear = React32.useCallback(() => {
|
|
3029
3178
|
const element = inputRef.current;
|
|
3030
3179
|
if (!element) {
|
|
3031
3180
|
return;
|
|
@@ -3039,8 +3188,8 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3039
3188
|
element.focus();
|
|
3040
3189
|
onClear?.();
|
|
3041
3190
|
}, [onClear]);
|
|
3042
|
-
return /* @__PURE__ */ (0,
|
|
3043
|
-
/* @__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)(
|
|
3044
3193
|
Input,
|
|
3045
3194
|
{
|
|
3046
3195
|
className: cn(
|
|
@@ -3057,7 +3206,7 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3057
3206
|
...props
|
|
3058
3207
|
}
|
|
3059
3208
|
),
|
|
3060
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3209
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3061
3210
|
AdsClearButton,
|
|
3062
3211
|
{
|
|
3063
3212
|
"aria-label": clearButtonLabel ?? messages.input.clear,
|
|
@@ -3068,7 +3217,7 @@ var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, cle
|
|
|
3068
3217
|
] });
|
|
3069
3218
|
});
|
|
3070
3219
|
AdsInputGroupInput.displayName = "AdsInputGroupInput";
|
|
3071
|
-
var AdsInputGroupTextarea =
|
|
3220
|
+
var AdsInputGroupTextarea = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3072
3221
|
Textarea,
|
|
3073
3222
|
{
|
|
3074
3223
|
className: cn(
|
|
@@ -3083,14 +3232,14 @@ var AdsInputGroupTextarea = React31.forwardRef(({ className, ...props }, ref) =>
|
|
|
3083
3232
|
AdsInputGroupTextarea.displayName = "AdsInputGroupTextarea";
|
|
3084
3233
|
|
|
3085
3234
|
// src/components/AdsInputOTP/index.tsx
|
|
3086
|
-
var
|
|
3235
|
+
var React34 = __toESM(require("react"), 1);
|
|
3087
3236
|
|
|
3088
3237
|
// src/primitives/input-otp.tsx
|
|
3089
|
-
var
|
|
3238
|
+
var React33 = __toESM(require("react"), 1);
|
|
3090
3239
|
var import_input_otp = require("input-otp");
|
|
3091
3240
|
var import_lucide_react11 = require("lucide-react");
|
|
3092
|
-
var
|
|
3093
|
-
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)(
|
|
3094
3243
|
import_input_otp.OTPInput,
|
|
3095
3244
|
{
|
|
3096
3245
|
ref,
|
|
@@ -3103,12 +3252,12 @@ var InputOTP = React32.forwardRef(({ className, containerClassName, ...props },
|
|
|
3103
3252
|
}
|
|
3104
3253
|
));
|
|
3105
3254
|
InputOTP.displayName = "InputOTP";
|
|
3106
|
-
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 }));
|
|
3107
3256
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
3108
|
-
var InputOTPSlot =
|
|
3109
|
-
const inputOTPContext =
|
|
3257
|
+
var InputOTPSlot = React33.forwardRef(({ index, className, ...props }, ref) => {
|
|
3258
|
+
const inputOTPContext = React33.useContext(import_input_otp.OTPInputContext);
|
|
3110
3259
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
3111
|
-
return /* @__PURE__ */ (0,
|
|
3260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3112
3261
|
"div",
|
|
3113
3262
|
{
|
|
3114
3263
|
ref,
|
|
@@ -3120,19 +3269,19 @@ var InputOTPSlot = React32.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
3120
3269
|
...props,
|
|
3121
3270
|
children: [
|
|
3122
3271
|
char,
|
|
3123
|
-
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" }) })
|
|
3124
3273
|
]
|
|
3125
3274
|
}
|
|
3126
3275
|
);
|
|
3127
3276
|
});
|
|
3128
3277
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
3129
|
-
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, {}) }));
|
|
3130
3279
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3131
3280
|
|
|
3132
3281
|
// src/components/AdsInputOTP/index.tsx
|
|
3133
|
-
var
|
|
3282
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3134
3283
|
function useFieldDescription(id, describedBy, helperText, errorText) {
|
|
3135
|
-
const generatedId =
|
|
3284
|
+
const generatedId = React34.useId();
|
|
3136
3285
|
const inputId = id ?? generatedId;
|
|
3137
3286
|
const helperId = helperText ? `${inputId}-helper` : void 0;
|
|
3138
3287
|
const errorId = errorText ? `${inputId}-error` : void 0;
|
|
@@ -3153,21 +3302,21 @@ function AdsInputOTPChrome({
|
|
|
3153
3302
|
inputId,
|
|
3154
3303
|
label
|
|
3155
3304
|
}) {
|
|
3156
|
-
return /* @__PURE__ */ (0,
|
|
3157
|
-
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,
|
|
3158
3307
|
children,
|
|
3159
|
-
helperText ? /* @__PURE__ */ (0,
|
|
3160
|
-
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
|
|
3161
3310
|
] });
|
|
3162
3311
|
}
|
|
3163
3312
|
function buildSeparator(node, key) {
|
|
3164
3313
|
if (node === void 0) {
|
|
3165
|
-
return /* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AdsInputOTPSeparator, {}, key);
|
|
3166
3315
|
}
|
|
3167
|
-
if (
|
|
3168
|
-
return
|
|
3316
|
+
if (React34.isValidElement(node)) {
|
|
3317
|
+
return React34.cloneElement(node, { key });
|
|
3169
3318
|
}
|
|
3170
|
-
return /* @__PURE__ */ (0,
|
|
3319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: node }, key);
|
|
3171
3320
|
}
|
|
3172
3321
|
function buildOtpChildren(groups, separator) {
|
|
3173
3322
|
const defaultGroup = groups.length > 0 ? groups : [6];
|
|
@@ -3175,7 +3324,7 @@ function buildOtpChildren(groups, separator) {
|
|
|
3175
3324
|
let index = 0;
|
|
3176
3325
|
defaultGroup.forEach((size, indexOfGroup) => {
|
|
3177
3326
|
items.push(
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AdsInputOTPGroup, { children: Array.from({ length: size }, (_, slotOffset) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3179
3328
|
AdsInputOTPSlot,
|
|
3180
3329
|
{
|
|
3181
3330
|
index: index + slotOffset
|
|
@@ -3190,11 +3339,11 @@ function buildOtpChildren(groups, separator) {
|
|
|
3190
3339
|
});
|
|
3191
3340
|
return items;
|
|
3192
3341
|
}
|
|
3193
|
-
var AdsInputOTP =
|
|
3342
|
+
var AdsInputOTP = React34.forwardRef(({ action, errorText, groups, helperText, label, separator, children, id, ...props }, ref) => {
|
|
3194
3343
|
const totalSlots = groups && groups.length > 0 ? groups.reduce((sum, value) => sum + value, 0) : 6;
|
|
3195
3344
|
const description = useFieldDescription(id, props["aria-describedby"], helperText, errorText);
|
|
3196
3345
|
const otpChildren = children ?? buildOtpChildren(groups ?? [], separator);
|
|
3197
|
-
return /* @__PURE__ */ (0,
|
|
3346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3198
3347
|
AdsInputOTPChrome,
|
|
3199
3348
|
{
|
|
3200
3349
|
errorText,
|
|
@@ -3203,8 +3352,8 @@ var AdsInputOTP = React33.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3203
3352
|
helperId: description.helperId,
|
|
3204
3353
|
inputId: description.inputId,
|
|
3205
3354
|
label,
|
|
3206
|
-
children: /* @__PURE__ */ (0,
|
|
3207
|
-
/* @__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)(
|
|
3208
3357
|
InputOTP,
|
|
3209
3358
|
{
|
|
3210
3359
|
"aria-describedby": description.describedBy,
|
|
@@ -3216,15 +3365,15 @@ var AdsInputOTP = React33.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3216
3365
|
children: otpChildren
|
|
3217
3366
|
}
|
|
3218
3367
|
),
|
|
3219
|
-
action ? /* @__PURE__ */ (0,
|
|
3368
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "shrink-0", children: action }) : null
|
|
3220
3369
|
] })
|
|
3221
3370
|
}
|
|
3222
3371
|
);
|
|
3223
3372
|
});
|
|
3224
3373
|
AdsInputOTP.displayName = "AdsInputOTP";
|
|
3225
|
-
var AdsInputOTPGroup =
|
|
3374
|
+
var AdsInputOTPGroup = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(InputOTPGroup, { className, ref, ...props }));
|
|
3226
3375
|
AdsInputOTPGroup.displayName = "AdsInputOTPGroup";
|
|
3227
|
-
var AdsInputOTPSeparator =
|
|
3376
|
+
var AdsInputOTPSeparator = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3228
3377
|
InputOTPSeparator,
|
|
3229
3378
|
{
|
|
3230
3379
|
className: className ?? "h-px w-6 shrink-0 bg-border text-transparent [&_svg]:hidden",
|
|
@@ -3233,7 +3382,7 @@ var AdsInputOTPSeparator = React33.forwardRef(({ className, ...props }, ref) =>
|
|
|
3233
3382
|
}
|
|
3234
3383
|
));
|
|
3235
3384
|
AdsInputOTPSeparator.displayName = "AdsInputOTPSeparator";
|
|
3236
|
-
var AdsInputOTPSlot =
|
|
3385
|
+
var AdsInputOTPSlot = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3237
3386
|
InputOTPSlot,
|
|
3238
3387
|
{
|
|
3239
3388
|
className: [
|
|
@@ -3250,17 +3399,17 @@ var AdsInputOTPSlot = React33.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3250
3399
|
AdsInputOTPSlot.displayName = "AdsInputOTPSlot";
|
|
3251
3400
|
|
|
3252
3401
|
// src/components/AdsDataPagination/index.tsx
|
|
3253
|
-
var
|
|
3402
|
+
var React38 = __toESM(require("react"), 1);
|
|
3254
3403
|
|
|
3255
3404
|
// src/components/AdsPagination/index.tsx
|
|
3256
|
-
var
|
|
3405
|
+
var React36 = __toESM(require("react"), 1);
|
|
3257
3406
|
var import_lucide_react13 = require("lucide-react");
|
|
3258
3407
|
|
|
3259
3408
|
// src/primitives/pagination.tsx
|
|
3260
|
-
var
|
|
3409
|
+
var React35 = __toESM(require("react"), 1);
|
|
3261
3410
|
var import_lucide_react12 = require("lucide-react");
|
|
3262
|
-
var
|
|
3263
|
-
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)(
|
|
3264
3413
|
"nav",
|
|
3265
3414
|
{
|
|
3266
3415
|
role: "navigation",
|
|
@@ -3270,7 +3419,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
3270
3419
|
}
|
|
3271
3420
|
);
|
|
3272
3421
|
Pagination.displayName = "Pagination";
|
|
3273
|
-
var PaginationContent =
|
|
3422
|
+
var PaginationContent = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3274
3423
|
"ul",
|
|
3275
3424
|
{
|
|
3276
3425
|
ref,
|
|
@@ -3279,14 +3428,14 @@ var PaginationContent = React34.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3279
3428
|
}
|
|
3280
3429
|
));
|
|
3281
3430
|
PaginationContent.displayName = "PaginationContent";
|
|
3282
|
-
var PaginationItem =
|
|
3431
|
+
var PaginationItem = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { ref, className: cn("", className), ...props }));
|
|
3283
3432
|
PaginationItem.displayName = "PaginationItem";
|
|
3284
3433
|
var PaginationLink = ({
|
|
3285
3434
|
className,
|
|
3286
3435
|
isActive,
|
|
3287
3436
|
size = "icon",
|
|
3288
3437
|
...props
|
|
3289
|
-
}) => /* @__PURE__ */ (0,
|
|
3438
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3290
3439
|
"a",
|
|
3291
3440
|
{
|
|
3292
3441
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3304,7 +3453,7 @@ PaginationLink.displayName = "PaginationLink";
|
|
|
3304
3453
|
var PaginationPrevious = ({
|
|
3305
3454
|
className,
|
|
3306
3455
|
...props
|
|
3307
|
-
}) => /* @__PURE__ */ (0,
|
|
3456
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3308
3457
|
PaginationLink,
|
|
3309
3458
|
{
|
|
3310
3459
|
"aria-label": "Go to previous page",
|
|
@@ -3312,8 +3461,8 @@ var PaginationPrevious = ({
|
|
|
3312
3461
|
className: cn("gap-1 pl-2.5", className),
|
|
3313
3462
|
...props,
|
|
3314
3463
|
children: [
|
|
3315
|
-
/* @__PURE__ */ (0,
|
|
3316
|
-
/* @__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" })
|
|
3317
3466
|
]
|
|
3318
3467
|
}
|
|
3319
3468
|
);
|
|
@@ -3321,7 +3470,7 @@ PaginationPrevious.displayName = "PaginationPrevious";
|
|
|
3321
3470
|
var PaginationNext = ({
|
|
3322
3471
|
className,
|
|
3323
3472
|
...props
|
|
3324
|
-
}) => /* @__PURE__ */ (0,
|
|
3473
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3325
3474
|
PaginationLink,
|
|
3326
3475
|
{
|
|
3327
3476
|
"aria-label": "Go to next page",
|
|
@@ -3329,8 +3478,8 @@ var PaginationNext = ({
|
|
|
3329
3478
|
className: cn("gap-1 pr-2.5", className),
|
|
3330
3479
|
...props,
|
|
3331
3480
|
children: [
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
/* @__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" })
|
|
3334
3483
|
]
|
|
3335
3484
|
}
|
|
3336
3485
|
);
|
|
@@ -3338,27 +3487,27 @@ PaginationNext.displayName = "PaginationNext";
|
|
|
3338
3487
|
var PaginationEllipsis = ({
|
|
3339
3488
|
className,
|
|
3340
3489
|
...props
|
|
3341
|
-
}) => /* @__PURE__ */ (0,
|
|
3490
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3342
3491
|
"span",
|
|
3343
3492
|
{
|
|
3344
3493
|
"aria-hidden": true,
|
|
3345
3494
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3346
3495
|
...props,
|
|
3347
3496
|
children: [
|
|
3348
|
-
/* @__PURE__ */ (0,
|
|
3349
|
-
/* @__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" })
|
|
3350
3499
|
]
|
|
3351
3500
|
}
|
|
3352
3501
|
);
|
|
3353
3502
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3354
3503
|
|
|
3355
3504
|
// src/components/AdsPagination/index.tsx
|
|
3356
|
-
var
|
|
3505
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3357
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";
|
|
3358
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)]";
|
|
3359
3508
|
var paginationLinkActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3360
3509
|
function AdsPagination({ className, ...props }) {
|
|
3361
|
-
return /* @__PURE__ */ (0,
|
|
3510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3362
3511
|
Pagination,
|
|
3363
3512
|
{
|
|
3364
3513
|
className: cn("mx-0 w-auto justify-start", className),
|
|
@@ -3367,14 +3516,14 @@ function AdsPagination({ className, ...props }) {
|
|
|
3367
3516
|
);
|
|
3368
3517
|
}
|
|
3369
3518
|
AdsPagination.displayName = "AdsPagination";
|
|
3370
|
-
var AdsPaginationContent =
|
|
3519
|
+
var AdsPaginationContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginationContent, { ref, className: cn("gap-1", className), ...props }));
|
|
3371
3520
|
AdsPaginationContent.displayName = "AdsPaginationContent";
|
|
3372
|
-
var AdsPaginationItem =
|
|
3373
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3521
|
+
var AdsPaginationItem = React36.forwardRef(
|
|
3522
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginationItem, { ref, className, ...props })
|
|
3374
3523
|
);
|
|
3375
3524
|
AdsPaginationItem.displayName = "AdsPaginationItem";
|
|
3376
|
-
var AdsPaginationLink =
|
|
3377
|
-
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3525
|
+
var AdsPaginationLink = React36.forwardRef(
|
|
3526
|
+
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3378
3527
|
"a",
|
|
3379
3528
|
{
|
|
3380
3529
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3389,10 +3538,10 @@ var AdsPaginationLink = React35.forwardRef(
|
|
|
3389
3538
|
)
|
|
3390
3539
|
);
|
|
3391
3540
|
AdsPaginationLink.displayName = "AdsPaginationLink";
|
|
3392
|
-
var AdsPaginationPrevious =
|
|
3541
|
+
var AdsPaginationPrevious = React36.forwardRef(({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3393
3542
|
const { messages } = useAdsI18n();
|
|
3394
3543
|
const label = children ?? messages.pagination.previous;
|
|
3395
|
-
return /* @__PURE__ */ (0,
|
|
3544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3396
3545
|
AdsPaginationLink,
|
|
3397
3546
|
{
|
|
3398
3547
|
"aria-label": ariaLabel ?? messages.pagination.previous,
|
|
@@ -3400,18 +3549,18 @@ var AdsPaginationPrevious = React35.forwardRef(({ "aria-label": ariaLabel, child
|
|
|
3400
3549
|
ref,
|
|
3401
3550
|
...props,
|
|
3402
3551
|
children: [
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3404
|
-
/* @__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 })
|
|
3405
3554
|
]
|
|
3406
3555
|
}
|
|
3407
3556
|
);
|
|
3408
3557
|
});
|
|
3409
3558
|
AdsPaginationPrevious.displayName = "AdsPaginationPrevious";
|
|
3410
|
-
var AdsPaginationNext =
|
|
3559
|
+
var AdsPaginationNext = React36.forwardRef(
|
|
3411
3560
|
({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3412
3561
|
const { messages } = useAdsI18n();
|
|
3413
3562
|
const label = children ?? messages.pagination.next;
|
|
3414
|
-
return /* @__PURE__ */ (0,
|
|
3563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3415
3564
|
AdsPaginationLink,
|
|
3416
3565
|
{
|
|
3417
3566
|
"aria-label": ariaLabel ?? messages.pagination.next,
|
|
@@ -3419,8 +3568,8 @@ var AdsPaginationNext = React35.forwardRef(
|
|
|
3419
3568
|
ref,
|
|
3420
3569
|
...props,
|
|
3421
3570
|
children: [
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3423
|
-
/* @__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" })
|
|
3424
3573
|
]
|
|
3425
3574
|
}
|
|
3426
3575
|
);
|
|
@@ -3434,7 +3583,7 @@ function AdsPaginationEllipsis({
|
|
|
3434
3583
|
}) {
|
|
3435
3584
|
const { messages } = useAdsI18n();
|
|
3436
3585
|
const resolvedLabel = label ?? messages.pagination.morePages;
|
|
3437
|
-
return /* @__PURE__ */ (0,
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3438
3587
|
"span",
|
|
3439
3588
|
{
|
|
3440
3589
|
"aria-hidden": true,
|
|
@@ -3444,8 +3593,8 @@ function AdsPaginationEllipsis({
|
|
|
3444
3593
|
),
|
|
3445
3594
|
...props,
|
|
3446
3595
|
children: [
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3448
|
-
/* @__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 })
|
|
3449
3598
|
]
|
|
3450
3599
|
}
|
|
3451
3600
|
);
|
|
@@ -3453,8 +3602,8 @@ function AdsPaginationEllipsis({
|
|
|
3453
3602
|
AdsPaginationEllipsis.displayName = "AdsPaginationEllipsis";
|
|
3454
3603
|
|
|
3455
3604
|
// src/components/AdsSelect/index.tsx
|
|
3456
|
-
var
|
|
3457
|
-
var
|
|
3605
|
+
var React37 = __toESM(require("react"), 1);
|
|
3606
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3458
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)]";
|
|
3459
3608
|
var selectContentBaseClassName = "rounded-radius-md border-border bg-popover text-popover-foreground shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
3460
3609
|
function AdsSelect({
|
|
@@ -3465,6 +3614,7 @@ function AdsSelect({
|
|
|
3465
3614
|
defaultValue,
|
|
3466
3615
|
descriptionPlacement = "below",
|
|
3467
3616
|
disabled,
|
|
3617
|
+
emptyText,
|
|
3468
3618
|
errorText,
|
|
3469
3619
|
helperText,
|
|
3470
3620
|
id,
|
|
@@ -3478,7 +3628,7 @@ function AdsSelect({
|
|
|
3478
3628
|
}) {
|
|
3479
3629
|
const { messages } = useAdsI18n();
|
|
3480
3630
|
const isControlled = value !== void 0;
|
|
3481
|
-
const [internalValue, setInternalValue] =
|
|
3631
|
+
const [internalValue, setInternalValue] = React37.useState(
|
|
3482
3632
|
defaultValue
|
|
3483
3633
|
);
|
|
3484
3634
|
const resolvedValue = isControlled ? value : internalValue;
|
|
@@ -3491,7 +3641,9 @@ function AdsSelect({
|
|
|
3491
3641
|
id
|
|
3492
3642
|
});
|
|
3493
3643
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.select.clear;
|
|
3494
|
-
const
|
|
3644
|
+
const resolvedEmptyText = emptyText ?? messages.select.noOptionsAvailable;
|
|
3645
|
+
const hasOptions = React37.Children.toArray(children).length > 0;
|
|
3646
|
+
const handleValueChange = React37.useCallback(
|
|
3495
3647
|
(nextValue) => {
|
|
3496
3648
|
if (!isControlled) {
|
|
3497
3649
|
setInternalValue(nextValue);
|
|
@@ -3500,7 +3652,7 @@ function AdsSelect({
|
|
|
3500
3652
|
},
|
|
3501
3653
|
[isControlled, onValueChange]
|
|
3502
3654
|
);
|
|
3503
|
-
const handleClear =
|
|
3655
|
+
const handleClear = React37.useCallback(
|
|
3504
3656
|
(event) => {
|
|
3505
3657
|
event.preventDefault();
|
|
3506
3658
|
event.stopPropagation();
|
|
@@ -3512,12 +3664,12 @@ function AdsSelect({
|
|
|
3512
3664
|
},
|
|
3513
3665
|
[isControlled, onClear, onValueChange]
|
|
3514
3666
|
);
|
|
3515
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
3516
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
3517
|
-
return /* @__PURE__ */ (0,
|
|
3518
|
-
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,
|
|
3519
3671
|
descriptionPlacement === "above" ? helperNode : null,
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3521
3673
|
Select,
|
|
3522
3674
|
{
|
|
3523
3675
|
...props,
|
|
@@ -3525,8 +3677,8 @@ function AdsSelect({
|
|
|
3525
3677
|
onValueChange: handleValueChange,
|
|
3526
3678
|
...resolvedValue !== void 0 ? { value: resolvedValue } : {},
|
|
3527
3679
|
children: [
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3529
|
-
/* @__PURE__ */ (0,
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3530
3682
|
SelectTrigger,
|
|
3531
3683
|
{
|
|
3532
3684
|
"aria-describedby": description.describedBy,
|
|
@@ -3538,10 +3690,10 @@ function AdsSelect({
|
|
|
3538
3690
|
triggerClassName
|
|
3539
3691
|
),
|
|
3540
3692
|
id: description.inputId,
|
|
3541
|
-
children: /* @__PURE__ */ (0,
|
|
3693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, { placeholder })
|
|
3542
3694
|
}
|
|
3543
3695
|
),
|
|
3544
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3696
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3545
3697
|
AdsClearButton,
|
|
3546
3698
|
{
|
|
3547
3699
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -3550,11 +3702,21 @@ function AdsSelect({
|
|
|
3550
3702
|
}
|
|
3551
3703
|
) : null
|
|
3552
3704
|
] }),
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3554
3706
|
SelectContent,
|
|
3555
3707
|
{
|
|
3556
3708
|
className: cn(selectContentBaseClassName, contentClassName3),
|
|
3557
|
-
children
|
|
3709
|
+
children: hasOptions ? children : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3710
|
+
"div",
|
|
3711
|
+
{
|
|
3712
|
+
"aria-live": "polite",
|
|
3713
|
+
className: cn(
|
|
3714
|
+
"flex min-h-8 items-center justify-center px-3 py-2 text-sm",
|
|
3715
|
+
adsTextColorClassName.muted
|
|
3716
|
+
),
|
|
3717
|
+
children: resolvedEmptyText
|
|
3718
|
+
}
|
|
3719
|
+
)
|
|
3558
3720
|
}
|
|
3559
3721
|
)
|
|
3560
3722
|
]
|
|
@@ -3567,7 +3729,7 @@ function AdsSelect({
|
|
|
3567
3729
|
}
|
|
3568
3730
|
|
|
3569
3731
|
// src/components/AdsDataPagination/index.tsx
|
|
3570
|
-
var
|
|
3732
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3571
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";
|
|
3572
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)]";
|
|
3573
3735
|
var paginationButtonActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
@@ -3643,9 +3805,9 @@ function AdsDataPagination({
|
|
|
3643
3805
|
ariaLabel
|
|
3644
3806
|
}) {
|
|
3645
3807
|
const { messages } = useAdsI18n();
|
|
3646
|
-
const [internalCurrent, setInternalCurrent] =
|
|
3647
|
-
const [internalPageSize, setInternalPageSize] =
|
|
3648
|
-
const [quickJumpValue, setQuickJumpValue] =
|
|
3808
|
+
const [internalCurrent, setInternalCurrent] = React38.useState(defaultCurrent);
|
|
3809
|
+
const [internalPageSize, setInternalPageSize] = React38.useState(defaultPageSize);
|
|
3810
|
+
const [quickJumpValue, setQuickJumpValue] = React38.useState("");
|
|
3649
3811
|
const isCurrentControlled = current !== void 0;
|
|
3650
3812
|
const isPageSizeControlled = pageSize !== void 0;
|
|
3651
3813
|
const mergedPageSize = Math.max(1, isPageSizeControlled ? pageSize : internalPageSize);
|
|
@@ -3666,20 +3828,20 @@ function AdsDataPagination({
|
|
|
3666
3828
|
new Set(pageSizeOptions.filter((option) => Number.isFinite(option) && option > 0))
|
|
3667
3829
|
);
|
|
3668
3830
|
const resolvedPageSizeOptions = pageSizeValues.length > 0 ? pageSizeValues : [10, 20, 50, 100];
|
|
3669
|
-
|
|
3831
|
+
React38.useEffect(() => {
|
|
3670
3832
|
if (!isCurrentControlled && internalCurrent !== mergedCurrent) {
|
|
3671
3833
|
setInternalCurrent(mergedCurrent);
|
|
3672
3834
|
}
|
|
3673
3835
|
}, [internalCurrent, isCurrentControlled, mergedCurrent]);
|
|
3674
|
-
|
|
3836
|
+
React38.useEffect(() => {
|
|
3675
3837
|
if (!isPageSizeControlled && internalPageSize !== mergedPageSize) {
|
|
3676
3838
|
setInternalPageSize(mergedPageSize);
|
|
3677
3839
|
}
|
|
3678
3840
|
}, [internalPageSize, isPageSizeControlled, mergedPageSize]);
|
|
3679
|
-
|
|
3841
|
+
React38.useEffect(() => {
|
|
3680
3842
|
setQuickJumpValue(String(mergedCurrent));
|
|
3681
3843
|
}, [mergedCurrent]);
|
|
3682
|
-
const commitPageChange =
|
|
3844
|
+
const commitPageChange = React38.useCallback(
|
|
3683
3845
|
(nextPage, nextPageSize = mergedPageSize) => {
|
|
3684
3846
|
const clampedPage = clampPage(nextPage, Math.max(1, Math.ceil(Math.max(total, 0) / nextPageSize)));
|
|
3685
3847
|
if (!isCurrentControlled) {
|
|
@@ -3693,7 +3855,7 @@ function AdsDataPagination({
|
|
|
3693
3855
|
},
|
|
3694
3856
|
[isCurrentControlled, mergedCurrent, mergedPageSize, onChange, total]
|
|
3695
3857
|
);
|
|
3696
|
-
const handlePageSizeChange =
|
|
3858
|
+
const handlePageSizeChange = React38.useCallback(
|
|
3697
3859
|
(nextValue) => {
|
|
3698
3860
|
const nextPageSize = Number(nextValue);
|
|
3699
3861
|
if (!Number.isFinite(nextPageSize) || nextPageSize <= 0 || nextPageSize === mergedPageSize) {
|
|
@@ -3718,7 +3880,7 @@ function AdsDataPagination({
|
|
|
3718
3880
|
total
|
|
3719
3881
|
]
|
|
3720
3882
|
);
|
|
3721
|
-
const handleQuickJumpSubmit =
|
|
3883
|
+
const handleQuickJumpSubmit = React38.useCallback(() => {
|
|
3722
3884
|
const trimmedValue = quickJumpValue.trim();
|
|
3723
3885
|
if (!trimmedValue) {
|
|
3724
3886
|
setQuickJumpValue(String(mergedCurrent));
|
|
@@ -3752,8 +3914,8 @@ function AdsDataPagination({
|
|
|
3752
3914
|
);
|
|
3753
3915
|
const renderPageNavigation = () => {
|
|
3754
3916
|
if (variant === "compact") {
|
|
3755
|
-
return /* @__PURE__ */ (0,
|
|
3756
|
-
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)(
|
|
3757
3919
|
Button,
|
|
3758
3920
|
{
|
|
3759
3921
|
"aria-label": messages.pagination.first,
|
|
@@ -3766,7 +3928,7 @@ function AdsDataPagination({
|
|
|
3766
3928
|
children: messages.pagination.first
|
|
3767
3929
|
}
|
|
3768
3930
|
) : null,
|
|
3769
|
-
/* @__PURE__ */ (0,
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3770
3932
|
Button,
|
|
3771
3933
|
{
|
|
3772
3934
|
"aria-label": messages.pagination.previous,
|
|
@@ -3779,7 +3941,7 @@ function AdsDataPagination({
|
|
|
3779
3941
|
children: messages.pagination.previous
|
|
3780
3942
|
}
|
|
3781
3943
|
),
|
|
3782
|
-
/* @__PURE__ */ (0,
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3783
3945
|
"span",
|
|
3784
3946
|
{
|
|
3785
3947
|
"aria-current": "page",
|
|
@@ -3787,7 +3949,7 @@ function AdsDataPagination({
|
|
|
3787
3949
|
children: pageStatus
|
|
3788
3950
|
}
|
|
3789
3951
|
),
|
|
3790
|
-
/* @__PURE__ */ (0,
|
|
3952
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3791
3953
|
Button,
|
|
3792
3954
|
{
|
|
3793
3955
|
"aria-label": messages.pagination.next,
|
|
@@ -3800,7 +3962,7 @@ function AdsDataPagination({
|
|
|
3800
3962
|
children: messages.pagination.next
|
|
3801
3963
|
}
|
|
3802
3964
|
),
|
|
3803
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3965
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3804
3966
|
Button,
|
|
3805
3967
|
{
|
|
3806
3968
|
"aria-label": messages.pagination.last,
|
|
@@ -3815,8 +3977,8 @@ function AdsDataPagination({
|
|
|
3815
3977
|
) : null
|
|
3816
3978
|
] });
|
|
3817
3979
|
}
|
|
3818
|
-
return /* @__PURE__ */ (0,
|
|
3819
|
-
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)(
|
|
3820
3982
|
Button,
|
|
3821
3983
|
{
|
|
3822
3984
|
"aria-label": messages.pagination.first,
|
|
@@ -3829,7 +3991,7 @@ function AdsDataPagination({
|
|
|
3829
3991
|
children: messages.pagination.first
|
|
3830
3992
|
}
|
|
3831
3993
|
) }) : null,
|
|
3832
|
-
/* @__PURE__ */ (0,
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3833
3995
|
Button,
|
|
3834
3996
|
{
|
|
3835
3997
|
"aria-label": messages.pagination.previous,
|
|
@@ -3843,7 +4005,7 @@ function AdsDataPagination({
|
|
|
3843
4005
|
}
|
|
3844
4006
|
) }),
|
|
3845
4007
|
paginationRange.map(
|
|
3846
|
-
(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)(
|
|
3847
4009
|
Button,
|
|
3848
4010
|
{
|
|
3849
4011
|
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
@@ -3860,7 +4022,7 @@ function AdsDataPagination({
|
|
|
3860
4022
|
}
|
|
3861
4023
|
) }, token)
|
|
3862
4024
|
),
|
|
3863
|
-
/* @__PURE__ */ (0,
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3864
4026
|
Button,
|
|
3865
4027
|
{
|
|
3866
4028
|
"aria-label": messages.pagination.next,
|
|
@@ -3873,7 +4035,7 @@ function AdsDataPagination({
|
|
|
3873
4035
|
children: messages.pagination.next
|
|
3874
4036
|
}
|
|
3875
4037
|
) }),
|
|
3876
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
4038
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3877
4039
|
Button,
|
|
3878
4040
|
{
|
|
3879
4041
|
"aria-label": messages.pagination.last,
|
|
@@ -3888,7 +4050,7 @@ function AdsDataPagination({
|
|
|
3888
4050
|
) }) : null
|
|
3889
4051
|
] }) });
|
|
3890
4052
|
};
|
|
3891
|
-
return /* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3892
4054
|
"div",
|
|
3893
4055
|
{
|
|
3894
4056
|
"data-slot": "ads-data-pagination",
|
|
@@ -3898,34 +4060,34 @@ function AdsDataPagination({
|
|
|
3898
4060
|
className
|
|
3899
4061
|
),
|
|
3900
4062
|
children: [
|
|
3901
|
-
/* @__PURE__ */ (0,
|
|
3902
|
-
variant === "compact" ? /* @__PURE__ */ (0,
|
|
3903
|
-
showSizeChanger ? /* @__PURE__ */ (0,
|
|
3904
|
-
/* @__PURE__ */ (0,
|
|
3905
|
-
/* @__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)(
|
|
3906
4068
|
Select,
|
|
3907
4069
|
{
|
|
3908
4070
|
disabled,
|
|
3909
4071
|
onValueChange: handlePageSizeChange,
|
|
3910
4072
|
value: String(mergedPageSize),
|
|
3911
4073
|
children: [
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3913
4075
|
SelectTrigger,
|
|
3914
4076
|
{
|
|
3915
4077
|
"aria-label": messages.pagination.itemsPerPage,
|
|
3916
4078
|
className: cn(inlineControlClassName, "w-[132px] px-sm"),
|
|
3917
|
-
children: /* @__PURE__ */ (0,
|
|
4079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectValue, {})
|
|
3918
4080
|
}
|
|
3919
4081
|
),
|
|
3920
|
-
/* @__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)) })
|
|
3921
4083
|
]
|
|
3922
4084
|
}
|
|
3923
4085
|
)
|
|
3924
4086
|
] }) : null
|
|
3925
4087
|
] }),
|
|
3926
|
-
/* @__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: [
|
|
3927
4089
|
renderPageNavigation(),
|
|
3928
|
-
showQuickJumper ? /* @__PURE__ */ (0,
|
|
4090
|
+
showQuickJumper ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3929
4091
|
"label",
|
|
3930
4092
|
{
|
|
3931
4093
|
className: cn(
|
|
@@ -3933,8 +4095,8 @@ function AdsDataPagination({
|
|
|
3933
4095
|
classNames?.quickJumper
|
|
3934
4096
|
),
|
|
3935
4097
|
children: [
|
|
3936
|
-
/* @__PURE__ */ (0,
|
|
3937
|
-
/* @__PURE__ */ (0,
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: messages.pagination.jumpTo }),
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3938
4100
|
Input,
|
|
3939
4101
|
{
|
|
3940
4102
|
"aria-label": messages.pagination.jumpTo,
|
|
@@ -3962,12 +4124,12 @@ function AdsDataPagination({
|
|
|
3962
4124
|
}
|
|
3963
4125
|
|
|
3964
4126
|
// src/components/AdsDataTable/index.tsx
|
|
3965
|
-
var
|
|
4127
|
+
var React43 = __toESM(require("react"), 1);
|
|
3966
4128
|
var import_lucide_react16 = require("lucide-react");
|
|
3967
4129
|
|
|
3968
4130
|
// src/components/AdsEmpty/index.tsx
|
|
3969
4131
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3970
|
-
var
|
|
4132
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3971
4133
|
var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
3972
4134
|
"flex w-full flex-col items-center justify-center gap-6 p-12 text-center",
|
|
3973
4135
|
{
|
|
@@ -3984,7 +4146,7 @@ var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3984
4146
|
}
|
|
3985
4147
|
);
|
|
3986
4148
|
function AdsEmpty({ className, variant, ...props }) {
|
|
3987
|
-
return /* @__PURE__ */ (0,
|
|
4149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3988
4150
|
"div",
|
|
3989
4151
|
{
|
|
3990
4152
|
"data-slot": "ads-empty",
|
|
@@ -3994,7 +4156,7 @@ function AdsEmpty({ className, variant, ...props }) {
|
|
|
3994
4156
|
);
|
|
3995
4157
|
}
|
|
3996
4158
|
function AdsEmptyHeader({ className, ...props }) {
|
|
3997
|
-
return /* @__PURE__ */ (0,
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3998
4160
|
"div",
|
|
3999
4161
|
{
|
|
4000
4162
|
"data-slot": "ads-empty-header",
|
|
@@ -4004,7 +4166,7 @@ function AdsEmptyHeader({ className, ...props }) {
|
|
|
4004
4166
|
);
|
|
4005
4167
|
}
|
|
4006
4168
|
function AdsEmptyMedia({ className, ...props }) {
|
|
4007
|
-
return /* @__PURE__ */ (0,
|
|
4169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4008
4170
|
"div",
|
|
4009
4171
|
{
|
|
4010
4172
|
"data-slot": "ads-empty-media",
|
|
@@ -4018,7 +4180,7 @@ function AdsEmptyMedia({ className, ...props }) {
|
|
|
4018
4180
|
);
|
|
4019
4181
|
}
|
|
4020
4182
|
function AdsEmptyTitle({ className, ...props }) {
|
|
4021
|
-
return /* @__PURE__ */ (0,
|
|
4183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4022
4184
|
"div",
|
|
4023
4185
|
{
|
|
4024
4186
|
"data-slot": "ads-empty-title",
|
|
@@ -4028,7 +4190,7 @@ function AdsEmptyTitle({ className, ...props }) {
|
|
|
4028
4190
|
);
|
|
4029
4191
|
}
|
|
4030
4192
|
function AdsEmptyDescription({ className, ...props }) {
|
|
4031
|
-
return /* @__PURE__ */ (0,
|
|
4193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4032
4194
|
"p",
|
|
4033
4195
|
{
|
|
4034
4196
|
"data-slot": "ads-empty-description",
|
|
@@ -4038,7 +4200,7 @@ function AdsEmptyDescription({ className, ...props }) {
|
|
|
4038
4200
|
);
|
|
4039
4201
|
}
|
|
4040
4202
|
function AdsEmptyContent({ className, ...props }) {
|
|
4041
|
-
return /* @__PURE__ */ (0,
|
|
4203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4042
4204
|
"div",
|
|
4043
4205
|
{
|
|
4044
4206
|
"data-slot": "ads-empty-content",
|
|
@@ -4048,7 +4210,7 @@ function AdsEmptyContent({ className, ...props }) {
|
|
|
4048
4210
|
);
|
|
4049
4211
|
}
|
|
4050
4212
|
function AdsEmptyActions({ className, ...props }) {
|
|
4051
|
-
return /* @__PURE__ */ (0,
|
|
4213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4052
4214
|
"div",
|
|
4053
4215
|
{
|
|
4054
4216
|
"data-slot": "ads-empty-actions",
|
|
@@ -4058,7 +4220,7 @@ function AdsEmptyActions({ className, ...props }) {
|
|
|
4058
4220
|
);
|
|
4059
4221
|
}
|
|
4060
4222
|
function AdsEmptyFooter({ className, ...props }) {
|
|
4061
|
-
return /* @__PURE__ */ (0,
|
|
4223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4062
4224
|
"div",
|
|
4063
4225
|
{
|
|
4064
4226
|
"data-slot": "ads-empty-footer",
|
|
@@ -4069,19 +4231,19 @@ function AdsEmptyFooter({ className, ...props }) {
|
|
|
4069
4231
|
}
|
|
4070
4232
|
|
|
4071
4233
|
// src/components/AdsTable/index.tsx
|
|
4072
|
-
var
|
|
4234
|
+
var React42 = __toESM(require("react"), 1);
|
|
4073
4235
|
var import_lucide_react15 = require("lucide-react");
|
|
4074
4236
|
|
|
4075
4237
|
// src/components/AdsRadioGroup/index.tsx
|
|
4076
|
-
var
|
|
4238
|
+
var React40 = __toESM(require("react"), 1);
|
|
4077
4239
|
|
|
4078
4240
|
// src/primitives/radio-group.tsx
|
|
4079
|
-
var
|
|
4241
|
+
var React39 = __toESM(require("react"), 1);
|
|
4080
4242
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
4081
4243
|
var import_lucide_react14 = require("lucide-react");
|
|
4082
|
-
var
|
|
4083
|
-
var RadioGroup =
|
|
4084
|
-
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)(
|
|
4085
4247
|
RadioGroupPrimitive.Root,
|
|
4086
4248
|
{
|
|
4087
4249
|
className: cn("grid gap-2", className),
|
|
@@ -4091,8 +4253,8 @@ var RadioGroup = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
4091
4253
|
);
|
|
4092
4254
|
});
|
|
4093
4255
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4094
|
-
var RadioGroupItem =
|
|
4095
|
-
return /* @__PURE__ */ (0,
|
|
4256
|
+
var RadioGroupItem = React39.forwardRef(({ className, ...props }, ref) => {
|
|
4257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4096
4258
|
RadioGroupPrimitive.Item,
|
|
4097
4259
|
{
|
|
4098
4260
|
ref,
|
|
@@ -4101,19 +4263,19 @@ var RadioGroupItem = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
4101
4263
|
className
|
|
4102
4264
|
),
|
|
4103
4265
|
...props,
|
|
4104
|
-
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" }) })
|
|
4105
4267
|
}
|
|
4106
4268
|
);
|
|
4107
4269
|
});
|
|
4108
4270
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
4109
4271
|
|
|
4110
4272
|
// src/components/AdsRadioGroup/index.tsx
|
|
4111
|
-
var
|
|
4273
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4112
4274
|
var radioGroupBaseClassName = "gap-3";
|
|
4113
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";
|
|
4114
|
-
var RadioGroup2 =
|
|
4276
|
+
var RadioGroup2 = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroup, { className: cn(radioGroupBaseClassName, className), ref, ...props }));
|
|
4115
4277
|
RadioGroup2.displayName = "RadioGroup";
|
|
4116
|
-
var RadioGroupItem2 =
|
|
4278
|
+
var RadioGroupItem2 = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4117
4279
|
RadioGroupItem,
|
|
4118
4280
|
{
|
|
4119
4281
|
className: cn(radioItemBaseClassName, className),
|
|
@@ -4122,7 +4284,7 @@ var RadioGroupItem2 = React39.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4122
4284
|
}
|
|
4123
4285
|
));
|
|
4124
4286
|
RadioGroupItem2.displayName = "RadioGroupItem";
|
|
4125
|
-
var AdsRadioGroup =
|
|
4287
|
+
var AdsRadioGroup = React40.forwardRef(
|
|
4126
4288
|
({
|
|
4127
4289
|
children,
|
|
4128
4290
|
className,
|
|
@@ -4138,12 +4300,12 @@ var AdsRadioGroup = React39.forwardRef(
|
|
|
4138
4300
|
helperText,
|
|
4139
4301
|
id
|
|
4140
4302
|
});
|
|
4141
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
4142
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
4143
|
-
return /* @__PURE__ */ (0,
|
|
4144
|
-
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,
|
|
4145
4307
|
descriptionPlacement === "above" ? helperNode : null,
|
|
4146
|
-
/* @__PURE__ */ (0,
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4147
4309
|
RadioGroup2,
|
|
4148
4310
|
{
|
|
4149
4311
|
"aria-describedby": description.describedBy,
|
|
@@ -4159,11 +4321,11 @@ var AdsRadioGroup = React39.forwardRef(
|
|
|
4159
4321
|
}
|
|
4160
4322
|
);
|
|
4161
4323
|
AdsRadioGroup.displayName = "AdsRadioGroup";
|
|
4162
|
-
var AdsRadioGroupOption =
|
|
4163
|
-
const generatedId =
|
|
4324
|
+
var AdsRadioGroupOption = React40.forwardRef(({ className, description, id, label, value, ...props }, ref) => {
|
|
4325
|
+
const generatedId = React40.useId();
|
|
4164
4326
|
const inputId = id ?? generatedId;
|
|
4165
|
-
return /* @__PURE__ */ (0,
|
|
4166
|
-
/* @__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)(
|
|
4167
4329
|
RadioGroupItem2,
|
|
4168
4330
|
{
|
|
4169
4331
|
className: cn(className),
|
|
@@ -4173,20 +4335,20 @@ var AdsRadioGroupOption = React39.forwardRef(({ className, description, id, labe
|
|
|
4173
4335
|
...props
|
|
4174
4336
|
}
|
|
4175
4337
|
),
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4178
|
-
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
|
|
4179
4341
|
] })
|
|
4180
4342
|
] });
|
|
4181
4343
|
});
|
|
4182
4344
|
AdsRadioGroupOption.displayName = "AdsRadioGroupOption";
|
|
4183
|
-
var AdsRadioGroupCardOption =
|
|
4184
|
-
const generatedId =
|
|
4345
|
+
var AdsRadioGroupCardOption = React40.forwardRef(({ className, description, disabled, id, label, value, ...props }, ref) => {
|
|
4346
|
+
const generatedId = React40.useId();
|
|
4185
4347
|
const inputId = id ?? generatedId;
|
|
4186
4348
|
const titleId = `${inputId}-label`;
|
|
4187
4349
|
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
4188
|
-
return /* @__PURE__ */ (0,
|
|
4189
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative", children: [
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4190
4352
|
RadioGroupItem2,
|
|
4191
4353
|
{
|
|
4192
4354
|
"aria-describedby": descriptionId,
|
|
@@ -4199,7 +4361,7 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4199
4361
|
...props
|
|
4200
4362
|
}
|
|
4201
4363
|
),
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4203
4365
|
"div",
|
|
4204
4366
|
{
|
|
4205
4367
|
className: cn(
|
|
@@ -4208,16 +4370,16 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4208
4370
|
className
|
|
4209
4371
|
),
|
|
4210
4372
|
children: [
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4212
|
-
/* @__PURE__ */ (0,
|
|
4213
|
-
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
|
|
4214
4376
|
] }),
|
|
4215
|
-
/* @__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)(
|
|
4216
4378
|
"div",
|
|
4217
4379
|
{
|
|
4218
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)]",
|
|
4219
4381
|
"data-indicator": true,
|
|
4220
|
-
children: /* @__PURE__ */ (0,
|
|
4382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4221
4383
|
"span",
|
|
4222
4384
|
{
|
|
4223
4385
|
className: "h-2 w-2 rounded-full bg-primary transition-opacity",
|
|
@@ -4234,9 +4396,9 @@ var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disa
|
|
|
4234
4396
|
AdsRadioGroupCardOption.displayName = "AdsRadioGroupCardOption";
|
|
4235
4397
|
|
|
4236
4398
|
// src/primitives/table.tsx
|
|
4237
|
-
var
|
|
4238
|
-
var
|
|
4239
|
-
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)(
|
|
4240
4402
|
"table",
|
|
4241
4403
|
{
|
|
4242
4404
|
ref,
|
|
@@ -4245,7 +4407,7 @@ var Table = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
4245
4407
|
}
|
|
4246
4408
|
));
|
|
4247
4409
|
Table.displayName = "Table";
|
|
4248
|
-
var TableScrollArea =
|
|
4410
|
+
var TableScrollArea = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4249
4411
|
"div",
|
|
4250
4412
|
{
|
|
4251
4413
|
ref,
|
|
@@ -4254,9 +4416,9 @@ var TableScrollArea = React40.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4254
4416
|
}
|
|
4255
4417
|
));
|
|
4256
4418
|
TableScrollArea.displayName = "TableScrollArea";
|
|
4257
|
-
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 }));
|
|
4258
4420
|
TableHeader.displayName = "TableHeader";
|
|
4259
|
-
var TableBody =
|
|
4421
|
+
var TableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4260
4422
|
"tbody",
|
|
4261
4423
|
{
|
|
4262
4424
|
ref,
|
|
@@ -4265,7 +4427,7 @@ var TableBody = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4265
4427
|
}
|
|
4266
4428
|
));
|
|
4267
4429
|
TableBody.displayName = "TableBody";
|
|
4268
|
-
var TableFooter =
|
|
4430
|
+
var TableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4269
4431
|
"tfoot",
|
|
4270
4432
|
{
|
|
4271
4433
|
ref,
|
|
@@ -4277,7 +4439,7 @@ var TableFooter = React40.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4277
4439
|
}
|
|
4278
4440
|
));
|
|
4279
4441
|
TableFooter.displayName = "TableFooter";
|
|
4280
|
-
var TableRow =
|
|
4442
|
+
var TableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4281
4443
|
"tr",
|
|
4282
4444
|
{
|
|
4283
4445
|
ref,
|
|
@@ -4289,7 +4451,7 @@ var TableRow = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4289
4451
|
}
|
|
4290
4452
|
));
|
|
4291
4453
|
TableRow.displayName = "TableRow";
|
|
4292
|
-
var TableHead =
|
|
4454
|
+
var TableHead = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4293
4455
|
"th",
|
|
4294
4456
|
{
|
|
4295
4457
|
ref,
|
|
@@ -4301,7 +4463,7 @@ var TableHead = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4301
4463
|
}
|
|
4302
4464
|
));
|
|
4303
4465
|
TableHead.displayName = "TableHead";
|
|
4304
|
-
var TableCell =
|
|
4466
|
+
var TableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4305
4467
|
"td",
|
|
4306
4468
|
{
|
|
4307
4469
|
ref,
|
|
@@ -4310,7 +4472,7 @@ var TableCell = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4310
4472
|
}
|
|
4311
4473
|
));
|
|
4312
4474
|
TableCell.displayName = "TableCell";
|
|
4313
|
-
var TableCaption =
|
|
4475
|
+
var TableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4314
4476
|
"caption",
|
|
4315
4477
|
{
|
|
4316
4478
|
ref,
|
|
@@ -4319,21 +4481,21 @@ var TableCaption = React40.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4319
4481
|
}
|
|
4320
4482
|
));
|
|
4321
4483
|
TableCaption.displayName = "TableCaption";
|
|
4322
|
-
var TableColGroup =
|
|
4484
|
+
var TableColGroup = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("colgroup", { ref, className: cn(className), ...props }));
|
|
4323
4485
|
TableColGroup.displayName = "TableColGroup";
|
|
4324
|
-
var TableCol =
|
|
4486
|
+
var TableCol = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("col", { ref, className: cn(className), ...props }));
|
|
4325
4487
|
TableCol.displayName = "TableCol";
|
|
4326
4488
|
|
|
4327
4489
|
// src/components/AdsTable/index.tsx
|
|
4328
|
-
var
|
|
4329
|
-
var AdsTableStickyHeaderContext =
|
|
4490
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4491
|
+
var AdsTableStickyHeaderContext = React42.createContext(false);
|
|
4330
4492
|
function resolveLength(value) {
|
|
4331
4493
|
if (value === void 0) {
|
|
4332
4494
|
return void 0;
|
|
4333
4495
|
}
|
|
4334
4496
|
return typeof value === "number" ? `${value}px` : value;
|
|
4335
4497
|
}
|
|
4336
|
-
var AdsTableSurface =
|
|
4498
|
+
var AdsTableSurface = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4337
4499
|
"div",
|
|
4338
4500
|
{
|
|
4339
4501
|
ref,
|
|
@@ -4345,8 +4507,8 @@ var AdsTableSurface = React41.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4345
4507
|
}
|
|
4346
4508
|
));
|
|
4347
4509
|
AdsTableSurface.displayName = "AdsTableSurface";
|
|
4348
|
-
var AdsTableRoot =
|
|
4349
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4510
|
+
var AdsTableRoot = React42.forwardRef(
|
|
4511
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4350
4512
|
Table,
|
|
4351
4513
|
{
|
|
4352
4514
|
ref,
|
|
@@ -4361,7 +4523,7 @@ var AdsTableRoot = React41.forwardRef(
|
|
|
4361
4523
|
)
|
|
4362
4524
|
);
|
|
4363
4525
|
AdsTableRoot.displayName = "AdsTableRoot";
|
|
4364
|
-
var AdsTableScrollArea =
|
|
4526
|
+
var AdsTableScrollArea = React42.forwardRef(
|
|
4365
4527
|
({
|
|
4366
4528
|
children,
|
|
4367
4529
|
className,
|
|
@@ -4371,7 +4533,7 @@ var AdsTableScrollArea = React41.forwardRef(
|
|
|
4371
4533
|
x,
|
|
4372
4534
|
y,
|
|
4373
4535
|
...props
|
|
4374
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
4536
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableStickyHeaderContext.Provider, { value: stickyHeader, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4375
4537
|
TableScrollArea,
|
|
4376
4538
|
{
|
|
4377
4539
|
ref,
|
|
@@ -4393,15 +4555,15 @@ var AdsTableScrollArea = React41.forwardRef(
|
|
|
4393
4555
|
) })
|
|
4394
4556
|
);
|
|
4395
4557
|
AdsTableScrollArea.displayName = "AdsTableScrollArea";
|
|
4396
|
-
var AdsTable =
|
|
4397
|
-
({ 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 }) }) })
|
|
4398
4560
|
);
|
|
4399
4561
|
AdsTable.displayName = "AdsTable";
|
|
4400
|
-
var AdsTableColGroup =
|
|
4562
|
+
var AdsTableColGroup = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableColGroup, { ref, className, ...props }));
|
|
4401
4563
|
AdsTableColGroup.displayName = "AdsTableColGroup";
|
|
4402
|
-
var AdsTableCol =
|
|
4564
|
+
var AdsTableCol = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCol, { ref, className, ...props }));
|
|
4403
4565
|
AdsTableCol.displayName = "AdsTableCol";
|
|
4404
|
-
var AdsTableHeader =
|
|
4566
|
+
var AdsTableHeader = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4405
4567
|
TableHeader,
|
|
4406
4568
|
{
|
|
4407
4569
|
ref,
|
|
@@ -4410,7 +4572,7 @@ var AdsTableHeader = React41.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4410
4572
|
}
|
|
4411
4573
|
));
|
|
4412
4574
|
AdsTableHeader.displayName = "AdsTableHeader";
|
|
4413
|
-
var AdsTableBody =
|
|
4575
|
+
var AdsTableBody = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4414
4576
|
TableBody,
|
|
4415
4577
|
{
|
|
4416
4578
|
ref,
|
|
@@ -4419,7 +4581,7 @@ var AdsTableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4419
4581
|
}
|
|
4420
4582
|
));
|
|
4421
4583
|
AdsTableBody.displayName = "AdsTableBody";
|
|
4422
|
-
var AdsTableFooter =
|
|
4584
|
+
var AdsTableFooter = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4423
4585
|
TableFooter,
|
|
4424
4586
|
{
|
|
4425
4587
|
ref,
|
|
@@ -4432,7 +4594,7 @@ var AdsTableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4432
4594
|
}
|
|
4433
4595
|
));
|
|
4434
4596
|
AdsTableFooter.displayName = "AdsTableFooter";
|
|
4435
|
-
var AdsTableRow =
|
|
4597
|
+
var AdsTableRow = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4436
4598
|
TableRow,
|
|
4437
4599
|
{
|
|
4438
4600
|
ref,
|
|
@@ -4444,9 +4606,9 @@ var AdsTableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4444
4606
|
}
|
|
4445
4607
|
));
|
|
4446
4608
|
AdsTableRow.displayName = "AdsTableRow";
|
|
4447
|
-
var AdsTableHead =
|
|
4448
|
-
const stickyHeader =
|
|
4449
|
-
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)(
|
|
4450
4612
|
TableHead,
|
|
4451
4613
|
{
|
|
4452
4614
|
ref,
|
|
@@ -4461,7 +4623,7 @@ var AdsTableHead = React41.forwardRef(({ className, ...props }, ref) => {
|
|
|
4461
4623
|
);
|
|
4462
4624
|
});
|
|
4463
4625
|
AdsTableHead.displayName = "AdsTableHead";
|
|
4464
|
-
var AdsTableCell =
|
|
4626
|
+
var AdsTableCell = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4465
4627
|
TableCell,
|
|
4466
4628
|
{
|
|
4467
4629
|
ref,
|
|
@@ -4474,7 +4636,7 @@ var AdsTableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4474
4636
|
}
|
|
4475
4637
|
));
|
|
4476
4638
|
AdsTableCell.displayName = "AdsTableCell";
|
|
4477
|
-
var AdsTableCaption =
|
|
4639
|
+
var AdsTableCaption = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4478
4640
|
TableCaption,
|
|
4479
4641
|
{
|
|
4480
4642
|
ref,
|
|
@@ -4483,12 +4645,12 @@ var AdsTableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4483
4645
|
}
|
|
4484
4646
|
));
|
|
4485
4647
|
AdsTableCaption.displayName = "AdsTableCaption";
|
|
4486
|
-
var AdsTableSortHeader =
|
|
4648
|
+
var AdsTableSortHeader = React42.forwardRef(
|
|
4487
4649
|
({ className, disabled = false, onToggleSort, sortOrder, title, ...props }, ref) => {
|
|
4488
4650
|
const { messages } = useAdsI18n();
|
|
4489
4651
|
const nextOrder = sortOrder === null ? "ascend" : sortOrder === "ascend" ? "descend" : null;
|
|
4490
4652
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
4491
|
-
return /* @__PURE__ */ (0,
|
|
4653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableHead, { ref, className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
4492
4654
|
Button,
|
|
4493
4655
|
{
|
|
4494
4656
|
"aria-label": `${title} ${actionLabel}`,
|
|
@@ -4504,15 +4666,15 @@ var AdsTableSortHeader = React41.forwardRef(
|
|
|
4504
4666
|
type: "button",
|
|
4505
4667
|
variant: "ghost",
|
|
4506
4668
|
children: [
|
|
4507
|
-
/* @__PURE__ */ (0,
|
|
4508
|
-
/* @__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" }) })
|
|
4509
4671
|
]
|
|
4510
4672
|
}
|
|
4511
4673
|
) });
|
|
4512
4674
|
}
|
|
4513
4675
|
);
|
|
4514
4676
|
AdsTableSortHeader.displayName = "AdsTableSortHeader";
|
|
4515
|
-
var AdsTableSelectionCell =
|
|
4677
|
+
var AdsTableSelectionCell = React42.forwardRef(
|
|
4516
4678
|
({
|
|
4517
4679
|
checked = false,
|
|
4518
4680
|
className,
|
|
@@ -4523,7 +4685,7 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4523
4685
|
...props
|
|
4524
4686
|
}, ref) => {
|
|
4525
4687
|
const { messages } = useAdsI18n();
|
|
4526
|
-
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)(
|
|
4527
4689
|
RadioGroupItem2,
|
|
4528
4690
|
{
|
|
4529
4691
|
"aria-label": messages.table.selectRow,
|
|
@@ -4535,7 +4697,7 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4535
4697
|
},
|
|
4536
4698
|
value
|
|
4537
4699
|
}
|
|
4538
|
-
) : /* @__PURE__ */ (0,
|
|
4700
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4539
4701
|
Checkbox2,
|
|
4540
4702
|
{
|
|
4541
4703
|
"aria-label": messages.table.selectRow,
|
|
@@ -4549,10 +4711,10 @@ var AdsTableSelectionCell = React41.forwardRef(
|
|
|
4549
4711
|
}
|
|
4550
4712
|
);
|
|
4551
4713
|
AdsTableSelectionCell.displayName = "AdsTableSelectionCell";
|
|
4552
|
-
var AdsTableExpandCell =
|
|
4714
|
+
var AdsTableExpandCell = React42.forwardRef(
|
|
4553
4715
|
({ className, disabled = false, expanded = false, onToggle, ...props }, ref) => {
|
|
4554
4716
|
const { messages } = useAdsI18n();
|
|
4555
|
-
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)(
|
|
4556
4718
|
Button,
|
|
4557
4719
|
{
|
|
4558
4720
|
"aria-label": expanded ? messages.table.collapseRow : messages.table.expandRow,
|
|
@@ -4569,7 +4731,7 @@ var AdsTableExpandCell = React41.forwardRef(
|
|
|
4569
4731
|
size: "sm",
|
|
4570
4732
|
type: "button",
|
|
4571
4733
|
variant: "ghost",
|
|
4572
|
-
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" })
|
|
4573
4735
|
}
|
|
4574
4736
|
) }) });
|
|
4575
4737
|
}
|
|
@@ -4577,7 +4739,7 @@ var AdsTableExpandCell = React41.forwardRef(
|
|
|
4577
4739
|
AdsTableExpandCell.displayName = "AdsTableExpandCell";
|
|
4578
4740
|
|
|
4579
4741
|
// src/components/AdsDataTable/index.tsx
|
|
4580
|
-
var
|
|
4742
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4581
4743
|
var SKELETON_ROW_COUNT = 4;
|
|
4582
4744
|
var FLEX_WIDTH_UNIT = 160;
|
|
4583
4745
|
var sizeClassNames = {
|
|
@@ -4714,7 +4876,7 @@ function getCellStyle(column, overrideWidth) {
|
|
|
4714
4876
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
4715
4877
|
}
|
|
4716
4878
|
function renderCellValue(value, ellipsis) {
|
|
4717
|
-
if (
|
|
4879
|
+
if (React43.isValidElement(value)) {
|
|
4718
4880
|
return value;
|
|
4719
4881
|
}
|
|
4720
4882
|
if (value === null || value === void 0) {
|
|
@@ -4724,7 +4886,7 @@ function renderCellValue(value, ellipsis) {
|
|
|
4724
4886
|
if (ellipsis) {
|
|
4725
4887
|
const shouldShowTitle = typeof ellipsis === "object" ? ellipsis.showTitle !== false : true;
|
|
4726
4888
|
const maxWidth = typeof ellipsis === "object" ? ellipsis.maxWidth : void 0;
|
|
4727
|
-
return /* @__PURE__ */ (0,
|
|
4889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4728
4890
|
"div",
|
|
4729
4891
|
{
|
|
4730
4892
|
className: "truncate",
|
|
@@ -4839,48 +5001,48 @@ function AdsDataTable({
|
|
|
4839
5001
|
suppressRowClickSelection = true
|
|
4840
5002
|
}) {
|
|
4841
5003
|
const { messages } = useAdsI18n();
|
|
4842
|
-
const resolvedColumns =
|
|
4843
|
-
const [internalSortState, setInternalSortState] =
|
|
5004
|
+
const resolvedColumns = React43.useMemo(() => columns.filter(Boolean), [columns]);
|
|
5005
|
+
const [internalSortState, setInternalSortState] = React43.useState(
|
|
4844
5006
|
() => getInitialSortState(resolvedColumns)
|
|
4845
5007
|
);
|
|
4846
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
5008
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = React43.useState(
|
|
4847
5009
|
rowSelection?.defaultSelectedRowKeys ?? rowSelection?.selectedRowKeys ?? []
|
|
4848
5010
|
);
|
|
4849
|
-
const [internalFilterValues, setInternalFilterValues] =
|
|
5011
|
+
const [internalFilterValues, setInternalFilterValues] = React43.useState(
|
|
4850
5012
|
() => getInitialFilterValues(resolvedColumns)
|
|
4851
5013
|
);
|
|
4852
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
5014
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = React43.useState(
|
|
4853
5015
|
expandable?.defaultExpandedRowKeys ?? expandable?.expandedRowKeys ?? []
|
|
4854
5016
|
);
|
|
4855
|
-
const [internalColumnWidths, setInternalColumnWidths] =
|
|
4856
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
5017
|
+
const [internalColumnWidths, setInternalColumnWidths] = React43.useState({});
|
|
5018
|
+
const [internalCurrentPage, setInternalCurrentPage] = React43.useState(
|
|
4857
5019
|
pagination !== false ? pagination.defaultCurrent ?? pagination.current ?? 1 : 1
|
|
4858
5020
|
);
|
|
4859
|
-
const [internalPageSize, setInternalPageSize] =
|
|
5021
|
+
const [internalPageSize, setInternalPageSize] = React43.useState(
|
|
4860
5022
|
pagination !== false ? pagination.defaultPageSize ?? pagination.pageSize ?? 10 : 10
|
|
4861
5023
|
);
|
|
4862
|
-
const [activeResize, setActiveResize] =
|
|
4863
|
-
|
|
5024
|
+
const [activeResize, setActiveResize] = React43.useState(null);
|
|
5025
|
+
React43.useEffect(() => {
|
|
4864
5026
|
if (rowSelection?.selectedRowKeys !== void 0) {
|
|
4865
5027
|
setInternalSelectedKeys(rowSelection.selectedRowKeys);
|
|
4866
5028
|
}
|
|
4867
5029
|
}, [rowSelection?.selectedRowKeys]);
|
|
4868
|
-
|
|
5030
|
+
React43.useEffect(() => {
|
|
4869
5031
|
if (expandable?.expandedRowKeys !== void 0) {
|
|
4870
5032
|
setInternalExpandedKeys(expandable.expandedRowKeys);
|
|
4871
5033
|
}
|
|
4872
5034
|
}, [expandable?.expandedRowKeys]);
|
|
4873
|
-
|
|
5035
|
+
React43.useEffect(() => {
|
|
4874
5036
|
if (pagination !== false && pagination.current !== void 0) {
|
|
4875
5037
|
setInternalCurrentPage(pagination.current);
|
|
4876
5038
|
}
|
|
4877
5039
|
}, [pagination]);
|
|
4878
|
-
|
|
5040
|
+
React43.useEffect(() => {
|
|
4879
5041
|
if (pagination !== false && pagination.pageSize !== void 0) {
|
|
4880
5042
|
setInternalPageSize(pagination.pageSize);
|
|
4881
5043
|
}
|
|
4882
5044
|
}, [pagination]);
|
|
4883
|
-
|
|
5045
|
+
React43.useEffect(() => {
|
|
4884
5046
|
setInternalFilterValues((previous) => {
|
|
4885
5047
|
const next = { ...previous };
|
|
4886
5048
|
let hasChanged = false;
|
|
@@ -4901,7 +5063,7 @@ function AdsDataTable({
|
|
|
4901
5063
|
return hasChanged ? next : previous;
|
|
4902
5064
|
});
|
|
4903
5065
|
}, [resolvedColumns]);
|
|
4904
|
-
const controlledSortState =
|
|
5066
|
+
const controlledSortState = React43.useMemo(() => {
|
|
4905
5067
|
const columnIndex = resolvedColumns.findIndex((column2) => column2.sortOrder !== void 0);
|
|
4906
5068
|
if (columnIndex === -1) {
|
|
4907
5069
|
return null;
|
|
@@ -4922,12 +5084,12 @@ function AdsDataTable({
|
|
|
4922
5084
|
const columnCount = resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn);
|
|
4923
5085
|
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
4924
5086
|
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
4925
|
-
const spinnerLoadingHeight =
|
|
5087
|
+
const spinnerLoadingHeight = React43.useMemo(
|
|
4926
5088
|
() => getSpinnerLoadingHeight(scroll?.y, density),
|
|
4927
5089
|
[density, scroll?.y]
|
|
4928
5090
|
);
|
|
4929
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";
|
|
4930
|
-
const filterValues =
|
|
5092
|
+
const filterValues = React43.useMemo(
|
|
4931
5093
|
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
4932
5094
|
const columnKey = getColumnKey(column, index);
|
|
4933
5095
|
accumulator[columnKey] = column.filterValue ?? internalFilterValues[columnKey] ?? "";
|
|
@@ -4935,7 +5097,7 @@ function AdsDataTable({
|
|
|
4935
5097
|
}, {}),
|
|
4936
5098
|
[internalFilterValues, resolvedColumns]
|
|
4937
5099
|
);
|
|
4938
|
-
const filteredData =
|
|
5100
|
+
const filteredData = React43.useMemo(() => {
|
|
4939
5101
|
const filterableColumns = resolvedColumns.filter((column) => column.filter);
|
|
4940
5102
|
if (filterableColumns.length === 0) {
|
|
4941
5103
|
return dataSource;
|
|
@@ -4955,7 +5117,7 @@ function AdsDataTable({
|
|
|
4955
5117
|
})
|
|
4956
5118
|
);
|
|
4957
5119
|
}, [dataSource, filterValues, resolvedColumns]);
|
|
4958
|
-
const sortedData =
|
|
5120
|
+
const sortedData = React43.useMemo(() => {
|
|
4959
5121
|
if (!sortState || !sortState.column || sortState.order === null) {
|
|
4960
5122
|
return filteredData;
|
|
4961
5123
|
}
|
|
@@ -4982,7 +5144,7 @@ function AdsDataTable({
|
|
|
4982
5144
|
Math.max(1, pagination.current ?? internalCurrentPage),
|
|
4983
5145
|
totalPages
|
|
4984
5146
|
);
|
|
4985
|
-
|
|
5147
|
+
React43.useEffect(() => {
|
|
4986
5148
|
if (pagination === false || pagination.current !== void 0) {
|
|
4987
5149
|
return;
|
|
4988
5150
|
}
|
|
@@ -4990,14 +5152,14 @@ function AdsDataTable({
|
|
|
4990
5152
|
setInternalCurrentPage(currentPage);
|
|
4991
5153
|
}
|
|
4992
5154
|
}, [currentPage, internalCurrentPage, pagination]);
|
|
4993
|
-
const paginatedData =
|
|
5155
|
+
const paginatedData = React43.useMemo(() => {
|
|
4994
5156
|
if (pagination === false || paginationMode === "server") {
|
|
4995
5157
|
return sortedData;
|
|
4996
5158
|
}
|
|
4997
5159
|
const start = (currentPage - 1) * currentPageSize;
|
|
4998
5160
|
return sortedData.slice(start, start + currentPageSize);
|
|
4999
5161
|
}, [currentPage, currentPageSize, pagination, paginationMode, sortedData]);
|
|
5000
|
-
const handleSortChange =
|
|
5162
|
+
const handleSortChange = React43.useCallback(
|
|
5001
5163
|
(column, columnKey, nextOrder) => {
|
|
5002
5164
|
const nextSortState = nextOrder === null ? null : {
|
|
5003
5165
|
column,
|
|
@@ -5011,7 +5173,7 @@ function AdsDataTable({
|
|
|
5011
5173
|
},
|
|
5012
5174
|
[controlledSortState, onSortChange]
|
|
5013
5175
|
);
|
|
5014
|
-
const handleFilterChange =
|
|
5176
|
+
const handleFilterChange = React43.useCallback(
|
|
5015
5177
|
(column, columnKey, nextValue) => {
|
|
5016
5178
|
if (column.filterValue === void 0) {
|
|
5017
5179
|
setInternalFilterValues((previous) => ({
|
|
@@ -5026,7 +5188,7 @@ function AdsDataTable({
|
|
|
5026
5188
|
},
|
|
5027
5189
|
[pagination]
|
|
5028
5190
|
);
|
|
5029
|
-
const updateSelection =
|
|
5191
|
+
const updateSelection = React43.useCallback(
|
|
5030
5192
|
(nextKeys) => {
|
|
5031
5193
|
if (!rowSelection) {
|
|
5032
5194
|
return;
|
|
@@ -5041,7 +5203,7 @@ function AdsDataTable({
|
|
|
5041
5203
|
},
|
|
5042
5204
|
[dataSource, rowKey, rowSelection]
|
|
5043
5205
|
);
|
|
5044
|
-
const toggleSelectionFromRowClick =
|
|
5206
|
+
const toggleSelectionFromRowClick = React43.useCallback(
|
|
5045
5207
|
(record, recordKey) => {
|
|
5046
5208
|
if (!allowsRowSelectionByClick || !rowSelection) {
|
|
5047
5209
|
return;
|
|
@@ -5055,7 +5217,7 @@ function AdsDataTable({
|
|
|
5055
5217
|
},
|
|
5056
5218
|
[allowsRowSelectionByClick, rowSelection, selectedKeys, updateSelection]
|
|
5057
5219
|
);
|
|
5058
|
-
const toggleExpanded =
|
|
5220
|
+
const toggleExpanded = React43.useCallback(
|
|
5059
5221
|
(record, recordKey) => {
|
|
5060
5222
|
if (!expandable?.expandedRowRender) {
|
|
5061
5223
|
return;
|
|
@@ -5072,11 +5234,11 @@ function AdsDataTable({
|
|
|
5072
5234
|
},
|
|
5073
5235
|
[expandable, expandedKeys]
|
|
5074
5236
|
);
|
|
5075
|
-
const renderedEmptyState = emptyState ?? /* @__PURE__ */ (0,
|
|
5076
|
-
/* @__PURE__ */ (0,
|
|
5077
|
-
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 })
|
|
5078
5240
|
] }) }) });
|
|
5079
|
-
const handlePaginationChange =
|
|
5241
|
+
const handlePaginationChange = React43.useCallback(
|
|
5080
5242
|
(page, nextPageSize) => {
|
|
5081
5243
|
if (pagination === false) {
|
|
5082
5244
|
return;
|
|
@@ -5091,7 +5253,7 @@ function AdsDataTable({
|
|
|
5091
5253
|
},
|
|
5092
5254
|
[currentPageSize, pagination]
|
|
5093
5255
|
);
|
|
5094
|
-
const handlePageSizeChange =
|
|
5256
|
+
const handlePageSizeChange = React43.useCallback(
|
|
5095
5257
|
(nextPageSize, page) => {
|
|
5096
5258
|
if (pagination === false) {
|
|
5097
5259
|
return;
|
|
@@ -5106,28 +5268,28 @@ function AdsDataTable({
|
|
|
5106
5268
|
},
|
|
5107
5269
|
[pagination]
|
|
5108
5270
|
);
|
|
5109
|
-
const visibleRowEntries =
|
|
5271
|
+
const visibleRowEntries = React43.useMemo(
|
|
5110
5272
|
() => paginatedData.map((record, index) => ({
|
|
5111
5273
|
key: resolveRowKey(record, index, rowKey),
|
|
5112
5274
|
record
|
|
5113
5275
|
})),
|
|
5114
5276
|
[paginatedData, rowKey]
|
|
5115
5277
|
);
|
|
5116
|
-
const visibleSelectableKeys =
|
|
5278
|
+
const visibleSelectableKeys = React43.useMemo(
|
|
5117
5279
|
() => visibleRowEntries.map((entry) => entry.key),
|
|
5118
5280
|
[visibleRowEntries]
|
|
5119
5281
|
);
|
|
5120
|
-
const selectedVisibleCount =
|
|
5282
|
+
const selectedVisibleCount = React43.useMemo(
|
|
5121
5283
|
() => visibleSelectableKeys.filter((key) => selectedKeys.includes(key)).length,
|
|
5122
5284
|
[selectedKeys, visibleSelectableKeys]
|
|
5123
5285
|
);
|
|
5124
5286
|
const allVisibleRowsSelected = visibleSelectableKeys.length > 0 && selectedVisibleCount === visibleSelectableKeys.length;
|
|
5125
5287
|
const someVisibleRowsSelected = selectedVisibleCount > 0 && selectedVisibleCount < visibleSelectableKeys.length;
|
|
5126
|
-
const getColumnWidthOverride =
|
|
5288
|
+
const getColumnWidthOverride = React43.useCallback(
|
|
5127
5289
|
(column, columnKey) => internalColumnWidths[columnKey] ?? getResolvedColumnWidth(column),
|
|
5128
5290
|
[internalColumnWidths]
|
|
5129
5291
|
);
|
|
5130
|
-
const startColumnResize =
|
|
5292
|
+
const startColumnResize = React43.useCallback(
|
|
5131
5293
|
(event, column, columnKey) => {
|
|
5132
5294
|
event.preventDefault();
|
|
5133
5295
|
event.stopPropagation();
|
|
@@ -5158,7 +5320,7 @@ function AdsDataTable({
|
|
|
5158
5320
|
},
|
|
5159
5321
|
[internalColumnWidths]
|
|
5160
5322
|
);
|
|
5161
|
-
const renderColumnHeader =
|
|
5323
|
+
const renderColumnHeader = React43.useCallback(
|
|
5162
5324
|
(column, columnKey, columnSortOrder) => {
|
|
5163
5325
|
const headerTitle = getColumnHeader(column, columnKey);
|
|
5164
5326
|
const hasSorter = Boolean(column.sorter);
|
|
@@ -5169,9 +5331,9 @@ function AdsDataTable({
|
|
|
5169
5331
|
}
|
|
5170
5332
|
const nextOrder = columnSortOrder === null ? "ascend" : columnSortOrder === "ascend" ? "descend" : null;
|
|
5171
5333
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
5172
|
-
return /* @__PURE__ */ (0,
|
|
5173
|
-
/* @__PURE__ */ (0,
|
|
5174
|
-
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)(
|
|
5175
5337
|
Button,
|
|
5176
5338
|
{
|
|
5177
5339
|
"aria-label": `${headerTitle} ${actionLabel}`,
|
|
@@ -5184,13 +5346,13 @@ function AdsDataTable({
|
|
|
5184
5346
|
type: "button",
|
|
5185
5347
|
variant: "ghost",
|
|
5186
5348
|
children: [
|
|
5187
|
-
/* @__PURE__ */ (0,
|
|
5188
|
-
/* @__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" }) })
|
|
5189
5351
|
]
|
|
5190
5352
|
}
|
|
5191
|
-
) : /* @__PURE__ */ (0,
|
|
5192
|
-
hasFilter ? /* @__PURE__ */ (0,
|
|
5193
|
-
/* @__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)(
|
|
5194
5356
|
Button,
|
|
5195
5357
|
{
|
|
5196
5358
|
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
@@ -5202,10 +5364,10 @@ function AdsDataTable({
|
|
|
5202
5364
|
size: "sm",
|
|
5203
5365
|
type: "button",
|
|
5204
5366
|
variant: "ghost",
|
|
5205
|
-
children: /* @__PURE__ */ (0,
|
|
5367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Filter, { className: "h-3.5 w-3.5" })
|
|
5206
5368
|
}
|
|
5207
5369
|
) }),
|
|
5208
|
-
/* @__PURE__ */ (0,
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5209
5371
|
AdsInput,
|
|
5210
5372
|
{
|
|
5211
5373
|
clearable: true,
|
|
@@ -5218,7 +5380,7 @@ function AdsDataTable({
|
|
|
5218
5380
|
) })
|
|
5219
5381
|
] }) : null
|
|
5220
5382
|
] }),
|
|
5221
|
-
hasResizeHandle ? /* @__PURE__ */ (0,
|
|
5383
|
+
hasResizeHandle ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5222
5384
|
"span",
|
|
5223
5385
|
{
|
|
5224
5386
|
"aria-label": `Resize ${headerTitle} column`,
|
|
@@ -5236,12 +5398,12 @@ function AdsDataTable({
|
|
|
5236
5398
|
},
|
|
5237
5399
|
[activeResize?.columnKey, filterValues, handleFilterChange, handleSortChange, messages.table, startColumnResize]
|
|
5238
5400
|
);
|
|
5239
|
-
const tableNode = /* @__PURE__ */ (0,
|
|
5240
|
-
/* @__PURE__ */ (0,
|
|
5241
|
-
/* @__PURE__ */ (0,
|
|
5242
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5243
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5244
|
-
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)(
|
|
5245
5407
|
AdsTableCol,
|
|
5246
5408
|
{
|
|
5247
5409
|
style: getCellStyle(column, getColumnWidthOverride(column, getColumnKey(column, index)))
|
|
@@ -5249,8 +5411,8 @@ function AdsDataTable({
|
|
|
5249
5411
|
getColumnKey(column, index)
|
|
5250
5412
|
))
|
|
5251
5413
|
] }),
|
|
5252
|
-
/* @__PURE__ */ (0,
|
|
5253
|
-
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)(
|
|
5254
5416
|
Checkbox2,
|
|
5255
5417
|
{
|
|
5256
5418
|
"aria-label": messages.table.selectAllRows,
|
|
@@ -5267,11 +5429,11 @@ function AdsDataTable({
|
|
|
5267
5429
|
onClick: (event) => event.stopPropagation()
|
|
5268
5430
|
}
|
|
5269
5431
|
) }) : null }) : null,
|
|
5270
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5432
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableHead, { className: "w-12 p-2" }) : null,
|
|
5271
5433
|
resolvedColumns.map((column, index) => {
|
|
5272
5434
|
const columnKey = getColumnKey(column, index);
|
|
5273
5435
|
const columnSortOrder = sortState?.columnKey === columnKey ? sortState.order : column.sortOrder ?? null;
|
|
5274
|
-
return /* @__PURE__ */ (0,
|
|
5436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5275
5437
|
AdsTableHead,
|
|
5276
5438
|
{
|
|
5277
5439
|
className: cn(density.head, column.className, column.headerClassName),
|
|
@@ -5282,13 +5444,13 @@ function AdsDataTable({
|
|
|
5282
5444
|
);
|
|
5283
5445
|
})
|
|
5284
5446
|
] }) }),
|
|
5285
|
-
/* @__PURE__ */ (0,
|
|
5286
|
-
/* @__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)(
|
|
5287
5449
|
AdsTableCell,
|
|
5288
5450
|
{
|
|
5289
5451
|
className: "p-0",
|
|
5290
5452
|
colSpan: columnCount,
|
|
5291
|
-
children: /* @__PURE__ */ (0,
|
|
5453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5292
5454
|
"div",
|
|
5293
5455
|
{
|
|
5294
5456
|
"aria-label": messages.table.loadingRows,
|
|
@@ -5296,19 +5458,19 @@ function AdsDataTable({
|
|
|
5296
5458
|
className: "flex items-center justify-center px-6 py-8 text-foreground",
|
|
5297
5459
|
role: "status",
|
|
5298
5460
|
style: { minHeight: spinnerLoadingHeight },
|
|
5299
|
-
children: /* @__PURE__ */ (0,
|
|
5461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSpinner, { size: "lg", tone: "foreground" })
|
|
5300
5462
|
}
|
|
5301
5463
|
)
|
|
5302
5464
|
}
|
|
5303
5465
|
) }, "spinner-row")
|
|
5304
|
-
] : loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0,
|
|
5305
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5306
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5307
|
-
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)(
|
|
5308
5470
|
AdsTableCell,
|
|
5309
5471
|
{
|
|
5310
5472
|
className: cn(density.cell, column.className),
|
|
5311
|
-
children: /* @__PURE__ */ (0,
|
|
5473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-full rounded" })
|
|
5312
5474
|
},
|
|
5313
5475
|
`${getColumnKey(column, index)}-${skeletonIndex}`
|
|
5314
5476
|
))
|
|
@@ -5317,7 +5479,7 @@ function AdsDataTable({
|
|
|
5317
5479
|
const isExpanded = expandedKeys.includes(recordKey);
|
|
5318
5480
|
const canExpand = !!expandable?.expandedRowRender && (!expandable.rowExpandable || expandable.rowExpandable(record));
|
|
5319
5481
|
const dataRowClassName = typeof rowClassName === "function" ? rowClassName(record, index) : rowClassName;
|
|
5320
|
-
const row = /* @__PURE__ */ (0,
|
|
5482
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5321
5483
|
AdsTableRow,
|
|
5322
5484
|
{
|
|
5323
5485
|
className: cn(
|
|
@@ -5340,7 +5502,7 @@ function AdsDataTable({
|
|
|
5340
5502
|
toggleSelectionFromRowClick(record, recordKey);
|
|
5341
5503
|
},
|
|
5342
5504
|
children: [
|
|
5343
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5505
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5344
5506
|
AdsTableSelectionCell,
|
|
5345
5507
|
{
|
|
5346
5508
|
checked: selectedKeys.includes(recordKey),
|
|
@@ -5356,7 +5518,7 @@ function AdsDataTable({
|
|
|
5356
5518
|
value: String(recordKey)
|
|
5357
5519
|
}
|
|
5358
5520
|
) : null,
|
|
5359
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5521
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5360
5522
|
AdsTableExpandCell,
|
|
5361
5523
|
{
|
|
5362
5524
|
disabled: !canExpand,
|
|
@@ -5369,7 +5531,7 @@ function AdsDataTable({
|
|
|
5369
5531
|
resolveRenderedCellContent(column, record, index),
|
|
5370
5532
|
column.ellipsis
|
|
5371
5533
|
);
|
|
5372
|
-
return /* @__PURE__ */ (0,
|
|
5534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5373
5535
|
AdsTableCell,
|
|
5374
5536
|
{
|
|
5375
5537
|
className: cn(
|
|
@@ -5395,12 +5557,12 @@ function AdsDataTable({
|
|
|
5395
5557
|
}
|
|
5396
5558
|
return [
|
|
5397
5559
|
row,
|
|
5398
|
-
/* @__PURE__ */ (0,
|
|
5560
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5399
5561
|
AdsTableCell,
|
|
5400
5562
|
{
|
|
5401
5563
|
className: "p-0",
|
|
5402
5564
|
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5403
|
-
children: /* @__PURE__ */ (0,
|
|
5565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5404
5566
|
"div",
|
|
5405
5567
|
{
|
|
5406
5568
|
className: cn(
|
|
@@ -5414,7 +5576,7 @@ function AdsDataTable({
|
|
|
5414
5576
|
) }, `${String(recordKey)}-expanded`)
|
|
5415
5577
|
];
|
|
5416
5578
|
}) : [
|
|
5417
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5418
5580
|
AdsTableCell,
|
|
5419
5581
|
{
|
|
5420
5582
|
colSpan: columnCount,
|
|
@@ -5424,8 +5586,8 @@ function AdsDataTable({
|
|
|
5424
5586
|
) }, "empty-row")
|
|
5425
5587
|
] })
|
|
5426
5588
|
] }) }),
|
|
5427
|
-
footer ? /* @__PURE__ */ (0,
|
|
5428
|
-
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)(
|
|
5429
5591
|
AdsDataPagination,
|
|
5430
5592
|
{
|
|
5431
5593
|
ariaLabel: messages.pagination.navigation,
|
|
@@ -5447,7 +5609,7 @@ function AdsDataTable({
|
|
|
5447
5609
|
) }) : null
|
|
5448
5610
|
] });
|
|
5449
5611
|
if (rowSelection?.type === "radio") {
|
|
5450
|
-
return /* @__PURE__ */ (0,
|
|
5612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5451
5613
|
RadioGroup2,
|
|
5452
5614
|
{
|
|
5453
5615
|
onValueChange: (value) => {
|
|
@@ -5468,7 +5630,7 @@ function AdsDataTable({
|
|
|
5468
5630
|
}
|
|
5469
5631
|
|
|
5470
5632
|
// src/components/AdsDataTableToolbar/index.tsx
|
|
5471
|
-
var
|
|
5633
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5472
5634
|
function AdsDataTableToolbar({
|
|
5473
5635
|
action,
|
|
5474
5636
|
className,
|
|
@@ -5480,7 +5642,7 @@ function AdsDataTableToolbar({
|
|
|
5480
5642
|
onSearchChange,
|
|
5481
5643
|
onSearchClear
|
|
5482
5644
|
}) {
|
|
5483
|
-
return /* @__PURE__ */ (0,
|
|
5645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5484
5646
|
"div",
|
|
5485
5647
|
{
|
|
5486
5648
|
className: cn(
|
|
@@ -5488,9 +5650,9 @@ function AdsDataTableToolbar({
|
|
|
5488
5650
|
className
|
|
5489
5651
|
),
|
|
5490
5652
|
children: [
|
|
5491
|
-
/* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
/* @__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)(
|
|
5494
5656
|
AdsInput,
|
|
5495
5657
|
{
|
|
5496
5658
|
className: cn(
|
|
@@ -5504,7 +5666,7 @@ function AdsDataTableToolbar({
|
|
|
5504
5666
|
value: searchValue
|
|
5505
5667
|
}
|
|
5506
5668
|
) }),
|
|
5507
|
-
action ? /* @__PURE__ */ (0,
|
|
5669
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
5508
5670
|
] })
|
|
5509
5671
|
]
|
|
5510
5672
|
}
|
|
@@ -5512,7 +5674,7 @@ function AdsDataTableToolbar({
|
|
|
5512
5674
|
}
|
|
5513
5675
|
|
|
5514
5676
|
// src/components/AdsViewCustomersDataTable/index.tsx
|
|
5515
|
-
var
|
|
5677
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5516
5678
|
function resolveHeight(value) {
|
|
5517
5679
|
if (value === void 0) {
|
|
5518
5680
|
return 500;
|
|
@@ -5544,13 +5706,13 @@ function AdsViewCustomersDataTable({
|
|
|
5544
5706
|
...props
|
|
5545
5707
|
}) {
|
|
5546
5708
|
const tableHeight = resolveHeight(height);
|
|
5547
|
-
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0,
|
|
5548
|
-
/* @__PURE__ */ (0,
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
5550
|
-
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
|
|
5551
5713
|
] });
|
|
5552
|
-
return /* @__PURE__ */ (0,
|
|
5553
|
-
/* @__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)(
|
|
5554
5716
|
AdsDataTableToolbar,
|
|
5555
5717
|
{
|
|
5556
5718
|
action: toolbarAction,
|
|
@@ -5562,7 +5724,7 @@ function AdsViewCustomersDataTable({
|
|
|
5562
5724
|
}
|
|
5563
5725
|
),
|
|
5564
5726
|
error ? resolvedErrorState : null,
|
|
5565
|
-
!error ? /* @__PURE__ */ (0,
|
|
5727
|
+
!error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5566
5728
|
AdsDataTable,
|
|
5567
5729
|
{
|
|
5568
5730
|
...props,
|
|
@@ -5597,20 +5759,20 @@ function AdsViewCustomersDataTable({
|
|
|
5597
5759
|
}
|
|
5598
5760
|
|
|
5599
5761
|
// src/components/AdsProgress/index.tsx
|
|
5600
|
-
var
|
|
5762
|
+
var React45 = __toESM(require("react"), 1);
|
|
5601
5763
|
|
|
5602
5764
|
// src/primitives/progress.tsx
|
|
5603
|
-
var
|
|
5765
|
+
var React44 = __toESM(require("react"), 1);
|
|
5604
5766
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
5605
|
-
var
|
|
5606
|
-
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)(
|
|
5607
5769
|
ProgressPrimitive.Root,
|
|
5608
5770
|
{
|
|
5609
5771
|
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
5610
5772
|
ref,
|
|
5611
5773
|
value,
|
|
5612
5774
|
...props,
|
|
5613
|
-
children: /* @__PURE__ */ (0,
|
|
5775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5614
5776
|
ProgressPrimitive.Indicator,
|
|
5615
5777
|
{
|
|
5616
5778
|
className: cn("h-full w-full flex-1 bg-primary transition-all", indicatorClassName),
|
|
@@ -5622,13 +5784,13 @@ var Progress = React43.forwardRef(({ className, indicatorClassName, value, ...pr
|
|
|
5622
5784
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
5623
5785
|
|
|
5624
5786
|
// src/components/AdsProgress/index.tsx
|
|
5625
|
-
var
|
|
5787
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5626
5788
|
var progressBaseClassName = "h-2 rounded-radius-full bg-[color:color-mix(in_srgb,var(--primary)_20%,transparent)]";
|
|
5627
5789
|
var progressIndicatorVariantClassName = {
|
|
5628
5790
|
ai: "bg-brand-gradient",
|
|
5629
5791
|
default: "bg-primary"
|
|
5630
5792
|
};
|
|
5631
|
-
var Progress2 =
|
|
5793
|
+
var Progress2 = React45.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5632
5794
|
Progress,
|
|
5633
5795
|
{
|
|
5634
5796
|
className: cn(progressBaseClassName, className),
|
|
@@ -5638,7 +5800,7 @@ var Progress2 = React44.forwardRef(({ className, indicatorClassName, ...props },
|
|
|
5638
5800
|
}
|
|
5639
5801
|
));
|
|
5640
5802
|
Progress2.displayName = "Progress";
|
|
5641
|
-
var AdsProgress =
|
|
5803
|
+
var AdsProgress = React45.forwardRef(
|
|
5642
5804
|
({
|
|
5643
5805
|
className,
|
|
5644
5806
|
descriptionPlacement = "above",
|
|
@@ -5657,12 +5819,12 @@ var AdsProgress = React44.forwardRef(
|
|
|
5657
5819
|
id
|
|
5658
5820
|
});
|
|
5659
5821
|
const labelId = label ? `${description.inputId}-label` : void 0;
|
|
5660
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5661
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5662
|
-
return /* @__PURE__ */ (0,
|
|
5663
|
-
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,
|
|
5664
5826
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5665
|
-
/* @__PURE__ */ (0,
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5666
5828
|
Progress,
|
|
5667
5829
|
{
|
|
5668
5830
|
"aria-describedby": description.describedBy,
|
|
@@ -5686,13 +5848,13 @@ var AdsProgress = React44.forwardRef(
|
|
|
5686
5848
|
AdsProgress.displayName = "AdsProgress";
|
|
5687
5849
|
|
|
5688
5850
|
// src/components/AdsSlider/index.tsx
|
|
5689
|
-
var
|
|
5851
|
+
var React47 = __toESM(require("react"), 1);
|
|
5690
5852
|
|
|
5691
5853
|
// src/primitives/slider.tsx
|
|
5692
|
-
var
|
|
5854
|
+
var React46 = __toESM(require("react"), 1);
|
|
5693
5855
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
5694
|
-
var
|
|
5695
|
-
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)(
|
|
5696
5858
|
SliderPrimitive.Root,
|
|
5697
5859
|
{
|
|
5698
5860
|
ref,
|
|
@@ -5702,10 +5864,10 @@ var Slider = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5702
5864
|
),
|
|
5703
5865
|
...props,
|
|
5704
5866
|
children: [
|
|
5705
|
-
/* @__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" }) }),
|
|
5706
5868
|
Array.from({
|
|
5707
5869
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5708
|
-
}).map((_, index) => /* @__PURE__ */ (0,
|
|
5870
|
+
}).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5709
5871
|
SliderPrimitive.Thumb,
|
|
5710
5872
|
{
|
|
5711
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"
|
|
@@ -5718,11 +5880,11 @@ var Slider = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5718
5880
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5719
5881
|
|
|
5720
5882
|
// src/components/AdsSlider/index.tsx
|
|
5721
|
-
var
|
|
5883
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5722
5884
|
var sliderBaseClassName = "py-1";
|
|
5723
|
-
var Slider2 =
|
|
5885
|
+
var Slider2 = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5724
5886
|
Slider2.displayName = "Slider";
|
|
5725
|
-
var AdsSlider =
|
|
5887
|
+
var AdsSlider = React47.forwardRef(
|
|
5726
5888
|
({
|
|
5727
5889
|
className,
|
|
5728
5890
|
descriptionPlacement = "above",
|
|
@@ -5737,12 +5899,12 @@ var AdsSlider = React46.forwardRef(
|
|
|
5737
5899
|
helperText,
|
|
5738
5900
|
id
|
|
5739
5901
|
});
|
|
5740
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5741
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5742
|
-
return /* @__PURE__ */ (0,
|
|
5743
|
-
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,
|
|
5744
5906
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5745
|
-
/* @__PURE__ */ (0,
|
|
5907
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5746
5908
|
Slider2,
|
|
5747
5909
|
{
|
|
5748
5910
|
"aria-describedby": description.describedBy,
|
|
@@ -5759,13 +5921,13 @@ var AdsSlider = React46.forwardRef(
|
|
|
5759
5921
|
AdsSlider.displayName = "AdsSlider";
|
|
5760
5922
|
|
|
5761
5923
|
// src/components/AdsSwitch/index.tsx
|
|
5762
|
-
var
|
|
5924
|
+
var React49 = __toESM(require("react"), 1);
|
|
5763
5925
|
|
|
5764
5926
|
// src/primitives/switch.tsx
|
|
5765
|
-
var
|
|
5927
|
+
var React48 = __toESM(require("react"), 1);
|
|
5766
5928
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
5767
|
-
var
|
|
5768
|
-
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)(
|
|
5769
5931
|
SwitchPrimitives.Root,
|
|
5770
5932
|
{
|
|
5771
5933
|
className: cn(
|
|
@@ -5774,7 +5936,7 @@ var Switch = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5774
5936
|
),
|
|
5775
5937
|
...props,
|
|
5776
5938
|
ref,
|
|
5777
|
-
children: /* @__PURE__ */ (0,
|
|
5939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5778
5940
|
SwitchPrimitives.Thumb,
|
|
5779
5941
|
{
|
|
5780
5942
|
className: cn(
|
|
@@ -5787,15 +5949,15 @@ var Switch = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5787
5949
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5788
5950
|
|
|
5789
5951
|
// src/components/AdsSwitch/index.tsx
|
|
5790
|
-
var
|
|
5952
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5791
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";
|
|
5792
|
-
var Switch2 =
|
|
5954
|
+
var Switch2 = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
5793
5955
|
Switch2.displayName = "Switch";
|
|
5794
|
-
var AdsSwitch =
|
|
5795
|
-
const generatedId =
|
|
5956
|
+
var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
5957
|
+
const generatedId = React49.useId();
|
|
5796
5958
|
const inputId = id ?? generatedId;
|
|
5797
5959
|
if (!label) {
|
|
5798
|
-
return /* @__PURE__ */ (0,
|
|
5960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5799
5961
|
Switch2,
|
|
5800
5962
|
{
|
|
5801
5963
|
className: cn(className, switchClassName),
|
|
@@ -5805,12 +5967,12 @@ var AdsSwitch = React48.forwardRef(({ className, description, id, label, switchC
|
|
|
5805
5967
|
}
|
|
5806
5968
|
);
|
|
5807
5969
|
}
|
|
5808
|
-
return /* @__PURE__ */ (0,
|
|
5809
|
-
/* @__PURE__ */ (0,
|
|
5810
|
-
/* @__PURE__ */ (0,
|
|
5811
|
-
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
|
|
5812
5974
|
] }),
|
|
5813
|
-
/* @__PURE__ */ (0,
|
|
5975
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5814
5976
|
Switch2,
|
|
5815
5977
|
{
|
|
5816
5978
|
className: cn(className, switchClassName),
|
|
@@ -5824,14 +5986,14 @@ var AdsSwitch = React48.forwardRef(({ className, description, id, label, switchC
|
|
|
5824
5986
|
AdsSwitch.displayName = "AdsSwitch";
|
|
5825
5987
|
|
|
5826
5988
|
// src/components/AdsTabs/index.tsx
|
|
5827
|
-
var
|
|
5989
|
+
var React51 = __toESM(require("react"), 1);
|
|
5828
5990
|
|
|
5829
5991
|
// src/primitives/tabs.tsx
|
|
5830
|
-
var
|
|
5992
|
+
var React50 = __toESM(require("react"), 1);
|
|
5831
5993
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
5832
|
-
var
|
|
5994
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5833
5995
|
var Tabs = TabsPrimitive.Root;
|
|
5834
|
-
var TabsList =
|
|
5996
|
+
var TabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5835
5997
|
TabsPrimitive.List,
|
|
5836
5998
|
{
|
|
5837
5999
|
className: cn("inline-flex items-center", className),
|
|
@@ -5840,7 +6002,7 @@ var TabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5840
6002
|
}
|
|
5841
6003
|
));
|
|
5842
6004
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5843
|
-
var TabsTrigger =
|
|
6005
|
+
var TabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5844
6006
|
TabsPrimitive.Trigger,
|
|
5845
6007
|
{
|
|
5846
6008
|
className: cn(
|
|
@@ -5852,7 +6014,7 @@ var TabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5852
6014
|
}
|
|
5853
6015
|
));
|
|
5854
6016
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5855
|
-
var TabsContent =
|
|
6017
|
+
var TabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5856
6018
|
TabsPrimitive.Content,
|
|
5857
6019
|
{
|
|
5858
6020
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -5863,9 +6025,9 @@ var TabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5863
6025
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5864
6026
|
|
|
5865
6027
|
// src/components/AdsTabs/index.tsx
|
|
5866
|
-
var
|
|
6028
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5867
6029
|
var AdsTabs = Tabs;
|
|
5868
|
-
var AdsTabsList =
|
|
6030
|
+
var AdsTabsList = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5869
6031
|
TabsList,
|
|
5870
6032
|
{
|
|
5871
6033
|
className: cn(
|
|
@@ -5877,7 +6039,7 @@ var AdsTabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5877
6039
|
}
|
|
5878
6040
|
));
|
|
5879
6041
|
AdsTabsList.displayName = "AdsTabsList";
|
|
5880
|
-
var AdsTabsTrigger =
|
|
6042
|
+
var AdsTabsTrigger = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5881
6043
|
TabsTrigger,
|
|
5882
6044
|
{
|
|
5883
6045
|
className: cn(
|
|
@@ -5889,7 +6051,7 @@ var AdsTabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5889
6051
|
}
|
|
5890
6052
|
));
|
|
5891
6053
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
5892
|
-
var AdsTabsContent =
|
|
6054
|
+
var AdsTabsContent = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5893
6055
|
TabsContent,
|
|
5894
6056
|
{
|
|
5895
6057
|
className: cn(
|
|
@@ -5903,13 +6065,13 @@ var AdsTabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5903
6065
|
AdsTabsContent.displayName = "AdsTabsContent";
|
|
5904
6066
|
|
|
5905
6067
|
// src/components/AdsToggle/index.tsx
|
|
5906
|
-
var
|
|
6068
|
+
var React53 = __toESM(require("react"), 1);
|
|
5907
6069
|
|
|
5908
6070
|
// src/primitives/toggle.tsx
|
|
5909
|
-
var
|
|
6071
|
+
var React52 = __toESM(require("react"), 1);
|
|
5910
6072
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
5911
|
-
var
|
|
5912
|
-
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)(
|
|
5913
6075
|
TogglePrimitive.Root,
|
|
5914
6076
|
{
|
|
5915
6077
|
className: cn(
|
|
@@ -5923,7 +6085,7 @@ var Toggle = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5923
6085
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5924
6086
|
|
|
5925
6087
|
// src/components/AdsToggle/index.tsx
|
|
5926
|
-
var
|
|
6088
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5927
6089
|
var sizeClassName3 = {
|
|
5928
6090
|
sm: "!h-8 px-[6px] text-sm",
|
|
5929
6091
|
md: "!h-9 px-md text-sm",
|
|
@@ -5938,10 +6100,10 @@ var variantClassName = {
|
|
|
5938
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)]",
|
|
5939
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)]"
|
|
5940
6102
|
};
|
|
5941
|
-
var AdsToggle =
|
|
5942
|
-
const childCount =
|
|
5943
|
-
const isIconOnly = childCount === 1 &&
|
|
5944
|
-
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)(
|
|
5945
6107
|
Toggle,
|
|
5946
6108
|
{
|
|
5947
6109
|
className: cn(
|
|
@@ -5960,13 +6122,13 @@ var AdsToggle = React52.forwardRef(({ children, className, size = "md", variant
|
|
|
5960
6122
|
AdsToggle.displayName = "AdsToggle";
|
|
5961
6123
|
|
|
5962
6124
|
// src/components/AdsToggleGroup/index.tsx
|
|
5963
|
-
var
|
|
6125
|
+
var React55 = __toESM(require("react"), 1);
|
|
5964
6126
|
|
|
5965
6127
|
// src/primitives/toggle-group.tsx
|
|
5966
|
-
var
|
|
6128
|
+
var React54 = __toESM(require("react"), 1);
|
|
5967
6129
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
5968
|
-
var
|
|
5969
|
-
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)(
|
|
5970
6132
|
ToggleGroupPrimitive.Root,
|
|
5971
6133
|
{
|
|
5972
6134
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -5975,7 +6137,7 @@ var ToggleGroup = React53.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5975
6137
|
}
|
|
5976
6138
|
));
|
|
5977
6139
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
5978
|
-
var ToggleGroupItem =
|
|
6140
|
+
var ToggleGroupItem = React54.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5979
6141
|
ToggleGroupPrimitive.Item,
|
|
5980
6142
|
{
|
|
5981
6143
|
className: cn(
|
|
@@ -5989,7 +6151,7 @@ var ToggleGroupItem = React53.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
5989
6151
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
5990
6152
|
|
|
5991
6153
|
// src/components/AdsToggleGroup/index.tsx
|
|
5992
|
-
var
|
|
6154
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5993
6155
|
var sizeClassName4 = {
|
|
5994
6156
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
5995
6157
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -5999,8 +6161,8 @@ var variantClassName2 = {
|
|
|
5999
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)]",
|
|
6000
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)]"
|
|
6001
6163
|
};
|
|
6002
|
-
var AdsToggleGroupContext =
|
|
6003
|
-
var AdsToggleGroup =
|
|
6164
|
+
var AdsToggleGroupContext = React55.createContext(null);
|
|
6165
|
+
var AdsToggleGroup = React55.forwardRef(
|
|
6004
6166
|
({
|
|
6005
6167
|
children,
|
|
6006
6168
|
className,
|
|
@@ -6008,7 +6170,7 @@ var AdsToggleGroup = React54.forwardRef(
|
|
|
6008
6170
|
size = "md",
|
|
6009
6171
|
variant = "default",
|
|
6010
6172
|
...props
|
|
6011
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
6173
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6012
6174
|
ToggleGroup,
|
|
6013
6175
|
{
|
|
6014
6176
|
className: cn(
|
|
@@ -6024,12 +6186,12 @@ var AdsToggleGroup = React54.forwardRef(
|
|
|
6024
6186
|
) })
|
|
6025
6187
|
);
|
|
6026
6188
|
AdsToggleGroup.displayName = "AdsToggleGroup";
|
|
6027
|
-
var AdsToggleGroupItem =
|
|
6028
|
-
const context =
|
|
6189
|
+
var AdsToggleGroupItem = React55.forwardRef(({ className, size, variant, ...props }, ref) => {
|
|
6190
|
+
const context = React55.useContext(AdsToggleGroupContext);
|
|
6029
6191
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
6030
6192
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
6031
6193
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
6032
|
-
return /* @__PURE__ */ (0,
|
|
6194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6033
6195
|
ToggleGroupItem,
|
|
6034
6196
|
{
|
|
6035
6197
|
className: cn(
|
|
@@ -6047,10 +6209,10 @@ var AdsToggleGroupItem = React54.forwardRef(({ className, size, variant, ...prop
|
|
|
6047
6209
|
AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
6048
6210
|
|
|
6049
6211
|
// src/components/AdsTextarea/index.tsx
|
|
6050
|
-
var
|
|
6051
|
-
var
|
|
6212
|
+
var React56 = __toESM(require("react"), 1);
|
|
6213
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6052
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";
|
|
6053
|
-
var AdsTextarea =
|
|
6215
|
+
var AdsTextarea = React56.forwardRef(
|
|
6054
6216
|
({
|
|
6055
6217
|
action,
|
|
6056
6218
|
className,
|
|
@@ -6069,12 +6231,12 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6069
6231
|
helperText,
|
|
6070
6232
|
id
|
|
6071
6233
|
});
|
|
6072
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
6073
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
6074
|
-
return /* @__PURE__ */ (0,
|
|
6075
|
-
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,
|
|
6076
6238
|
descriptionPlacement === "above" ? helperNode : null,
|
|
6077
|
-
/* @__PURE__ */ (0,
|
|
6239
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6078
6240
|
Textarea,
|
|
6079
6241
|
{
|
|
6080
6242
|
"aria-describedby": description.describedBy,
|
|
@@ -6092,7 +6254,7 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6092
6254
|
...props
|
|
6093
6255
|
}
|
|
6094
6256
|
),
|
|
6095
|
-
action ? /* @__PURE__ */ (0,
|
|
6257
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
6096
6258
|
descriptionPlacement === "below" ? helperNode : null,
|
|
6097
6259
|
errorNode
|
|
6098
6260
|
] });
|
|
@@ -6101,17 +6263,17 @@ var AdsTextarea = React55.forwardRef(
|
|
|
6101
6263
|
AdsTextarea.displayName = "AdsTextarea";
|
|
6102
6264
|
|
|
6103
6265
|
// src/components/AdsTooltip/index.tsx
|
|
6104
|
-
var
|
|
6266
|
+
var React58 = __toESM(require("react"), 1);
|
|
6105
6267
|
|
|
6106
6268
|
// src/primitives/tooltip.tsx
|
|
6107
|
-
var
|
|
6269
|
+
var React57 = __toESM(require("react"), 1);
|
|
6108
6270
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
6109
|
-
var
|
|
6271
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6110
6272
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6111
6273
|
var Tooltip = TooltipPrimitive.Root;
|
|
6112
6274
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6113
6275
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
6114
|
-
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)(
|
|
6115
6277
|
TooltipPrimitive.Content,
|
|
6116
6278
|
{
|
|
6117
6279
|
className: cn(
|
|
@@ -6126,12 +6288,12 @@ var TooltipContent = React56.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
6126
6288
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6127
6289
|
|
|
6128
6290
|
// src/components/AdsTooltip/index.tsx
|
|
6129
|
-
var
|
|
6291
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6130
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)]";
|
|
6131
6293
|
var AdsTooltipProvider = TooltipProvider;
|
|
6132
6294
|
var AdsTooltip = Tooltip;
|
|
6133
6295
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
6134
|
-
var AdsTooltipContent =
|
|
6296
|
+
var AdsTooltipContent = React58.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6135
6297
|
TooltipContent,
|
|
6136
6298
|
{
|
|
6137
6299
|
align,
|
|
@@ -6142,7 +6304,7 @@ var AdsTooltipContent = React57.forwardRef(({ align = "center", className, sideO
|
|
|
6142
6304
|
}
|
|
6143
6305
|
));
|
|
6144
6306
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
6145
|
-
var AdsTooltipArrow =
|
|
6307
|
+
var AdsTooltipArrow = React58.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6146
6308
|
TooltipArrow,
|
|
6147
6309
|
{
|
|
6148
6310
|
className: cn("fill-[#844fff]", className),
|
|
@@ -6155,10 +6317,10 @@ var AdsTooltipArrow = React57.forwardRef(({ className, height = 5, width = 10, .
|
|
|
6155
6317
|
AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
6156
6318
|
|
|
6157
6319
|
// src/components/AdsToast/index.tsx
|
|
6158
|
-
var
|
|
6320
|
+
var React59 = __toESM(require("react"), 1);
|
|
6159
6321
|
var import_lucide_react17 = require("lucide-react");
|
|
6160
6322
|
var import_sonner = require("sonner");
|
|
6161
|
-
var
|
|
6323
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6162
6324
|
var adsToastIconMap = {
|
|
6163
6325
|
success: import_lucide_react17.CircleCheck,
|
|
6164
6326
|
info: import_lucide_react17.Info,
|
|
@@ -6174,7 +6336,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6174
6336
|
return null;
|
|
6175
6337
|
}
|
|
6176
6338
|
const Icon2 = adsToastIconMap[intent];
|
|
6177
|
-
return /* @__PURE__ */ (0,
|
|
6339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6178
6340
|
Icon2,
|
|
6179
6341
|
{
|
|
6180
6342
|
"aria-hidden": true,
|
|
@@ -6187,7 +6349,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6187
6349
|
}
|
|
6188
6350
|
);
|
|
6189
6351
|
}
|
|
6190
|
-
var AdsToast =
|
|
6352
|
+
var AdsToast = React59.forwardRef(
|
|
6191
6353
|
({
|
|
6192
6354
|
action,
|
|
6193
6355
|
className,
|
|
@@ -6198,7 +6360,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6198
6360
|
...props
|
|
6199
6361
|
}, ref) => {
|
|
6200
6362
|
const resolvedIcon = resolveToastIcon(intent, icon);
|
|
6201
|
-
return /* @__PURE__ */ (0,
|
|
6363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6202
6364
|
"div",
|
|
6203
6365
|
{
|
|
6204
6366
|
className: cn(
|
|
@@ -6213,8 +6375,8 @@ var AdsToast = React58.forwardRef(
|
|
|
6213
6375
|
...props,
|
|
6214
6376
|
children: [
|
|
6215
6377
|
resolvedIcon,
|
|
6216
|
-
/* @__PURE__ */ (0,
|
|
6217
|
-
/* @__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)(
|
|
6218
6380
|
"p",
|
|
6219
6381
|
{
|
|
6220
6382
|
className: cn(
|
|
@@ -6224,7 +6386,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6224
6386
|
children: title
|
|
6225
6387
|
}
|
|
6226
6388
|
),
|
|
6227
|
-
description ? /* @__PURE__ */ (0,
|
|
6389
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6228
6390
|
"p",
|
|
6229
6391
|
{
|
|
6230
6392
|
className: cn(
|
|
@@ -6235,7 +6397,7 @@ var AdsToast = React58.forwardRef(
|
|
|
6235
6397
|
}
|
|
6236
6398
|
) : null
|
|
6237
6399
|
] }),
|
|
6238
|
-
action ? /* @__PURE__ */ (0,
|
|
6400
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6239
6401
|
AdsButton,
|
|
6240
6402
|
{
|
|
6241
6403
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -6261,7 +6423,7 @@ function AdsToaster({
|
|
|
6261
6423
|
...props
|
|
6262
6424
|
}) {
|
|
6263
6425
|
const { messages } = useAdsI18n();
|
|
6264
|
-
return /* @__PURE__ */ (0,
|
|
6426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6265
6427
|
import_sonner.Toaster,
|
|
6266
6428
|
{
|
|
6267
6429
|
closeButton: false,
|
|
@@ -6279,7 +6441,7 @@ function AdsToaster({
|
|
|
6279
6441
|
);
|
|
6280
6442
|
}
|
|
6281
6443
|
function toStageNode(intent, title, options) {
|
|
6282
|
-
return /* @__PURE__ */ (0,
|
|
6444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6283
6445
|
AdsToast,
|
|
6284
6446
|
{
|
|
6285
6447
|
action: options?.action,
|
|
@@ -6293,7 +6455,7 @@ function toStageNode(intent, title, options) {
|
|
|
6293
6455
|
function showAdsToast(intent, title, options) {
|
|
6294
6456
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
6295
6457
|
return import_sonner.toast.custom(
|
|
6296
|
-
(id) => /* @__PURE__ */ (0,
|
|
6458
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6297
6459
|
AdsToast,
|
|
6298
6460
|
{
|
|
6299
6461
|
action: action ? {
|
|
@@ -6347,10 +6509,10 @@ var AdsToastManager = Object.assign(
|
|
|
6347
6509
|
);
|
|
6348
6510
|
|
|
6349
6511
|
// src/components/AdsDialog/index.tsx
|
|
6350
|
-
var
|
|
6512
|
+
var React60 = __toESM(require("react"), 1);
|
|
6351
6513
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
6352
6514
|
var import_lucide_react18 = require("lucide-react");
|
|
6353
|
-
var
|
|
6515
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6354
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";
|
|
6355
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%]";
|
|
6356
6518
|
var bodyClassName = "min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]";
|
|
@@ -6358,7 +6520,7 @@ var closeButtonClassName = "absolute right-xl top-xl inline-flex h-6 w-6 items-c
|
|
|
6358
6520
|
var Dialog = DialogPrimitive.Root;
|
|
6359
6521
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
6360
6522
|
var DialogPortal = DialogPrimitive.Portal;
|
|
6361
|
-
var DialogOverlay =
|
|
6523
|
+
var DialogOverlay = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6362
6524
|
DialogPrimitive.Overlay,
|
|
6363
6525
|
{
|
|
6364
6526
|
className: cn(overlayClassName2, className),
|
|
@@ -6367,7 +6529,7 @@ var DialogOverlay = React59.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
6367
6529
|
}
|
|
6368
6530
|
));
|
|
6369
6531
|
DialogOverlay.displayName = "DialogOverlay";
|
|
6370
|
-
var DialogClose =
|
|
6532
|
+
var DialogClose = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6371
6533
|
DialogPrimitive.Close,
|
|
6372
6534
|
{
|
|
6373
6535
|
className: cn(
|
|
@@ -6381,8 +6543,8 @@ var DialogClose = React59.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6381
6543
|
DialogClose.displayName = "DialogClose";
|
|
6382
6544
|
function flattenDialogChildren(children) {
|
|
6383
6545
|
const nodes = [];
|
|
6384
|
-
|
|
6385
|
-
if (
|
|
6546
|
+
React60.Children.forEach(children, (child) => {
|
|
6547
|
+
if (React60.isValidElement(child) && child.type === React60.Fragment) {
|
|
6386
6548
|
nodes.push(...flattenDialogChildren(child.props.children));
|
|
6387
6549
|
return;
|
|
6388
6550
|
}
|
|
@@ -6391,10 +6553,10 @@ function flattenDialogChildren(children) {
|
|
|
6391
6553
|
return nodes;
|
|
6392
6554
|
}
|
|
6393
6555
|
function isDialogSlotElement(child, component) {
|
|
6394
|
-
return
|
|
6556
|
+
return React60.isValidElement(child) && child.type === component;
|
|
6395
6557
|
}
|
|
6396
|
-
var DialogBody =
|
|
6397
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6558
|
+
var DialogBody = React60.forwardRef(
|
|
6559
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6398
6560
|
"div",
|
|
6399
6561
|
{
|
|
6400
6562
|
className: cn(bodyClassName, className),
|
|
@@ -6405,7 +6567,7 @@ var DialogBody = React59.forwardRef(
|
|
|
6405
6567
|
)
|
|
6406
6568
|
);
|
|
6407
6569
|
DialogBody.displayName = "DialogBody";
|
|
6408
|
-
var DialogContent =
|
|
6570
|
+
var DialogContent = React60.forwardRef(
|
|
6409
6571
|
({ children, className, closeLabel, hideCloseButton = false, ...props }, ref) => {
|
|
6410
6572
|
const { messages } = useAdsI18n();
|
|
6411
6573
|
const resolvedCloseLabel = closeLabel ?? messages.dialog.close;
|
|
@@ -6450,9 +6612,9 @@ var DialogContent = React59.forwardRef(
|
|
|
6450
6612
|
const looseBodyNodes = bodyNodes.filter(
|
|
6451
6613
|
(child) => !isDialogSlotElement(child, DialogBody)
|
|
6452
6614
|
);
|
|
6453
|
-
return /* @__PURE__ */ (0,
|
|
6454
|
-
/* @__PURE__ */ (0,
|
|
6455
|
-
/* @__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)(
|
|
6456
6618
|
DialogPrimitive.Content,
|
|
6457
6619
|
{
|
|
6458
6620
|
"data-slot": "ads-dialog-content",
|
|
@@ -6465,18 +6627,18 @@ var DialogContent = React59.forwardRef(
|
|
|
6465
6627
|
...props,
|
|
6466
6628
|
children: [
|
|
6467
6629
|
headerNode,
|
|
6468
|
-
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6630
|
+
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogHeader, { children: generatedHeaderNodes }) : null,
|
|
6469
6631
|
explicitBodyNodes.length > 0 ? explicitBodyNodes : null,
|
|
6470
|
-
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6632
|
+
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogBody, { children: looseBodyNodes }) : null,
|
|
6471
6633
|
footerNode,
|
|
6472
|
-
!hideCloseButton ? /* @__PURE__ */ (0,
|
|
6634
|
+
!hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6473
6635
|
DialogPrimitive.Close,
|
|
6474
6636
|
{
|
|
6475
6637
|
"aria-label": resolvedCloseLabel,
|
|
6476
6638
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
6477
6639
|
children: [
|
|
6478
|
-
/* @__PURE__ */ (0,
|
|
6479
|
-
/* @__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 })
|
|
6480
6642
|
]
|
|
6481
6643
|
}
|
|
6482
6644
|
) : null
|
|
@@ -6487,8 +6649,8 @@ var DialogContent = React59.forwardRef(
|
|
|
6487
6649
|
}
|
|
6488
6650
|
);
|
|
6489
6651
|
DialogContent.displayName = "DialogContent";
|
|
6490
|
-
var DialogHeader =
|
|
6491
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6652
|
+
var DialogHeader = React60.forwardRef(
|
|
6653
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6492
6654
|
"div",
|
|
6493
6655
|
{
|
|
6494
6656
|
"data-slot": "ads-dialog-header",
|
|
@@ -6499,8 +6661,8 @@ var DialogHeader = React59.forwardRef(
|
|
|
6499
6661
|
)
|
|
6500
6662
|
);
|
|
6501
6663
|
DialogHeader.displayName = "DialogHeader";
|
|
6502
|
-
var DialogFooter =
|
|
6503
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6664
|
+
var DialogFooter = React60.forwardRef(
|
|
6665
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6504
6666
|
"div",
|
|
6505
6667
|
{
|
|
6506
6668
|
"data-slot": "ads-dialog-footer",
|
|
@@ -6514,7 +6676,7 @@ var DialogFooter = React59.forwardRef(
|
|
|
6514
6676
|
)
|
|
6515
6677
|
);
|
|
6516
6678
|
DialogFooter.displayName = "DialogFooter";
|
|
6517
|
-
var DialogTitle =
|
|
6679
|
+
var DialogTitle = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6518
6680
|
DialogPrimitive.Title,
|
|
6519
6681
|
{
|
|
6520
6682
|
className: cn(
|
|
@@ -6527,7 +6689,7 @@ var DialogTitle = React59.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6527
6689
|
}
|
|
6528
6690
|
));
|
|
6529
6691
|
DialogTitle.displayName = "DialogTitle";
|
|
6530
|
-
var DialogDescription =
|
|
6692
|
+
var DialogDescription = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6531
6693
|
DialogPrimitive.Description,
|
|
6532
6694
|
{
|
|
6533
6695
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -6550,7 +6712,7 @@ var AdsDialogDescription = DialogDescription;
|
|
|
6550
6712
|
|
|
6551
6713
|
// src/components/AdsMasonry/index.tsx
|
|
6552
6714
|
var import_masonic = require("masonic");
|
|
6553
|
-
var
|
|
6715
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6554
6716
|
var DEFAULT_COLUMN_WIDTH = 240;
|
|
6555
6717
|
var DEFAULT_GAP = 16;
|
|
6556
6718
|
var DEFAULT_ITEM_HEIGHT_ESTIMATE = 280;
|
|
@@ -6586,7 +6748,7 @@ function AdsMasonry({
|
|
|
6586
6748
|
{ length: loadingItemCount },
|
|
6587
6749
|
(_, index) => index
|
|
6588
6750
|
);
|
|
6589
|
-
return /* @__PURE__ */ (0,
|
|
6751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6590
6752
|
"div",
|
|
6591
6753
|
{
|
|
6592
6754
|
className: cn(
|
|
@@ -6598,20 +6760,20 @@ function AdsMasonry({
|
|
|
6598
6760
|
const mediaHeight = LOADING_MEDIA_HEIGHT_PATTERN[index % LOADING_MEDIA_HEIGHT_PATTERN.length];
|
|
6599
6761
|
const titleWidth = LOADING_TITLE_WIDTH_PATTERN[index % LOADING_TITLE_WIDTH_PATTERN.length];
|
|
6600
6762
|
const bodyWidth = LOADING_BODY_WIDTH_PATTERN[index % LOADING_BODY_WIDTH_PATTERN.length];
|
|
6601
|
-
return /* @__PURE__ */ (0,
|
|
6763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
6602
6764
|
"article",
|
|
6603
6765
|
{
|
|
6604
6766
|
className: "overflow-hidden rounded-radius-lg border border-border bg-card shadow-showcase",
|
|
6605
6767
|
"data-slot": "ads-masonry-loading-card",
|
|
6606
6768
|
"data-testid": "ads-masonry-loading-card",
|
|
6607
6769
|
children: [
|
|
6608
|
-
/* @__PURE__ */ (0,
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6609
6771
|
"div",
|
|
6610
6772
|
{
|
|
6611
6773
|
className: "border-b border-border/60 bg-surface-inset/50",
|
|
6612
6774
|
"data-slot": "ads-masonry-skeleton-preview",
|
|
6613
6775
|
"data-testid": "ads-masonry-skeleton-preview",
|
|
6614
|
-
children: /* @__PURE__ */ (0,
|
|
6776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6615
6777
|
AdsSkeleton,
|
|
6616
6778
|
{
|
|
6617
6779
|
className: cn("w-full rounded-none", classNames?.skeleton),
|
|
@@ -6622,10 +6784,10 @@ function AdsMasonry({
|
|
|
6622
6784
|
)
|
|
6623
6785
|
}
|
|
6624
6786
|
),
|
|
6625
|
-
/* @__PURE__ */ (0,
|
|
6626
|
-
/* @__PURE__ */ (0,
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
6628
|
-
/* @__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)(
|
|
6629
6791
|
AdsSkeleton,
|
|
6630
6792
|
{
|
|
6631
6793
|
className: cn("h-3 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6633,7 +6795,7 @@ function AdsMasonry({
|
|
|
6633
6795
|
"data-testid": "ads-masonry-skeleton"
|
|
6634
6796
|
}
|
|
6635
6797
|
),
|
|
6636
|
-
/* @__PURE__ */ (0,
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6637
6799
|
AdsSkeleton,
|
|
6638
6800
|
{
|
|
6639
6801
|
className: cn("h-6 rounded-full", classNames?.skeleton),
|
|
@@ -6643,7 +6805,7 @@ function AdsMasonry({
|
|
|
6643
6805
|
}
|
|
6644
6806
|
)
|
|
6645
6807
|
] }),
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6647
6809
|
AdsSkeleton,
|
|
6648
6810
|
{
|
|
6649
6811
|
className: cn("h-6 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6652,7 +6814,7 @@ function AdsMasonry({
|
|
|
6652
6814
|
}
|
|
6653
6815
|
)
|
|
6654
6816
|
] }),
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6656
6818
|
AdsSkeleton,
|
|
6657
6819
|
{
|
|
6658
6820
|
className: cn("h-4 rounded-full", classNames?.skeleton),
|
|
@@ -6671,7 +6833,7 @@ function AdsMasonry({
|
|
|
6671
6833
|
);
|
|
6672
6834
|
}
|
|
6673
6835
|
if (items.length === 0) {
|
|
6674
|
-
return emptyState ? /* @__PURE__ */ (0,
|
|
6836
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6675
6837
|
"div",
|
|
6676
6838
|
{
|
|
6677
6839
|
className: cn(rootClassName, classNames?.empty),
|
|
@@ -6680,7 +6842,7 @@ function AdsMasonry({
|
|
|
6680
6842
|
}
|
|
6681
6843
|
) : null;
|
|
6682
6844
|
}
|
|
6683
|
-
return /* @__PURE__ */ (0,
|
|
6845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6684
6846
|
import_masonic.Masonry,
|
|
6685
6847
|
{
|
|
6686
6848
|
className: rootClassName,
|
|
@@ -6692,7 +6854,7 @@ function AdsMasonry({
|
|
|
6692
6854
|
maxColumnCount,
|
|
6693
6855
|
onRender,
|
|
6694
6856
|
overscanBy,
|
|
6695
|
-
render: ({ data, index, width }) => /* @__PURE__ */ (0,
|
|
6857
|
+
render: ({ data, index, width }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6696
6858
|
"div",
|
|
6697
6859
|
{
|
|
6698
6860
|
className: cn("pb-0", classNames?.item, itemClassName),
|