@teja-app/ui 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.types.d.ts +2 -0
- package/dist/components/Alert/Alert.types.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.types.d.ts +2 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.types.d.ts +2 -0
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.types.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.types.d.ts +2 -0
- package/dist/components/Combobox/Combobox.types.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +2 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.types.d.ts +2 -0
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.types.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.types.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.types.d.ts +2 -0
- package/dist/components/Modal/Modal.types.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.types.d.ts +2 -0
- package/dist/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +2 -0
- package/dist/components/PasswordInput/PasswordInput.types.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.types.d.ts +4 -0
- package/dist/components/Radio/Radio.types.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +1 -1
- package/dist/components/Radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.types.d.ts +2 -0
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +4 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem.d.ts +1 -1
- package/dist/components/Sidebar/SidebarItem.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.types.d.ts +2 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +2 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.types.d.ts +4 -0
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.types.d.ts +2 -0
- package/dist/components/Textarea/Textarea.types.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.types.d.ts +2 -0
- package/dist/components/Toggle/Toggle.types.d.ts.map +1 -1
- package/dist/index.cjs +202 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +202 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -150,6 +150,7 @@ const Spinner = forwardRef(
|
|
|
150
150
|
color = "current",
|
|
151
151
|
label = "Loading",
|
|
152
152
|
className,
|
|
153
|
+
testId,
|
|
153
154
|
...props
|
|
154
155
|
}, ref) => {
|
|
155
156
|
return /* @__PURE__ */ jsxs(
|
|
@@ -167,6 +168,7 @@ const Spinner = forwardRef(
|
|
|
167
168
|
xmlns: "http://www.w3.org/2000/svg",
|
|
168
169
|
role: "status",
|
|
169
170
|
"aria-label": label,
|
|
171
|
+
"data-testid": testId,
|
|
170
172
|
...props,
|
|
171
173
|
children: [
|
|
172
174
|
/* @__PURE__ */ jsx(
|
|
@@ -207,18 +209,20 @@ const Input = forwardRef(
|
|
|
207
209
|
required,
|
|
208
210
|
disabled,
|
|
209
211
|
isLoading = false,
|
|
212
|
+
testId,
|
|
210
213
|
...props
|
|
211
214
|
}, ref) => {
|
|
212
215
|
const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
213
216
|
const hasError = !!error2;
|
|
214
217
|
const errorId = hasError ? `${inputId}-error` : void 0;
|
|
215
218
|
const showRightIcon = rightIcon || isLoading;
|
|
216
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto"), children: [
|
|
219
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto"), "data-testid": testId, children: [
|
|
217
220
|
label && /* @__PURE__ */ jsxs(
|
|
218
221
|
"label",
|
|
219
222
|
{
|
|
220
223
|
htmlFor: inputId,
|
|
221
224
|
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
225
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
222
226
|
children: [
|
|
223
227
|
label,
|
|
224
228
|
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
@@ -226,7 +230,14 @@ const Input = forwardRef(
|
|
|
226
230
|
}
|
|
227
231
|
),
|
|
228
232
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
229
|
-
leftIcon && /* @__PURE__ */ jsx(
|
|
233
|
+
leftIcon && /* @__PURE__ */ jsx(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-primary-400 dark:text-primary-500",
|
|
237
|
+
"data-testid": testId ? `${testId}-left-icon` : void 0,
|
|
238
|
+
children: leftIcon
|
|
239
|
+
}
|
|
240
|
+
),
|
|
230
241
|
/* @__PURE__ */ jsx(
|
|
231
242
|
"input",
|
|
232
243
|
{
|
|
@@ -237,6 +248,7 @@ const Input = forwardRef(
|
|
|
237
248
|
"aria-label": !label ? props.placeholder || "Input" : void 0,
|
|
238
249
|
"aria-invalid": hasError ? "true" : void 0,
|
|
239
250
|
"aria-describedby": errorId,
|
|
251
|
+
"data-testid": testId ? `${testId}-input` : void 0,
|
|
240
252
|
className: cn(
|
|
241
253
|
// Base styles - Light mode
|
|
242
254
|
"block w-full rounded-md border bg-white px-4 py-2.5 text-sm text-primary-900",
|
|
@@ -259,13 +271,21 @@ const Input = forwardRef(
|
|
|
259
271
|
...props
|
|
260
272
|
}
|
|
261
273
|
),
|
|
262
|
-
showRightIcon && /* @__PURE__ */ jsx(
|
|
274
|
+
showRightIcon && /* @__PURE__ */ jsx(
|
|
275
|
+
"div",
|
|
276
|
+
{
|
|
277
|
+
className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-primary-400 dark:text-primary-500",
|
|
278
|
+
"data-testid": testId ? `${testId}-right-icon` : void 0,
|
|
279
|
+
children: isLoading ? /* @__PURE__ */ jsx(Spinner, { size: "sm", color: "primary" }) : rightIcon
|
|
280
|
+
}
|
|
281
|
+
)
|
|
263
282
|
] }),
|
|
264
283
|
(error2 || helperText) && /* @__PURE__ */ jsx(
|
|
265
284
|
"p",
|
|
266
285
|
{
|
|
267
286
|
id: errorId,
|
|
268
287
|
role: hasError ? "alert" : void 0,
|
|
288
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
269
289
|
className: cn(
|
|
270
290
|
"mt-1.5 text-sm",
|
|
271
291
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -345,7 +365,7 @@ function getPasswordStrength(password) {
|
|
|
345
365
|
}
|
|
346
366
|
}
|
|
347
367
|
const PasswordInput = forwardRef(
|
|
348
|
-
({ showStrengthIndicator = false, value, className, ...props }, ref) => {
|
|
368
|
+
({ showStrengthIndicator = false, value, className, testId, ...props }, ref) => {
|
|
349
369
|
const [showPassword, setShowPassword] = useState(false);
|
|
350
370
|
const togglePasswordVisibility = () => {
|
|
351
371
|
setShowPassword((prev) => !prev);
|
|
@@ -364,10 +384,11 @@ const PasswordInput = forwardRef(
|
|
|
364
384
|
"dark:text-primary-500 dark:hover:text-primary-300"
|
|
365
385
|
),
|
|
366
386
|
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
387
|
+
"data-testid": testId ? `${testId}-toggle-button` : void 0,
|
|
367
388
|
children: showPassword ? /* @__PURE__ */ jsx(EyeSlashIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
|
|
368
389
|
}
|
|
369
390
|
);
|
|
370
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
391
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), "data-testid": testId, children: [
|
|
371
392
|
/* @__PURE__ */ jsx(
|
|
372
393
|
Input,
|
|
373
394
|
{
|
|
@@ -375,7 +396,8 @@ const PasswordInput = forwardRef(
|
|
|
375
396
|
ref,
|
|
376
397
|
type: showPassword ? "text" : "password",
|
|
377
398
|
value,
|
|
378
|
-
rightIcon: toggleButton
|
|
399
|
+
rightIcon: toggleButton,
|
|
400
|
+
testId: testId ? `${testId}-input` : void 0
|
|
379
401
|
}
|
|
380
402
|
),
|
|
381
403
|
showStrengthIndicator && passwordValue && strength && strength.label && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
@@ -424,6 +446,7 @@ const Textarea = forwardRef(
|
|
|
424
446
|
defaultValue,
|
|
425
447
|
onChange,
|
|
426
448
|
isLoading = false,
|
|
449
|
+
testId,
|
|
427
450
|
...props
|
|
428
451
|
}, ref) => {
|
|
429
452
|
const textareaId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
@@ -464,12 +487,13 @@ const Textarea = forwardRef(
|
|
|
464
487
|
adjustHeight();
|
|
465
488
|
}
|
|
466
489
|
}, [autoResize, adjustHeight, value, defaultValue]);
|
|
467
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto"), children: [
|
|
490
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto"), "data-testid": testId, children: [
|
|
468
491
|
label && /* @__PURE__ */ jsxs(
|
|
469
492
|
"label",
|
|
470
493
|
{
|
|
471
494
|
htmlFor: textareaId,
|
|
472
495
|
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
496
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
473
497
|
children: [
|
|
474
498
|
label,
|
|
475
499
|
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
@@ -492,6 +516,7 @@ const Textarea = forwardRef(
|
|
|
492
516
|
"aria-invalid": hasError ? "true" : void 0,
|
|
493
517
|
"aria-describedby": errorId,
|
|
494
518
|
onChange: handleChange,
|
|
519
|
+
"data-testid": testId ? `${testId}-textarea` : void 0,
|
|
495
520
|
className: cn(
|
|
496
521
|
// Base styles - Light mode
|
|
497
522
|
"block w-full rounded-md border bg-white px-4 py-2.5 text-sm text-primary-900",
|
|
@@ -522,6 +547,7 @@ const Textarea = forwardRef(
|
|
|
522
547
|
{
|
|
523
548
|
id: errorId,
|
|
524
549
|
role: hasError ? "alert" : void 0,
|
|
550
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
525
551
|
className: cn(
|
|
526
552
|
"text-sm",
|
|
527
553
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -7223,18 +7249,20 @@ function Select({
|
|
|
7223
7249
|
className,
|
|
7224
7250
|
isLoading = false,
|
|
7225
7251
|
loadingText = "Loading...",
|
|
7226
|
-
placement = "bottom"
|
|
7252
|
+
placement = "bottom",
|
|
7253
|
+
testId
|
|
7227
7254
|
}) {
|
|
7228
7255
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
7229
7256
|
const hasError = !!error2;
|
|
7230
7257
|
const isDisabled = disabled || isLoading;
|
|
7231
7258
|
const labelId = useId$1();
|
|
7232
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), children: [
|
|
7259
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), "data-testid": testId, children: [
|
|
7233
7260
|
label && /* @__PURE__ */ jsxs(
|
|
7234
7261
|
"label",
|
|
7235
7262
|
{
|
|
7236
7263
|
id: labelId,
|
|
7237
7264
|
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
7265
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
7238
7266
|
children: [
|
|
7239
7267
|
label,
|
|
7240
7268
|
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
@@ -7247,6 +7275,7 @@ function Select({
|
|
|
7247
7275
|
{
|
|
7248
7276
|
"aria-label": !label ? placeholder : void 0,
|
|
7249
7277
|
"aria-labelledby": label ? labelId : void 0,
|
|
7278
|
+
"data-testid": testId ? `${testId}-button` : void 0,
|
|
7250
7279
|
className: cn(
|
|
7251
7280
|
// Base styles - Light mode
|
|
7252
7281
|
"relative w-full rounded-md border bg-white px-4 py-2.5 text-left text-sm",
|
|
@@ -7304,11 +7333,13 @@ function Select({
|
|
|
7304
7333
|
"absolute z-dropdown max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700",
|
|
7305
7334
|
placement === "top" ? "bottom-full mb-1" : "top-full mt-1"
|
|
7306
7335
|
),
|
|
7307
|
-
|
|
7336
|
+
"data-testid": testId ? `${testId}-options` : void 0,
|
|
7337
|
+
children: options.map((option, index2) => /* @__PURE__ */ jsx(
|
|
7308
7338
|
It,
|
|
7309
7339
|
{
|
|
7310
7340
|
disabled: option.disabled,
|
|
7311
7341
|
value: option.value,
|
|
7342
|
+
"data-testid": testId ? `${testId}-option-${index2}` : void 0,
|
|
7312
7343
|
className: ({ active, selected }) => cn(
|
|
7313
7344
|
"relative cursor-pointer select-none py-2.5 pl-10 pr-4",
|
|
7314
7345
|
// Light mode
|
|
@@ -7350,6 +7381,7 @@ function Select({
|
|
|
7350
7381
|
"p",
|
|
7351
7382
|
{
|
|
7352
7383
|
role: hasError ? "alert" : void 0,
|
|
7384
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
7353
7385
|
className: cn(
|
|
7354
7386
|
"mt-1.5 text-sm",
|
|
7355
7387
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -7395,7 +7427,8 @@ function Modal({
|
|
|
7395
7427
|
footer,
|
|
7396
7428
|
closeOnOverlay = true,
|
|
7397
7429
|
className,
|
|
7398
|
-
isLoading = false
|
|
7430
|
+
isLoading = false,
|
|
7431
|
+
testId
|
|
7399
7432
|
}) {
|
|
7400
7433
|
const handleClose = closeOnOverlay ? onClose : () => {
|
|
7401
7434
|
};
|
|
@@ -7410,7 +7443,7 @@ function Modal({
|
|
|
7410
7443
|
leave: "ease-in duration-100",
|
|
7411
7444
|
leaveFrom: "opacity-100",
|
|
7412
7445
|
leaveTo: "opacity-0",
|
|
7413
|
-
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black/40 backdrop-blur-sm" })
|
|
7446
|
+
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black/40 backdrop-blur-sm", "data-testid": testId ? `${testId}-overlay` : void 0 })
|
|
7414
7447
|
}
|
|
7415
7448
|
),
|
|
7416
7449
|
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 flex items-center justify-center p-4", children: /* @__PURE__ */ jsx(
|
|
@@ -7435,6 +7468,7 @@ function Modal({
|
|
|
7435
7468
|
sizeStyles$b[size2],
|
|
7436
7469
|
className
|
|
7437
7470
|
),
|
|
7471
|
+
"data-testid": testId,
|
|
7438
7472
|
children: [
|
|
7439
7473
|
(title || showCloseButton) && /* @__PURE__ */ jsxs(
|
|
7440
7474
|
"div",
|
|
@@ -7443,6 +7477,7 @@ function Modal({
|
|
|
7443
7477
|
"flex items-start justify-between px-6 py-4",
|
|
7444
7478
|
(children || footer) && "border-b border-primary-200 dark:border-primary-700"
|
|
7445
7479
|
),
|
|
7480
|
+
"data-testid": testId ? `${testId}-header` : void 0,
|
|
7446
7481
|
children: [
|
|
7447
7482
|
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
7448
7483
|
title && /* @__PURE__ */ jsx(Qe, { className: "text-lg font-semibold text-primary-900 dark:text-white", children: title }),
|
|
@@ -7461,13 +7496,14 @@ function Modal({
|
|
|
7461
7496
|
"focus:outline-none focus:ring-2 focus:ring-gold-500/20",
|
|
7462
7497
|
"transition-colors"
|
|
7463
7498
|
),
|
|
7499
|
+
"data-testid": testId ? `${testId}-close-button` : void 0,
|
|
7464
7500
|
children: /* @__PURE__ */ jsx(CloseIcon$2, {})
|
|
7465
7501
|
}
|
|
7466
7502
|
)
|
|
7467
7503
|
]
|
|
7468
7504
|
}
|
|
7469
7505
|
),
|
|
7470
|
-
children && /* @__PURE__ */ jsxs("div", { className: "relative px-6 py-4 text-primary-700 dark:text-primary-300", children: [
|
|
7506
|
+
children && /* @__PURE__ */ jsxs("div", { className: "relative px-6 py-4 text-primary-700 dark:text-primary-300", "data-testid": testId ? `${testId}-body` : void 0, children: [
|
|
7471
7507
|
children,
|
|
7472
7508
|
isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-white/60 dark:bg-primary-800/60", children: /* @__PURE__ */ jsx(Spinner, { size: "md", color: "primary" }) })
|
|
7473
7509
|
] }),
|
|
@@ -7480,6 +7516,7 @@ function Modal({
|
|
|
7480
7516
|
"bg-primary-50 dark:bg-primary-900/50",
|
|
7481
7517
|
"rounded-b-lg"
|
|
7482
7518
|
),
|
|
7519
|
+
"data-testid": testId ? `${testId}-footer` : void 0,
|
|
7483
7520
|
children: footer
|
|
7484
7521
|
}
|
|
7485
7522
|
)
|
|
@@ -7524,7 +7561,8 @@ function Drawer({
|
|
|
7524
7561
|
showCloseButton = true,
|
|
7525
7562
|
footer,
|
|
7526
7563
|
className,
|
|
7527
|
-
isLoading = false
|
|
7564
|
+
isLoading = false,
|
|
7565
|
+
testId
|
|
7528
7566
|
}) {
|
|
7529
7567
|
return /* @__PURE__ */ jsx(Ke$2, { show: isOpen, as: Fragment$1, children: /* @__PURE__ */ jsxs(ht$1, { className: "relative z-50", onClose, children: [
|
|
7530
7568
|
/* @__PURE__ */ jsx(
|
|
@@ -7537,7 +7575,7 @@ function Drawer({
|
|
|
7537
7575
|
leave: "ease-in duration-200",
|
|
7538
7576
|
leaveFrom: "opacity-100",
|
|
7539
7577
|
leaveTo: "opacity-0",
|
|
7540
|
-
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black/40 backdrop-blur-sm" })
|
|
7578
|
+
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black/40 backdrop-blur-sm", "data-testid": testId ? `${testId}-overlay` : void 0 })
|
|
7541
7579
|
}
|
|
7542
7580
|
),
|
|
7543
7581
|
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 flex justify-end", children: /* @__PURE__ */ jsx(
|
|
@@ -7562,6 +7600,7 @@ function Drawer({
|
|
|
7562
7600
|
sizeStyles$a[size2],
|
|
7563
7601
|
className
|
|
7564
7602
|
),
|
|
7603
|
+
"data-testid": testId,
|
|
7565
7604
|
children: [
|
|
7566
7605
|
(title || showCloseButton) && /* @__PURE__ */ jsxs(
|
|
7567
7606
|
"div",
|
|
@@ -7585,13 +7624,14 @@ function Drawer({
|
|
|
7585
7624
|
"focus:outline-none focus:ring-2 focus:ring-gold-500/20",
|
|
7586
7625
|
"transition-colors"
|
|
7587
7626
|
),
|
|
7627
|
+
"data-testid": testId ? `${testId}-close-button` : void 0,
|
|
7588
7628
|
children: /* @__PURE__ */ jsx(CloseIcon$1, {})
|
|
7589
7629
|
}
|
|
7590
7630
|
)
|
|
7591
7631
|
]
|
|
7592
7632
|
}
|
|
7593
7633
|
),
|
|
7594
|
-
/* @__PURE__ */ jsxs("div", { className: "relative flex-1 overflow-y-auto px-6 py-4 text-primary-700 dark:text-primary-300", children: [
|
|
7634
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex-1 overflow-y-auto px-6 py-4 text-primary-700 dark:text-primary-300", "data-testid": testId ? `${testId}-content` : void 0, children: [
|
|
7595
7635
|
children,
|
|
7596
7636
|
isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-white/60 dark:bg-primary-800/60", children: /* @__PURE__ */ jsx(Spinner, { size: "md", color: "primary" }) })
|
|
7597
7637
|
] }),
|
|
@@ -7629,7 +7669,8 @@ function ConfirmDialog({
|
|
|
7629
7669
|
variant = "neutral",
|
|
7630
7670
|
cancelText = "Cancel",
|
|
7631
7671
|
confirmText = "Confirm",
|
|
7632
|
-
loading = false
|
|
7672
|
+
loading = false,
|
|
7673
|
+
testId
|
|
7633
7674
|
}) {
|
|
7634
7675
|
const buttonVariant = variantToButton[variant];
|
|
7635
7676
|
const handleConfirm = () => {
|
|
@@ -7645,6 +7686,7 @@ function ConfirmDialog({
|
|
|
7645
7686
|
size: "sm",
|
|
7646
7687
|
showCloseButton: false,
|
|
7647
7688
|
closeOnOverlay: !loading,
|
|
7689
|
+
testId,
|
|
7648
7690
|
footer: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-3", children: [
|
|
7649
7691
|
/* @__PURE__ */ jsx(
|
|
7650
7692
|
Button,
|
|
@@ -7652,6 +7694,7 @@ function ConfirmDialog({
|
|
|
7652
7694
|
variant: "secondary",
|
|
7653
7695
|
onClick: onClose,
|
|
7654
7696
|
disabled: loading,
|
|
7697
|
+
"data-testid": testId ? `${testId}-cancel-button` : void 0,
|
|
7655
7698
|
children: cancelText
|
|
7656
7699
|
}
|
|
7657
7700
|
),
|
|
@@ -7661,6 +7704,7 @@ function ConfirmDialog({
|
|
|
7661
7704
|
variant: buttonVariant,
|
|
7662
7705
|
onClick: handleConfirm,
|
|
7663
7706
|
disabled: loading,
|
|
7707
|
+
"data-testid": testId ? `${testId}-confirm-button` : void 0,
|
|
7664
7708
|
children: loading ? "Loading..." : confirmText
|
|
7665
7709
|
}
|
|
7666
7710
|
)
|
|
@@ -7700,6 +7744,7 @@ const Card = forwardRef(
|
|
|
7700
7744
|
hoverable = false,
|
|
7701
7745
|
children,
|
|
7702
7746
|
className,
|
|
7747
|
+
testId,
|
|
7703
7748
|
...props
|
|
7704
7749
|
}, ref) => {
|
|
7705
7750
|
return /* @__PURE__ */ jsx(
|
|
@@ -7725,6 +7770,7 @@ const Card = forwardRef(
|
|
|
7725
7770
|
],
|
|
7726
7771
|
className
|
|
7727
7772
|
),
|
|
7773
|
+
"data-testid": testId,
|
|
7728
7774
|
...props,
|
|
7729
7775
|
children
|
|
7730
7776
|
}
|
|
@@ -7754,6 +7800,7 @@ const Checkbox = forwardRef(
|
|
|
7754
7800
|
indeterminate = false,
|
|
7755
7801
|
className,
|
|
7756
7802
|
id,
|
|
7803
|
+
testId,
|
|
7757
7804
|
...props
|
|
7758
7805
|
}, forwardedRef) => {
|
|
7759
7806
|
const checkboxId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
@@ -7780,7 +7827,7 @@ const Checkbox = forwardRef(
|
|
|
7780
7827
|
const handleChange = (e3) => {
|
|
7781
7828
|
onChange?.(e3.target.checked);
|
|
7782
7829
|
};
|
|
7783
|
-
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
7830
|
+
return /* @__PURE__ */ jsxs("div", { className, "data-testid": testId, children: [
|
|
7784
7831
|
/* @__PURE__ */ jsxs(
|
|
7785
7832
|
"label",
|
|
7786
7833
|
{
|
|
@@ -7789,6 +7836,7 @@ const Checkbox = forwardRef(
|
|
|
7789
7836
|
"inline-flex items-center gap-2",
|
|
7790
7837
|
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
|
|
7791
7838
|
),
|
|
7839
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
7792
7840
|
children: [
|
|
7793
7841
|
/* @__PURE__ */ jsx(
|
|
7794
7842
|
"input",
|
|
@@ -7801,6 +7849,7 @@ const Checkbox = forwardRef(
|
|
|
7801
7849
|
"aria-invalid": hasError ? "true" : void 0,
|
|
7802
7850
|
"aria-describedby": errorId,
|
|
7803
7851
|
onChange: handleChange,
|
|
7852
|
+
"data-testid": testId ? `${testId}-checkbox` : void 0,
|
|
7804
7853
|
className: cn(
|
|
7805
7854
|
sizeStyles$9[size2],
|
|
7806
7855
|
"rounded border transition-colors",
|
|
@@ -7845,6 +7894,7 @@ const Checkbox = forwardRef(
|
|
|
7845
7894
|
{
|
|
7846
7895
|
id: errorId,
|
|
7847
7896
|
role: hasError ? "alert" : void 0,
|
|
7897
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
7848
7898
|
className: cn(
|
|
7849
7899
|
"mt-1 text-sm",
|
|
7850
7900
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -7874,6 +7924,7 @@ const Radio = forwardRef(
|
|
|
7874
7924
|
error: error2 = false,
|
|
7875
7925
|
className,
|
|
7876
7926
|
id,
|
|
7927
|
+
testId,
|
|
7877
7928
|
...props
|
|
7878
7929
|
}, ref) => {
|
|
7879
7930
|
const radioId = id || (label ? `${props.name}-${label.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
@@ -7886,6 +7937,7 @@ const Radio = forwardRef(
|
|
|
7886
7937
|
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
7887
7938
|
className
|
|
7888
7939
|
),
|
|
7940
|
+
"data-testid": testId,
|
|
7889
7941
|
children: [
|
|
7890
7942
|
/* @__PURE__ */ jsx(
|
|
7891
7943
|
"input",
|
|
@@ -7894,6 +7946,7 @@ const Radio = forwardRef(
|
|
|
7894
7946
|
type: "radio",
|
|
7895
7947
|
id: radioId,
|
|
7896
7948
|
disabled,
|
|
7949
|
+
"data-testid": testId ? `${testId}-radio` : void 0,
|
|
7897
7950
|
className: cn(
|
|
7898
7951
|
sizeStyles$8[size2],
|
|
7899
7952
|
"border transition-colors",
|
|
@@ -7925,6 +7978,7 @@ const Radio = forwardRef(
|
|
|
7925
7978
|
"text-primary-700 dark:text-primary-200",
|
|
7926
7979
|
error2 && "text-error"
|
|
7927
7980
|
),
|
|
7981
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
7928
7982
|
children: label
|
|
7929
7983
|
}
|
|
7930
7984
|
)
|
|
@@ -7946,7 +8000,8 @@ function RadioGroup({
|
|
|
7946
8000
|
disabled = false,
|
|
7947
8001
|
orientation = "vertical",
|
|
7948
8002
|
className,
|
|
7949
|
-
isLoading = false
|
|
8003
|
+
isLoading = false,
|
|
8004
|
+
testId
|
|
7950
8005
|
}) {
|
|
7951
8006
|
const hasError = !!error2;
|
|
7952
8007
|
const groupId = `${name}-group`;
|
|
@@ -7954,7 +8009,7 @@ function RadioGroup({
|
|
|
7954
8009
|
const handleChange = (e3) => {
|
|
7955
8010
|
onChange?.(e3.target.value);
|
|
7956
8011
|
};
|
|
7957
|
-
return /* @__PURE__ */ jsxs("fieldset", { className, role: "radiogroup", "aria-labelledby": label ? groupId : void 0, children: [
|
|
8012
|
+
return /* @__PURE__ */ jsxs("fieldset", { className, role: "radiogroup", "aria-labelledby": label ? groupId : void 0, "data-testid": testId, children: [
|
|
7958
8013
|
label && /* @__PURE__ */ jsxs(
|
|
7959
8014
|
"legend",
|
|
7960
8015
|
{
|
|
@@ -7972,7 +8027,7 @@ function RadioGroup({
|
|
|
7972
8027
|
className: cn(
|
|
7973
8028
|
orientation === "vertical" ? "space-y-2" : "flex flex-wrap gap-4"
|
|
7974
8029
|
),
|
|
7975
|
-
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
8030
|
+
children: options.map((option, index2) => /* @__PURE__ */ jsx(
|
|
7976
8031
|
Radio,
|
|
7977
8032
|
{
|
|
7978
8033
|
name,
|
|
@@ -7982,7 +8037,8 @@ function RadioGroup({
|
|
|
7982
8037
|
disabled: isDisabled || option.disabled,
|
|
7983
8038
|
error: hasError,
|
|
7984
8039
|
checked: value === option.value,
|
|
7985
|
-
onChange: handleChange
|
|
8040
|
+
onChange: handleChange,
|
|
8041
|
+
testId: testId ? `${testId}-option-${index2}` : void 0
|
|
7986
8042
|
},
|
|
7987
8043
|
option.value
|
|
7988
8044
|
))
|
|
@@ -7992,6 +8048,7 @@ function RadioGroup({
|
|
|
7992
8048
|
"p",
|
|
7993
8049
|
{
|
|
7994
8050
|
role: hasError ? "alert" : void 0,
|
|
8051
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
7995
8052
|
className: cn(
|
|
7996
8053
|
"mt-2 text-sm",
|
|
7997
8054
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -8027,11 +8084,12 @@ function Toggle({
|
|
|
8027
8084
|
disabled = false,
|
|
8028
8085
|
size: size2 = "md",
|
|
8029
8086
|
className,
|
|
8030
|
-
isLoading = false
|
|
8087
|
+
isLoading = false,
|
|
8088
|
+
testId
|
|
8031
8089
|
}) {
|
|
8032
8090
|
const currentSize = sizeStyles$7[size2];
|
|
8033
8091
|
const isDisabled = disabled || isLoading;
|
|
8034
|
-
return /* @__PURE__ */ jsx(W, { className, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8092
|
+
return /* @__PURE__ */ jsx(W, { className, "data-testid": testId, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8035
8093
|
(label || description) && /* @__PURE__ */ jsxs("div", { className: "flex-1 mr-4", children: [
|
|
8036
8094
|
label && /* @__PURE__ */ jsx(
|
|
8037
8095
|
Z,
|
|
@@ -8053,6 +8111,7 @@ function Toggle({
|
|
|
8053
8111
|
disabled: isDisabled,
|
|
8054
8112
|
onChange,
|
|
8055
8113
|
"aria-label": !label ? "Toggle" : void 0,
|
|
8114
|
+
"data-testid": testId ? `${testId}-toggle` : void 0,
|
|
8056
8115
|
className: cn(
|
|
8057
8116
|
currentSize.switch,
|
|
8058
8117
|
"relative inline-flex shrink-0 cursor-pointer rounded-full",
|
|
@@ -8138,7 +8197,8 @@ function Combobox({
|
|
|
8138
8197
|
isLoading = false,
|
|
8139
8198
|
loadingText = "Loading...",
|
|
8140
8199
|
emptyText = "No results found",
|
|
8141
|
-
onSearch
|
|
8200
|
+
onSearch,
|
|
8201
|
+
testId
|
|
8142
8202
|
}) {
|
|
8143
8203
|
const [query, setQuery] = useState("");
|
|
8144
8204
|
const hasError = !!error2;
|
|
@@ -8158,12 +8218,13 @@ function Combobox({
|
|
|
8158
8218
|
onChange?.(newValue);
|
|
8159
8219
|
setQuery("");
|
|
8160
8220
|
};
|
|
8161
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), children: [
|
|
8221
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), "data-testid": testId, children: [
|
|
8162
8222
|
label && /* @__PURE__ */ jsxs(
|
|
8163
8223
|
"label",
|
|
8164
8224
|
{
|
|
8165
8225
|
id: labelId,
|
|
8166
8226
|
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
8227
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
8167
8228
|
children: [
|
|
8168
8229
|
label,
|
|
8169
8230
|
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
@@ -8190,6 +8251,7 @@ function Combobox({
|
|
|
8190
8251
|
onSearch?.(newQuery);
|
|
8191
8252
|
},
|
|
8192
8253
|
placeholder,
|
|
8254
|
+
"data-testid": testId ? `${testId}-input` : void 0,
|
|
8193
8255
|
className: cn(
|
|
8194
8256
|
// Base styles - Light mode
|
|
8195
8257
|
"w-full rounded-md border bg-white px-4 py-2.5 pr-10 text-sm text-primary-900",
|
|
@@ -8223,30 +8285,38 @@ function Combobox({
|
|
|
8223
8285
|
leaveFrom: "opacity-100",
|
|
8224
8286
|
leaveTo: "opacity-0",
|
|
8225
8287
|
afterLeave: () => setQuery(""),
|
|
8226
|
-
children: /* @__PURE__ */ jsx(
|
|
8227
|
-
|
|
8228
|
-
/* @__PURE__ */ jsx("span", { children: loadingText })
|
|
8229
|
-
] }) : filteredOptions.length === 0 && query !== "" ? /* @__PURE__ */ jsx("div", { className: "relative cursor-default select-none px-4 py-2.5 text-primary-500 dark:text-primary-400", children: emptyText }) : filteredOptions.map((option) => /* @__PURE__ */ jsx(
|
|
8230
|
-
Ho,
|
|
8288
|
+
children: /* @__PURE__ */ jsx(
|
|
8289
|
+
Uo,
|
|
8231
8290
|
{
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8291
|
+
className: "absolute z-dropdown mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700",
|
|
8292
|
+
"data-testid": testId ? `${testId}-options` : void 0,
|
|
8293
|
+
children: isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 px-4 py-2.5 text-primary-500 dark:text-primary-400", children: [
|
|
8294
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm", color: "primary" }),
|
|
8295
|
+
/* @__PURE__ */ jsx("span", { children: loadingText })
|
|
8296
|
+
] }) : filteredOptions.length === 0 && query !== "" ? /* @__PURE__ */ jsx("div", { className: "relative cursor-default select-none px-4 py-2.5 text-primary-500 dark:text-primary-400", children: emptyText }) : filteredOptions.map((option, index2) => /* @__PURE__ */ jsx(
|
|
8297
|
+
Ho,
|
|
8298
|
+
{
|
|
8299
|
+
value: option.value,
|
|
8300
|
+
disabled: option.disabled,
|
|
8301
|
+
"data-testid": testId ? `${testId}-option-${index2}` : void 0,
|
|
8302
|
+
className: ({ active, selected }) => cn(
|
|
8303
|
+
"relative cursor-pointer select-none py-2.5 pl-10 pr-4",
|
|
8304
|
+
// Light mode
|
|
8305
|
+
active ? "bg-gold-50 text-primary-900" : "text-primary-900",
|
|
8306
|
+
// Dark mode
|
|
8307
|
+
active ? "dark:bg-primary-700 dark:text-primary-100" : "dark:text-primary-200",
|
|
8308
|
+
option.disabled && "cursor-not-allowed opacity-50",
|
|
8309
|
+
selected && "font-medium"
|
|
8310
|
+
),
|
|
8311
|
+
children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8312
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate", children: option.label }),
|
|
8313
|
+
selected && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-gold-600 dark:text-gold-400", children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
8314
|
+
] })
|
|
8315
|
+
},
|
|
8316
|
+
option.value
|
|
8317
|
+
))
|
|
8318
|
+
}
|
|
8319
|
+
)
|
|
8250
8320
|
}
|
|
8251
8321
|
)
|
|
8252
8322
|
] })
|
|
@@ -8256,6 +8326,7 @@ function Combobox({
|
|
|
8256
8326
|
"p",
|
|
8257
8327
|
{
|
|
8258
8328
|
role: hasError ? "alert" : void 0,
|
|
8329
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
8259
8330
|
className: cn(
|
|
8260
8331
|
"mt-1.5 text-sm",
|
|
8261
8332
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -8298,7 +8369,7 @@ const sizeStyles$6 = {
|
|
|
8298
8369
|
lg: "px-3 py-1.5 text-base"
|
|
8299
8370
|
};
|
|
8300
8371
|
const Badge = forwardRef(
|
|
8301
|
-
({ variant = "default", size: size2 = "md", children, className, ...props }, ref) => {
|
|
8372
|
+
({ variant = "default", size: size2 = "md", children, className, testId, ...props }, ref) => {
|
|
8302
8373
|
return /* @__PURE__ */ jsx(
|
|
8303
8374
|
"span",
|
|
8304
8375
|
{
|
|
@@ -8309,6 +8380,7 @@ const Badge = forwardRef(
|
|
|
8309
8380
|
sizeStyles$6[size2],
|
|
8310
8381
|
className
|
|
8311
8382
|
),
|
|
8383
|
+
"data-testid": testId,
|
|
8312
8384
|
...props,
|
|
8313
8385
|
children
|
|
8314
8386
|
}
|
|
@@ -8478,6 +8550,7 @@ function Tabs({
|
|
|
8478
8550
|
size: size2 = "md",
|
|
8479
8551
|
className,
|
|
8480
8552
|
"aria-label": ariaLabel = "Navigation tabs",
|
|
8553
|
+
testId,
|
|
8481
8554
|
...props
|
|
8482
8555
|
}) {
|
|
8483
8556
|
const selectedIndex = useMemo(
|
|
@@ -8505,11 +8578,13 @@ function Tabs({
|
|
|
8505
8578
|
fullWidth && "w-full",
|
|
8506
8579
|
className
|
|
8507
8580
|
),
|
|
8581
|
+
"data-testid": testId,
|
|
8508
8582
|
...props,
|
|
8509
|
-
children: tabs.map((tab) => /* @__PURE__ */ jsx(
|
|
8583
|
+
children: tabs.map((tab, index2) => /* @__PURE__ */ jsx(
|
|
8510
8584
|
dt,
|
|
8511
8585
|
{
|
|
8512
8586
|
disabled: tab.disabled,
|
|
8587
|
+
"data-testid": testId ? `${testId}-tab-${index2}` : void 0,
|
|
8513
8588
|
className: ({ selected }) => cn(
|
|
8514
8589
|
"relative outline-none transition-colors duration-normal",
|
|
8515
8590
|
"focus-visible:ring-2 focus-visible:ring-gold-500/50",
|
|
@@ -8556,6 +8631,7 @@ function TabContentPanels({
|
|
|
8556
8631
|
children,
|
|
8557
8632
|
className,
|
|
8558
8633
|
isLoading = false,
|
|
8634
|
+
testId,
|
|
8559
8635
|
...props
|
|
8560
8636
|
}) {
|
|
8561
8637
|
const activeContent = activeTab && children[activeTab];
|
|
@@ -8564,6 +8640,7 @@ function TabContentPanels({
|
|
|
8564
8640
|
{
|
|
8565
8641
|
role: "tabpanel",
|
|
8566
8642
|
className: cn("relative mt-4", className),
|
|
8643
|
+
"data-testid": testId,
|
|
8567
8644
|
...props,
|
|
8568
8645
|
children: [
|
|
8569
8646
|
activeContent,
|
|
@@ -8628,6 +8705,7 @@ const Breadcrumbs = forwardRef(
|
|
|
8628
8705
|
maxItems = 0,
|
|
8629
8706
|
renderLink,
|
|
8630
8707
|
className,
|
|
8708
|
+
testId,
|
|
8631
8709
|
...props
|
|
8632
8710
|
}, ref) => {
|
|
8633
8711
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -8679,12 +8757,20 @@ const Breadcrumbs = forwardRef(
|
|
|
8679
8757
|
ref,
|
|
8680
8758
|
"aria-label": "Breadcrumb",
|
|
8681
8759
|
className: cn("text-sm", className),
|
|
8760
|
+
"data-testid": testId,
|
|
8682
8761
|
...props,
|
|
8683
8762
|
children: /* @__PURE__ */ jsx("ol", { className: "flex items-center flex-wrap gap-1", children: displayItems.map((item, index2) => {
|
|
8684
8763
|
const isLast = index2 === displayItems.length - 1;
|
|
8685
8764
|
const showEllipsis = shouldCollapse && index2 === 0;
|
|
8686
8765
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
8687
|
-
/* @__PURE__ */ jsx(
|
|
8766
|
+
/* @__PURE__ */ jsx(
|
|
8767
|
+
"li",
|
|
8768
|
+
{
|
|
8769
|
+
className: "inline-flex items-center",
|
|
8770
|
+
"data-testid": testId ? `${testId}-item-${index2}` : void 0,
|
|
8771
|
+
children: renderItem(item, index2, isLast)
|
|
8772
|
+
}
|
|
8773
|
+
),
|
|
8688
8774
|
showEllipsis && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8689
8775
|
/* @__PURE__ */ jsx("li", { className: "inline-flex items-center", "aria-hidden": "true", children: separatorElement }),
|
|
8690
8776
|
/* @__PURE__ */ jsx("li", { className: "inline-flex items-center", children: /* @__PURE__ */ jsx(EllipsisButton, { onClick: () => setIsExpanded(true) }) })
|
|
@@ -8712,6 +8798,7 @@ const Skeleton = forwardRef(
|
|
|
8712
8798
|
label = "Loading...",
|
|
8713
8799
|
className,
|
|
8714
8800
|
style,
|
|
8801
|
+
testId,
|
|
8715
8802
|
...props
|
|
8716
8803
|
}, ref) => {
|
|
8717
8804
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
@@ -8726,6 +8813,7 @@ const Skeleton = forwardRef(
|
|
|
8726
8813
|
role: "status",
|
|
8727
8814
|
"aria-label": label,
|
|
8728
8815
|
"aria-busy": "true",
|
|
8816
|
+
"data-testid": testId,
|
|
8729
8817
|
...props,
|
|
8730
8818
|
children: [
|
|
8731
8819
|
Array.from({ length: lines }).map((_2, index2) => /* @__PURE__ */ jsx(
|
|
@@ -8767,6 +8855,7 @@ const Skeleton = forwardRef(
|
|
|
8767
8855
|
role: "status",
|
|
8768
8856
|
"aria-label": label,
|
|
8769
8857
|
"aria-busy": "true",
|
|
8858
|
+
"data-testid": testId,
|
|
8770
8859
|
...props,
|
|
8771
8860
|
children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: label })
|
|
8772
8861
|
}
|
|
@@ -8867,6 +8956,7 @@ const EmptyState = forwardRef(
|
|
|
8867
8956
|
action,
|
|
8868
8957
|
size: size2 = "md",
|
|
8869
8958
|
className,
|
|
8959
|
+
testId,
|
|
8870
8960
|
...props
|
|
8871
8961
|
}, ref) => {
|
|
8872
8962
|
const styles = sizeStyles$4[size2];
|
|
@@ -8879,9 +8969,17 @@ const EmptyState = forwardRef(
|
|
|
8879
8969
|
styles.container,
|
|
8880
8970
|
className
|
|
8881
8971
|
),
|
|
8972
|
+
"data-testid": testId,
|
|
8882
8973
|
...props,
|
|
8883
8974
|
children: [
|
|
8884
|
-
/* @__PURE__ */ jsx(
|
|
8975
|
+
/* @__PURE__ */ jsx(
|
|
8976
|
+
"div",
|
|
8977
|
+
{
|
|
8978
|
+
className: cn(styles.icon, typeColors[type], "mb-4"),
|
|
8979
|
+
"data-testid": testId ? `${testId}-icon` : void 0,
|
|
8980
|
+
children: icon || defaultIcons$1[type]
|
|
8981
|
+
}
|
|
8982
|
+
),
|
|
8885
8983
|
/* @__PURE__ */ jsx(
|
|
8886
8984
|
"h3",
|
|
8887
8985
|
{
|
|
@@ -8890,6 +8988,7 @@ const EmptyState = forwardRef(
|
|
|
8890
8988
|
"text-primary-900 dark:text-primary-100",
|
|
8891
8989
|
"mb-1"
|
|
8892
8990
|
),
|
|
8991
|
+
"data-testid": testId ? `${testId}-title` : void 0,
|
|
8893
8992
|
children: title
|
|
8894
8993
|
}
|
|
8895
8994
|
),
|
|
@@ -8901,10 +9000,11 @@ const EmptyState = forwardRef(
|
|
|
8901
9000
|
"text-primary-500 dark:text-primary-400",
|
|
8902
9001
|
"max-w-sm mb-4"
|
|
8903
9002
|
),
|
|
9003
|
+
"data-testid": testId ? `${testId}-description` : void 0,
|
|
8904
9004
|
children: description
|
|
8905
9005
|
}
|
|
8906
9006
|
),
|
|
8907
|
-
action && /* @__PURE__ */ jsx("div", { className: "mt-2", children: action })
|
|
9007
|
+
action && /* @__PURE__ */ jsx("div", { className: "mt-2", "data-testid": testId ? `${testId}-action` : void 0, children: action })
|
|
8908
9008
|
]
|
|
8909
9009
|
}
|
|
8910
9010
|
);
|
|
@@ -8960,7 +9060,8 @@ function Pagination({
|
|
|
8960
9060
|
totalItems,
|
|
8961
9061
|
disabled = false,
|
|
8962
9062
|
size: size2 = "md",
|
|
8963
|
-
className
|
|
9063
|
+
className,
|
|
9064
|
+
testId
|
|
8964
9065
|
}) {
|
|
8965
9066
|
const pageSizeId = useId$1();
|
|
8966
9067
|
const currentSize = sizeStyles$3[size2];
|
|
@@ -8993,13 +9094,14 @@ function Pagination({
|
|
|
8993
9094
|
};
|
|
8994
9095
|
if (variant === "load-more") {
|
|
8995
9096
|
if (!canGoNext) return null;
|
|
8996
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsx(
|
|
9097
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex justify-center", className), "data-testid": testId, children: /* @__PURE__ */ jsx(
|
|
8997
9098
|
Button,
|
|
8998
9099
|
{
|
|
8999
9100
|
variant: "secondary",
|
|
9000
9101
|
size: size2 === "sm" ? "sm" : "md",
|
|
9001
9102
|
onClick: handleNext,
|
|
9002
9103
|
disabled,
|
|
9104
|
+
"data-testid": testId ? `${testId}-load-more` : void 0,
|
|
9003
9105
|
children: "Load more"
|
|
9004
9106
|
}
|
|
9005
9107
|
) });
|
|
@@ -9010,6 +9112,7 @@ function Pagination({
|
|
|
9010
9112
|
{
|
|
9011
9113
|
"aria-label": "Pagination",
|
|
9012
9114
|
className: cn("flex items-center justify-between gap-4", className),
|
|
9115
|
+
"data-testid": testId,
|
|
9013
9116
|
children: [
|
|
9014
9117
|
/* @__PURE__ */ jsxs(
|
|
9015
9118
|
Button,
|
|
@@ -9019,6 +9122,7 @@ function Pagination({
|
|
|
9019
9122
|
onClick: handlePrevious,
|
|
9020
9123
|
disabled: disabled || !canGoPrevious,
|
|
9021
9124
|
"aria-label": "Previous page",
|
|
9125
|
+
"data-testid": testId ? `${testId}-prev` : void 0,
|
|
9022
9126
|
children: [
|
|
9023
9127
|
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
9024
9128
|
/* @__PURE__ */ jsx("span", { className: "ml-1", children: "Previous" })
|
|
@@ -9039,6 +9143,7 @@ function Pagination({
|
|
|
9039
9143
|
onClick: handleNext,
|
|
9040
9144
|
disabled: disabled || !canGoNext,
|
|
9041
9145
|
"aria-label": "Next page",
|
|
9146
|
+
"data-testid": testId ? `${testId}-next` : void 0,
|
|
9042
9147
|
children: [
|
|
9043
9148
|
/* @__PURE__ */ jsx("span", { className: "mr-1", children: "Next" }),
|
|
9044
9149
|
/* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
@@ -9054,6 +9159,7 @@ function Pagination({
|
|
|
9054
9159
|
{
|
|
9055
9160
|
"aria-label": "Pagination",
|
|
9056
9161
|
className: cn("flex items-center justify-between gap-4", className),
|
|
9162
|
+
"data-testid": testId,
|
|
9057
9163
|
children: [
|
|
9058
9164
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
9059
9165
|
itemsRange && /* @__PURE__ */ jsxs("span", { className: cn("text-primary-600 dark:text-primary-400", currentSize.text), children: [
|
|
@@ -9100,6 +9206,7 @@ function Pagination({
|
|
|
9100
9206
|
onClick: handlePrevious,
|
|
9101
9207
|
disabled: disabled || !canGoPrevious,
|
|
9102
9208
|
"aria-label": "Previous page",
|
|
9209
|
+
"data-testid": testId ? `${testId}-prev` : void 0,
|
|
9103
9210
|
className: cn(
|
|
9104
9211
|
"inline-flex items-center justify-center rounded-md",
|
|
9105
9212
|
"border border-primary-300 dark:border-primary-600",
|
|
@@ -9134,6 +9241,7 @@ function Pagination({
|
|
|
9134
9241
|
disabled,
|
|
9135
9242
|
"aria-label": `Page ${page}`,
|
|
9136
9243
|
"aria-current": page === currentPage ? "page" : void 0,
|
|
9244
|
+
"data-testid": testId ? `${testId}-page-${page}` : void 0,
|
|
9137
9245
|
className: cn(
|
|
9138
9246
|
"inline-flex items-center justify-center rounded-md",
|
|
9139
9247
|
"border transition-colors",
|
|
@@ -9162,6 +9270,7 @@ function Pagination({
|
|
|
9162
9270
|
onClick: handleNext,
|
|
9163
9271
|
disabled: disabled || !canGoNext,
|
|
9164
9272
|
"aria-label": "Next page",
|
|
9273
|
+
"data-testid": testId ? `${testId}-next` : void 0,
|
|
9165
9274
|
className: cn(
|
|
9166
9275
|
"inline-flex items-center justify-center rounded-md",
|
|
9167
9276
|
"border border-primary-300 dark:border-primary-600",
|
|
@@ -9229,7 +9338,8 @@ function MultiSelect({
|
|
|
9229
9338
|
required = false,
|
|
9230
9339
|
disabled = false,
|
|
9231
9340
|
fullWidth = false,
|
|
9232
|
-
className
|
|
9341
|
+
className,
|
|
9342
|
+
testId
|
|
9233
9343
|
}) {
|
|
9234
9344
|
const [query, setQuery] = useState("");
|
|
9235
9345
|
const searchInputRef = useRef(null);
|
|
@@ -9285,12 +9395,13 @@ function MultiSelect({
|
|
|
9285
9395
|
};
|
|
9286
9396
|
const displayedChips = selectedOptions.slice(0, maxDisplayedItems);
|
|
9287
9397
|
const hiddenCount = selectedOptions.length - maxDisplayedItems;
|
|
9288
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), children: [
|
|
9398
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto", className), "data-testid": testId, children: [
|
|
9289
9399
|
label && /* @__PURE__ */ jsxs(
|
|
9290
9400
|
"label",
|
|
9291
9401
|
{
|
|
9292
9402
|
id: labelId,
|
|
9293
9403
|
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
9404
|
+
"data-testid": testId ? `${testId}-label` : void 0,
|
|
9294
9405
|
children: [
|
|
9295
9406
|
label,
|
|
9296
9407
|
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
@@ -9318,7 +9429,7 @@ function MultiSelect({
|
|
|
9318
9429
|
hasError ? "border-error focus-within:border-error focus-within:ring-2 focus-within:ring-error/20" : "border-primary-300 dark:border-primary-600 focus-within:border-gold-500 focus-within:ring-2 focus-within:ring-gold-500/20"
|
|
9319
9430
|
),
|
|
9320
9431
|
children: [
|
|
9321
|
-
displayedChips.map((option) => /* @__PURE__ */ jsxs(
|
|
9432
|
+
displayedChips.map((option, index2) => /* @__PURE__ */ jsxs(
|
|
9322
9433
|
"span",
|
|
9323
9434
|
{
|
|
9324
9435
|
className: cn(
|
|
@@ -9326,6 +9437,7 @@ function MultiSelect({
|
|
|
9326
9437
|
"bg-primary-100 dark:bg-primary-700",
|
|
9327
9438
|
"text-sm text-primary-700 dark:text-primary-200"
|
|
9328
9439
|
),
|
|
9440
|
+
"data-testid": testId ? `${testId}-chip-${index2}` : void 0,
|
|
9329
9441
|
children: [
|
|
9330
9442
|
option.label,
|
|
9331
9443
|
/* @__PURE__ */ jsx(
|
|
@@ -9386,6 +9498,7 @@ function MultiSelect({
|
|
|
9386
9498
|
{
|
|
9387
9499
|
static: true,
|
|
9388
9500
|
className: "absolute z-dropdown mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700",
|
|
9501
|
+
"data-testid": testId ? `${testId}-options` : void 0,
|
|
9389
9502
|
children: isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 px-4 py-2.5 text-primary-500 dark:text-primary-400", children: [
|
|
9390
9503
|
/* @__PURE__ */ jsx(Spinner, { size: "sm", color: "primary" }),
|
|
9391
9504
|
/* @__PURE__ */ jsx("span", { children: loadingText })
|
|
@@ -9401,6 +9514,7 @@ function MultiSelect({
|
|
|
9401
9514
|
value: query,
|
|
9402
9515
|
onChange: handleSearchChange,
|
|
9403
9516
|
placeholder: "Search...",
|
|
9517
|
+
"data-testid": testId ? `${testId}-input` : void 0,
|
|
9404
9518
|
className: cn(
|
|
9405
9519
|
"w-full rounded border border-primary-300 px-2 py-1 text-sm",
|
|
9406
9520
|
"bg-white dark:bg-primary-900",
|
|
@@ -9442,11 +9556,12 @@ function MultiSelect({
|
|
|
9442
9556
|
]
|
|
9443
9557
|
}
|
|
9444
9558
|
),
|
|
9445
|
-
filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2.5 text-primary-500 dark:text-primary-400", children: emptyText }) : filteredOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
9559
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2.5 text-primary-500 dark:text-primary-400", children: emptyText }) : filteredOptions.map((option, index2) => /* @__PURE__ */ jsxs(
|
|
9446
9560
|
It,
|
|
9447
9561
|
{
|
|
9448
9562
|
value: option.value,
|
|
9449
9563
|
disabled: option.disabled,
|
|
9564
|
+
"data-testid": testId ? `${testId}-option-${index2}` : void 0,
|
|
9450
9565
|
className: ({ active }) => cn(
|
|
9451
9566
|
"flex cursor-pointer items-center gap-2 px-4 py-2.5",
|
|
9452
9567
|
active && "bg-primary-50 dark:bg-primary-700",
|
|
@@ -9480,6 +9595,7 @@ function MultiSelect({
|
|
|
9480
9595
|
"p",
|
|
9481
9596
|
{
|
|
9482
9597
|
role: hasError ? "alert" : void 0,
|
|
9598
|
+
"data-testid": testId ? hasError ? `${testId}-error` : `${testId}-helper-text` : void 0,
|
|
9483
9599
|
className: cn(
|
|
9484
9600
|
"mt-1.5 text-sm",
|
|
9485
9601
|
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
@@ -9548,6 +9664,7 @@ function SidebarItem({
|
|
|
9548
9664
|
onNavigate,
|
|
9549
9665
|
LinkComponent,
|
|
9550
9666
|
className,
|
|
9667
|
+
testId,
|
|
9551
9668
|
...props
|
|
9552
9669
|
}) {
|
|
9553
9670
|
if (!shouldShowItem(item)) {
|
|
@@ -9594,6 +9711,7 @@ function SidebarItem({
|
|
|
9594
9711
|
disabled: item.disabled,
|
|
9595
9712
|
"aria-label": item["aria-label"] || item.label,
|
|
9596
9713
|
title: collapsed ? item.label : void 0,
|
|
9714
|
+
"data-testid": testId,
|
|
9597
9715
|
className: cn(
|
|
9598
9716
|
// Base styles
|
|
9599
9717
|
"flex w-full items-center rounded-lg font-medium",
|
|
@@ -9626,6 +9744,7 @@ function SidebarItem({
|
|
|
9626
9744
|
{
|
|
9627
9745
|
to: item.href,
|
|
9628
9746
|
onClick: handleClick,
|
|
9747
|
+
"data-testid": testId,
|
|
9629
9748
|
className: cn(
|
|
9630
9749
|
// Base styles
|
|
9631
9750
|
"flex items-center rounded-lg font-medium",
|
|
@@ -9763,6 +9882,7 @@ const Sidebar = forwardRef(
|
|
|
9763
9882
|
collapsedWidth = "4rem",
|
|
9764
9883
|
className,
|
|
9765
9884
|
"aria-label": ariaLabel = "Main navigation",
|
|
9885
|
+
testId,
|
|
9766
9886
|
...props
|
|
9767
9887
|
}, ref) => {
|
|
9768
9888
|
useEffect(() => {
|
|
@@ -9870,6 +9990,7 @@ const Sidebar = forwardRef(
|
|
|
9870
9990
|
"focus:outline-none focus:ring-2 focus:ring-primary-500/20"
|
|
9871
9991
|
),
|
|
9872
9992
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9993
|
+
"data-testid": testId ? `${testId}-toggle` : void 0,
|
|
9873
9994
|
children: /* @__PURE__ */ jsx(
|
|
9874
9995
|
"svg",
|
|
9875
9996
|
{
|
|
@@ -9901,7 +10022,8 @@ const Sidebar = forwardRef(
|
|
|
9901
10022
|
{
|
|
9902
10023
|
className: "fixed inset-0 z-40 bg-black/20 lg:hidden",
|
|
9903
10024
|
onClick: handleOverlayClick,
|
|
9904
|
-
"aria-hidden": "true"
|
|
10025
|
+
"aria-hidden": "true",
|
|
10026
|
+
"data-testid": testId ? `${testId}-overlay` : void 0
|
|
9905
10027
|
}
|
|
9906
10028
|
),
|
|
9907
10029
|
/* @__PURE__ */ jsx(
|
|
@@ -9922,6 +10044,7 @@ const Sidebar = forwardRef(
|
|
|
9922
10044
|
),
|
|
9923
10045
|
style: { width: sidebarWidth },
|
|
9924
10046
|
"aria-label": ariaLabel,
|
|
10047
|
+
"data-testid": testId,
|
|
9925
10048
|
...props,
|
|
9926
10049
|
children: sidebarContent
|
|
9927
10050
|
}
|
|
@@ -9976,7 +10099,7 @@ const variantStyles = {
|
|
|
9976
10099
|
}
|
|
9977
10100
|
};
|
|
9978
10101
|
const Alert = forwardRef(
|
|
9979
|
-
({ variant = "info", title, message, icon, onClose, className, ...props }, ref) => {
|
|
10102
|
+
({ variant = "info", title, message, icon, onClose, className, testId, ...props }, ref) => {
|
|
9980
10103
|
const styles = variantStyles[variant];
|
|
9981
10104
|
const displayIcon = icon === null ? null : icon ?? defaultIcons[variant];
|
|
9982
10105
|
return /* @__PURE__ */ jsx(
|
|
@@ -9989,9 +10112,18 @@ const Alert = forwardRef(
|
|
|
9989
10112
|
styles.container,
|
|
9990
10113
|
className
|
|
9991
10114
|
),
|
|
10115
|
+
"data-testid": testId,
|
|
9992
10116
|
...props,
|
|
9993
10117
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [
|
|
9994
|
-
displayIcon !== null && /* @__PURE__ */ jsx(
|
|
10118
|
+
displayIcon !== null && /* @__PURE__ */ jsx(
|
|
10119
|
+
"div",
|
|
10120
|
+
{
|
|
10121
|
+
className: cn("flex-shrink-0", styles.icon),
|
|
10122
|
+
"aria-hidden": "true",
|
|
10123
|
+
"data-testid": testId ? `${testId}-icon` : void 0,
|
|
10124
|
+
children: displayIcon
|
|
10125
|
+
}
|
|
10126
|
+
),
|
|
9995
10127
|
/* @__PURE__ */ jsxs("div", { className: cn("flex-1", displayIcon !== null && "ml-3"), children: [
|
|
9996
10128
|
title && /* @__PURE__ */ jsx("h3", { className: cn("text-sm font-medium", styles.title), children: title }),
|
|
9997
10129
|
/* @__PURE__ */ jsx("div", { className: cn("text-sm", title && "mt-1"), children: message })
|
|
@@ -10007,6 +10139,7 @@ const Alert = forwardRef(
|
|
|
10007
10139
|
"focus:ring-current/20",
|
|
10008
10140
|
"dark:focus:ring-offset-primary-900"
|
|
10009
10141
|
),
|
|
10142
|
+
"data-testid": testId ? `${testId}-close-button` : void 0,
|
|
10010
10143
|
children: [
|
|
10011
10144
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Dismiss" }),
|
|
10012
10145
|
/* @__PURE__ */ jsx(XMarkIcon, {})
|
|
@@ -10033,7 +10166,7 @@ const statusStyles = {
|
|
|
10033
10166
|
busy: "bg-error"
|
|
10034
10167
|
};
|
|
10035
10168
|
const Avatar = forwardRef(
|
|
10036
|
-
({ name, src, size: size2 = "md", alt, status, className, ...props }, ref) => {
|
|
10169
|
+
({ name, src, size: size2 = "md", alt, status, className, testId, ...props }, ref) => {
|
|
10037
10170
|
const getInitials = (fullName) => {
|
|
10038
10171
|
const names = fullName.trim().split(" ");
|
|
10039
10172
|
if (names.length === 1) {
|
|
@@ -10059,6 +10192,7 @@ const Avatar = forwardRef(
|
|
|
10059
10192
|
styles.container,
|
|
10060
10193
|
className
|
|
10061
10194
|
),
|
|
10195
|
+
"data-testid": testId,
|
|
10062
10196
|
...props,
|
|
10063
10197
|
children: [
|
|
10064
10198
|
src ? /* @__PURE__ */ jsx(
|
|
@@ -10066,7 +10200,8 @@ const Avatar = forwardRef(
|
|
|
10066
10200
|
{
|
|
10067
10201
|
src,
|
|
10068
10202
|
alt: alt || `${name}'s avatar`,
|
|
10069
|
-
className: "w-full h-full rounded-full object-cover"
|
|
10203
|
+
className: "w-full h-full rounded-full object-cover",
|
|
10204
|
+
"data-testid": testId ? `${testId}-image` : void 0
|
|
10070
10205
|
}
|
|
10071
10206
|
) : /* @__PURE__ */ jsx("span", { className: styles.text, children: initials }),
|
|
10072
10207
|
status && /* @__PURE__ */ jsx(
|
|
@@ -10079,7 +10214,8 @@ const Avatar = forwardRef(
|
|
|
10079
10214
|
styles.status,
|
|
10080
10215
|
statusStyles[status]
|
|
10081
10216
|
),
|
|
10082
|
-
"aria-label": `Status: ${status}
|
|
10217
|
+
"aria-label": `Status: ${status}`,
|
|
10218
|
+
"data-testid": testId ? `${testId}-status` : void 0
|
|
10083
10219
|
}
|
|
10084
10220
|
)
|
|
10085
10221
|
]
|