@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +751 -791
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -11
- package/dist/index.d.ts +8 -11
- package/dist/index.js +672 -712
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,7 +41,6 @@ var adsDefaultMessages = {
|
|
|
41
41
|
collapseRow: "Collapse row",
|
|
42
42
|
expandRow: "Expand row",
|
|
43
43
|
filterColumn: "Filter column",
|
|
44
|
-
loadingRows: "Loading table rows",
|
|
45
44
|
noDataAvailable: "No data available",
|
|
46
45
|
selectAllRows: "Select all rows",
|
|
47
46
|
selectRow: "Select row",
|
|
@@ -92,7 +91,6 @@ var adsDefaultMessages = {
|
|
|
92
91
|
collapseRow: "\u6536\u8D77\u884C",
|
|
93
92
|
expandRow: "\u5C55\u5F00\u884C",
|
|
94
93
|
filterColumn: "\u7B5B\u9009\u5217",
|
|
95
|
-
loadingRows: "\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C",
|
|
96
94
|
noDataAvailable: "\u6682\u65E0\u6570\u636E",
|
|
97
95
|
selectAllRows: "\u9009\u62E9\u5168\u90E8\u884C",
|
|
98
96
|
selectRow: "\u9009\u62E9\u884C",
|
|
@@ -651,7 +649,7 @@ var adsTextColorClassName = {
|
|
|
651
649
|
// src/components/AdsAlertDialog/index.tsx
|
|
652
650
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
653
651
|
var overlayClassName = "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";
|
|
654
|
-
var contentClassName = "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-[512px] -translate-x-1/2 -translate-y-1/2 gap-lg rounded-radius-lg border-
|
|
652
|
+
var contentClassName = "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-[512px] -translate-x-1/2 -translate-y-1/2 gap-lg rounded-radius-lg 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%]";
|
|
655
653
|
var actionClassName = "inline-flex h-9 items-center justify-center rounded-radius-md border-0 bg-brand-gradient px-lg py-sm text-sm font-medium leading-5 tracking-normal shadow-[0px_1px_2px_rgba(0,0,0,0.1)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:pointer-events-none disabled:opacity-[0.65]";
|
|
656
654
|
var cancelClassName = "inline-flex h-9 items-center justify-center rounded-radius-md border border-border bg-card px-lg py-sm text-sm font-medium leading-5 tracking-normal shadow-[0px_1px_2px_rgba(0,0,0,0.1)] transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:pointer-events-none disabled:opacity-[0.65]";
|
|
657
655
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
@@ -966,16 +964,43 @@ var AdsButton = React10.forwardRef(
|
|
|
966
964
|
);
|
|
967
965
|
AdsButton.displayName = "AdsButton";
|
|
968
966
|
|
|
967
|
+
// src/components/AdsCard/index.tsx
|
|
968
|
+
import * as React11 from "react";
|
|
969
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
970
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
971
|
+
var cardBaseClassName = "relative isolate rounded-radius-lg border border-border bg-card shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
972
|
+
var cardInteractiveClassName = "transition-[transform,border-color,box-shadow,background-image] duration-300 motion-safe:hover:-translate-y-1 motion-safe:focus-visible:-translate-y-1 hover:[border-color:color-mix(in_srgb,var(--color-brand-primary)_38%,var(--color-border-subtle))] focus-visible:border-border-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:[box-shadow:0_24px_52px_rgba(0,0,0,0.28),0_12px_28px_color-mix(in_srgb,var(--color-brand-gradient-from)_18%,transparent),0_6px_16px_color-mix(in_srgb,var(--color-brand-gradient-to)_14%,transparent),0_0_0_1px_color-mix(in_srgb,var(--color-brand-primary)_14%,transparent)] focus-visible:[box-shadow:0_24px_52px_rgba(0,0,0,0.28),0_12px_28px_color-mix(in_srgb,var(--color-brand-gradient-from)_18%,transparent),0_6px_16px_color-mix(in_srgb,var(--color-brand-gradient-to)_14%,transparent),0_0_0_1px_color-mix(in_srgb,var(--color-brand-primary)_14%,transparent)] hover:[background-image:linear-gradient(135deg,color-mix(in_srgb,var(--color-brand-gradient-from)_8%,transparent)_0%,transparent_68%)] focus-visible:[background-image:linear-gradient(135deg,color-mix(in_srgb,var(--color-brand-gradient-from)_8%,transparent)_0%,transparent_68%)] motion-reduce:transition-none motion-reduce:hover:transform-none motion-reduce:focus-visible:transform-none";
|
|
973
|
+
var AdsCard = React11.forwardRef(
|
|
974
|
+
({ asChild = false, className, interactive = false, ...props }, ref) => {
|
|
975
|
+
const Comp = asChild ? Slot2 : "div";
|
|
976
|
+
return /* @__PURE__ */ jsx12(
|
|
977
|
+
Comp,
|
|
978
|
+
{
|
|
979
|
+
className: cn(
|
|
980
|
+
cardBaseClassName,
|
|
981
|
+
interactive && cardInteractiveClassName,
|
|
982
|
+
className
|
|
983
|
+
),
|
|
984
|
+
"data-interactive": interactive,
|
|
985
|
+
"data-slot": "ads-card",
|
|
986
|
+
ref,
|
|
987
|
+
...props
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
);
|
|
992
|
+
AdsCard.displayName = "AdsCard";
|
|
993
|
+
|
|
969
994
|
// src/components/AdsBreadcrumb/index.tsx
|
|
970
|
-
import * as
|
|
995
|
+
import * as React13 from "react";
|
|
971
996
|
import { ChevronRight as ChevronRight2, MoreHorizontal as MoreHorizontal2, Slash } from "lucide-react";
|
|
972
997
|
|
|
973
998
|
// src/primitives/breadcrumb.tsx
|
|
974
|
-
import * as
|
|
975
|
-
import { Slot as
|
|
999
|
+
import * as React12 from "react";
|
|
1000
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
976
1001
|
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
977
|
-
import { jsx as
|
|
978
|
-
var Breadcrumb =
|
|
1002
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1003
|
+
var Breadcrumb = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
979
1004
|
"nav",
|
|
980
1005
|
{
|
|
981
1006
|
"aria-label": "breadcrumb",
|
|
@@ -985,7 +1010,7 @@ var Breadcrumb = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
985
1010
|
}
|
|
986
1011
|
));
|
|
987
1012
|
Breadcrumb.displayName = "Breadcrumb";
|
|
988
|
-
var BreadcrumbList =
|
|
1013
|
+
var BreadcrumbList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
989
1014
|
"ul",
|
|
990
1015
|
{
|
|
991
1016
|
className: cn(
|
|
@@ -997,7 +1022,7 @@ var BreadcrumbList = React11.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
997
1022
|
}
|
|
998
1023
|
));
|
|
999
1024
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
1000
|
-
var BreadcrumbItem =
|
|
1025
|
+
var BreadcrumbItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1001
1026
|
"li",
|
|
1002
1027
|
{
|
|
1003
1028
|
className: cn("inline-flex items-center gap-1.5", className),
|
|
@@ -1006,14 +1031,14 @@ var BreadcrumbItem = React11.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1006
1031
|
}
|
|
1007
1032
|
));
|
|
1008
1033
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1009
|
-
var BreadcrumbLink =
|
|
1034
|
+
var BreadcrumbLink = React12.forwardRef(
|
|
1010
1035
|
({ asChild = false, className, ...props }, ref) => {
|
|
1011
|
-
const Comp = asChild ?
|
|
1012
|
-
return /* @__PURE__ */
|
|
1036
|
+
const Comp = asChild ? Slot3 : "a";
|
|
1037
|
+
return /* @__PURE__ */ jsx13(Comp, { className: cn("transition-colors", className), ref, ...props });
|
|
1013
1038
|
}
|
|
1014
1039
|
);
|
|
1015
1040
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
1016
|
-
var BreadcrumbPage =
|
|
1041
|
+
var BreadcrumbPage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1017
1042
|
"span",
|
|
1018
1043
|
{
|
|
1019
1044
|
"aria-current": "page",
|
|
@@ -1029,14 +1054,14 @@ var BreadcrumbSeparator = ({
|
|
|
1029
1054
|
children,
|
|
1030
1055
|
className,
|
|
1031
1056
|
...props
|
|
1032
|
-
}) => /* @__PURE__ */
|
|
1057
|
+
}) => /* @__PURE__ */ jsx13(
|
|
1033
1058
|
"li",
|
|
1034
1059
|
{
|
|
1035
1060
|
"aria-hidden": "true",
|
|
1036
1061
|
className: cn("[&_svg]:size-3.5", className),
|
|
1037
1062
|
role: "presentation",
|
|
1038
1063
|
...props,
|
|
1039
|
-
children: children ?? /* @__PURE__ */
|
|
1064
|
+
children: children ?? /* @__PURE__ */ jsx13(ChevronRight, {})
|
|
1040
1065
|
}
|
|
1041
1066
|
);
|
|
1042
1067
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
@@ -1051,18 +1076,18 @@ var BreadcrumbEllipsis = ({
|
|
|
1051
1076
|
role: "presentation",
|
|
1052
1077
|
...props,
|
|
1053
1078
|
children: [
|
|
1054
|
-
/* @__PURE__ */
|
|
1055
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ jsx13(MoreHorizontal, { className: "size-3.5" }),
|
|
1080
|
+
/* @__PURE__ */ jsx13("span", { className: "sr-only", children: "More" })
|
|
1056
1081
|
]
|
|
1057
1082
|
}
|
|
1058
1083
|
);
|
|
1059
1084
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
1060
1085
|
|
|
1061
1086
|
// src/components/AdsBreadcrumb/index.tsx
|
|
1062
|
-
import { jsx as
|
|
1063
|
-
var AdsBreadcrumb =
|
|
1087
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1088
|
+
var AdsBreadcrumb = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(Breadcrumb, { className: cn("w-full", className), ref, ...props }));
|
|
1064
1089
|
AdsBreadcrumb.displayName = "AdsBreadcrumb";
|
|
1065
|
-
var AdsBreadcrumbList =
|
|
1090
|
+
var AdsBreadcrumbList = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1066
1091
|
BreadcrumbList,
|
|
1067
1092
|
{
|
|
1068
1093
|
className: cn(
|
|
@@ -1074,7 +1099,7 @@ var AdsBreadcrumbList = React12.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1074
1099
|
}
|
|
1075
1100
|
));
|
|
1076
1101
|
AdsBreadcrumbList.displayName = "AdsBreadcrumbList";
|
|
1077
|
-
var AdsBreadcrumbItem =
|
|
1102
|
+
var AdsBreadcrumbItem = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1078
1103
|
BreadcrumbItem,
|
|
1079
1104
|
{
|
|
1080
1105
|
className: cn("inline-flex items-center gap-1.5", className),
|
|
@@ -1083,7 +1108,7 @@ var AdsBreadcrumbItem = React12.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1083
1108
|
}
|
|
1084
1109
|
));
|
|
1085
1110
|
AdsBreadcrumbItem.displayName = "AdsBreadcrumbItem";
|
|
1086
|
-
var AdsBreadcrumbLink =
|
|
1111
|
+
var AdsBreadcrumbLink = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1087
1112
|
BreadcrumbLink,
|
|
1088
1113
|
{
|
|
1089
1114
|
className: cn(
|
|
@@ -1095,7 +1120,7 @@ var AdsBreadcrumbLink = React12.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1095
1120
|
}
|
|
1096
1121
|
));
|
|
1097
1122
|
AdsBreadcrumbLink.displayName = "AdsBreadcrumbLink";
|
|
1098
|
-
var AdsBreadcrumbPage =
|
|
1123
|
+
var AdsBreadcrumbPage = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1099
1124
|
BreadcrumbPage,
|
|
1100
1125
|
{
|
|
1101
1126
|
className: cn("text-sm font-normal leading-5 text-foreground", className),
|
|
@@ -1105,15 +1130,15 @@ var AdsBreadcrumbPage = React12.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1105
1130
|
));
|
|
1106
1131
|
AdsBreadcrumbPage.displayName = "AdsBreadcrumbPage";
|
|
1107
1132
|
var separatorIcons = {
|
|
1108
|
-
chevron: /* @__PURE__ */
|
|
1109
|
-
slash: /* @__PURE__ */
|
|
1133
|
+
chevron: /* @__PURE__ */ jsx14(ChevronRight2, { className: "size-3.5" }),
|
|
1134
|
+
slash: /* @__PURE__ */ jsx14(Slash, { className: "size-3.5" })
|
|
1110
1135
|
};
|
|
1111
1136
|
var AdsBreadcrumbSeparator = ({
|
|
1112
1137
|
children,
|
|
1113
1138
|
className,
|
|
1114
1139
|
icon = "chevron",
|
|
1115
1140
|
...props
|
|
1116
|
-
}) => /* @__PURE__ */
|
|
1141
|
+
}) => /* @__PURE__ */ jsx14(
|
|
1117
1142
|
BreadcrumbSeparator,
|
|
1118
1143
|
{
|
|
1119
1144
|
className: cn("text-muted-foreground [&_svg]:size-3.5", className),
|
|
@@ -1126,25 +1151,25 @@ var AdsBreadcrumbEllipsis = ({
|
|
|
1126
1151
|
className,
|
|
1127
1152
|
children,
|
|
1128
1153
|
...props
|
|
1129
|
-
}) => /* @__PURE__ */
|
|
1154
|
+
}) => /* @__PURE__ */ jsx14(
|
|
1130
1155
|
BreadcrumbEllipsis,
|
|
1131
1156
|
{
|
|
1132
1157
|
className: cn("size-3.5 text-muted-foreground", className),
|
|
1133
1158
|
...props,
|
|
1134
|
-
children: children ?? /* @__PURE__ */
|
|
1159
|
+
children: children ?? /* @__PURE__ */ jsx14(MoreHorizontal2, { className: "size-3.5" })
|
|
1135
1160
|
}
|
|
1136
1161
|
);
|
|
1137
1162
|
AdsBreadcrumbEllipsis.displayName = "AdsBreadcrumbEllipsis";
|
|
1138
1163
|
|
|
1139
1164
|
// src/components/AdsCheckbox/index.tsx
|
|
1140
|
-
import * as
|
|
1165
|
+
import * as React18 from "react";
|
|
1141
1166
|
|
|
1142
1167
|
// src/primitives/checkbox.tsx
|
|
1143
|
-
import * as
|
|
1168
|
+
import * as React14 from "react";
|
|
1144
1169
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1145
1170
|
import { Check } from "lucide-react";
|
|
1146
|
-
import { jsx as
|
|
1147
|
-
var Checkbox =
|
|
1171
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1172
|
+
var Checkbox = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1148
1173
|
CheckboxPrimitive.Root,
|
|
1149
1174
|
{
|
|
1150
1175
|
ref,
|
|
@@ -1153,11 +1178,11 @@ var Checkbox = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1153
1178
|
className
|
|
1154
1179
|
),
|
|
1155
1180
|
...props,
|
|
1156
|
-
children: /* @__PURE__ */
|
|
1181
|
+
children: /* @__PURE__ */ jsx15(
|
|
1157
1182
|
CheckboxPrimitive.Indicator,
|
|
1158
1183
|
{
|
|
1159
1184
|
className: cn("grid place-content-center text-current"),
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1185
|
+
children: /* @__PURE__ */ jsx15(Check, { className: "h-4 w-4" })
|
|
1161
1186
|
}
|
|
1162
1187
|
)
|
|
1163
1188
|
}
|
|
@@ -1165,21 +1190,21 @@ var Checkbox = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1165
1190
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
1166
1191
|
|
|
1167
1192
|
// src/components/AdsField/index.tsx
|
|
1168
|
-
import * as
|
|
1193
|
+
import * as React17 from "react";
|
|
1169
1194
|
|
|
1170
1195
|
// src/primitives/field.tsx
|
|
1171
1196
|
import { useMemo as useMemo2 } from "react";
|
|
1172
1197
|
import { cva as cva7 } from "class-variance-authority";
|
|
1173
1198
|
|
|
1174
1199
|
// src/primitives/label.tsx
|
|
1175
|
-
import * as
|
|
1200
|
+
import * as React15 from "react";
|
|
1176
1201
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1177
1202
|
import { cva as cva6 } from "class-variance-authority";
|
|
1178
|
-
import { jsx as
|
|
1203
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1179
1204
|
var labelVariants = cva6(
|
|
1180
1205
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1181
1206
|
);
|
|
1182
|
-
var Label =
|
|
1207
|
+
var Label = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1183
1208
|
LabelPrimitive.Root,
|
|
1184
1209
|
{
|
|
1185
1210
|
ref,
|
|
@@ -1190,11 +1215,11 @@ var Label = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1190
1215
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
1191
1216
|
|
|
1192
1217
|
// src/primitives/separator.tsx
|
|
1193
|
-
import * as
|
|
1218
|
+
import * as React16 from "react";
|
|
1194
1219
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1195
|
-
import { jsx as
|
|
1196
|
-
var Separator =
|
|
1197
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */
|
|
1220
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1221
|
+
var Separator = React16.forwardRef(
|
|
1222
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1198
1223
|
SeparatorPrimitive.Root,
|
|
1199
1224
|
{
|
|
1200
1225
|
ref,
|
|
@@ -1212,9 +1237,9 @@ var Separator = React15.forwardRef(
|
|
|
1212
1237
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
1213
1238
|
|
|
1214
1239
|
// src/primitives/field.tsx
|
|
1215
|
-
import { jsx as
|
|
1240
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1216
1241
|
function FieldSet({ className, ...props }) {
|
|
1217
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ jsx18(
|
|
1218
1243
|
"fieldset",
|
|
1219
1244
|
{
|
|
1220
1245
|
"data-slot": "field-set",
|
|
@@ -1232,7 +1257,7 @@ function FieldLegend({
|
|
|
1232
1257
|
variant = "legend",
|
|
1233
1258
|
...props
|
|
1234
1259
|
}) {
|
|
1235
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsx18(
|
|
1236
1261
|
"legend",
|
|
1237
1262
|
{
|
|
1238
1263
|
"data-slot": "field-legend",
|
|
@@ -1248,7 +1273,7 @@ function FieldLegend({
|
|
|
1248
1273
|
);
|
|
1249
1274
|
}
|
|
1250
1275
|
function FieldGroup({ className, ...props }) {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsx18(
|
|
1252
1277
|
"div",
|
|
1253
1278
|
{
|
|
1254
1279
|
"data-slot": "field-group",
|
|
@@ -1288,7 +1313,7 @@ function Field({
|
|
|
1288
1313
|
orientation = "vertical",
|
|
1289
1314
|
...props
|
|
1290
1315
|
}) {
|
|
1291
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ jsx18(
|
|
1292
1317
|
"div",
|
|
1293
1318
|
{
|
|
1294
1319
|
role: "group",
|
|
@@ -1303,7 +1328,7 @@ function FieldLabel({
|
|
|
1303
1328
|
className,
|
|
1304
1329
|
...props
|
|
1305
1330
|
}) {
|
|
1306
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ jsx18(
|
|
1307
1332
|
Label,
|
|
1308
1333
|
{
|
|
1309
1334
|
"data-slot": "field-label",
|
|
@@ -1318,7 +1343,7 @@ function FieldLabel({
|
|
|
1318
1343
|
);
|
|
1319
1344
|
}
|
|
1320
1345
|
function FieldTitle({ className, ...props }) {
|
|
1321
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx18(
|
|
1322
1347
|
"div",
|
|
1323
1348
|
{
|
|
1324
1349
|
"data-slot": "field-label",
|
|
@@ -1331,7 +1356,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
1331
1356
|
);
|
|
1332
1357
|
}
|
|
1333
1358
|
function FieldDescription({ className, ...props }) {
|
|
1334
|
-
return /* @__PURE__ */
|
|
1359
|
+
return /* @__PURE__ */ jsx18(
|
|
1335
1360
|
"p",
|
|
1336
1361
|
{
|
|
1337
1362
|
"data-slot": "field-description",
|
|
@@ -1361,8 +1386,8 @@ function FieldSeparator({
|
|
|
1361
1386
|
),
|
|
1362
1387
|
...props,
|
|
1363
1388
|
children: [
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
children && /* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ jsx18(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
1390
|
+
children && /* @__PURE__ */ jsx18(
|
|
1366
1391
|
"span",
|
|
1367
1392
|
{
|
|
1368
1393
|
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
@@ -1390,14 +1415,14 @@ function FieldError({
|
|
|
1390
1415
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
1391
1416
|
return errors[0].message;
|
|
1392
1417
|
}
|
|
1393
|
-
return /* @__PURE__ */
|
|
1394
|
-
(error, index) => error?.message && /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ jsx18("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
1419
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx18("li", { children: error.message }, index)
|
|
1395
1420
|
) });
|
|
1396
1421
|
}, [children, errors]);
|
|
1397
1422
|
if (!content) {
|
|
1398
1423
|
return null;
|
|
1399
1424
|
}
|
|
1400
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ jsx18(
|
|
1401
1426
|
"div",
|
|
1402
1427
|
{
|
|
1403
1428
|
role: "alert",
|
|
@@ -1410,14 +1435,14 @@ function FieldError({
|
|
|
1410
1435
|
}
|
|
1411
1436
|
|
|
1412
1437
|
// src/components/AdsField/index.tsx
|
|
1413
|
-
import { jsx as
|
|
1438
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1414
1439
|
function useAdsFieldDescription({
|
|
1415
1440
|
describedBy,
|
|
1416
1441
|
errorText,
|
|
1417
1442
|
helperText,
|
|
1418
1443
|
id
|
|
1419
1444
|
}) {
|
|
1420
|
-
const generatedId =
|
|
1445
|
+
const generatedId = React17.useId();
|
|
1421
1446
|
const inputId = id ?? generatedId;
|
|
1422
1447
|
const helperId = helperText ? `${inputId}-helper` : void 0;
|
|
1423
1448
|
const errorId = errorText ? `${inputId}-error` : void 0;
|
|
@@ -1429,7 +1454,7 @@ function useAdsFieldDescription({
|
|
|
1429
1454
|
inputId
|
|
1430
1455
|
};
|
|
1431
1456
|
}
|
|
1432
|
-
var AdsField =
|
|
1457
|
+
var AdsField = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1433
1458
|
FieldGroup,
|
|
1434
1459
|
{
|
|
1435
1460
|
className: cn("w-full gap-7", className),
|
|
@@ -1438,14 +1463,14 @@ var AdsField = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1438
1463
|
}
|
|
1439
1464
|
));
|
|
1440
1465
|
AdsField.displayName = "AdsField";
|
|
1441
|
-
var AdsFieldHeader =
|
|
1466
|
+
var AdsFieldHeader = React17.forwardRef(({ className, description, title, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1442
1467
|
"div",
|
|
1443
1468
|
{
|
|
1444
1469
|
className: cn("flex w-full flex-col gap-3", className),
|
|
1445
1470
|
ref,
|
|
1446
1471
|
...props,
|
|
1447
1472
|
children: [
|
|
1448
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ jsx19(
|
|
1449
1474
|
FieldTitle,
|
|
1450
1475
|
{
|
|
1451
1476
|
className: cn(
|
|
@@ -1455,7 +1480,7 @@ var AdsFieldHeader = React16.forwardRef(({ className, description, title, ...pro
|
|
|
1455
1480
|
children: title
|
|
1456
1481
|
}
|
|
1457
1482
|
),
|
|
1458
|
-
description ? /* @__PURE__ */
|
|
1483
|
+
description ? /* @__PURE__ */ jsx19(
|
|
1459
1484
|
FieldDescription,
|
|
1460
1485
|
{
|
|
1461
1486
|
className: cn("w-full text-sm leading-5", adsTextColorClassName.muted),
|
|
@@ -1466,7 +1491,7 @@ var AdsFieldHeader = React16.forwardRef(({ className, description, title, ...pro
|
|
|
1466
1491
|
}
|
|
1467
1492
|
));
|
|
1468
1493
|
AdsFieldHeader.displayName = "AdsFieldHeader";
|
|
1469
|
-
var AdsFieldItem =
|
|
1494
|
+
var AdsFieldItem = React17.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1470
1495
|
Field,
|
|
1471
1496
|
{
|
|
1472
1497
|
className: cn("w-full gap-3", className),
|
|
@@ -1476,7 +1501,7 @@ var AdsFieldItem = React16.forwardRef(({ className, orientation = "vertical", ..
|
|
|
1476
1501
|
}
|
|
1477
1502
|
));
|
|
1478
1503
|
AdsFieldItem.displayName = "AdsFieldItem";
|
|
1479
|
-
var AdsFieldLabel =
|
|
1504
|
+
var AdsFieldLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1480
1505
|
FieldLabel,
|
|
1481
1506
|
{
|
|
1482
1507
|
className: cn(
|
|
@@ -1489,7 +1514,7 @@ var AdsFieldLabel = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1489
1514
|
}
|
|
1490
1515
|
));
|
|
1491
1516
|
AdsFieldLabel.displayName = "AdsFieldLabel";
|
|
1492
|
-
var AdsFieldLegend =
|
|
1517
|
+
var AdsFieldLegend = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1493
1518
|
FieldLegend,
|
|
1494
1519
|
{
|
|
1495
1520
|
className: cn(
|
|
@@ -1502,7 +1527,7 @@ var AdsFieldLegend = React16.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1502
1527
|
}
|
|
1503
1528
|
));
|
|
1504
1529
|
AdsFieldLegend.displayName = "AdsFieldLegend";
|
|
1505
|
-
var AdsFieldDescription =
|
|
1530
|
+
var AdsFieldDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1506
1531
|
FieldDescription,
|
|
1507
1532
|
{
|
|
1508
1533
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -1511,7 +1536,7 @@ var AdsFieldDescription = React16.forwardRef(({ className, ...props }, ref) => /
|
|
|
1511
1536
|
}
|
|
1512
1537
|
));
|
|
1513
1538
|
AdsFieldDescription.displayName = "AdsFieldDescription";
|
|
1514
|
-
var AdsFieldError =
|
|
1539
|
+
var AdsFieldError = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1515
1540
|
FieldError,
|
|
1516
1541
|
{
|
|
1517
1542
|
className: cn("text-sm leading-5 text-destructive", className),
|
|
@@ -1520,7 +1545,7 @@ var AdsFieldError = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1520
1545
|
}
|
|
1521
1546
|
));
|
|
1522
1547
|
AdsFieldError.displayName = "AdsFieldError";
|
|
1523
|
-
var AdsFieldSeparator =
|
|
1548
|
+
var AdsFieldSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1524
1549
|
FieldSeparator,
|
|
1525
1550
|
{
|
|
1526
1551
|
className: cn("py-2", adsTextColorClassName.muted, className),
|
|
@@ -1529,7 +1554,7 @@ var AdsFieldSeparator = React16.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1529
1554
|
}
|
|
1530
1555
|
));
|
|
1531
1556
|
AdsFieldSeparator.displayName = "AdsFieldSeparator";
|
|
1532
|
-
var AdsFieldGroup =
|
|
1557
|
+
var AdsFieldGroup = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1533
1558
|
FieldGroup,
|
|
1534
1559
|
{
|
|
1535
1560
|
className: cn("w-full gap-6", className),
|
|
@@ -1538,7 +1563,7 @@ var AdsFieldGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1538
1563
|
}
|
|
1539
1564
|
));
|
|
1540
1565
|
AdsFieldGroup.displayName = "AdsFieldGroup";
|
|
1541
|
-
var AdsFieldSet =
|
|
1566
|
+
var AdsFieldSet = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1542
1567
|
FieldSet,
|
|
1543
1568
|
{
|
|
1544
1569
|
className: cn("w-full gap-6", className),
|
|
@@ -1547,7 +1572,7 @@ var AdsFieldSet = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1547
1572
|
}
|
|
1548
1573
|
));
|
|
1549
1574
|
AdsFieldSet.displayName = "AdsFieldSet";
|
|
1550
|
-
var AdsFieldCheckboxRow =
|
|
1575
|
+
var AdsFieldCheckboxRow = React17.forwardRef(({ className, control, description, label, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1551
1576
|
"div",
|
|
1552
1577
|
{
|
|
1553
1578
|
className: cn(
|
|
@@ -1558,16 +1583,16 @@ var AdsFieldCheckboxRow = React16.forwardRef(({ className, control, description,
|
|
|
1558
1583
|
ref,
|
|
1559
1584
|
...props,
|
|
1560
1585
|
children: [
|
|
1561
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsx19("div", { className: "shrink-0 pt-px", children: control }),
|
|
1562
1587
|
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
description ? /* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsx19("div", { className: cn("text-sm leading-5", adsTextColorClassName.default), children: label }),
|
|
1589
|
+
description ? /* @__PURE__ */ jsx19(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
1565
1590
|
] })
|
|
1566
1591
|
]
|
|
1567
1592
|
}
|
|
1568
1593
|
));
|
|
1569
1594
|
AdsFieldCheckboxRow.displayName = "AdsFieldCheckboxRow";
|
|
1570
|
-
var AdsFieldChoiceCard =
|
|
1595
|
+
var AdsFieldChoiceCard = React17.forwardRef(({ checked, className, control, description, title, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1571
1596
|
"label",
|
|
1572
1597
|
{
|
|
1573
1598
|
className: cn(
|
|
@@ -1579,9 +1604,9 @@ var AdsFieldChoiceCard = React16.forwardRef(({ checked, className, control, desc
|
|
|
1579
1604
|
ref,
|
|
1580
1605
|
...props,
|
|
1581
1606
|
children: [
|
|
1582
|
-
control ? /* @__PURE__ */
|
|
1607
|
+
control ? /* @__PURE__ */ jsx19("div", { className: "shrink-0 pt-px", children: control }) : null,
|
|
1583
1608
|
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
1584
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ jsx19(
|
|
1585
1610
|
"div",
|
|
1586
1611
|
{
|
|
1587
1612
|
className: cn(
|
|
@@ -1591,13 +1616,13 @@ var AdsFieldChoiceCard = React16.forwardRef(({ checked, className, control, desc
|
|
|
1591
1616
|
children: title
|
|
1592
1617
|
}
|
|
1593
1618
|
),
|
|
1594
|
-
description ? /* @__PURE__ */
|
|
1619
|
+
description ? /* @__PURE__ */ jsx19(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
1595
1620
|
] })
|
|
1596
1621
|
]
|
|
1597
1622
|
}
|
|
1598
1623
|
));
|
|
1599
1624
|
AdsFieldChoiceCard.displayName = "AdsFieldChoiceCard";
|
|
1600
|
-
var AdsFieldActions =
|
|
1625
|
+
var AdsFieldActions = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1601
1626
|
"div",
|
|
1602
1627
|
{
|
|
1603
1628
|
className: cn("flex w-full flex-wrap items-center gap-3", className),
|
|
@@ -1608,15 +1633,15 @@ var AdsFieldActions = React16.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1608
1633
|
AdsFieldActions.displayName = "AdsFieldActions";
|
|
1609
1634
|
|
|
1610
1635
|
// src/components/AdsCheckbox/index.tsx
|
|
1611
|
-
import { jsx as
|
|
1636
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1612
1637
|
var checkboxBaseClassName = "h-4 w-4 rounded-[4px] 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 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground";
|
|
1613
|
-
var Checkbox2 =
|
|
1638
|
+
var Checkbox2 = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(Checkbox, { className: cn(checkboxBaseClassName, className), ref, ...props }));
|
|
1614
1639
|
Checkbox2.displayName = "Checkbox";
|
|
1615
|
-
var AdsCheckbox =
|
|
1616
|
-
const generatedId =
|
|
1640
|
+
var AdsCheckbox = React18.forwardRef(({ checkboxClassName, className, description, id, label, wrapperClassName, ...props }, ref) => {
|
|
1641
|
+
const generatedId = React18.useId();
|
|
1617
1642
|
const inputId = id ?? generatedId;
|
|
1618
1643
|
if (!label) {
|
|
1619
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsx20(
|
|
1620
1645
|
Checkbox2,
|
|
1621
1646
|
{
|
|
1622
1647
|
className: cn(className, checkboxClassName),
|
|
@@ -1626,10 +1651,10 @@ var AdsCheckbox = React17.forwardRef(({ checkboxClassName, className, descriptio
|
|
|
1626
1651
|
}
|
|
1627
1652
|
);
|
|
1628
1653
|
}
|
|
1629
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx20("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ jsx20(
|
|
1630
1655
|
AdsFieldCheckboxRow,
|
|
1631
1656
|
{
|
|
1632
|
-
control: /* @__PURE__ */
|
|
1657
|
+
control: /* @__PURE__ */ jsx20(
|
|
1633
1658
|
Checkbox2,
|
|
1634
1659
|
{
|
|
1635
1660
|
className: cn(className, checkboxClassName),
|
|
@@ -1646,16 +1671,16 @@ var AdsCheckbox = React17.forwardRef(({ checkboxClassName, className, descriptio
|
|
|
1646
1671
|
AdsCheckbox.displayName = "AdsCheckbox";
|
|
1647
1672
|
|
|
1648
1673
|
// src/components/AdsCalendar/index.tsx
|
|
1649
|
-
import * as
|
|
1674
|
+
import * as React25 from "react";
|
|
1650
1675
|
import { format } from "date-fns";
|
|
1651
1676
|
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
1652
1677
|
|
|
1653
1678
|
// src/primitives/input.tsx
|
|
1654
|
-
import * as
|
|
1655
|
-
import { jsx as
|
|
1656
|
-
var Input =
|
|
1679
|
+
import * as React19 from "react";
|
|
1680
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1681
|
+
var Input = React19.forwardRef(
|
|
1657
1682
|
({ className, type, ...props }, ref) => {
|
|
1658
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ jsx21(
|
|
1659
1684
|
"input",
|
|
1660
1685
|
{
|
|
1661
1686
|
type,
|
|
@@ -1672,20 +1697,20 @@ var Input = React18.forwardRef(
|
|
|
1672
1697
|
Input.displayName = "Input";
|
|
1673
1698
|
|
|
1674
1699
|
// src/components/AdsPopover/index.tsx
|
|
1675
|
-
import * as
|
|
1700
|
+
import * as React22 from "react";
|
|
1676
1701
|
|
|
1677
1702
|
// src/primitives/popover.tsx
|
|
1678
|
-
import * as
|
|
1703
|
+
import * as React21 from "react";
|
|
1679
1704
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1680
1705
|
|
|
1681
1706
|
// src/lib/nestedDismissableLayer.tsx
|
|
1682
|
-
import * as
|
|
1683
|
-
import { jsx as
|
|
1684
|
-
var NestedDismissableLayerContext =
|
|
1707
|
+
import * as React20 from "react";
|
|
1708
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1709
|
+
var NestedDismissableLayerContext = React20.createContext(null);
|
|
1685
1710
|
function useNestedDismissableLayerCoordinator() {
|
|
1686
|
-
const activeLayersRef =
|
|
1687
|
-
const pointerInteractionHadNestedLayerRef =
|
|
1688
|
-
const registerNestedLayer =
|
|
1711
|
+
const activeLayersRef = React20.useRef(/* @__PURE__ */ new Map());
|
|
1712
|
+
const pointerInteractionHadNestedLayerRef = React20.useRef(false);
|
|
1713
|
+
const registerNestedLayer = React20.useCallback(
|
|
1689
1714
|
(id, dismiss) => {
|
|
1690
1715
|
const activeLayers = activeLayersRef.current;
|
|
1691
1716
|
activeLayers.delete(id);
|
|
@@ -1698,19 +1723,19 @@ function useNestedDismissableLayerCoordinator() {
|
|
|
1698
1723
|
},
|
|
1699
1724
|
[]
|
|
1700
1725
|
);
|
|
1701
|
-
const hasActiveNestedLayer =
|
|
1726
|
+
const hasActiveNestedLayer = React20.useCallback(
|
|
1702
1727
|
() => activeLayersRef.current.size > 0,
|
|
1703
1728
|
[]
|
|
1704
1729
|
);
|
|
1705
|
-
const hadActiveNestedLayerAtPointerDown =
|
|
1730
|
+
const hadActiveNestedLayerAtPointerDown = React20.useCallback(
|
|
1706
1731
|
() => pointerInteractionHadNestedLayerRef.current,
|
|
1707
1732
|
[]
|
|
1708
1733
|
);
|
|
1709
|
-
const dismissTopNestedLayer =
|
|
1734
|
+
const dismissTopNestedLayer = React20.useCallback(() => {
|
|
1710
1735
|
const activeLayers = [...activeLayersRef.current.values()];
|
|
1711
1736
|
activeLayers.at(-1)?.();
|
|
1712
1737
|
}, []);
|
|
1713
|
-
|
|
1738
|
+
React20.useEffect(() => {
|
|
1714
1739
|
const ownerDocument = globalThis.document;
|
|
1715
1740
|
if (!ownerDocument) return;
|
|
1716
1741
|
const handlePointerDown = () => {
|
|
@@ -1731,7 +1756,7 @@ function useNestedDismissableLayerCoordinator() {
|
|
|
1731
1756
|
ownerDocument.removeEventListener("keydown", handleKeyDown, true);
|
|
1732
1757
|
};
|
|
1733
1758
|
}, []);
|
|
1734
|
-
return
|
|
1759
|
+
return React20.useMemo(
|
|
1735
1760
|
() => ({
|
|
1736
1761
|
dismissTopNestedLayer,
|
|
1737
1762
|
hasActiveNestedLayer,
|
|
@@ -1752,8 +1777,8 @@ function useNestedDismissableLayerParent({
|
|
|
1752
1777
|
onPointerDownOutside
|
|
1753
1778
|
} = {}) {
|
|
1754
1779
|
const coordinator = useNestedDismissableLayerCoordinator();
|
|
1755
|
-
const shieldNextFocusOutsideRef =
|
|
1756
|
-
const handlePointerDownOutside =
|
|
1780
|
+
const shieldNextFocusOutsideRef = React20.useRef(false);
|
|
1781
|
+
const handlePointerDownOutside = React20.useCallback(
|
|
1757
1782
|
(event) => {
|
|
1758
1783
|
onPointerDownOutside?.(event);
|
|
1759
1784
|
if (event.defaultPrevented) return;
|
|
@@ -1771,7 +1796,7 @@ function useNestedDismissableLayerParent({
|
|
|
1771
1796
|
},
|
|
1772
1797
|
[coordinator, onPointerDownOutside]
|
|
1773
1798
|
);
|
|
1774
|
-
const handleFocusOutside =
|
|
1799
|
+
const handleFocusOutside = React20.useCallback(
|
|
1775
1800
|
(event) => {
|
|
1776
1801
|
onFocusOutside?.(event);
|
|
1777
1802
|
if (event.defaultPrevented) return;
|
|
@@ -1787,7 +1812,7 @@ function useNestedDismissableLayerParent({
|
|
|
1787
1812
|
},
|
|
1788
1813
|
[coordinator, onFocusOutside]
|
|
1789
1814
|
);
|
|
1790
|
-
const handleEscapeKeyDown =
|
|
1815
|
+
const handleEscapeKeyDown = React20.useCallback(
|
|
1791
1816
|
(event) => {
|
|
1792
1817
|
onEscapeKeyDown?.(event);
|
|
1793
1818
|
if (event.defaultPrevented || !coordinator.hasActiveNestedLayer()) {
|
|
@@ -1798,7 +1823,7 @@ function useNestedDismissableLayerParent({
|
|
|
1798
1823
|
},
|
|
1799
1824
|
[coordinator, onEscapeKeyDown]
|
|
1800
1825
|
);
|
|
1801
|
-
return
|
|
1826
|
+
return React20.useMemo(
|
|
1802
1827
|
() => ({
|
|
1803
1828
|
coordinator,
|
|
1804
1829
|
onEscapeKeyDown: handleEscapeKeyDown,
|
|
@@ -1817,22 +1842,22 @@ function NestedDismissableLayerProvider({
|
|
|
1817
1842
|
children,
|
|
1818
1843
|
coordinator
|
|
1819
1844
|
}) {
|
|
1820
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsx22(NestedDismissableLayerContext.Provider, { value: coordinator, children });
|
|
1821
1846
|
}
|
|
1822
1847
|
function useNestedDismissableLayer(active, dismiss) {
|
|
1823
|
-
const coordinator =
|
|
1824
|
-
const idRef =
|
|
1825
|
-
|
|
1848
|
+
const coordinator = React20.useContext(NestedDismissableLayerContext);
|
|
1849
|
+
const idRef = React20.useRef(/* @__PURE__ */ Symbol("ads-nested-dismissable-layer"));
|
|
1850
|
+
React20.useEffect(() => {
|
|
1826
1851
|
if (!active || !coordinator) return;
|
|
1827
1852
|
return coordinator.registerNestedLayer(idRef.current, dismiss);
|
|
1828
1853
|
}, [active, coordinator, dismiss]);
|
|
1829
1854
|
}
|
|
1830
1855
|
|
|
1831
1856
|
// src/primitives/popover.tsx
|
|
1832
|
-
import { jsx as
|
|
1857
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1833
1858
|
var Popover = PopoverPrimitive.Root;
|
|
1834
1859
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1835
|
-
var PopoverContentImpl =
|
|
1860
|
+
var PopoverContentImpl = React21.forwardRef(
|
|
1836
1861
|
({
|
|
1837
1862
|
className,
|
|
1838
1863
|
align = "center",
|
|
@@ -1847,7 +1872,7 @@ var PopoverContentImpl = React20.forwardRef(
|
|
|
1847
1872
|
onFocusOutside,
|
|
1848
1873
|
onPointerDownOutside
|
|
1849
1874
|
});
|
|
1850
|
-
return /* @__PURE__ */
|
|
1875
|
+
return /* @__PURE__ */ jsx23(NestedDismissableLayerProvider, { coordinator: parentLayer.coordinator, children: /* @__PURE__ */ jsx23(
|
|
1851
1876
|
PopoverPrimitive.Content,
|
|
1852
1877
|
{
|
|
1853
1878
|
ref,
|
|
@@ -1866,16 +1891,16 @@ var PopoverContentImpl = React20.forwardRef(
|
|
|
1866
1891
|
}
|
|
1867
1892
|
);
|
|
1868
1893
|
PopoverContentImpl.displayName = "PopoverContentImpl";
|
|
1869
|
-
var PopoverContent =
|
|
1894
|
+
var PopoverContent = React21.forwardRef((props, ref) => /* @__PURE__ */ jsx23(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx23(PopoverContentImpl, { ...props, ref }) }));
|
|
1870
1895
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1871
1896
|
|
|
1872
1897
|
// src/components/AdsPopover/index.tsx
|
|
1873
|
-
import { jsx as
|
|
1898
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1874
1899
|
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]";
|
|
1875
1900
|
var AdsPopover = Popover;
|
|
1876
1901
|
var AdsPopoverTrigger = PopoverTrigger;
|
|
1877
|
-
var AdsPopoverContent =
|
|
1878
|
-
({ align = "center", className, inset = false, sideOffset = 8, ...props }, ref) => /* @__PURE__ */
|
|
1902
|
+
var AdsPopoverContent = React22.forwardRef(
|
|
1903
|
+
({ align = "center", className, inset = false, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1879
1904
|
PopoverContent,
|
|
1880
1905
|
{
|
|
1881
1906
|
align,
|
|
@@ -1891,10 +1916,10 @@ var AdsPopoverContent = React21.forwardRef(
|
|
|
1891
1916
|
)
|
|
1892
1917
|
);
|
|
1893
1918
|
AdsPopoverContent.displayName = "AdsPopoverContent";
|
|
1894
|
-
var AdsPopoverHeader =
|
|
1919
|
+
var AdsPopoverHeader = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-sm", className), ref, ...props }));
|
|
1895
1920
|
AdsPopoverHeader.displayName = "AdsPopoverHeader";
|
|
1896
|
-
var AdsPopoverBody =
|
|
1897
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1921
|
+
var AdsPopoverBody = React22.forwardRef(
|
|
1922
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1898
1923
|
"div",
|
|
1899
1924
|
{
|
|
1900
1925
|
className: cn("mt-md flex flex-col gap-md", className),
|
|
@@ -1904,7 +1929,7 @@ var AdsPopoverBody = React21.forwardRef(
|
|
|
1904
1929
|
)
|
|
1905
1930
|
);
|
|
1906
1931
|
AdsPopoverBody.displayName = "AdsPopoverBody";
|
|
1907
|
-
var AdsPopoverTitle =
|
|
1932
|
+
var AdsPopoverTitle = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1908
1933
|
"h4",
|
|
1909
1934
|
{
|
|
1910
1935
|
className: cn(
|
|
@@ -1917,7 +1942,7 @@ var AdsPopoverTitle = React21.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1917
1942
|
}
|
|
1918
1943
|
));
|
|
1919
1944
|
AdsPopoverTitle.displayName = "AdsPopoverTitle";
|
|
1920
|
-
var AdsPopoverDescription =
|
|
1945
|
+
var AdsPopoverDescription = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1921
1946
|
"p",
|
|
1922
1947
|
{
|
|
1923
1948
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -1928,7 +1953,7 @@ var AdsPopoverDescription = React21.forwardRef(({ className, ...props }, ref) =>
|
|
|
1928
1953
|
AdsPopoverDescription.displayName = "AdsPopoverDescription";
|
|
1929
1954
|
|
|
1930
1955
|
// src/primitives/calendar.tsx
|
|
1931
|
-
import * as
|
|
1956
|
+
import * as React24 from "react";
|
|
1932
1957
|
import {
|
|
1933
1958
|
DayFlag,
|
|
1934
1959
|
DayPicker as GregorianDayPicker,
|
|
@@ -1946,11 +1971,11 @@ import {
|
|
|
1946
1971
|
} from "@daypicker/persian";
|
|
1947
1972
|
|
|
1948
1973
|
// src/primitives/select.tsx
|
|
1949
|
-
import * as
|
|
1974
|
+
import * as React23 from "react";
|
|
1950
1975
|
import * as DismissableLayerPrimitive from "@radix-ui/react-dismissable-layer";
|
|
1951
1976
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1952
1977
|
import { Check as Check2, ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
1953
|
-
import { jsx as
|
|
1978
|
+
import { jsx as jsx25, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1954
1979
|
function Select({
|
|
1955
1980
|
defaultOpen,
|
|
1956
1981
|
onOpenChange,
|
|
@@ -1958,11 +1983,11 @@ function Select({
|
|
|
1958
1983
|
...props
|
|
1959
1984
|
}) {
|
|
1960
1985
|
const isControlled = openProp !== void 0;
|
|
1961
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
1986
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React23.useState(
|
|
1962
1987
|
defaultOpen ?? false
|
|
1963
1988
|
);
|
|
1964
1989
|
const resolvedOpen = isControlled ? openProp : uncontrolledOpen;
|
|
1965
|
-
const handleOpenChange =
|
|
1990
|
+
const handleOpenChange = React23.useCallback(
|
|
1966
1991
|
(nextOpen) => {
|
|
1967
1992
|
if (!isControlled) {
|
|
1968
1993
|
setUncontrolledOpen(nextOpen);
|
|
@@ -1971,11 +1996,11 @@ function Select({
|
|
|
1971
1996
|
},
|
|
1972
1997
|
[isControlled, onOpenChange]
|
|
1973
1998
|
);
|
|
1974
|
-
const handleNestedDismiss =
|
|
1999
|
+
const handleNestedDismiss = React23.useCallback(() => {
|
|
1975
2000
|
handleOpenChange(false);
|
|
1976
2001
|
}, [handleOpenChange]);
|
|
1977
2002
|
useNestedDismissableLayer(resolvedOpen, handleNestedDismiss);
|
|
1978
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsx25(
|
|
1979
2004
|
SelectPrimitive.Root,
|
|
1980
2005
|
{
|
|
1981
2006
|
...props,
|
|
@@ -1988,7 +2013,7 @@ function Select({
|
|
|
1988
2013
|
Select.displayName = SelectPrimitive.Root.displayName;
|
|
1989
2014
|
var SelectGroup = SelectPrimitive.Group;
|
|
1990
2015
|
var SelectValue = SelectPrimitive.Value;
|
|
1991
|
-
var SelectTrigger =
|
|
2016
|
+
var SelectTrigger = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
1992
2017
|
SelectPrimitive.Trigger,
|
|
1993
2018
|
{
|
|
1994
2019
|
ref,
|
|
@@ -1999,12 +2024,12 @@ var SelectTrigger = React22.forwardRef(({ className, children, ...props }, ref)
|
|
|
1999
2024
|
...props,
|
|
2000
2025
|
children: [
|
|
2001
2026
|
children,
|
|
2002
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ jsx25(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx25(ChevronDown2, { className: "h-4 w-4 opacity-50" }) })
|
|
2003
2028
|
]
|
|
2004
2029
|
}
|
|
2005
2030
|
));
|
|
2006
2031
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2007
|
-
var SelectScrollUpButton =
|
|
2032
|
+
var SelectScrollUpButton = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2008
2033
|
SelectPrimitive.ScrollUpButton,
|
|
2009
2034
|
{
|
|
2010
2035
|
ref,
|
|
@@ -2013,11 +2038,11 @@ var SelectScrollUpButton = React22.forwardRef(({ className, ...props }, ref) =>
|
|
|
2013
2038
|
className
|
|
2014
2039
|
),
|
|
2015
2040
|
...props,
|
|
2016
|
-
children: /* @__PURE__ */
|
|
2041
|
+
children: /* @__PURE__ */ jsx25(ChevronUp, { className: "h-4 w-4" })
|
|
2017
2042
|
}
|
|
2018
2043
|
));
|
|
2019
2044
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2020
|
-
var SelectScrollDownButton =
|
|
2045
|
+
var SelectScrollDownButton = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2021
2046
|
SelectPrimitive.ScrollDownButton,
|
|
2022
2047
|
{
|
|
2023
2048
|
ref,
|
|
@@ -2026,11 +2051,11 @@ var SelectScrollDownButton = React22.forwardRef(({ className, ...props }, ref) =
|
|
|
2026
2051
|
className
|
|
2027
2052
|
),
|
|
2028
2053
|
...props,
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ jsx25(ChevronDown2, { className: "h-4 w-4" })
|
|
2030
2055
|
}
|
|
2031
2056
|
));
|
|
2032
2057
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
2033
|
-
var SelectContent =
|
|
2058
|
+
var SelectContent = React23.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx25(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx25(DismissableLayerPrimitive.Branch, { asChild: true, children: /* @__PURE__ */ jsxs10(
|
|
2034
2059
|
SelectPrimitive.Content,
|
|
2035
2060
|
{
|
|
2036
2061
|
ref,
|
|
@@ -2042,8 +2067,8 @@ var SelectContent = React22.forwardRef(({ className, children, position = "poppe
|
|
|
2042
2067
|
position,
|
|
2043
2068
|
...props,
|
|
2044
2069
|
children: [
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsx25(SelectScrollUpButton, {}),
|
|
2071
|
+
/* @__PURE__ */ jsx25(
|
|
2047
2072
|
SelectPrimitive.Viewport,
|
|
2048
2073
|
{
|
|
2049
2074
|
className: cn(
|
|
@@ -2053,12 +2078,12 @@ var SelectContent = React22.forwardRef(({ className, children, position = "poppe
|
|
|
2053
2078
|
children
|
|
2054
2079
|
}
|
|
2055
2080
|
),
|
|
2056
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ jsx25(SelectScrollDownButton, {})
|
|
2057
2082
|
]
|
|
2058
2083
|
}
|
|
2059
2084
|
) }) }));
|
|
2060
2085
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2061
|
-
var SelectLabel =
|
|
2086
|
+
var SelectLabel = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2062
2087
|
SelectPrimitive.Label,
|
|
2063
2088
|
{
|
|
2064
2089
|
ref,
|
|
@@ -2067,7 +2092,7 @@ var SelectLabel = React22.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2067
2092
|
}
|
|
2068
2093
|
));
|
|
2069
2094
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2070
|
-
var SelectItem =
|
|
2095
|
+
var SelectItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
2071
2096
|
SelectPrimitive.Item,
|
|
2072
2097
|
{
|
|
2073
2098
|
ref,
|
|
@@ -2077,13 +2102,13 @@ var SelectItem = React22.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2077
2102
|
),
|
|
2078
2103
|
...props,
|
|
2079
2104
|
children: [
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ jsx25("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx25(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx25(Check2, { className: "h-4 w-4" }) }) }),
|
|
2106
|
+
/* @__PURE__ */ jsx25(SelectPrimitive.ItemText, { children })
|
|
2082
2107
|
]
|
|
2083
2108
|
}
|
|
2084
2109
|
));
|
|
2085
2110
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2086
|
-
var SelectSeparator =
|
|
2111
|
+
var SelectSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2087
2112
|
SelectPrimitive.Separator,
|
|
2088
2113
|
{
|
|
2089
2114
|
ref,
|
|
@@ -2094,7 +2119,7 @@ var SelectSeparator = React22.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
2094
2119
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2095
2120
|
|
|
2096
2121
|
// src/primitives/calendar.tsx
|
|
2097
|
-
import { jsx as
|
|
2122
|
+
import { jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2098
2123
|
var cellSizeClasses = {
|
|
2099
2124
|
md: {
|
|
2100
2125
|
cell: "size-8",
|
|
@@ -2163,7 +2188,7 @@ function CalendarDropdown({
|
|
|
2163
2188
|
}) {
|
|
2164
2189
|
const { classNames, styles } = useDayPicker();
|
|
2165
2190
|
const selectedValue = value?.toString();
|
|
2166
|
-
return /* @__PURE__ */
|
|
2191
|
+
return /* @__PURE__ */ jsx26(
|
|
2167
2192
|
"span",
|
|
2168
2193
|
{
|
|
2169
2194
|
className: classNames[UI.DropdownRoot],
|
|
@@ -2180,7 +2205,7 @@ function CalendarDropdown({
|
|
|
2180
2205
|
},
|
|
2181
2206
|
value: selectedValue,
|
|
2182
2207
|
children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ jsx26(
|
|
2184
2209
|
SelectTrigger,
|
|
2185
2210
|
{
|
|
2186
2211
|
"aria-label": ariaLabel,
|
|
@@ -2190,10 +2215,10 @@ function CalendarDropdown({
|
|
|
2190
2215
|
className
|
|
2191
2216
|
),
|
|
2192
2217
|
style,
|
|
2193
|
-
children: /* @__PURE__ */
|
|
2218
|
+
children: /* @__PURE__ */ jsx26(SelectValue, {})
|
|
2194
2219
|
}
|
|
2195
2220
|
),
|
|
2196
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ jsx26(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__ */ jsx26(
|
|
2197
2222
|
SelectItem,
|
|
2198
2223
|
{
|
|
2199
2224
|
disabled: option.disabled,
|
|
@@ -2208,7 +2233,7 @@ function CalendarDropdown({
|
|
|
2208
2233
|
}
|
|
2209
2234
|
);
|
|
2210
2235
|
}
|
|
2211
|
-
var Calendar =
|
|
2236
|
+
var Calendar = React24.forwardRef(
|
|
2212
2237
|
({
|
|
2213
2238
|
captionLayout,
|
|
2214
2239
|
calendarSystem = "gregorian",
|
|
@@ -2220,7 +2245,7 @@ var Calendar = React23.forwardRef(
|
|
|
2220
2245
|
showOutsideDays = true,
|
|
2221
2246
|
...props
|
|
2222
2247
|
}, ref) => {
|
|
2223
|
-
const mergedClassNames =
|
|
2248
|
+
const mergedClassNames = React24.useMemo(
|
|
2224
2249
|
() => ({
|
|
2225
2250
|
...getCalendarClassNames(cellSize, captionLayout?.startsWith("dropdown") ?? false),
|
|
2226
2251
|
...classNames
|
|
@@ -2241,7 +2266,7 @@ var Calendar = React23.forwardRef(
|
|
|
2241
2266
|
showOutsideDays
|
|
2242
2267
|
};
|
|
2243
2268
|
if (calendarSystem === "persian") {
|
|
2244
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx26("div", { ref, children: /* @__PURE__ */ jsx26(
|
|
2245
2270
|
PersianDayPicker,
|
|
2246
2271
|
{
|
|
2247
2272
|
...sharedProps,
|
|
@@ -2252,7 +2277,7 @@ var Calendar = React23.forwardRef(
|
|
|
2252
2277
|
) });
|
|
2253
2278
|
}
|
|
2254
2279
|
if (calendarSystem === "hijri") {
|
|
2255
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsx26("div", { ref, children: /* @__PURE__ */ jsx26(
|
|
2256
2281
|
HijriDayPicker,
|
|
2257
2282
|
{
|
|
2258
2283
|
...sharedProps,
|
|
@@ -2262,13 +2287,13 @@ var Calendar = React23.forwardRef(
|
|
|
2262
2287
|
}
|
|
2263
2288
|
) });
|
|
2264
2289
|
}
|
|
2265
|
-
return /* @__PURE__ */
|
|
2290
|
+
return /* @__PURE__ */ jsx26("div", { ref, children: /* @__PURE__ */ jsx26(GregorianDayPicker, { ...sharedProps }) });
|
|
2266
2291
|
}
|
|
2267
2292
|
);
|
|
2268
2293
|
Calendar.displayName = "Calendar";
|
|
2269
2294
|
|
|
2270
2295
|
// src/components/AdsCalendar/index.tsx
|
|
2271
|
-
import { jsx as
|
|
2296
|
+
import { jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2272
2297
|
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";
|
|
2273
2298
|
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)]";
|
|
2274
2299
|
function useControllableDate({
|
|
@@ -2276,12 +2301,12 @@ function useControllableDate({
|
|
|
2276
2301
|
onSelect,
|
|
2277
2302
|
selected
|
|
2278
2303
|
}) {
|
|
2279
|
-
const [internalSelected, setInternalSelected] =
|
|
2304
|
+
const [internalSelected, setInternalSelected] = React25.useState(
|
|
2280
2305
|
defaultSelected
|
|
2281
2306
|
);
|
|
2282
2307
|
const isControlled = selected !== void 0;
|
|
2283
2308
|
const value = isControlled ? selected : internalSelected;
|
|
2284
|
-
const handleSelect =
|
|
2309
|
+
const handleSelect = React25.useCallback(
|
|
2285
2310
|
(nextValue) => {
|
|
2286
2311
|
if (!isControlled) {
|
|
2287
2312
|
setInternalSelected(nextValue);
|
|
@@ -2298,11 +2323,11 @@ function getDateLabel(value, formatter) {
|
|
|
2298
2323
|
}
|
|
2299
2324
|
return formatter ? formatter(value) : format(value, "MMM d, yyyy");
|
|
2300
2325
|
}
|
|
2301
|
-
var AdsCalendar =
|
|
2302
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2326
|
+
var AdsCalendar = React25.forwardRef(
|
|
2327
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx27(Calendar, { className: cn(className), ref, ...props })
|
|
2303
2328
|
);
|
|
2304
2329
|
AdsCalendar.displayName = "AdsCalendar";
|
|
2305
|
-
var AdsDatePicker =
|
|
2330
|
+
var AdsDatePicker = React25.forwardRef(
|
|
2306
2331
|
({
|
|
2307
2332
|
className,
|
|
2308
2333
|
defaultSelected,
|
|
@@ -2315,7 +2340,7 @@ var AdsDatePicker = React24.forwardRef(
|
|
|
2315
2340
|
triggerClassName,
|
|
2316
2341
|
...calendarProps
|
|
2317
2342
|
}, ref) => {
|
|
2318
|
-
const [open, setOpen] =
|
|
2343
|
+
const [open, setOpen] = React25.useState(false);
|
|
2319
2344
|
const [value, handleSelect] = useControllableDate({
|
|
2320
2345
|
defaultSelected,
|
|
2321
2346
|
onSelect,
|
|
@@ -2323,7 +2348,7 @@ var AdsDatePicker = React24.forwardRef(
|
|
|
2323
2348
|
});
|
|
2324
2349
|
const description = useAdsFieldDescription({ id });
|
|
2325
2350
|
const labelText = getDateLabel(value, formatDateLabel) ?? placeholder;
|
|
2326
|
-
const onCalendarSelect =
|
|
2351
|
+
const onCalendarSelect = React25.useCallback(
|
|
2327
2352
|
(nextValue) => {
|
|
2328
2353
|
handleSelect(nextValue);
|
|
2329
2354
|
setOpen(false);
|
|
@@ -2331,9 +2356,9 @@ var AdsDatePicker = React24.forwardRef(
|
|
|
2331
2356
|
[handleSelect]
|
|
2332
2357
|
);
|
|
2333
2358
|
return /* @__PURE__ */ jsxs12(AdsFieldItem, { className: cn("gap-3", className), ref, children: [
|
|
2334
|
-
label ? /* @__PURE__ */
|
|
2359
|
+
label ? /* @__PURE__ */ jsx27(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
2335
2360
|
/* @__PURE__ */ jsxs12(AdsPopover, { onOpenChange: setOpen, open, children: [
|
|
2336
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx27(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
2337
2362
|
Button,
|
|
2338
2363
|
{
|
|
2339
2364
|
"aria-label": labelText,
|
|
@@ -2346,12 +2371,12 @@ var AdsDatePicker = React24.forwardRef(
|
|
|
2346
2371
|
id: description.inputId,
|
|
2347
2372
|
type: "button",
|
|
2348
2373
|
children: [
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2374
|
+
/* @__PURE__ */ jsx27("span", { className: "truncate", children: labelText }),
|
|
2375
|
+
/* @__PURE__ */ jsx27(ChevronDown3, { "aria-hidden": true, className: "size-4 shrink-0 text-icon-muted" })
|
|
2351
2376
|
]
|
|
2352
2377
|
}
|
|
2353
2378
|
) }),
|
|
2354
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx27(AdsPopoverContent, { className: "w-auto p-0", inset: true, sideOffset: 4, children: /* @__PURE__ */ jsx27(
|
|
2355
2380
|
AdsCalendar,
|
|
2356
2381
|
{
|
|
2357
2382
|
...calendarProps,
|
|
@@ -2365,7 +2390,7 @@ var AdsDatePicker = React24.forwardRef(
|
|
|
2365
2390
|
}
|
|
2366
2391
|
);
|
|
2367
2392
|
AdsDatePicker.displayName = "AdsDatePicker";
|
|
2368
|
-
var AdsDateTimePicker =
|
|
2393
|
+
var AdsDateTimePicker = React25.forwardRef(
|
|
2369
2394
|
({
|
|
2370
2395
|
className,
|
|
2371
2396
|
timeLabel = "Time",
|
|
@@ -2373,10 +2398,10 @@ var AdsDateTimePicker = React24.forwardRef(
|
|
|
2373
2398
|
onTimeChange,
|
|
2374
2399
|
...props
|
|
2375
2400
|
}, ref) => /* @__PURE__ */ jsxs12("div", { className: cn("flex flex-wrap items-start gap-4", className), ref, children: [
|
|
2376
|
-
/* @__PURE__ */
|
|
2401
|
+
/* @__PURE__ */ jsx27(AdsDatePicker, { className: "w-[min(100%,135px)]", ...props }),
|
|
2377
2402
|
/* @__PURE__ */ jsxs12(AdsFieldItem, { className: "w-[91px] gap-3", children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ jsx27(AdsFieldLabel, { children: timeLabel }),
|
|
2404
|
+
/* @__PURE__ */ jsx27(
|
|
2380
2405
|
Input,
|
|
2381
2406
|
{
|
|
2382
2407
|
className: timeInputClassName,
|
|
@@ -2392,13 +2417,13 @@ var AdsDateTimePicker = React24.forwardRef(
|
|
|
2392
2417
|
AdsDateTimePicker.displayName = "AdsDateTimePicker";
|
|
2393
2418
|
|
|
2394
2419
|
// src/components/AdsButtonGroup/index.tsx
|
|
2395
|
-
import * as
|
|
2396
|
-
import { Slot as
|
|
2420
|
+
import * as React26 from "react";
|
|
2421
|
+
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
2397
2422
|
|
|
2398
2423
|
// src/primitives/button-group.tsx
|
|
2399
|
-
import { Slot as
|
|
2424
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
2400
2425
|
import { cva as cva8 } from "class-variance-authority";
|
|
2401
|
-
import { jsx as
|
|
2426
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2402
2427
|
var buttonGroupVariants = cva8(
|
|
2403
2428
|
"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",
|
|
2404
2429
|
{
|
|
@@ -2418,7 +2443,7 @@ function ButtonGroupSeparator({
|
|
|
2418
2443
|
orientation = "vertical",
|
|
2419
2444
|
...props
|
|
2420
2445
|
}) {
|
|
2421
|
-
return /* @__PURE__ */
|
|
2446
|
+
return /* @__PURE__ */ jsx28(
|
|
2422
2447
|
Separator,
|
|
2423
2448
|
{
|
|
2424
2449
|
"data-slot": "button-group-separator",
|
|
@@ -2437,7 +2462,7 @@ function ButtonGroupSeparator({
|
|
|
2437
2462
|
}
|
|
2438
2463
|
|
|
2439
2464
|
// src/components/AdsButtonGroup/index.tsx
|
|
2440
|
-
import { jsx as
|
|
2465
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2441
2466
|
var buttonGroupPressClassName = "[&_button]:transition-[background-color,box-shadow,filter] [&_button]:active:translate-y-0 [&_button]:active:brightness-95";
|
|
2442
2467
|
var segmentSizeClassName = {
|
|
2443
2468
|
sm: "h-8 px-md text-sm",
|
|
@@ -2445,14 +2470,14 @@ var segmentSizeClassName = {
|
|
|
2445
2470
|
lg: "h-10 px-xl text-base"
|
|
2446
2471
|
};
|
|
2447
2472
|
function isAdsButtonElement(child) {
|
|
2448
|
-
return
|
|
2473
|
+
return React26.isValidElement(child) && child.type === AdsButton;
|
|
2449
2474
|
}
|
|
2450
2475
|
function enhanceChildren(children, attached, size, surface) {
|
|
2451
|
-
return
|
|
2476
|
+
return React26.Children.map(children, (child) => {
|
|
2452
2477
|
if (!isAdsButtonElement(child)) {
|
|
2453
2478
|
return child;
|
|
2454
2479
|
}
|
|
2455
|
-
return
|
|
2480
|
+
return React26.cloneElement(child, {
|
|
2456
2481
|
className: cn(
|
|
2457
2482
|
attached && "rounded-none shadow-none",
|
|
2458
2483
|
attached && surface === "secondary" && "bg-secondary hover:bg-secondary/90",
|
|
@@ -2462,7 +2487,7 @@ function enhanceChildren(children, attached, size, surface) {
|
|
|
2462
2487
|
});
|
|
2463
2488
|
});
|
|
2464
2489
|
}
|
|
2465
|
-
var AdsButtonGroup =
|
|
2490
|
+
var AdsButtonGroup = React26.forwardRef(
|
|
2466
2491
|
({
|
|
2467
2492
|
attached = true,
|
|
2468
2493
|
children,
|
|
@@ -2481,7 +2506,7 @@ var AdsButtonGroup = React25.forwardRef(
|
|
|
2481
2506
|
buttonGroupVariants({ orientation }),
|
|
2482
2507
|
surface === "pill" ? "rounded-full" : "rounded-radius-md"
|
|
2483
2508
|
);
|
|
2484
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx29(
|
|
2485
2510
|
"div",
|
|
2486
2511
|
{
|
|
2487
2512
|
"aria-orientation": orientation,
|
|
@@ -2523,7 +2548,7 @@ var inputSizeClassName = {
|
|
|
2523
2548
|
md: "h-9 text-sm leading-5",
|
|
2524
2549
|
lg: "h-10 text-base leading-6"
|
|
2525
2550
|
};
|
|
2526
|
-
var AdsButtonGroupText =
|
|
2551
|
+
var AdsButtonGroupText = React26.forwardRef(
|
|
2527
2552
|
({
|
|
2528
2553
|
align = "start",
|
|
2529
2554
|
asChild = false,
|
|
@@ -2533,8 +2558,8 @@ var AdsButtonGroupText = React25.forwardRef(
|
|
|
2533
2558
|
tone = "default",
|
|
2534
2559
|
...props
|
|
2535
2560
|
}, ref) => {
|
|
2536
|
-
const Comp = asChild ?
|
|
2537
|
-
return /* @__PURE__ */
|
|
2561
|
+
const Comp = asChild ? Slot5 : "div";
|
|
2562
|
+
return /* @__PURE__ */ jsx29(
|
|
2538
2563
|
Comp,
|
|
2539
2564
|
{
|
|
2540
2565
|
className: cn(
|
|
@@ -2554,7 +2579,7 @@ var AdsButtonGroupText = React25.forwardRef(
|
|
|
2554
2579
|
}
|
|
2555
2580
|
);
|
|
2556
2581
|
AdsButtonGroupText.displayName = "AdsButtonGroupText";
|
|
2557
|
-
var AdsButtonGroupInput =
|
|
2582
|
+
var AdsButtonGroupInput = React26.forwardRef(({ className, size = "md", type = "text", ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
2558
2583
|
Input,
|
|
2559
2584
|
{
|
|
2560
2585
|
className: cn(
|
|
@@ -2571,13 +2596,13 @@ AdsButtonGroupInput.displayName = "AdsButtonGroupInput";
|
|
|
2571
2596
|
var AdsButtonGroupSeparator = ButtonGroupSeparator;
|
|
2572
2597
|
|
|
2573
2598
|
// src/components/AdsSeparator/index.tsx
|
|
2574
|
-
import * as
|
|
2575
|
-
import { jsx as
|
|
2599
|
+
import * as React27 from "react";
|
|
2600
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2576
2601
|
var toneClassName2 = {
|
|
2577
2602
|
default: "bg-border",
|
|
2578
2603
|
muted: "bg-border-muted"
|
|
2579
2604
|
};
|
|
2580
|
-
var AdsSeparator =
|
|
2605
|
+
var AdsSeparator = React27.forwardRef(({ className, orientation = "horizontal", tone = "default", ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
2581
2606
|
Separator,
|
|
2582
2607
|
{
|
|
2583
2608
|
className: cn(
|
|
@@ -2594,13 +2619,13 @@ var AdsSeparator = React26.forwardRef(({ className, orientation = "horizontal",
|
|
|
2594
2619
|
AdsSeparator.displayName = "AdsSeparator";
|
|
2595
2620
|
|
|
2596
2621
|
// src/components/AdsSkeleton/index.tsx
|
|
2597
|
-
import * as
|
|
2622
|
+
import * as React29 from "react";
|
|
2598
2623
|
|
|
2599
2624
|
// src/primitives/skeleton.tsx
|
|
2600
|
-
import * as
|
|
2601
|
-
import { jsx as
|
|
2602
|
-
var Skeleton =
|
|
2603
|
-
({ animated = true, className, ...props }, ref) => /* @__PURE__ */
|
|
2625
|
+
import * as React28 from "react";
|
|
2626
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2627
|
+
var Skeleton = React28.forwardRef(
|
|
2628
|
+
({ animated = true, className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
2604
2629
|
"div",
|
|
2605
2630
|
{
|
|
2606
2631
|
className: cn(
|
|
@@ -2616,7 +2641,7 @@ var Skeleton = React27.forwardRef(
|
|
|
2616
2641
|
Skeleton.displayName = "Skeleton";
|
|
2617
2642
|
|
|
2618
2643
|
// src/components/AdsSkeleton/index.tsx
|
|
2619
|
-
import { jsx as
|
|
2644
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2620
2645
|
var shapeClassName = {
|
|
2621
2646
|
default: "rounded-radius-md",
|
|
2622
2647
|
line: "h-4 w-full rounded-full",
|
|
@@ -2626,8 +2651,8 @@ var toneClassName3 = {
|
|
|
2626
2651
|
default: "bg-secondary",
|
|
2627
2652
|
muted: "bg-accent"
|
|
2628
2653
|
};
|
|
2629
|
-
var AdsSkeleton =
|
|
2630
|
-
({ className, shape = "default", tone = "default", ...props }, ref) => /* @__PURE__ */
|
|
2654
|
+
var AdsSkeleton = React29.forwardRef(
|
|
2655
|
+
({ className, shape = "default", tone = "default", ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
2631
2656
|
Skeleton,
|
|
2632
2657
|
{
|
|
2633
2658
|
className: cn(shapeClassName[shape], toneClassName3[tone], className),
|
|
@@ -2639,39 +2664,33 @@ var AdsSkeleton = React28.forwardRef(
|
|
|
2639
2664
|
AdsSkeleton.displayName = "AdsSkeleton";
|
|
2640
2665
|
|
|
2641
2666
|
// src/components/AdsInput/index.tsx
|
|
2642
|
-
import * as
|
|
2643
|
-
import { Upload } from "lucide-react";
|
|
2667
|
+
import * as React31 from "react";
|
|
2644
2668
|
|
|
2645
2669
|
// src/lib/adsClearButton.tsx
|
|
2646
|
-
import * as
|
|
2670
|
+
import * as React30 from "react";
|
|
2647
2671
|
import { X } from "lucide-react";
|
|
2648
|
-
import { jsx as
|
|
2672
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2649
2673
|
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";
|
|
2650
|
-
var AdsClearButton =
|
|
2674
|
+
var AdsClearButton = React30.forwardRef(({ className, type = "button", ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2651
2675
|
"button",
|
|
2652
2676
|
{
|
|
2653
2677
|
...props,
|
|
2654
2678
|
className: cn(adsClearButtonClassName, "h-4 w-4", className),
|
|
2655
2679
|
ref,
|
|
2656
2680
|
type,
|
|
2657
|
-
children: /* @__PURE__ */
|
|
2681
|
+
children: /* @__PURE__ */ jsx33(X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
2658
2682
|
}
|
|
2659
2683
|
));
|
|
2660
2684
|
AdsClearButton.displayName = "AdsClearButton";
|
|
2661
2685
|
|
|
2662
2686
|
// src/components/AdsInput/index.tsx
|
|
2663
|
-
import { jsx as
|
|
2664
|
-
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:
|
|
2687
|
+
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2688
|
+
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";
|
|
2665
2689
|
var inputSizeClasses = {
|
|
2666
2690
|
sm: "h-8 text-sm leading-5",
|
|
2667
2691
|
md: "h-9 text-base leading-6",
|
|
2668
2692
|
lg: "h-10 text-base leading-6"
|
|
2669
2693
|
};
|
|
2670
|
-
var fileTriggerSizeClasses = {
|
|
2671
|
-
sm: "h-8 px-md py-sm",
|
|
2672
|
-
md: "h-9 px-lg py-sm",
|
|
2673
|
-
lg: "h-10 px-xl py-[10px]"
|
|
2674
|
-
};
|
|
2675
2694
|
function assignInputRef(ref, value) {
|
|
2676
2695
|
if (typeof ref === "function") {
|
|
2677
2696
|
ref(value);
|
|
@@ -2690,17 +2709,6 @@ function getTextInputValue(value) {
|
|
|
2690
2709
|
}
|
|
2691
2710
|
return "";
|
|
2692
2711
|
}
|
|
2693
|
-
function renderFileTriggerIcon(icon) {
|
|
2694
|
-
if (!icon) {
|
|
2695
|
-
return null;
|
|
2696
|
-
}
|
|
2697
|
-
if (React30.isValidElement(icon)) {
|
|
2698
|
-
return React30.cloneElement(icon, {
|
|
2699
|
-
className: cn("!h-4 !w-4 h-4 w-4", icon.props.className)
|
|
2700
|
-
});
|
|
2701
|
-
}
|
|
2702
|
-
return icon;
|
|
2703
|
-
}
|
|
2704
2712
|
function getInputSurfaceClassName({
|
|
2705
2713
|
className,
|
|
2706
2714
|
errorText,
|
|
@@ -2718,7 +2726,7 @@ function getInputSurfaceClassName({
|
|
|
2718
2726
|
className
|
|
2719
2727
|
);
|
|
2720
2728
|
}
|
|
2721
|
-
var AdsInput =
|
|
2729
|
+
var AdsInput = React31.forwardRef(
|
|
2722
2730
|
({
|
|
2723
2731
|
action,
|
|
2724
2732
|
className,
|
|
@@ -2727,7 +2735,6 @@ var AdsInput = React30.forwardRef(
|
|
|
2727
2735
|
descriptionPlacement = "below",
|
|
2728
2736
|
emptyFileLabel,
|
|
2729
2737
|
errorText,
|
|
2730
|
-
fileTriggerIcon = /* @__PURE__ */ jsx33(Upload, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
2731
2738
|
fileTriggerLabel,
|
|
2732
2739
|
helperText,
|
|
2733
2740
|
id,
|
|
@@ -2741,9 +2748,9 @@ var AdsInput = React30.forwardRef(
|
|
|
2741
2748
|
...props
|
|
2742
2749
|
}, ref) => {
|
|
2743
2750
|
const { messages } = useAdsI18n();
|
|
2744
|
-
const inputRef =
|
|
2745
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2746
|
-
const [currentValue, setCurrentValue] =
|
|
2751
|
+
const inputRef = React31.useRef(null);
|
|
2752
|
+
const [selectedFiles, setSelectedFiles] = React31.useState([]);
|
|
2753
|
+
const [currentValue, setCurrentValue] = React31.useState(
|
|
2747
2754
|
() => getTextInputValue(props.value ?? props.defaultValue)
|
|
2748
2755
|
);
|
|
2749
2756
|
const description = useAdsFieldDescription({
|
|
@@ -2752,7 +2759,7 @@ var AdsInput = React30.forwardRef(
|
|
|
2752
2759
|
helperText,
|
|
2753
2760
|
id
|
|
2754
2761
|
});
|
|
2755
|
-
|
|
2762
|
+
React31.useEffect(() => {
|
|
2756
2763
|
if (props.value !== void 0) {
|
|
2757
2764
|
setCurrentValue(getTextInputValue(props.value));
|
|
2758
2765
|
}
|
|
@@ -2768,9 +2775,8 @@ var AdsInput = React30.forwardRef(
|
|
|
2768
2775
|
});
|
|
2769
2776
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.input.clear;
|
|
2770
2777
|
const resolvedFileTriggerLabel = fileTriggerLabel ?? messages.input.chooseFile;
|
|
2771
|
-
const resolvedFileTriggerIcon = renderFileTriggerIcon(fileTriggerIcon);
|
|
2772
2778
|
const resolvedEmptyFileLabel = emptyFileLabel ?? messages.input.noFileChosen;
|
|
2773
|
-
const handleChange =
|
|
2779
|
+
const handleChange = React31.useCallback(
|
|
2774
2780
|
(event) => {
|
|
2775
2781
|
setCurrentValue(event.target.value);
|
|
2776
2782
|
if (isFileInput) {
|
|
@@ -2782,7 +2788,7 @@ var AdsInput = React30.forwardRef(
|
|
|
2782
2788
|
},
|
|
2783
2789
|
[isFileInput, onChange]
|
|
2784
2790
|
);
|
|
2785
|
-
const handleClear =
|
|
2791
|
+
const handleClear = React31.useCallback(() => {
|
|
2786
2792
|
const element = inputRef.current;
|
|
2787
2793
|
if (!element) {
|
|
2788
2794
|
return;
|
|
@@ -2797,10 +2803,10 @@ var AdsInput = React30.forwardRef(
|
|
|
2797
2803
|
onClear?.();
|
|
2798
2804
|
}, [onClear]);
|
|
2799
2805
|
const fileNameText = selectedFiles.length > 0 ? selectedFiles.join(", ") : resolvedEmptyFileLabel;
|
|
2800
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
2801
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
2802
|
-
const inputNode = isFileInput ? /* @__PURE__ */ jsxs13("div", { className: "
|
|
2803
|
-
/* @__PURE__ */
|
|
2806
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx34(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
2807
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx34(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
2808
|
+
const inputNode = isFileInput ? /* @__PURE__ */ jsxs13("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2809
|
+
/* @__PURE__ */ jsx34(
|
|
2804
2810
|
Input,
|
|
2805
2811
|
{
|
|
2806
2812
|
"aria-describedby": description.describedBy,
|
|
@@ -2825,26 +2831,23 @@ var AdsInput = React30.forwardRef(
|
|
|
2825
2831
|
{
|
|
2826
2832
|
"aria-hidden": "true",
|
|
2827
2833
|
className: cn(
|
|
2828
|
-
|
|
2834
|
+
inputSurfaceClassName,
|
|
2835
|
+
adsTextColorClassName.card,
|
|
2836
|
+
"items-center text-sm leading-5",
|
|
2829
2837
|
props.disabled ? "cursor-not-allowed opacity-50" : void 0
|
|
2830
2838
|
),
|
|
2831
2839
|
children: [
|
|
2832
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ jsx34(
|
|
2833
2841
|
"span",
|
|
2834
2842
|
{
|
|
2835
|
-
"data-ads-file-trigger": "",
|
|
2836
2843
|
className: cn(
|
|
2837
|
-
"
|
|
2838
|
-
|
|
2839
|
-
adsTextColorClassName.primary
|
|
2844
|
+
"shrink-0 pr-sm text-sm font-medium leading-5",
|
|
2845
|
+
adsTextColorClassName.card
|
|
2840
2846
|
),
|
|
2841
|
-
children:
|
|
2842
|
-
resolvedFileTriggerIcon ? /* @__PURE__ */ jsx33("span", { className: "inline-flex h-4 w-4 items-center justify-center [&>svg]:!h-4 [&>svg]:!w-4", children: resolvedFileTriggerIcon }) : null,
|
|
2843
|
-
resolvedFileTriggerLabel
|
|
2844
|
-
]
|
|
2847
|
+
children: resolvedFileTriggerLabel
|
|
2845
2848
|
}
|
|
2846
2849
|
),
|
|
2847
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ jsx34(
|
|
2848
2851
|
"span",
|
|
2849
2852
|
{
|
|
2850
2853
|
className: cn(
|
|
@@ -2858,8 +2861,8 @@ var AdsInput = React30.forwardRef(
|
|
|
2858
2861
|
}
|
|
2859
2862
|
)
|
|
2860
2863
|
] }) : /* @__PURE__ */ jsxs13("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2861
|
-
prefix ? /* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2864
|
+
prefix ? /* @__PURE__ */ jsx34("span", { className: "pointer-events-none absolute left-md inline-flex text-icon-muted", children: prefix }) : null,
|
|
2865
|
+
/* @__PURE__ */ jsx34(
|
|
2863
2866
|
Input,
|
|
2864
2867
|
{
|
|
2865
2868
|
"aria-describedby": description.describedBy,
|
|
@@ -2876,8 +2879,8 @@ var AdsInput = React30.forwardRef(
|
|
|
2876
2879
|
}
|
|
2877
2880
|
),
|
|
2878
2881
|
canClear || suffix ? /* @__PURE__ */ jsxs13("span", { className: "absolute right-md inline-flex items-center gap-xs text-icon-muted", children: [
|
|
2879
|
-
suffix ? /* @__PURE__ */
|
|
2880
|
-
canClear ? /* @__PURE__ */
|
|
2882
|
+
suffix ? /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center", children: suffix }) : null,
|
|
2883
|
+
canClear ? /* @__PURE__ */ jsx34(
|
|
2881
2884
|
AdsClearButton,
|
|
2882
2885
|
{
|
|
2883
2886
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -2887,11 +2890,11 @@ var AdsInput = React30.forwardRef(
|
|
|
2887
2890
|
] }) : null
|
|
2888
2891
|
] });
|
|
2889
2892
|
return /* @__PURE__ */ jsxs13(AdsFieldItem, { children: [
|
|
2890
|
-
label ? /* @__PURE__ */
|
|
2893
|
+
label ? /* @__PURE__ */ jsx34(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
2891
2894
|
descriptionPlacement === "above" ? helperNode : null,
|
|
2892
2895
|
/* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center gap-sm", children: [
|
|
2893
2896
|
inputNode,
|
|
2894
|
-
action ? /* @__PURE__ */
|
|
2897
|
+
action ? /* @__PURE__ */ jsx34("div", { className: "shrink-0", children: action }) : null
|
|
2895
2898
|
] }),
|
|
2896
2899
|
descriptionPlacement === "below" ? helperNode : null,
|
|
2897
2900
|
errorNode
|
|
@@ -2901,13 +2904,13 @@ var AdsInput = React30.forwardRef(
|
|
|
2901
2904
|
AdsInput.displayName = "AdsInput";
|
|
2902
2905
|
|
|
2903
2906
|
// src/components/AdsInputGroup/index.tsx
|
|
2904
|
-
import * as
|
|
2907
|
+
import * as React33 from "react";
|
|
2905
2908
|
|
|
2906
2909
|
// src/primitives/textarea.tsx
|
|
2907
|
-
import * as
|
|
2908
|
-
import { jsx as
|
|
2909
|
-
var Textarea =
|
|
2910
|
-
return /* @__PURE__ */
|
|
2910
|
+
import * as React32 from "react";
|
|
2911
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2912
|
+
var Textarea = React32.forwardRef(({ className, ...props }, ref) => {
|
|
2913
|
+
return /* @__PURE__ */ jsx35(
|
|
2911
2914
|
"textarea",
|
|
2912
2915
|
{
|
|
2913
2916
|
className: cn(
|
|
@@ -2922,7 +2925,7 @@ var Textarea = React31.forwardRef(({ className, ...props }, ref) => {
|
|
|
2922
2925
|
Textarea.displayName = "Textarea";
|
|
2923
2926
|
|
|
2924
2927
|
// src/components/AdsInputGroup/index.tsx
|
|
2925
|
-
import { jsx as
|
|
2928
|
+
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2926
2929
|
function useAdsInputGroupDescription(describedBy, helperText, errorText, idBase) {
|
|
2927
2930
|
const helperId = helperText ? `${idBase}-helper` : void 0;
|
|
2928
2931
|
const errorId = errorText ? `${idBase}-error` : void 0;
|
|
@@ -2942,10 +2945,10 @@ function AdsInputGroupChrome({
|
|
|
2942
2945
|
label
|
|
2943
2946
|
}) {
|
|
2944
2947
|
return /* @__PURE__ */ jsxs14("div", { className: "flex w-full flex-col gap-md", children: [
|
|
2945
|
-
label ? /* @__PURE__ */
|
|
2948
|
+
label ? /* @__PURE__ */ jsx36("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }) : null,
|
|
2946
2949
|
children,
|
|
2947
|
-
helperText ? /* @__PURE__ */
|
|
2948
|
-
errorText ? /* @__PURE__ */
|
|
2950
|
+
helperText ? /* @__PURE__ */ jsx36("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
2951
|
+
errorText ? /* @__PURE__ */ jsx36("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
2949
2952
|
] });
|
|
2950
2953
|
}
|
|
2951
2954
|
var addonBaseClassName = "flex shrink-0 items-center self-stretch bg-secondary px-lg text-sm leading-5 text-foreground";
|
|
@@ -2984,21 +2987,21 @@ function AdsInputGroup({
|
|
|
2984
2987
|
trailingAddon,
|
|
2985
2988
|
trailingAddonClassName
|
|
2986
2989
|
}) {
|
|
2987
|
-
const generatedId =
|
|
2990
|
+
const generatedId = React33.useId();
|
|
2988
2991
|
const description = useAdsInputGroupDescription(
|
|
2989
2992
|
void 0,
|
|
2990
2993
|
helperText,
|
|
2991
2994
|
errorText,
|
|
2992
2995
|
id ?? generatedId
|
|
2993
2996
|
);
|
|
2994
|
-
return /* @__PURE__ */
|
|
2997
|
+
return /* @__PURE__ */ jsx36(
|
|
2995
2998
|
AdsInputGroupChrome,
|
|
2996
2999
|
{
|
|
2997
3000
|
errorText,
|
|
2998
3001
|
helperText,
|
|
2999
3002
|
label,
|
|
3000
3003
|
...description,
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3004
|
+
children: /* @__PURE__ */ jsx36("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs14(
|
|
3002
3005
|
"div",
|
|
3003
3006
|
{
|
|
3004
3007
|
className: cn(
|
|
@@ -3008,9 +3011,9 @@ function AdsInputGroup({
|
|
|
3008
3011
|
surfaceClassName
|
|
3009
3012
|
),
|
|
3010
3013
|
children: [
|
|
3011
|
-
header ? /* @__PURE__ */
|
|
3014
|
+
header ? /* @__PURE__ */ jsx36("div", { className: "border-b border-border px-md py-md text-sm text-foreground", children: header }) : null,
|
|
3012
3015
|
/* @__PURE__ */ jsxs14("div", { className: "flex min-h-11 w-full items-stretch", children: [
|
|
3013
|
-
leadingAddon ? /* @__PURE__ */
|
|
3016
|
+
leadingAddon ? /* @__PURE__ */ jsx36(
|
|
3014
3017
|
"div",
|
|
3015
3018
|
{
|
|
3016
3019
|
className: cn(
|
|
@@ -3021,7 +3024,7 @@ function AdsInputGroup({
|
|
|
3021
3024
|
children: leadingAddon
|
|
3022
3025
|
}
|
|
3023
3026
|
) : null,
|
|
3024
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx36(
|
|
3025
3028
|
"div",
|
|
3026
3029
|
{
|
|
3027
3030
|
className: cn(
|
|
@@ -3031,7 +3034,7 @@ function AdsInputGroup({
|
|
|
3031
3034
|
children
|
|
3032
3035
|
}
|
|
3033
3036
|
),
|
|
3034
|
-
trailingAddon ? /* @__PURE__ */
|
|
3037
|
+
trailingAddon ? /* @__PURE__ */ jsx36(
|
|
3035
3038
|
"div",
|
|
3036
3039
|
{
|
|
3037
3040
|
className: cn(
|
|
@@ -3043,33 +3046,33 @@ function AdsInputGroup({
|
|
|
3043
3046
|
}
|
|
3044
3047
|
) : null
|
|
3045
3048
|
] }),
|
|
3046
|
-
footer ? /* @__PURE__ */
|
|
3049
|
+
footer ? /* @__PURE__ */ jsx36("div", { className: "border-t border-border px-md py-sm text-sm text-muted-foreground", children: footer }) : null
|
|
3047
3050
|
]
|
|
3048
3051
|
}
|
|
3049
3052
|
) })
|
|
3050
3053
|
}
|
|
3051
3054
|
);
|
|
3052
3055
|
}
|
|
3053
|
-
var AdsInputGroupInput =
|
|
3056
|
+
var AdsInputGroupInput = React33.forwardRef(({ className, clearable = false, clearButtonLabel, onChange, onClear, ...props }, ref) => {
|
|
3054
3057
|
const { messages } = useAdsI18n();
|
|
3055
|
-
const inputRef =
|
|
3056
|
-
const [currentValue, setCurrentValue] =
|
|
3058
|
+
const inputRef = React33.useRef(null);
|
|
3059
|
+
const [currentValue, setCurrentValue] = React33.useState(
|
|
3057
3060
|
() => getInputGroupValue(props.value ?? props.defaultValue)
|
|
3058
3061
|
);
|
|
3059
|
-
|
|
3062
|
+
React33.useEffect(() => {
|
|
3060
3063
|
if (props.value !== void 0) {
|
|
3061
3064
|
setCurrentValue(getInputGroupValue(props.value));
|
|
3062
3065
|
}
|
|
3063
3066
|
}, [props.value]);
|
|
3064
3067
|
const canClear = clearable && !props.disabled && !props.readOnly && currentValue.length > 0;
|
|
3065
|
-
const handleChange =
|
|
3068
|
+
const handleChange = React33.useCallback(
|
|
3066
3069
|
(event) => {
|
|
3067
3070
|
setCurrentValue(event.target.value);
|
|
3068
3071
|
onChange?.(event);
|
|
3069
3072
|
},
|
|
3070
3073
|
[onChange]
|
|
3071
3074
|
);
|
|
3072
|
-
const handleClear =
|
|
3075
|
+
const handleClear = React33.useCallback(() => {
|
|
3073
3076
|
const element = inputRef.current;
|
|
3074
3077
|
if (!element) {
|
|
3075
3078
|
return;
|
|
@@ -3084,7 +3087,7 @@ var AdsInputGroupInput = React32.forwardRef(({ className, clearable = false, cle
|
|
|
3084
3087
|
onClear?.();
|
|
3085
3088
|
}, [onClear]);
|
|
3086
3089
|
return /* @__PURE__ */ jsxs14("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
3087
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ jsx36(
|
|
3088
3091
|
Input,
|
|
3089
3092
|
{
|
|
3090
3093
|
className: cn(
|
|
@@ -3101,7 +3104,7 @@ var AdsInputGroupInput = React32.forwardRef(({ className, clearable = false, cle
|
|
|
3101
3104
|
...props
|
|
3102
3105
|
}
|
|
3103
3106
|
),
|
|
3104
|
-
canClear ? /* @__PURE__ */
|
|
3107
|
+
canClear ? /* @__PURE__ */ jsx36(
|
|
3105
3108
|
AdsClearButton,
|
|
3106
3109
|
{
|
|
3107
3110
|
"aria-label": clearButtonLabel ?? messages.input.clear,
|
|
@@ -3112,7 +3115,7 @@ var AdsInputGroupInput = React32.forwardRef(({ className, clearable = false, cle
|
|
|
3112
3115
|
] });
|
|
3113
3116
|
});
|
|
3114
3117
|
AdsInputGroupInput.displayName = "AdsInputGroupInput";
|
|
3115
|
-
var AdsInputGroupTextarea =
|
|
3118
|
+
var AdsInputGroupTextarea = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
3116
3119
|
Textarea,
|
|
3117
3120
|
{
|
|
3118
3121
|
className: cn(
|
|
@@ -3127,14 +3130,14 @@ var AdsInputGroupTextarea = React32.forwardRef(({ className, ...props }, ref) =>
|
|
|
3127
3130
|
AdsInputGroupTextarea.displayName = "AdsInputGroupTextarea";
|
|
3128
3131
|
|
|
3129
3132
|
// src/components/AdsInputOTP/index.tsx
|
|
3130
|
-
import * as
|
|
3133
|
+
import * as React35 from "react";
|
|
3131
3134
|
|
|
3132
3135
|
// src/primitives/input-otp.tsx
|
|
3133
|
-
import * as
|
|
3136
|
+
import * as React34 from "react";
|
|
3134
3137
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
3135
3138
|
import { Dot } from "lucide-react";
|
|
3136
|
-
import { jsx as
|
|
3137
|
-
var InputOTP =
|
|
3139
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3140
|
+
var InputOTP = React34.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3138
3141
|
OTPInput,
|
|
3139
3142
|
{
|
|
3140
3143
|
ref,
|
|
@@ -3147,10 +3150,10 @@ var InputOTP = React33.forwardRef(({ className, containerClassName, ...props },
|
|
|
3147
3150
|
}
|
|
3148
3151
|
));
|
|
3149
3152
|
InputOTP.displayName = "InputOTP";
|
|
3150
|
-
var InputOTPGroup =
|
|
3153
|
+
var InputOTPGroup = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
3151
3154
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
3152
|
-
var InputOTPSlot =
|
|
3153
|
-
const inputOTPContext =
|
|
3155
|
+
var InputOTPSlot = React34.forwardRef(({ index, className, ...props }, ref) => {
|
|
3156
|
+
const inputOTPContext = React34.useContext(OTPInputContext);
|
|
3154
3157
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
3155
3158
|
return /* @__PURE__ */ jsxs15(
|
|
3156
3159
|
"div",
|
|
@@ -3164,19 +3167,19 @@ var InputOTPSlot = React33.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
3164
3167
|
...props,
|
|
3165
3168
|
children: [
|
|
3166
3169
|
char,
|
|
3167
|
-
hasFakeCaret && /* @__PURE__ */
|
|
3170
|
+
hasFakeCaret && /* @__PURE__ */ jsx37("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx37("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
3168
3171
|
]
|
|
3169
3172
|
}
|
|
3170
3173
|
);
|
|
3171
3174
|
});
|
|
3172
3175
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
3173
|
-
var InputOTPSeparator =
|
|
3176
|
+
var InputOTPSeparator = React34.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx37("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx37(Dot, {}) }));
|
|
3174
3177
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3175
3178
|
|
|
3176
3179
|
// src/components/AdsInputOTP/index.tsx
|
|
3177
|
-
import { jsx as
|
|
3180
|
+
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3178
3181
|
function useFieldDescription(id, describedBy, helperText, errorText) {
|
|
3179
|
-
const generatedId =
|
|
3182
|
+
const generatedId = React35.useId();
|
|
3180
3183
|
const inputId = id ?? generatedId;
|
|
3181
3184
|
const helperId = helperText ? `${inputId}-helper` : void 0;
|
|
3182
3185
|
const errorId = errorText ? `${inputId}-error` : void 0;
|
|
@@ -3198,20 +3201,20 @@ function AdsInputOTPChrome({
|
|
|
3198
3201
|
label
|
|
3199
3202
|
}) {
|
|
3200
3203
|
return /* @__PURE__ */ jsxs16("div", { className: "flex w-full flex-col gap-md", children: [
|
|
3201
|
-
label ? /* @__PURE__ */
|
|
3204
|
+
label ? /* @__PURE__ */ jsx38("label", { className: "text-sm font-medium leading-5 text-foreground", htmlFor: inputId, children: label }) : null,
|
|
3202
3205
|
children,
|
|
3203
|
-
helperText ? /* @__PURE__ */
|
|
3204
|
-
errorText ? /* @__PURE__ */
|
|
3206
|
+
helperText ? /* @__PURE__ */ jsx38("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
3207
|
+
errorText ? /* @__PURE__ */ jsx38("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
3205
3208
|
] });
|
|
3206
3209
|
}
|
|
3207
3210
|
function buildSeparator(node, key) {
|
|
3208
3211
|
if (node === void 0) {
|
|
3209
|
-
return /* @__PURE__ */
|
|
3212
|
+
return /* @__PURE__ */ jsx38(AdsInputOTPSeparator, {}, key);
|
|
3210
3213
|
}
|
|
3211
|
-
if (
|
|
3212
|
-
return
|
|
3214
|
+
if (React35.isValidElement(node)) {
|
|
3215
|
+
return React35.cloneElement(node, { key });
|
|
3213
3216
|
}
|
|
3214
|
-
return /* @__PURE__ */
|
|
3217
|
+
return /* @__PURE__ */ jsx38("span", { children: node }, key);
|
|
3215
3218
|
}
|
|
3216
3219
|
function buildOtpChildren(groups, separator) {
|
|
3217
3220
|
const defaultGroup = groups.length > 0 ? groups : [6];
|
|
@@ -3219,7 +3222,7 @@ function buildOtpChildren(groups, separator) {
|
|
|
3219
3222
|
let index = 0;
|
|
3220
3223
|
defaultGroup.forEach((size, indexOfGroup) => {
|
|
3221
3224
|
items.push(
|
|
3222
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ jsx38(AdsInputOTPGroup, { children: Array.from({ length: size }, (_, slotOffset) => /* @__PURE__ */ jsx38(
|
|
3223
3226
|
AdsInputOTPSlot,
|
|
3224
3227
|
{
|
|
3225
3228
|
index: index + slotOffset
|
|
@@ -3234,11 +3237,11 @@ function buildOtpChildren(groups, separator) {
|
|
|
3234
3237
|
});
|
|
3235
3238
|
return items;
|
|
3236
3239
|
}
|
|
3237
|
-
var AdsInputOTP =
|
|
3240
|
+
var AdsInputOTP = React35.forwardRef(({ action, errorText, groups, helperText, label, separator, children, id, ...props }, ref) => {
|
|
3238
3241
|
const totalSlots = groups && groups.length > 0 ? groups.reduce((sum, value) => sum + value, 0) : 6;
|
|
3239
3242
|
const description = useFieldDescription(id, props["aria-describedby"], helperText, errorText);
|
|
3240
3243
|
const otpChildren = children ?? buildOtpChildren(groups ?? [], separator);
|
|
3241
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsx38(
|
|
3242
3245
|
AdsInputOTPChrome,
|
|
3243
3246
|
{
|
|
3244
3247
|
errorText,
|
|
@@ -3248,7 +3251,7 @@ var AdsInputOTP = React34.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3248
3251
|
inputId: description.inputId,
|
|
3249
3252
|
label,
|
|
3250
3253
|
children: /* @__PURE__ */ jsxs16("div", { className: "flex w-full items-center gap-sm", children: [
|
|
3251
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsx38(
|
|
3252
3255
|
InputOTP,
|
|
3253
3256
|
{
|
|
3254
3257
|
"aria-describedby": description.describedBy,
|
|
@@ -3260,15 +3263,15 @@ var AdsInputOTP = React34.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3260
3263
|
children: otpChildren
|
|
3261
3264
|
}
|
|
3262
3265
|
),
|
|
3263
|
-
action ? /* @__PURE__ */
|
|
3266
|
+
action ? /* @__PURE__ */ jsx38("span", { className: "shrink-0", children: action }) : null
|
|
3264
3267
|
] })
|
|
3265
3268
|
}
|
|
3266
3269
|
);
|
|
3267
3270
|
});
|
|
3268
3271
|
AdsInputOTP.displayName = "AdsInputOTP";
|
|
3269
|
-
var AdsInputOTPGroup =
|
|
3272
|
+
var AdsInputOTPGroup = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(InputOTPGroup, { className, ref, ...props }));
|
|
3270
3273
|
AdsInputOTPGroup.displayName = "AdsInputOTPGroup";
|
|
3271
|
-
var AdsInputOTPSeparator =
|
|
3274
|
+
var AdsInputOTPSeparator = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3272
3275
|
InputOTPSeparator,
|
|
3273
3276
|
{
|
|
3274
3277
|
className: className ?? "h-px w-6 shrink-0 bg-border text-transparent [&_svg]:hidden",
|
|
@@ -3277,7 +3280,7 @@ var AdsInputOTPSeparator = React34.forwardRef(({ className, ...props }, ref) =>
|
|
|
3277
3280
|
}
|
|
3278
3281
|
));
|
|
3279
3282
|
AdsInputOTPSeparator.displayName = "AdsInputOTPSeparator";
|
|
3280
|
-
var AdsInputOTPSlot =
|
|
3283
|
+
var AdsInputOTPSlot = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3281
3284
|
InputOTPSlot,
|
|
3282
3285
|
{
|
|
3283
3286
|
className: [
|
|
@@ -3294,17 +3297,17 @@ var AdsInputOTPSlot = React34.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3294
3297
|
AdsInputOTPSlot.displayName = "AdsInputOTPSlot";
|
|
3295
3298
|
|
|
3296
3299
|
// src/components/AdsDataPagination/index.tsx
|
|
3297
|
-
import * as
|
|
3300
|
+
import * as React39 from "react";
|
|
3298
3301
|
|
|
3299
3302
|
// src/components/AdsPagination/index.tsx
|
|
3300
|
-
import * as
|
|
3303
|
+
import * as React37 from "react";
|
|
3301
3304
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight4, MoreHorizontal as MoreHorizontal4 } from "lucide-react";
|
|
3302
3305
|
|
|
3303
3306
|
// src/primitives/pagination.tsx
|
|
3304
|
-
import * as
|
|
3307
|
+
import * as React36 from "react";
|
|
3305
3308
|
import { ChevronLeft, ChevronRight as ChevronRight3, MoreHorizontal as MoreHorizontal3 } from "lucide-react";
|
|
3306
|
-
import { jsx as
|
|
3307
|
-
var Pagination = ({ className, ...props }) => /* @__PURE__ */
|
|
3309
|
+
import { jsx as jsx39, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3310
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx39(
|
|
3308
3311
|
"nav",
|
|
3309
3312
|
{
|
|
3310
3313
|
role: "navigation",
|
|
@@ -3314,7 +3317,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx38(
|
|
|
3314
3317
|
}
|
|
3315
3318
|
);
|
|
3316
3319
|
Pagination.displayName = "Pagination";
|
|
3317
|
-
var PaginationContent =
|
|
3320
|
+
var PaginationContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
3318
3321
|
"ul",
|
|
3319
3322
|
{
|
|
3320
3323
|
ref,
|
|
@@ -3323,14 +3326,14 @@ var PaginationContent = React35.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3323
3326
|
}
|
|
3324
3327
|
));
|
|
3325
3328
|
PaginationContent.displayName = "PaginationContent";
|
|
3326
|
-
var PaginationItem =
|
|
3329
|
+
var PaginationItem = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39("li", { ref, className: cn("", className), ...props }));
|
|
3327
3330
|
PaginationItem.displayName = "PaginationItem";
|
|
3328
3331
|
var PaginationLink = ({
|
|
3329
3332
|
className,
|
|
3330
3333
|
isActive,
|
|
3331
3334
|
size = "icon",
|
|
3332
3335
|
...props
|
|
3333
|
-
}) => /* @__PURE__ */
|
|
3336
|
+
}) => /* @__PURE__ */ jsx39(
|
|
3334
3337
|
"a",
|
|
3335
3338
|
{
|
|
3336
3339
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3356,8 +3359,8 @@ var PaginationPrevious = ({
|
|
|
3356
3359
|
className: cn("gap-1 pl-2.5", className),
|
|
3357
3360
|
...props,
|
|
3358
3361
|
children: [
|
|
3359
|
-
/* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
3362
|
+
/* @__PURE__ */ jsx39(ChevronLeft, { className: "h-4 w-4" }),
|
|
3363
|
+
/* @__PURE__ */ jsx39("span", { children: "Previous" })
|
|
3361
3364
|
]
|
|
3362
3365
|
}
|
|
3363
3366
|
);
|
|
@@ -3373,8 +3376,8 @@ var PaginationNext = ({
|
|
|
3373
3376
|
className: cn("gap-1 pr-2.5", className),
|
|
3374
3377
|
...props,
|
|
3375
3378
|
children: [
|
|
3376
|
-
/* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3379
|
+
/* @__PURE__ */ jsx39("span", { children: "Next" }),
|
|
3380
|
+
/* @__PURE__ */ jsx39(ChevronRight3, { className: "h-4 w-4" })
|
|
3378
3381
|
]
|
|
3379
3382
|
}
|
|
3380
3383
|
);
|
|
@@ -3389,20 +3392,20 @@ var PaginationEllipsis = ({
|
|
|
3389
3392
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3390
3393
|
...props,
|
|
3391
3394
|
children: [
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ jsx39(MoreHorizontal3, { className: "h-4 w-4" }),
|
|
3396
|
+
/* @__PURE__ */ jsx39("span", { className: "sr-only", children: "More pages" })
|
|
3394
3397
|
]
|
|
3395
3398
|
}
|
|
3396
3399
|
);
|
|
3397
3400
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3398
3401
|
|
|
3399
3402
|
// src/components/AdsPagination/index.tsx
|
|
3400
|
-
import { jsx as
|
|
3403
|
+
import { jsx as jsx40, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3401
3404
|
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";
|
|
3402
3405
|
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)]";
|
|
3403
3406
|
var paginationLinkActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3404
3407
|
function AdsPagination({ className, ...props }) {
|
|
3405
|
-
return /* @__PURE__ */
|
|
3408
|
+
return /* @__PURE__ */ jsx40(
|
|
3406
3409
|
Pagination,
|
|
3407
3410
|
{
|
|
3408
3411
|
className: cn("mx-0 w-auto justify-start", className),
|
|
@@ -3411,14 +3414,14 @@ function AdsPagination({ className, ...props }) {
|
|
|
3411
3414
|
);
|
|
3412
3415
|
}
|
|
3413
3416
|
AdsPagination.displayName = "AdsPagination";
|
|
3414
|
-
var AdsPaginationContent =
|
|
3417
|
+
var AdsPaginationContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(PaginationContent, { ref, className: cn("gap-1", className), ...props }));
|
|
3415
3418
|
AdsPaginationContent.displayName = "AdsPaginationContent";
|
|
3416
|
-
var AdsPaginationItem =
|
|
3417
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
3419
|
+
var AdsPaginationItem = React37.forwardRef(
|
|
3420
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx40(PaginationItem, { ref, className, ...props })
|
|
3418
3421
|
);
|
|
3419
3422
|
AdsPaginationItem.displayName = "AdsPaginationItem";
|
|
3420
|
-
var AdsPaginationLink =
|
|
3421
|
-
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */
|
|
3423
|
+
var AdsPaginationLink = React37.forwardRef(
|
|
3424
|
+
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3422
3425
|
"a",
|
|
3423
3426
|
{
|
|
3424
3427
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3433,7 +3436,7 @@ var AdsPaginationLink = React36.forwardRef(
|
|
|
3433
3436
|
)
|
|
3434
3437
|
);
|
|
3435
3438
|
AdsPaginationLink.displayName = "AdsPaginationLink";
|
|
3436
|
-
var AdsPaginationPrevious =
|
|
3439
|
+
var AdsPaginationPrevious = React37.forwardRef(({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3437
3440
|
const { messages } = useAdsI18n();
|
|
3438
3441
|
const label = children ?? messages.pagination.previous;
|
|
3439
3442
|
return /* @__PURE__ */ jsxs18(
|
|
@@ -3444,14 +3447,14 @@ var AdsPaginationPrevious = React36.forwardRef(({ "aria-label": ariaLabel, child
|
|
|
3444
3447
|
ref,
|
|
3445
3448
|
...props,
|
|
3446
3449
|
children: [
|
|
3447
|
-
/* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx40(ChevronLeft2, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
3451
|
+
/* @__PURE__ */ jsx40("span", { children: label })
|
|
3449
3452
|
]
|
|
3450
3453
|
}
|
|
3451
3454
|
);
|
|
3452
3455
|
});
|
|
3453
3456
|
AdsPaginationPrevious.displayName = "AdsPaginationPrevious";
|
|
3454
|
-
var AdsPaginationNext =
|
|
3457
|
+
var AdsPaginationNext = React37.forwardRef(
|
|
3455
3458
|
({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3456
3459
|
const { messages } = useAdsI18n();
|
|
3457
3460
|
const label = children ?? messages.pagination.next;
|
|
@@ -3463,8 +3466,8 @@ var AdsPaginationNext = React36.forwardRef(
|
|
|
3463
3466
|
ref,
|
|
3464
3467
|
...props,
|
|
3465
3468
|
children: [
|
|
3466
|
-
/* @__PURE__ */
|
|
3467
|
-
/* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ jsx40("span", { children: label }),
|
|
3470
|
+
/* @__PURE__ */ jsx40(ChevronRight4, { "aria-hidden": true, className: "h-4 w-4" })
|
|
3468
3471
|
]
|
|
3469
3472
|
}
|
|
3470
3473
|
);
|
|
@@ -3488,8 +3491,8 @@ function AdsPaginationEllipsis({
|
|
|
3488
3491
|
),
|
|
3489
3492
|
...props,
|
|
3490
3493
|
children: [
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
/* @__PURE__ */
|
|
3494
|
+
/* @__PURE__ */ jsx40(MoreHorizontal4, { className: "h-4 w-4" }),
|
|
3495
|
+
/* @__PURE__ */ jsx40("span", { className: "sr-only", children: resolvedLabel })
|
|
3493
3496
|
]
|
|
3494
3497
|
}
|
|
3495
3498
|
);
|
|
@@ -3497,8 +3500,8 @@ function AdsPaginationEllipsis({
|
|
|
3497
3500
|
AdsPaginationEllipsis.displayName = "AdsPaginationEllipsis";
|
|
3498
3501
|
|
|
3499
3502
|
// src/components/AdsSelect/index.tsx
|
|
3500
|
-
import * as
|
|
3501
|
-
import { jsx as
|
|
3503
|
+
import * as React38 from "react";
|
|
3504
|
+
import { jsx as jsx41, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3502
3505
|
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)]";
|
|
3503
3506
|
var selectContentBaseClassName = "rounded-radius-md border-border bg-popover text-popover-foreground shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
3504
3507
|
function AdsSelect({
|
|
@@ -3523,7 +3526,7 @@ function AdsSelect({
|
|
|
3523
3526
|
}) {
|
|
3524
3527
|
const { messages } = useAdsI18n();
|
|
3525
3528
|
const isControlled = value !== void 0;
|
|
3526
|
-
const [internalValue, setInternalValue] =
|
|
3529
|
+
const [internalValue, setInternalValue] = React38.useState(
|
|
3527
3530
|
defaultValue
|
|
3528
3531
|
);
|
|
3529
3532
|
const resolvedValue = isControlled ? value : internalValue;
|
|
@@ -3537,8 +3540,8 @@ function AdsSelect({
|
|
|
3537
3540
|
});
|
|
3538
3541
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.select.clear;
|
|
3539
3542
|
const resolvedEmptyText = emptyText ?? messages.select.noOptionsAvailable;
|
|
3540
|
-
const hasOptions =
|
|
3541
|
-
const handleValueChange =
|
|
3543
|
+
const hasOptions = React38.Children.toArray(children).length > 0;
|
|
3544
|
+
const handleValueChange = React38.useCallback(
|
|
3542
3545
|
(nextValue) => {
|
|
3543
3546
|
if (!isControlled) {
|
|
3544
3547
|
setInternalValue(nextValue);
|
|
@@ -3547,7 +3550,7 @@ function AdsSelect({
|
|
|
3547
3550
|
},
|
|
3548
3551
|
[isControlled, onValueChange]
|
|
3549
3552
|
);
|
|
3550
|
-
const handleClear =
|
|
3553
|
+
const handleClear = React38.useCallback(
|
|
3551
3554
|
(event) => {
|
|
3552
3555
|
event.preventDefault();
|
|
3553
3556
|
event.stopPropagation();
|
|
@@ -3559,10 +3562,10 @@ function AdsSelect({
|
|
|
3559
3562
|
},
|
|
3560
3563
|
[isControlled, onClear, onValueChange]
|
|
3561
3564
|
);
|
|
3562
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
3563
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
3565
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx41(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
3566
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx41(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
3564
3567
|
return /* @__PURE__ */ jsxs19(AdsFieldItem, { children: [
|
|
3565
|
-
label ? /* @__PURE__ */
|
|
3568
|
+
label ? /* @__PURE__ */ jsx41(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
3566
3569
|
descriptionPlacement === "above" ? helperNode : null,
|
|
3567
3570
|
/* @__PURE__ */ jsxs19(
|
|
3568
3571
|
Select,
|
|
@@ -3573,7 +3576,7 @@ function AdsSelect({
|
|
|
3573
3576
|
...resolvedValue !== void 0 ? { value: resolvedValue } : {},
|
|
3574
3577
|
children: [
|
|
3575
3578
|
/* @__PURE__ */ jsxs19("div", { className: "relative", children: [
|
|
3576
|
-
/* @__PURE__ */
|
|
3579
|
+
/* @__PURE__ */ jsx41(
|
|
3577
3580
|
SelectTrigger,
|
|
3578
3581
|
{
|
|
3579
3582
|
"aria-describedby": description.describedBy,
|
|
@@ -3585,10 +3588,10 @@ function AdsSelect({
|
|
|
3585
3588
|
triggerClassName
|
|
3586
3589
|
),
|
|
3587
3590
|
id: description.inputId,
|
|
3588
|
-
children: /* @__PURE__ */
|
|
3591
|
+
children: /* @__PURE__ */ jsx41(SelectValue, { placeholder })
|
|
3589
3592
|
}
|
|
3590
3593
|
),
|
|
3591
|
-
canClear ? /* @__PURE__ */
|
|
3594
|
+
canClear ? /* @__PURE__ */ jsx41(
|
|
3592
3595
|
AdsClearButton,
|
|
3593
3596
|
{
|
|
3594
3597
|
"aria-label": resolvedClearButtonLabel,
|
|
@@ -3597,11 +3600,11 @@ function AdsSelect({
|
|
|
3597
3600
|
}
|
|
3598
3601
|
) : null
|
|
3599
3602
|
] }),
|
|
3600
|
-
/* @__PURE__ */
|
|
3603
|
+
/* @__PURE__ */ jsx41(
|
|
3601
3604
|
SelectContent,
|
|
3602
3605
|
{
|
|
3603
3606
|
className: cn(selectContentBaseClassName, contentClassName3),
|
|
3604
|
-
children: hasOptions ? children : /* @__PURE__ */
|
|
3607
|
+
children: hasOptions ? children : /* @__PURE__ */ jsx41(
|
|
3605
3608
|
"div",
|
|
3606
3609
|
{
|
|
3607
3610
|
"aria-live": "polite",
|
|
@@ -3624,7 +3627,7 @@ function AdsSelect({
|
|
|
3624
3627
|
}
|
|
3625
3628
|
|
|
3626
3629
|
// src/components/AdsDataPagination/index.tsx
|
|
3627
|
-
import { jsx as
|
|
3630
|
+
import { jsx as jsx42, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3628
3631
|
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";
|
|
3629
3632
|
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)]";
|
|
3630
3633
|
var paginationButtonActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
@@ -3700,9 +3703,9 @@ function AdsDataPagination({
|
|
|
3700
3703
|
ariaLabel
|
|
3701
3704
|
}) {
|
|
3702
3705
|
const { messages } = useAdsI18n();
|
|
3703
|
-
const [internalCurrent, setInternalCurrent] =
|
|
3704
|
-
const [internalPageSize, setInternalPageSize] =
|
|
3705
|
-
const [quickJumpValue, setQuickJumpValue] =
|
|
3706
|
+
const [internalCurrent, setInternalCurrent] = React39.useState(defaultCurrent);
|
|
3707
|
+
const [internalPageSize, setInternalPageSize] = React39.useState(defaultPageSize);
|
|
3708
|
+
const [quickJumpValue, setQuickJumpValue] = React39.useState("");
|
|
3706
3709
|
const isCurrentControlled = current !== void 0;
|
|
3707
3710
|
const isPageSizeControlled = pageSize !== void 0;
|
|
3708
3711
|
const mergedPageSize = Math.max(1, isPageSizeControlled ? pageSize : internalPageSize);
|
|
@@ -3723,20 +3726,20 @@ function AdsDataPagination({
|
|
|
3723
3726
|
new Set(pageSizeOptions.filter((option) => Number.isFinite(option) && option > 0))
|
|
3724
3727
|
);
|
|
3725
3728
|
const resolvedPageSizeOptions = pageSizeValues.length > 0 ? pageSizeValues : [10, 20, 50, 100];
|
|
3726
|
-
|
|
3729
|
+
React39.useEffect(() => {
|
|
3727
3730
|
if (!isCurrentControlled && internalCurrent !== mergedCurrent) {
|
|
3728
3731
|
setInternalCurrent(mergedCurrent);
|
|
3729
3732
|
}
|
|
3730
3733
|
}, [internalCurrent, isCurrentControlled, mergedCurrent]);
|
|
3731
|
-
|
|
3734
|
+
React39.useEffect(() => {
|
|
3732
3735
|
if (!isPageSizeControlled && internalPageSize !== mergedPageSize) {
|
|
3733
3736
|
setInternalPageSize(mergedPageSize);
|
|
3734
3737
|
}
|
|
3735
3738
|
}, [internalPageSize, isPageSizeControlled, mergedPageSize]);
|
|
3736
|
-
|
|
3739
|
+
React39.useEffect(() => {
|
|
3737
3740
|
setQuickJumpValue(String(mergedCurrent));
|
|
3738
3741
|
}, [mergedCurrent]);
|
|
3739
|
-
const commitPageChange =
|
|
3742
|
+
const commitPageChange = React39.useCallback(
|
|
3740
3743
|
(nextPage, nextPageSize = mergedPageSize) => {
|
|
3741
3744
|
const clampedPage = clampPage(nextPage, Math.max(1, Math.ceil(Math.max(total, 0) / nextPageSize)));
|
|
3742
3745
|
if (!isCurrentControlled) {
|
|
@@ -3750,7 +3753,7 @@ function AdsDataPagination({
|
|
|
3750
3753
|
},
|
|
3751
3754
|
[isCurrentControlled, mergedCurrent, mergedPageSize, onChange, total]
|
|
3752
3755
|
);
|
|
3753
|
-
const handlePageSizeChange =
|
|
3756
|
+
const handlePageSizeChange = React39.useCallback(
|
|
3754
3757
|
(nextValue) => {
|
|
3755
3758
|
const nextPageSize = Number(nextValue);
|
|
3756
3759
|
if (!Number.isFinite(nextPageSize) || nextPageSize <= 0 || nextPageSize === mergedPageSize) {
|
|
@@ -3775,7 +3778,7 @@ function AdsDataPagination({
|
|
|
3775
3778
|
total
|
|
3776
3779
|
]
|
|
3777
3780
|
);
|
|
3778
|
-
const handleQuickJumpSubmit =
|
|
3781
|
+
const handleQuickJumpSubmit = React39.useCallback(() => {
|
|
3779
3782
|
const trimmedValue = quickJumpValue.trim();
|
|
3780
3783
|
if (!trimmedValue) {
|
|
3781
3784
|
setQuickJumpValue(String(mergedCurrent));
|
|
@@ -3810,7 +3813,7 @@ function AdsDataPagination({
|
|
|
3810
3813
|
const renderPageNavigation = () => {
|
|
3811
3814
|
if (variant === "compact") {
|
|
3812
3815
|
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-sm", children: [
|
|
3813
|
-
shouldShowFirstLast ? /* @__PURE__ */
|
|
3816
|
+
shouldShowFirstLast ? /* @__PURE__ */ jsx42(
|
|
3814
3817
|
Button,
|
|
3815
3818
|
{
|
|
3816
3819
|
"aria-label": messages.pagination.first,
|
|
@@ -3823,7 +3826,7 @@ function AdsDataPagination({
|
|
|
3823
3826
|
children: messages.pagination.first
|
|
3824
3827
|
}
|
|
3825
3828
|
) : null,
|
|
3826
|
-
/* @__PURE__ */
|
|
3829
|
+
/* @__PURE__ */ jsx42(
|
|
3827
3830
|
Button,
|
|
3828
3831
|
{
|
|
3829
3832
|
"aria-label": messages.pagination.previous,
|
|
@@ -3836,7 +3839,7 @@ function AdsDataPagination({
|
|
|
3836
3839
|
children: messages.pagination.previous
|
|
3837
3840
|
}
|
|
3838
3841
|
),
|
|
3839
|
-
/* @__PURE__ */
|
|
3842
|
+
/* @__PURE__ */ jsx42(
|
|
3840
3843
|
"span",
|
|
3841
3844
|
{
|
|
3842
3845
|
"aria-current": "page",
|
|
@@ -3844,7 +3847,7 @@ function AdsDataPagination({
|
|
|
3844
3847
|
children: pageStatus
|
|
3845
3848
|
}
|
|
3846
3849
|
),
|
|
3847
|
-
/* @__PURE__ */
|
|
3850
|
+
/* @__PURE__ */ jsx42(
|
|
3848
3851
|
Button,
|
|
3849
3852
|
{
|
|
3850
3853
|
"aria-label": messages.pagination.next,
|
|
@@ -3857,7 +3860,7 @@ function AdsDataPagination({
|
|
|
3857
3860
|
children: messages.pagination.next
|
|
3858
3861
|
}
|
|
3859
3862
|
),
|
|
3860
|
-
shouldShowFirstLast ? /* @__PURE__ */
|
|
3863
|
+
shouldShowFirstLast ? /* @__PURE__ */ jsx42(
|
|
3861
3864
|
Button,
|
|
3862
3865
|
{
|
|
3863
3866
|
"aria-label": messages.pagination.last,
|
|
@@ -3872,8 +3875,8 @@ function AdsDataPagination({
|
|
|
3872
3875
|
) : null
|
|
3873
3876
|
] });
|
|
3874
3877
|
}
|
|
3875
|
-
return /* @__PURE__ */
|
|
3876
|
-
shouldShowFirstLast ? /* @__PURE__ */
|
|
3878
|
+
return /* @__PURE__ */ jsx42(AdsPagination, { "aria-label": navigationLabel, children: /* @__PURE__ */ jsxs20(AdsPaginationContent, { children: [
|
|
3879
|
+
shouldShowFirstLast ? /* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(
|
|
3877
3880
|
Button,
|
|
3878
3881
|
{
|
|
3879
3882
|
"aria-label": messages.pagination.first,
|
|
@@ -3886,7 +3889,7 @@ function AdsDataPagination({
|
|
|
3886
3889
|
children: messages.pagination.first
|
|
3887
3890
|
}
|
|
3888
3891
|
) }) : null,
|
|
3889
|
-
/* @__PURE__ */
|
|
3892
|
+
/* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(
|
|
3890
3893
|
Button,
|
|
3891
3894
|
{
|
|
3892
3895
|
"aria-label": messages.pagination.previous,
|
|
@@ -3900,7 +3903,7 @@ function AdsDataPagination({
|
|
|
3900
3903
|
}
|
|
3901
3904
|
) }),
|
|
3902
3905
|
paginationRange.map(
|
|
3903
|
-
(token, index) => token === "ellipsis" ? /* @__PURE__ */
|
|
3906
|
+
(token, index) => token === "ellipsis" ? /* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(AdsPaginationEllipsis, { label: messages.pagination.morePages }) }, `ellipsis-${index}`) : /* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(
|
|
3904
3907
|
Button,
|
|
3905
3908
|
{
|
|
3906
3909
|
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
@@ -3917,7 +3920,7 @@ function AdsDataPagination({
|
|
|
3917
3920
|
}
|
|
3918
3921
|
) }, token)
|
|
3919
3922
|
),
|
|
3920
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(
|
|
3921
3924
|
Button,
|
|
3922
3925
|
{
|
|
3923
3926
|
"aria-label": messages.pagination.next,
|
|
@@ -3930,7 +3933,7 @@ function AdsDataPagination({
|
|
|
3930
3933
|
children: messages.pagination.next
|
|
3931
3934
|
}
|
|
3932
3935
|
) }),
|
|
3933
|
-
shouldShowFirstLast ? /* @__PURE__ */
|
|
3936
|
+
shouldShowFirstLast ? /* @__PURE__ */ jsx42(AdsPaginationItem, { children: /* @__PURE__ */ jsx42(
|
|
3934
3937
|
Button,
|
|
3935
3938
|
{
|
|
3936
3939
|
"aria-label": messages.pagination.last,
|
|
@@ -3956,9 +3959,9 @@ function AdsDataPagination({
|
|
|
3956
3959
|
),
|
|
3957
3960
|
children: [
|
|
3958
3961
|
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-md text-sm leading-5 text-muted-foreground", children: [
|
|
3959
|
-
variant === "compact" ? /* @__PURE__ */
|
|
3962
|
+
variant === "compact" ? /* @__PURE__ */ jsx42("div", { className: classNames?.total, children: compactTotalContent }) : totalContent ? /* @__PURE__ */ jsx42("div", { className: classNames?.total, children: totalContent }) : null,
|
|
3960
3963
|
showSizeChanger ? /* @__PURE__ */ jsxs20("div", { className: cn("flex items-center gap-sm", classNames?.pageSizeChanger), children: [
|
|
3961
|
-
/* @__PURE__ */
|
|
3964
|
+
/* @__PURE__ */ jsx42("span", { children: messages.pagination.itemsPerPage }),
|
|
3962
3965
|
/* @__PURE__ */ jsxs20(
|
|
3963
3966
|
Select,
|
|
3964
3967
|
{
|
|
@@ -3966,15 +3969,15 @@ function AdsDataPagination({
|
|
|
3966
3969
|
onValueChange: handlePageSizeChange,
|
|
3967
3970
|
value: String(mergedPageSize),
|
|
3968
3971
|
children: [
|
|
3969
|
-
/* @__PURE__ */
|
|
3972
|
+
/* @__PURE__ */ jsx42(
|
|
3970
3973
|
SelectTrigger,
|
|
3971
3974
|
{
|
|
3972
3975
|
"aria-label": messages.pagination.itemsPerPage,
|
|
3973
3976
|
className: cn(inlineControlClassName, "w-[132px] px-sm"),
|
|
3974
|
-
children: /* @__PURE__ */
|
|
3977
|
+
children: /* @__PURE__ */ jsx42(SelectValue, {})
|
|
3975
3978
|
}
|
|
3976
3979
|
),
|
|
3977
|
-
/* @__PURE__ */
|
|
3980
|
+
/* @__PURE__ */ jsx42(SelectContent, { children: resolvedPageSizeOptions.map((option) => /* @__PURE__ */ jsx42(SelectItem, { value: String(option), children: interpolate(messages.pagination.itemsPerPageOption, { value: option }) }, option)) })
|
|
3978
3981
|
]
|
|
3979
3982
|
}
|
|
3980
3983
|
)
|
|
@@ -3990,8 +3993,8 @@ function AdsDataPagination({
|
|
|
3990
3993
|
classNames?.quickJumper
|
|
3991
3994
|
),
|
|
3992
3995
|
children: [
|
|
3993
|
-
/* @__PURE__ */
|
|
3994
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsx42("span", { children: messages.pagination.jumpTo }),
|
|
3997
|
+
/* @__PURE__ */ jsx42(
|
|
3995
3998
|
Input,
|
|
3996
3999
|
{
|
|
3997
4000
|
"aria-label": messages.pagination.jumpTo,
|
|
@@ -4019,12 +4022,12 @@ function AdsDataPagination({
|
|
|
4019
4022
|
}
|
|
4020
4023
|
|
|
4021
4024
|
// src/components/AdsDataTable/index.tsx
|
|
4022
|
-
import * as
|
|
4025
|
+
import * as React44 from "react";
|
|
4023
4026
|
import { ChevronDown as ChevronDown5, Filter } from "lucide-react";
|
|
4024
4027
|
|
|
4025
4028
|
// src/components/AdsEmpty/index.tsx
|
|
4026
4029
|
import { cva as cva9 } from "class-variance-authority";
|
|
4027
|
-
import { jsx as
|
|
4030
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4028
4031
|
var adsEmptyVariants = cva9(
|
|
4029
4032
|
"flex w-full flex-col items-center justify-center gap-6 p-12 text-center",
|
|
4030
4033
|
{
|
|
@@ -4041,7 +4044,7 @@ var adsEmptyVariants = cva9(
|
|
|
4041
4044
|
}
|
|
4042
4045
|
);
|
|
4043
4046
|
function AdsEmpty({ className, variant, ...props }) {
|
|
4044
|
-
return /* @__PURE__ */
|
|
4047
|
+
return /* @__PURE__ */ jsx43(
|
|
4045
4048
|
"div",
|
|
4046
4049
|
{
|
|
4047
4050
|
"data-slot": "ads-empty",
|
|
@@ -4051,7 +4054,7 @@ function AdsEmpty({ className, variant, ...props }) {
|
|
|
4051
4054
|
);
|
|
4052
4055
|
}
|
|
4053
4056
|
function AdsEmptyHeader({ className, ...props }) {
|
|
4054
|
-
return /* @__PURE__ */
|
|
4057
|
+
return /* @__PURE__ */ jsx43(
|
|
4055
4058
|
"div",
|
|
4056
4059
|
{
|
|
4057
4060
|
"data-slot": "ads-empty-header",
|
|
@@ -4061,7 +4064,7 @@ function AdsEmptyHeader({ className, ...props }) {
|
|
|
4061
4064
|
);
|
|
4062
4065
|
}
|
|
4063
4066
|
function AdsEmptyMedia({ className, ...props }) {
|
|
4064
|
-
return /* @__PURE__ */
|
|
4067
|
+
return /* @__PURE__ */ jsx43(
|
|
4065
4068
|
"div",
|
|
4066
4069
|
{
|
|
4067
4070
|
"data-slot": "ads-empty-media",
|
|
@@ -4075,7 +4078,7 @@ function AdsEmptyMedia({ className, ...props }) {
|
|
|
4075
4078
|
);
|
|
4076
4079
|
}
|
|
4077
4080
|
function AdsEmptyTitle({ className, ...props }) {
|
|
4078
|
-
return /* @__PURE__ */
|
|
4081
|
+
return /* @__PURE__ */ jsx43(
|
|
4079
4082
|
"div",
|
|
4080
4083
|
{
|
|
4081
4084
|
"data-slot": "ads-empty-title",
|
|
@@ -4085,7 +4088,7 @@ function AdsEmptyTitle({ className, ...props }) {
|
|
|
4085
4088
|
);
|
|
4086
4089
|
}
|
|
4087
4090
|
function AdsEmptyDescription({ className, ...props }) {
|
|
4088
|
-
return /* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ jsx43(
|
|
4089
4092
|
"p",
|
|
4090
4093
|
{
|
|
4091
4094
|
"data-slot": "ads-empty-description",
|
|
@@ -4095,7 +4098,7 @@ function AdsEmptyDescription({ className, ...props }) {
|
|
|
4095
4098
|
);
|
|
4096
4099
|
}
|
|
4097
4100
|
function AdsEmptyContent({ className, ...props }) {
|
|
4098
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx43(
|
|
4099
4102
|
"div",
|
|
4100
4103
|
{
|
|
4101
4104
|
"data-slot": "ads-empty-content",
|
|
@@ -4105,7 +4108,7 @@ function AdsEmptyContent({ className, ...props }) {
|
|
|
4105
4108
|
);
|
|
4106
4109
|
}
|
|
4107
4110
|
function AdsEmptyActions({ className, ...props }) {
|
|
4108
|
-
return /* @__PURE__ */
|
|
4111
|
+
return /* @__PURE__ */ jsx43(
|
|
4109
4112
|
"div",
|
|
4110
4113
|
{
|
|
4111
4114
|
"data-slot": "ads-empty-actions",
|
|
@@ -4115,7 +4118,7 @@ function AdsEmptyActions({ className, ...props }) {
|
|
|
4115
4118
|
);
|
|
4116
4119
|
}
|
|
4117
4120
|
function AdsEmptyFooter({ className, ...props }) {
|
|
4118
|
-
return /* @__PURE__ */
|
|
4121
|
+
return /* @__PURE__ */ jsx43(
|
|
4119
4122
|
"div",
|
|
4120
4123
|
{
|
|
4121
4124
|
"data-slot": "ads-empty-footer",
|
|
@@ -4126,19 +4129,19 @@ function AdsEmptyFooter({ className, ...props }) {
|
|
|
4126
4129
|
}
|
|
4127
4130
|
|
|
4128
4131
|
// src/components/AdsTable/index.tsx
|
|
4129
|
-
import * as
|
|
4132
|
+
import * as React43 from "react";
|
|
4130
4133
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
4131
4134
|
|
|
4132
4135
|
// src/components/AdsRadioGroup/index.tsx
|
|
4133
|
-
import * as
|
|
4136
|
+
import * as React41 from "react";
|
|
4134
4137
|
|
|
4135
4138
|
// src/primitives/radio-group.tsx
|
|
4136
|
-
import * as
|
|
4139
|
+
import * as React40 from "react";
|
|
4137
4140
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4138
4141
|
import { Circle } from "lucide-react";
|
|
4139
|
-
import { jsx as
|
|
4140
|
-
var RadioGroup =
|
|
4141
|
-
return /* @__PURE__ */
|
|
4142
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4143
|
+
var RadioGroup = React40.forwardRef(({ className, ...props }, ref) => {
|
|
4144
|
+
return /* @__PURE__ */ jsx44(
|
|
4142
4145
|
RadioGroupPrimitive.Root,
|
|
4143
4146
|
{
|
|
4144
4147
|
className: cn("grid gap-2", className),
|
|
@@ -4148,8 +4151,8 @@ var RadioGroup = React39.forwardRef(({ className, ...props }, ref) => {
|
|
|
4148
4151
|
);
|
|
4149
4152
|
});
|
|
4150
4153
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4151
|
-
var RadioGroupItem =
|
|
4152
|
-
return /* @__PURE__ */
|
|
4154
|
+
var RadioGroupItem = React40.forwardRef(({ className, ...props }, ref) => {
|
|
4155
|
+
return /* @__PURE__ */ jsx44(
|
|
4153
4156
|
RadioGroupPrimitive.Item,
|
|
4154
4157
|
{
|
|
4155
4158
|
ref,
|
|
@@ -4158,19 +4161,19 @@ var RadioGroupItem = React39.forwardRef(({ className, ...props }, ref) => {
|
|
|
4158
4161
|
className
|
|
4159
4162
|
),
|
|
4160
4163
|
...props,
|
|
4161
|
-
children: /* @__PURE__ */
|
|
4164
|
+
children: /* @__PURE__ */ jsx44(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx44(Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
4162
4165
|
}
|
|
4163
4166
|
);
|
|
4164
4167
|
});
|
|
4165
4168
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
4166
4169
|
|
|
4167
4170
|
// src/components/AdsRadioGroup/index.tsx
|
|
4168
|
-
import { jsx as
|
|
4171
|
+
import { jsx as jsx45, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4169
4172
|
var radioGroupBaseClassName = "gap-3";
|
|
4170
4173
|
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";
|
|
4171
|
-
var RadioGroup2 =
|
|
4174
|
+
var RadioGroup2 = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(RadioGroup, { className: cn(radioGroupBaseClassName, className), ref, ...props }));
|
|
4172
4175
|
RadioGroup2.displayName = "RadioGroup";
|
|
4173
|
-
var RadioGroupItem2 =
|
|
4176
|
+
var RadioGroupItem2 = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4174
4177
|
RadioGroupItem,
|
|
4175
4178
|
{
|
|
4176
4179
|
className: cn(radioItemBaseClassName, className),
|
|
@@ -4179,7 +4182,7 @@ var RadioGroupItem2 = React40.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4179
4182
|
}
|
|
4180
4183
|
));
|
|
4181
4184
|
RadioGroupItem2.displayName = "RadioGroupItem";
|
|
4182
|
-
var AdsRadioGroup =
|
|
4185
|
+
var AdsRadioGroup = React41.forwardRef(
|
|
4183
4186
|
({
|
|
4184
4187
|
children,
|
|
4185
4188
|
className,
|
|
@@ -4195,12 +4198,12 @@ var AdsRadioGroup = React40.forwardRef(
|
|
|
4195
4198
|
helperText,
|
|
4196
4199
|
id
|
|
4197
4200
|
});
|
|
4198
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
4199
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
4201
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx45(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
4202
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx45(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
4200
4203
|
return /* @__PURE__ */ jsxs21(AdsFieldItem, { children: [
|
|
4201
|
-
label ? /* @__PURE__ */
|
|
4204
|
+
label ? /* @__PURE__ */ jsx45(AdsFieldLabel, { children: label }) : null,
|
|
4202
4205
|
descriptionPlacement === "above" ? helperNode : null,
|
|
4203
|
-
/* @__PURE__ */
|
|
4206
|
+
/* @__PURE__ */ jsx45(
|
|
4204
4207
|
RadioGroup2,
|
|
4205
4208
|
{
|
|
4206
4209
|
"aria-describedby": description.describedBy,
|
|
@@ -4216,11 +4219,11 @@ var AdsRadioGroup = React40.forwardRef(
|
|
|
4216
4219
|
}
|
|
4217
4220
|
);
|
|
4218
4221
|
AdsRadioGroup.displayName = "AdsRadioGroup";
|
|
4219
|
-
var AdsRadioGroupOption =
|
|
4220
|
-
const generatedId =
|
|
4222
|
+
var AdsRadioGroupOption = React41.forwardRef(({ className, description, id, label, value, ...props }, ref) => {
|
|
4223
|
+
const generatedId = React41.useId();
|
|
4221
4224
|
const inputId = id ?? generatedId;
|
|
4222
4225
|
return /* @__PURE__ */ jsxs21("label", { className: "flex w-full cursor-pointer items-start gap-2", htmlFor: inputId, children: [
|
|
4223
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx45(
|
|
4224
4227
|
RadioGroupItem2,
|
|
4225
4228
|
{
|
|
4226
4229
|
className: cn(className),
|
|
@@ -4231,19 +4234,19 @@ var AdsRadioGroupOption = React40.forwardRef(({ className, description, id, labe
|
|
|
4231
4234
|
}
|
|
4232
4235
|
),
|
|
4233
4236
|
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
description ? /* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx45("div", { className: "text-sm leading-5 text-foreground", children: label }),
|
|
4238
|
+
description ? /* @__PURE__ */ jsx45(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
4236
4239
|
] })
|
|
4237
4240
|
] });
|
|
4238
4241
|
});
|
|
4239
4242
|
AdsRadioGroupOption.displayName = "AdsRadioGroupOption";
|
|
4240
|
-
var AdsRadioGroupCardOption =
|
|
4241
|
-
const generatedId =
|
|
4243
|
+
var AdsRadioGroupCardOption = React41.forwardRef(({ className, description, disabled, id, label, value, ...props }, ref) => {
|
|
4244
|
+
const generatedId = React41.useId();
|
|
4242
4245
|
const inputId = id ?? generatedId;
|
|
4243
4246
|
const titleId = `${inputId}-label`;
|
|
4244
4247
|
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
4245
4248
|
return /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
4246
|
-
/* @__PURE__ */
|
|
4249
|
+
/* @__PURE__ */ jsx45(
|
|
4247
4250
|
RadioGroupItem2,
|
|
4248
4251
|
{
|
|
4249
4252
|
"aria-describedby": descriptionId,
|
|
@@ -4266,15 +4269,15 @@ var AdsRadioGroupCardOption = React40.forwardRef(({ className, description, disa
|
|
|
4266
4269
|
),
|
|
4267
4270
|
children: [
|
|
4268
4271
|
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4269
|
-
/* @__PURE__ */
|
|
4270
|
-
description ? /* @__PURE__ */
|
|
4272
|
+
/* @__PURE__ */ jsx45("div", { className: "text-sm font-medium leading-5 text-foreground", id: titleId, children: label }),
|
|
4273
|
+
description ? /* @__PURE__ */ jsx45(AdsFieldDescription, { className: "text-xs leading-4", id: descriptionId, children: description }) : null
|
|
4271
4274
|
] }),
|
|
4272
|
-
/* @__PURE__ */
|
|
4275
|
+
/* @__PURE__ */ jsx45("div", { className: "flex h-full shrink-0 items-start justify-center pt-px", children: /* @__PURE__ */ jsx45(
|
|
4273
4276
|
"div",
|
|
4274
4277
|
{
|
|
4275
4278
|
className: "grid h-4 w-4 place-content-center rounded-full border bg-card shadow-[0px_1px_2px_rgba(0,0,0,0.1)]",
|
|
4276
4279
|
"data-indicator": true,
|
|
4277
|
-
children: /* @__PURE__ */
|
|
4280
|
+
children: /* @__PURE__ */ jsx45(
|
|
4278
4281
|
"span",
|
|
4279
4282
|
{
|
|
4280
4283
|
className: "h-2 w-2 rounded-full bg-primary transition-opacity",
|
|
@@ -4291,9 +4294,9 @@ var AdsRadioGroupCardOption = React40.forwardRef(({ className, description, disa
|
|
|
4291
4294
|
AdsRadioGroupCardOption.displayName = "AdsRadioGroupCardOption";
|
|
4292
4295
|
|
|
4293
4296
|
// src/primitives/table.tsx
|
|
4294
|
-
import * as
|
|
4295
|
-
import { jsx as
|
|
4296
|
-
var Table =
|
|
4297
|
+
import * as React42 from "react";
|
|
4298
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4299
|
+
var Table = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4297
4300
|
"table",
|
|
4298
4301
|
{
|
|
4299
4302
|
ref,
|
|
@@ -4302,7 +4305,7 @@ var Table = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
4302
4305
|
}
|
|
4303
4306
|
));
|
|
4304
4307
|
Table.displayName = "Table";
|
|
4305
|
-
var TableScrollArea =
|
|
4308
|
+
var TableScrollArea = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4306
4309
|
"div",
|
|
4307
4310
|
{
|
|
4308
4311
|
ref,
|
|
@@ -4311,9 +4314,9 @@ var TableScrollArea = React41.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4311
4314
|
}
|
|
4312
4315
|
));
|
|
4313
4316
|
TableScrollArea.displayName = "TableScrollArea";
|
|
4314
|
-
var TableHeader =
|
|
4317
|
+
var TableHeader = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
4315
4318
|
TableHeader.displayName = "TableHeader";
|
|
4316
|
-
var TableBody =
|
|
4319
|
+
var TableBody = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4317
4320
|
"tbody",
|
|
4318
4321
|
{
|
|
4319
4322
|
ref,
|
|
@@ -4322,7 +4325,7 @@ var TableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4322
4325
|
}
|
|
4323
4326
|
));
|
|
4324
4327
|
TableBody.displayName = "TableBody";
|
|
4325
|
-
var TableFooter =
|
|
4328
|
+
var TableFooter = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4326
4329
|
"tfoot",
|
|
4327
4330
|
{
|
|
4328
4331
|
ref,
|
|
@@ -4334,7 +4337,7 @@ var TableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4334
4337
|
}
|
|
4335
4338
|
));
|
|
4336
4339
|
TableFooter.displayName = "TableFooter";
|
|
4337
|
-
var TableRow =
|
|
4340
|
+
var TableRow = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4338
4341
|
"tr",
|
|
4339
4342
|
{
|
|
4340
4343
|
ref,
|
|
@@ -4346,7 +4349,7 @@ var TableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4346
4349
|
}
|
|
4347
4350
|
));
|
|
4348
4351
|
TableRow.displayName = "TableRow";
|
|
4349
|
-
var TableHead =
|
|
4352
|
+
var TableHead = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4350
4353
|
"th",
|
|
4351
4354
|
{
|
|
4352
4355
|
ref,
|
|
@@ -4358,7 +4361,7 @@ var TableHead = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4358
4361
|
}
|
|
4359
4362
|
));
|
|
4360
4363
|
TableHead.displayName = "TableHead";
|
|
4361
|
-
var TableCell =
|
|
4364
|
+
var TableCell = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4362
4365
|
"td",
|
|
4363
4366
|
{
|
|
4364
4367
|
ref,
|
|
@@ -4367,7 +4370,7 @@ var TableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4367
4370
|
}
|
|
4368
4371
|
));
|
|
4369
4372
|
TableCell.displayName = "TableCell";
|
|
4370
|
-
var TableCaption =
|
|
4373
|
+
var TableCaption = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4371
4374
|
"caption",
|
|
4372
4375
|
{
|
|
4373
4376
|
ref,
|
|
@@ -4376,21 +4379,21 @@ var TableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4376
4379
|
}
|
|
4377
4380
|
));
|
|
4378
4381
|
TableCaption.displayName = "TableCaption";
|
|
4379
|
-
var TableColGroup =
|
|
4382
|
+
var TableColGroup = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46("colgroup", { ref, className: cn(className), ...props }));
|
|
4380
4383
|
TableColGroup.displayName = "TableColGroup";
|
|
4381
|
-
var TableCol =
|
|
4384
|
+
var TableCol = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46("col", { ref, className: cn(className), ...props }));
|
|
4382
4385
|
TableCol.displayName = "TableCol";
|
|
4383
4386
|
|
|
4384
4387
|
// src/components/AdsTable/index.tsx
|
|
4385
|
-
import { jsx as
|
|
4386
|
-
var AdsTableStickyHeaderContext =
|
|
4388
|
+
import { jsx as jsx47, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4389
|
+
var AdsTableStickyHeaderContext = React43.createContext(false);
|
|
4387
4390
|
function resolveLength(value) {
|
|
4388
4391
|
if (value === void 0) {
|
|
4389
4392
|
return void 0;
|
|
4390
4393
|
}
|
|
4391
4394
|
return typeof value === "number" ? `${value}px` : value;
|
|
4392
4395
|
}
|
|
4393
|
-
var AdsTableSurface =
|
|
4396
|
+
var AdsTableSurface = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4394
4397
|
"div",
|
|
4395
4398
|
{
|
|
4396
4399
|
ref,
|
|
@@ -4402,8 +4405,8 @@ var AdsTableSurface = React42.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4402
4405
|
}
|
|
4403
4406
|
));
|
|
4404
4407
|
AdsTableSurface.displayName = "AdsTableSurface";
|
|
4405
|
-
var AdsTableRoot =
|
|
4406
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4408
|
+
var AdsTableRoot = React43.forwardRef(
|
|
4409
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4407
4410
|
Table,
|
|
4408
4411
|
{
|
|
4409
4412
|
ref,
|
|
@@ -4418,7 +4421,7 @@ var AdsTableRoot = React42.forwardRef(
|
|
|
4418
4421
|
)
|
|
4419
4422
|
);
|
|
4420
4423
|
AdsTableRoot.displayName = "AdsTableRoot";
|
|
4421
|
-
var AdsTableScrollArea =
|
|
4424
|
+
var AdsTableScrollArea = React43.forwardRef(
|
|
4422
4425
|
({
|
|
4423
4426
|
children,
|
|
4424
4427
|
className,
|
|
@@ -4428,7 +4431,7 @@ var AdsTableScrollArea = React42.forwardRef(
|
|
|
4428
4431
|
x,
|
|
4429
4432
|
y,
|
|
4430
4433
|
...props
|
|
4431
|
-
}, ref) => /* @__PURE__ */
|
|
4434
|
+
}, ref) => /* @__PURE__ */ jsx47(AdsTableStickyHeaderContext.Provider, { value: stickyHeader, children: /* @__PURE__ */ jsx47(
|
|
4432
4435
|
TableScrollArea,
|
|
4433
4436
|
{
|
|
4434
4437
|
ref,
|
|
@@ -4450,15 +4453,15 @@ var AdsTableScrollArea = React42.forwardRef(
|
|
|
4450
4453
|
) })
|
|
4451
4454
|
);
|
|
4452
4455
|
AdsTableScrollArea.displayName = "AdsTableScrollArea";
|
|
4453
|
-
var AdsTable =
|
|
4454
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4456
|
+
var AdsTable = React43.forwardRef(
|
|
4457
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx47(AdsTableSurface, { children: /* @__PURE__ */ jsx47(AdsTableScrollArea, { children: /* @__PURE__ */ jsx47(AdsTableRoot, { ref, className, ...props }) }) })
|
|
4455
4458
|
);
|
|
4456
4459
|
AdsTable.displayName = "AdsTable";
|
|
4457
|
-
var AdsTableColGroup =
|
|
4460
|
+
var AdsTableColGroup = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(TableColGroup, { ref, className, ...props }));
|
|
4458
4461
|
AdsTableColGroup.displayName = "AdsTableColGroup";
|
|
4459
|
-
var AdsTableCol =
|
|
4462
|
+
var AdsTableCol = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(TableCol, { ref, className, ...props }));
|
|
4460
4463
|
AdsTableCol.displayName = "AdsTableCol";
|
|
4461
|
-
var AdsTableHeader =
|
|
4464
|
+
var AdsTableHeader = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4462
4465
|
TableHeader,
|
|
4463
4466
|
{
|
|
4464
4467
|
ref,
|
|
@@ -4467,7 +4470,7 @@ var AdsTableHeader = React42.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4467
4470
|
}
|
|
4468
4471
|
));
|
|
4469
4472
|
AdsTableHeader.displayName = "AdsTableHeader";
|
|
4470
|
-
var AdsTableBody =
|
|
4473
|
+
var AdsTableBody = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4471
4474
|
TableBody,
|
|
4472
4475
|
{
|
|
4473
4476
|
ref,
|
|
@@ -4476,7 +4479,7 @@ var AdsTableBody = React42.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4476
4479
|
}
|
|
4477
4480
|
));
|
|
4478
4481
|
AdsTableBody.displayName = "AdsTableBody";
|
|
4479
|
-
var AdsTableFooter =
|
|
4482
|
+
var AdsTableFooter = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4480
4483
|
TableFooter,
|
|
4481
4484
|
{
|
|
4482
4485
|
ref,
|
|
@@ -4489,7 +4492,7 @@ var AdsTableFooter = React42.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4489
4492
|
}
|
|
4490
4493
|
));
|
|
4491
4494
|
AdsTableFooter.displayName = "AdsTableFooter";
|
|
4492
|
-
var AdsTableRow =
|
|
4495
|
+
var AdsTableRow = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4493
4496
|
TableRow,
|
|
4494
4497
|
{
|
|
4495
4498
|
ref,
|
|
@@ -4501,9 +4504,9 @@ var AdsTableRow = React42.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4501
4504
|
}
|
|
4502
4505
|
));
|
|
4503
4506
|
AdsTableRow.displayName = "AdsTableRow";
|
|
4504
|
-
var AdsTableHead =
|
|
4505
|
-
const stickyHeader =
|
|
4506
|
-
return /* @__PURE__ */
|
|
4507
|
+
var AdsTableHead = React43.forwardRef(({ className, ...props }, ref) => {
|
|
4508
|
+
const stickyHeader = React43.useContext(AdsTableStickyHeaderContext);
|
|
4509
|
+
return /* @__PURE__ */ jsx47(
|
|
4507
4510
|
TableHead,
|
|
4508
4511
|
{
|
|
4509
4512
|
ref,
|
|
@@ -4518,7 +4521,7 @@ var AdsTableHead = React42.forwardRef(({ className, ...props }, ref) => {
|
|
|
4518
4521
|
);
|
|
4519
4522
|
});
|
|
4520
4523
|
AdsTableHead.displayName = "AdsTableHead";
|
|
4521
|
-
var AdsTableCell =
|
|
4524
|
+
var AdsTableCell = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4522
4525
|
TableCell,
|
|
4523
4526
|
{
|
|
4524
4527
|
ref,
|
|
@@ -4531,7 +4534,7 @@ var AdsTableCell = React42.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4531
4534
|
}
|
|
4532
4535
|
));
|
|
4533
4536
|
AdsTableCell.displayName = "AdsTableCell";
|
|
4534
|
-
var AdsTableCaption =
|
|
4537
|
+
var AdsTableCaption = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4535
4538
|
TableCaption,
|
|
4536
4539
|
{
|
|
4537
4540
|
ref,
|
|
@@ -4540,12 +4543,12 @@ var AdsTableCaption = React42.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4540
4543
|
}
|
|
4541
4544
|
));
|
|
4542
4545
|
AdsTableCaption.displayName = "AdsTableCaption";
|
|
4543
|
-
var AdsTableSortHeader =
|
|
4546
|
+
var AdsTableSortHeader = React43.forwardRef(
|
|
4544
4547
|
({ className, disabled = false, onToggleSort, sortOrder, title, ...props }, ref) => {
|
|
4545
4548
|
const { messages } = useAdsI18n();
|
|
4546
4549
|
const nextOrder = sortOrder === null ? "ascend" : sortOrder === "ascend" ? "descend" : null;
|
|
4547
4550
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
4548
|
-
return /* @__PURE__ */
|
|
4551
|
+
return /* @__PURE__ */ jsx47(AdsTableHead, { ref, className, ...props, children: /* @__PURE__ */ jsxs22(
|
|
4549
4552
|
Button,
|
|
4550
4553
|
{
|
|
4551
4554
|
"aria-label": `${title} ${actionLabel}`,
|
|
@@ -4561,15 +4564,15 @@ var AdsTableSortHeader = React42.forwardRef(
|
|
|
4561
4564
|
type: "button",
|
|
4562
4565
|
variant: "ghost",
|
|
4563
4566
|
children: [
|
|
4564
|
-
/* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ jsx47("span", { className: "truncate", children: title }),
|
|
4568
|
+
/* @__PURE__ */ jsx47("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: sortOrder === "ascend" ? /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4 rotate-180" }) : sortOrder === "descend" ? /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4 opacity-60" }) })
|
|
4566
4569
|
]
|
|
4567
4570
|
}
|
|
4568
4571
|
) });
|
|
4569
4572
|
}
|
|
4570
4573
|
);
|
|
4571
4574
|
AdsTableSortHeader.displayName = "AdsTableSortHeader";
|
|
4572
|
-
var AdsTableSelectionCell =
|
|
4575
|
+
var AdsTableSelectionCell = React43.forwardRef(
|
|
4573
4576
|
({
|
|
4574
4577
|
checked = false,
|
|
4575
4578
|
className,
|
|
@@ -4580,7 +4583,7 @@ var AdsTableSelectionCell = React42.forwardRef(
|
|
|
4580
4583
|
...props
|
|
4581
4584
|
}, ref) => {
|
|
4582
4585
|
const { messages } = useAdsI18n();
|
|
4583
|
-
return /* @__PURE__ */
|
|
4586
|
+
return /* @__PURE__ */ jsx47(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ jsx47("div", { className: "flex items-center justify-center", children: type === "radio" ? /* @__PURE__ */ jsx47(
|
|
4584
4587
|
RadioGroupItem2,
|
|
4585
4588
|
{
|
|
4586
4589
|
"aria-label": messages.table.selectRow,
|
|
@@ -4592,7 +4595,7 @@ var AdsTableSelectionCell = React42.forwardRef(
|
|
|
4592
4595
|
},
|
|
4593
4596
|
value
|
|
4594
4597
|
}
|
|
4595
|
-
) : /* @__PURE__ */
|
|
4598
|
+
) : /* @__PURE__ */ jsx47(
|
|
4596
4599
|
Checkbox2,
|
|
4597
4600
|
{
|
|
4598
4601
|
"aria-label": messages.table.selectRow,
|
|
@@ -4606,10 +4609,10 @@ var AdsTableSelectionCell = React42.forwardRef(
|
|
|
4606
4609
|
}
|
|
4607
4610
|
);
|
|
4608
4611
|
AdsTableSelectionCell.displayName = "AdsTableSelectionCell";
|
|
4609
|
-
var AdsTableExpandCell =
|
|
4612
|
+
var AdsTableExpandCell = React43.forwardRef(
|
|
4610
4613
|
({ className, disabled = false, expanded = false, onToggle, ...props }, ref) => {
|
|
4611
4614
|
const { messages } = useAdsI18n();
|
|
4612
|
-
return /* @__PURE__ */
|
|
4615
|
+
return /* @__PURE__ */ jsx47(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ jsx47("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx47(
|
|
4613
4616
|
Button,
|
|
4614
4617
|
{
|
|
4615
4618
|
"aria-label": expanded ? messages.table.collapseRow : messages.table.expandRow,
|
|
@@ -4626,7 +4629,7 @@ var AdsTableExpandCell = React42.forwardRef(
|
|
|
4626
4629
|
size: "sm",
|
|
4627
4630
|
type: "button",
|
|
4628
4631
|
variant: "ghost",
|
|
4629
|
-
children: expanded ? /* @__PURE__ */
|
|
4632
|
+
children: expanded ? /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx47(ChevronRight5, { className: "h-4 w-4" })
|
|
4630
4633
|
}
|
|
4631
4634
|
) }) });
|
|
4632
4635
|
}
|
|
@@ -4634,38 +4637,23 @@ var AdsTableExpandCell = React42.forwardRef(
|
|
|
4634
4637
|
AdsTableExpandCell.displayName = "AdsTableExpandCell";
|
|
4635
4638
|
|
|
4636
4639
|
// src/components/AdsDataTable/index.tsx
|
|
4637
|
-
import { jsx as
|
|
4640
|
+
import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4638
4641
|
var SKELETON_ROW_COUNT = 4;
|
|
4639
4642
|
var FLEX_WIDTH_UNIT = 160;
|
|
4640
4643
|
var sizeClassNames = {
|
|
4641
4644
|
small: {
|
|
4642
|
-
bodyHeight: 32,
|
|
4643
4645
|
cell: "py-1.5 text-xs leading-4",
|
|
4644
|
-
headHeight: 32,
|
|
4645
4646
|
head: "h-8 py-1.5 text-xs leading-4"
|
|
4646
4647
|
},
|
|
4647
4648
|
middle: {
|
|
4648
|
-
bodyHeight: 40,
|
|
4649
4649
|
cell: "py-2 text-sm leading-5",
|
|
4650
|
-
headHeight: 40,
|
|
4651
4650
|
head: "h-10 py-2 text-sm leading-5"
|
|
4652
4651
|
},
|
|
4653
4652
|
large: {
|
|
4654
|
-
bodyHeight: 48,
|
|
4655
4653
|
cell: "py-3 text-base leading-6",
|
|
4656
|
-
headHeight: 48,
|
|
4657
4654
|
head: "h-12 py-3 text-base leading-6"
|
|
4658
4655
|
}
|
|
4659
4656
|
};
|
|
4660
|
-
function getSpinnerLoadingHeight(scrollY, density) {
|
|
4661
|
-
if (typeof scrollY === "number") {
|
|
4662
|
-
return Math.max(scrollY - density.headHeight, density.bodyHeight * SKELETON_ROW_COUNT);
|
|
4663
|
-
}
|
|
4664
|
-
if (typeof scrollY === "string") {
|
|
4665
|
-
return `max(calc(${scrollY} - ${density.headHeight}px), ${density.bodyHeight * SKELETON_ROW_COUNT}px)`;
|
|
4666
|
-
}
|
|
4667
|
-
return density.bodyHeight * SKELETON_ROW_COUNT;
|
|
4668
|
-
}
|
|
4669
4657
|
function getColumnKey(column, index) {
|
|
4670
4658
|
if (column.key !== void 0) {
|
|
4671
4659
|
return String(column.key);
|
|
@@ -4771,7 +4759,7 @@ function getCellStyle(column, overrideWidth) {
|
|
|
4771
4759
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
4772
4760
|
}
|
|
4773
4761
|
function renderCellValue(value, ellipsis) {
|
|
4774
|
-
if (
|
|
4762
|
+
if (React44.isValidElement(value)) {
|
|
4775
4763
|
return value;
|
|
4776
4764
|
}
|
|
4777
4765
|
if (value === null || value === void 0) {
|
|
@@ -4781,7 +4769,7 @@ function renderCellValue(value, ellipsis) {
|
|
|
4781
4769
|
if (ellipsis) {
|
|
4782
4770
|
const shouldShowTitle = typeof ellipsis === "object" ? ellipsis.showTitle !== false : true;
|
|
4783
4771
|
const maxWidth = typeof ellipsis === "object" ? ellipsis.maxWidth : void 0;
|
|
4784
|
-
return /* @__PURE__ */
|
|
4772
|
+
return /* @__PURE__ */ jsx48(
|
|
4785
4773
|
"div",
|
|
4786
4774
|
{
|
|
4787
4775
|
className: "truncate",
|
|
@@ -4876,8 +4864,6 @@ function AdsDataTable({
|
|
|
4876
4864
|
dataSource = [],
|
|
4877
4865
|
rowKey,
|
|
4878
4866
|
loading = false,
|
|
4879
|
-
loadingVariant = "skeleton",
|
|
4880
|
-
expandedRowSurface = "inset",
|
|
4881
4867
|
emptyText,
|
|
4882
4868
|
emptyState,
|
|
4883
4869
|
rowClassName,
|
|
@@ -4896,48 +4882,48 @@ function AdsDataTable({
|
|
|
4896
4882
|
suppressRowClickSelection = true
|
|
4897
4883
|
}) {
|
|
4898
4884
|
const { messages } = useAdsI18n();
|
|
4899
|
-
const resolvedColumns =
|
|
4900
|
-
const [internalSortState, setInternalSortState] =
|
|
4885
|
+
const resolvedColumns = React44.useMemo(() => columns.filter(Boolean), [columns]);
|
|
4886
|
+
const [internalSortState, setInternalSortState] = React44.useState(
|
|
4901
4887
|
() => getInitialSortState(resolvedColumns)
|
|
4902
4888
|
);
|
|
4903
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
4889
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = React44.useState(
|
|
4904
4890
|
rowSelection?.defaultSelectedRowKeys ?? rowSelection?.selectedRowKeys ?? []
|
|
4905
4891
|
);
|
|
4906
|
-
const [internalFilterValues, setInternalFilterValues] =
|
|
4892
|
+
const [internalFilterValues, setInternalFilterValues] = React44.useState(
|
|
4907
4893
|
() => getInitialFilterValues(resolvedColumns)
|
|
4908
4894
|
);
|
|
4909
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
4895
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = React44.useState(
|
|
4910
4896
|
expandable?.defaultExpandedRowKeys ?? expandable?.expandedRowKeys ?? []
|
|
4911
4897
|
);
|
|
4912
|
-
const [internalColumnWidths, setInternalColumnWidths] =
|
|
4913
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
4898
|
+
const [internalColumnWidths, setInternalColumnWidths] = React44.useState({});
|
|
4899
|
+
const [internalCurrentPage, setInternalCurrentPage] = React44.useState(
|
|
4914
4900
|
pagination !== false ? pagination.defaultCurrent ?? pagination.current ?? 1 : 1
|
|
4915
4901
|
);
|
|
4916
|
-
const [internalPageSize, setInternalPageSize] =
|
|
4902
|
+
const [internalPageSize, setInternalPageSize] = React44.useState(
|
|
4917
4903
|
pagination !== false ? pagination.defaultPageSize ?? pagination.pageSize ?? 10 : 10
|
|
4918
4904
|
);
|
|
4919
|
-
const [activeResize, setActiveResize] =
|
|
4920
|
-
|
|
4905
|
+
const [activeResize, setActiveResize] = React44.useState(null);
|
|
4906
|
+
React44.useEffect(() => {
|
|
4921
4907
|
if (rowSelection?.selectedRowKeys !== void 0) {
|
|
4922
4908
|
setInternalSelectedKeys(rowSelection.selectedRowKeys);
|
|
4923
4909
|
}
|
|
4924
4910
|
}, [rowSelection?.selectedRowKeys]);
|
|
4925
|
-
|
|
4911
|
+
React44.useEffect(() => {
|
|
4926
4912
|
if (expandable?.expandedRowKeys !== void 0) {
|
|
4927
4913
|
setInternalExpandedKeys(expandable.expandedRowKeys);
|
|
4928
4914
|
}
|
|
4929
4915
|
}, [expandable?.expandedRowKeys]);
|
|
4930
|
-
|
|
4916
|
+
React44.useEffect(() => {
|
|
4931
4917
|
if (pagination !== false && pagination.current !== void 0) {
|
|
4932
4918
|
setInternalCurrentPage(pagination.current);
|
|
4933
4919
|
}
|
|
4934
4920
|
}, [pagination]);
|
|
4935
|
-
|
|
4921
|
+
React44.useEffect(() => {
|
|
4936
4922
|
if (pagination !== false && pagination.pageSize !== void 0) {
|
|
4937
4923
|
setInternalPageSize(pagination.pageSize);
|
|
4938
4924
|
}
|
|
4939
4925
|
}, [pagination]);
|
|
4940
|
-
|
|
4926
|
+
React44.useEffect(() => {
|
|
4941
4927
|
setInternalFilterValues((previous) => {
|
|
4942
4928
|
const next = { ...previous };
|
|
4943
4929
|
let hasChanged = false;
|
|
@@ -4958,7 +4944,7 @@ function AdsDataTable({
|
|
|
4958
4944
|
return hasChanged ? next : previous;
|
|
4959
4945
|
});
|
|
4960
4946
|
}, [resolvedColumns]);
|
|
4961
|
-
const controlledSortState =
|
|
4947
|
+
const controlledSortState = React44.useMemo(() => {
|
|
4962
4948
|
const columnIndex = resolvedColumns.findIndex((column2) => column2.sortOrder !== void 0);
|
|
4963
4949
|
if (columnIndex === -1) {
|
|
4964
4950
|
return null;
|
|
@@ -4976,15 +4962,9 @@ function AdsDataTable({
|
|
|
4976
4962
|
const hasSelectionColumn = Boolean(rowSelection);
|
|
4977
4963
|
const hasExpandableColumn = Boolean(expandable?.expandedRowRender);
|
|
4978
4964
|
const density = sizeClassNames[size];
|
|
4979
|
-
const columnCount = resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn);
|
|
4980
4965
|
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
4981
4966
|
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
4982
|
-
const
|
|
4983
|
-
() => getSpinnerLoadingHeight(scroll?.y, density),
|
|
4984
|
-
[density, scroll?.y]
|
|
4985
|
-
);
|
|
4986
|
-
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";
|
|
4987
|
-
const filterValues = React43.useMemo(
|
|
4967
|
+
const filterValues = React44.useMemo(
|
|
4988
4968
|
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
4989
4969
|
const columnKey = getColumnKey(column, index);
|
|
4990
4970
|
accumulator[columnKey] = column.filterValue ?? internalFilterValues[columnKey] ?? "";
|
|
@@ -4992,7 +4972,7 @@ function AdsDataTable({
|
|
|
4992
4972
|
}, {}),
|
|
4993
4973
|
[internalFilterValues, resolvedColumns]
|
|
4994
4974
|
);
|
|
4995
|
-
const filteredData =
|
|
4975
|
+
const filteredData = React44.useMemo(() => {
|
|
4996
4976
|
const filterableColumns = resolvedColumns.filter((column) => column.filter);
|
|
4997
4977
|
if (filterableColumns.length === 0) {
|
|
4998
4978
|
return dataSource;
|
|
@@ -5012,7 +4992,7 @@ function AdsDataTable({
|
|
|
5012
4992
|
})
|
|
5013
4993
|
);
|
|
5014
4994
|
}, [dataSource, filterValues, resolvedColumns]);
|
|
5015
|
-
const sortedData =
|
|
4995
|
+
const sortedData = React44.useMemo(() => {
|
|
5016
4996
|
if (!sortState || !sortState.column || sortState.order === null) {
|
|
5017
4997
|
return filteredData;
|
|
5018
4998
|
}
|
|
@@ -5039,7 +5019,7 @@ function AdsDataTable({
|
|
|
5039
5019
|
Math.max(1, pagination.current ?? internalCurrentPage),
|
|
5040
5020
|
totalPages
|
|
5041
5021
|
);
|
|
5042
|
-
|
|
5022
|
+
React44.useEffect(() => {
|
|
5043
5023
|
if (pagination === false || pagination.current !== void 0) {
|
|
5044
5024
|
return;
|
|
5045
5025
|
}
|
|
@@ -5047,14 +5027,14 @@ function AdsDataTable({
|
|
|
5047
5027
|
setInternalCurrentPage(currentPage);
|
|
5048
5028
|
}
|
|
5049
5029
|
}, [currentPage, internalCurrentPage, pagination]);
|
|
5050
|
-
const paginatedData =
|
|
5030
|
+
const paginatedData = React44.useMemo(() => {
|
|
5051
5031
|
if (pagination === false || paginationMode === "server") {
|
|
5052
5032
|
return sortedData;
|
|
5053
5033
|
}
|
|
5054
5034
|
const start = (currentPage - 1) * currentPageSize;
|
|
5055
5035
|
return sortedData.slice(start, start + currentPageSize);
|
|
5056
5036
|
}, [currentPage, currentPageSize, pagination, paginationMode, sortedData]);
|
|
5057
|
-
const handleSortChange =
|
|
5037
|
+
const handleSortChange = React44.useCallback(
|
|
5058
5038
|
(column, columnKey, nextOrder) => {
|
|
5059
5039
|
const nextSortState = nextOrder === null ? null : {
|
|
5060
5040
|
column,
|
|
@@ -5068,7 +5048,7 @@ function AdsDataTable({
|
|
|
5068
5048
|
},
|
|
5069
5049
|
[controlledSortState, onSortChange]
|
|
5070
5050
|
);
|
|
5071
|
-
const handleFilterChange =
|
|
5051
|
+
const handleFilterChange = React44.useCallback(
|
|
5072
5052
|
(column, columnKey, nextValue) => {
|
|
5073
5053
|
if (column.filterValue === void 0) {
|
|
5074
5054
|
setInternalFilterValues((previous) => ({
|
|
@@ -5083,7 +5063,7 @@ function AdsDataTable({
|
|
|
5083
5063
|
},
|
|
5084
5064
|
[pagination]
|
|
5085
5065
|
);
|
|
5086
|
-
const updateSelection =
|
|
5066
|
+
const updateSelection = React44.useCallback(
|
|
5087
5067
|
(nextKeys) => {
|
|
5088
5068
|
if (!rowSelection) {
|
|
5089
5069
|
return;
|
|
@@ -5098,7 +5078,7 @@ function AdsDataTable({
|
|
|
5098
5078
|
},
|
|
5099
5079
|
[dataSource, rowKey, rowSelection]
|
|
5100
5080
|
);
|
|
5101
|
-
const toggleSelectionFromRowClick =
|
|
5081
|
+
const toggleSelectionFromRowClick = React44.useCallback(
|
|
5102
5082
|
(record, recordKey) => {
|
|
5103
5083
|
if (!allowsRowSelectionByClick || !rowSelection) {
|
|
5104
5084
|
return;
|
|
@@ -5112,7 +5092,7 @@ function AdsDataTable({
|
|
|
5112
5092
|
},
|
|
5113
5093
|
[allowsRowSelectionByClick, rowSelection, selectedKeys, updateSelection]
|
|
5114
5094
|
);
|
|
5115
|
-
const toggleExpanded =
|
|
5095
|
+
const toggleExpanded = React44.useCallback(
|
|
5116
5096
|
(record, recordKey) => {
|
|
5117
5097
|
if (!expandable?.expandedRowRender) {
|
|
5118
5098
|
return;
|
|
@@ -5129,11 +5109,11 @@ function AdsDataTable({
|
|
|
5129
5109
|
},
|
|
5130
5110
|
[expandable, expandedKeys]
|
|
5131
5111
|
);
|
|
5132
|
-
const renderedEmptyState = emptyState ?? /* @__PURE__ */
|
|
5133
|
-
/* @__PURE__ */
|
|
5134
|
-
typeof emptyText === "string" ? null : /* @__PURE__ */
|
|
5112
|
+
const renderedEmptyState = emptyState ?? /* @__PURE__ */ jsx48(AdsEmpty, { className: "min-h-[220px] py-12", children: /* @__PURE__ */ jsx48(AdsEmptyContent, { children: /* @__PURE__ */ jsxs23(AdsEmptyHeader, { children: [
|
|
5113
|
+
/* @__PURE__ */ jsx48(AdsEmptyTitle, { children: emptyText ?? messages.table.noDataAvailable }),
|
|
5114
|
+
typeof emptyText === "string" ? null : /* @__PURE__ */ jsx48(AdsEmptyDescription, { children: messages.table.noDataAvailable })
|
|
5135
5115
|
] }) }) });
|
|
5136
|
-
const handlePaginationChange =
|
|
5116
|
+
const handlePaginationChange = React44.useCallback(
|
|
5137
5117
|
(page, nextPageSize) => {
|
|
5138
5118
|
if (pagination === false) {
|
|
5139
5119
|
return;
|
|
@@ -5148,7 +5128,7 @@ function AdsDataTable({
|
|
|
5148
5128
|
},
|
|
5149
5129
|
[currentPageSize, pagination]
|
|
5150
5130
|
);
|
|
5151
|
-
const handlePageSizeChange =
|
|
5131
|
+
const handlePageSizeChange = React44.useCallback(
|
|
5152
5132
|
(nextPageSize, page) => {
|
|
5153
5133
|
if (pagination === false) {
|
|
5154
5134
|
return;
|
|
@@ -5163,28 +5143,28 @@ function AdsDataTable({
|
|
|
5163
5143
|
},
|
|
5164
5144
|
[pagination]
|
|
5165
5145
|
);
|
|
5166
|
-
const visibleRowEntries =
|
|
5146
|
+
const visibleRowEntries = React44.useMemo(
|
|
5167
5147
|
() => paginatedData.map((record, index) => ({
|
|
5168
5148
|
key: resolveRowKey(record, index, rowKey),
|
|
5169
5149
|
record
|
|
5170
5150
|
})),
|
|
5171
5151
|
[paginatedData, rowKey]
|
|
5172
5152
|
);
|
|
5173
|
-
const visibleSelectableKeys =
|
|
5153
|
+
const visibleSelectableKeys = React44.useMemo(
|
|
5174
5154
|
() => visibleRowEntries.map((entry) => entry.key),
|
|
5175
5155
|
[visibleRowEntries]
|
|
5176
5156
|
);
|
|
5177
|
-
const selectedVisibleCount =
|
|
5157
|
+
const selectedVisibleCount = React44.useMemo(
|
|
5178
5158
|
() => visibleSelectableKeys.filter((key) => selectedKeys.includes(key)).length,
|
|
5179
5159
|
[selectedKeys, visibleSelectableKeys]
|
|
5180
5160
|
);
|
|
5181
5161
|
const allVisibleRowsSelected = visibleSelectableKeys.length > 0 && selectedVisibleCount === visibleSelectableKeys.length;
|
|
5182
5162
|
const someVisibleRowsSelected = selectedVisibleCount > 0 && selectedVisibleCount < visibleSelectableKeys.length;
|
|
5183
|
-
const getColumnWidthOverride =
|
|
5163
|
+
const getColumnWidthOverride = React44.useCallback(
|
|
5184
5164
|
(column, columnKey) => internalColumnWidths[columnKey] ?? getResolvedColumnWidth(column),
|
|
5185
5165
|
[internalColumnWidths]
|
|
5186
5166
|
);
|
|
5187
|
-
const startColumnResize =
|
|
5167
|
+
const startColumnResize = React44.useCallback(
|
|
5188
5168
|
(event, column, columnKey) => {
|
|
5189
5169
|
event.preventDefault();
|
|
5190
5170
|
event.stopPropagation();
|
|
@@ -5215,7 +5195,7 @@ function AdsDataTable({
|
|
|
5215
5195
|
},
|
|
5216
5196
|
[internalColumnWidths]
|
|
5217
5197
|
);
|
|
5218
|
-
const renderColumnHeader =
|
|
5198
|
+
const renderColumnHeader = React44.useCallback(
|
|
5219
5199
|
(column, columnKey, columnSortOrder) => {
|
|
5220
5200
|
const headerTitle = getColumnHeader(column, columnKey);
|
|
5221
5201
|
const hasSorter = Boolean(column.sorter);
|
|
@@ -5241,13 +5221,13 @@ function AdsDataTable({
|
|
|
5241
5221
|
type: "button",
|
|
5242
5222
|
variant: "ghost",
|
|
5243
5223
|
children: [
|
|
5244
|
-
/* @__PURE__ */
|
|
5245
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ jsx48("span", { className: "truncate", children: headerTitle }),
|
|
5225
|
+
/* @__PURE__ */ jsx48("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ jsx48(ChevronDown5, { className: "h-4 w-4 rotate-180" }) : columnSortOrder === "descend" ? /* @__PURE__ */ jsx48(ChevronDown5, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx48(ChevronDown5, { className: "h-4 w-4 opacity-60" }) })
|
|
5246
5226
|
]
|
|
5247
5227
|
}
|
|
5248
|
-
) : /* @__PURE__ */
|
|
5228
|
+
) : /* @__PURE__ */ jsx48("span", { className: "truncate", children: headerTitle }),
|
|
5249
5229
|
hasFilter ? /* @__PURE__ */ jsxs23(AdsPopover, { children: [
|
|
5250
|
-
/* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ jsx48(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
5251
5231
|
Button,
|
|
5252
5232
|
{
|
|
5253
5233
|
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
@@ -5259,10 +5239,10 @@ function AdsDataTable({
|
|
|
5259
5239
|
size: "sm",
|
|
5260
5240
|
type: "button",
|
|
5261
5241
|
variant: "ghost",
|
|
5262
|
-
children: /* @__PURE__ */
|
|
5242
|
+
children: /* @__PURE__ */ jsx48(Filter, { className: "h-3.5 w-3.5" })
|
|
5263
5243
|
}
|
|
5264
5244
|
) }),
|
|
5265
|
-
/* @__PURE__ */
|
|
5245
|
+
/* @__PURE__ */ jsx48(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ jsx48(
|
|
5266
5246
|
AdsInput,
|
|
5267
5247
|
{
|
|
5268
5248
|
clearable: true,
|
|
@@ -5275,7 +5255,7 @@ function AdsDataTable({
|
|
|
5275
5255
|
) })
|
|
5276
5256
|
] }) : null
|
|
5277
5257
|
] }),
|
|
5278
|
-
hasResizeHandle ? /* @__PURE__ */
|
|
5258
|
+
hasResizeHandle ? /* @__PURE__ */ jsx48(
|
|
5279
5259
|
"span",
|
|
5280
5260
|
{
|
|
5281
5261
|
"aria-label": `Resize ${headerTitle} column`,
|
|
@@ -5294,11 +5274,11 @@ function AdsDataTable({
|
|
|
5294
5274
|
[activeResize?.columnKey, filterValues, handleFilterChange, handleSortChange, messages.table, startColumnResize]
|
|
5295
5275
|
);
|
|
5296
5276
|
const tableNode = /* @__PURE__ */ jsxs23(AdsTableSurface, { className: cn("flex min-h-0 flex-1 flex-col", className), children: [
|
|
5297
|
-
/* @__PURE__ */
|
|
5277
|
+
/* @__PURE__ */ jsx48(AdsTableScrollArea, { fill, stickyHeader: sticky, x: scroll?.x, y: scroll?.y, children: /* @__PURE__ */ jsxs23(AdsTableRoot, { className: tableClassName, children: [
|
|
5298
5278
|
/* @__PURE__ */ jsxs23(AdsTableColGroup, { children: [
|
|
5299
|
-
hasSelectionColumn ? /* @__PURE__ */
|
|
5300
|
-
hasExpandableColumn ? /* @__PURE__ */
|
|
5301
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */
|
|
5279
|
+
hasSelectionColumn ? /* @__PURE__ */ jsx48(AdsTableCol, { style: { width: rowSelection?.columnWidth ?? 48 } }) : null,
|
|
5280
|
+
hasExpandableColumn ? /* @__PURE__ */ jsx48(AdsTableCol, { style: { width: 48 } }) : null,
|
|
5281
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ jsx48(
|
|
5302
5282
|
AdsTableCol,
|
|
5303
5283
|
{
|
|
5304
5284
|
style: getCellStyle(column, getColumnWidthOverride(column, getColumnKey(column, index)))
|
|
@@ -5306,8 +5286,8 @@ function AdsDataTable({
|
|
|
5306
5286
|
getColumnKey(column, index)
|
|
5307
5287
|
))
|
|
5308
5288
|
] }),
|
|
5309
|
-
/* @__PURE__ */
|
|
5310
|
-
hasSelectionColumn ? /* @__PURE__ */
|
|
5289
|
+
/* @__PURE__ */ jsx48(AdsTableHeader, { children: /* @__PURE__ */ jsxs23(AdsTableRow, { children: [
|
|
5290
|
+
hasSelectionColumn ? /* @__PURE__ */ jsx48(AdsTableHead, { className: "w-12 p-2", children: rowSelection?.type !== "radio" && !rowSelection?.hideSelectAll ? /* @__PURE__ */ jsx48("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx48(
|
|
5311
5291
|
Checkbox2,
|
|
5312
5292
|
{
|
|
5313
5293
|
"aria-label": messages.table.selectAllRows,
|
|
@@ -5324,11 +5304,11 @@ function AdsDataTable({
|
|
|
5324
5304
|
onClick: (event) => event.stopPropagation()
|
|
5325
5305
|
}
|
|
5326
5306
|
) }) : null }) : null,
|
|
5327
|
-
hasExpandableColumn ? /* @__PURE__ */
|
|
5307
|
+
hasExpandableColumn ? /* @__PURE__ */ jsx48(AdsTableHead, { className: "w-12 p-2" }) : null,
|
|
5328
5308
|
resolvedColumns.map((column, index) => {
|
|
5329
5309
|
const columnKey = getColumnKey(column, index);
|
|
5330
5310
|
const columnSortOrder = sortState?.columnKey === columnKey ? sortState.order : column.sortOrder ?? null;
|
|
5331
|
-
return /* @__PURE__ */
|
|
5311
|
+
return /* @__PURE__ */ jsx48(
|
|
5332
5312
|
AdsTableHead,
|
|
5333
5313
|
{
|
|
5334
5314
|
className: cn(density.head, column.className, column.headerClassName),
|
|
@@ -5339,33 +5319,14 @@ function AdsDataTable({
|
|
|
5339
5319
|
);
|
|
5340
5320
|
})
|
|
5341
5321
|
] }) }),
|
|
5342
|
-
/* @__PURE__ */
|
|
5343
|
-
/* @__PURE__ */
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
className: "p-0",
|
|
5347
|
-
colSpan: columnCount,
|
|
5348
|
-
children: /* @__PURE__ */ jsx47(
|
|
5349
|
-
"div",
|
|
5350
|
-
{
|
|
5351
|
-
"aria-label": messages.table.loadingRows,
|
|
5352
|
-
"aria-live": "polite",
|
|
5353
|
-
className: "flex items-center justify-center px-6 py-8 text-foreground",
|
|
5354
|
-
role: "status",
|
|
5355
|
-
style: { minHeight: spinnerLoadingHeight },
|
|
5356
|
-
children: /* @__PURE__ */ jsx47(AdsSpinner, { size: "lg", tone: "foreground" })
|
|
5357
|
-
}
|
|
5358
|
-
)
|
|
5359
|
-
}
|
|
5360
|
-
) }, "spinner-row")
|
|
5361
|
-
] : loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ jsxs23(AdsTableRow, { children: [
|
|
5362
|
-
hasSelectionColumn ? /* @__PURE__ */ jsx47(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ jsx47(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5363
|
-
hasExpandableColumn ? /* @__PURE__ */ jsx47(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ jsx47(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5364
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */ jsx47(
|
|
5322
|
+
/* @__PURE__ */ jsx48(AdsTableBody, { children: loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ jsxs23(AdsTableRow, { children: [
|
|
5323
|
+
hasSelectionColumn ? /* @__PURE__ */ jsx48(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ jsx48(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5324
|
+
hasExpandableColumn ? /* @__PURE__ */ jsx48(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ jsx48(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5325
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ jsx48(
|
|
5365
5326
|
AdsTableCell,
|
|
5366
5327
|
{
|
|
5367
5328
|
className: cn(density.cell, column.className),
|
|
5368
|
-
children: /* @__PURE__ */
|
|
5329
|
+
children: /* @__PURE__ */ jsx48(AdsSkeleton, { className: "h-4 w-full rounded" })
|
|
5369
5330
|
},
|
|
5370
5331
|
`${getColumnKey(column, index)}-${skeletonIndex}`
|
|
5371
5332
|
))
|
|
@@ -5397,7 +5358,7 @@ function AdsDataTable({
|
|
|
5397
5358
|
toggleSelectionFromRowClick(record, recordKey);
|
|
5398
5359
|
},
|
|
5399
5360
|
children: [
|
|
5400
|
-
hasSelectionColumn ? /* @__PURE__ */
|
|
5361
|
+
hasSelectionColumn ? /* @__PURE__ */ jsx48(
|
|
5401
5362
|
AdsTableSelectionCell,
|
|
5402
5363
|
{
|
|
5403
5364
|
checked: selectedKeys.includes(recordKey),
|
|
@@ -5413,7 +5374,7 @@ function AdsDataTable({
|
|
|
5413
5374
|
value: String(recordKey)
|
|
5414
5375
|
}
|
|
5415
5376
|
) : null,
|
|
5416
|
-
hasExpandableColumn ? /* @__PURE__ */
|
|
5377
|
+
hasExpandableColumn ? /* @__PURE__ */ jsx48(
|
|
5417
5378
|
AdsTableExpandCell,
|
|
5418
5379
|
{
|
|
5419
5380
|
disabled: !canExpand,
|
|
@@ -5426,7 +5387,7 @@ function AdsDataTable({
|
|
|
5426
5387
|
resolveRenderedCellContent(column, record, index),
|
|
5427
5388
|
column.ellipsis
|
|
5428
5389
|
);
|
|
5429
|
-
return /* @__PURE__ */
|
|
5390
|
+
return /* @__PURE__ */ jsx48(
|
|
5430
5391
|
AdsTableCell,
|
|
5431
5392
|
{
|
|
5432
5393
|
className: cn(
|
|
@@ -5452,16 +5413,16 @@ function AdsDataTable({
|
|
|
5452
5413
|
}
|
|
5453
5414
|
return [
|
|
5454
5415
|
row,
|
|
5455
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx48(AdsTableRow, { children: /* @__PURE__ */ jsx48(
|
|
5456
5417
|
AdsTableCell,
|
|
5457
5418
|
{
|
|
5458
5419
|
className: "p-0",
|
|
5459
5420
|
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5460
|
-
children: /* @__PURE__ */
|
|
5421
|
+
children: /* @__PURE__ */ jsx48(
|
|
5461
5422
|
"div",
|
|
5462
5423
|
{
|
|
5463
5424
|
className: cn(
|
|
5464
|
-
|
|
5425
|
+
"border-t border-border bg-popover/40 p-4",
|
|
5465
5426
|
classNames?.expandedRowContent
|
|
5466
5427
|
),
|
|
5467
5428
|
children: expandable?.expandedRowRender?.(record, index)
|
|
@@ -5471,18 +5432,18 @@ function AdsDataTable({
|
|
|
5471
5432
|
) }, `${String(recordKey)}-expanded`)
|
|
5472
5433
|
];
|
|
5473
5434
|
}) : [
|
|
5474
|
-
/* @__PURE__ */
|
|
5435
|
+
/* @__PURE__ */ jsx48(AdsTableRow, { children: /* @__PURE__ */ jsx48(
|
|
5475
5436
|
AdsTableCell,
|
|
5476
5437
|
{
|
|
5477
|
-
colSpan:
|
|
5438
|
+
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5478
5439
|
className: cn("p-0", classNames?.emptyRowCell),
|
|
5479
5440
|
children: renderedEmptyState
|
|
5480
5441
|
}
|
|
5481
5442
|
) }, "empty-row")
|
|
5482
5443
|
] })
|
|
5483
5444
|
] }) }),
|
|
5484
|
-
footer ? /* @__PURE__ */
|
|
5485
|
-
pagination !== false ? /* @__PURE__ */
|
|
5445
|
+
footer ? /* @__PURE__ */ jsx48("div", { className: "border-t border-border p-3", children: footer }) : null,
|
|
5446
|
+
pagination !== false ? /* @__PURE__ */ jsx48("div", { className: cn("border-t border-border p-3", classNames?.paginationContainer), children: /* @__PURE__ */ jsx48(
|
|
5486
5447
|
AdsDataPagination,
|
|
5487
5448
|
{
|
|
5488
5449
|
ariaLabel: messages.pagination.navigation,
|
|
@@ -5504,7 +5465,7 @@ function AdsDataTable({
|
|
|
5504
5465
|
) }) : null
|
|
5505
5466
|
] });
|
|
5506
5467
|
if (rowSelection?.type === "radio") {
|
|
5507
|
-
return /* @__PURE__ */
|
|
5468
|
+
return /* @__PURE__ */ jsx48(
|
|
5508
5469
|
RadioGroup2,
|
|
5509
5470
|
{
|
|
5510
5471
|
onValueChange: (value) => {
|
|
@@ -5525,7 +5486,7 @@ function AdsDataTable({
|
|
|
5525
5486
|
}
|
|
5526
5487
|
|
|
5527
5488
|
// src/components/AdsDataTableToolbar/index.tsx
|
|
5528
|
-
import { jsx as
|
|
5489
|
+
import { jsx as jsx49, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5529
5490
|
function AdsDataTableToolbar({
|
|
5530
5491
|
action,
|
|
5531
5492
|
className,
|
|
@@ -5545,9 +5506,9 @@ function AdsDataTableToolbar({
|
|
|
5545
5506
|
className
|
|
5546
5507
|
),
|
|
5547
5508
|
children: [
|
|
5548
|
-
/* @__PURE__ */
|
|
5509
|
+
/* @__PURE__ */ jsx49("div", { className: "min-w-0 flex-1", children: title ? /* @__PURE__ */ jsx49("h2", { className: cn("truncate text-xl font-medium text-white", titleClassName), children: title }) : null }),
|
|
5549
5510
|
/* @__PURE__ */ jsxs24("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: [
|
|
5550
|
-
/* @__PURE__ */
|
|
5511
|
+
/* @__PURE__ */ jsx49("div", { className: "min-w-0 md:max-w-[440px] md:flex-1", children: /* @__PURE__ */ jsx49(
|
|
5551
5512
|
AdsInput,
|
|
5552
5513
|
{
|
|
5553
5514
|
className: cn(
|
|
@@ -5561,7 +5522,7 @@ function AdsDataTableToolbar({
|
|
|
5561
5522
|
value: searchValue
|
|
5562
5523
|
}
|
|
5563
5524
|
) }),
|
|
5564
|
-
action ? /* @__PURE__ */
|
|
5525
|
+
action ? /* @__PURE__ */ jsx49("div", { className: "shrink-0", children: action }) : null
|
|
5565
5526
|
] })
|
|
5566
5527
|
]
|
|
5567
5528
|
}
|
|
@@ -5569,7 +5530,7 @@ function AdsDataTableToolbar({
|
|
|
5569
5530
|
}
|
|
5570
5531
|
|
|
5571
5532
|
// src/components/AdsViewCustomersDataTable/index.tsx
|
|
5572
|
-
import { jsx as
|
|
5533
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5573
5534
|
function resolveHeight(value) {
|
|
5574
5535
|
if (value === void 0) {
|
|
5575
5536
|
return 500;
|
|
@@ -5602,12 +5563,12 @@ function AdsViewCustomersDataTable({
|
|
|
5602
5563
|
}) {
|
|
5603
5564
|
const tableHeight = resolveHeight(height);
|
|
5604
5565
|
const resolvedErrorState = errorState ?? /* @__PURE__ */ jsxs25("div", { className: "flex min-h-[500px] flex-col items-center justify-center gap-3 px-6 py-12 text-center", children: [
|
|
5605
|
-
/* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5607
|
-
onRetry ? /* @__PURE__ */
|
|
5566
|
+
/* @__PURE__ */ jsx50("p", { className: "text-sm font-medium text-white", children: errorTitle }),
|
|
5567
|
+
/* @__PURE__ */ jsx50("p", { className: "max-w-md text-sm text-[#848484]", children: errorDescription }),
|
|
5568
|
+
onRetry ? /* @__PURE__ */ jsx50(AdsButton, { intent: "primary", onClick: onRetry, children: retryLabel }) : null
|
|
5608
5569
|
] });
|
|
5609
5570
|
return /* @__PURE__ */ jsxs25("div", { className: "overflow-hidden rounded-xl border border-[#27282F] bg-[#1B1C21]", children: [
|
|
5610
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ jsx50(
|
|
5611
5572
|
AdsDataTableToolbar,
|
|
5612
5573
|
{
|
|
5613
5574
|
action: toolbarAction,
|
|
@@ -5619,7 +5580,7 @@ function AdsViewCustomersDataTable({
|
|
|
5619
5580
|
}
|
|
5620
5581
|
),
|
|
5621
5582
|
error ? resolvedErrorState : null,
|
|
5622
|
-
!error ? /* @__PURE__ */
|
|
5583
|
+
!error ? /* @__PURE__ */ jsx50(
|
|
5623
5584
|
AdsDataTable,
|
|
5624
5585
|
{
|
|
5625
5586
|
...props,
|
|
@@ -5654,20 +5615,20 @@ function AdsViewCustomersDataTable({
|
|
|
5654
5615
|
}
|
|
5655
5616
|
|
|
5656
5617
|
// src/components/AdsProgress/index.tsx
|
|
5657
|
-
import * as
|
|
5618
|
+
import * as React46 from "react";
|
|
5658
5619
|
|
|
5659
5620
|
// src/primitives/progress.tsx
|
|
5660
|
-
import * as
|
|
5621
|
+
import * as React45 from "react";
|
|
5661
5622
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5662
|
-
import { jsx as
|
|
5663
|
-
var Progress =
|
|
5623
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
5624
|
+
var Progress = React45.forwardRef(({ className, indicatorClassName, value, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5664
5625
|
ProgressPrimitive.Root,
|
|
5665
5626
|
{
|
|
5666
5627
|
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
5667
5628
|
ref,
|
|
5668
5629
|
value,
|
|
5669
5630
|
...props,
|
|
5670
|
-
children: /* @__PURE__ */
|
|
5631
|
+
children: /* @__PURE__ */ jsx51(
|
|
5671
5632
|
ProgressPrimitive.Indicator,
|
|
5672
5633
|
{
|
|
5673
5634
|
className: cn("h-full w-full flex-1 bg-primary transition-all", indicatorClassName),
|
|
@@ -5679,13 +5640,13 @@ var Progress = React44.forwardRef(({ className, indicatorClassName, value, ...pr
|
|
|
5679
5640
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
5680
5641
|
|
|
5681
5642
|
// src/components/AdsProgress/index.tsx
|
|
5682
|
-
import { jsx as
|
|
5643
|
+
import { jsx as jsx52, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5683
5644
|
var progressBaseClassName = "h-2 rounded-radius-full bg-[color:color-mix(in_srgb,var(--primary)_20%,transparent)]";
|
|
5684
5645
|
var progressIndicatorVariantClassName = {
|
|
5685
5646
|
ai: "bg-brand-gradient",
|
|
5686
5647
|
default: "bg-primary"
|
|
5687
5648
|
};
|
|
5688
|
-
var Progress2 =
|
|
5649
|
+
var Progress2 = React46.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
5689
5650
|
Progress,
|
|
5690
5651
|
{
|
|
5691
5652
|
className: cn(progressBaseClassName, className),
|
|
@@ -5695,7 +5656,7 @@ var Progress2 = React45.forwardRef(({ className, indicatorClassName, ...props },
|
|
|
5695
5656
|
}
|
|
5696
5657
|
));
|
|
5697
5658
|
Progress2.displayName = "Progress";
|
|
5698
|
-
var AdsProgress =
|
|
5659
|
+
var AdsProgress = React46.forwardRef(
|
|
5699
5660
|
({
|
|
5700
5661
|
className,
|
|
5701
5662
|
descriptionPlacement = "above",
|
|
@@ -5714,12 +5675,12 @@ var AdsProgress = React45.forwardRef(
|
|
|
5714
5675
|
id
|
|
5715
5676
|
});
|
|
5716
5677
|
const labelId = label ? `${description.inputId}-label` : void 0;
|
|
5717
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
5718
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
5678
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx52(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5679
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx52(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5719
5680
|
return /* @__PURE__ */ jsxs26(AdsFieldItem, { children: [
|
|
5720
|
-
label ? /* @__PURE__ */
|
|
5681
|
+
label ? /* @__PURE__ */ jsx52(AdsFieldLabel, { id: labelId, children: label }) : null,
|
|
5721
5682
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5722
|
-
/* @__PURE__ */
|
|
5683
|
+
/* @__PURE__ */ jsx52(
|
|
5723
5684
|
Progress,
|
|
5724
5685
|
{
|
|
5725
5686
|
"aria-describedby": description.describedBy,
|
|
@@ -5743,13 +5704,13 @@ var AdsProgress = React45.forwardRef(
|
|
|
5743
5704
|
AdsProgress.displayName = "AdsProgress";
|
|
5744
5705
|
|
|
5745
5706
|
// src/components/AdsSlider/index.tsx
|
|
5746
|
-
import * as
|
|
5707
|
+
import * as React48 from "react";
|
|
5747
5708
|
|
|
5748
5709
|
// src/primitives/slider.tsx
|
|
5749
|
-
import * as
|
|
5710
|
+
import * as React47 from "react";
|
|
5750
5711
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
5751
|
-
import { jsx as
|
|
5752
|
-
var Slider =
|
|
5712
|
+
import { jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5713
|
+
var Slider = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs27(
|
|
5753
5714
|
SliderPrimitive.Root,
|
|
5754
5715
|
{
|
|
5755
5716
|
ref,
|
|
@@ -5759,10 +5720,10 @@ var Slider = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5759
5720
|
),
|
|
5760
5721
|
...props,
|
|
5761
5722
|
children: [
|
|
5762
|
-
/* @__PURE__ */
|
|
5723
|
+
/* @__PURE__ */ jsx53(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx53(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
5763
5724
|
Array.from({
|
|
5764
5725
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5765
|
-
}).map((_, index) => /* @__PURE__ */
|
|
5726
|
+
}).map((_, index) => /* @__PURE__ */ jsx53(
|
|
5766
5727
|
SliderPrimitive.Thumb,
|
|
5767
5728
|
{
|
|
5768
5729
|
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"
|
|
@@ -5775,11 +5736,11 @@ var Slider = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5775
5736
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5776
5737
|
|
|
5777
5738
|
// src/components/AdsSlider/index.tsx
|
|
5778
|
-
import { jsx as
|
|
5739
|
+
import { jsx as jsx54, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5779
5740
|
var sliderBaseClassName = "py-1";
|
|
5780
|
-
var Slider2 =
|
|
5741
|
+
var Slider2 = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx54(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5781
5742
|
Slider2.displayName = "Slider";
|
|
5782
|
-
var AdsSlider =
|
|
5743
|
+
var AdsSlider = React48.forwardRef(
|
|
5783
5744
|
({
|
|
5784
5745
|
className,
|
|
5785
5746
|
descriptionPlacement = "above",
|
|
@@ -5794,12 +5755,12 @@ var AdsSlider = React47.forwardRef(
|
|
|
5794
5755
|
helperText,
|
|
5795
5756
|
id
|
|
5796
5757
|
});
|
|
5797
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
5798
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
5758
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx54(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5759
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx54(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5799
5760
|
return /* @__PURE__ */ jsxs28(AdsFieldItem, { children: [
|
|
5800
|
-
label ? /* @__PURE__ */
|
|
5761
|
+
label ? /* @__PURE__ */ jsx54(AdsFieldLabel, { children: label }) : null,
|
|
5801
5762
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5802
|
-
/* @__PURE__ */
|
|
5763
|
+
/* @__PURE__ */ jsx54(
|
|
5803
5764
|
Slider2,
|
|
5804
5765
|
{
|
|
5805
5766
|
"aria-describedby": description.describedBy,
|
|
@@ -5816,13 +5777,13 @@ var AdsSlider = React47.forwardRef(
|
|
|
5816
5777
|
AdsSlider.displayName = "AdsSlider";
|
|
5817
5778
|
|
|
5818
5779
|
// src/components/AdsSwitch/index.tsx
|
|
5819
|
-
import * as
|
|
5780
|
+
import * as React50 from "react";
|
|
5820
5781
|
|
|
5821
5782
|
// src/primitives/switch.tsx
|
|
5822
|
-
import * as
|
|
5783
|
+
import * as React49 from "react";
|
|
5823
5784
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5824
|
-
import { jsx as
|
|
5825
|
-
var Switch =
|
|
5785
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
5786
|
+
var Switch = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
|
|
5826
5787
|
SwitchPrimitives.Root,
|
|
5827
5788
|
{
|
|
5828
5789
|
className: cn(
|
|
@@ -5831,7 +5792,7 @@ var Switch = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5831
5792
|
),
|
|
5832
5793
|
...props,
|
|
5833
5794
|
ref,
|
|
5834
|
-
children: /* @__PURE__ */
|
|
5795
|
+
children: /* @__PURE__ */ jsx55(
|
|
5835
5796
|
SwitchPrimitives.Thumb,
|
|
5836
5797
|
{
|
|
5837
5798
|
className: cn(
|
|
@@ -5844,15 +5805,15 @@ var Switch = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5844
5805
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5845
5806
|
|
|
5846
5807
|
// src/components/AdsSwitch/index.tsx
|
|
5847
|
-
import { jsx as
|
|
5808
|
+
import { jsx as jsx56, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5848
5809
|
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";
|
|
5849
|
-
var Switch2 =
|
|
5810
|
+
var Switch2 = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
5850
5811
|
Switch2.displayName = "Switch";
|
|
5851
|
-
var AdsSwitch =
|
|
5852
|
-
const generatedId =
|
|
5812
|
+
var AdsSwitch = React50.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
5813
|
+
const generatedId = React50.useId();
|
|
5853
5814
|
const inputId = id ?? generatedId;
|
|
5854
5815
|
if (!label) {
|
|
5855
|
-
return /* @__PURE__ */
|
|
5816
|
+
return /* @__PURE__ */ jsx56(
|
|
5856
5817
|
Switch2,
|
|
5857
5818
|
{
|
|
5858
5819
|
className: cn(className, switchClassName),
|
|
@@ -5862,12 +5823,12 @@ var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchC
|
|
|
5862
5823
|
}
|
|
5863
5824
|
);
|
|
5864
5825
|
}
|
|
5865
|
-
return /* @__PURE__ */
|
|
5826
|
+
return /* @__PURE__ */ jsx56("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ jsxs29("div", { className: "flex w-full items-start gap-3", children: [
|
|
5866
5827
|
/* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5 pt-0.5", children: [
|
|
5867
|
-
/* @__PURE__ */
|
|
5868
|
-
description ? /* @__PURE__ */
|
|
5828
|
+
/* @__PURE__ */ jsx56("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }),
|
|
5829
|
+
description ? /* @__PURE__ */ jsx56(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
5869
5830
|
] }),
|
|
5870
|
-
/* @__PURE__ */
|
|
5831
|
+
/* @__PURE__ */ jsx56("div", { className: "shrink-0", children: /* @__PURE__ */ jsx56(
|
|
5871
5832
|
Switch2,
|
|
5872
5833
|
{
|
|
5873
5834
|
className: cn(className, switchClassName),
|
|
@@ -5881,14 +5842,14 @@ var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchC
|
|
|
5881
5842
|
AdsSwitch.displayName = "AdsSwitch";
|
|
5882
5843
|
|
|
5883
5844
|
// src/components/AdsTabs/index.tsx
|
|
5884
|
-
import * as
|
|
5845
|
+
import * as React52 from "react";
|
|
5885
5846
|
|
|
5886
5847
|
// src/primitives/tabs.tsx
|
|
5887
|
-
import * as
|
|
5848
|
+
import * as React51 from "react";
|
|
5888
5849
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5889
|
-
import { jsx as
|
|
5850
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5890
5851
|
var Tabs = TabsPrimitive.Root;
|
|
5891
|
-
var TabsList =
|
|
5852
|
+
var TabsList = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
5892
5853
|
TabsPrimitive.List,
|
|
5893
5854
|
{
|
|
5894
5855
|
className: cn("inline-flex items-center", className),
|
|
@@ -5897,7 +5858,7 @@ var TabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5897
5858
|
}
|
|
5898
5859
|
));
|
|
5899
5860
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5900
|
-
var TabsTrigger =
|
|
5861
|
+
var TabsTrigger = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
5901
5862
|
TabsPrimitive.Trigger,
|
|
5902
5863
|
{
|
|
5903
5864
|
className: cn(
|
|
@@ -5909,7 +5870,7 @@ var TabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5909
5870
|
}
|
|
5910
5871
|
));
|
|
5911
5872
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5912
|
-
var TabsContent =
|
|
5873
|
+
var TabsContent = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
5913
5874
|
TabsPrimitive.Content,
|
|
5914
5875
|
{
|
|
5915
5876
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -5920,9 +5881,9 @@ var TabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5920
5881
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5921
5882
|
|
|
5922
5883
|
// src/components/AdsTabs/index.tsx
|
|
5923
|
-
import { jsx as
|
|
5884
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
5924
5885
|
var AdsTabs = Tabs;
|
|
5925
|
-
var AdsTabsList =
|
|
5886
|
+
var AdsTabsList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
|
|
5926
5887
|
TabsList,
|
|
5927
5888
|
{
|
|
5928
5889
|
className: cn(
|
|
@@ -5934,7 +5895,7 @@ var AdsTabsList = React51.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5934
5895
|
}
|
|
5935
5896
|
));
|
|
5936
5897
|
AdsTabsList.displayName = "AdsTabsList";
|
|
5937
|
-
var AdsTabsTrigger =
|
|
5898
|
+
var AdsTabsTrigger = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
|
|
5938
5899
|
TabsTrigger,
|
|
5939
5900
|
{
|
|
5940
5901
|
className: cn(
|
|
@@ -5946,7 +5907,7 @@ var AdsTabsTrigger = React51.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5946
5907
|
}
|
|
5947
5908
|
));
|
|
5948
5909
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
5949
|
-
var AdsTabsContent =
|
|
5910
|
+
var AdsTabsContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
|
|
5950
5911
|
TabsContent,
|
|
5951
5912
|
{
|
|
5952
5913
|
className: cn(
|
|
@@ -5960,13 +5921,13 @@ var AdsTabsContent = React51.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5960
5921
|
AdsTabsContent.displayName = "AdsTabsContent";
|
|
5961
5922
|
|
|
5962
5923
|
// src/components/AdsToggle/index.tsx
|
|
5963
|
-
import * as
|
|
5924
|
+
import * as React54 from "react";
|
|
5964
5925
|
|
|
5965
5926
|
// src/primitives/toggle.tsx
|
|
5966
|
-
import * as
|
|
5927
|
+
import * as React53 from "react";
|
|
5967
5928
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5968
|
-
import { jsx as
|
|
5969
|
-
var Toggle =
|
|
5929
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5930
|
+
var Toggle = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
5970
5931
|
TogglePrimitive.Root,
|
|
5971
5932
|
{
|
|
5972
5933
|
className: cn(
|
|
@@ -5980,7 +5941,7 @@ var Toggle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5980
5941
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5981
5942
|
|
|
5982
5943
|
// src/components/AdsToggle/index.tsx
|
|
5983
|
-
import { jsx as
|
|
5944
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
5984
5945
|
var sizeClassName3 = {
|
|
5985
5946
|
sm: "!h-8 px-[6px] text-sm",
|
|
5986
5947
|
md: "!h-9 px-md text-sm",
|
|
@@ -5995,10 +5956,10 @@ var variantClassName = {
|
|
|
5995
5956
|
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)]",
|
|
5996
5957
|
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)]"
|
|
5997
5958
|
};
|
|
5998
|
-
var AdsToggle =
|
|
5999
|
-
const childCount =
|
|
6000
|
-
const isIconOnly = childCount === 1 &&
|
|
6001
|
-
return /* @__PURE__ */
|
|
5959
|
+
var AdsToggle = React54.forwardRef(({ children, className, size = "md", variant = "default", ...props }, ref) => {
|
|
5960
|
+
const childCount = React54.Children.count(children);
|
|
5961
|
+
const isIconOnly = childCount === 1 && React54.isValidElement(children);
|
|
5962
|
+
return /* @__PURE__ */ jsx60(
|
|
6002
5963
|
Toggle,
|
|
6003
5964
|
{
|
|
6004
5965
|
className: cn(
|
|
@@ -6017,13 +5978,13 @@ var AdsToggle = React53.forwardRef(({ children, className, size = "md", variant
|
|
|
6017
5978
|
AdsToggle.displayName = "AdsToggle";
|
|
6018
5979
|
|
|
6019
5980
|
// src/components/AdsToggleGroup/index.tsx
|
|
6020
|
-
import * as
|
|
5981
|
+
import * as React56 from "react";
|
|
6021
5982
|
|
|
6022
5983
|
// src/primitives/toggle-group.tsx
|
|
6023
|
-
import * as
|
|
5984
|
+
import * as React55 from "react";
|
|
6024
5985
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
6025
|
-
import { jsx as
|
|
6026
|
-
var ToggleGroup =
|
|
5986
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
5987
|
+
var ToggleGroup = React55.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx61(
|
|
6027
5988
|
ToggleGroupPrimitive.Root,
|
|
6028
5989
|
{
|
|
6029
5990
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -6032,7 +5993,7 @@ var ToggleGroup = React54.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6032
5993
|
}
|
|
6033
5994
|
));
|
|
6034
5995
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
6035
|
-
var ToggleGroupItem =
|
|
5996
|
+
var ToggleGroupItem = React55.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx61(
|
|
6036
5997
|
ToggleGroupPrimitive.Item,
|
|
6037
5998
|
{
|
|
6038
5999
|
className: cn(
|
|
@@ -6046,7 +6007,7 @@ var ToggleGroupItem = React54.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
6046
6007
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
6047
6008
|
|
|
6048
6009
|
// src/components/AdsToggleGroup/index.tsx
|
|
6049
|
-
import { jsx as
|
|
6010
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
6050
6011
|
var sizeClassName4 = {
|
|
6051
6012
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
6052
6013
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -6056,8 +6017,8 @@ var variantClassName2 = {
|
|
|
6056
6017
|
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)]",
|
|
6057
6018
|
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)]"
|
|
6058
6019
|
};
|
|
6059
|
-
var AdsToggleGroupContext =
|
|
6060
|
-
var AdsToggleGroup =
|
|
6020
|
+
var AdsToggleGroupContext = React56.createContext(null);
|
|
6021
|
+
var AdsToggleGroup = React56.forwardRef(
|
|
6061
6022
|
({
|
|
6062
6023
|
children,
|
|
6063
6024
|
className,
|
|
@@ -6065,7 +6026,7 @@ var AdsToggleGroup = React55.forwardRef(
|
|
|
6065
6026
|
size = "md",
|
|
6066
6027
|
variant = "default",
|
|
6067
6028
|
...props
|
|
6068
|
-
}, ref) => /* @__PURE__ */
|
|
6029
|
+
}, ref) => /* @__PURE__ */ jsx62(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ jsx62(
|
|
6069
6030
|
ToggleGroup,
|
|
6070
6031
|
{
|
|
6071
6032
|
className: cn(
|
|
@@ -6081,12 +6042,12 @@ var AdsToggleGroup = React55.forwardRef(
|
|
|
6081
6042
|
) })
|
|
6082
6043
|
);
|
|
6083
6044
|
AdsToggleGroup.displayName = "AdsToggleGroup";
|
|
6084
|
-
var AdsToggleGroupItem =
|
|
6085
|
-
const context =
|
|
6045
|
+
var AdsToggleGroupItem = React56.forwardRef(({ className, size, variant, ...props }, ref) => {
|
|
6046
|
+
const context = React56.useContext(AdsToggleGroupContext);
|
|
6086
6047
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
6087
6048
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
6088
6049
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
6089
|
-
return /* @__PURE__ */
|
|
6050
|
+
return /* @__PURE__ */ jsx62(
|
|
6090
6051
|
ToggleGroupItem,
|
|
6091
6052
|
{
|
|
6092
6053
|
className: cn(
|
|
@@ -6104,10 +6065,10 @@ var AdsToggleGroupItem = React55.forwardRef(({ className, size, variant, ...prop
|
|
|
6104
6065
|
AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
6105
6066
|
|
|
6106
6067
|
// src/components/AdsTextarea/index.tsx
|
|
6107
|
-
import * as
|
|
6108
|
-
import { jsx as
|
|
6109
|
-
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:
|
|
6110
|
-
var AdsTextarea =
|
|
6068
|
+
import * as React57 from "react";
|
|
6069
|
+
import { jsx as jsx63, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6070
|
+
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";
|
|
6071
|
+
var AdsTextarea = React57.forwardRef(
|
|
6111
6072
|
({
|
|
6112
6073
|
action,
|
|
6113
6074
|
className,
|
|
@@ -6126,12 +6087,12 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6126
6087
|
helperText,
|
|
6127
6088
|
id
|
|
6128
6089
|
});
|
|
6129
|
-
const helperNode = helperText ? /* @__PURE__ */
|
|
6130
|
-
const errorNode = errorText ? /* @__PURE__ */
|
|
6090
|
+
const helperNode = helperText ? /* @__PURE__ */ jsx63(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6091
|
+
const errorNode = errorText ? /* @__PURE__ */ jsx63(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6131
6092
|
return /* @__PURE__ */ jsxs30(AdsFieldItem, { children: [
|
|
6132
|
-
label ? /* @__PURE__ */
|
|
6093
|
+
label ? /* @__PURE__ */ jsx63(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
6133
6094
|
descriptionPlacement === "above" ? helperNode : null,
|
|
6134
|
-
/* @__PURE__ */
|
|
6095
|
+
/* @__PURE__ */ jsx63(
|
|
6135
6096
|
Textarea,
|
|
6136
6097
|
{
|
|
6137
6098
|
"aria-describedby": description.describedBy,
|
|
@@ -6149,7 +6110,7 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6149
6110
|
...props
|
|
6150
6111
|
}
|
|
6151
6112
|
),
|
|
6152
|
-
action ? /* @__PURE__ */
|
|
6113
|
+
action ? /* @__PURE__ */ jsx63("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
6153
6114
|
descriptionPlacement === "below" ? helperNode : null,
|
|
6154
6115
|
errorNode
|
|
6155
6116
|
] });
|
|
@@ -6158,17 +6119,17 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6158
6119
|
AdsTextarea.displayName = "AdsTextarea";
|
|
6159
6120
|
|
|
6160
6121
|
// src/components/AdsTooltip/index.tsx
|
|
6161
|
-
import * as
|
|
6122
|
+
import * as React59 from "react";
|
|
6162
6123
|
|
|
6163
6124
|
// src/primitives/tooltip.tsx
|
|
6164
|
-
import * as
|
|
6125
|
+
import * as React58 from "react";
|
|
6165
6126
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6166
|
-
import { jsx as
|
|
6127
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
6167
6128
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6168
6129
|
var Tooltip = TooltipPrimitive.Root;
|
|
6169
6130
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6170
6131
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
6171
|
-
var TooltipContent =
|
|
6132
|
+
var TooltipContent = React58.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx64(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx64(
|
|
6172
6133
|
TooltipPrimitive.Content,
|
|
6173
6134
|
{
|
|
6174
6135
|
className: cn(
|
|
@@ -6183,12 +6144,12 @@ var TooltipContent = React57.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
6183
6144
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6184
6145
|
|
|
6185
6146
|
// src/components/AdsTooltip/index.tsx
|
|
6186
|
-
import { jsx as
|
|
6147
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
6187
6148
|
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)]";
|
|
6188
6149
|
var AdsTooltipProvider = TooltipProvider;
|
|
6189
6150
|
var AdsTooltip = Tooltip;
|
|
6190
6151
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
6191
|
-
var AdsTooltipContent =
|
|
6152
|
+
var AdsTooltipContent = React59.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
6192
6153
|
TooltipContent,
|
|
6193
6154
|
{
|
|
6194
6155
|
align,
|
|
@@ -6199,7 +6160,7 @@ var AdsTooltipContent = React58.forwardRef(({ align = "center", className, sideO
|
|
|
6199
6160
|
}
|
|
6200
6161
|
));
|
|
6201
6162
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
6202
|
-
var AdsTooltipArrow =
|
|
6163
|
+
var AdsTooltipArrow = React59.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
6203
6164
|
TooltipArrow,
|
|
6204
6165
|
{
|
|
6205
6166
|
className: cn("fill-[#844fff]", className),
|
|
@@ -6212,7 +6173,7 @@ var AdsTooltipArrow = React58.forwardRef(({ className, height = 5, width = 10, .
|
|
|
6212
6173
|
AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
6213
6174
|
|
|
6214
6175
|
// src/components/AdsToast/index.tsx
|
|
6215
|
-
import * as
|
|
6176
|
+
import * as React60 from "react";
|
|
6216
6177
|
import {
|
|
6217
6178
|
CircleCheck as CircleCheck2,
|
|
6218
6179
|
Info as Info2,
|
|
@@ -6221,7 +6182,7 @@ import {
|
|
|
6221
6182
|
TriangleAlert as TriangleAlert2
|
|
6222
6183
|
} from "lucide-react";
|
|
6223
6184
|
import { Toaster, toast } from "sonner";
|
|
6224
|
-
import { jsx as
|
|
6185
|
+
import { jsx as jsx66, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6225
6186
|
var adsToastIconMap = {
|
|
6226
6187
|
success: CircleCheck2,
|
|
6227
6188
|
info: Info2,
|
|
@@ -6237,7 +6198,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6237
6198
|
return null;
|
|
6238
6199
|
}
|
|
6239
6200
|
const Icon2 = adsToastIconMap[intent];
|
|
6240
|
-
return /* @__PURE__ */
|
|
6201
|
+
return /* @__PURE__ */ jsx66(
|
|
6241
6202
|
Icon2,
|
|
6242
6203
|
{
|
|
6243
6204
|
"aria-hidden": true,
|
|
@@ -6250,7 +6211,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6250
6211
|
}
|
|
6251
6212
|
);
|
|
6252
6213
|
}
|
|
6253
|
-
var AdsToast =
|
|
6214
|
+
var AdsToast = React60.forwardRef(
|
|
6254
6215
|
({
|
|
6255
6216
|
action,
|
|
6256
6217
|
className,
|
|
@@ -6277,7 +6238,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6277
6238
|
children: [
|
|
6278
6239
|
resolvedIcon,
|
|
6279
6240
|
/* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6280
|
-
/* @__PURE__ */
|
|
6241
|
+
/* @__PURE__ */ jsx66(
|
|
6281
6242
|
"p",
|
|
6282
6243
|
{
|
|
6283
6244
|
className: cn(
|
|
@@ -6287,7 +6248,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6287
6248
|
children: title
|
|
6288
6249
|
}
|
|
6289
6250
|
),
|
|
6290
|
-
description ? /* @__PURE__ */
|
|
6251
|
+
description ? /* @__PURE__ */ jsx66(
|
|
6291
6252
|
"p",
|
|
6292
6253
|
{
|
|
6293
6254
|
className: cn(
|
|
@@ -6298,7 +6259,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6298
6259
|
}
|
|
6299
6260
|
) : null
|
|
6300
6261
|
] }),
|
|
6301
|
-
action ? /* @__PURE__ */
|
|
6262
|
+
action ? /* @__PURE__ */ jsx66(
|
|
6302
6263
|
AdsButton,
|
|
6303
6264
|
{
|
|
6304
6265
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -6324,7 +6285,7 @@ function AdsToaster({
|
|
|
6324
6285
|
...props
|
|
6325
6286
|
}) {
|
|
6326
6287
|
const { messages } = useAdsI18n();
|
|
6327
|
-
return /* @__PURE__ */
|
|
6288
|
+
return /* @__PURE__ */ jsx66(
|
|
6328
6289
|
Toaster,
|
|
6329
6290
|
{
|
|
6330
6291
|
closeButton: false,
|
|
@@ -6342,7 +6303,7 @@ function AdsToaster({
|
|
|
6342
6303
|
);
|
|
6343
6304
|
}
|
|
6344
6305
|
function toStageNode(intent, title, options) {
|
|
6345
|
-
return /* @__PURE__ */
|
|
6306
|
+
return /* @__PURE__ */ jsx66(
|
|
6346
6307
|
AdsToast,
|
|
6347
6308
|
{
|
|
6348
6309
|
action: options?.action,
|
|
@@ -6356,7 +6317,7 @@ function toStageNode(intent, title, options) {
|
|
|
6356
6317
|
function showAdsToast(intent, title, options) {
|
|
6357
6318
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
6358
6319
|
return toast.custom(
|
|
6359
|
-
(id) => /* @__PURE__ */
|
|
6320
|
+
(id) => /* @__PURE__ */ jsx66(
|
|
6360
6321
|
AdsToast,
|
|
6361
6322
|
{
|
|
6362
6323
|
action: action ? {
|
|
@@ -6410,10 +6371,10 @@ var AdsToastManager = Object.assign(
|
|
|
6410
6371
|
);
|
|
6411
6372
|
|
|
6412
6373
|
// src/components/AdsDialog/index.tsx
|
|
6413
|
-
import * as
|
|
6374
|
+
import * as React61 from "react";
|
|
6414
6375
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
6415
6376
|
import { X as X2 } from "lucide-react";
|
|
6416
|
-
import { jsx as
|
|
6377
|
+
import { jsx as jsx67, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6417
6378
|
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";
|
|
6418
6379
|
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%]";
|
|
6419
6380
|
var bodyClassName = "min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]";
|
|
@@ -6421,7 +6382,7 @@ var closeButtonClassName = "absolute right-xl top-xl inline-flex h-6 w-6 items-c
|
|
|
6421
6382
|
var Dialog = DialogPrimitive.Root;
|
|
6422
6383
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
6423
6384
|
var DialogPortal = DialogPrimitive.Portal;
|
|
6424
|
-
var DialogOverlay =
|
|
6385
|
+
var DialogOverlay = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6425
6386
|
DialogPrimitive.Overlay,
|
|
6426
6387
|
{
|
|
6427
6388
|
className: cn(overlayClassName2, className),
|
|
@@ -6430,7 +6391,7 @@ var DialogOverlay = React60.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
6430
6391
|
}
|
|
6431
6392
|
));
|
|
6432
6393
|
DialogOverlay.displayName = "DialogOverlay";
|
|
6433
|
-
var DialogClose =
|
|
6394
|
+
var DialogClose = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6434
6395
|
DialogPrimitive.Close,
|
|
6435
6396
|
{
|
|
6436
6397
|
className: cn(
|
|
@@ -6444,8 +6405,8 @@ var DialogClose = React60.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6444
6405
|
DialogClose.displayName = "DialogClose";
|
|
6445
6406
|
function flattenDialogChildren(children) {
|
|
6446
6407
|
const nodes = [];
|
|
6447
|
-
|
|
6448
|
-
if (
|
|
6408
|
+
React61.Children.forEach(children, (child) => {
|
|
6409
|
+
if (React61.isValidElement(child) && child.type === React61.Fragment) {
|
|
6449
6410
|
nodes.push(...flattenDialogChildren(child.props.children));
|
|
6450
6411
|
return;
|
|
6451
6412
|
}
|
|
@@ -6454,10 +6415,10 @@ function flattenDialogChildren(children) {
|
|
|
6454
6415
|
return nodes;
|
|
6455
6416
|
}
|
|
6456
6417
|
function isDialogSlotElement(child, component) {
|
|
6457
|
-
return
|
|
6418
|
+
return React61.isValidElement(child) && child.type === component;
|
|
6458
6419
|
}
|
|
6459
|
-
var DialogBody =
|
|
6460
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
6420
|
+
var DialogBody = React61.forwardRef(
|
|
6421
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6461
6422
|
"div",
|
|
6462
6423
|
{
|
|
6463
6424
|
className: cn(bodyClassName, className),
|
|
@@ -6468,7 +6429,7 @@ var DialogBody = React60.forwardRef(
|
|
|
6468
6429
|
)
|
|
6469
6430
|
);
|
|
6470
6431
|
DialogBody.displayName = "DialogBody";
|
|
6471
|
-
var DialogContent =
|
|
6432
|
+
var DialogContent = React61.forwardRef(
|
|
6472
6433
|
({
|
|
6473
6434
|
children,
|
|
6474
6435
|
className,
|
|
@@ -6525,8 +6486,8 @@ var DialogContent = React60.forwardRef(
|
|
|
6525
6486
|
const looseBodyNodes = bodyNodes.filter(
|
|
6526
6487
|
(child) => !isDialogSlotElement(child, DialogBody)
|
|
6527
6488
|
);
|
|
6528
|
-
return /* @__PURE__ */
|
|
6529
|
-
/* @__PURE__ */
|
|
6489
|
+
return /* @__PURE__ */ jsx67(NestedDismissableLayerProvider, { coordinator: parentLayer.coordinator, children: /* @__PURE__ */ jsxs32(DialogPortal, { children: [
|
|
6490
|
+
/* @__PURE__ */ jsx67(DialogOverlay, {}),
|
|
6530
6491
|
/* @__PURE__ */ jsxs32(
|
|
6531
6492
|
DialogPrimitive.Content,
|
|
6532
6493
|
{
|
|
@@ -6543,9 +6504,9 @@ var DialogContent = React60.forwardRef(
|
|
|
6543
6504
|
...props,
|
|
6544
6505
|
children: [
|
|
6545
6506
|
headerNode,
|
|
6546
|
-
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */
|
|
6507
|
+
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ jsx67(DialogHeader, { children: generatedHeaderNodes }) : null,
|
|
6547
6508
|
explicitBodyNodes.length > 0 ? explicitBodyNodes : null,
|
|
6548
|
-
looseBodyNodes.length > 0 ? /* @__PURE__ */
|
|
6509
|
+
looseBodyNodes.length > 0 ? /* @__PURE__ */ jsx67(DialogBody, { children: looseBodyNodes }) : null,
|
|
6549
6510
|
footerNode,
|
|
6550
6511
|
!hideCloseButton ? /* @__PURE__ */ jsxs32(
|
|
6551
6512
|
DialogPrimitive.Close,
|
|
@@ -6553,8 +6514,8 @@ var DialogContent = React60.forwardRef(
|
|
|
6553
6514
|
"aria-label": resolvedCloseLabel,
|
|
6554
6515
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
6555
6516
|
children: [
|
|
6556
|
-
/* @__PURE__ */
|
|
6557
|
-
/* @__PURE__ */
|
|
6517
|
+
/* @__PURE__ */ jsx67(X2, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
6518
|
+
/* @__PURE__ */ jsx67("span", { className: "sr-only", children: resolvedCloseLabel })
|
|
6558
6519
|
]
|
|
6559
6520
|
}
|
|
6560
6521
|
) : null
|
|
@@ -6565,8 +6526,8 @@ var DialogContent = React60.forwardRef(
|
|
|
6565
6526
|
}
|
|
6566
6527
|
);
|
|
6567
6528
|
DialogContent.displayName = "DialogContent";
|
|
6568
|
-
var DialogHeader =
|
|
6569
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
6529
|
+
var DialogHeader = React61.forwardRef(
|
|
6530
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6570
6531
|
"div",
|
|
6571
6532
|
{
|
|
6572
6533
|
"data-slot": "ads-dialog-header",
|
|
@@ -6577,8 +6538,8 @@ var DialogHeader = React60.forwardRef(
|
|
|
6577
6538
|
)
|
|
6578
6539
|
);
|
|
6579
6540
|
DialogHeader.displayName = "DialogHeader";
|
|
6580
|
-
var DialogFooter =
|
|
6581
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
6541
|
+
var DialogFooter = React61.forwardRef(
|
|
6542
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6582
6543
|
"div",
|
|
6583
6544
|
{
|
|
6584
6545
|
"data-slot": "ads-dialog-footer",
|
|
@@ -6592,7 +6553,7 @@ var DialogFooter = React60.forwardRef(
|
|
|
6592
6553
|
)
|
|
6593
6554
|
);
|
|
6594
6555
|
DialogFooter.displayName = "DialogFooter";
|
|
6595
|
-
var DialogTitle =
|
|
6556
|
+
var DialogTitle = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6596
6557
|
DialogPrimitive.Title,
|
|
6597
6558
|
{
|
|
6598
6559
|
className: cn(
|
|
@@ -6605,7 +6566,7 @@ var DialogTitle = React60.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6605
6566
|
}
|
|
6606
6567
|
));
|
|
6607
6568
|
DialogTitle.displayName = "DialogTitle";
|
|
6608
|
-
var DialogDescription =
|
|
6569
|
+
var DialogDescription = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx67(
|
|
6609
6570
|
DialogPrimitive.Description,
|
|
6610
6571
|
{
|
|
6611
6572
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -6621,14 +6582,13 @@ var AdsDialogOverlay = DialogOverlay;
|
|
|
6621
6582
|
var AdsDialogClose = DialogClose;
|
|
6622
6583
|
var AdsDialogContent = DialogContent;
|
|
6623
6584
|
var AdsDialogHeader = DialogHeader;
|
|
6624
|
-
var AdsDialogBody = DialogBody;
|
|
6625
6585
|
var AdsDialogFooter = DialogFooter;
|
|
6626
6586
|
var AdsDialogTitle = DialogTitle;
|
|
6627
6587
|
var AdsDialogDescription = DialogDescription;
|
|
6628
6588
|
|
|
6629
6589
|
// src/components/AdsMasonry/index.tsx
|
|
6630
6590
|
import { Masonry } from "masonic";
|
|
6631
|
-
import { jsx as
|
|
6591
|
+
import { jsx as jsx68, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6632
6592
|
var DEFAULT_COLUMN_WIDTH = 240;
|
|
6633
6593
|
var DEFAULT_GAP = 16;
|
|
6634
6594
|
var DEFAULT_ITEM_HEIGHT_ESTIMATE = 280;
|
|
@@ -6664,7 +6624,7 @@ function AdsMasonry({
|
|
|
6664
6624
|
{ length: loadingItemCount },
|
|
6665
6625
|
(_, index) => index
|
|
6666
6626
|
);
|
|
6667
|
-
return /* @__PURE__ */
|
|
6627
|
+
return /* @__PURE__ */ jsx68(
|
|
6668
6628
|
"div",
|
|
6669
6629
|
{
|
|
6670
6630
|
className: cn(
|
|
@@ -6683,13 +6643,13 @@ function AdsMasonry({
|
|
|
6683
6643
|
"data-slot": "ads-masonry-loading-card",
|
|
6684
6644
|
"data-testid": "ads-masonry-loading-card",
|
|
6685
6645
|
children: [
|
|
6686
|
-
/* @__PURE__ */
|
|
6646
|
+
/* @__PURE__ */ jsx68(
|
|
6687
6647
|
"div",
|
|
6688
6648
|
{
|
|
6689
6649
|
className: "border-b border-border/60 bg-surface-inset/50",
|
|
6690
6650
|
"data-slot": "ads-masonry-skeleton-preview",
|
|
6691
6651
|
"data-testid": "ads-masonry-skeleton-preview",
|
|
6692
|
-
children: /* @__PURE__ */
|
|
6652
|
+
children: /* @__PURE__ */ jsx68(
|
|
6693
6653
|
AdsSkeleton,
|
|
6694
6654
|
{
|
|
6695
6655
|
className: cn("w-full rounded-none", classNames?.skeleton),
|
|
@@ -6703,7 +6663,7 @@ function AdsMasonry({
|
|
|
6703
6663
|
/* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-4 p-lg", children: [
|
|
6704
6664
|
/* @__PURE__ */ jsxs33("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6705
6665
|
/* @__PURE__ */ jsxs33("div", { className: "flex-1 space-y-2", children: [
|
|
6706
|
-
/* @__PURE__ */
|
|
6666
|
+
/* @__PURE__ */ jsx68(
|
|
6707
6667
|
AdsSkeleton,
|
|
6708
6668
|
{
|
|
6709
6669
|
className: cn("h-3 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6711,7 +6671,7 @@ function AdsMasonry({
|
|
|
6711
6671
|
"data-testid": "ads-masonry-skeleton"
|
|
6712
6672
|
}
|
|
6713
6673
|
),
|
|
6714
|
-
/* @__PURE__ */
|
|
6674
|
+
/* @__PURE__ */ jsx68(
|
|
6715
6675
|
AdsSkeleton,
|
|
6716
6676
|
{
|
|
6717
6677
|
className: cn("h-6 rounded-full", classNames?.skeleton),
|
|
@@ -6721,7 +6681,7 @@ function AdsMasonry({
|
|
|
6721
6681
|
}
|
|
6722
6682
|
)
|
|
6723
6683
|
] }),
|
|
6724
|
-
/* @__PURE__ */
|
|
6684
|
+
/* @__PURE__ */ jsx68(
|
|
6725
6685
|
AdsSkeleton,
|
|
6726
6686
|
{
|
|
6727
6687
|
className: cn("h-6 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6730,7 +6690,7 @@ function AdsMasonry({
|
|
|
6730
6690
|
}
|
|
6731
6691
|
)
|
|
6732
6692
|
] }),
|
|
6733
|
-
/* @__PURE__ */
|
|
6693
|
+
/* @__PURE__ */ jsx68(
|
|
6734
6694
|
AdsSkeleton,
|
|
6735
6695
|
{
|
|
6736
6696
|
className: cn("h-4 rounded-full", classNames?.skeleton),
|
|
@@ -6749,7 +6709,7 @@ function AdsMasonry({
|
|
|
6749
6709
|
);
|
|
6750
6710
|
}
|
|
6751
6711
|
if (items.length === 0) {
|
|
6752
|
-
return emptyState ? /* @__PURE__ */
|
|
6712
|
+
return emptyState ? /* @__PURE__ */ jsx68(
|
|
6753
6713
|
"div",
|
|
6754
6714
|
{
|
|
6755
6715
|
className: cn(rootClassName, classNames?.empty),
|
|
@@ -6758,7 +6718,7 @@ function AdsMasonry({
|
|
|
6758
6718
|
}
|
|
6759
6719
|
) : null;
|
|
6760
6720
|
}
|
|
6761
|
-
return /* @__PURE__ */
|
|
6721
|
+
return /* @__PURE__ */ jsx68(
|
|
6762
6722
|
Masonry,
|
|
6763
6723
|
{
|
|
6764
6724
|
className: rootClassName,
|
|
@@ -6770,7 +6730,7 @@ function AdsMasonry({
|
|
|
6770
6730
|
maxColumnCount,
|
|
6771
6731
|
onRender,
|
|
6772
6732
|
overscanBy,
|
|
6773
|
-
render: ({ data, index, width }) => /* @__PURE__ */
|
|
6733
|
+
render: ({ data, index, width }) => /* @__PURE__ */ jsx68(
|
|
6774
6734
|
"div",
|
|
6775
6735
|
{
|
|
6776
6736
|
className: cn("pb-0", classNames?.item, itemClassName),
|
|
@@ -6817,6 +6777,7 @@ export {
|
|
|
6817
6777
|
AdsButtonGroupSeparator,
|
|
6818
6778
|
AdsButtonGroupText,
|
|
6819
6779
|
AdsCalendar,
|
|
6780
|
+
AdsCard,
|
|
6820
6781
|
AdsCheckbox,
|
|
6821
6782
|
AdsDataPagination,
|
|
6822
6783
|
AdsDataTable,
|
|
@@ -6824,7 +6785,6 @@ export {
|
|
|
6824
6785
|
AdsDatePicker,
|
|
6825
6786
|
AdsDateTimePicker,
|
|
6826
6787
|
AdsDialog,
|
|
6827
|
-
AdsDialogBody,
|
|
6828
6788
|
AdsDialogClose,
|
|
6829
6789
|
AdsDialogContent,
|
|
6830
6790
|
AdsDialogDescription,
|