@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.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function _interopNamespaceDefault(e2) {
|
|
|
23
23
|
}
|
|
24
24
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
25
25
|
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
|
|
26
|
-
const variantStyles$
|
|
26
|
+
const variantStyles$5 = {
|
|
27
27
|
primary: [
|
|
28
28
|
// Light mode
|
|
29
29
|
"bg-primary-800 text-white border border-gold-500/40",
|
|
@@ -63,7 +63,7 @@ const variantStyles$4 = {
|
|
|
63
63
|
"dark:focus:ring-error/30"
|
|
64
64
|
].join(" ")
|
|
65
65
|
};
|
|
66
|
-
const sizeStyles$
|
|
66
|
+
const sizeStyles$d = {
|
|
67
67
|
sm: "px-3 py-1.5 text-sm h-8",
|
|
68
68
|
md: "px-4 py-2 text-base h-10",
|
|
69
69
|
lg: "px-6 py-3 text-lg h-12"
|
|
@@ -93,9 +93,9 @@ const Button = React.forwardRef(
|
|
|
93
93
|
"dark:focus:ring-offset-primary-900",
|
|
94
94
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
95
95
|
// Variant styles
|
|
96
|
-
variantStyles$
|
|
96
|
+
variantStyles$5[variant],
|
|
97
97
|
// Size styles
|
|
98
|
-
sizeStyles$
|
|
98
|
+
sizeStyles$d[size2],
|
|
99
99
|
// Width styles
|
|
100
100
|
fullWidth && "w-full",
|
|
101
101
|
// Custom className (allows override)
|
|
@@ -146,7 +146,7 @@ const Button = React.forwardRef(
|
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
Button.displayName = "Button";
|
|
149
|
-
const sizeStyles$
|
|
149
|
+
const sizeStyles$c = {
|
|
150
150
|
xs: "h-3 w-3",
|
|
151
151
|
// 12px
|
|
152
152
|
sm: "h-4 w-4",
|
|
@@ -176,7 +176,7 @@ const Spinner = React.forwardRef(
|
|
|
176
176
|
ref,
|
|
177
177
|
className: utils_index.cn(
|
|
178
178
|
"animate-spin",
|
|
179
|
-
sizeStyles$
|
|
179
|
+
sizeStyles$c[size2],
|
|
180
180
|
colorStyles[color],
|
|
181
181
|
className
|
|
182
182
|
),
|
|
@@ -7397,7 +7397,7 @@ const CloseIcon$2 = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
7397
7397
|
)
|
|
7398
7398
|
}
|
|
7399
7399
|
);
|
|
7400
|
-
const sizeStyles$
|
|
7400
|
+
const sizeStyles$b = {
|
|
7401
7401
|
sm: "max-w-[400px]",
|
|
7402
7402
|
md: "max-w-[560px]",
|
|
7403
7403
|
lg: "max-w-[720px]"
|
|
@@ -7450,7 +7450,7 @@ function Modal({
|
|
|
7450
7450
|
"bg-white border border-primary-200",
|
|
7451
7451
|
// Dark mode
|
|
7452
7452
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7453
|
-
sizeStyles$
|
|
7453
|
+
sizeStyles$b[size2],
|
|
7454
7454
|
className
|
|
7455
7455
|
),
|
|
7456
7456
|
children: [
|
|
@@ -7528,7 +7528,7 @@ const CloseIcon$1 = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
7528
7528
|
)
|
|
7529
7529
|
}
|
|
7530
7530
|
);
|
|
7531
|
-
const sizeStyles$
|
|
7531
|
+
const sizeStyles$a = {
|
|
7532
7532
|
sm: "max-w-[400px]",
|
|
7533
7533
|
md: "max-w-[560px]",
|
|
7534
7534
|
lg: "max-w-[720px]"
|
|
@@ -7577,7 +7577,7 @@ function Drawer({
|
|
|
7577
7577
|
"bg-white border-l border-primary-200",
|
|
7578
7578
|
// Dark mode
|
|
7579
7579
|
"dark:bg-primary-800 dark:border-primary-700",
|
|
7580
|
-
sizeStyles$
|
|
7580
|
+
sizeStyles$a[size2],
|
|
7581
7581
|
className
|
|
7582
7582
|
),
|
|
7583
7583
|
children: [
|
|
@@ -7693,7 +7693,7 @@ const paddingStyles = {
|
|
|
7693
7693
|
md: "p-6",
|
|
7694
7694
|
lg: "p-8"
|
|
7695
7695
|
};
|
|
7696
|
-
const variantStyles$
|
|
7696
|
+
const variantStyles$4 = {
|
|
7697
7697
|
default: [
|
|
7698
7698
|
"shadow-sm border border-primary-200",
|
|
7699
7699
|
"dark:border-primary-700"
|
|
@@ -7734,7 +7734,7 @@ const Card = React.forwardRef(
|
|
|
7734
7734
|
// Padding
|
|
7735
7735
|
paddingStyles[padding],
|
|
7736
7736
|
// Variant
|
|
7737
|
-
variantStyles$
|
|
7737
|
+
variantStyles$4[variant],
|
|
7738
7738
|
// Hover effect
|
|
7739
7739
|
hoverable && [
|
|
7740
7740
|
"cursor-pointer",
|
|
@@ -7750,7 +7750,7 @@ const Card = React.forwardRef(
|
|
|
7750
7750
|
}
|
|
7751
7751
|
);
|
|
7752
7752
|
Card.displayName = "Card";
|
|
7753
|
-
const sizeStyles$
|
|
7753
|
+
const sizeStyles$9 = {
|
|
7754
7754
|
sm: "h-4 w-4",
|
|
7755
7755
|
md: "h-5 w-5",
|
|
7756
7756
|
lg: "h-6 w-6"
|
|
@@ -7820,7 +7820,7 @@ const Checkbox = React.forwardRef(
|
|
|
7820
7820
|
"aria-describedby": errorId,
|
|
7821
7821
|
onChange: handleChange,
|
|
7822
7822
|
className: utils_index.cn(
|
|
7823
|
-
sizeStyles$
|
|
7823
|
+
sizeStyles$9[size2],
|
|
7824
7824
|
"rounded border transition-colors",
|
|
7825
7825
|
"focus:ring-2 focus:ring-offset-0",
|
|
7826
7826
|
"disabled:cursor-not-allowed",
|
|
@@ -7874,7 +7874,7 @@ const Checkbox = React.forwardRef(
|
|
|
7874
7874
|
}
|
|
7875
7875
|
);
|
|
7876
7876
|
Checkbox.displayName = "Checkbox";
|
|
7877
|
-
const sizeStyles$
|
|
7877
|
+
const sizeStyles$8 = {
|
|
7878
7878
|
sm: "h-4 w-4",
|
|
7879
7879
|
md: "h-5 w-5",
|
|
7880
7880
|
lg: "h-6 w-6"
|
|
@@ -7913,7 +7913,7 @@ const Radio = React.forwardRef(
|
|
|
7913
7913
|
id: radioId,
|
|
7914
7914
|
disabled,
|
|
7915
7915
|
className: utils_index.cn(
|
|
7916
|
-
sizeStyles$
|
|
7916
|
+
sizeStyles$8[size2],
|
|
7917
7917
|
"border transition-colors",
|
|
7918
7918
|
"focus:ring-2 focus:ring-offset-0",
|
|
7919
7919
|
"disabled:cursor-not-allowed",
|
|
@@ -8020,7 +8020,7 @@ function RadioGroup({
|
|
|
8020
8020
|
] });
|
|
8021
8021
|
}
|
|
8022
8022
|
RadioGroup.displayName = "RadioGroup";
|
|
8023
|
-
const sizeStyles$
|
|
8023
|
+
const sizeStyles$7 = {
|
|
8024
8024
|
sm: {
|
|
8025
8025
|
switch: "h-5 w-9",
|
|
8026
8026
|
dot: "h-3 w-3",
|
|
@@ -8047,7 +8047,7 @@ function Toggle({
|
|
|
8047
8047
|
className,
|
|
8048
8048
|
isLoading = false
|
|
8049
8049
|
}) {
|
|
8050
|
-
const currentSize = sizeStyles$
|
|
8050
|
+
const currentSize = sizeStyles$7[size2];
|
|
8051
8051
|
const isDisabled = disabled || isLoading;
|
|
8052
8052
|
return /* @__PURE__ */ jsxRuntime.jsx(W, { className, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8053
8053
|
(label || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 mr-4", children: [
|
|
@@ -8284,7 +8284,7 @@ function Combobox({
|
|
|
8284
8284
|
] });
|
|
8285
8285
|
}
|
|
8286
8286
|
Combobox.displayName = "Combobox";
|
|
8287
|
-
const variantStyles$
|
|
8287
|
+
const variantStyles$3 = {
|
|
8288
8288
|
default: utils_index.cn(
|
|
8289
8289
|
"bg-primary-100 text-primary-700 border-primary-200",
|
|
8290
8290
|
"dark:bg-primary-800 dark:text-primary-200 dark:border-primary-700"
|
|
@@ -8310,7 +8310,7 @@ const variantStyles$2 = {
|
|
|
8310
8310
|
"dark:bg-gold-900/50 dark:text-gold-300 dark:border-gold-700"
|
|
8311
8311
|
)
|
|
8312
8312
|
};
|
|
8313
|
-
const sizeStyles$
|
|
8313
|
+
const sizeStyles$6 = {
|
|
8314
8314
|
sm: "px-2 py-0.5 text-xs",
|
|
8315
8315
|
md: "px-2.5 py-1 text-sm",
|
|
8316
8316
|
lg: "px-3 py-1.5 text-base"
|
|
@@ -8323,8 +8323,8 @@ const Badge = React.forwardRef(
|
|
|
8323
8323
|
ref,
|
|
8324
8324
|
className: utils_index.cn(
|
|
8325
8325
|
"inline-flex items-center justify-center font-medium rounded-full border",
|
|
8326
|
-
variantStyles$
|
|
8327
|
-
sizeStyles$
|
|
8326
|
+
variantStyles$3[variant],
|
|
8327
|
+
sizeStyles$6[size2],
|
|
8328
8328
|
className
|
|
8329
8329
|
),
|
|
8330
8330
|
...props,
|
|
@@ -8482,7 +8482,7 @@ const TableCell = React.forwardRef(
|
|
|
8482
8482
|
}
|
|
8483
8483
|
);
|
|
8484
8484
|
TableCell.displayName = "TableCell";
|
|
8485
|
-
const sizeStyles$
|
|
8485
|
+
const sizeStyles$5 = {
|
|
8486
8486
|
sm: "px-3 py-1.5 text-sm",
|
|
8487
8487
|
md: "px-4 py-2 text-sm",
|
|
8488
8488
|
lg: "px-5 py-2.5 text-base"
|
|
@@ -8531,7 +8531,7 @@ function Tabs({
|
|
|
8531
8531
|
className: ({ selected }) => utils_index.cn(
|
|
8532
8532
|
"relative outline-none transition-colors duration-normal",
|
|
8533
8533
|
"focus-visible:ring-2 focus-visible:ring-gold-500/50",
|
|
8534
|
-
sizeStyles$
|
|
8534
|
+
sizeStyles$5[size2],
|
|
8535
8535
|
fullWidth && "flex-1",
|
|
8536
8536
|
// Default variant styles
|
|
8537
8537
|
variant === "default" && [
|
|
@@ -8715,7 +8715,7 @@ const Breadcrumbs = React.forwardRef(
|
|
|
8715
8715
|
}
|
|
8716
8716
|
);
|
|
8717
8717
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
8718
|
-
const variantStyles$
|
|
8718
|
+
const variantStyles$2 = {
|
|
8719
8719
|
text: "rounded",
|
|
8720
8720
|
circular: "rounded-full",
|
|
8721
8721
|
rectangular: "rounded-md"
|
|
@@ -8751,7 +8751,7 @@ const Skeleton = React.forwardRef(
|
|
|
8751
8751
|
{
|
|
8752
8752
|
className: utils_index.cn(
|
|
8753
8753
|
"bg-primary-200 dark:bg-primary-700",
|
|
8754
|
-
variantStyles$
|
|
8754
|
+
variantStyles$2[variant],
|
|
8755
8755
|
animate && "animate-pulse"
|
|
8756
8756
|
),
|
|
8757
8757
|
style: {
|
|
@@ -8773,7 +8773,7 @@ const Skeleton = React.forwardRef(
|
|
|
8773
8773
|
ref,
|
|
8774
8774
|
className: utils_index.cn(
|
|
8775
8775
|
"bg-primary-200 dark:bg-primary-700",
|
|
8776
|
-
variantStyles$
|
|
8776
|
+
variantStyles$2[variant],
|
|
8777
8777
|
animate && "animate-pulse",
|
|
8778
8778
|
className
|
|
8779
8779
|
),
|
|
@@ -8792,7 +8792,7 @@ const Skeleton = React.forwardRef(
|
|
|
8792
8792
|
}
|
|
8793
8793
|
);
|
|
8794
8794
|
Skeleton.displayName = "Skeleton";
|
|
8795
|
-
const defaultIcons = {
|
|
8795
|
+
const defaultIcons$1 = {
|
|
8796
8796
|
"no-data": /* @__PURE__ */ jsxRuntime.jsx(
|
|
8797
8797
|
"svg",
|
|
8798
8798
|
{
|
|
@@ -8851,7 +8851,7 @@ const defaultIcons = {
|
|
|
8851
8851
|
}
|
|
8852
8852
|
)
|
|
8853
8853
|
};
|
|
8854
|
-
const sizeStyles$
|
|
8854
|
+
const sizeStyles$4 = {
|
|
8855
8855
|
sm: {
|
|
8856
8856
|
container: "py-6 px-4",
|
|
8857
8857
|
icon: "w-10 h-10",
|
|
@@ -8887,7 +8887,7 @@ const EmptyState = React.forwardRef(
|
|
|
8887
8887
|
className,
|
|
8888
8888
|
...props
|
|
8889
8889
|
}, ref) => {
|
|
8890
|
-
const styles = sizeStyles$
|
|
8890
|
+
const styles = sizeStyles$4[size2];
|
|
8891
8891
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8892
8892
|
"div",
|
|
8893
8893
|
{
|
|
@@ -8899,7 +8899,7 @@ const EmptyState = React.forwardRef(
|
|
|
8899
8899
|
),
|
|
8900
8900
|
...props,
|
|
8901
8901
|
children: [
|
|
8902
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_index.cn(styles.icon, typeColors[type], "mb-4"), children: icon || defaultIcons[type] }),
|
|
8902
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_index.cn(styles.icon, typeColors[type], "mb-4"), children: icon || defaultIcons$1[type] }),
|
|
8903
8903
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8904
8904
|
"h3",
|
|
8905
8905
|
{
|
|
@@ -8931,7 +8931,7 @@ const EmptyState = React.forwardRef(
|
|
|
8931
8931
|
EmptyState.displayName = "EmptyState";
|
|
8932
8932
|
const ChevronLeftIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) });
|
|
8933
8933
|
const ChevronRightIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) });
|
|
8934
|
-
const sizeStyles$
|
|
8934
|
+
const sizeStyles$3 = {
|
|
8935
8935
|
sm: { button: "h-8 min-w-8 px-2 text-sm", text: "text-sm" },
|
|
8936
8936
|
md: { button: "h-10 min-w-10 px-3 text-sm", text: "text-sm" }
|
|
8937
8937
|
};
|
|
@@ -8981,7 +8981,7 @@ function Pagination({
|
|
|
8981
8981
|
className
|
|
8982
8982
|
}) {
|
|
8983
8983
|
const pageSizeId = React.useId();
|
|
8984
|
-
const currentSize = sizeStyles$
|
|
8984
|
+
const currentSize = sizeStyles$3[size2];
|
|
8985
8985
|
const canGoPrevious = currentPage > 1;
|
|
8986
8986
|
const canGoNext = currentPage < totalPages;
|
|
8987
8987
|
const pageNumbers = React.useMemo(
|
|
@@ -9528,7 +9528,7 @@ function isItemActive(currentPath, href, matcher = "exact") {
|
|
|
9528
9528
|
return false;
|
|
9529
9529
|
}
|
|
9530
9530
|
}
|
|
9531
|
-
const sizeStyles = {
|
|
9531
|
+
const sizeStyles$2 = {
|
|
9532
9532
|
sm: "px-2 py-1.5 text-xs gap-2",
|
|
9533
9533
|
md: "px-3 py-2.5 text-sm gap-3",
|
|
9534
9534
|
lg: "px-4 py-3 text-base gap-3"
|
|
@@ -9619,7 +9619,7 @@ function SidebarItem({
|
|
|
9619
9619
|
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9620
9620
|
"dark:focus:ring-offset-primary-900",
|
|
9621
9621
|
// Size styles
|
|
9622
|
-
sizeStyles[size2],
|
|
9622
|
+
sizeStyles$2[size2],
|
|
9623
9623
|
// State styles
|
|
9624
9624
|
item.disabled && "opacity-50 cursor-not-allowed",
|
|
9625
9625
|
!item.disabled && !isActive && [
|
|
@@ -9651,7 +9651,7 @@ function SidebarItem({
|
|
|
9651
9651
|
"focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-2",
|
|
9652
9652
|
"dark:focus:ring-offset-primary-900",
|
|
9653
9653
|
// Size styles
|
|
9654
|
-
sizeStyles[size2],
|
|
9654
|
+
sizeStyles$2[size2],
|
|
9655
9655
|
// State styles
|
|
9656
9656
|
item.disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
9657
9657
|
!item.disabled && !isActive && [
|
|
@@ -9752,7 +9752,7 @@ const SidebarDivider = React.forwardRef(
|
|
|
9752
9752
|
}
|
|
9753
9753
|
);
|
|
9754
9754
|
SidebarDivider.displayName = "SidebarDivider";
|
|
9755
|
-
const variantStyles = {
|
|
9755
|
+
const variantStyles$1 = {
|
|
9756
9756
|
default: [
|
|
9757
9757
|
"bg-white border-r border-gold-500/40",
|
|
9758
9758
|
"dark:bg-primary-900 dark:border-gold-500/20"
|
|
@@ -9935,7 +9935,7 @@ const Sidebar = React.forwardRef(
|
|
|
9935
9935
|
// Mobile styles
|
|
9936
9936
|
isOpen ? "translate-x-0" : "-translate-x-full",
|
|
9937
9937
|
// Variant styles
|
|
9938
|
-
variantStyles[variant],
|
|
9938
|
+
variantStyles$1[variant],
|
|
9939
9939
|
className
|
|
9940
9940
|
),
|
|
9941
9941
|
style: { width: sidebarWidth },
|
|
@@ -9948,6 +9948,505 @@ const Sidebar = React.forwardRef(
|
|
|
9948
9948
|
}
|
|
9949
9949
|
);
|
|
9950
9950
|
Sidebar.displayName = "Sidebar";
|
|
9951
|
+
const CheckCircleIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.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" }) });
|
|
9952
|
+
const XCircleIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.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" }) });
|
|
9953
|
+
const ExclamationCircleIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.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" }) });
|
|
9954
|
+
const InformationCircleIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.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" }) });
|
|
9955
|
+
const XMarkIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
9956
|
+
const defaultIcons = {
|
|
9957
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(CheckCircleIcon, {}),
|
|
9958
|
+
error: /* @__PURE__ */ jsxRuntime.jsx(XCircleIcon, {}),
|
|
9959
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(ExclamationCircleIcon, {}),
|
|
9960
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(InformationCircleIcon, {})
|
|
9961
|
+
};
|
|
9962
|
+
const variantStyles = {
|
|
9963
|
+
success: {
|
|
9964
|
+
container: utils_index.cn(
|
|
9965
|
+
"bg-success-light border-success/20 text-[#166534]",
|
|
9966
|
+
"dark:bg-success/10 dark:border-success/30 dark:text-[#86efac]"
|
|
9967
|
+
),
|
|
9968
|
+
icon: "text-success dark:text-[#4ade80]",
|
|
9969
|
+
title: "text-[#14532d] dark:text-[#bbf7d0]"
|
|
9970
|
+
},
|
|
9971
|
+
error: {
|
|
9972
|
+
container: utils_index.cn(
|
|
9973
|
+
"bg-error-light border-error/20 text-[#991b1b]",
|
|
9974
|
+
"dark:bg-error/10 dark:border-error/30 dark:text-[#fca5a5]"
|
|
9975
|
+
),
|
|
9976
|
+
icon: "text-error dark:text-[#f87171]",
|
|
9977
|
+
title: "text-[#7f1d1d] dark:text-[#fecaca]"
|
|
9978
|
+
},
|
|
9979
|
+
warning: {
|
|
9980
|
+
container: utils_index.cn(
|
|
9981
|
+
"bg-warning-light border-warning/20 text-[#854d0e]",
|
|
9982
|
+
"dark:bg-warning/10 dark:border-warning/30 dark:text-[#fde047]"
|
|
9983
|
+
),
|
|
9984
|
+
icon: "text-warning dark:text-[#facc15]",
|
|
9985
|
+
title: "text-[#713f12] dark:text-[#fef08a]"
|
|
9986
|
+
},
|
|
9987
|
+
info: {
|
|
9988
|
+
container: utils_index.cn(
|
|
9989
|
+
"bg-info-light border-info/20 text-[#1e40af]",
|
|
9990
|
+
"dark:bg-info/10 dark:border-info/30 dark:text-[#93c5fd]"
|
|
9991
|
+
),
|
|
9992
|
+
icon: "text-info dark:text-[#60a5fa]",
|
|
9993
|
+
title: "text-[#1e3a8a] dark:text-[#bfdbfe]"
|
|
9994
|
+
}
|
|
9995
|
+
};
|
|
9996
|
+
const Alert = React.forwardRef(
|
|
9997
|
+
({ variant = "info", title, message, icon, onClose, className, ...props }, ref) => {
|
|
9998
|
+
const styles = variantStyles[variant];
|
|
9999
|
+
const displayIcon = icon === null ? null : icon ?? defaultIcons[variant];
|
|
10000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10001
|
+
"div",
|
|
10002
|
+
{
|
|
10003
|
+
ref,
|
|
10004
|
+
role: "alert",
|
|
10005
|
+
className: utils_index.cn(
|
|
10006
|
+
"rounded-lg border p-4",
|
|
10007
|
+
styles.container,
|
|
10008
|
+
className
|
|
10009
|
+
),
|
|
10010
|
+
...props,
|
|
10011
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start", children: [
|
|
10012
|
+
displayIcon !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_index.cn("flex-shrink-0", styles.icon), "aria-hidden": "true", children: displayIcon }),
|
|
10013
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils_index.cn("flex-1", displayIcon !== null && "ml-3"), children: [
|
|
10014
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: utils_index.cn("text-sm font-medium", styles.title), children: title }),
|
|
10015
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_index.cn("text-sm", title && "mt-1"), children: message })
|
|
10016
|
+
] }),
|
|
10017
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10018
|
+
"button",
|
|
10019
|
+
{
|
|
10020
|
+
type: "button",
|
|
10021
|
+
onClick: onClose,
|
|
10022
|
+
className: utils_index.cn(
|
|
10023
|
+
"inline-flex rounded-md p-1.5",
|
|
10024
|
+
"hover:opacity-75 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
10025
|
+
"focus:ring-current/20",
|
|
10026
|
+
"dark:focus:ring-offset-primary-900"
|
|
10027
|
+
),
|
|
10028
|
+
children: [
|
|
10029
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Dismiss" }),
|
|
10030
|
+
/* @__PURE__ */ jsxRuntime.jsx(XMarkIcon, {})
|
|
10031
|
+
]
|
|
10032
|
+
}
|
|
10033
|
+
) })
|
|
10034
|
+
] })
|
|
10035
|
+
}
|
|
10036
|
+
);
|
|
10037
|
+
}
|
|
10038
|
+
);
|
|
10039
|
+
Alert.displayName = "Alert";
|
|
10040
|
+
const sizeStyles$1 = {
|
|
10041
|
+
xs: { container: "w-6 h-6", text: "text-xs", status: "w-2 h-2 border" },
|
|
10042
|
+
sm: { container: "w-8 h-8", text: "text-sm", status: "w-2.5 h-2.5 border" },
|
|
10043
|
+
md: { container: "w-10 h-10", text: "text-base", status: "w-3 h-3 border-2" },
|
|
10044
|
+
lg: { container: "w-12 h-12", text: "text-lg", status: "w-3.5 h-3.5 border-2" },
|
|
10045
|
+
xl: { container: "w-16 h-16", text: "text-2xl", status: "w-4 h-4 border-2" }
|
|
10046
|
+
};
|
|
10047
|
+
const statusStyles = {
|
|
10048
|
+
online: "bg-success",
|
|
10049
|
+
offline: "bg-primary-400 dark:bg-primary-500",
|
|
10050
|
+
away: "bg-warning",
|
|
10051
|
+
busy: "bg-error"
|
|
10052
|
+
};
|
|
10053
|
+
const Avatar = React.forwardRef(
|
|
10054
|
+
({ name, src, size: size2 = "md", alt, status, className, ...props }, ref) => {
|
|
10055
|
+
const getInitials = (fullName) => {
|
|
10056
|
+
const names = fullName.trim().split(" ");
|
|
10057
|
+
if (names.length === 1) {
|
|
10058
|
+
return names[0]?.charAt(0).toUpperCase() || "";
|
|
10059
|
+
}
|
|
10060
|
+
const firstName = names[0];
|
|
10061
|
+
const lastName = names[names.length - 1];
|
|
10062
|
+
return ((firstName?.charAt(0) || "") + (lastName?.charAt(0) || "")).toUpperCase();
|
|
10063
|
+
};
|
|
10064
|
+
const initials = getInitials(name);
|
|
10065
|
+
const styles = sizeStyles$1[size2];
|
|
10066
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10067
|
+
"div",
|
|
10068
|
+
{
|
|
10069
|
+
ref,
|
|
10070
|
+
className: utils_index.cn(
|
|
10071
|
+
"relative inline-flex items-center justify-center",
|
|
10072
|
+
"rounded-full font-medium",
|
|
10073
|
+
// Light mode
|
|
10074
|
+
"bg-gold-500 text-white",
|
|
10075
|
+
// Dark mode
|
|
10076
|
+
"dark:bg-gold-600 dark:text-white",
|
|
10077
|
+
styles.container,
|
|
10078
|
+
className
|
|
10079
|
+
),
|
|
10080
|
+
...props,
|
|
10081
|
+
children: [
|
|
10082
|
+
src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10083
|
+
"img",
|
|
10084
|
+
{
|
|
10085
|
+
src,
|
|
10086
|
+
alt: alt || `${name}'s avatar`,
|
|
10087
|
+
className: "w-full h-full rounded-full object-cover"
|
|
10088
|
+
}
|
|
10089
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.text, children: initials }),
|
|
10090
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10091
|
+
"span",
|
|
10092
|
+
{
|
|
10093
|
+
role: "status",
|
|
10094
|
+
className: utils_index.cn(
|
|
10095
|
+
"absolute bottom-0 right-0 rounded-full",
|
|
10096
|
+
"border-white dark:border-primary-900",
|
|
10097
|
+
styles.status,
|
|
10098
|
+
statusStyles[status]
|
|
10099
|
+
),
|
|
10100
|
+
"aria-label": `Status: ${status}`
|
|
10101
|
+
}
|
|
10102
|
+
)
|
|
10103
|
+
]
|
|
10104
|
+
}
|
|
10105
|
+
);
|
|
10106
|
+
}
|
|
10107
|
+
);
|
|
10108
|
+
Avatar.displayName = "Avatar";
|
|
10109
|
+
const OTPInput = ({
|
|
10110
|
+
length = 6,
|
|
10111
|
+
value,
|
|
10112
|
+
onChange,
|
|
10113
|
+
error: error2,
|
|
10114
|
+
disabled = false,
|
|
10115
|
+
autoFocus = false,
|
|
10116
|
+
label = "One-time password",
|
|
10117
|
+
className
|
|
10118
|
+
}) => {
|
|
10119
|
+
const inputRefs = React.useRef([]);
|
|
10120
|
+
const digits = value.split("").slice(0, length);
|
|
10121
|
+
while (digits.length < length) {
|
|
10122
|
+
digits.push("");
|
|
10123
|
+
}
|
|
10124
|
+
const focusInput = React.useCallback((index2) => {
|
|
10125
|
+
const input = inputRefs.current[index2];
|
|
10126
|
+
if (input) {
|
|
10127
|
+
input.focus();
|
|
10128
|
+
input.select();
|
|
10129
|
+
}
|
|
10130
|
+
}, []);
|
|
10131
|
+
const handleChange = React.useCallback(
|
|
10132
|
+
(index2, event_) => {
|
|
10133
|
+
const newValue = event_.target.value;
|
|
10134
|
+
if (!/^\d*$/.test(newValue)) return;
|
|
10135
|
+
const digit = newValue.slice(-1);
|
|
10136
|
+
const newDigits = [...digits];
|
|
10137
|
+
newDigits[index2] = digit;
|
|
10138
|
+
const newOtp = newDigits.join("");
|
|
10139
|
+
onChange(newOtp);
|
|
10140
|
+
if (digit && index2 < length - 1) {
|
|
10141
|
+
focusInput(index2 + 1);
|
|
10142
|
+
}
|
|
10143
|
+
},
|
|
10144
|
+
[digits, length, onChange, focusInput]
|
|
10145
|
+
);
|
|
10146
|
+
const handleKeyDown = React.useCallback(
|
|
10147
|
+
(index2, event_) => {
|
|
10148
|
+
switch (event_.key) {
|
|
10149
|
+
case "Backspace":
|
|
10150
|
+
if (!digits[index2] && index2 > 0) {
|
|
10151
|
+
event_.preventDefault();
|
|
10152
|
+
const newDigits = [...digits];
|
|
10153
|
+
newDigits[index2 - 1] = "";
|
|
10154
|
+
onChange(newDigits.join(""));
|
|
10155
|
+
focusInput(index2 - 1);
|
|
10156
|
+
} else if (digits[index2]) {
|
|
10157
|
+
const newDigits = [...digits];
|
|
10158
|
+
newDigits[index2] = "";
|
|
10159
|
+
onChange(newDigits.join(""));
|
|
10160
|
+
}
|
|
10161
|
+
break;
|
|
10162
|
+
case "ArrowLeft":
|
|
10163
|
+
event_.preventDefault();
|
|
10164
|
+
if (index2 > 0) {
|
|
10165
|
+
focusInput(index2 - 1);
|
|
10166
|
+
}
|
|
10167
|
+
break;
|
|
10168
|
+
case "ArrowRight":
|
|
10169
|
+
event_.preventDefault();
|
|
10170
|
+
if (index2 < length - 1) {
|
|
10171
|
+
focusInput(index2 + 1);
|
|
10172
|
+
}
|
|
10173
|
+
break;
|
|
10174
|
+
case "Delete": {
|
|
10175
|
+
event_.preventDefault();
|
|
10176
|
+
const newDigits = [...digits];
|
|
10177
|
+
newDigits[index2] = "";
|
|
10178
|
+
onChange(newDigits.join(""));
|
|
10179
|
+
break;
|
|
10180
|
+
}
|
|
10181
|
+
}
|
|
10182
|
+
},
|
|
10183
|
+
[digits, length, onChange, focusInput]
|
|
10184
|
+
);
|
|
10185
|
+
const handlePaste = React.useCallback(
|
|
10186
|
+
(event_) => {
|
|
10187
|
+
event_.preventDefault();
|
|
10188
|
+
const pastedData = event_.clipboardData.getData("text");
|
|
10189
|
+
const pastedDigits = pastedData.replace(/\D/g, "").slice(0, length);
|
|
10190
|
+
if (pastedDigits) {
|
|
10191
|
+
onChange(pastedDigits);
|
|
10192
|
+
const focusIndex = Math.min(pastedDigits.length, length - 1);
|
|
10193
|
+
focusInput(focusIndex);
|
|
10194
|
+
}
|
|
10195
|
+
},
|
|
10196
|
+
[length, onChange, focusInput]
|
|
10197
|
+
);
|
|
10198
|
+
const errorId = error2 ? "otp-input-error" : void 0;
|
|
10199
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils_index.cn("w-full", className), "data-testid": "otp-input", children: [
|
|
10200
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10201
|
+
"div",
|
|
10202
|
+
{
|
|
10203
|
+
role: "group",
|
|
10204
|
+
"aria-label": label,
|
|
10205
|
+
"aria-describedby": errorId,
|
|
10206
|
+
className: "flex justify-center gap-2 sm:gap-3",
|
|
10207
|
+
children: digits.map((digit, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10208
|
+
"input",
|
|
10209
|
+
{
|
|
10210
|
+
ref: (element) => {
|
|
10211
|
+
inputRefs.current[index2] = element;
|
|
10212
|
+
},
|
|
10213
|
+
type: "text",
|
|
10214
|
+
inputMode: "numeric",
|
|
10215
|
+
pattern: "\\d*",
|
|
10216
|
+
maxLength: 1,
|
|
10217
|
+
value: digit,
|
|
10218
|
+
disabled,
|
|
10219
|
+
autoFocus: autoFocus && index2 === 0,
|
|
10220
|
+
"aria-label": `Digit ${index2 + 1} of ${length}`,
|
|
10221
|
+
"aria-invalid": !!error2,
|
|
10222
|
+
"data-testid": `otp-input-digit-${index2}`,
|
|
10223
|
+
className: utils_index.cn(
|
|
10224
|
+
"w-10 h-12 sm:w-12 sm:h-14",
|
|
10225
|
+
"text-center text-xl sm:text-2xl font-semibold",
|
|
10226
|
+
"border-2 rounded-lg",
|
|
10227
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",
|
|
10228
|
+
"transition-colors duration-200",
|
|
10229
|
+
// Light mode
|
|
10230
|
+
error2 ? "border-error bg-error-light" : "border-primary-300 bg-white",
|
|
10231
|
+
// Dark mode
|
|
10232
|
+
error2 ? "dark:border-error dark:bg-error/10" : "dark:border-primary-600 dark:bg-primary-900 dark:text-white",
|
|
10233
|
+
"dark:focus:ring-primary-400 dark:focus:border-primary-400",
|
|
10234
|
+
disabled && "bg-primary-100 cursor-not-allowed opacity-50 dark:bg-primary-800"
|
|
10235
|
+
),
|
|
10236
|
+
onChange: (event_) => handleChange(index2, event_),
|
|
10237
|
+
onKeyDown: (event_) => handleKeyDown(index2, event_),
|
|
10238
|
+
onPaste: handlePaste,
|
|
10239
|
+
onFocus: (event_) => event_.target.select()
|
|
10240
|
+
},
|
|
10241
|
+
index2
|
|
10242
|
+
))
|
|
10243
|
+
}
|
|
10244
|
+
),
|
|
10245
|
+
error2 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10246
|
+
"p",
|
|
10247
|
+
{
|
|
10248
|
+
id: errorId,
|
|
10249
|
+
role: "alert",
|
|
10250
|
+
"aria-live": "assertive",
|
|
10251
|
+
"data-testid": "otp-input-error",
|
|
10252
|
+
className: utils_index.cn(
|
|
10253
|
+
"mt-2 text-sm text-center",
|
|
10254
|
+
"text-error dark:text-[#fca5a5]"
|
|
10255
|
+
),
|
|
10256
|
+
children: error2
|
|
10257
|
+
}
|
|
10258
|
+
)
|
|
10259
|
+
] });
|
|
10260
|
+
};
|
|
10261
|
+
const DateInput = React.forwardRef(
|
|
10262
|
+
({
|
|
10263
|
+
value,
|
|
10264
|
+
onChange,
|
|
10265
|
+
label,
|
|
10266
|
+
error: error2,
|
|
10267
|
+
helperText,
|
|
10268
|
+
fullWidth = false,
|
|
10269
|
+
disabled = false,
|
|
10270
|
+
className,
|
|
10271
|
+
id,
|
|
10272
|
+
required,
|
|
10273
|
+
min: min2,
|
|
10274
|
+
max: max2,
|
|
10275
|
+
...props
|
|
10276
|
+
}, ref) => {
|
|
10277
|
+
const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
10278
|
+
const hasError = !!error2;
|
|
10279
|
+
const errorId = hasError ? `${inputId}-error` : void 0;
|
|
10280
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils_index.cn(fullWidth ? "w-full" : "w-auto"), children: [
|
|
10281
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10282
|
+
"label",
|
|
10283
|
+
{
|
|
10284
|
+
htmlFor: inputId,
|
|
10285
|
+
className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white",
|
|
10286
|
+
children: [
|
|
10287
|
+
label,
|
|
10288
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-error", children: "*" })
|
|
10289
|
+
]
|
|
10290
|
+
}
|
|
10291
|
+
),
|
|
10292
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10293
|
+
"input",
|
|
10294
|
+
{
|
|
10295
|
+
ref,
|
|
10296
|
+
type: "date",
|
|
10297
|
+
id: inputId,
|
|
10298
|
+
"data-testid": "date-input",
|
|
10299
|
+
value: value || "",
|
|
10300
|
+
onChange: (event_) => onChange(event_.target.value || null),
|
|
10301
|
+
disabled,
|
|
10302
|
+
required,
|
|
10303
|
+
min: min2,
|
|
10304
|
+
max: max2,
|
|
10305
|
+
"aria-label": label ? void 0 : "Select date",
|
|
10306
|
+
"aria-invalid": hasError ? "true" : void 0,
|
|
10307
|
+
"aria-describedby": errorId,
|
|
10308
|
+
className: utils_index.cn(
|
|
10309
|
+
// Base styles - Light mode
|
|
10310
|
+
"block w-full rounded-md border bg-white px-4 py-2.5 text-sm text-primary-900",
|
|
10311
|
+
"transition-colors duration-normal",
|
|
10312
|
+
"focus:outline-none focus:ring-2",
|
|
10313
|
+
"disabled:cursor-not-allowed disabled:bg-primary-50 disabled:text-primary-500",
|
|
10314
|
+
// Base styles - Dark mode
|
|
10315
|
+
"dark:bg-primary-800 dark:text-primary-100",
|
|
10316
|
+
"dark:disabled:bg-primary-900 dark:disabled:text-primary-600",
|
|
10317
|
+
// Border and focus styles
|
|
10318
|
+
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",
|
|
10319
|
+
// Custom className
|
|
10320
|
+
className
|
|
10321
|
+
),
|
|
10322
|
+
...props
|
|
10323
|
+
}
|
|
10324
|
+
),
|
|
10325
|
+
(error2 || helperText) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10326
|
+
"p",
|
|
10327
|
+
{
|
|
10328
|
+
id: errorId,
|
|
10329
|
+
role: hasError ? "alert" : void 0,
|
|
10330
|
+
className: utils_index.cn(
|
|
10331
|
+
"mt-1.5 text-sm",
|
|
10332
|
+
hasError ? "text-error" : "text-primary-500 dark:text-primary-400"
|
|
10333
|
+
),
|
|
10334
|
+
children: error2 || helperText
|
|
10335
|
+
}
|
|
10336
|
+
)
|
|
10337
|
+
] });
|
|
10338
|
+
}
|
|
10339
|
+
);
|
|
10340
|
+
DateInput.displayName = "DateInput";
|
|
10341
|
+
const sizeStyles = {
|
|
10342
|
+
sm: "px-2.5 py-1 text-xs gap-1",
|
|
10343
|
+
md: "px-3 py-1.5 text-sm gap-1.5",
|
|
10344
|
+
lg: "px-4 py-2 text-base gap-2"
|
|
10345
|
+
};
|
|
10346
|
+
const checkmarkSize = {
|
|
10347
|
+
sm: "w-3 h-3",
|
|
10348
|
+
md: "w-4 h-4",
|
|
10349
|
+
lg: "w-5 h-5"
|
|
10350
|
+
};
|
|
10351
|
+
const PillSelector = React.forwardRef(
|
|
10352
|
+
({
|
|
10353
|
+
options,
|
|
10354
|
+
selected,
|
|
10355
|
+
onChange,
|
|
10356
|
+
multiple = true,
|
|
10357
|
+
size: size2 = "md",
|
|
10358
|
+
label,
|
|
10359
|
+
fullWidth = false,
|
|
10360
|
+
disabled = false,
|
|
10361
|
+
className,
|
|
10362
|
+
...props
|
|
10363
|
+
}, ref) => {
|
|
10364
|
+
const handleClick = (value) => {
|
|
10365
|
+
if (disabled) return;
|
|
10366
|
+
if (multiple) {
|
|
10367
|
+
if (selected.includes(value)) {
|
|
10368
|
+
onChange(selected.filter((v2) => v2 !== value));
|
|
10369
|
+
} else {
|
|
10370
|
+
onChange([...selected, value]);
|
|
10371
|
+
}
|
|
10372
|
+
} else {
|
|
10373
|
+
onChange([value]);
|
|
10374
|
+
}
|
|
10375
|
+
};
|
|
10376
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10377
|
+
"div",
|
|
10378
|
+
{
|
|
10379
|
+
ref,
|
|
10380
|
+
className: utils_index.cn(fullWidth ? "w-full" : "w-auto", className),
|
|
10381
|
+
...props,
|
|
10382
|
+
children: [
|
|
10383
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-2 block text-sm font-medium text-primary-700 dark:text-white", children: label }),
|
|
10384
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", role: "group", "aria-label": label, children: options.map((option) => {
|
|
10385
|
+
const isSelected = selected.includes(option.value);
|
|
10386
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10387
|
+
"button",
|
|
10388
|
+
{
|
|
10389
|
+
type: "button",
|
|
10390
|
+
disabled,
|
|
10391
|
+
"aria-pressed": isSelected,
|
|
10392
|
+
onClick: () => handleClick(option.value),
|
|
10393
|
+
className: utils_index.cn(
|
|
10394
|
+
"inline-flex items-center justify-center rounded-full border font-medium",
|
|
10395
|
+
"transition-colors duration-normal",
|
|
10396
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-1",
|
|
10397
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
10398
|
+
sizeStyles[size2],
|
|
10399
|
+
isSelected ? utils_index.cn(
|
|
10400
|
+
// Light mode - selected
|
|
10401
|
+
"border-primary-700 bg-primary-700 text-white",
|
|
10402
|
+
"hover:bg-primary-800 hover:border-primary-800",
|
|
10403
|
+
"focus:ring-primary-500/30",
|
|
10404
|
+
// Dark mode - selected
|
|
10405
|
+
"dark:border-gold-500 dark:bg-gold-500 dark:text-primary-900",
|
|
10406
|
+
"dark:hover:bg-gold-400 dark:hover:border-gold-400",
|
|
10407
|
+
"dark:focus:ring-gold-400/30"
|
|
10408
|
+
) : utils_index.cn(
|
|
10409
|
+
// Light mode - unselected
|
|
10410
|
+
"border-primary-300 bg-white text-primary-700",
|
|
10411
|
+
"hover:border-primary-400 hover:bg-primary-50",
|
|
10412
|
+
"focus:ring-primary-500/20",
|
|
10413
|
+
// Dark mode - unselected
|
|
10414
|
+
"dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200",
|
|
10415
|
+
"dark:hover:border-primary-500 dark:hover:bg-primary-700",
|
|
10416
|
+
"dark:focus:ring-primary-400/20"
|
|
10417
|
+
)
|
|
10418
|
+
),
|
|
10419
|
+
children: [
|
|
10420
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10421
|
+
"svg",
|
|
10422
|
+
{
|
|
10423
|
+
className: checkmarkSize[size2],
|
|
10424
|
+
fill: "currentColor",
|
|
10425
|
+
viewBox: "0 0 20 20",
|
|
10426
|
+
"aria-hidden": "true",
|
|
10427
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10428
|
+
"path",
|
|
10429
|
+
{
|
|
10430
|
+
fillRule: "evenodd",
|
|
10431
|
+
clipRule: "evenodd",
|
|
10432
|
+
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"
|
|
10433
|
+
}
|
|
10434
|
+
)
|
|
10435
|
+
}
|
|
10436
|
+
),
|
|
10437
|
+
option.icon,
|
|
10438
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
|
|
10439
|
+
]
|
|
10440
|
+
},
|
|
10441
|
+
option.value
|
|
10442
|
+
);
|
|
10443
|
+
}) })
|
|
10444
|
+
]
|
|
10445
|
+
}
|
|
10446
|
+
);
|
|
10447
|
+
}
|
|
10448
|
+
);
|
|
10449
|
+
PillSelector.displayName = "PillSelector";
|
|
9951
10450
|
exports.useDebounce = useSidebar.useDebounce;
|
|
9952
10451
|
exports.useDebouncedCallback = useSidebar.useDebouncedCallback;
|
|
9953
10452
|
exports.useDebouncedCallbackWithControl = useSidebar.useDebouncedCallbackWithControl;
|
|
@@ -9955,6 +10454,8 @@ exports.useSelection = useSidebar.useSelection;
|
|
|
9955
10454
|
exports.useSidebar = useSidebar.useSidebar;
|
|
9956
10455
|
exports.useTable = useSidebar.useTable;
|
|
9957
10456
|
exports.cn = utils_index.cn;
|
|
10457
|
+
exports.Alert = Alert;
|
|
10458
|
+
exports.Avatar = Avatar;
|
|
9958
10459
|
exports.Badge = Badge;
|
|
9959
10460
|
exports.Breadcrumbs = Breadcrumbs;
|
|
9960
10461
|
exports.Button = Button;
|
|
@@ -9962,13 +10463,16 @@ exports.Card = Card;
|
|
|
9962
10463
|
exports.Checkbox = Checkbox;
|
|
9963
10464
|
exports.Combobox = Combobox;
|
|
9964
10465
|
exports.ConfirmDialog = ConfirmDialog;
|
|
10466
|
+
exports.DateInput = DateInput;
|
|
9965
10467
|
exports.Drawer = Drawer;
|
|
9966
10468
|
exports.EmptyState = EmptyState;
|
|
9967
10469
|
exports.Input = Input;
|
|
9968
10470
|
exports.Modal = Modal;
|
|
9969
10471
|
exports.MultiSelect = MultiSelect;
|
|
10472
|
+
exports.OTPInput = OTPInput;
|
|
9970
10473
|
exports.Pagination = Pagination;
|
|
9971
10474
|
exports.PasswordInput = PasswordInput;
|
|
10475
|
+
exports.PillSelector = PillSelector;
|
|
9972
10476
|
exports.Radio = Radio;
|
|
9973
10477
|
exports.RadioGroup = RadioGroup;
|
|
9974
10478
|
exports.Select = Select;
|