@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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import React10, { forwardRef, createContext, useState, useMemo, useRef, useEffect, useCallback, useContext } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
@@ -846,9 +846,9 @@ var Button = forwardRef(function Button2({
|
|
|
846
846
|
children,
|
|
847
847
|
...rest
|
|
848
848
|
}, ref) {
|
|
849
|
-
const isDisabled =
|
|
849
|
+
const isDisabled = React10.useMemo(() => disabled || loading, [disabled, loading]);
|
|
850
850
|
const preset = isPresetColor(color);
|
|
851
|
-
const computedStyle =
|
|
851
|
+
const computedStyle = React10.useMemo(() => {
|
|
852
852
|
const baseStyle = preset ? hoverColor ? { [`--rh-${color}-hover`]: toRgbTriplet2(hoverColor) ?? hoverColor } : {} : getArbitraryColorStyle(variant, color);
|
|
853
853
|
const hoverVars = hoverStyle ? {
|
|
854
854
|
"--btn-hover-bg": hoverStyle.backgroundColor,
|
|
@@ -998,7 +998,7 @@ var IconButton = forwardRef(function IconButton2({
|
|
|
998
998
|
}, ref) {
|
|
999
999
|
const isDisabled = disabled || loading;
|
|
1000
1000
|
const preset = isPresetColor2(color);
|
|
1001
|
-
const computedStyle =
|
|
1001
|
+
const computedStyle = React10.useMemo(
|
|
1002
1002
|
() => preset ? style ?? {} : { ...style, ...getArbitraryColorStyle2(variant, color) },
|
|
1003
1003
|
[preset, color, variant, style]
|
|
1004
1004
|
);
|
|
@@ -1117,9 +1117,9 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
1117
1117
|
id,
|
|
1118
1118
|
...rest
|
|
1119
1119
|
}, ref) {
|
|
1120
|
-
const generatedId =
|
|
1120
|
+
const generatedId = React10.useId();
|
|
1121
1121
|
const inputId = id || generatedId;
|
|
1122
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
1122
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10.useState(false);
|
|
1123
1123
|
const { onChange, ...inputProps } = rest;
|
|
1124
1124
|
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
1125
1125
|
const containerStyle = {
|
|
@@ -1223,7 +1223,150 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
1223
1223
|
}
|
|
1224
1224
|
);
|
|
1225
1225
|
});
|
|
1226
|
+
var statusClasses2 = {
|
|
1227
|
+
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1228
|
+
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1229
|
+
};
|
|
1226
1230
|
var sizeClasses4 = {
|
|
1231
|
+
sm: "rh-text-sm rh-px-input-x-sm rh-py-2",
|
|
1232
|
+
md: "rh-text-sm rh-px-input-x-md rh-py-2",
|
|
1233
|
+
lg: "rh-text-base rh-px-input-x-lg rh-py-3"
|
|
1234
|
+
};
|
|
1235
|
+
var radiusClasses4 = {
|
|
1236
|
+
none: "rh-rounded-none",
|
|
1237
|
+
xxs: "rh-rounded-xxs",
|
|
1238
|
+
xs: "rh-rounded-xs",
|
|
1239
|
+
sm: "rh-rounded-sm",
|
|
1240
|
+
md: "rh-rounded-md",
|
|
1241
|
+
lg: "rh-rounded-lg",
|
|
1242
|
+
xl: "rh-rounded-xl",
|
|
1243
|
+
full: "rh-rounded-full"
|
|
1244
|
+
};
|
|
1245
|
+
var borderWidthClasses2 = {
|
|
1246
|
+
sm: "rh-border-sm",
|
|
1247
|
+
md: "rh-border-md",
|
|
1248
|
+
lg: "rh-border-lg"
|
|
1249
|
+
};
|
|
1250
|
+
var resizeClasses = {
|
|
1251
|
+
none: "rh-resize-none",
|
|
1252
|
+
vertical: "rh-resize-y",
|
|
1253
|
+
horizontal: "rh-resize-x",
|
|
1254
|
+
both: "rh-resize"
|
|
1255
|
+
};
|
|
1256
|
+
var helperStatusClasses2 = {
|
|
1257
|
+
default: "rh-text-text-muted",
|
|
1258
|
+
error: "rh-text-danger"
|
|
1259
|
+
};
|
|
1260
|
+
var labelWeightClasses2 = {
|
|
1261
|
+
normal: "rh-font-normal",
|
|
1262
|
+
medium: "rh-font-medium",
|
|
1263
|
+
semibold: "rh-font-semibold",
|
|
1264
|
+
bold: "rh-font-bold"
|
|
1265
|
+
};
|
|
1266
|
+
var getSubtitleClassName2 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1267
|
+
var TextArea = forwardRef(function TextArea2({
|
|
1268
|
+
label,
|
|
1269
|
+
labelWeight = "medium",
|
|
1270
|
+
labelColor = "#080B12",
|
|
1271
|
+
subtitle,
|
|
1272
|
+
status = "default",
|
|
1273
|
+
size = "md",
|
|
1274
|
+
radius = "xs",
|
|
1275
|
+
helperText,
|
|
1276
|
+
rows = 3,
|
|
1277
|
+
resize = "vertical",
|
|
1278
|
+
disabled,
|
|
1279
|
+
className = "",
|
|
1280
|
+
wrapperClassName = "",
|
|
1281
|
+
borderColor,
|
|
1282
|
+
backgroundColor,
|
|
1283
|
+
borderWidth = "sm",
|
|
1284
|
+
id,
|
|
1285
|
+
...rest
|
|
1286
|
+
}, ref) {
|
|
1287
|
+
const generatedId = React10.useId();
|
|
1288
|
+
const textareaId = id || generatedId;
|
|
1289
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10.useState(false);
|
|
1290
|
+
const { onChange, ...textareaProps } = rest;
|
|
1291
|
+
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
1292
|
+
const containerStyle = {
|
|
1293
|
+
...borderColor ? { borderColor } : {},
|
|
1294
|
+
...!disabled && backgroundColor ? { backgroundColor } : {}
|
|
1295
|
+
};
|
|
1296
|
+
return /* @__PURE__ */ jsxs(
|
|
1297
|
+
"div",
|
|
1298
|
+
{
|
|
1299
|
+
className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-body", wrapperClassName].filter(Boolean).join(" "),
|
|
1300
|
+
children: [
|
|
1301
|
+
label && /* @__PURE__ */ jsxs("label", { htmlFor: textareaId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1302
|
+
/* @__PURE__ */ jsx(
|
|
1303
|
+
"span",
|
|
1304
|
+
{
|
|
1305
|
+
className: `rh-text-sm ${labelWeightClasses2[labelWeight]}`,
|
|
1306
|
+
style: { color: labelColor },
|
|
1307
|
+
children: label
|
|
1308
|
+
}
|
|
1309
|
+
),
|
|
1310
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName2(subtitle)}`, children: subtitle })
|
|
1311
|
+
] }),
|
|
1312
|
+
/* @__PURE__ */ jsx(
|
|
1313
|
+
"div",
|
|
1314
|
+
{
|
|
1315
|
+
style: containerStyle,
|
|
1316
|
+
className: [
|
|
1317
|
+
"rh-flex",
|
|
1318
|
+
"rh-bg-surface rh-font-body",
|
|
1319
|
+
borderWidthClasses2[borderWidth],
|
|
1320
|
+
"rh-transition-colors rh-duration-150",
|
|
1321
|
+
statusClasses2[visualStatus],
|
|
1322
|
+
radiusClasses4[radius],
|
|
1323
|
+
sizeClasses4[size],
|
|
1324
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "",
|
|
1325
|
+
className
|
|
1326
|
+
].filter(Boolean).join(" "),
|
|
1327
|
+
children: /* @__PURE__ */ jsx(
|
|
1328
|
+
"textarea",
|
|
1329
|
+
{
|
|
1330
|
+
ref,
|
|
1331
|
+
id: textareaId,
|
|
1332
|
+
rows,
|
|
1333
|
+
disabled,
|
|
1334
|
+
"aria-invalid": visualStatus === "error" || void 0,
|
|
1335
|
+
"aria-describedby": helperText ? `${textareaId}-helper` : void 0,
|
|
1336
|
+
className: [
|
|
1337
|
+
"rh-flex-1 rh-min-w-0 rh-w-full rh-bg-transparent rh-outline-none",
|
|
1338
|
+
"rh-text-text placeholder:rh-text-text-muted hover:placeholder:rh-text-text",
|
|
1339
|
+
resizeClasses[resize],
|
|
1340
|
+
disabled ? "rh-cursor-not-allowed" : ""
|
|
1341
|
+
].filter(Boolean).join(" "),
|
|
1342
|
+
onChange: (e) => {
|
|
1343
|
+
if (helperText) setIsHelperDismissed(true);
|
|
1344
|
+
onChange?.(e);
|
|
1345
|
+
},
|
|
1346
|
+
...textareaProps
|
|
1347
|
+
}
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
helperText && !isHelperDismissed && /* @__PURE__ */ jsxs(
|
|
1352
|
+
"span",
|
|
1353
|
+
{
|
|
1354
|
+
id: `${textareaId}-helper`,
|
|
1355
|
+
className: [
|
|
1356
|
+
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
1357
|
+
helperStatusClasses2[visualStatus]
|
|
1358
|
+
].join(" "),
|
|
1359
|
+
children: [
|
|
1360
|
+
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
1361
|
+
helperText
|
|
1362
|
+
]
|
|
1363
|
+
}
|
|
1364
|
+
)
|
|
1365
|
+
]
|
|
1366
|
+
}
|
|
1367
|
+
);
|
|
1368
|
+
});
|
|
1369
|
+
var sizeClasses5 = {
|
|
1227
1370
|
sm: "rh-h-4 rh-w-4",
|
|
1228
1371
|
md: "rh-h-5 rh-w-5",
|
|
1229
1372
|
lg: "rh-h-6 rh-w-6"
|
|
@@ -1281,10 +1424,10 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1281
1424
|
onChange,
|
|
1282
1425
|
...rest
|
|
1283
1426
|
}, ref) {
|
|
1284
|
-
const innerRef =
|
|
1285
|
-
const inputId = id ||
|
|
1286
|
-
|
|
1287
|
-
|
|
1427
|
+
const innerRef = React10.useRef(null);
|
|
1428
|
+
const inputId = id || React10.useId();
|
|
1429
|
+
React10.useImperativeHandle(ref, () => innerRef.current);
|
|
1430
|
+
React10.useEffect(() => {
|
|
1288
1431
|
if (innerRef.current) {
|
|
1289
1432
|
innerRef.current.indeterminate = indeterminate;
|
|
1290
1433
|
}
|
|
@@ -1324,7 +1467,7 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1324
1467
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1325
1468
|
"rh-border rh-border-border rh-rounded-xxs",
|
|
1326
1469
|
"rh-transition-colors rh-duration-150",
|
|
1327
|
-
|
|
1470
|
+
sizeClasses5[size],
|
|
1328
1471
|
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1329
1472
|
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1330
1473
|
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
@@ -1385,7 +1528,7 @@ var Radio = forwardRef(function Radio2({
|
|
|
1385
1528
|
onChange,
|
|
1386
1529
|
...rest
|
|
1387
1530
|
}, ref) {
|
|
1388
|
-
const inputId = id ||
|
|
1531
|
+
const inputId = id || React10.useId();
|
|
1389
1532
|
const getAccentColor = () => {
|
|
1390
1533
|
if (isPresetColor3(color)) {
|
|
1391
1534
|
return `rgb(var(--rh-${color}))`;
|
|
@@ -1467,8 +1610,8 @@ var RadioGroup = forwardRef(function RadioGroup2({
|
|
|
1467
1610
|
className = "",
|
|
1468
1611
|
...rest
|
|
1469
1612
|
}, ref) {
|
|
1470
|
-
const [internalValue, setInternalValue] =
|
|
1471
|
-
const groupName = name ||
|
|
1613
|
+
const [internalValue, setInternalValue] = React10.useState(defaultValue);
|
|
1614
|
+
const groupName = name || React10.useId();
|
|
1472
1615
|
const currentValue = value ?? internalValue;
|
|
1473
1616
|
const handleChange = (newValue) => {
|
|
1474
1617
|
setInternalValue(newValue);
|
|
@@ -1503,16 +1646,16 @@ var RadioGroup = forwardRef(function RadioGroup2({
|
|
|
1503
1646
|
}
|
|
1504
1647
|
);
|
|
1505
1648
|
});
|
|
1506
|
-
var
|
|
1649
|
+
var statusClasses3 = {
|
|
1507
1650
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200 ",
|
|
1508
1651
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100 "
|
|
1509
1652
|
};
|
|
1510
|
-
var
|
|
1653
|
+
var sizeClasses6 = {
|
|
1511
1654
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1512
1655
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1513
1656
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1514
1657
|
};
|
|
1515
|
-
var
|
|
1658
|
+
var radiusClasses5 = {
|
|
1516
1659
|
none: "rh-rounded-none",
|
|
1517
1660
|
xxs: "rh-rounded-xxs",
|
|
1518
1661
|
xs: "rh-rounded-xs",
|
|
@@ -1532,7 +1675,7 @@ var dropdownRadiusClasses = {
|
|
|
1532
1675
|
xl: "rh-rounded-xs",
|
|
1533
1676
|
full: "rh-rounded-xs"
|
|
1534
1677
|
};
|
|
1535
|
-
var
|
|
1678
|
+
var helperStatusClasses3 = {
|
|
1536
1679
|
default: "rh-text-text-muted",
|
|
1537
1680
|
error: "rh-text-danger"
|
|
1538
1681
|
};
|
|
@@ -1541,7 +1684,7 @@ var optionSizeClasses = {
|
|
|
1541
1684
|
md: "rh-px-input-x-md rh-py-2 rh-text-sm",
|
|
1542
1685
|
lg: "rh-px-input-x-lg rh-py-2.5 rh-text-base"
|
|
1543
1686
|
};
|
|
1544
|
-
var
|
|
1687
|
+
var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1545
1688
|
var ChevronIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
1546
1689
|
"svg",
|
|
1547
1690
|
{
|
|
@@ -1614,18 +1757,18 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1614
1757
|
multiple = false,
|
|
1615
1758
|
backgroundColor
|
|
1616
1759
|
} = props;
|
|
1617
|
-
const triggerId =
|
|
1618
|
-
const listboxId =
|
|
1619
|
-
const helperId =
|
|
1620
|
-
const [isOpen, setIsOpen] =
|
|
1621
|
-
const [activeIndex, setActiveIndex] =
|
|
1622
|
-
const [isHelperDismissed, setIsHelperDismissed] =
|
|
1623
|
-
|
|
1624
|
-
const wrapperRef =
|
|
1625
|
-
const innerRef =
|
|
1626
|
-
const listboxRef =
|
|
1627
|
-
|
|
1628
|
-
const [internalValue, setInternalValue] =
|
|
1760
|
+
const triggerId = React10.useId();
|
|
1761
|
+
const listboxId = React10.useId();
|
|
1762
|
+
const helperId = React10.useId();
|
|
1763
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
1764
|
+
const [activeIndex, setActiveIndex] = React10.useState(-1);
|
|
1765
|
+
const [isHelperDismissed, setIsHelperDismissed] = React10.useState(false);
|
|
1766
|
+
React10.useRef({ query: "", lastAt: 0 });
|
|
1767
|
+
const wrapperRef = React10.useRef(null);
|
|
1768
|
+
const innerRef = React10.useRef(null);
|
|
1769
|
+
const listboxRef = React10.useRef(null);
|
|
1770
|
+
React10.useImperativeHandle(ref, () => innerRef.current);
|
|
1771
|
+
const [internalValue, setInternalValue] = React10.useState(() => {
|
|
1629
1772
|
if (props.defaultValue !== void 0) {
|
|
1630
1773
|
return Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];
|
|
1631
1774
|
}
|
|
@@ -1642,14 +1785,15 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1642
1785
|
if (!isControlled) setInternalValue(next);
|
|
1643
1786
|
props.onChange?.(next);
|
|
1644
1787
|
} else {
|
|
1645
|
-
const
|
|
1788
|
+
const isDeselecting = selectedValues.includes(optionValue);
|
|
1789
|
+
const next = isDeselecting ? [] : [optionValue];
|
|
1646
1790
|
if (!isControlled) setInternalValue(next);
|
|
1647
|
-
props.onChange?.(optionValue);
|
|
1791
|
+
props.onChange?.(isDeselecting ? "" : optionValue);
|
|
1648
1792
|
setIsOpen(false);
|
|
1649
1793
|
innerRef.current?.focus();
|
|
1650
1794
|
}
|
|
1651
1795
|
};
|
|
1652
|
-
const displayText =
|
|
1796
|
+
const displayText = React10.useMemo(() => {
|
|
1653
1797
|
if (selectedValues.length === 0) return null;
|
|
1654
1798
|
if (!multiple) {
|
|
1655
1799
|
return options.find((o) => o.value === selectedValues[0])?.label ?? null;
|
|
@@ -1659,7 +1803,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1659
1803
|
if (selectedLabels.length === 1) return selectedLabels[0];
|
|
1660
1804
|
return `${selectedLabels.length} selected`;
|
|
1661
1805
|
}, [selectedValues, options, multiple]);
|
|
1662
|
-
|
|
1806
|
+
React10.useEffect(() => {
|
|
1663
1807
|
if (!isOpen) return;
|
|
1664
1808
|
const handleClickOutside = (e) => {
|
|
1665
1809
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
@@ -1669,7 +1813,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1669
1813
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1670
1814
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1671
1815
|
}, [isOpen]);
|
|
1672
|
-
|
|
1816
|
+
React10.useEffect(() => {
|
|
1673
1817
|
if (!isOpen) return;
|
|
1674
1818
|
const handleEscape = (e) => {
|
|
1675
1819
|
if (e.key === "Escape") {
|
|
@@ -1680,7 +1824,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1680
1824
|
document.addEventListener("keydown", handleEscape);
|
|
1681
1825
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
1682
1826
|
}, [isOpen]);
|
|
1683
|
-
|
|
1827
|
+
React10.useEffect(() => {
|
|
1684
1828
|
if (!isOpen || activeIndex < 0) return;
|
|
1685
1829
|
const listbox = listboxRef.current;
|
|
1686
1830
|
if (!listbox) return;
|
|
@@ -1689,7 +1833,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1689
1833
|
activeEl.scrollIntoView({ block: "nearest" });
|
|
1690
1834
|
}
|
|
1691
1835
|
}, [activeIndex, isOpen]);
|
|
1692
|
-
|
|
1836
|
+
React10.useEffect(() => {
|
|
1693
1837
|
if (isOpen) {
|
|
1694
1838
|
const firstSelectedIdx = options.findIndex(
|
|
1695
1839
|
(o) => !o.disabled && selectedValues.includes(o.value)
|
|
@@ -1772,7 +1916,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1772
1916
|
children: [
|
|
1773
1917
|
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1774
1918
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
1775
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
1919
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
|
|
1776
1920
|
] }),
|
|
1777
1921
|
/* @__PURE__ */ jsxs(
|
|
1778
1922
|
"button",
|
|
@@ -1798,9 +1942,9 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1798
1942
|
!backgroundColor && "rh-bg-surface",
|
|
1799
1943
|
"rh-transition-colors rh-duration-150",
|
|
1800
1944
|
"rh-text-left rh-w-full",
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1945
|
+
statusClasses3[visualStatus],
|
|
1946
|
+
radiusClasses5[radius],
|
|
1947
|
+
sizeClasses6[size],
|
|
1804
1948
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
1805
1949
|
className
|
|
1806
1950
|
].filter(Boolean).join(" "),
|
|
@@ -1897,7 +2041,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1897
2041
|
id: helperId,
|
|
1898
2042
|
className: [
|
|
1899
2043
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
1900
|
-
|
|
2044
|
+
helperStatusClasses3[visualStatus]
|
|
1901
2045
|
].join(" "),
|
|
1902
2046
|
children: [
|
|
1903
2047
|
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
@@ -1943,16 +2087,16 @@ var MODE_OPTIONS = [
|
|
|
1943
2087
|
{ value: "month", label: "M\xEAs" },
|
|
1944
2088
|
{ value: "year", label: "Ano" }
|
|
1945
2089
|
];
|
|
1946
|
-
var
|
|
2090
|
+
var statusClasses4 = {
|
|
1947
2091
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1948
2092
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1949
2093
|
};
|
|
1950
|
-
var
|
|
2094
|
+
var sizeClasses7 = {
|
|
1951
2095
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1952
2096
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1953
2097
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1954
2098
|
};
|
|
1955
|
-
var
|
|
2099
|
+
var radiusClasses6 = {
|
|
1956
2100
|
none: "rh-rounded-none",
|
|
1957
2101
|
xxs: "rh-rounded-xxs",
|
|
1958
2102
|
xs: "rh-rounded-xs",
|
|
@@ -1972,11 +2116,11 @@ var dropdownRadiusClasses2 = {
|
|
|
1972
2116
|
xl: "rh-rounded-xs",
|
|
1973
2117
|
full: "rh-rounded-xs"
|
|
1974
2118
|
};
|
|
1975
|
-
var
|
|
2119
|
+
var helperStatusClasses4 = {
|
|
1976
2120
|
default: "rh-text-text-muted",
|
|
1977
2121
|
error: "rh-text-danger"
|
|
1978
2122
|
};
|
|
1979
|
-
var
|
|
2123
|
+
var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1980
2124
|
var ChevronIcon2 = ({ className }) => /* @__PURE__ */ jsx(
|
|
1981
2125
|
"svg",
|
|
1982
2126
|
{
|
|
@@ -2056,8 +2200,8 @@ var DateSelect = forwardRef(
|
|
|
2056
2200
|
backgroundColor,
|
|
2057
2201
|
modes
|
|
2058
2202
|
} = props;
|
|
2059
|
-
const triggerId =
|
|
2060
|
-
const helperId =
|
|
2203
|
+
const triggerId = React10.useId();
|
|
2204
|
+
const helperId = React10.useId();
|
|
2061
2205
|
const [isOpen, setIsOpen] = useState(false);
|
|
2062
2206
|
const [isHelperDismissed, setIsHelperDismissed] = useState(false);
|
|
2063
2207
|
const [dropdownAlign, setDropdownAlign] = useState("left");
|
|
@@ -2087,7 +2231,7 @@ var DateSelect = forwardRef(
|
|
|
2087
2231
|
const wrapperRef = useRef(null);
|
|
2088
2232
|
const innerRef = useRef(null);
|
|
2089
2233
|
const dropdownRef = useRef(null);
|
|
2090
|
-
|
|
2234
|
+
React10.useImperativeHandle(ref, () => innerRef.current);
|
|
2091
2235
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2092
2236
|
const yearStart = startYear ?? currentYear - 10;
|
|
2093
2237
|
const yearEnd = endYear ?? currentYear + 10;
|
|
@@ -2366,7 +2510,7 @@ var DateSelect = forwardRef(
|
|
|
2366
2510
|
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2367
2511
|
}
|
|
2368
2512
|
),
|
|
2369
|
-
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2513
|
+
/* @__PURE__ */ 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__ */ jsx(
|
|
2370
2514
|
"div",
|
|
2371
2515
|
{
|
|
2372
2516
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2411,7 +2555,7 @@ var DateSelect = forwardRef(
|
|
|
2411
2555
|
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2412
2556
|
}
|
|
2413
2557
|
),
|
|
2414
|
-
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2558
|
+
/* @__PURE__ */ 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__ */ jsx(
|
|
2415
2559
|
"div",
|
|
2416
2560
|
{
|
|
2417
2561
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2493,7 +2637,7 @@ var DateSelect = forwardRef(
|
|
|
2493
2637
|
!isStart && !isEnd && !inRange && !inHoverRange && !isHoverEnd ? "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]" : ""
|
|
2494
2638
|
].join(" ");
|
|
2495
2639
|
};
|
|
2496
|
-
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-text-center", children: [
|
|
2640
|
+
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-justify-items-center rh-text-center", children: [
|
|
2497
2641
|
prevDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2498
2642
|
"div",
|
|
2499
2643
|
{
|
|
@@ -2578,7 +2722,7 @@ var DateSelect = forwardRef(
|
|
|
2578
2722
|
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2579
2723
|
}
|
|
2580
2724
|
),
|
|
2581
|
-
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2725
|
+
/* @__PURE__ */ 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__ */ jsx(
|
|
2582
2726
|
"div",
|
|
2583
2727
|
{
|
|
2584
2728
|
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
@@ -2619,7 +2763,7 @@ var DateSelect = forwardRef(
|
|
|
2619
2763
|
const totalCells = firstDay + daysInMonth;
|
|
2620
2764
|
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2621
2765
|
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2622
|
-
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
2766
|
+
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-justify-items-center", children: [
|
|
2623
2767
|
prevDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2624
2768
|
"div",
|
|
2625
2769
|
{
|
|
@@ -2630,13 +2774,18 @@ var DateSelect = forwardRef(
|
|
|
2630
2774
|
)),
|
|
2631
2775
|
days.map((day) => {
|
|
2632
2776
|
const isSelected = value.mode === "day" && value.year === calYear && value.month === calMonth && value.day === day;
|
|
2777
|
+
const today = /* @__PURE__ */ new Date();
|
|
2778
|
+
const isCurrentDay = today.getFullYear() === calYear && today.getMonth() === calMonth && today.getDate() === day;
|
|
2633
2779
|
return /* @__PURE__ */ jsx(
|
|
2634
2780
|
"button",
|
|
2635
2781
|
{
|
|
2636
2782
|
onClick: () => handleChange({ mode: "day", year: calYear, month: calMonth, day }),
|
|
2783
|
+
style: {
|
|
2784
|
+
borderColor: !isSelected && isCurrentDay ? "#15607A" : "transparent"
|
|
2785
|
+
},
|
|
2637
2786
|
className: [
|
|
2638
|
-
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-
|
|
2639
|
-
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text
|
|
2787
|
+
"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",
|
|
2788
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text rh-bg-transparent hover:rh-bg-[#D1D5DB]"
|
|
2640
2789
|
].join(" "),
|
|
2641
2790
|
children: day
|
|
2642
2791
|
},
|
|
@@ -2661,7 +2810,7 @@ var DateSelect = forwardRef(
|
|
|
2661
2810
|
children: [
|
|
2662
2811
|
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2663
2812
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
2664
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
2813
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
|
|
2665
2814
|
] }),
|
|
2666
2815
|
/* @__PURE__ */ jsxs(
|
|
2667
2816
|
"button",
|
|
@@ -2685,9 +2834,9 @@ var DateSelect = forwardRef(
|
|
|
2685
2834
|
!backgroundColor && "rh-bg-surface",
|
|
2686
2835
|
"rh-transition-colors rh-duration-150",
|
|
2687
2836
|
"rh-text-left rh-w-full",
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2837
|
+
statusClasses4[visualStatus],
|
|
2838
|
+
radiusClasses6[radius],
|
|
2839
|
+
sizeClasses7[size],
|
|
2691
2840
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2692
2841
|
className
|
|
2693
2842
|
].filter(Boolean).join(" "),
|
|
@@ -2741,7 +2890,7 @@ var DateSelect = forwardRef(
|
|
|
2741
2890
|
id: helperId,
|
|
2742
2891
|
className: [
|
|
2743
2892
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2744
|
-
|
|
2893
|
+
helperStatusClasses4[visualStatus]
|
|
2745
2894
|
].join(" "),
|
|
2746
2895
|
children: [
|
|
2747
2896
|
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
@@ -2762,16 +2911,16 @@ var CLOCK_HOURS_INNER = [0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
|
|
2762
2911
|
var CLOCK_MINUTES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
2763
2912
|
var pad = (n) => String(n).padStart(2, "0");
|
|
2764
2913
|
var clampClockPart = (value, max) => Math.min(max, Math.max(0, value));
|
|
2765
|
-
var
|
|
2914
|
+
var statusClasses5 = {
|
|
2766
2915
|
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
2767
2916
|
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
2768
2917
|
};
|
|
2769
|
-
var
|
|
2918
|
+
var sizeClasses8 = {
|
|
2770
2919
|
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
2771
2920
|
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
2772
2921
|
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
2773
2922
|
};
|
|
2774
|
-
var
|
|
2923
|
+
var radiusClasses7 = {
|
|
2775
2924
|
none: "rh-rounded-none",
|
|
2776
2925
|
xxs: "rh-rounded-xxs",
|
|
2777
2926
|
xs: "rh-rounded-xs",
|
|
@@ -2781,11 +2930,11 @@ var radiusClasses6 = {
|
|
|
2781
2930
|
xl: "rh-rounded-xl",
|
|
2782
2931
|
full: "rh-rounded-full"
|
|
2783
2932
|
};
|
|
2784
|
-
var
|
|
2933
|
+
var helperStatusClasses5 = {
|
|
2785
2934
|
default: "rh-text-text-muted",
|
|
2786
2935
|
error: "rh-text-danger"
|
|
2787
2936
|
};
|
|
2788
|
-
var
|
|
2937
|
+
var getSubtitleClassName5 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
2789
2938
|
var ClockIcon = () => /* @__PURE__ */ jsxs(
|
|
2790
2939
|
"svg",
|
|
2791
2940
|
{
|
|
@@ -2869,8 +3018,8 @@ var TimePicker = forwardRef(
|
|
|
2869
3018
|
backgroundColor,
|
|
2870
3019
|
presentation = "dropdown"
|
|
2871
3020
|
} = props;
|
|
2872
|
-
const triggerId =
|
|
2873
|
-
const helperId =
|
|
3021
|
+
const triggerId = React10.useId();
|
|
3022
|
+
const helperId = React10.useId();
|
|
2874
3023
|
const isControlled = props.value !== void 0;
|
|
2875
3024
|
const [internalValue, setInternalValue] = useState(
|
|
2876
3025
|
props.defaultValue ?? null
|
|
@@ -2889,7 +3038,7 @@ var TimePicker = forwardRef(
|
|
|
2889
3038
|
const dropdownRef = useRef(null);
|
|
2890
3039
|
const hourColRef = useRef(null);
|
|
2891
3040
|
const minuteColRef = useRef(null);
|
|
2892
|
-
|
|
3041
|
+
React10.useImperativeHandle(ref, () => innerRef.current);
|
|
2893
3042
|
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
2894
3043
|
useEffect(() => {
|
|
2895
3044
|
if (!isOpen) return;
|
|
@@ -3022,7 +3171,7 @@ var TimePicker = forwardRef(
|
|
|
3022
3171
|
children: [
|
|
3023
3172
|
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3024
3173
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
3025
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
3174
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName5(subtitle)}`, children: subtitle })
|
|
3026
3175
|
] }),
|
|
3027
3176
|
/* @__PURE__ */ jsxs(
|
|
3028
3177
|
"button",
|
|
@@ -3046,9 +3195,9 @@ var TimePicker = forwardRef(
|
|
|
3046
3195
|
!backgroundColor && "rh-bg-surface",
|
|
3047
3196
|
"rh-transition-colors rh-duration-150",
|
|
3048
3197
|
"rh-text-left rh-w-full",
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3198
|
+
statusClasses5[visualStatus],
|
|
3199
|
+
radiusClasses7[radius],
|
|
3200
|
+
sizeClasses8[size],
|
|
3052
3201
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3053
3202
|
className
|
|
3054
3203
|
].filter(Boolean).join(" "),
|
|
@@ -3298,7 +3447,7 @@ var TimePicker = forwardRef(
|
|
|
3298
3447
|
id: helperId,
|
|
3299
3448
|
className: [
|
|
3300
3449
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3301
|
-
|
|
3450
|
+
helperStatusClasses5[visualStatus]
|
|
3302
3451
|
].join(" "),
|
|
3303
3452
|
children: [
|
|
3304
3453
|
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
@@ -3321,7 +3470,7 @@ var arrowVariantClasses = {
|
|
|
3321
3470
|
default: "rh-border-primary/20 rh-bg-primary/10",
|
|
3322
3471
|
dark: "rh-bg-primary"
|
|
3323
3472
|
};
|
|
3324
|
-
var
|
|
3473
|
+
var sizeClasses9 = {
|
|
3325
3474
|
sm: "rh-px-3 rh-py-1.5 rh-text-xs",
|
|
3326
3475
|
md: "rh-px-4 rh-py-3 rh-text-sm"
|
|
3327
3476
|
};
|
|
@@ -3412,8 +3561,8 @@ var Tooltip = forwardRef(
|
|
|
3412
3561
|
useEffect(() => {
|
|
3413
3562
|
return () => clearTimers();
|
|
3414
3563
|
}, [clearTimers]);
|
|
3415
|
-
const triggerChild =
|
|
3416
|
-
const triggerElement =
|
|
3564
|
+
const triggerChild = React10.Children.only(children);
|
|
3565
|
+
const triggerElement = React10.cloneElement(triggerChild, {
|
|
3417
3566
|
onMouseEnter: (e) => {
|
|
3418
3567
|
handleEnter();
|
|
3419
3568
|
triggerChild.props.onMouseEnter?.(e);
|
|
@@ -3452,7 +3601,7 @@ var Tooltip = forwardRef(
|
|
|
3452
3601
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
3453
3602
|
tooltipPlacementClasses[placement],
|
|
3454
3603
|
variantClasses[variant],
|
|
3455
|
-
|
|
3604
|
+
sizeClasses9[size],
|
|
3456
3605
|
className
|
|
3457
3606
|
].filter(Boolean).join(" "),
|
|
3458
3607
|
children: [
|
|
@@ -3553,7 +3702,7 @@ function getAvatarColors(name) {
|
|
|
3553
3702
|
const index = hash % AVATAR_COLORS.length;
|
|
3554
3703
|
return AVATAR_COLORS[index];
|
|
3555
3704
|
}
|
|
3556
|
-
var
|
|
3705
|
+
var sizeClasses10 = {
|
|
3557
3706
|
sm: "rh-w-8 rh-h-8 rh-text-xs",
|
|
3558
3707
|
md: "rh-w-10 rh-h-10 rh-text-sm",
|
|
3559
3708
|
lg: "rh-w-12 rh-h-12 rh-text-base",
|
|
@@ -3588,7 +3737,7 @@ var Avatar = forwardRef(function Avatar2({ src, alt = "", initials, size = "md",
|
|
|
3588
3737
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
3589
3738
|
avatarColors ? "" : "rh-bg-primary rh-text-surface",
|
|
3590
3739
|
"rh-font-display rh-font-medium rh-select-none",
|
|
3591
|
-
|
|
3740
|
+
sizeClasses10[size],
|
|
3592
3741
|
variantClasses2[variant],
|
|
3593
3742
|
className
|
|
3594
3743
|
].filter(Boolean).join(" "),
|
|
@@ -3655,7 +3804,7 @@ var hoverInactivePresetClasses = {
|
|
|
3655
3804
|
info: "hover:rh-bg-info/20 hover:rh-border-info/50",
|
|
3656
3805
|
neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
|
|
3657
3806
|
};
|
|
3658
|
-
var
|
|
3807
|
+
var sizeClasses11 = {
|
|
3659
3808
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
3660
3809
|
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
3661
3810
|
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
@@ -3702,7 +3851,7 @@ var Tag = forwardRef(function Tag2({
|
|
|
3702
3851
|
"rh-transition-colors rh-duration-150",
|
|
3703
3852
|
"rh-cursor-pointer",
|
|
3704
3853
|
clickable ? "rh-cursor-pointer" : "",
|
|
3705
|
-
|
|
3854
|
+
sizeClasses11[size],
|
|
3706
3855
|
colorClasses3,
|
|
3707
3856
|
hoverClasses,
|
|
3708
3857
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -3719,16 +3868,16 @@ var Tag = forwardRef(function Tag2({
|
|
|
3719
3868
|
}
|
|
3720
3869
|
);
|
|
3721
3870
|
});
|
|
3722
|
-
var
|
|
3871
|
+
var statusClasses6 = {
|
|
3723
3872
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
3724
3873
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
3725
3874
|
};
|
|
3726
|
-
var
|
|
3875
|
+
var sizeClasses12 = {
|
|
3727
3876
|
sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
|
|
3728
3877
|
md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
|
|
3729
3878
|
lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
|
|
3730
3879
|
};
|
|
3731
|
-
var
|
|
3880
|
+
var radiusClasses8 = {
|
|
3732
3881
|
none: "rh-rounded-none",
|
|
3733
3882
|
xxs: "rh-rounded-xxs",
|
|
3734
3883
|
xs: "rh-rounded-xs",
|
|
@@ -3738,7 +3887,7 @@ var radiusClasses7 = {
|
|
|
3738
3887
|
xl: "rh-rounded-xl",
|
|
3739
3888
|
full: "rh-rounded-full"
|
|
3740
3889
|
};
|
|
3741
|
-
var
|
|
3890
|
+
var helperStatusClasses6 = {
|
|
3742
3891
|
default: "rh-text-text-muted",
|
|
3743
3892
|
error: "rh-text-danger"
|
|
3744
3893
|
};
|
|
@@ -3757,7 +3906,7 @@ var addButtonSizeClasses = {
|
|
|
3757
3906
|
md: "rh-w-5 rh-h-5",
|
|
3758
3907
|
lg: "rh-w-5 rh-h-5"
|
|
3759
3908
|
};
|
|
3760
|
-
var
|
|
3909
|
+
var getSubtitleClassName6 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
3761
3910
|
var TagInput = forwardRef(function TagInput2({
|
|
3762
3911
|
label,
|
|
3763
3912
|
subtitle,
|
|
@@ -3773,7 +3922,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3773
3922
|
className = "",
|
|
3774
3923
|
wrapperClassName = ""
|
|
3775
3924
|
}, ref) {
|
|
3776
|
-
const inputId =
|
|
3925
|
+
const inputId = React10.useId();
|
|
3777
3926
|
const [isOpen, setIsOpen] = useState(false);
|
|
3778
3927
|
const containerRef = useRef(null);
|
|
3779
3928
|
useEffect(() => {
|
|
@@ -3814,7 +3963,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3814
3963
|
children: [
|
|
3815
3964
|
label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3816
3965
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
|
|
3817
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
3966
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName6(subtitle)}`, children: subtitle })
|
|
3818
3967
|
] }),
|
|
3819
3968
|
/* @__PURE__ */ jsxs(
|
|
3820
3969
|
"div",
|
|
@@ -3824,9 +3973,9 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3824
3973
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
3825
3974
|
"rh-border rh-bg-surface rh-font-body",
|
|
3826
3975
|
"rh-transition-colors rh-duration-150",
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3976
|
+
statusClasses6[status],
|
|
3977
|
+
radiusClasses8[radius],
|
|
3978
|
+
sizeClasses12[size],
|
|
3830
3979
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3831
3980
|
className
|
|
3832
3981
|
].filter(Boolean).join(" "),
|
|
@@ -3989,7 +4138,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3989
4138
|
id: `${inputId}-helper`,
|
|
3990
4139
|
className: [
|
|
3991
4140
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3992
|
-
|
|
4141
|
+
helperStatusClasses6[status]
|
|
3993
4142
|
].join(" "),
|
|
3994
4143
|
children: helperText
|
|
3995
4144
|
}
|
|
@@ -4096,12 +4245,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
4096
4245
|
"info"
|
|
4097
4246
|
]);
|
|
4098
4247
|
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
4099
|
-
var
|
|
4248
|
+
var sizeClasses13 = {
|
|
4100
4249
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
4101
4250
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
4102
4251
|
lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
|
|
4103
4252
|
};
|
|
4104
|
-
var
|
|
4253
|
+
var radiusClasses9 = {
|
|
4105
4254
|
none: "rh-rounded-none",
|
|
4106
4255
|
xs: "rh-rounded-xs",
|
|
4107
4256
|
sm: "rh-rounded-sm",
|
|
@@ -4134,8 +4283,8 @@ function ToggleGroupInner({
|
|
|
4134
4283
|
className: [
|
|
4135
4284
|
"rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
|
|
4136
4285
|
"rh-p-1 rh-gap-0.5",
|
|
4137
|
-
|
|
4138
|
-
|
|
4286
|
+
radiusClasses9[radius],
|
|
4287
|
+
sizeClasses13[size].container,
|
|
4139
4288
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
|
|
4140
4289
|
className
|
|
4141
4290
|
].filter(Boolean).join(" "),
|
|
@@ -4157,8 +4306,8 @@ function ToggleGroupInner({
|
|
|
4157
4306
|
"rh-border-0 rh-font-display rh-font-medium",
|
|
4158
4307
|
"rh-transition-all rh-duration-150",
|
|
4159
4308
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
|
|
4160
|
-
|
|
4161
|
-
|
|
4309
|
+
radiusClasses9[radius],
|
|
4310
|
+
sizeClasses13[size].button,
|
|
4162
4311
|
isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
|
|
4163
4312
|
!isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
|
|
4164
4313
|
isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
|
|
@@ -4181,7 +4330,7 @@ var variantClasses3 = {
|
|
|
4181
4330
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
4182
4331
|
filled: "rh-bg-background rh-border-0 rh-shadow-none"
|
|
4183
4332
|
};
|
|
4184
|
-
var
|
|
4333
|
+
var radiusClasses10 = {
|
|
4185
4334
|
none: "rh-rounded-none",
|
|
4186
4335
|
xs: "rh-rounded-xs",
|
|
4187
4336
|
sm: "rh-rounded-sm",
|
|
@@ -4216,7 +4365,7 @@ var CardRoot = forwardRef(function Card({
|
|
|
4216
4365
|
className: [
|
|
4217
4366
|
"rh-font-body rh-transition-all rh-duration-150",
|
|
4218
4367
|
variantClasses3[variant],
|
|
4219
|
-
|
|
4368
|
+
radiusClasses10[radius],
|
|
4220
4369
|
paddingClasses[padding],
|
|
4221
4370
|
isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
|
|
4222
4371
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -4269,7 +4418,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
|
4269
4418
|
"info"
|
|
4270
4419
|
]);
|
|
4271
4420
|
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
4272
|
-
var
|
|
4421
|
+
var sizeClasses14 = {
|
|
4273
4422
|
xs: "rh-w-3 rh-h-3",
|
|
4274
4423
|
sm: "rh-w-4 rh-h-4",
|
|
4275
4424
|
md: "rh-w-6 rh-h-6",
|
|
@@ -4297,7 +4446,7 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
|
|
|
4297
4446
|
"aria-label": label,
|
|
4298
4447
|
className: [
|
|
4299
4448
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
4300
|
-
|
|
4449
|
+
sizeClasses14[size],
|
|
4301
4450
|
colorClass,
|
|
4302
4451
|
className
|
|
4303
4452
|
].filter(Boolean).join(" "),
|
|
@@ -4428,7 +4577,6 @@ var DatePickerDropdown = ({
|
|
|
4428
4577
|
selectedDate ? selectedDate.getFullYear() : today.getFullYear()
|
|
4429
4578
|
);
|
|
4430
4579
|
const [viewMonth, setViewMonth] = useState(selectedDate ? selectedDate.getMonth() : today.getMonth());
|
|
4431
|
-
const [tempDate, setTempDate] = useState(selectedDate);
|
|
4432
4580
|
const dropdownRef = useRef(null);
|
|
4433
4581
|
useEffect(() => {
|
|
4434
4582
|
const handleClickOutside = (e) => {
|
|
@@ -4460,7 +4608,9 @@ var DatePickerDropdown = ({
|
|
|
4460
4608
|
const firstDay = getFirstDayOfMonth(viewYear, viewMonth);
|
|
4461
4609
|
const prevMonthDays = getDaysInMonth(viewMonth === 0 ? viewYear - 1 : viewYear, viewMonth === 0 ? 11 : viewMonth - 1);
|
|
4462
4610
|
const trailingCount = (firstDay + daysInMonth) % 7 === 0 ? 0 : 7 - (firstDay + daysInMonth) % 7;
|
|
4463
|
-
const
|
|
4611
|
+
const effectiveSelectedDate = selectedDate ?? today;
|
|
4612
|
+
const isSelected = (day) => effectiveSelectedDate.getFullYear() === viewYear && effectiveSelectedDate.getMonth() === viewMonth && effectiveSelectedDate.getDate() === day;
|
|
4613
|
+
const isToday = (day) => today.getFullYear() === viewYear && today.getMonth() === viewMonth && today.getDate() === day;
|
|
4464
4614
|
return createPortal(
|
|
4465
4615
|
/* @__PURE__ */ jsxs(
|
|
4466
4616
|
"div",
|
|
@@ -4471,7 +4621,8 @@ var DatePickerDropdown = ({
|
|
|
4471
4621
|
backgroundColor: opaqueBackgroundColor,
|
|
4472
4622
|
color: textColor,
|
|
4473
4623
|
boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)",
|
|
4474
|
-
width: 260
|
|
4624
|
+
width: 260,
|
|
4625
|
+
minHeight: 275
|
|
4475
4626
|
},
|
|
4476
4627
|
className: "rh-bg-surface rh-rounded-xs rh-p-5 rh-select-none rh-font-body",
|
|
4477
4628
|
children: [
|
|
@@ -4511,33 +4662,35 @@ var DatePickerDropdown = ({
|
|
|
4511
4662
|
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7", children: DAYS_SHORT.map((d, i) => /* @__PURE__ */ jsx(
|
|
4512
4663
|
"div",
|
|
4513
4664
|
{
|
|
4514
|
-
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
4665
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1 rh-pt-4",
|
|
4515
4666
|
style: calendarTextStyle,
|
|
4516
4667
|
children: d
|
|
4517
4668
|
},
|
|
4518
4669
|
i
|
|
4519
4670
|
)) }),
|
|
4520
|
-
/* @__PURE__ */ 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__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" }) }),
|
|
4671
|
+
/* @__PURE__ */ 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__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" }) }),
|
|
4521
4672
|
/* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
4522
4673
|
Array.from({ length: firstDay }).map((_, i) => /* @__PURE__ */ 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}`)),
|
|
4523
4674
|
Array.from({ length: daysInMonth }).map((_, i) => {
|
|
4524
4675
|
const day = i + 1;
|
|
4525
4676
|
const selected = isSelected(day);
|
|
4677
|
+
const isCurrentDay = isToday(day);
|
|
4526
4678
|
return /* @__PURE__ */ jsx(
|
|
4527
4679
|
"button",
|
|
4528
4680
|
{
|
|
4529
4681
|
type: "button",
|
|
4530
4682
|
style: {
|
|
4531
|
-
backgroundColor: selected ? "#15607A" :
|
|
4532
|
-
color: selected ? "#FFFFFF" : textColor
|
|
4683
|
+
backgroundColor: selected ? "#15607A" : void 0,
|
|
4684
|
+
color: selected ? "#FFFFFF" : textColor,
|
|
4685
|
+
borderColor: !selected && isCurrentDay ? "#15607A" : "transparent"
|
|
4533
4686
|
},
|
|
4534
4687
|
onMouseDown: (e) => {
|
|
4535
4688
|
e.preventDefault();
|
|
4536
|
-
|
|
4689
|
+
onSelect(new Date(viewYear, viewMonth, day));
|
|
4537
4690
|
},
|
|
4538
4691
|
className: [
|
|
4539
|
-
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-
|
|
4540
|
-
selected ? "rh-text-surface" : "rh-text-text
|
|
4692
|
+
"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",
|
|
4693
|
+
selected ? "rh-text-surface rh-bg-[#15607A]" : "rh-text-text rh-bg-transparent hover:rh-bg-[#D1D5DB]"
|
|
4541
4694
|
].join(" "),
|
|
4542
4695
|
children: day
|
|
4543
4696
|
},
|
|
@@ -4545,20 +4698,7 @@ var DatePickerDropdown = ({
|
|
|
4545
4698
|
);
|
|
4546
4699
|
}),
|
|
4547
4700
|
Array.from({ length: trailingCount }).map((_, i) => /* @__PURE__ */ 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}`))
|
|
4548
|
-
] })
|
|
4549
|
-
/* @__PURE__ */ jsx("div", { className: "rh-flex rh-justify-end rh-gap-2 rh-mt-4", children: /* @__PURE__ */ jsx(
|
|
4550
|
-
"button",
|
|
4551
|
-
{
|
|
4552
|
-
type: "button",
|
|
4553
|
-
style: { backgroundColor: "#87A851" },
|
|
4554
|
-
onClick: () => {
|
|
4555
|
-
if (tempDate) onSelect(tempDate);
|
|
4556
|
-
onClose();
|
|
4557
|
-
},
|
|
4558
|
-
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",
|
|
4559
|
-
children: "Aplicar"
|
|
4560
|
-
}
|
|
4561
|
-
) })
|
|
4701
|
+
] })
|
|
4562
4702
|
]
|
|
4563
4703
|
}
|
|
4564
4704
|
),
|
|
@@ -4581,7 +4721,7 @@ var CustomSelect = ({
|
|
|
4581
4721
|
const [dropdownStyle, setDropdownStyle] = useState({});
|
|
4582
4722
|
const containerRef = useRef(null);
|
|
4583
4723
|
const textAreaRef = useRef(null);
|
|
4584
|
-
const resizeTextArea =
|
|
4724
|
+
const resizeTextArea = React10.useCallback(() => {
|
|
4585
4725
|
if (type !== "textInput" || !textAreaRef.current) return;
|
|
4586
4726
|
const textarea = textAreaRef.current;
|
|
4587
4727
|
textarea.style.height = "auto";
|
|
@@ -4645,7 +4785,7 @@ var CustomSelect = ({
|
|
|
4645
4785
|
setIsOpen(false);
|
|
4646
4786
|
};
|
|
4647
4787
|
const hasValue = value != null && value !== "";
|
|
4648
|
-
const displayLabel = type === "date" ? selectedDate ? formatDisplay(selectedDate) : hasValue ? value :
|
|
4788
|
+
const displayLabel = type === "date" ? selectedDate ? formatDisplay(selectedDate) : hasValue ? value : formatDisplay(/* @__PURE__ */ new Date()) : selectedOption?.label || (hasValue ? value : placeholder || "");
|
|
4649
4789
|
const displayBg = type === "date" ? backgroundColor : selectedOption?.backgroundColor || backgroundColor;
|
|
4650
4790
|
const displayTextColor = type === "date" ? textColor : selectedOption?.textColor || (hasValue ? textColor : placeholderColor) || (displayBg ? "white" : "inherit");
|
|
4651
4791
|
if (type === "textInput") {
|
|
@@ -4757,7 +4897,7 @@ var CustomSelect = ({
|
|
|
4757
4897
|
)
|
|
4758
4898
|
] });
|
|
4759
4899
|
};
|
|
4760
|
-
var
|
|
4900
|
+
var sizeClasses15 = {
|
|
4761
4901
|
sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
|
|
4762
4902
|
md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
|
|
4763
4903
|
lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
|
|
@@ -4914,7 +5054,7 @@ function TableInner({
|
|
|
4914
5054
|
...rowPaddingStyle
|
|
4915
5055
|
},
|
|
4916
5056
|
className: [
|
|
4917
|
-
rowPadding ? "" :
|
|
5057
|
+
rowPadding ? "" : sizeClasses15[size].header,
|
|
4918
5058
|
alignClasses[column.align || "left"],
|
|
4919
5059
|
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
4920
5060
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
@@ -4995,7 +5135,7 @@ function TableInner({
|
|
|
4995
5135
|
{
|
|
4996
5136
|
style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
|
|
4997
5137
|
className: [
|
|
4998
|
-
rowPadding ? "" :
|
|
5138
|
+
rowPadding ? "" : sizeClasses15[size].cell,
|
|
4999
5139
|
alignClasses[column.align || "left"],
|
|
5000
5140
|
"rh-text-text"
|
|
5001
5141
|
].filter(Boolean).join(" "),
|
|
@@ -5153,7 +5293,7 @@ var Typography = forwardRef(function Typography2({
|
|
|
5153
5293
|
}, ref) {
|
|
5154
5294
|
const element = as ?? defaultElements[variant];
|
|
5155
5295
|
const weightClass = bold ? "rh-font-bold" : semibold ? "rh-font-semibold" : medium ? "rh-font-medium" : "";
|
|
5156
|
-
return
|
|
5296
|
+
return React10.createElement(
|
|
5157
5297
|
element,
|
|
5158
5298
|
{
|
|
5159
5299
|
ref,
|
|
@@ -5490,6 +5630,6 @@ var GridItem = forwardRef(
|
|
|
5490
5630
|
}
|
|
5491
5631
|
);
|
|
5492
5632
|
|
|
5493
|
-
export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DateSelect, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextInput, TimePicker, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
|
|
5633
|
+
export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DateSelect, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextArea, TextInput, TimePicker, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
|
|
5494
5634
|
//# sourceMappingURL=index.mjs.map
|
|
5495
5635
|
//# sourceMappingURL=index.mjs.map
|