@teja-app/ui 0.0.4 → 0.0.5
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 +13 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/Alert.types.d.ts +15 -0
- package/dist/components/Alert/Alert.types.d.ts.map +1 -0
- package/dist/components/Alert/index.d.ts +3 -0
- package/dist/components/Alert/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +13 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.types.d.ts +16 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/DateInput/DateInput.d.ts +13 -0
- package/dist/components/DateInput/DateInput.d.ts.map +1 -0
- package/dist/components/DateInput/DateInput.types.d.ts +16 -0
- package/dist/components/DateInput/DateInput.types.d.ts.map +1 -0
- package/dist/components/DateInput/index.d.ts +3 -0
- package/dist/components/DateInput/index.d.ts.map +1 -0
- package/dist/components/OTPInput/OTPInput.d.ts +22 -0
- package/dist/components/OTPInput/OTPInput.d.ts.map +1 -0
- package/dist/components/OTPInput/OTPInput.types.d.ts +19 -0
- package/dist/components/OTPInput/OTPInput.types.d.ts.map +1 -0
- package/dist/components/OTPInput/index.d.ts +3 -0
- package/dist/components/OTPInput/index.d.ts.map +1 -0
- package/dist/components/PillSelector/PillSelector.d.ts +16 -0
- package/dist/components/PillSelector/PillSelector.d.ts.map +1 -0
- package/dist/components/PillSelector/PillSelector.types.d.ts +29 -0
- package/dist/components/PillSelector/PillSelector.types.d.ts.map +1 -0
- package/dist/components/PillSelector/index.d.ts +3 -0
- package/dist/components/PillSelector/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +542 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +542 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import React__default, { forwardRef, useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect, useContext, createContext, Fragment as Fragment$1, isValidElement, cloneElement, createElement, useId as useId$1, useSyncExternalStore, useReducer, createRef } from "react";
|
|
6
6
|
import * as ReactDOM from "react-dom";
|
|
7
7
|
import { flushSync, createPortal } from "react-dom";
|
|
8
|
-
const variantStyles$
|
|
8
|
+
const variantStyles$5 = {
|
|
9
9
|
primary: [
|
|
10
10
|
// Light mode
|
|
11
11
|
"bg-primary-800 text-white border border-gold-500/40",
|
|
@@ -45,7 +45,7 @@ const variantStyles$4 = {
|
|
|
45
45
|
"dark:focus:ring-error/30"
|
|
46
46
|
].join(" ")
|
|
47
47
|
};
|
|
48
|
-
const sizeStyles$
|
|
48
|
+
const sizeStyles$d = {
|
|
49
49
|
sm: "px-3 py-1.5 text-sm h-8",
|
|
50
50
|
md: "px-4 py-2 text-base h-10",
|
|
51
51
|
lg: "px-6 py-3 text-lg h-12"
|
|
@@ -75,9 +75,9 @@ const Button = forwardRef(
|
|
|
75
75
|
"dark:focus:ring-offset-primary-900",
|
|
76
76
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
77
77
|
// Variant styles
|
|
78
|
-
variantStyles$
|
|
78
|
+
variantStyles$5[variant],
|
|
79
79
|
// Size styles
|
|
80
|
-
sizeStyles$
|
|
80
|
+
sizeStyles$d[size2],
|
|
81
81
|
// Width styles
|
|
82
82
|
fullWidth && "w-full",
|
|
83
83
|
// Custom className (allows override)
|
|
@@ -128,7 +128,7 @@ const Button = forwardRef(
|
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
Button.displayName = "Button";
|
|
131
|
-
const sizeStyles$
|
|
131
|
+
const sizeStyles$c = {
|
|
132
132
|
xs: "h-3 w-3",
|
|
133
133
|
// 12px
|
|
134
134
|
sm: "h-4 w-4",
|
|
@@ -158,7 +158,7 @@ const Spinner = forwardRef(
|
|
|
158
158
|
ref,
|
|
159
159
|
className: cn(
|
|
160
160
|
"animate-spin",
|
|
161
|
-
sizeStyles$
|
|
161
|
+
sizeStyles$c[size2],
|
|
162
162
|
colorStyles[color],
|
|
163
163
|
className
|
|
164
164
|
),
|
|
@@ -7379,7 +7379,7 @@ const CloseIcon$2 = () => /* @__PURE__ */ jsx(
|
|
|
7379
7379
|
)
|
|
7380
7380
|
}
|
|
7381
7381
|
);
|
|
7382
|
-
const sizeStyles$
|
|
7382
|
+
const sizeStyles$b = {
|
|
7383
7383
|
sm: "max-w-[400px]",
|
|
7384
7384
|
md: "max-w-[560px]",
|
|
7385
7385
|
lg: "max-w-[720px]"
|
|
@@ -7432,7 +7432,7 @@ function Modal({
|
|
|
7432
7432
|
"bg-white border border-primary-200",
|
|
7433
7433
|
// Dark mode
|
|
7434
7434
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7435
|
-
sizeStyles$
|
|
7435
|
+
sizeStyles$b[size2],
|
|
7436
7436
|
className
|
|
7437
7437
|
),
|
|
7438
7438
|
children: [
|
|
@@ -7510,7 +7510,7 @@ const CloseIcon$1 = () => /* @__PURE__ */ jsx(
|
|
|
7510
7510
|
)
|
|
7511
7511
|
}
|
|
7512
7512
|
);
|
|
7513
|
-
const sizeStyles$
|
|
7513
|
+
const sizeStyles$a = {
|
|
7514
7514
|
sm: "max-w-[400px]",
|
|
7515
7515
|
md: "max-w-[560px]",
|
|
7516
7516
|
lg: "max-w-[720px]"
|
|
@@ -7559,7 +7559,7 @@ function Drawer({
|
|
|
7559
7559
|
"bg-white border-l border-primary-200",
|
|
7560
7560
|
// Dark mode
|
|
7561
7561
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7562
|
-
sizeStyles$
|
|
7562
|
+
sizeStyles$a[size2],
|
|
7563
7563
|
className
|
|
7564
7564
|
),
|
|
7565
7565
|
children: [
|
|
@@ -7675,7 +7675,7 @@ const paddingStyles = {
|
|
|
7675
7675
|
md: "p-6",
|
|
7676
7676
|
lg: "p-8"
|
|
7677
7677
|
};
|
|
7678
|
-
const variantStyles$
|
|
7678
|
+
const variantStyles$4 = {
|
|
7679
7679
|
default: [
|
|
7680
7680
|
"shadow-sm border border-primary-200",
|
|
7681
7681
|
"dark:border-primary-700"
|
|
@@ -7716,7 +7716,7 @@ const Card = forwardRef(
|
|
|
7716
7716
|
// Padding
|
|
7717
7717
|
paddingStyles[padding],
|
|
7718
7718
|
// Variant
|
|
7719
|
-
variantStyles$
|
|
7719
|
+
variantStyles$4[variant],
|
|
7720
7720
|
// Hover effect
|
|
7721
7721
|
hoverable && [
|
|
7722
7722
|
"cursor-pointer",
|
|
@@ -7732,7 +7732,7 @@ const Card = forwardRef(
|
|
|
7732
7732
|
}
|
|
7733
7733
|
);
|
|
7734
7734
|
Card.displayName = "Card";
|
|
7735
|
-
const sizeStyles$
|
|
7735
|
+
const sizeStyles$9 = {
|
|
7736
7736
|
sm: "h-4 w-4",
|
|
7737
7737
|
md: "h-5 w-5",
|
|
7738
7738
|
lg: "h-6 w-6"
|
|
@@ -7802,7 +7802,7 @@ const Checkbox = forwardRef(
|
|
|
7802
7802
|
"aria-describedby": errorId,
|
|
7803
7803
|
onChange: handleChange,
|
|
7804
7804
|
className: cn(
|
|
7805
|
-
sizeStyles$
|
|
7805
|
+
sizeStyles$9[size2],
|
|
7806
7806
|
"rounded border transition-colors",
|
|
7807
7807
|
"focus:ring-2 focus:ring-offset-0",
|
|
7808
7808
|
"disabled:cursor-not-allowed",
|
|
@@ -7856,7 +7856,7 @@ const Checkbox = forwardRef(
|
|
|
7856
7856
|
}
|
|
7857
7857
|
);
|
|
7858
7858
|
Checkbox.displayName = "Checkbox";
|
|
7859
|
-
const sizeStyles$
|
|
7859
|
+
const sizeStyles$8 = {
|
|
7860
7860
|
sm: "h-4 w-4",
|
|
7861
7861
|
md: "h-5 w-5",
|
|
7862
7862
|
lg: "h-6 w-6"
|
|
@@ -7895,7 +7895,7 @@ const Radio = forwardRef(
|
|
|
7895
7895
|
id: radioId,
|
|
7896
7896
|
disabled,
|
|
7897
7897
|
className: cn(
|
|
7898
|
-
sizeStyles$
|
|
7898
|
+
sizeStyles$8[size2],
|
|
7899
7899
|
"border transition-colors",
|
|
7900
7900
|
"focus:ring-2 focus:ring-offset-0",
|
|
7901
7901
|
"disabled:cursor-not-allowed",
|
|
@@ -8002,7 +8002,7 @@ function RadioGroup({
|
|
|
8002
8002
|
] });
|
|
8003
8003
|
}
|
|
8004
8004
|
RadioGroup.displayName = "RadioGroup";
|
|
8005
|
-
const sizeStyles$
|
|
8005
|
+
const sizeStyles$7 = {
|
|
8006
8006
|
sm: {
|
|
8007
8007
|
switch: "h-5 w-9",
|
|
8008
8008
|
dot: "h-3 w-3",
|
|
@@ -8029,7 +8029,7 @@ function Toggle({
|
|
|
8029
8029
|
className,
|
|
8030
8030
|
isLoading = false
|
|
8031
8031
|
}) {
|
|
8032
|
-
const currentSize = sizeStyles$
|
|
8032
|
+
const currentSize = sizeStyles$7[size2];
|
|
8033
8033
|
const isDisabled = disabled || isLoading;
|
|
8034
8034
|
return /* @__PURE__ */ jsx(W, { className, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8035
8035
|
(label || description) && /* @__PURE__ */ jsxs("div", { className: "flex-1 mr-4", children: [
|
|
@@ -8266,7 +8266,7 @@ function Combobox({
|
|
|
8266
8266
|
] });
|
|
8267
8267
|
}
|
|
8268
8268
|
Combobox.displayName = "Combobox";
|
|
8269
|
-
const variantStyles$
|
|
8269
|
+
const variantStyles$3 = {
|
|
8270
8270
|
default: cn(
|
|
8271
8271
|
"bg-primary-100 text-primary-700 border-primary-200",
|
|
8272
8272
|
"dark:bg-primary-800 dark:text-primary-200 dark:border-primary-700"
|
|
@@ -8292,7 +8292,7 @@ const variantStyles$2 = {
|
|
|
8292
8292
|
"dark:bg-gold-900/50 dark:text-gold-300 dark:border-gold-700"
|
|
8293
8293
|
)
|
|
8294
8294
|
};
|
|
8295
|
-
const sizeStyles$
|
|
8295
|
+
const sizeStyles$6 = {
|
|
8296
8296
|
sm: "px-2 py-0.5 text-xs",
|
|
8297
8297
|
md: "px-2.5 py-1 text-sm",
|
|
8298
8298
|
lg: "px-3 py-1.5 text-base"
|
|
@@ -8305,8 +8305,8 @@ const Badge = forwardRef(
|
|
|
8305
8305
|
ref,
|
|
8306
8306
|
className: cn(
|
|
8307
8307
|
"inline-flex items-center justify-center font-medium rounded-full border",
|
|
8308
|
-
variantStyles$
|
|
8309
|
-
sizeStyles$
|
|
8308
|
+
variantStyles$3[variant],
|
|
8309
|
+
sizeStyles$6[size2],
|
|
8310
8310
|
className
|
|
8311
8311
|
),
|
|
8312
8312
|
...props,
|
|
@@ -8464,7 +8464,7 @@ const TableCell = forwardRef(
|
|
|
8464
8464
|
}
|
|
8465
8465
|
);
|
|
8466
8466
|
TableCell.displayName = "TableCell";
|
|
8467
|
-
const sizeStyles$
|
|
8467
|
+
const sizeStyles$5 = {
|
|
8468
8468
|
sm: "px-3 py-1.5 text-sm",
|
|
8469
8469
|
md: "px-4 py-2 text-sm",
|
|
8470
8470
|
lg: "px-5 py-2.5 text-base"
|
|
@@ -8513,7 +8513,7 @@ function Tabs({
|
|
|
8513
8513
|
className: ({ selected }) => cn(
|
|
8514
8514
|
"relative outline-none transition-colors duration-normal",
|
|
8515
8515
|
"focus-visible:ring-2 focus-visible:ring-gold-500/50",
|
|
8516
|
-
sizeStyles$
|
|
8516
|
+
sizeStyles$5[size2],
|
|
8517
8517
|
fullWidth && "flex-1",
|
|
8518
8518
|
// Default variant styles
|
|
8519
8519
|
variant === "default" && [
|
|
@@ -8697,7 +8697,7 @@ const Breadcrumbs = forwardRef(
|
|
|
8697
8697
|
}
|
|
8698
8698
|
);
|
|
8699
8699
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
8700
|
-
const variantStyles$
|
|
8700
|
+
const variantStyles$2 = {
|
|
8701
8701
|
text: "rounded",
|
|
8702
8702
|
circular: "rounded-full",
|
|
8703
8703
|
rectangular: "rounded-md"
|
|
@@ -8733,7 +8733,7 @@ const Skeleton = forwardRef(
|
|
|
8733
8733
|
{
|
|
8734
8734
|
className: cn(
|
|
8735
8735
|
"bg-primary-200 dark:bg-primary-700",
|
|
8736
|
-
variantStyles$
|
|
8736
|
+
variantStyles$2[variant],
|
|
8737
8737
|
animate && "animate-pulse"
|
|
8738
8738
|
),
|
|
8739
8739
|
style: {
|
|
@@ -8755,7 +8755,7 @@ const Skeleton = forwardRef(
|
|
|
8755
8755
|
ref,
|
|
8756
8756
|
className: cn(
|
|
8757
8757
|
"bg-primary-200 dark:bg-primary-700",
|
|
8758
|
-
variantStyles$
|
|
8758
|
+
variantStyles$2[variant],
|
|
8759
8759
|
animate && "animate-pulse",
|
|
8760
8760
|
className
|
|
8761
8761
|
),
|
|
@@ -8774,7 +8774,7 @@ const Skeleton = forwardRef(
|
|
|
8774
8774
|
}
|
|
8775
8775
|
);
|
|
8776
8776
|
Skeleton.displayName = "Skeleton";
|
|
8777
|
-
const defaultIcons = {
|
|
8777
|
+
const defaultIcons$1 = {
|
|
8778
8778
|
"no-data": /* @__PURE__ */ jsx(
|
|
8779
8779
|
"svg",
|
|
8780
8780
|
{
|
|
@@ -8833,7 +8833,7 @@ const defaultIcons = {
|
|
|
8833
8833
|
}
|
|
8834
8834
|
)
|
|
8835
8835
|
};
|
|
8836
|
-
const sizeStyles$
|
|
8836
|
+
const sizeStyles$4 = {
|
|
8837
8837
|
sm: {
|
|
8838
8838
|
container: "py-6 px-4",
|
|
8839
8839
|
icon: "w-10 h-10",
|
|
@@ -8869,7 +8869,7 @@ const EmptyState = forwardRef(
|
|
|
8869
8869
|
className,
|
|
8870
8870
|
...props
|
|
8871
8871
|
}, ref) => {
|
|
8872
|
-
const styles = sizeStyles$
|
|
8872
|
+
const styles = sizeStyles$4[size2];
|
|
8873
8873
|
return /* @__PURE__ */ jsxs(
|
|
8874
8874
|
"div",
|
|
8875
8875
|
{
|
|
@@ -8881,7 +8881,7 @@ const EmptyState = forwardRef(
|
|
|
8881
8881
|
),
|
|
8882
8882
|
...props,
|
|
8883
8883
|
children: [
|
|
8884
|
-
/* @__PURE__ */ jsx("div", { className: cn(styles.icon, typeColors[type], "mb-4"), children: icon || defaultIcons[type] }),
|
|
8884
|
+
/* @__PURE__ */ jsx("div", { className: cn(styles.icon, typeColors[type], "mb-4"), children: icon || defaultIcons$1[type] }),
|
|
8885
8885
|
/* @__PURE__ */ jsx(
|
|
8886
8886
|
"h3",
|
|
8887
8887
|
{
|
|
@@ -8913,7 +8913,7 @@ const EmptyState = forwardRef(
|
|
|
8913
8913
|
EmptyState.displayName = "EmptyState";
|
|
8914
8914
|
const ChevronLeftIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) });
|
|
8915
8915
|
const ChevronRightIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) });
|
|
8916
|
-
const sizeStyles$
|
|
8916
|
+
const sizeStyles$3 = {
|
|
8917
8917
|
sm: { button: "h-8 min-w-8 px-2 text-sm", text: "text-sm" },
|
|
8918
8918
|
md: { button: "h-10 min-w-10 px-3 text-sm", text: "text-sm" }
|
|
8919
8919
|
};
|
|
@@ -8963,7 +8963,7 @@ function Pagination({
|
|
|
8963
8963
|
className
|
|
8964
8964
|
}) {
|
|
8965
8965
|
const pageSizeId = useId$1();
|
|
8966
|
-
const currentSize = sizeStyles$
|
|
8966
|
+
const currentSize = sizeStyles$3[size2];
|
|
8967
8967
|
const canGoPrevious = currentPage > 1;
|
|
8968
8968
|
const canGoNext = currentPage < totalPages;
|
|
8969
8969
|
const pageNumbers = useMemo(
|
|
@@ -9510,7 +9510,7 @@ function isItemActive(currentPath, href, matcher = "exact") {
|
|
|
9510
9510
|
return false;
|
|
9511
9511
|
}
|
|
9512
9512
|
}
|
|
9513
|
-
const sizeStyles = {
|
|
9513
|
+
const sizeStyles$2 = {
|
|
9514
9514
|
sm: "px-2 py-1.5 text-xs gap-2",
|
|
9515
9515
|
md: "px-3 py-2.5 text-sm gap-3",
|
|
9516
9516
|
lg: "px-4 py-3 text-base gap-3"
|
|
@@ -9601,7 +9601,7 @@ function SidebarItem({
|
|
|
9601
9601
|
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9602
9602
|
"dark:focus:ring-offset-primary-900",
|
|
9603
9603
|
// Size styles
|
|
9604
|
-
sizeStyles[size2],
|
|
9604
|
+
sizeStyles$2[size2],
|
|
9605
9605
|
// State styles
|
|
9606
9606
|
item.disabled && "opacity-50 cursor-not-allowed",
|
|
9607
9607
|
!item.disabled && !isActive && [
|
|
@@ -9633,7 +9633,7 @@ function SidebarItem({
|
|
|
9633
9633
|
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9634
9634
|
"dark:focus:ring-offset-primary-900",
|
|
9635
9635
|
// Size styles
|
|
9636
|
-
sizeStyles[size2],
|
|
9636
|
+
sizeStyles$2[size2],
|
|
9637
9637
|
// State styles
|
|
9638
9638
|
item.disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
9639
9639
|
!item.disabled && !isActive && [
|
|
@@ -9734,7 +9734,7 @@ const SidebarDivider = forwardRef(
|
|
|
9734
9734
|
}
|
|
9735
9735
|
);
|
|
9736
9736
|
SidebarDivider.displayName = "SidebarDivider";
|
|
9737
|
-
const variantStyles = {
|
|
9737
|
+
const variantStyles$1 = {
|
|
9738
9738
|
default: [
|
|
9739
9739
|
"bg-white border-r border-gold-500/40",
|
|
9740
9740
|
"dark:bg-primary-900 dark:border-gold-500/20"
|
|
@@ -9917,7 +9917,7 @@ const Sidebar = forwardRef(
|
|
|
9917
9917
|
// Mobile styles
|
|
9918
9918
|
isOpen ? "translate-x-0" : "-translate-x-full",
|
|
9919
9919
|
// Variant styles
|
|
9920
|
-
variantStyles[variant],
|
|
9920
|
+
variantStyles$1[variant],
|
|
9921
9921
|
className
|
|
9922
9922
|
),
|
|
9923
9923
|
style: { width: sidebarWidth },
|
|
@@ -9930,7 +9930,508 @@ const Sidebar = forwardRef(
|
|
|
9930
9930
|
}
|
|
9931
9931
|
);
|
|
9932
9932
|
Sidebar.displayName = "Sidebar";
|
|
9933
|
+
const CheckCircleIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
9934
|
+
const XCircleIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
9935
|
+
const ExclamationCircleIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) });
|
|
9936
|
+
const InformationCircleIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) });
|
|
9937
|
+
const XMarkIcon = () => /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
9938
|
+
const defaultIcons = {
|
|
9939
|
+
success: /* @__PURE__ */ jsx(CheckCircleIcon, {}),
|
|
9940
|
+
error: /* @__PURE__ */ jsx(XCircleIcon, {}),
|
|
9941
|
+
warning: /* @__PURE__ */ jsx(ExclamationCircleIcon, {}),
|
|
9942
|
+
info: /* @__PURE__ */ jsx(InformationCircleIcon, {})
|
|
9943
|
+
};
|
|
9944
|
+
const variantStyles = {
|
|
9945
|
+
success: {
|
|
9946
|
+
container: cn(
|
|
9947
|
+
"bg-success-light border-success/20 text-[#166534]",
|
|
9948
|
+
"dark:bg-success/10 dark:border-success/30 dark:text-[#86efac]"
|
|
9949
|
+
),
|
|
9950
|
+
icon: "text-success dark:text-[#4ade80]",
|
|
9951
|
+
title: "text-[#14532d] dark:text-[#bbf7d0]"
|
|
9952
|
+
},
|
|
9953
|
+
error: {
|
|
9954
|
+
container: cn(
|
|
9955
|
+
"bg-error-light border-error/20 text-[#991b1b]",
|
|
9956
|
+
"dark:bg-error/10 dark:border-error/30 dark:text-[#fca5a5]"
|
|
9957
|
+
),
|
|
9958
|
+
icon: "text-error dark:text-[#f87171]",
|
|
9959
|
+
title: "text-[#7f1d1d] dark:text-[#fecaca]"
|
|
9960
|
+
},
|
|
9961
|
+
warning: {
|
|
9962
|
+
container: cn(
|
|
9963
|
+
"bg-warning-light border-warning/20 text-[#854d0e]",
|
|
9964
|
+
"dark:bg-warning/10 dark:border-warning/30 dark:text-[#fde047]"
|
|
9965
|
+
),
|
|
9966
|
+
icon: "text-warning dark:text-[#facc15]",
|
|
9967
|
+
title: "text-[#713f12] dark:text-[#fef08a]"
|
|
9968
|
+
},
|
|
9969
|
+
info: {
|
|
9970
|
+
container: cn(
|
|
9971
|
+
"bg-info-light border-info/20 text-[#1e40af]",
|
|
9972
|
+
"dark:bg-info/10 dark:border-info/30 dark:text-[#93c5fd]"
|
|
9973
|
+
),
|
|
9974
|
+
icon: "text-info dark:text-[#60a5fa]",
|
|
9975
|
+
title: "text-[#1e3a8a] dark:text-[#bfdbfe]"
|
|
9976
|
+
}
|
|
9977
|
+
};
|
|
9978
|
+
const Alert = forwardRef(
|
|
9979
|
+
({ variant = "info", title, message, icon, onClose, className, ...props }, ref) => {
|
|
9980
|
+
const styles = variantStyles[variant];
|
|
9981
|
+
const displayIcon = icon === null ? null : icon ?? defaultIcons[variant];
|
|
9982
|
+
return /* @__PURE__ */ jsx(
|
|
9983
|
+
"div",
|
|
9984
|
+
{
|
|
9985
|
+
ref,
|
|
9986
|
+
role: "alert",
|
|
9987
|
+
className: cn(
|
|
9988
|
+
"rounded-lg border p-4",
|
|
9989
|
+
styles.container,
|
|
9990
|
+
className
|
|
9991
|
+
),
|
|
9992
|
+
...props,
|
|
9993
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [
|
|
9994
|
+
displayIcon !== null && /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0", styles.icon), "aria-hidden": "true", children: displayIcon }),
|
|
9995
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex-1", displayIcon !== null && "ml-3"), children: [
|
|
9996
|
+
title && /* @__PURE__ */ jsx("h3", { className: cn("text-sm font-medium", styles.title), children: title }),
|
|
9997
|
+
/* @__PURE__ */ jsx("div", { className: cn("text-sm", title && "mt-1"), children: message })
|
|
9998
|
+
] }),
|
|
9999
|
+
onClose && /* @__PURE__ */ jsx("div", { className: "ml-3 flex-shrink-0", children: /* @__PURE__ */ jsxs(
|
|
10000
|
+
"button",
|
|
10001
|
+
{
|
|
10002
|
+
type: "button",
|
|
10003
|
+
onClick: onClose,
|
|
10004
|
+
className: cn(
|
|
10005
|
+
"inline-flex rounded-md p-1.5",
|
|
10006
|
+
"hover:opacity-75 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
10007
|
+
"focus:ring-current/20",
|
|
10008
|
+
"dark:focus:ring-offset-primary-900"
|
|
10009
|
+
),
|
|
10010
|
+
children: [
|
|
10011
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Dismiss" }),
|
|
10012
|
+
/* @__PURE__ */ jsx(XMarkIcon, {})
|
|
10013
|
+
]
|
|
10014
|
+
}
|
|
10015
|
+
) })
|
|
10016
|
+
] })
|
|
10017
|
+
}
|
|
10018
|
+
);
|
|
10019
|
+
}
|
|
10020
|
+
);
|
|
10021
|
+
Alert.displayName = "Alert";
|
|
10022
|
+
const sizeStyles$1 = {
|
|
10023
|
+
xs: { container: "w-6 h-6", text: "text-xs", status: "w-2 h-2 border" },
|
|
10024
|
+
sm: { container: "w-8 h-8", text: "text-sm", status: "w-2.5 h-2.5 border" },
|
|
10025
|
+
md: { container: "w-10 h-10", text: "text-base", status: "w-3 h-3 border-2" },
|
|
10026
|
+
lg: { container: "w-12 h-12", text: "text-lg", status: "w-3.5 h-3.5 border-2" },
|
|
10027
|
+
xl: { container: "w-16 h-16", text: "text-2xl", status: "w-4 h-4 border-2" }
|
|
10028
|
+
};
|
|
10029
|
+
const statusStyles = {
|
|
10030
|
+
online: "bg-success",
|
|
10031
|
+
offline: "bg-primary-400 dark:bg-primary-500",
|
|
10032
|
+
away: "bg-warning",
|
|
10033
|
+
busy: "bg-error"
|
|
10034
|
+
};
|
|
10035
|
+
const Avatar = forwardRef(
|
|
10036
|
+
({ name, src, size: size2 = "md", alt, status, className, ...props }, ref) => {
|
|
10037
|
+
const getInitials = (fullName) => {
|
|
10038
|
+
const names = fullName.trim().split(" ");
|
|
10039
|
+
if (names.length === 1) {
|
|
10040
|
+
return names[0]?.charAt(0).toUpperCase() || "";
|
|
10041
|
+
}
|
|
10042
|
+
const firstName = names[0];
|
|
10043
|
+
const lastName = names[names.length - 1];
|
|
10044
|
+
return ((firstName?.charAt(0) || "") + (lastName?.charAt(0) || "")).toUpperCase();
|
|
10045
|
+
};
|
|
10046
|
+
const initials = getInitials(name);
|
|
10047
|
+
const styles = sizeStyles$1[size2];
|
|
10048
|
+
return /* @__PURE__ */ jsxs(
|
|
10049
|
+
"div",
|
|
10050
|
+
{
|
|
10051
|
+
ref,
|
|
10052
|
+
className: cn(
|
|
10053
|
+
"relative inline-flex items-center justify-center",
|
|
10054
|
+
"rounded-full font-medium",
|
|
10055
|
+
// Light mode
|
|
10056
|
+
"bg-gold-500 text-white",
|
|
10057
|
+
// Dark mode
|
|
10058
|
+
"dark:bg-gold-600 dark:text-white",
|
|
10059
|
+
styles.container,
|
|
10060
|
+
className
|
|
10061
|
+
),
|
|
10062
|
+
...props,
|
|
10063
|
+
children: [
|
|
10064
|
+
src ? /* @__PURE__ */ jsx(
|
|
10065
|
+
"img",
|
|
10066
|
+
{
|
|
10067
|
+
src,
|
|
10068
|
+
alt: alt || `${name}'s avatar`,
|
|
10069
|
+
className: "w-full h-full rounded-full object-cover"
|
|
10070
|
+
}
|
|
10071
|
+
) : /* @__PURE__ */ jsx("span", { className: styles.text, children: initials }),
|
|
10072
|
+
status && /* @__PURE__ */ jsx(
|
|
10073
|
+
"span",
|
|
10074
|
+
{
|
|
10075
|
+
role: "status",
|
|
10076
|
+
className: cn(
|
|
10077
|
+
"absolute bottom-0 right-0 rounded-full",
|
|
10078
|
+
"border-white dark:border-primary-900",
|
|
10079
|
+
styles.status,
|
|
10080
|
+
statusStyles[status]
|
|
10081
|
+
),
|
|
10082
|
+
"aria-label": `Status: ${status}`
|
|
10083
|
+
}
|
|
10084
|
+
)
|
|
10085
|
+
]
|
|
10086
|
+
}
|
|
10087
|
+
);
|
|
10088
|
+
}
|
|
10089
|
+
);
|
|
10090
|
+
Avatar.displayName = "Avatar";
|
|
10091
|
+
const OTPInput = ({
|
|
10092
|
+
length = 6,
|
|
10093
|
+
value,
|
|
10094
|
+
onChange,
|
|
10095
|
+
error: error2,
|
|
10096
|
+
disabled = false,
|
|
10097
|
+
autoFocus = false,
|
|
10098
|
+
label = "One-time password",
|
|
10099
|
+
className
|
|
10100
|
+
}) => {
|
|
10101
|
+
const inputRefs = useRef([]);
|
|
10102
|
+
const digits = value.split("").slice(0, length);
|
|
10103
|
+
while (digits.length < length) {
|
|
10104
|
+
digits.push("");
|
|
10105
|
+
}
|
|
10106
|
+
const focusInput = useCallback((index2) => {
|
|
10107
|
+
const input = inputRefs.current[index2];
|
|
10108
|
+
if (input) {
|
|
10109
|
+
input.focus();
|
|
10110
|
+
input.select();
|
|
10111
|
+
}
|
|
10112
|
+
}, []);
|
|
10113
|
+
const handleChange = useCallback(
|
|
10114
|
+
(index2, event_) => {
|
|
10115
|
+
const newValue = event_.target.value;
|
|
10116
|
+
if (!/^\d*$/.test(newValue)) return;
|
|
10117
|
+
const digit = newValue.slice(-1);
|
|
10118
|
+
const newDigits = [...digits];
|
|
10119
|
+
newDigits[index2] = digit;
|
|
10120
|
+
const newOtp = newDigits.join("");
|
|
10121
|
+
onChange(newOtp);
|
|
10122
|
+
if (digit && index2 < length - 1) {
|
|
10123
|
+
focusInput(index2 + 1);
|
|
10124
|
+
}
|
|
10125
|
+
},
|
|
10126
|
+
[digits, length, onChange, focusInput]
|
|
10127
|
+
);
|
|
10128
|
+
const handleKeyDown = useCallback(
|
|
10129
|
+
(index2, event_) => {
|
|
10130
|
+
switch (event_.key) {
|
|
10131
|
+
case "Backspace":
|
|
10132
|
+
if (!digits[index2] && index2 > 0) {
|
|
10133
|
+
event_.preventDefault();
|
|
10134
|
+
const newDigits = [...digits];
|
|
10135
|
+
newDigits[index2 - 1] = "";
|
|
10136
|
+
onChange(newDigits.join(""));
|
|
10137
|
+
focusInput(index2 - 1);
|
|
10138
|
+
} else if (digits[index2]) {
|
|
10139
|
+
const newDigits = [...digits];
|
|
10140
|
+
newDigits[index2] = "";
|
|
10141
|
+
onChange(newDigits.join(""));
|
|
10142
|
+
}
|
|
10143
|
+
break;
|
|
10144
|
+
case "ArrowLeft":
|
|
10145
|
+
event_.preventDefault();
|
|
10146
|
+
if (index2 > 0) {
|
|
10147
|
+
focusInput(index2 - 1);
|
|
10148
|
+
}
|
|
10149
|
+
break;
|
|
10150
|
+
case "ArrowRight":
|
|
10151
|
+
event_.preventDefault();
|
|
10152
|
+
if (index2 < length - 1) {
|
|
10153
|
+
focusInput(index2 + 1);
|
|
10154
|
+
}
|
|
10155
|
+
break;
|
|
10156
|
+
case "Delete": {
|
|
10157
|
+
event_.preventDefault();
|
|
10158
|
+
const newDigits = [...digits];
|
|
10159
|
+
newDigits[index2] = "";
|
|
10160
|
+
onChange(newDigits.join(""));
|
|
10161
|
+
break;
|
|
10162
|
+
}
|
|
10163
|
+
}
|
|
10164
|
+
},
|
|
10165
|
+
[digits, length, onChange, focusInput]
|
|
10166
|
+
);
|
|
10167
|
+
const handlePaste = useCallback(
|
|
10168
|
+
(event_) => {
|
|
10169
|
+
event_.preventDefault();
|
|
10170
|
+
const pastedData = event_.clipboardData.getData("text");
|
|
10171
|
+
const pastedDigits = pastedData.replace(/\D/g, "").slice(0, length);
|
|
10172
|
+
if (pastedDigits) {
|
|
10173
|
+
onChange(pastedDigits);
|
|
10174
|
+
const focusIndex = Math.min(pastedDigits.length, length - 1);
|
|
10175
|
+
focusInput(focusIndex);
|
|
10176
|
+
}
|
|
10177
|
+
},
|
|
10178
|
+
[length, onChange, focusInput]
|
|
10179
|
+
);
|
|
10180
|
+
const errorId = error2 ? "otp-input-error" : void 0;
|
|
10181
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), "data-testid": "otp-input", children: [
|
|
10182
|
+
/* @__PURE__ */ jsx(
|
|
10183
|
+
"div",
|
|
10184
|
+
{
|
|
10185
|
+
role: "group",
|
|
10186
|
+
"aria-label": label,
|
|
10187
|
+
"aria-describedby": errorId,
|
|
10188
|
+
className: "flex justify-center gap-2 sm:gap-3",
|
|
10189
|
+
children: digits.map((digit, index2) => /* @__PURE__ */ jsx(
|
|
10190
|
+
"input",
|
|
10191
|
+
{
|
|
10192
|
+
ref: (element) => {
|
|
10193
|
+
inputRefs.current[index2] = element;
|
|
10194
|
+
},
|
|
10195
|
+
type: "text",
|
|
10196
|
+
inputMode: "numeric",
|
|
10197
|
+
pattern: "\\d*",
|
|
10198
|
+
maxLength: 1,
|
|
10199
|
+
value: digit,
|
|
10200
|
+
disabled,
|
|
10201
|
+
autoFocus: autoFocus && index2 === 0,
|
|
10202
|
+
"aria-label": `Digit ${index2 + 1} of ${length}`,
|
|
10203
|
+
"aria-invalid": !!error2,
|
|
10204
|
+
"data-testid": `otp-input-digit-${index2}`,
|
|
10205
|
+
className: cn(
|
|
10206
|
+
"w-10 h-12 sm:w-12 sm:h-14",
|
|
10207
|
+
"text-center text-xl sm:text-2xl font-semibold",
|
|
10208
|
+
"border-2 rounded-lg",
|
|
10209
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",
|
|
10210
|
+
"transition-colors duration-200",
|
|
10211
|
+
// Light mode
|
|
10212
|
+
error2 ? "border-error bg-error-light" : "border-primary-300 bg-white",
|
|
10213
|
+
// Dark mode
|
|
10214
|
+
error2 ? "dark:border-error dark:bg-error/10" : "dark:border-primary-600 dark:bg-primary-900 dark:text-white",
|
|
10215
|
+
"dark:focus:ring-primary-400 dark:focus:border-primary-400",
|
|
10216
|
+
disabled && "bg-primary-100 cursor-not-allowed opacity-50 dark:bg-primary-800"
|
|
10217
|
+
),
|
|
10218
|
+
onChange: (event_) => handleChange(index2, event_),
|
|
10219
|
+
onKeyDown: (event_) => handleKeyDown(index2, event_),
|
|
10220
|
+
onPaste: handlePaste,
|
|
10221
|
+
onFocus: (event_) => event_.target.select()
|
|
10222
|
+
},
|
|
10223
|
+
index2
|
|
10224
|
+
))
|
|
10225
|
+
}
|
|
10226
|
+
),
|
|
10227
|
+
error2 && /* @__PURE__ */ jsx(
|
|
10228
|
+
"p",
|
|
10229
|
+
{
|
|
10230
|
+
id: errorId,
|
|
10231
|
+
role: "alert",
|
|
10232
|
+
"aria-live": "assertive",
|
|
10233
|
+
"data-testid": "otp-input-error",
|
|
10234
|
+
className: cn(
|
|
10235
|
+
"mt-2 text-sm text-center",
|
|
10236
|
+
"text-error dark:text-[#fca5a5]"
|
|
10237
|
+
),
|
|
10238
|
+
children: error2
|
|
10239
|
+
}
|
|
10240
|
+
)
|
|
10241
|
+
] });
|
|
10242
|
+
};
|
|
10243
|
+
const DateInput = forwardRef(
|
|
10244
|
+
({
|
|
10245
|
+
value,
|
|
10246
|
+
onChange,
|
|
10247
|
+
label,
|
|
10248
|
+
error: error2,
|
|
10249
|
+
helperText,
|
|
10250
|
+
fullWidth = false,
|
|
10251
|
+
disabled = false,
|
|
10252
|
+
className,
|
|
10253
|
+
id,
|
|
10254
|
+
required,
|
|
10255
|
+
min: min2,
|
|
10256
|
+
max: max2,
|
|
10257
|
+
...props
|
|
10258
|
+
}, ref) => {
|
|
10259
|
+
const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
10260
|
+
const hasError = !!error2;
|
|
10261
|
+
const errorId = hasError ? `${inputId}-error` : void 0;
|
|
10262
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(fullWidth ? "w-full" : "w-auto"), children: [
|
|
10263
|
+
label && /* @__PURE__ */ jsxs(
|
|
10264
|
+
"label",
|
|
10265
|
+
{
|
|
10266
|
+
htmlFor: inputId,
|
|
10267
|
+
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
10268
|
+
children: [
|
|
10269
|
+
label,
|
|
10270
|
+
required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
10271
|
+
]
|
|
10272
|
+
}
|
|
10273
|
+
),
|
|
10274
|
+
/* @__PURE__ */ jsx(
|
|
10275
|
+
"input",
|
|
10276
|
+
{
|
|
10277
|
+
ref,
|
|
10278
|
+
type: "date",
|
|
10279
|
+
id: inputId,
|
|
10280
|
+
"data-testid": "date-input",
|
|
10281
|
+
value: value || "",
|
|
10282
|
+
onChange: (event_) => onChange(event_.target.value || null),
|
|
10283
|
+
disabled,
|
|
10284
|
+
required,
|
|
10285
|
+
min: min2,
|
|
10286
|
+
max: max2,
|
|
10287
|
+
"aria-label": label ? void 0 : "Select date",
|
|
10288
|
+
"aria-invalid": hasError ? "true" : void 0,
|
|
10289
|
+
"aria-describedby": errorId,
|
|
10290
|
+
className: cn(
|
|
10291
|
+
// Base styles - Light mode
|
|
10292
|
+
"block w-full rounded-md border bg-white px-4 py-2.5 text-sm text-primary-900",
|
|
10293
|
+
"transition-colors duration-normal",
|
|
10294
|
+
"focus:outline-none focus:ring-2",
|
|
10295
|
+
"disabled:cursor-not-allowed disabled:bg-primary-50 disabled:text-primary-500",
|
|
10296
|
+
// Base styles - Dark mode
|
|
10297
|
+
"dark:bg-primary-800 dark:text-primary-100",
|
|
10298
|
+
"dark:disabled:bg-primary-900 dark:disabled:text-primary-600",
|
|
10299
|
+
// Border and focus styles
|
|
10300
|
+
hasError ? "border-error focus:border-error focus:ring-error/20 dark:border-error/70 dark:focus:ring-error/30" : "border-primary-300 focus:border-gold-500 focus:ring-gold-500/20 dark:border-primary-600 dark:focus:border-gold-400 dark:focus:ring-gold-400/30",
|
|
10301
|
+
// Custom className
|
|
10302
|
+
className
|
|
10303
|
+
),
|
|
10304
|
+
...props
|
|
10305
|
+
}
|
|
10306
|
+
),
|
|
10307
|
+
(error2 || helperText) && /* @__PURE__ */ jsx(
|
|
10308
|
+
"p",
|
|
10309
|
+
{
|
|
10310
|
+
id: errorId,
|
|
10311
|
+
role: hasError ? "alert" : void 0,
|
|
10312
|
+
className: cn(
|
|
10313
|
+
"mt-1.5 text-sm",
|
|
10314
|
+
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
10315
|
+
),
|
|
10316
|
+
children: error2 || helperText
|
|
10317
|
+
}
|
|
10318
|
+
)
|
|
10319
|
+
] });
|
|
10320
|
+
}
|
|
10321
|
+
);
|
|
10322
|
+
DateInput.displayName = "DateInput";
|
|
10323
|
+
const sizeStyles = {
|
|
10324
|
+
sm: "px-2.5 py-1 text-xs gap-1",
|
|
10325
|
+
md: "px-3 py-1.5 text-sm gap-1.5",
|
|
10326
|
+
lg: "px-4 py-2 text-base gap-2"
|
|
10327
|
+
};
|
|
10328
|
+
const checkmarkSize = {
|
|
10329
|
+
sm: "w-3 h-3",
|
|
10330
|
+
md: "w-4 h-4",
|
|
10331
|
+
lg: "w-5 h-5"
|
|
10332
|
+
};
|
|
10333
|
+
const PillSelector = forwardRef(
|
|
10334
|
+
({
|
|
10335
|
+
options,
|
|
10336
|
+
selected,
|
|
10337
|
+
onChange,
|
|
10338
|
+
multiple = true,
|
|
10339
|
+
size: size2 = "md",
|
|
10340
|
+
label,
|
|
10341
|
+
fullWidth = false,
|
|
10342
|
+
disabled = false,
|
|
10343
|
+
className,
|
|
10344
|
+
...props
|
|
10345
|
+
}, ref) => {
|
|
10346
|
+
const handleClick = (value) => {
|
|
10347
|
+
if (disabled) return;
|
|
10348
|
+
if (multiple) {
|
|
10349
|
+
if (selected.includes(value)) {
|
|
10350
|
+
onChange(selected.filter((v2) => v2 !== value));
|
|
10351
|
+
} else {
|
|
10352
|
+
onChange([...selected, value]);
|
|
10353
|
+
}
|
|
10354
|
+
} else {
|
|
10355
|
+
onChange([value]);
|
|
10356
|
+
}
|
|
10357
|
+
};
|
|
10358
|
+
return /* @__PURE__ */ jsxs(
|
|
10359
|
+
"div",
|
|
10360
|
+
{
|
|
10361
|
+
ref,
|
|
10362
|
+
className: cn(fullWidth ? "w-full" : "w-auto", className),
|
|
10363
|
+
...props,
|
|
10364
|
+
children: [
|
|
10365
|
+
label && /* @__PURE__ */ jsx("label", { className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white", children: label }),
|
|
10366
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", role: "group", "aria-label": label, children: options.map((option) => {
|
|
10367
|
+
const isSelected = selected.includes(option.value);
|
|
10368
|
+
return /* @__PURE__ */ jsxs(
|
|
10369
|
+
"button",
|
|
10370
|
+
{
|
|
10371
|
+
type: "button",
|
|
10372
|
+
disabled,
|
|
10373
|
+
"aria-pressed": isSelected,
|
|
10374
|
+
onClick: () => handleClick(option.value),
|
|
10375
|
+
className: cn(
|
|
10376
|
+
"inline-flex items-center justify-center rounded-full border font-medium",
|
|
10377
|
+
"transition-colors duration-normal",
|
|
10378
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-1",
|
|
10379
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
10380
|
+
sizeStyles[size2],
|
|
10381
|
+
isSelected ? cn(
|
|
10382
|
+
// Light mode - selected
|
|
10383
|
+
"border-primary-700 bg-primary-700 text-white",
|
|
10384
|
+
"hover:bg-primary-800 hover:border-primary-800",
|
|
10385
|
+
"focus:ring-primary-500/30",
|
|
10386
|
+
// Dark mode - selected
|
|
10387
|
+
"dark:border-gold-500 dark:bg-gold-500 dark:text-primary-900",
|
|
10388
|
+
"dark:hover:bg-gold-400 dark:hover:border-gold-400",
|
|
10389
|
+
"dark:focus:ring-gold-400/30"
|
|
10390
|
+
) : cn(
|
|
10391
|
+
// Light mode - unselected
|
|
10392
|
+
"border-primary-300 bg-white text-primary-700",
|
|
10393
|
+
"hover:border-primary-400 hover:bg-primary-50",
|
|
10394
|
+
"focus:ring-primary-500/20",
|
|
10395
|
+
// Dark mode - unselected
|
|
10396
|
+
"dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200",
|
|
10397
|
+
"dark:hover:border-primary-500 dark:hover:bg-primary-700",
|
|
10398
|
+
"dark:focus:ring-primary-400/20"
|
|
10399
|
+
)
|
|
10400
|
+
),
|
|
10401
|
+
children: [
|
|
10402
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
10403
|
+
"svg",
|
|
10404
|
+
{
|
|
10405
|
+
className: checkmarkSize[size2],
|
|
10406
|
+
fill: "currentColor",
|
|
10407
|
+
viewBox: "0 0 20 20",
|
|
10408
|
+
"aria-hidden": "true",
|
|
10409
|
+
children: /* @__PURE__ */ jsx(
|
|
10410
|
+
"path",
|
|
10411
|
+
{
|
|
10412
|
+
fillRule: "evenodd",
|
|
10413
|
+
clipRule: "evenodd",
|
|
10414
|
+
d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
|
|
10415
|
+
}
|
|
10416
|
+
)
|
|
10417
|
+
}
|
|
10418
|
+
),
|
|
10419
|
+
option.icon,
|
|
10420
|
+
/* @__PURE__ */ jsx("span", { children: option.label })
|
|
10421
|
+
]
|
|
10422
|
+
},
|
|
10423
|
+
option.value
|
|
10424
|
+
);
|
|
10425
|
+
}) })
|
|
10426
|
+
]
|
|
10427
|
+
}
|
|
10428
|
+
);
|
|
10429
|
+
}
|
|
10430
|
+
);
|
|
10431
|
+
PillSelector.displayName = "PillSelector";
|
|
9933
10432
|
export {
|
|
10433
|
+
Alert,
|
|
10434
|
+
Avatar,
|
|
9934
10435
|
Badge,
|
|
9935
10436
|
Breadcrumbs,
|
|
9936
10437
|
Button,
|
|
@@ -9938,13 +10439,16 @@ export {
|
|
|
9938
10439
|
Checkbox,
|
|
9939
10440
|
Combobox,
|
|
9940
10441
|
ConfirmDialog,
|
|
10442
|
+
DateInput,
|
|
9941
10443
|
Drawer,
|
|
9942
10444
|
EmptyState,
|
|
9943
10445
|
Input,
|
|
9944
10446
|
Modal,
|
|
9945
10447
|
MultiSelect,
|
|
10448
|
+
OTPInput,
|
|
9946
10449
|
Pagination,
|
|
9947
10450
|
PasswordInput,
|
|
10451
|
+
PillSelector,
|
|
9948
10452
|
Radio,
|
|
9949
10453
|
RadioGroup,
|
|
9950
10454
|
Select,
|