@rehagro/ui 1.0.64 → 1.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +94 -1
- package/dist/index.d.ts +94 -1
- package/dist/index.js +388 -247
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +276 -136
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +54 -1
- package/dist/native.d.ts +54 -1
- package/dist/native.js +115 -2
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +114 -2
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React10 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var React10__default = /*#__PURE__*/_interopDefault(React10);
|
|
11
11
|
|
|
12
12
|
// src/provider/RehagroProvider.tsx
|
|
13
13
|
|
|
@@ -437,7 +437,7 @@ var closeStyles = {
|
|
|
437
437
|
"neutral-light": "rh-text-gray-500 hover:rh-text-gray-800",
|
|
438
438
|
"neutral-outline": "rh-text-text-muted hover:rh-text-text"
|
|
439
439
|
};
|
|
440
|
-
var Toast =
|
|
440
|
+
var Toast = React10.forwardRef(function Toast2({
|
|
441
441
|
title,
|
|
442
442
|
description,
|
|
443
443
|
link,
|
|
@@ -545,9 +545,9 @@ function AnimatedToastItem({
|
|
|
545
545
|
onRequestDismiss,
|
|
546
546
|
children
|
|
547
547
|
}) {
|
|
548
|
-
const [entered, setEntered] =
|
|
549
|
-
const leaveTimerRef =
|
|
550
|
-
|
|
548
|
+
const [entered, setEntered] = React10.useState(false);
|
|
549
|
+
const leaveTimerRef = React10.useRef(null);
|
|
550
|
+
React10.useEffect(() => {
|
|
551
551
|
if (!isDismissing) return;
|
|
552
552
|
leaveTimerRef.current = setTimeout(() => {
|
|
553
553
|
onRemove(id);
|
|
@@ -556,10 +556,10 @@ function AnimatedToastItem({
|
|
|
556
556
|
if (leaveTimerRef.current) clearTimeout(leaveTimerRef.current);
|
|
557
557
|
};
|
|
558
558
|
}, [id, isDismissing, onRemove]);
|
|
559
|
-
const handleAnimationEnd =
|
|
559
|
+
const handleAnimationEnd = React10.useCallback(() => {
|
|
560
560
|
if (!entered) setEntered(true);
|
|
561
561
|
}, [entered]);
|
|
562
|
-
const handleClose =
|
|
562
|
+
const handleClose = React10.useCallback(() => {
|
|
563
563
|
onRequestDismiss(id);
|
|
564
564
|
}, [id, onRequestDismiss]);
|
|
565
565
|
const animClass = isDismissing ? leaveClass[animDir] : entered ? "" : enterClass[animDir];
|
|
@@ -605,15 +605,15 @@ function ToastContainer() {
|
|
|
605
605
|
}
|
|
606
606
|
);
|
|
607
607
|
}
|
|
608
|
-
var ToastContext =
|
|
608
|
+
var ToastContext = React10.createContext(null);
|
|
609
609
|
function ToastProvider({
|
|
610
610
|
children,
|
|
611
611
|
position = "top-right"
|
|
612
612
|
}) {
|
|
613
|
-
const [toasts, setToasts] =
|
|
614
|
-
const [dismissingIds, setDismissingIds] =
|
|
615
|
-
const counterRef =
|
|
616
|
-
const remove =
|
|
613
|
+
const [toasts, setToasts] = React10.useState([]);
|
|
614
|
+
const [dismissingIds, setDismissingIds] = React10.useState(/* @__PURE__ */ new Set());
|
|
615
|
+
const counterRef = React10.useRef(0);
|
|
616
|
+
const remove = React10.useCallback((id) => {
|
|
617
617
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
618
618
|
setDismissingIds((prev) => {
|
|
619
619
|
const next = new Set(prev);
|
|
@@ -621,10 +621,10 @@ function ToastProvider({
|
|
|
621
621
|
return next;
|
|
622
622
|
});
|
|
623
623
|
}, []);
|
|
624
|
-
const requestDismiss =
|
|
624
|
+
const requestDismiss = React10.useCallback((id) => {
|
|
625
625
|
setDismissingIds((prev) => new Set(prev).add(id));
|
|
626
626
|
}, []);
|
|
627
|
-
const add =
|
|
627
|
+
const add = React10.useCallback(
|
|
628
628
|
(item) => {
|
|
629
629
|
const id = `rh-toast-${++counterRef.current}`;
|
|
630
630
|
const toast = { ...item, id };
|
|
@@ -642,7 +642,7 @@ function ToastProvider({
|
|
|
642
642
|
] });
|
|
643
643
|
}
|
|
644
644
|
function useToastContext() {
|
|
645
|
-
const ctx =
|
|
645
|
+
const ctx = React10.useContext(ToastContext);
|
|
646
646
|
if (!ctx) {
|
|
647
647
|
throw new Error("useToastContext must be used inside ToastProvider");
|
|
648
648
|
}
|
|
@@ -650,7 +650,7 @@ function useToastContext() {
|
|
|
650
650
|
}
|
|
651
651
|
function useToast() {
|
|
652
652
|
const { add, requestDismiss } = useToastContext();
|
|
653
|
-
const createToast =
|
|
653
|
+
const createToast = React10.useCallback(
|
|
654
654
|
(variant) => (title, options = {}) => {
|
|
655
655
|
return add({
|
|
656
656
|
title,
|
|
@@ -663,7 +663,7 @@ function useToast() {
|
|
|
663
663
|
},
|
|
664
664
|
[add]
|
|
665
665
|
);
|
|
666
|
-
const toast =
|
|
666
|
+
const toast = React10.useCallback(
|
|
667
667
|
(title, options = {}) => {
|
|
668
668
|
return add({
|
|
669
669
|
title,
|
|
@@ -706,7 +706,7 @@ function toRgbTriplet(value) {
|
|
|
706
706
|
return void 0;
|
|
707
707
|
}
|
|
708
708
|
function RehagroProvider({ theme, toastPosition, children }) {
|
|
709
|
-
const style =
|
|
709
|
+
const style = React10.useMemo(() => {
|
|
710
710
|
const vars = {};
|
|
711
711
|
for (const [key, config] of Object.entries(TOKEN_MAP)) {
|
|
712
712
|
const value = theme[key];
|
|
@@ -835,7 +835,7 @@ var radiusClasses = {
|
|
|
835
835
|
xl: "rh-rounded-xl",
|
|
836
836
|
full: "rh-rounded-full"
|
|
837
837
|
};
|
|
838
|
-
var Button =
|
|
838
|
+
var Button = React10.forwardRef(function Button2({
|
|
839
839
|
variant = "solid",
|
|
840
840
|
size = "md",
|
|
841
841
|
radius = "sm",
|
|
@@ -852,9 +852,9 @@ var Button = React9.forwardRef(function Button2({
|
|
|
852
852
|
children,
|
|
853
853
|
...rest
|
|
854
854
|
}, ref) {
|
|
855
|
-
const isDisabled =
|
|
855
|
+
const isDisabled = React10__default.default.useMemo(() => disabled || loading, [disabled, loading]);
|
|
856
856
|
const preset = isPresetColor(color);
|
|
857
|
-
const computedStyle =
|
|
857
|
+
const computedStyle = React10__default.default.useMemo(() => {
|
|
858
858
|
const baseStyle = preset ? hoverColor ? { [`--rh-${color}-hover`]: toRgbTriplet2(hoverColor) ?? hoverColor } : {} : getArbitraryColorStyle(variant, color);
|
|
859
859
|
const hoverVars = hoverStyle ? {
|
|
860
860
|
"--btn-hover-bg": hoverStyle.backgroundColor,
|
|
@@ -990,7 +990,7 @@ var radiusClasses2 = {
|
|
|
990
990
|
xl: "rh-rounded-[24px]",
|
|
991
991
|
full: "rh-rounded-full"
|
|
992
992
|
};
|
|
993
|
-
var IconButton =
|
|
993
|
+
var IconButton = React10.forwardRef(function IconButton2({
|
|
994
994
|
variant = "ghost",
|
|
995
995
|
size = "md",
|
|
996
996
|
radius = "full",
|
|
@@ -1004,7 +1004,7 @@ var IconButton = React9.forwardRef(function IconButton2({
|
|
|
1004
1004
|
}, ref) {
|
|
1005
1005
|
const isDisabled = disabled || loading;
|
|
1006
1006
|
const preset = isPresetColor2(color);
|
|
1007
|
-
const computedStyle =
|
|
1007
|
+
const computedStyle = React10__default.default.useMemo(
|
|
1008
1008
|
() => preset ? style ?? {} : { ...style, ...getArbitraryColorStyle2(variant, color) },
|
|
1009
1009
|
[preset, color, variant, style]
|
|
1010
1010
|
);
|
|
@@ -1103,7 +1103,7 @@ var labelWeightClasses = {
|
|
|
1103
1103
|
bold: "rh-font-bold"
|
|
1104
1104
|
};
|
|
1105
1105
|
var getSubtitleClassName = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1106
|
-
var TextInput =
|
|
1106
|
+
var TextInput = React10.forwardRef(function TextInput2({
|
|
1107
1107
|
label,
|
|
1108
1108
|
labelWeight = "medium",
|
|
1109
1109
|
labelColor = "#080B12",
|
|
@@ -1123,9 +1123,9 @@ var TextInput = React9.forwardRef(function TextInput2({
|
|
|
1123
1123
|
id,
|
|
1124
1124
|
...rest
|
|
1125
1125
|
}, ref) {
|
|
1126
|
-
const generatedId =
|
|
1126
|
+
const generatedId = React10__default.default.useId();
|
|
1127
1127
|
const inputId = id || generatedId;
|
|
1128
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
1128
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10__default.default.useState(false);
|
|
1129
1129
|
const { onChange, ...inputProps } = rest;
|
|
1130
1130
|
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
1131
1131
|
const containerStyle = {
|
|
@@ -1229,7 +1229,150 @@ var TextInput = React9.forwardRef(function TextInput2({
|
|
|
1229
1229
|
}
|
|
1230
1230
|
);
|
|
1231
1231
|
});
|
|
1232
|
+
var statusClasses2 = {
|
|
1233
|
+
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1234
|
+
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1235
|
+
};
|
|
1232
1236
|
var sizeClasses4 = {
|
|
1237
|
+
sm: "rh-text-sm rh-px-input-x-sm rh-py-2",
|
|
1238
|
+
md: "rh-text-sm rh-px-input-x-md rh-py-2",
|
|
1239
|
+
lg: "rh-text-base rh-px-input-x-lg rh-py-3"
|
|
1240
|
+
};
|
|
1241
|
+
var radiusClasses4 = {
|
|
1242
|
+
none: "rh-rounded-none",
|
|
1243
|
+
xxs: "rh-rounded-xxs",
|
|
1244
|
+
xs: "rh-rounded-xs",
|
|
1245
|
+
sm: "rh-rounded-sm",
|
|
1246
|
+
md: "rh-rounded-md",
|
|
1247
|
+
lg: "rh-rounded-lg",
|
|
1248
|
+
xl: "rh-rounded-xl",
|
|
1249
|
+
full: "rh-rounded-full"
|
|
1250
|
+
};
|
|
1251
|
+
var borderWidthClasses2 = {
|
|
1252
|
+
sm: "rh-border-sm",
|
|
1253
|
+
md: "rh-border-md",
|
|
1254
|
+
lg: "rh-border-lg"
|
|
1255
|
+
};
|
|
1256
|
+
var resizeClasses = {
|
|
1257
|
+
none: "rh-resize-none",
|
|
1258
|
+
vertical: "rh-resize-y",
|
|
1259
|
+
horizontal: "rh-resize-x",
|
|
1260
|
+
both: "rh-resize"
|
|
1261
|
+
};
|
|
1262
|
+
var helperStatusClasses2 = {
|
|
1263
|
+
default: "rh-text-text-muted",
|
|
1264
|
+
error: "rh-text-danger"
|
|
1265
|
+
};
|
|
1266
|
+
var labelWeightClasses2 = {
|
|
1267
|
+
normal: "rh-font-normal",
|
|
1268
|
+
medium: "rh-font-medium",
|
|
1269
|
+
semibold: "rh-font-semibold",
|
|
1270
|
+
bold: "rh-font-bold"
|
|
1271
|
+
};
|
|
1272
|
+
var getSubtitleClassName2 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1273
|
+
var TextArea = React10.forwardRef(function TextArea2({
|
|
1274
|
+
label,
|
|
1275
|
+
labelWeight = "medium",
|
|
1276
|
+
labelColor = "#080B12",
|
|
1277
|
+
subtitle,
|
|
1278
|
+
status = "default",
|
|
1279
|
+
size = "md",
|
|
1280
|
+
radius = "xs",
|
|
1281
|
+
helperText,
|
|
1282
|
+
rows = 3,
|
|
1283
|
+
resize = "vertical",
|
|
1284
|
+
disabled,
|
|
1285
|
+
className = "",
|
|
1286
|
+
wrapperClassName = "",
|
|
1287
|
+
borderColor,
|
|
1288
|
+
backgroundColor,
|
|
1289
|
+
borderWidth = "sm",
|
|
1290
|
+
id,
|
|
1291
|
+
...rest
|
|
1292
|
+
}, ref) {
|
|
1293
|
+
const generatedId = React10__default.default.useId();
|
|
1294
|
+
const textareaId = id || generatedId;
|
|
1295
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10__default.default.useState(false);
|
|
1296
|
+
const { onChange, ...textareaProps } = rest;
|
|
1297
|
+
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
1298
|
+
const containerStyle = {
|
|
1299
|
+
...borderColor ? { borderColor } : {},
|
|
1300
|
+
...!disabled && backgroundColor ? { backgroundColor } : {}
|
|
1301
|
+
};
|
|
1302
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-body", wrapperClassName].filter(Boolean).join(" "),
|
|
1306
|
+
children: [
|
|
1307
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: textareaId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1308
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1309
|
+
"span",
|
|
1310
|
+
{
|
|
1311
|
+
className: `rh-text-sm ${labelWeightClasses2[labelWeight]}`,
|
|
1312
|
+
style: { color: labelColor },
|
|
1313
|
+
children: label
|
|
1314
|
+
}
|
|
1315
|
+
),
|
|
1316
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName2(subtitle)}`, children: subtitle })
|
|
1317
|
+
] }),
|
|
1318
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1319
|
+
"div",
|
|
1320
|
+
{
|
|
1321
|
+
style: containerStyle,
|
|
1322
|
+
className: [
|
|
1323
|
+
"rh-flex",
|
|
1324
|
+
"rh-bg-surface rh-font-body",
|
|
1325
|
+
borderWidthClasses2[borderWidth],
|
|
1326
|
+
"rh-transition-colors rh-duration-150",
|
|
1327
|
+
statusClasses2[visualStatus],
|
|
1328
|
+
radiusClasses4[radius],
|
|
1329
|
+
sizeClasses4[size],
|
|
1330
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "",
|
|
1331
|
+
className
|
|
1332
|
+
].filter(Boolean).join(" "),
|
|
1333
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1334
|
+
"textarea",
|
|
1335
|
+
{
|
|
1336
|
+
ref,
|
|
1337
|
+
id: textareaId,
|
|
1338
|
+
rows,
|
|
1339
|
+
disabled,
|
|
1340
|
+
"aria-invalid": visualStatus === "error" || void 0,
|
|
1341
|
+
"aria-describedby": helperText ? `${textareaId}-helper` : void 0,
|
|
1342
|
+
className: [
|
|
1343
|
+
"rh-flex-1 rh-min-w-0 rh-w-full rh-bg-transparent rh-outline-none",
|
|
1344
|
+
"rh-text-text placeholder:rh-text-text-muted hover:placeholder:rh-text-text",
|
|
1345
|
+
resizeClasses[resize],
|
|
1346
|
+
disabled ? "rh-cursor-not-allowed" : ""
|
|
1347
|
+
].filter(Boolean).join(" "),
|
|
1348
|
+
onChange: (e) => {
|
|
1349
|
+
if (helperText) setIsHelperDismissed(true);
|
|
1350
|
+
onChange?.(e);
|
|
1351
|
+
},
|
|
1352
|
+
...textareaProps
|
|
1353
|
+
}
|
|
1354
|
+
)
|
|
1355
|
+
}
|
|
1356
|
+
),
|
|
1357
|
+
helperText && !isHelperDismissed && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1358
|
+
"span",
|
|
1359
|
+
{
|
|
1360
|
+
id: `${textareaId}-helper`,
|
|
1361
|
+
className: [
|
|
1362
|
+
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
1363
|
+
helperStatusClasses2[visualStatus]
|
|
1364
|
+
].join(" "),
|
|
1365
|
+
children: [
|
|
1366
|
+
/* @__PURE__ */ jsxRuntime.jsx(WarningCircleIcon, {}),
|
|
1367
|
+
helperText
|
|
1368
|
+
]
|
|
1369
|
+
}
|
|
1370
|
+
)
|
|
1371
|
+
]
|
|
1372
|
+
}
|
|
1373
|
+
);
|
|
1374
|
+
});
|
|
1375
|
+
var sizeClasses5 = {
|
|
1233
1376
|
sm: "rh-h-4 rh-w-4",
|
|
1234
1377
|
md: "rh-h-5 rh-w-5",
|
|
1235
1378
|
lg: "rh-h-6 rh-w-6"
|
|
@@ -1275,7 +1418,7 @@ var MinusIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1275
1418
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
1276
1419
|
}
|
|
1277
1420
|
);
|
|
1278
|
-
var Checkbox =
|
|
1421
|
+
var Checkbox = React10.forwardRef(function Checkbox2({
|
|
1279
1422
|
size = "md",
|
|
1280
1423
|
label,
|
|
1281
1424
|
indeterminate = false,
|
|
@@ -1287,10 +1430,10 @@ var Checkbox = React9.forwardRef(function Checkbox2({
|
|
|
1287
1430
|
onChange,
|
|
1288
1431
|
...rest
|
|
1289
1432
|
}, ref) {
|
|
1290
|
-
const innerRef =
|
|
1291
|
-
const inputId = id ||
|
|
1292
|
-
|
|
1293
|
-
|
|
1433
|
+
const innerRef = React10__default.default.useRef(null);
|
|
1434
|
+
const inputId = id || React10__default.default.useId();
|
|
1435
|
+
React10__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
1436
|
+
React10__default.default.useEffect(() => {
|
|
1294
1437
|
if (innerRef.current) {
|
|
1295
1438
|
innerRef.current.indeterminate = indeterminate;
|
|
1296
1439
|
}
|
|
@@ -1330,7 +1473,7 @@ var Checkbox = React9.forwardRef(function Checkbox2({
|
|
|
1330
1473
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1331
1474
|
"rh-border rh-border-border rh-rounded-xxs",
|
|
1332
1475
|
"rh-transition-colors rh-duration-150",
|
|
1333
|
-
|
|
1476
|
+
sizeClasses5[size],
|
|
1334
1477
|
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1335
1478
|
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1336
1479
|
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
@@ -1345,8 +1488,8 @@ var Checkbox = React9.forwardRef(function Checkbox2({
|
|
|
1345
1488
|
}
|
|
1346
1489
|
);
|
|
1347
1490
|
});
|
|
1348
|
-
var RadioGroupContext =
|
|
1349
|
-
var useRadioGroup = () =>
|
|
1491
|
+
var RadioGroupContext = React10.createContext(null);
|
|
1492
|
+
var useRadioGroup = () => React10.useContext(RadioGroupContext);
|
|
1350
1493
|
var labelSizeClasses2 = {
|
|
1351
1494
|
sm: "rh-text-sm",
|
|
1352
1495
|
md: "rh-text-sm",
|
|
@@ -1378,7 +1521,7 @@ var inputSizeClasses = {
|
|
|
1378
1521
|
md: "rh-w-5 rh-h-5",
|
|
1379
1522
|
lg: "rh-w-6 rh-h-6"
|
|
1380
1523
|
};
|
|
1381
|
-
var Radio =
|
|
1524
|
+
var Radio = React10.forwardRef(function Radio2({
|
|
1382
1525
|
size = "md",
|
|
1383
1526
|
label,
|
|
1384
1527
|
description,
|
|
@@ -1391,7 +1534,7 @@ var Radio = React9.forwardRef(function Radio2({
|
|
|
1391
1534
|
onChange,
|
|
1392
1535
|
...rest
|
|
1393
1536
|
}, ref) {
|
|
1394
|
-
const inputId = id ||
|
|
1537
|
+
const inputId = id || React10__default.default.useId();
|
|
1395
1538
|
const getAccentColor = () => {
|
|
1396
1539
|
if (isPresetColor3(color)) {
|
|
1397
1540
|
return `rgb(var(--rh-${color}))`;
|
|
@@ -1435,7 +1578,7 @@ var Radio = React9.forwardRef(function Radio2({
|
|
|
1435
1578
|
}
|
|
1436
1579
|
);
|
|
1437
1580
|
});
|
|
1438
|
-
var RadioOption =
|
|
1581
|
+
var RadioOption = React10.forwardRef(function RadioOption2({ value, size, color, disabled, ...rest }, ref) {
|
|
1439
1582
|
const group = useRadioGroup();
|
|
1440
1583
|
const mergedSize = size ?? group?.size ?? "md";
|
|
1441
1584
|
const mergedColor = color ?? group?.color ?? "primary";
|
|
@@ -1459,7 +1602,7 @@ var RadioOption = React9.forwardRef(function RadioOption2({ value, size, color,
|
|
|
1459
1602
|
}
|
|
1460
1603
|
);
|
|
1461
1604
|
});
|
|
1462
|
-
var RadioGroup =
|
|
1605
|
+
var RadioGroup = React10.forwardRef(function RadioGroup2({
|
|
1463
1606
|
children,
|
|
1464
1607
|
value,
|
|
1465
1608
|
defaultValue,
|
|
@@ -1473,8 +1616,8 @@ var RadioGroup = React9.forwardRef(function RadioGroup2({
|
|
|
1473
1616
|
className = "",
|
|
1474
1617
|
...rest
|
|
1475
1618
|
}, ref) {
|
|
1476
|
-
const [internalValue, setInternalValue] =
|
|
1477
|
-
const groupName = name ||
|
|
1619
|
+
const [internalValue, setInternalValue] = React10__default.default.useState(defaultValue);
|
|
1620
|
+
const groupName = name || React10__default.default.useId();
|
|
1478
1621
|
const currentValue = value ?? internalValue;
|
|
1479
1622
|
const handleChange = (newValue) => {
|
|
1480
1623
|
setInternalValue(newValue);
|
|
@@ -1509,16 +1652,16 @@ var RadioGroup = React9.forwardRef(function RadioGroup2({
|
|
|
1509
1652
|
}
|
|
1510
1653
|
);
|
|
1511
1654
|
});
|
|
1512
|
-
var
|
|
1655
|
+
var statusClasses3 = {
|
|
1513
1656
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200 ",
|
|
1514
1657
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100 "
|
|
1515
1658
|
};
|
|
1516
|
-
var
|
|
1659
|
+
var sizeClasses6 = {
|
|
1517
1660
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1518
1661
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1519
1662
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1520
1663
|
};
|
|
1521
|
-
var
|
|
1664
|
+
var radiusClasses5 = {
|
|
1522
1665
|
none: "rh-rounded-none",
|
|
1523
1666
|
xxs: "rh-rounded-xxs",
|
|
1524
1667
|
xs: "rh-rounded-xs",
|
|
@@ -1538,7 +1681,7 @@ var dropdownRadiusClasses = {
|
|
|
1538
1681
|
xl: "rh-rounded-xs",
|
|
1539
1682
|
full: "rh-rounded-xs"
|
|
1540
1683
|
};
|
|
1541
|
-
var
|
|
1684
|
+
var helperStatusClasses3 = {
|
|
1542
1685
|
default: "rh-text-text-muted",
|
|
1543
1686
|
error: "rh-text-danger"
|
|
1544
1687
|
};
|
|
@@ -1547,7 +1690,7 @@ var optionSizeClasses = {
|
|
|
1547
1690
|
md: "rh-px-input-x-md rh-py-2 rh-text-sm",
|
|
1548
1691
|
lg: "rh-px-input-x-lg rh-py-2.5 rh-text-base"
|
|
1549
1692
|
};
|
|
1550
|
-
var
|
|
1693
|
+
var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1551
1694
|
var ChevronIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1552
1695
|
"svg",
|
|
1553
1696
|
{
|
|
@@ -1603,7 +1746,7 @@ var RadioIcon = ({ isSelected }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
|
1603
1746
|
]
|
|
1604
1747
|
}
|
|
1605
1748
|
);
|
|
1606
|
-
var Select =
|
|
1749
|
+
var Select = React10.forwardRef(function Select2(props, ref) {
|
|
1607
1750
|
const {
|
|
1608
1751
|
options,
|
|
1609
1752
|
label,
|
|
@@ -1620,18 +1763,18 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1620
1763
|
multiple = false,
|
|
1621
1764
|
backgroundColor
|
|
1622
1765
|
} = props;
|
|
1623
|
-
const triggerId =
|
|
1624
|
-
const listboxId =
|
|
1625
|
-
const helperId =
|
|
1626
|
-
const [isOpen, setIsOpen] =
|
|
1627
|
-
const [activeIndex, setActiveIndex] =
|
|
1628
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
1629
|
-
|
|
1630
|
-
const wrapperRef =
|
|
1631
|
-
const innerRef =
|
|
1632
|
-
const listboxRef =
|
|
1633
|
-
|
|
1634
|
-
const [internalValue, setInternalValue] =
|
|
1766
|
+
const triggerId = React10__default.default.useId();
|
|
1767
|
+
const listboxId = React10__default.default.useId();
|
|
1768
|
+
const helperId = React10__default.default.useId();
|
|
1769
|
+
const [isOpen, setIsOpen] = React10__default.default.useState(false);
|
|
1770
|
+
const [activeIndex, setActiveIndex] = React10__default.default.useState(-1);
|
|
1771
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10__default.default.useState(false);
|
|
1772
|
+
React10__default.default.useRef({ query: "", lastAt: 0 });
|
|
1773
|
+
const wrapperRef = React10__default.default.useRef(null);
|
|
1774
|
+
const innerRef = React10__default.default.useRef(null);
|
|
1775
|
+
const listboxRef = React10__default.default.useRef(null);
|
|
1776
|
+
React10__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
1777
|
+
const [internalValue, setInternalValue] = React10__default.default.useState(() => {
|
|
1635
1778
|
if (props.defaultValue !== void 0) {
|
|
1636
1779
|
return Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];
|
|
1637
1780
|
}
|
|
@@ -1648,14 +1791,15 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1648
1791
|
if (!isControlled) setInternalValue(next);
|
|
1649
1792
|
props.onChange?.(next);
|
|
1650
1793
|
} else {
|
|
1651
|
-
const
|
|
1794
|
+
const isDeselecting = selectedValues.includes(optionValue);
|
|
1795
|
+
const next = isDeselecting ? [] : [optionValue];
|
|
1652
1796
|
if (!isControlled) setInternalValue(next);
|
|
1653
|
-
props.onChange?.(optionValue);
|
|
1797
|
+
props.onChange?.(isDeselecting ? "" : optionValue);
|
|
1654
1798
|
setIsOpen(false);
|
|
1655
1799
|
innerRef.current?.focus();
|
|
1656
1800
|
}
|
|
1657
1801
|
};
|
|
1658
|
-
const displayText =
|
|
1802
|
+
const displayText = React10__default.default.useMemo(() => {
|
|
1659
1803
|
if (selectedValues.length === 0) return null;
|
|
1660
1804
|
if (!multiple) {
|
|
1661
1805
|
return options.find((o) => o.value === selectedValues[0])?.label ?? null;
|
|
@@ -1665,7 +1809,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1665
1809
|
if (selectedLabels.length === 1) return selectedLabels[0];
|
|
1666
1810
|
return `${selectedLabels.length} selected`;
|
|
1667
1811
|
}, [selectedValues, options, multiple]);
|
|
1668
|
-
|
|
1812
|
+
React10__default.default.useEffect(() => {
|
|
1669
1813
|
if (!isOpen) return;
|
|
1670
1814
|
const handleClickOutside = (e) => {
|
|
1671
1815
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
@@ -1675,7 +1819,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1675
1819
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1676
1820
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1677
1821
|
}, [isOpen]);
|
|
1678
|
-
|
|
1822
|
+
React10__default.default.useEffect(() => {
|
|
1679
1823
|
if (!isOpen) return;
|
|
1680
1824
|
const handleEscape = (e) => {
|
|
1681
1825
|
if (e.key === "Escape") {
|
|
@@ -1686,7 +1830,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1686
1830
|
document.addEventListener("keydown", handleEscape);
|
|
1687
1831
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
1688
1832
|
}, [isOpen]);
|
|
1689
|
-
|
|
1833
|
+
React10__default.default.useEffect(() => {
|
|
1690
1834
|
if (!isOpen || activeIndex < 0) return;
|
|
1691
1835
|
const listbox = listboxRef.current;
|
|
1692
1836
|
if (!listbox) return;
|
|
@@ -1695,7 +1839,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1695
1839
|
activeEl.scrollIntoView({ block: "nearest" });
|
|
1696
1840
|
}
|
|
1697
1841
|
}, [activeIndex, isOpen]);
|
|
1698
|
-
|
|
1842
|
+
React10__default.default.useEffect(() => {
|
|
1699
1843
|
if (isOpen) {
|
|
1700
1844
|
const firstSelectedIdx = options.findIndex(
|
|
1701
1845
|
(o) => !o.disabled && selectedValues.includes(o.value)
|
|
@@ -1778,7 +1922,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1778
1922
|
children: [
|
|
1779
1923
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1780
1924
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
1781
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${
|
|
1925
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
|
|
1782
1926
|
] }),
|
|
1783
1927
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1784
1928
|
"button",
|
|
@@ -1804,9 +1948,9 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1804
1948
|
!backgroundColor && "rh-bg-surface",
|
|
1805
1949
|
"rh-transition-colors rh-duration-150",
|
|
1806
1950
|
"rh-text-left rh-w-full",
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1951
|
+
statusClasses3[visualStatus],
|
|
1952
|
+
radiusClasses5[radius],
|
|
1953
|
+
sizeClasses6[size],
|
|
1810
1954
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
1811
1955
|
className
|
|
1812
1956
|
].filter(Boolean).join(" "),
|
|
@@ -1903,7 +2047,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1903
2047
|
id: helperId,
|
|
1904
2048
|
className: [
|
|
1905
2049
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
1906
|
-
|
|
2050
|
+
helperStatusClasses3[visualStatus]
|
|
1907
2051
|
].join(" "),
|
|
1908
2052
|
children: [
|
|
1909
2053
|
/* @__PURE__ */ jsxRuntime.jsx(WarningCircleIcon, {}),
|
|
@@ -1949,16 +2093,16 @@ var MODE_OPTIONS = [
|
|
|
1949
2093
|
{ value: "month", label: "M\xEAs" },
|
|
1950
2094
|
{ value: "year", label: "Ano" }
|
|
1951
2095
|
];
|
|
1952
|
-
var
|
|
2096
|
+
var statusClasses4 = {
|
|
1953
2097
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1954
2098
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1955
2099
|
};
|
|
1956
|
-
var
|
|
2100
|
+
var sizeClasses7 = {
|
|
1957
2101
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1958
2102
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1959
2103
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1960
2104
|
};
|
|
1961
|
-
var
|
|
2105
|
+
var radiusClasses6 = {
|
|
1962
2106
|
none: "rh-rounded-none",
|
|
1963
2107
|
xxs: "rh-rounded-xxs",
|
|
1964
2108
|
xs: "rh-rounded-xs",
|
|
@@ -1978,11 +2122,11 @@ var dropdownRadiusClasses2 = {
|
|
|
1978
2122
|
xl: "rh-rounded-xs",
|
|
1979
2123
|
full: "rh-rounded-xs"
|
|
1980
2124
|
};
|
|
1981
|
-
var
|
|
2125
|
+
var helperStatusClasses4 = {
|
|
1982
2126
|
default: "rh-text-text-muted",
|
|
1983
2127
|
error: "rh-text-danger"
|
|
1984
2128
|
};
|
|
1985
|
-
var
|
|
2129
|
+
var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1986
2130
|
var ChevronIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1987
2131
|
"svg",
|
|
1988
2132
|
{
|
|
@@ -2044,7 +2188,7 @@ var EraserIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { widt
|
|
|
2044
2188
|
fill: "#374151"
|
|
2045
2189
|
}
|
|
2046
2190
|
) });
|
|
2047
|
-
var DateSelect =
|
|
2191
|
+
var DateSelect = React10.forwardRef(
|
|
2048
2192
|
function DateSelect2(props, ref) {
|
|
2049
2193
|
const {
|
|
2050
2194
|
label,
|
|
@@ -2062,38 +2206,38 @@ var DateSelect = React9.forwardRef(
|
|
|
2062
2206
|
backgroundColor,
|
|
2063
2207
|
modes
|
|
2064
2208
|
} = props;
|
|
2065
|
-
const triggerId =
|
|
2066
|
-
const helperId =
|
|
2067
|
-
const [isOpen, setIsOpen] =
|
|
2068
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
2069
|
-
const [dropdownAlign, setDropdownAlign] =
|
|
2070
|
-
const [internalValue, setInternalValue] =
|
|
2209
|
+
const triggerId = React10__default.default.useId();
|
|
2210
|
+
const helperId = React10__default.default.useId();
|
|
2211
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
2212
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10.useState(false);
|
|
2213
|
+
const [dropdownAlign, setDropdownAlign] = React10.useState("left");
|
|
2214
|
+
const [internalValue, setInternalValue] = React10.useState(
|
|
2071
2215
|
props.defaultValue ?? { mode: "day" }
|
|
2072
2216
|
);
|
|
2073
2217
|
const isControlled = props.value !== void 0;
|
|
2074
2218
|
const value = isControlled ? props.value ?? internalValue : internalValue;
|
|
2075
|
-
const availableModes =
|
|
2219
|
+
const availableModes = React10.useMemo(
|
|
2076
2220
|
() => modes && modes.length > 0 ? MODE_OPTIONS.filter((o) => modes.includes(o.value)) : MODE_OPTIONS,
|
|
2077
2221
|
[modes]
|
|
2078
2222
|
);
|
|
2079
2223
|
const defaultMode = availableModes[0]?.value ?? "day";
|
|
2080
|
-
const [activeMode, setActiveMode] =
|
|
2224
|
+
const [activeMode, setActiveMode] = React10.useState(
|
|
2081
2225
|
availableModes.some((o) => o.value === (value.mode ?? "day")) ? value.mode ?? "day" : defaultMode
|
|
2082
2226
|
);
|
|
2083
|
-
const [selectedYear, setSelectedYear] =
|
|
2084
|
-
const [selectedMonth, setSelectedMonth] =
|
|
2227
|
+
const [selectedYear, setSelectedYear] = React10.useState((/* @__PURE__ */ new Date()).getFullYear());
|
|
2228
|
+
const [selectedMonth, setSelectedMonth] = React10.useState((/* @__PURE__ */ new Date()).getMonth());
|
|
2085
2229
|
const rightMonth = selectedMonth === 11 ? 0 : selectedMonth + 1;
|
|
2086
2230
|
const rightYear = selectedMonth === 11 ? selectedYear + 1 : selectedYear;
|
|
2087
|
-
const [intervalStart, setIntervalStart] =
|
|
2088
|
-
const [intervalEnd, setIntervalEnd] =
|
|
2089
|
-
const [hoverDate, setHoverDate] =
|
|
2090
|
-
const [yearGridStart, setYearGridStart] =
|
|
2231
|
+
const [intervalStart, setIntervalStart] = React10.useState(value.startDate);
|
|
2232
|
+
const [intervalEnd, setIntervalEnd] = React10.useState(value.endDate);
|
|
2233
|
+
const [hoverDate, setHoverDate] = React10.useState();
|
|
2234
|
+
const [yearGridStart, setYearGridStart] = React10.useState(
|
|
2091
2235
|
Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12
|
|
2092
2236
|
);
|
|
2093
|
-
const wrapperRef =
|
|
2094
|
-
const innerRef =
|
|
2095
|
-
const dropdownRef =
|
|
2096
|
-
|
|
2237
|
+
const wrapperRef = React10.useRef(null);
|
|
2238
|
+
const innerRef = React10.useRef(null);
|
|
2239
|
+
const dropdownRef = React10.useRef(null);
|
|
2240
|
+
React10__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
2097
2241
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2098
2242
|
const yearStart = startYear ?? currentYear - 10;
|
|
2099
2243
|
const yearEnd = endYear ?? currentYear + 10;
|
|
@@ -2141,7 +2285,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2141
2285
|
if (!isControlled) setInternalValue(newValue);
|
|
2142
2286
|
props.onChange?.(newValue);
|
|
2143
2287
|
};
|
|
2144
|
-
const displayText =
|
|
2288
|
+
const displayText = React10.useMemo(() => {
|
|
2145
2289
|
if (value.mode === "year" && value.year) return value.year.toString();
|
|
2146
2290
|
if (value.mode === "month" && value.year != null)
|
|
2147
2291
|
return `${MONTHS_SHORT[value.month || 0]} ${value.year}`;
|
|
@@ -2152,7 +2296,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2152
2296
|
}
|
|
2153
2297
|
return null;
|
|
2154
2298
|
}, [value]);
|
|
2155
|
-
|
|
2299
|
+
React10.useEffect(() => {
|
|
2156
2300
|
if (!isOpen) return;
|
|
2157
2301
|
const handleClickOutside = (e) => {
|
|
2158
2302
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
@@ -2162,7 +2306,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2162
2306
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2163
2307
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2164
2308
|
}, [isOpen]);
|
|
2165
|
-
|
|
2309
|
+
React10.useEffect(() => {
|
|
2166
2310
|
if (!isOpen) return;
|
|
2167
2311
|
const handleEscape = (e) => {
|
|
2168
2312
|
if (e.key === "Escape") {
|
|
@@ -2173,7 +2317,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2173
2317
|
document.addEventListener("keydown", handleEscape);
|
|
2174
2318
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
2175
2319
|
}, [isOpen]);
|
|
2176
|
-
|
|
2320
|
+
React10.useEffect(() => {
|
|
2177
2321
|
if (!isOpen || !innerRef.current || !dropdownRef.current) return;
|
|
2178
2322
|
const triggerRect = innerRef.current.getBoundingClientRect();
|
|
2179
2323
|
const dropdownWidth = activeMode === "interval" ? 720 : 385;
|
|
@@ -2372,7 +2516,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2372
2516
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2373
2517
|
}
|
|
2374
2518
|
),
|
|
2375
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2519
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1 rh-justify-items-center", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2376
2520
|
"div",
|
|
2377
2521
|
{
|
|
2378
2522
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2417,7 +2561,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2417
2561
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2418
2562
|
}
|
|
2419
2563
|
),
|
|
2420
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2564
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1 rh-justify-items-center", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2421
2565
|
"div",
|
|
2422
2566
|
{
|
|
2423
2567
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2499,7 +2643,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2499
2643
|
!isStart && !isEnd && !inRange && !inHoverRange && !isHoverEnd ? "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]" : ""
|
|
2500
2644
|
].join(" ");
|
|
2501
2645
|
};
|
|
2502
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-text-center", children: [
|
|
2646
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-justify-items-center rh-text-center", children: [
|
|
2503
2647
|
prevDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2504
2648
|
"div",
|
|
2505
2649
|
{
|
|
@@ -2584,7 +2728,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2584
2728
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2585
2729
|
}
|
|
2586
2730
|
),
|
|
2587
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2731
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1 rh-justify-items-center", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2588
2732
|
"div",
|
|
2589
2733
|
{
|
|
2590
2734
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2625,7 +2769,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2625
2769
|
const totalCells = firstDay + daysInMonth;
|
|
2626
2770
|
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2627
2771
|
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2628
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
2772
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-justify-items-center", children: [
|
|
2629
2773
|
prevDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2630
2774
|
"div",
|
|
2631
2775
|
{
|
|
@@ -2636,13 +2780,18 @@ var DateSelect = React9.forwardRef(
|
|
|
2636
2780
|
)),
|
|
2637
2781
|
days.map((day) => {
|
|
2638
2782
|
const isSelected = value.mode === "day" && value.year === calYear && value.month === calMonth && value.day === day;
|
|
2783
|
+
const today = /* @__PURE__ */ new Date();
|
|
2784
|
+
const isCurrentDay = today.getFullYear() === calYear && today.getMonth() === calMonth && today.getDate() === day;
|
|
2639
2785
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2640
2786
|
"button",
|
|
2641
2787
|
{
|
|
2642
2788
|
onClick: () => handleChange({ mode: "day", year: calYear, month: calMonth, day }),
|
|
2789
|
+
style: {
|
|
2790
|
+
borderColor: !isSelected && isCurrentDay ? "#15607A" : "transparent"
|
|
2791
|
+
},
|
|
2643
2792
|
className: [
|
|
2644
|
-
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-
|
|
2645
|
-
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text
|
|
2793
|
+
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-full rh-border rh-transition-colors rh-duration-150",
|
|
2794
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text rh-bg-transparent hover:rh-bg-[#D1D5DB]"
|
|
2646
2795
|
].join(" "),
|
|
2647
2796
|
children: day
|
|
2648
2797
|
},
|
|
@@ -2667,7 +2816,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2667
2816
|
children: [
|
|
2668
2817
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2669
2818
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
2670
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${
|
|
2819
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
|
|
2671
2820
|
] }),
|
|
2672
2821
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2673
2822
|
"button",
|
|
@@ -2691,9 +2840,9 @@ var DateSelect = React9.forwardRef(
|
|
|
2691
2840
|
!backgroundColor && "rh-bg-surface",
|
|
2692
2841
|
"rh-transition-colors rh-duration-150",
|
|
2693
2842
|
"rh-text-left rh-w-full",
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2843
|
+
statusClasses4[visualStatus],
|
|
2844
|
+
radiusClasses6[radius],
|
|
2845
|
+
sizeClasses7[size],
|
|
2697
2846
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2698
2847
|
className
|
|
2699
2848
|
].filter(Boolean).join(" "),
|
|
@@ -2747,7 +2896,7 @@ var DateSelect = React9.forwardRef(
|
|
|
2747
2896
|
id: helperId,
|
|
2748
2897
|
className: [
|
|
2749
2898
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2750
|
-
|
|
2899
|
+
helperStatusClasses4[visualStatus]
|
|
2751
2900
|
].join(" "),
|
|
2752
2901
|
children: [
|
|
2753
2902
|
/* @__PURE__ */ jsxRuntime.jsx(WarningCircleIcon, {}),
|
|
@@ -2768,16 +2917,16 @@ var CLOCK_HOURS_INNER = [0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
|
|
2768
2917
|
var CLOCK_MINUTES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
2769
2918
|
var pad = (n) => String(n).padStart(2, "0");
|
|
2770
2919
|
var clampClockPart = (value, max) => Math.min(max, Math.max(0, value));
|
|
2771
|
-
var
|
|
2920
|
+
var statusClasses5 = {
|
|
2772
2921
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
2773
2922
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
2774
2923
|
};
|
|
2775
|
-
var
|
|
2924
|
+
var sizeClasses8 = {
|
|
2776
2925
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
2777
2926
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
2778
2927
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
2779
2928
|
};
|
|
2780
|
-
var
|
|
2929
|
+
var radiusClasses7 = {
|
|
2781
2930
|
none: "rh-rounded-none",
|
|
2782
2931
|
xxs: "rh-rounded-xxs",
|
|
2783
2932
|
xs: "rh-rounded-xs",
|
|
@@ -2787,11 +2936,11 @@ var radiusClasses6 = {
|
|
|
2787
2936
|
xl: "rh-rounded-xl",
|
|
2788
2937
|
full: "rh-rounded-full"
|
|
2789
2938
|
};
|
|
2790
|
-
var
|
|
2939
|
+
var helperStatusClasses5 = {
|
|
2791
2940
|
default: "rh-text-text-muted",
|
|
2792
2941
|
error: "rh-text-danger"
|
|
2793
2942
|
};
|
|
2794
|
-
var
|
|
2943
|
+
var getSubtitleClassName5 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
2795
2944
|
var ClockIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2796
2945
|
"svg",
|
|
2797
2946
|
{
|
|
@@ -2859,7 +3008,7 @@ function getRehagroPortalStyle(source) {
|
|
|
2859
3008
|
}
|
|
2860
3009
|
return variables;
|
|
2861
3010
|
}
|
|
2862
|
-
var TimePicker =
|
|
3011
|
+
var TimePicker = React10.forwardRef(
|
|
2863
3012
|
function TimePicker2(props, ref) {
|
|
2864
3013
|
const {
|
|
2865
3014
|
label,
|
|
@@ -2875,29 +3024,29 @@ var TimePicker = React9.forwardRef(
|
|
|
2875
3024
|
backgroundColor,
|
|
2876
3025
|
presentation = "dropdown"
|
|
2877
3026
|
} = props;
|
|
2878
|
-
const triggerId =
|
|
2879
|
-
const helperId =
|
|
3027
|
+
const triggerId = React10__default.default.useId();
|
|
3028
|
+
const helperId = React10__default.default.useId();
|
|
2880
3029
|
const isControlled = props.value !== void 0;
|
|
2881
|
-
const [internalValue, setInternalValue] =
|
|
3030
|
+
const [internalValue, setInternalValue] = React10.useState(
|
|
2882
3031
|
props.defaultValue ?? null
|
|
2883
3032
|
);
|
|
2884
3033
|
const committedValue = isControlled ? props.value ?? null : internalValue;
|
|
2885
|
-
const [isOpen, setIsOpen] =
|
|
2886
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
2887
|
-
const [dropdownAlign, setDropdownAlign] =
|
|
2888
|
-
const [clockStep, setClockStep] =
|
|
2889
|
-
const [isManualClockInput, setIsManualClockInput] =
|
|
2890
|
-
const [hasPendingValue, setHasPendingValue] =
|
|
2891
|
-
const [pendingHour, setPendingHour] =
|
|
2892
|
-
const [pendingMinute, setPendingMinute] =
|
|
2893
|
-
const wrapperRef =
|
|
2894
|
-
const innerRef =
|
|
2895
|
-
const dropdownRef =
|
|
2896
|
-
const hourColRef =
|
|
2897
|
-
const minuteColRef =
|
|
2898
|
-
|
|
3034
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
3035
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10.useState(false);
|
|
3036
|
+
const [dropdownAlign, setDropdownAlign] = React10.useState("left");
|
|
3037
|
+
const [clockStep, setClockStep] = React10.useState("hour");
|
|
3038
|
+
const [isManualClockInput, setIsManualClockInput] = React10.useState(false);
|
|
3039
|
+
const [hasPendingValue, setHasPendingValue] = React10.useState(committedValue != null);
|
|
3040
|
+
const [pendingHour, setPendingHour] = React10.useState(committedValue?.hour ?? 0);
|
|
3041
|
+
const [pendingMinute, setPendingMinute] = React10.useState(committedValue?.minute ?? 0);
|
|
3042
|
+
const wrapperRef = React10.useRef(null);
|
|
3043
|
+
const innerRef = React10.useRef(null);
|
|
3044
|
+
const dropdownRef = React10.useRef(null);
|
|
3045
|
+
const hourColRef = React10.useRef(null);
|
|
3046
|
+
const minuteColRef = React10.useRef(null);
|
|
3047
|
+
React10__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
2899
3048
|
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
2900
|
-
|
|
3049
|
+
React10.useEffect(() => {
|
|
2901
3050
|
if (!isOpen) return;
|
|
2902
3051
|
const h = committedValue?.hour ?? 0;
|
|
2903
3052
|
const m = committedValue?.minute ?? 0;
|
|
@@ -2913,13 +3062,13 @@ var TimePicker = React9.forwardRef(
|
|
|
2913
3062
|
});
|
|
2914
3063
|
}
|
|
2915
3064
|
}, [isOpen]);
|
|
2916
|
-
|
|
3065
|
+
React10.useEffect(() => {
|
|
2917
3066
|
if (!isOpen || presentation !== "dropdown" || !innerRef.current) return;
|
|
2918
3067
|
const rect = innerRef.current.getBoundingClientRect();
|
|
2919
3068
|
const dropdownW = 240;
|
|
2920
3069
|
setDropdownAlign(window.innerWidth - rect.right >= dropdownW ? "left" : "right");
|
|
2921
3070
|
}, [isOpen, presentation]);
|
|
2922
|
-
|
|
3071
|
+
React10.useEffect(() => {
|
|
2923
3072
|
if (!isOpen || presentation !== "dropdown") return;
|
|
2924
3073
|
const handler = (e) => {
|
|
2925
3074
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
@@ -2929,7 +3078,7 @@ var TimePicker = React9.forwardRef(
|
|
|
2929
3078
|
document.addEventListener("mousedown", handler);
|
|
2930
3079
|
return () => document.removeEventListener("mousedown", handler);
|
|
2931
3080
|
}, [isOpen, presentation]);
|
|
2932
|
-
|
|
3081
|
+
React10.useEffect(() => {
|
|
2933
3082
|
if (!isOpen) return;
|
|
2934
3083
|
const handler = (e) => {
|
|
2935
3084
|
if (e.key === "Escape") {
|
|
@@ -2940,7 +3089,7 @@ var TimePicker = React9.forwardRef(
|
|
|
2940
3089
|
document.addEventListener("keydown", handler);
|
|
2941
3090
|
return () => document.removeEventListener("keydown", handler);
|
|
2942
3091
|
}, [isOpen]);
|
|
2943
|
-
const commit =
|
|
3092
|
+
const commit = React10.useCallback(
|
|
2944
3093
|
(hour, minute) => {
|
|
2945
3094
|
const newValue = { hour, minute };
|
|
2946
3095
|
if (helperText) setIsHelperDismissed(true);
|
|
@@ -2950,7 +3099,7 @@ var TimePicker = React9.forwardRef(
|
|
|
2950
3099
|
},
|
|
2951
3100
|
[helperText, isControlled, props]
|
|
2952
3101
|
);
|
|
2953
|
-
const handleClear =
|
|
3102
|
+
const handleClear = React10.useCallback(() => {
|
|
2954
3103
|
setPendingHour(0);
|
|
2955
3104
|
setPendingMinute(0);
|
|
2956
3105
|
if (!isControlled) setInternalValue(null);
|
|
@@ -3028,7 +3177,7 @@ var TimePicker = React9.forwardRef(
|
|
|
3028
3177
|
children: [
|
|
3029
3178
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3030
3179
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
3031
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${
|
|
3180
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName5(subtitle)}`, children: subtitle })
|
|
3032
3181
|
] }),
|
|
3033
3182
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3034
3183
|
"button",
|
|
@@ -3052,9 +3201,9 @@ var TimePicker = React9.forwardRef(
|
|
|
3052
3201
|
!backgroundColor && "rh-bg-surface",
|
|
3053
3202
|
"rh-transition-colors rh-duration-150",
|
|
3054
3203
|
"rh-text-left rh-w-full",
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3204
|
+
statusClasses5[visualStatus],
|
|
3205
|
+
radiusClasses7[radius],
|
|
3206
|
+
sizeClasses8[size],
|
|
3058
3207
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3059
3208
|
className
|
|
3060
3209
|
].filter(Boolean).join(" "),
|
|
@@ -3304,7 +3453,7 @@ var TimePicker = React9.forwardRef(
|
|
|
3304
3453
|
id: helperId,
|
|
3305
3454
|
className: [
|
|
3306
3455
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3307
|
-
|
|
3456
|
+
helperStatusClasses5[visualStatus]
|
|
3308
3457
|
].join(" "),
|
|
3309
3458
|
children: [
|
|
3310
3459
|
/* @__PURE__ */ jsxRuntime.jsx(WarningCircleIcon, {}),
|
|
@@ -3327,7 +3476,7 @@ var arrowVariantClasses = {
|
|
|
3327
3476
|
default: "rh-border-primary/20 rh-bg-primary/10",
|
|
3328
3477
|
dark: "rh-bg-primary"
|
|
3329
3478
|
};
|
|
3330
|
-
var
|
|
3479
|
+
var sizeClasses9 = {
|
|
3331
3480
|
sm: "rh-px-3 rh-py-1.5 rh-text-xs",
|
|
3332
3481
|
md: "rh-px-4 rh-py-3 rh-text-sm"
|
|
3333
3482
|
};
|
|
@@ -3359,7 +3508,7 @@ var arrowPlacementClasses = {
|
|
|
3359
3508
|
"right-start": "rh-left-0 rh-top-3 rh--translate-x-1/2 rh-rotate-45",
|
|
3360
3509
|
"right-end": "rh-left-0 rh-bottom-3 rh--translate-x-1/2 rh-rotate-45"
|
|
3361
3510
|
};
|
|
3362
|
-
var Tooltip =
|
|
3511
|
+
var Tooltip = React10.forwardRef(
|
|
3363
3512
|
function Tooltip2({
|
|
3364
3513
|
title,
|
|
3365
3514
|
description,
|
|
@@ -3375,12 +3524,12 @@ var Tooltip = React9.forwardRef(
|
|
|
3375
3524
|
children,
|
|
3376
3525
|
className = ""
|
|
3377
3526
|
}, ref) {
|
|
3378
|
-
const [internalOpen, setInternalOpen] =
|
|
3379
|
-
const enterTimerRef =
|
|
3380
|
-
const leaveTimerRef =
|
|
3527
|
+
const [internalOpen, setInternalOpen] = React10.useState(false);
|
|
3528
|
+
const enterTimerRef = React10.useRef(null);
|
|
3529
|
+
const leaveTimerRef = React10.useRef(null);
|
|
3381
3530
|
const isControlled = controlledOpen !== void 0;
|
|
3382
3531
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
3383
|
-
const setOpen =
|
|
3532
|
+
const setOpen = React10.useCallback(
|
|
3384
3533
|
(value) => {
|
|
3385
3534
|
if (!isControlled) {
|
|
3386
3535
|
setInternalOpen(value);
|
|
@@ -3389,7 +3538,7 @@ var Tooltip = React9.forwardRef(
|
|
|
3389
3538
|
},
|
|
3390
3539
|
[isControlled, onOpenChange]
|
|
3391
3540
|
);
|
|
3392
|
-
const clearTimers =
|
|
3541
|
+
const clearTimers = React10.useCallback(() => {
|
|
3393
3542
|
if (enterTimerRef.current) {
|
|
3394
3543
|
clearTimeout(enterTimerRef.current);
|
|
3395
3544
|
enterTimerRef.current = null;
|
|
@@ -3399,27 +3548,27 @@ var Tooltip = React9.forwardRef(
|
|
|
3399
3548
|
leaveTimerRef.current = null;
|
|
3400
3549
|
}
|
|
3401
3550
|
}, []);
|
|
3402
|
-
const handleEnter =
|
|
3551
|
+
const handleEnter = React10.useCallback(() => {
|
|
3403
3552
|
clearTimers();
|
|
3404
3553
|
enterTimerRef.current = setTimeout(() => {
|
|
3405
3554
|
setOpen(true);
|
|
3406
3555
|
}, enterDelay);
|
|
3407
3556
|
}, [clearTimers, enterDelay, setOpen]);
|
|
3408
|
-
const handleLeave =
|
|
3557
|
+
const handleLeave = React10.useCallback(() => {
|
|
3409
3558
|
clearTimers();
|
|
3410
3559
|
leaveTimerRef.current = setTimeout(() => {
|
|
3411
3560
|
setOpen(false);
|
|
3412
3561
|
}, leaveDelay);
|
|
3413
3562
|
}, [clearTimers, leaveDelay, setOpen]);
|
|
3414
|
-
const handleClose =
|
|
3563
|
+
const handleClose = React10.useCallback(() => {
|
|
3415
3564
|
clearTimers();
|
|
3416
3565
|
setOpen(false);
|
|
3417
3566
|
}, [clearTimers, setOpen]);
|
|
3418
|
-
|
|
3567
|
+
React10.useEffect(() => {
|
|
3419
3568
|
return () => clearTimers();
|
|
3420
3569
|
}, [clearTimers]);
|
|
3421
|
-
const triggerChild =
|
|
3422
|
-
const triggerElement =
|
|
3570
|
+
const triggerChild = React10__default.default.Children.only(children);
|
|
3571
|
+
const triggerElement = React10__default.default.cloneElement(triggerChild, {
|
|
3423
3572
|
onMouseEnter: (e) => {
|
|
3424
3573
|
handleEnter();
|
|
3425
3574
|
triggerChild.props.onMouseEnter?.(e);
|
|
@@ -3458,7 +3607,7 @@ var Tooltip = React9.forwardRef(
|
|
|
3458
3607
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
3459
3608
|
tooltipPlacementClasses[placement],
|
|
3460
3609
|
variantClasses[variant],
|
|
3461
|
-
|
|
3610
|
+
sizeClasses9[size],
|
|
3462
3611
|
className
|
|
3463
3612
|
].filter(Boolean).join(" "),
|
|
3464
3613
|
children: [
|
|
@@ -3559,7 +3708,7 @@ function getAvatarColors(name) {
|
|
|
3559
3708
|
const index = hash % AVATAR_COLORS.length;
|
|
3560
3709
|
return AVATAR_COLORS[index];
|
|
3561
3710
|
}
|
|
3562
|
-
var
|
|
3711
|
+
var sizeClasses10 = {
|
|
3563
3712
|
sm: "rh-w-8 rh-h-8 rh-text-xs",
|
|
3564
3713
|
md: "rh-w-10 rh-h-10 rh-text-sm",
|
|
3565
3714
|
lg: "rh-w-12 rh-h-12 rh-text-base",
|
|
@@ -3575,10 +3724,10 @@ var variantClasses2 = {
|
|
|
3575
3724
|
circle: "rh-rounded-full",
|
|
3576
3725
|
square: "rh-rounded-sm"
|
|
3577
3726
|
};
|
|
3578
|
-
var Avatar =
|
|
3579
|
-
const [imgError, setImgError] =
|
|
3727
|
+
var Avatar = React10.forwardRef(function Avatar2({ src, alt = "", initials, size = "md", variant = "circle", colorFromName = false, className = "", style, ...rest }, ref) {
|
|
3728
|
+
const [imgError, setImgError] = React10.useState(false);
|
|
3580
3729
|
const showImage = src && !imgError;
|
|
3581
|
-
const avatarColors =
|
|
3730
|
+
const avatarColors = React10.useMemo(() => {
|
|
3582
3731
|
if (!colorFromName) return null;
|
|
3583
3732
|
const name = initials || alt || "";
|
|
3584
3733
|
return name ? getAvatarColors(name) : null;
|
|
@@ -3594,7 +3743,7 @@ var Avatar = React9.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
3594
3743
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
3595
3744
|
avatarColors ? "" : "rh-bg-primary rh-text-surface",
|
|
3596
3745
|
"rh-font-display rh-font-medium rh-select-none",
|
|
3597
|
-
|
|
3746
|
+
sizeClasses10[size],
|
|
3598
3747
|
variantClasses2[variant],
|
|
3599
3748
|
className
|
|
3600
3749
|
].filter(Boolean).join(" "),
|
|
@@ -3661,7 +3810,7 @@ var hoverInactivePresetClasses = {
|
|
|
3661
3810
|
info: "hover:rh-bg-info/20 hover:rh-border-info/50",
|
|
3662
3811
|
neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
|
|
3663
3812
|
};
|
|
3664
|
-
var
|
|
3813
|
+
var sizeClasses11 = {
|
|
3665
3814
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
3666
3815
|
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
3667
3816
|
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
@@ -3676,7 +3825,7 @@ function getCustomColorStyles(color, active) {
|
|
|
3676
3825
|
color
|
|
3677
3826
|
};
|
|
3678
3827
|
}
|
|
3679
|
-
var Tag =
|
|
3828
|
+
var Tag = React10.forwardRef(function Tag2({
|
|
3680
3829
|
color = "primary",
|
|
3681
3830
|
size = "md",
|
|
3682
3831
|
active = false,
|
|
@@ -3708,7 +3857,7 @@ var Tag = React9.forwardRef(function Tag2({
|
|
|
3708
3857
|
"rh-transition-colors rh-duration-150",
|
|
3709
3858
|
"rh-cursor-pointer",
|
|
3710
3859
|
clickable ? "rh-cursor-pointer" : "",
|
|
3711
|
-
|
|
3860
|
+
sizeClasses11[size],
|
|
3712
3861
|
colorClasses3,
|
|
3713
3862
|
hoverClasses,
|
|
3714
3863
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -3725,16 +3874,16 @@ var Tag = React9.forwardRef(function Tag2({
|
|
|
3725
3874
|
}
|
|
3726
3875
|
);
|
|
3727
3876
|
});
|
|
3728
|
-
var
|
|
3877
|
+
var statusClasses6 = {
|
|
3729
3878
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
3730
3879
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
3731
3880
|
};
|
|
3732
|
-
var
|
|
3881
|
+
var sizeClasses12 = {
|
|
3733
3882
|
sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
|
|
3734
3883
|
md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
|
|
3735
3884
|
lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
|
|
3736
3885
|
};
|
|
3737
|
-
var
|
|
3886
|
+
var radiusClasses8 = {
|
|
3738
3887
|
none: "rh-rounded-none",
|
|
3739
3888
|
xxs: "rh-rounded-xxs",
|
|
3740
3889
|
xs: "rh-rounded-xs",
|
|
@@ -3744,7 +3893,7 @@ var radiusClasses7 = {
|
|
|
3744
3893
|
xl: "rh-rounded-xl",
|
|
3745
3894
|
full: "rh-rounded-full"
|
|
3746
3895
|
};
|
|
3747
|
-
var
|
|
3896
|
+
var helperStatusClasses6 = {
|
|
3748
3897
|
default: "rh-text-text-muted",
|
|
3749
3898
|
error: "rh-text-danger"
|
|
3750
3899
|
};
|
|
@@ -3763,8 +3912,8 @@ var addButtonSizeClasses = {
|
|
|
3763
3912
|
md: "rh-w-5 rh-h-5",
|
|
3764
3913
|
lg: "rh-w-5 rh-h-5"
|
|
3765
3914
|
};
|
|
3766
|
-
var
|
|
3767
|
-
var TagInput =
|
|
3915
|
+
var getSubtitleClassName6 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
3916
|
+
var TagInput = React10.forwardRef(function TagInput2({
|
|
3768
3917
|
label,
|
|
3769
3918
|
subtitle,
|
|
3770
3919
|
options = [],
|
|
@@ -3779,10 +3928,10 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
3779
3928
|
className = "",
|
|
3780
3929
|
wrapperClassName = ""
|
|
3781
3930
|
}, ref) {
|
|
3782
|
-
const inputId =
|
|
3783
|
-
const [isOpen, setIsOpen] =
|
|
3784
|
-
const containerRef =
|
|
3785
|
-
|
|
3931
|
+
const inputId = React10__default.default.useId();
|
|
3932
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
3933
|
+
const containerRef = React10.useRef(null);
|
|
3934
|
+
React10.useEffect(() => {
|
|
3786
3935
|
const handleClickOutside = (event) => {
|
|
3787
3936
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
3788
3937
|
setIsOpen(false);
|
|
@@ -3820,7 +3969,7 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
3820
3969
|
children: [
|
|
3821
3970
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3822
3971
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
|
|
3823
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${
|
|
3972
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName6(subtitle)}`, children: subtitle })
|
|
3824
3973
|
] }),
|
|
3825
3974
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3826
3975
|
"div",
|
|
@@ -3830,9 +3979,9 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
3830
3979
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
3831
3980
|
"rh-border rh-bg-surface rh-font-body",
|
|
3832
3981
|
"rh-transition-colors rh-duration-150",
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3982
|
+
statusClasses6[status],
|
|
3983
|
+
radiusClasses8[radius],
|
|
3984
|
+
sizeClasses12[size],
|
|
3836
3985
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3837
3986
|
className
|
|
3838
3987
|
].filter(Boolean).join(" "),
|
|
@@ -3995,7 +4144,7 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
3995
4144
|
id: `${inputId}-helper`,
|
|
3996
4145
|
className: [
|
|
3997
4146
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3998
|
-
|
|
4147
|
+
helperStatusClasses6[status]
|
|
3999
4148
|
].join(" "),
|
|
4000
4149
|
children: helperText
|
|
4001
4150
|
}
|
|
@@ -4015,7 +4164,7 @@ function resolveThickness(thickness) {
|
|
|
4015
4164
|
if (typeof thickness === "number") return thickness;
|
|
4016
4165
|
return THICKNESS_MAP[thickness];
|
|
4017
4166
|
}
|
|
4018
|
-
var ProgressBar =
|
|
4167
|
+
var ProgressBar = React10.forwardRef(function ProgressBar2({
|
|
4019
4168
|
value,
|
|
4020
4169
|
label,
|
|
4021
4170
|
variant = "inline",
|
|
@@ -4102,12 +4251,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
4102
4251
|
"info"
|
|
4103
4252
|
]);
|
|
4104
4253
|
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
4105
|
-
var
|
|
4254
|
+
var sizeClasses13 = {
|
|
4106
4255
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
4107
4256
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
4108
4257
|
lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
|
|
4109
4258
|
};
|
|
4110
|
-
var
|
|
4259
|
+
var radiusClasses9 = {
|
|
4111
4260
|
none: "rh-rounded-none",
|
|
4112
4261
|
xs: "rh-rounded-xs",
|
|
4113
4262
|
sm: "rh-rounded-sm",
|
|
@@ -4140,8 +4289,8 @@ function ToggleGroupInner({
|
|
|
4140
4289
|
className: [
|
|
4141
4290
|
"rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
|
|
4142
4291
|
"rh-p-1 rh-gap-0.5",
|
|
4143
|
-
|
|
4144
|
-
|
|
4292
|
+
radiusClasses9[radius],
|
|
4293
|
+
sizeClasses13[size].container,
|
|
4145
4294
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
|
|
4146
4295
|
className
|
|
4147
4296
|
].filter(Boolean).join(" "),
|
|
@@ -4163,8 +4312,8 @@ function ToggleGroupInner({
|
|
|
4163
4312
|
"rh-border-0 rh-font-display rh-font-medium",
|
|
4164
4313
|
"rh-transition-all rh-duration-150",
|
|
4165
4314
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
|
|
4166
|
-
|
|
4167
|
-
|
|
4315
|
+
radiusClasses9[radius],
|
|
4316
|
+
sizeClasses13[size].button,
|
|
4168
4317
|
isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
|
|
4169
4318
|
!isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
|
|
4170
4319
|
isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
|
|
@@ -4181,13 +4330,13 @@ function ToggleGroupInner({
|
|
|
4181
4330
|
}
|
|
4182
4331
|
);
|
|
4183
4332
|
}
|
|
4184
|
-
var ToggleGroup =
|
|
4333
|
+
var ToggleGroup = React10.forwardRef(ToggleGroupInner);
|
|
4185
4334
|
var variantClasses3 = {
|
|
4186
4335
|
elevated: "rh-bg-surface rh-shadow-md rh-border-0",
|
|
4187
4336
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
4188
4337
|
filled: "rh-bg-background rh-border-0 rh-shadow-none"
|
|
4189
4338
|
};
|
|
4190
|
-
var
|
|
4339
|
+
var radiusClasses10 = {
|
|
4191
4340
|
none: "rh-rounded-none",
|
|
4192
4341
|
xs: "rh-rounded-xs",
|
|
4193
4342
|
sm: "rh-rounded-sm",
|
|
@@ -4201,7 +4350,7 @@ var paddingClasses = {
|
|
|
4201
4350
|
md: "rh-p-4",
|
|
4202
4351
|
lg: "rh-p-6"
|
|
4203
4352
|
};
|
|
4204
|
-
var CardRoot =
|
|
4353
|
+
var CardRoot = React10.forwardRef(function Card({
|
|
4205
4354
|
variant = "outlined",
|
|
4206
4355
|
radius = "sm",
|
|
4207
4356
|
padding = "md",
|
|
@@ -4222,7 +4371,7 @@ var CardRoot = React9.forwardRef(function Card({
|
|
|
4222
4371
|
className: [
|
|
4223
4372
|
"rh-font-body rh-transition-all rh-duration-150",
|
|
4224
4373
|
variantClasses3[variant],
|
|
4225
|
-
|
|
4374
|
+
radiusClasses10[radius],
|
|
4226
4375
|
paddingClasses[padding],
|
|
4227
4376
|
isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
|
|
4228
4377
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -4233,7 +4382,7 @@ var CardRoot = React9.forwardRef(function Card({
|
|
|
4233
4382
|
}
|
|
4234
4383
|
);
|
|
4235
4384
|
});
|
|
4236
|
-
var CardHeader =
|
|
4385
|
+
var CardHeader = React10.forwardRef(function CardHeader2({ className = "", children, ...rest }, ref) {
|
|
4237
4386
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4238
4387
|
"div",
|
|
4239
4388
|
{
|
|
@@ -4244,10 +4393,10 @@ var CardHeader = React9.forwardRef(function CardHeader2({ className = "", childr
|
|
|
4244
4393
|
}
|
|
4245
4394
|
);
|
|
4246
4395
|
});
|
|
4247
|
-
var CardContent =
|
|
4396
|
+
var CardContent = React10.forwardRef(function CardContent2({ className = "", children, ...rest }, ref) {
|
|
4248
4397
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: ["rh-mt-2", className].filter(Boolean).join(" "), ...rest, children });
|
|
4249
4398
|
});
|
|
4250
|
-
var CardFooter =
|
|
4399
|
+
var CardFooter = React10.forwardRef(function CardFooter2({ className = "", children, ...rest }, ref) {
|
|
4251
4400
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4252
4401
|
"div",
|
|
4253
4402
|
{
|
|
@@ -4275,7 +4424,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
|
4275
4424
|
"info"
|
|
4276
4425
|
]);
|
|
4277
4426
|
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
4278
|
-
var
|
|
4427
|
+
var sizeClasses14 = {
|
|
4279
4428
|
xs: "rh-w-3 rh-h-3",
|
|
4280
4429
|
sm: "rh-w-4 rh-h-4",
|
|
4281
4430
|
md: "rh-w-6 rh-h-6",
|
|
@@ -4291,7 +4440,7 @@ var colorClasses = {
|
|
|
4291
4440
|
info: "rh-text-info",
|
|
4292
4441
|
neutral: "rh-text-neutral"
|
|
4293
4442
|
};
|
|
4294
|
-
var Spinner =
|
|
4443
|
+
var Spinner = React10.forwardRef(function Spinner2({ size = "md", color = "primary", label = "Carregando...", className = "", style, ...rest }, ref) {
|
|
4295
4444
|
const preset = isPresetColor6(color);
|
|
4296
4445
|
const colorClass = preset ? colorClasses[color] : "";
|
|
4297
4446
|
const customStyle = preset ? style : { ...style, color };
|
|
@@ -4303,7 +4452,7 @@ var Spinner = React9.forwardRef(function Spinner2({ size = "md", color = "primar
|
|
|
4303
4452
|
"aria-label": label,
|
|
4304
4453
|
className: [
|
|
4305
4454
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
4306
|
-
|
|
4455
|
+
sizeClasses14[size],
|
|
4307
4456
|
colorClass,
|
|
4308
4457
|
className
|
|
4309
4458
|
].filter(Boolean).join(" "),
|
|
@@ -4430,13 +4579,12 @@ var DatePickerDropdown = ({
|
|
|
4430
4579
|
const today = /* @__PURE__ */ new Date();
|
|
4431
4580
|
const opaqueBackgroundColor = removeHexAlpha(backgroundColor);
|
|
4432
4581
|
const calendarTextStyle = textColor ? { color: textColor } : void 0;
|
|
4433
|
-
const [viewYear, setViewYear] =
|
|
4582
|
+
const [viewYear, setViewYear] = React10.useState(
|
|
4434
4583
|
selectedDate ? selectedDate.getFullYear() : today.getFullYear()
|
|
4435
4584
|
);
|
|
4436
|
-
const [viewMonth, setViewMonth] =
|
|
4437
|
-
const
|
|
4438
|
-
|
|
4439
|
-
React9.useEffect(() => {
|
|
4585
|
+
const [viewMonth, setViewMonth] = React10.useState(selectedDate ? selectedDate.getMonth() : today.getMonth());
|
|
4586
|
+
const dropdownRef = React10.useRef(null);
|
|
4587
|
+
React10.useEffect(() => {
|
|
4440
4588
|
const handleClickOutside = (e) => {
|
|
4441
4589
|
const target = e.target;
|
|
4442
4590
|
if (dropdownRef.current && !dropdownRef.current.contains(target) && containerRef.current && !containerRef.current.contains(target)) {
|
|
@@ -4466,7 +4614,9 @@ var DatePickerDropdown = ({
|
|
|
4466
4614
|
const firstDay = getFirstDayOfMonth(viewYear, viewMonth);
|
|
4467
4615
|
const prevMonthDays = getDaysInMonth(viewMonth === 0 ? viewYear - 1 : viewYear, viewMonth === 0 ? 11 : viewMonth - 1);
|
|
4468
4616
|
const trailingCount = (firstDay + daysInMonth) % 7 === 0 ? 0 : 7 - (firstDay + daysInMonth) % 7;
|
|
4469
|
-
const
|
|
4617
|
+
const effectiveSelectedDate = selectedDate ?? today;
|
|
4618
|
+
const isSelected = (day) => effectiveSelectedDate.getFullYear() === viewYear && effectiveSelectedDate.getMonth() === viewMonth && effectiveSelectedDate.getDate() === day;
|
|
4619
|
+
const isToday = (day) => today.getFullYear() === viewYear && today.getMonth() === viewMonth && today.getDate() === day;
|
|
4470
4620
|
return reactDom.createPortal(
|
|
4471
4621
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4472
4622
|
"div",
|
|
@@ -4477,7 +4627,8 @@ var DatePickerDropdown = ({
|
|
|
4477
4627
|
backgroundColor: opaqueBackgroundColor,
|
|
4478
4628
|
color: textColor,
|
|
4479
4629
|
boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)",
|
|
4480
|
-
width: 260
|
|
4630
|
+
width: 260,
|
|
4631
|
+
minHeight: 275
|
|
4481
4632
|
},
|
|
4482
4633
|
className: "rh-bg-surface rh-rounded-xs rh-p-5 rh-select-none rh-font-body",
|
|
4483
4634
|
children: [
|
|
@@ -4517,33 +4668,35 @@ var DatePickerDropdown = ({
|
|
|
4517
4668
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7", children: DAYS_SHORT.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4518
4669
|
"div",
|
|
4519
4670
|
{
|
|
4520
|
-
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
4671
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1 rh-pt-4",
|
|
4521
4672
|
style: calendarTextStyle,
|
|
4522
4673
|
children: d
|
|
4523
4674
|
},
|
|
4524
4675
|
i
|
|
4525
4676
|
)) }),
|
|
4526
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "1", viewBox: "0 0 350 1", fill: "none", className: "rh-mb-3", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" }) }),
|
|
4677
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "1", viewBox: "0 0 350 1", fill: "none", className: "rh-mb-3 rh-mt-1", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" }) }),
|
|
4527
4678
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
4528
4679
|
Array.from({ length: firstDay }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40", style: calendarTextStyle, children: prevMonthDays - firstDay + i + 1 }, `prev-${i}`)),
|
|
4529
4680
|
Array.from({ length: daysInMonth }).map((_, i) => {
|
|
4530
4681
|
const day = i + 1;
|
|
4531
4682
|
const selected = isSelected(day);
|
|
4683
|
+
const isCurrentDay = isToday(day);
|
|
4532
4684
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4533
4685
|
"button",
|
|
4534
4686
|
{
|
|
4535
4687
|
type: "button",
|
|
4536
4688
|
style: {
|
|
4537
|
-
backgroundColor: selected ? "#15607A" :
|
|
4538
|
-
color: selected ? "#FFFFFF" : textColor
|
|
4689
|
+
backgroundColor: selected ? "#15607A" : void 0,
|
|
4690
|
+
color: selected ? "#FFFFFF" : textColor,
|
|
4691
|
+
borderColor: !selected && isCurrentDay ? "#15607A" : "transparent"
|
|
4539
4692
|
},
|
|
4540
4693
|
onMouseDown: (e) => {
|
|
4541
4694
|
e.preventDefault();
|
|
4542
|
-
|
|
4695
|
+
onSelect(new Date(viewYear, viewMonth, day));
|
|
4543
4696
|
},
|
|
4544
4697
|
className: [
|
|
4545
|
-
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-
|
|
4546
|
-
selected ? "rh-text-surface" : "rh-text-text
|
|
4698
|
+
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-full rh-border rh-transition-colors rh-duration-150 rh-cursor-pointer",
|
|
4699
|
+
selected ? "rh-text-surface rh-bg-[#15607A]" : "rh-text-text rh-bg-transparent hover:rh-bg-[#D1D5DB]"
|
|
4547
4700
|
].join(" "),
|
|
4548
4701
|
children: day
|
|
4549
4702
|
},
|
|
@@ -4551,20 +4704,7 @@ var DatePickerDropdown = ({
|
|
|
4551
4704
|
);
|
|
4552
4705
|
}),
|
|
4553
4706
|
Array.from({ length: trailingCount }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40", style: calendarTextStyle, children: i + 1 }, `next-${i}`))
|
|
4554
|
-
] })
|
|
4555
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-flex rh-justify-end rh-gap-2 rh-mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4556
|
-
"button",
|
|
4557
|
-
{
|
|
4558
|
-
type: "button",
|
|
4559
|
-
style: { backgroundColor: "#87A851" },
|
|
4560
|
-
onClick: () => {
|
|
4561
|
-
if (tempDate) onSelect(tempDate);
|
|
4562
|
-
onClose();
|
|
4563
|
-
},
|
|
4564
|
-
className: "rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-transition-colors rh-duration-150 rh-bg-success rh-text-surface",
|
|
4565
|
-
children: "Aplicar"
|
|
4566
|
-
}
|
|
4567
|
-
) })
|
|
4707
|
+
] })
|
|
4568
4708
|
]
|
|
4569
4709
|
}
|
|
4570
4710
|
),
|
|
@@ -4583,11 +4723,11 @@ var CustomSelect = ({
|
|
|
4583
4723
|
type = "select",
|
|
4584
4724
|
disabled = false
|
|
4585
4725
|
}) => {
|
|
4586
|
-
const [isOpen, setIsOpen] =
|
|
4587
|
-
const [dropdownStyle, setDropdownStyle] =
|
|
4588
|
-
const containerRef =
|
|
4589
|
-
const textAreaRef =
|
|
4590
|
-
const resizeTextArea =
|
|
4726
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
4727
|
+
const [dropdownStyle, setDropdownStyle] = React10.useState({});
|
|
4728
|
+
const containerRef = React10.useRef(null);
|
|
4729
|
+
const textAreaRef = React10.useRef(null);
|
|
4730
|
+
const resizeTextArea = React10__default.default.useCallback(() => {
|
|
4591
4731
|
if (type !== "textInput" || !textAreaRef.current) return;
|
|
4592
4732
|
const textarea = textAreaRef.current;
|
|
4593
4733
|
textarea.style.height = "auto";
|
|
@@ -4619,7 +4759,7 @@ var CustomSelect = ({
|
|
|
4619
4759
|
if (!isOpen) setDropdownStyle(calcPosition());
|
|
4620
4760
|
setIsOpen((prev) => !prev);
|
|
4621
4761
|
};
|
|
4622
|
-
|
|
4762
|
+
React10.useEffect(() => {
|
|
4623
4763
|
if (!isOpen) return;
|
|
4624
4764
|
const close = () => setIsOpen(false);
|
|
4625
4765
|
window.addEventListener("scroll", close, { capture: true, passive: true });
|
|
@@ -4629,11 +4769,11 @@ var CustomSelect = ({
|
|
|
4629
4769
|
window.removeEventListener("resize", close);
|
|
4630
4770
|
};
|
|
4631
4771
|
}, [isOpen]);
|
|
4632
|
-
|
|
4772
|
+
React10.useEffect(() => {
|
|
4633
4773
|
resizeTextArea();
|
|
4634
4774
|
}, [resizeTextArea, value]);
|
|
4635
4775
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
4636
|
-
|
|
4776
|
+
React10.useEffect(() => {
|
|
4637
4777
|
if (type !== "select") return;
|
|
4638
4778
|
const handleClickOutside = (e) => {
|
|
4639
4779
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4651,7 +4791,7 @@ var CustomSelect = ({
|
|
|
4651
4791
|
setIsOpen(false);
|
|
4652
4792
|
};
|
|
4653
4793
|
const hasValue = value != null && value !== "";
|
|
4654
|
-
const displayLabel = type === "date" ? selectedDate ? formatDisplay(selectedDate) : hasValue ? value :
|
|
4794
|
+
const displayLabel = type === "date" ? selectedDate ? formatDisplay(selectedDate) : hasValue ? value : formatDisplay(/* @__PURE__ */ new Date()) : selectedOption?.label || (hasValue ? value : placeholder || "");
|
|
4655
4795
|
const displayBg = type === "date" ? backgroundColor : selectedOption?.backgroundColor || backgroundColor;
|
|
4656
4796
|
const displayTextColor = type === "date" ? textColor : selectedOption?.textColor || (hasValue ? textColor : placeholderColor) || (displayBg ? "white" : "inherit");
|
|
4657
4797
|
if (type === "textInput") {
|
|
@@ -4763,7 +4903,7 @@ var CustomSelect = ({
|
|
|
4763
4903
|
)
|
|
4764
4904
|
] });
|
|
4765
4905
|
};
|
|
4766
|
-
var
|
|
4906
|
+
var sizeClasses15 = {
|
|
4767
4907
|
sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
|
|
4768
4908
|
md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
|
|
4769
4909
|
lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
|
|
@@ -4920,7 +5060,7 @@ function TableInner({
|
|
|
4920
5060
|
...rowPaddingStyle
|
|
4921
5061
|
},
|
|
4922
5062
|
className: [
|
|
4923
|
-
rowPadding ? "" :
|
|
5063
|
+
rowPadding ? "" : sizeClasses15[size].header,
|
|
4924
5064
|
alignClasses[column.align || "left"],
|
|
4925
5065
|
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
4926
5066
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
@@ -5001,7 +5141,7 @@ function TableInner({
|
|
|
5001
5141
|
{
|
|
5002
5142
|
style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
|
|
5003
5143
|
className: [
|
|
5004
|
-
rowPadding ? "" :
|
|
5144
|
+
rowPadding ? "" : sizeClasses15[size].cell,
|
|
5005
5145
|
alignClasses[column.align || "left"],
|
|
5006
5146
|
"rh-text-text"
|
|
5007
5147
|
].filter(Boolean).join(" "),
|
|
@@ -5058,7 +5198,7 @@ function TableInner({
|
|
|
5058
5198
|
}
|
|
5059
5199
|
) });
|
|
5060
5200
|
}
|
|
5061
|
-
var Table =
|
|
5201
|
+
var Table = React10.forwardRef(TableInner);
|
|
5062
5202
|
var defaultElements = {
|
|
5063
5203
|
h1: "h1",
|
|
5064
5204
|
h2: "h2",
|
|
@@ -5146,7 +5286,7 @@ var colorClasses2 = {
|
|
|
5146
5286
|
warning: "rh-text-warning",
|
|
5147
5287
|
info: "rh-text-info"
|
|
5148
5288
|
};
|
|
5149
|
-
var Typography =
|
|
5289
|
+
var Typography = React10.forwardRef(function Typography2({
|
|
5150
5290
|
variant = "body",
|
|
5151
5291
|
color = "default",
|
|
5152
5292
|
bold = false,
|
|
@@ -5159,7 +5299,7 @@ var Typography = React9.forwardRef(function Typography2({
|
|
|
5159
5299
|
}, ref) {
|
|
5160
5300
|
const element = as ?? defaultElements[variant];
|
|
5161
5301
|
const weightClass = bold ? "rh-font-bold" : semibold ? "rh-font-semibold" : medium ? "rh-font-medium" : "";
|
|
5162
|
-
return
|
|
5302
|
+
return React10__default.default.createElement(
|
|
5163
5303
|
element,
|
|
5164
5304
|
{
|
|
5165
5305
|
ref,
|
|
@@ -5211,7 +5351,7 @@ function getVisiblePages(currentPage, totalPages, maxVisible) {
|
|
|
5211
5351
|
}
|
|
5212
5352
|
return pages;
|
|
5213
5353
|
}
|
|
5214
|
-
var Pagination =
|
|
5354
|
+
var Pagination = React10.forwardRef(function Pagination2({
|
|
5215
5355
|
currentPage,
|
|
5216
5356
|
totalPages,
|
|
5217
5357
|
onPageChange,
|
|
@@ -5220,7 +5360,7 @@ var Pagination = React9.forwardRef(function Pagination2({
|
|
|
5220
5360
|
className = "",
|
|
5221
5361
|
disabled = false
|
|
5222
5362
|
}, ref) {
|
|
5223
|
-
const visiblePages =
|
|
5363
|
+
const visiblePages = React10.useMemo(
|
|
5224
5364
|
() => getVisiblePages(currentPage, totalPages, maxVisible),
|
|
5225
5365
|
[currentPage, totalPages, maxVisible]
|
|
5226
5366
|
);
|
|
@@ -5327,7 +5467,7 @@ var Pagination = React9.forwardRef(function Pagination2({
|
|
|
5327
5467
|
}
|
|
5328
5468
|
);
|
|
5329
5469
|
});
|
|
5330
|
-
var Container =
|
|
5470
|
+
var Container = React10.forwardRef(
|
|
5331
5471
|
function Container2({ fluid = false, className = "", children, ...rest }, ref) {
|
|
5332
5472
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5333
5473
|
"div",
|
|
@@ -5359,7 +5499,7 @@ var colsClasses = {
|
|
|
5359
5499
|
11: "rh-grid-cols-11",
|
|
5360
5500
|
12: "rh-grid-cols-12"
|
|
5361
5501
|
};
|
|
5362
|
-
var GridContainer =
|
|
5502
|
+
var GridContainer = React10.forwardRef(
|
|
5363
5503
|
function GridContainer2({ columns, spacing, className = "", style, children, ...rest }, ref) {
|
|
5364
5504
|
const colClass = columns ? colsClasses[columns] : "rh-grid-cols-4 desktop-xs:rh-grid-cols-12";
|
|
5365
5505
|
const gapStyle = spacing !== void 0 ? { gap: `${spacing}px`, ...style } : style;
|
|
@@ -5460,7 +5600,7 @@ var desktopLgSpanClasses = {
|
|
|
5460
5600
|
11: "desktop-lg:rh-col-span-11",
|
|
5461
5601
|
12: "desktop-lg:rh-col-span-12"
|
|
5462
5602
|
};
|
|
5463
|
-
var GridItem =
|
|
5603
|
+
var GridItem = React10.forwardRef(
|
|
5464
5604
|
function GridItem2({
|
|
5465
5605
|
mobile = 4,
|
|
5466
5606
|
mobileSm,
|
|
@@ -5530,6 +5670,7 @@ exports.SuccessIcon = SuccessIcon;
|
|
|
5530
5670
|
exports.Table = Table;
|
|
5531
5671
|
exports.Tag = Tag;
|
|
5532
5672
|
exports.TagInput = TagInput;
|
|
5673
|
+
exports.TextArea = TextArea;
|
|
5533
5674
|
exports.TextInput = TextInput;
|
|
5534
5675
|
exports.TimePicker = TimePicker;
|
|
5535
5676
|
exports.Toast = Toast;
|