@rehagro/ui 1.0.25 → 1.0.26
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 +91 -3
- package/dist/index.d.ts +91 -3
- package/dist/index.js +328 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +272 -62
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React9 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var React9__default = /*#__PURE__*/_interopDefault(React9);
|
|
10
10
|
|
|
11
11
|
// src/provider/RehagroProvider.tsx
|
|
12
12
|
|
|
@@ -421,7 +421,7 @@ var closeStyles = {
|
|
|
421
421
|
"neutral-light": "rh-text-gray-500 hover:rh-text-gray-800",
|
|
422
422
|
"neutral-outline": "rh-text-text-muted hover:rh-text-text"
|
|
423
423
|
};
|
|
424
|
-
var Toast =
|
|
424
|
+
var Toast = React9.forwardRef(function Toast2({
|
|
425
425
|
title,
|
|
426
426
|
description,
|
|
427
427
|
link,
|
|
@@ -529,9 +529,9 @@ function AnimatedToastItem({
|
|
|
529
529
|
onRequestDismiss,
|
|
530
530
|
children
|
|
531
531
|
}) {
|
|
532
|
-
const [entered, setEntered] =
|
|
533
|
-
const leaveTimerRef =
|
|
534
|
-
|
|
532
|
+
const [entered, setEntered] = React9.useState(false);
|
|
533
|
+
const leaveTimerRef = React9.useRef(null);
|
|
534
|
+
React9.useEffect(() => {
|
|
535
535
|
if (!isDismissing) return;
|
|
536
536
|
leaveTimerRef.current = setTimeout(() => {
|
|
537
537
|
onRemove(id);
|
|
@@ -540,10 +540,10 @@ function AnimatedToastItem({
|
|
|
540
540
|
if (leaveTimerRef.current) clearTimeout(leaveTimerRef.current);
|
|
541
541
|
};
|
|
542
542
|
}, [id, isDismissing, onRemove]);
|
|
543
|
-
const handleAnimationEnd =
|
|
543
|
+
const handleAnimationEnd = React9.useCallback(() => {
|
|
544
544
|
if (!entered) setEntered(true);
|
|
545
545
|
}, [entered]);
|
|
546
|
-
const handleClose =
|
|
546
|
+
const handleClose = React9.useCallback(() => {
|
|
547
547
|
onRequestDismiss(id);
|
|
548
548
|
}, [id, onRequestDismiss]);
|
|
549
549
|
const animClass = isDismissing ? leaveClass[animDir] : entered ? "" : enterClass[animDir];
|
|
@@ -589,15 +589,15 @@ function ToastContainer() {
|
|
|
589
589
|
}
|
|
590
590
|
);
|
|
591
591
|
}
|
|
592
|
-
var ToastContext =
|
|
592
|
+
var ToastContext = React9.createContext(null);
|
|
593
593
|
function ToastProvider({
|
|
594
594
|
children,
|
|
595
595
|
position = "top-right"
|
|
596
596
|
}) {
|
|
597
|
-
const [toasts, setToasts] =
|
|
598
|
-
const [dismissingIds, setDismissingIds] =
|
|
599
|
-
const counterRef =
|
|
600
|
-
const remove =
|
|
597
|
+
const [toasts, setToasts] = React9.useState([]);
|
|
598
|
+
const [dismissingIds, setDismissingIds] = React9.useState(/* @__PURE__ */ new Set());
|
|
599
|
+
const counterRef = React9.useRef(0);
|
|
600
|
+
const remove = React9.useCallback((id) => {
|
|
601
601
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
602
602
|
setDismissingIds((prev) => {
|
|
603
603
|
const next = new Set(prev);
|
|
@@ -605,10 +605,10 @@ function ToastProvider({
|
|
|
605
605
|
return next;
|
|
606
606
|
});
|
|
607
607
|
}, []);
|
|
608
|
-
const requestDismiss =
|
|
608
|
+
const requestDismiss = React9.useCallback((id) => {
|
|
609
609
|
setDismissingIds((prev) => new Set(prev).add(id));
|
|
610
610
|
}, []);
|
|
611
|
-
const add =
|
|
611
|
+
const add = React9.useCallback(
|
|
612
612
|
(item) => {
|
|
613
613
|
const id = `rh-toast-${++counterRef.current}`;
|
|
614
614
|
const toast = { ...item, id };
|
|
@@ -626,7 +626,7 @@ function ToastProvider({
|
|
|
626
626
|
] });
|
|
627
627
|
}
|
|
628
628
|
function useToastContext() {
|
|
629
|
-
const ctx =
|
|
629
|
+
const ctx = React9.useContext(ToastContext);
|
|
630
630
|
if (!ctx) {
|
|
631
631
|
throw new Error("useToastContext must be used inside ToastProvider");
|
|
632
632
|
}
|
|
@@ -634,7 +634,7 @@ function useToastContext() {
|
|
|
634
634
|
}
|
|
635
635
|
function useToast() {
|
|
636
636
|
const { add, requestDismiss } = useToastContext();
|
|
637
|
-
const createToast =
|
|
637
|
+
const createToast = React9.useCallback(
|
|
638
638
|
(variant) => (title, options = {}) => {
|
|
639
639
|
return add({
|
|
640
640
|
title,
|
|
@@ -647,7 +647,7 @@ function useToast() {
|
|
|
647
647
|
},
|
|
648
648
|
[add]
|
|
649
649
|
);
|
|
650
|
-
const toast =
|
|
650
|
+
const toast = React9.useCallback(
|
|
651
651
|
(title, options = {}) => {
|
|
652
652
|
return add({
|
|
653
653
|
title,
|
|
@@ -690,7 +690,7 @@ function toRgbTriplet(value) {
|
|
|
690
690
|
return void 0;
|
|
691
691
|
}
|
|
692
692
|
function RehagroProvider({ theme, toastPosition, children }) {
|
|
693
|
-
const style =
|
|
693
|
+
const style = React9.useMemo(() => {
|
|
694
694
|
if (!theme) return void 0;
|
|
695
695
|
const vars = {};
|
|
696
696
|
for (const [key, config] of Object.entries(TOKEN_MAP)) {
|
|
@@ -746,12 +746,12 @@ var variantColorClasses = {
|
|
|
746
746
|
info: "rh-bg-info rh-text-surface rh-border-info hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
747
747
|
},
|
|
748
748
|
outline: {
|
|
749
|
-
primary: "rh-bg-transparent rh-text-primary rh-border-primary hover:rh-bg-primary
|
|
750
|
-
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary hover:rh-bg-secondary
|
|
751
|
-
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger
|
|
752
|
-
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning
|
|
753
|
-
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success
|
|
754
|
-
info: "rh-bg-transparent rh-text-info rh-border-info hover:rh-bg-info
|
|
749
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-primary hover:rh-bg-primary/[0.16]",
|
|
750
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary hover:rh-bg-secondary/[0.16]",
|
|
751
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-danger hover:rh-bg-danger/[0.16]",
|
|
752
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-warning hover:rh-bg-warning/[0.16]",
|
|
753
|
+
success: "rh-bg-transparent rh-text-success rh-border-success hover:rh-bg-success/[0.16]",
|
|
754
|
+
info: "rh-bg-transparent rh-text-info rh-border-info hover:rh-bg-info/[0.16]"
|
|
755
755
|
},
|
|
756
756
|
ghost: {
|
|
757
757
|
primary: "rh-bg-transparent rh-text-primary rh-border-transparent hover:rh-bg-primary/10",
|
|
@@ -782,7 +782,7 @@ var radiusClasses = {
|
|
|
782
782
|
xl: "rh-rounded-xl",
|
|
783
783
|
full: "rh-rounded-full"
|
|
784
784
|
};
|
|
785
|
-
var Button =
|
|
785
|
+
var Button = React9.forwardRef(function Button2({
|
|
786
786
|
variant = "solid",
|
|
787
787
|
size = "md",
|
|
788
788
|
radius = "sm",
|
|
@@ -798,9 +798,9 @@ var Button = React8.forwardRef(function Button2({
|
|
|
798
798
|
children,
|
|
799
799
|
...rest
|
|
800
800
|
}, ref) {
|
|
801
|
-
const isDisabled =
|
|
801
|
+
const isDisabled = React9__default.default.useMemo(() => disabled || loading, [disabled, loading]);
|
|
802
802
|
const preset = isPresetColor(color);
|
|
803
|
-
const computedStyle =
|
|
803
|
+
const computedStyle = React9__default.default.useMemo(() => {
|
|
804
804
|
const baseStyle = preset ? hoverColor ? { [`--rh-${color}-hover`]: toRgbTriplet2(hoverColor) ?? hoverColor } : {} : getArbitraryColorStyle(variant, color);
|
|
805
805
|
const hoverVars = hoverStyle ? {
|
|
806
806
|
"--btn-hover-bg": hoverStyle.backgroundColor,
|
|
@@ -925,7 +925,7 @@ var radiusClasses2 = {
|
|
|
925
925
|
xl: "rh-rounded-xl",
|
|
926
926
|
full: "rh-rounded-full"
|
|
927
927
|
};
|
|
928
|
-
var IconButton =
|
|
928
|
+
var IconButton = React9.forwardRef(function IconButton2({
|
|
929
929
|
variant = "ghost",
|
|
930
930
|
size = "md",
|
|
931
931
|
radius = "full",
|
|
@@ -939,7 +939,7 @@ var IconButton = React8.forwardRef(function IconButton2({
|
|
|
939
939
|
}, ref) {
|
|
940
940
|
const isDisabled = disabled || loading;
|
|
941
941
|
const preset = isPresetColor2(color);
|
|
942
|
-
const computedStyle =
|
|
942
|
+
const computedStyle = React9__default.default.useMemo(
|
|
943
943
|
() => preset ? style ?? {} : { ...style, ...getArbitraryColorStyle2(variant, color) },
|
|
944
944
|
[preset, color, variant, style]
|
|
945
945
|
);
|
|
@@ -1030,7 +1030,7 @@ var labelWeightClasses = {
|
|
|
1030
1030
|
semibold: "rh-font-semibold",
|
|
1031
1031
|
bold: "rh-font-bold"
|
|
1032
1032
|
};
|
|
1033
|
-
var TextInput =
|
|
1033
|
+
var TextInput = React9.forwardRef(function TextInput2({
|
|
1034
1034
|
label,
|
|
1035
1035
|
labelWeight = "medium",
|
|
1036
1036
|
subtitle,
|
|
@@ -1046,7 +1046,7 @@ var TextInput = React8.forwardRef(function TextInput2({
|
|
|
1046
1046
|
id,
|
|
1047
1047
|
...rest
|
|
1048
1048
|
}, ref) {
|
|
1049
|
-
const inputId = id ||
|
|
1049
|
+
const inputId = id || React9__default.default.useId();
|
|
1050
1050
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1051
1051
|
"div",
|
|
1052
1052
|
{
|
|
@@ -1175,7 +1175,7 @@ var MinusIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1175
1175
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
1176
1176
|
}
|
|
1177
1177
|
);
|
|
1178
|
-
var Checkbox =
|
|
1178
|
+
var Checkbox = React9.forwardRef(function Checkbox2({
|
|
1179
1179
|
size = "md",
|
|
1180
1180
|
label,
|
|
1181
1181
|
indeterminate = false,
|
|
@@ -1187,10 +1187,10 @@ var Checkbox = React8.forwardRef(function Checkbox2({
|
|
|
1187
1187
|
onChange,
|
|
1188
1188
|
...rest
|
|
1189
1189
|
}, ref) {
|
|
1190
|
-
const innerRef =
|
|
1191
|
-
const inputId = id ||
|
|
1192
|
-
|
|
1193
|
-
|
|
1190
|
+
const innerRef = React9__default.default.useRef(null);
|
|
1191
|
+
const inputId = id || React9__default.default.useId();
|
|
1192
|
+
React9__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
1193
|
+
React9__default.default.useEffect(() => {
|
|
1194
1194
|
if (innerRef.current) {
|
|
1195
1195
|
innerRef.current.indeterminate = indeterminate;
|
|
1196
1196
|
}
|
|
@@ -1245,6 +1245,177 @@ var Checkbox = React8.forwardRef(function Checkbox2({
|
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
1247
1247
|
});
|
|
1248
|
+
var RadioGroupContext = React9.createContext(null);
|
|
1249
|
+
var useRadioGroup = () => React9.useContext(RadioGroupContext);
|
|
1250
|
+
var labelSizeClasses2 = {
|
|
1251
|
+
sm: "rh-text-sm",
|
|
1252
|
+
md: "rh-text-sm",
|
|
1253
|
+
lg: "rh-text-base"
|
|
1254
|
+
};
|
|
1255
|
+
var descriptionSizeClasses = {
|
|
1256
|
+
sm: "rh-text-xs",
|
|
1257
|
+
md: "rh-text-xs",
|
|
1258
|
+
lg: "rh-text-sm"
|
|
1259
|
+
};
|
|
1260
|
+
var gapClasses = {
|
|
1261
|
+
sm: "rh-gap-2",
|
|
1262
|
+
md: "rh-gap-3",
|
|
1263
|
+
lg: "rh-gap-4"
|
|
1264
|
+
};
|
|
1265
|
+
var PRESET_COLORS3 = /* @__PURE__ */ new Set([
|
|
1266
|
+
"primary",
|
|
1267
|
+
"secondary",
|
|
1268
|
+
"danger",
|
|
1269
|
+
"warning",
|
|
1270
|
+
"success",
|
|
1271
|
+
"info"
|
|
1272
|
+
]);
|
|
1273
|
+
var isPresetColor3 = (color) => PRESET_COLORS3.has(color);
|
|
1274
|
+
var inputSizeClasses = {
|
|
1275
|
+
sm: "rh-w-4 rh-h-4",
|
|
1276
|
+
md: "rh-w-5 rh-h-5",
|
|
1277
|
+
lg: "rh-w-6 rh-h-6"
|
|
1278
|
+
};
|
|
1279
|
+
var Radio = React9.forwardRef(function Radio2({
|
|
1280
|
+
size = "md",
|
|
1281
|
+
label,
|
|
1282
|
+
description,
|
|
1283
|
+
color = "primary",
|
|
1284
|
+
disabled,
|
|
1285
|
+
checked,
|
|
1286
|
+
defaultChecked,
|
|
1287
|
+
className = "",
|
|
1288
|
+
id,
|
|
1289
|
+
onChange,
|
|
1290
|
+
...rest
|
|
1291
|
+
}, ref) {
|
|
1292
|
+
const inputId = id || React9__default.default.useId();
|
|
1293
|
+
const getAccentColor = () => {
|
|
1294
|
+
if (isPresetColor3(color)) {
|
|
1295
|
+
return `rgb(var(--rh-${color}))`;
|
|
1296
|
+
}
|
|
1297
|
+
return color;
|
|
1298
|
+
};
|
|
1299
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1300
|
+
"label",
|
|
1301
|
+
{
|
|
1302
|
+
htmlFor: inputId,
|
|
1303
|
+
className: [
|
|
1304
|
+
"rh-inline-flex rh-items-start rh-gap-2 rh-font-body rh-select-none",
|
|
1305
|
+
disabled ? "rh-cursor-not-allowed rh-opacity-50" : "rh-cursor-pointer",
|
|
1306
|
+
className
|
|
1307
|
+
].filter(Boolean).join(" "),
|
|
1308
|
+
children: [
|
|
1309
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1310
|
+
"input",
|
|
1311
|
+
{
|
|
1312
|
+
ref,
|
|
1313
|
+
id: inputId,
|
|
1314
|
+
type: "radio",
|
|
1315
|
+
disabled,
|
|
1316
|
+
checked,
|
|
1317
|
+
defaultChecked,
|
|
1318
|
+
onChange,
|
|
1319
|
+
className: [
|
|
1320
|
+
inputSizeClasses[size],
|
|
1321
|
+
"rh-accent-current rh-cursor-pointer",
|
|
1322
|
+
disabled ? "rh-cursor-not-allowed" : ""
|
|
1323
|
+
].filter(Boolean).join(" "),
|
|
1324
|
+
style: { accentColor: getAccentColor() },
|
|
1325
|
+
...rest
|
|
1326
|
+
}
|
|
1327
|
+
),
|
|
1328
|
+
(label || description) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-flex rh-flex-col", children: [
|
|
1329
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["rh-text-text", labelSizeClasses2[size]].join(" "), children: label }),
|
|
1330
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1331
|
+
"span",
|
|
1332
|
+
{
|
|
1333
|
+
className: [
|
|
1334
|
+
"rh-text-text-muted",
|
|
1335
|
+
descriptionSizeClasses[size]
|
|
1336
|
+
].join(" "),
|
|
1337
|
+
children: description
|
|
1338
|
+
}
|
|
1339
|
+
)
|
|
1340
|
+
] })
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
});
|
|
1345
|
+
var RadioOption = React9.forwardRef(function RadioOption2({ value, size, color, disabled, ...rest }, ref) {
|
|
1346
|
+
const group = useRadioGroup();
|
|
1347
|
+
const mergedSize = size ?? group?.size ?? "md";
|
|
1348
|
+
const mergedColor = color ?? group?.color ?? "primary";
|
|
1349
|
+
const mergedDisabled = disabled ?? group?.disabled ?? false;
|
|
1350
|
+
const isChecked = group?.value === value;
|
|
1351
|
+
const handleChange = () => {
|
|
1352
|
+
group?.onChange?.(value);
|
|
1353
|
+
};
|
|
1354
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1355
|
+
Radio,
|
|
1356
|
+
{
|
|
1357
|
+
ref,
|
|
1358
|
+
name: group?.name,
|
|
1359
|
+
value,
|
|
1360
|
+
size: mergedSize,
|
|
1361
|
+
color: mergedColor,
|
|
1362
|
+
disabled: mergedDisabled,
|
|
1363
|
+
checked: isChecked,
|
|
1364
|
+
onChange: handleChange,
|
|
1365
|
+
...rest
|
|
1366
|
+
}
|
|
1367
|
+
);
|
|
1368
|
+
});
|
|
1369
|
+
var RadioGroup = React9.forwardRef(function RadioGroup2({
|
|
1370
|
+
children,
|
|
1371
|
+
value,
|
|
1372
|
+
defaultValue,
|
|
1373
|
+
onChange,
|
|
1374
|
+
size = "md",
|
|
1375
|
+
orientation = "vertical",
|
|
1376
|
+
color = "primary",
|
|
1377
|
+
disabled = false,
|
|
1378
|
+
name,
|
|
1379
|
+
gap = "md",
|
|
1380
|
+
className = "",
|
|
1381
|
+
...rest
|
|
1382
|
+
}, ref) {
|
|
1383
|
+
const [internalValue, setInternalValue] = React9__default.default.useState(defaultValue);
|
|
1384
|
+
const groupName = name || React9__default.default.useId();
|
|
1385
|
+
const currentValue = value ?? internalValue;
|
|
1386
|
+
const handleChange = (newValue) => {
|
|
1387
|
+
setInternalValue(newValue);
|
|
1388
|
+
onChange?.(newValue);
|
|
1389
|
+
};
|
|
1390
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1391
|
+
RadioGroupContext.Provider,
|
|
1392
|
+
{
|
|
1393
|
+
value: {
|
|
1394
|
+
name: groupName,
|
|
1395
|
+
value: currentValue,
|
|
1396
|
+
onChange: handleChange,
|
|
1397
|
+
size,
|
|
1398
|
+
color,
|
|
1399
|
+
disabled
|
|
1400
|
+
},
|
|
1401
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1402
|
+
"div",
|
|
1403
|
+
{
|
|
1404
|
+
ref,
|
|
1405
|
+
role: "radiogroup",
|
|
1406
|
+
className: [
|
|
1407
|
+
"rh-flex",
|
|
1408
|
+
orientation === "vertical" ? "rh-flex-col" : "rh-flex-row rh-flex-wrap",
|
|
1409
|
+
gapClasses[gap],
|
|
1410
|
+
className
|
|
1411
|
+
].filter(Boolean).join(" "),
|
|
1412
|
+
...rest,
|
|
1413
|
+
children
|
|
1414
|
+
}
|
|
1415
|
+
)
|
|
1416
|
+
}
|
|
1417
|
+
);
|
|
1418
|
+
});
|
|
1248
1419
|
var statusClasses2 = {
|
|
1249
1420
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
1250
1421
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
@@ -1321,7 +1492,7 @@ var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1321
1492
|
)
|
|
1322
1493
|
}
|
|
1323
1494
|
);
|
|
1324
|
-
var Select =
|
|
1495
|
+
var Select = React9.forwardRef(function Select2(props, ref) {
|
|
1325
1496
|
const {
|
|
1326
1497
|
options,
|
|
1327
1498
|
label,
|
|
@@ -1336,16 +1507,16 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1336
1507
|
wrapperClassName = "",
|
|
1337
1508
|
multiple = false
|
|
1338
1509
|
} = props;
|
|
1339
|
-
const triggerId =
|
|
1340
|
-
const listboxId =
|
|
1341
|
-
const helperId =
|
|
1342
|
-
const [isOpen, setIsOpen] =
|
|
1343
|
-
const [activeIndex, setActiveIndex] =
|
|
1344
|
-
const wrapperRef =
|
|
1345
|
-
const innerRef =
|
|
1346
|
-
const listboxRef =
|
|
1347
|
-
|
|
1348
|
-
const [internalValue, setInternalValue] =
|
|
1510
|
+
const triggerId = React9__default.default.useId();
|
|
1511
|
+
const listboxId = React9__default.default.useId();
|
|
1512
|
+
const helperId = React9__default.default.useId();
|
|
1513
|
+
const [isOpen, setIsOpen] = React9__default.default.useState(false);
|
|
1514
|
+
const [activeIndex, setActiveIndex] = React9__default.default.useState(-1);
|
|
1515
|
+
const wrapperRef = React9__default.default.useRef(null);
|
|
1516
|
+
const innerRef = React9__default.default.useRef(null);
|
|
1517
|
+
const listboxRef = React9__default.default.useRef(null);
|
|
1518
|
+
React9__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
1519
|
+
const [internalValue, setInternalValue] = React9__default.default.useState(() => {
|
|
1349
1520
|
if (props.defaultValue !== void 0) {
|
|
1350
1521
|
return Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];
|
|
1351
1522
|
}
|
|
@@ -1367,7 +1538,7 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1367
1538
|
innerRef.current?.focus();
|
|
1368
1539
|
}
|
|
1369
1540
|
};
|
|
1370
|
-
const displayText =
|
|
1541
|
+
const displayText = React9__default.default.useMemo(() => {
|
|
1371
1542
|
if (selectedValues.length === 0) return null;
|
|
1372
1543
|
if (!multiple) {
|
|
1373
1544
|
return options.find((o) => o.value === selectedValues[0])?.label ?? null;
|
|
@@ -1377,7 +1548,7 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1377
1548
|
if (selectedLabels.length === 1) return selectedLabels[0];
|
|
1378
1549
|
return `${selectedLabels.length} selected`;
|
|
1379
1550
|
}, [selectedValues, options, multiple]);
|
|
1380
|
-
|
|
1551
|
+
React9__default.default.useEffect(() => {
|
|
1381
1552
|
if (!isOpen) return;
|
|
1382
1553
|
const handleClickOutside = (e) => {
|
|
1383
1554
|
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
@@ -1387,7 +1558,7 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1387
1558
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1388
1559
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1389
1560
|
}, [isOpen]);
|
|
1390
|
-
|
|
1561
|
+
React9__default.default.useEffect(() => {
|
|
1391
1562
|
if (!isOpen) return;
|
|
1392
1563
|
const handleEscape = (e) => {
|
|
1393
1564
|
if (e.key === "Escape") {
|
|
@@ -1398,7 +1569,7 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1398
1569
|
document.addEventListener("keydown", handleEscape);
|
|
1399
1570
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
1400
1571
|
}, [isOpen]);
|
|
1401
|
-
|
|
1572
|
+
React9__default.default.useEffect(() => {
|
|
1402
1573
|
if (!isOpen || activeIndex < 0) return;
|
|
1403
1574
|
const listbox = listboxRef.current;
|
|
1404
1575
|
if (!listbox) return;
|
|
@@ -1407,7 +1578,7 @@ var Select = React8.forwardRef(function Select2(props, ref) {
|
|
|
1407
1578
|
activeEl.scrollIntoView({ block: "nearest" });
|
|
1408
1579
|
}
|
|
1409
1580
|
}, [activeIndex, isOpen]);
|
|
1410
|
-
|
|
1581
|
+
React9__default.default.useEffect(() => {
|
|
1411
1582
|
if (isOpen) {
|
|
1412
1583
|
const firstSelectedIdx = options.findIndex(
|
|
1413
1584
|
(o) => !o.disabled && selectedValues.includes(o.value)
|
|
@@ -1667,7 +1838,7 @@ var arrowPlacementClasses = {
|
|
|
1667
1838
|
"right-start": "rh-left-0 rh-top-3 rh--translate-x-1/2 rh-rotate-45",
|
|
1668
1839
|
"right-end": "rh-left-0 rh-bottom-3 rh--translate-x-1/2 rh-rotate-45"
|
|
1669
1840
|
};
|
|
1670
|
-
var Tooltip =
|
|
1841
|
+
var Tooltip = React9.forwardRef(
|
|
1671
1842
|
function Tooltip2({
|
|
1672
1843
|
title,
|
|
1673
1844
|
description,
|
|
@@ -1683,12 +1854,12 @@ var Tooltip = React8.forwardRef(
|
|
|
1683
1854
|
children,
|
|
1684
1855
|
className = ""
|
|
1685
1856
|
}, ref) {
|
|
1686
|
-
const [internalOpen, setInternalOpen] =
|
|
1687
|
-
const enterTimerRef =
|
|
1688
|
-
const leaveTimerRef =
|
|
1857
|
+
const [internalOpen, setInternalOpen] = React9.useState(false);
|
|
1858
|
+
const enterTimerRef = React9.useRef(null);
|
|
1859
|
+
const leaveTimerRef = React9.useRef(null);
|
|
1689
1860
|
const isControlled = controlledOpen !== void 0;
|
|
1690
1861
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
1691
|
-
const setOpen =
|
|
1862
|
+
const setOpen = React9.useCallback(
|
|
1692
1863
|
(value) => {
|
|
1693
1864
|
if (!isControlled) {
|
|
1694
1865
|
setInternalOpen(value);
|
|
@@ -1697,7 +1868,7 @@ var Tooltip = React8.forwardRef(
|
|
|
1697
1868
|
},
|
|
1698
1869
|
[isControlled, onOpenChange]
|
|
1699
1870
|
);
|
|
1700
|
-
const clearTimers =
|
|
1871
|
+
const clearTimers = React9.useCallback(() => {
|
|
1701
1872
|
if (enterTimerRef.current) {
|
|
1702
1873
|
clearTimeout(enterTimerRef.current);
|
|
1703
1874
|
enterTimerRef.current = null;
|
|
@@ -1707,27 +1878,27 @@ var Tooltip = React8.forwardRef(
|
|
|
1707
1878
|
leaveTimerRef.current = null;
|
|
1708
1879
|
}
|
|
1709
1880
|
}, []);
|
|
1710
|
-
const handleEnter =
|
|
1881
|
+
const handleEnter = React9.useCallback(() => {
|
|
1711
1882
|
clearTimers();
|
|
1712
1883
|
enterTimerRef.current = setTimeout(() => {
|
|
1713
1884
|
setOpen(true);
|
|
1714
1885
|
}, enterDelay);
|
|
1715
1886
|
}, [clearTimers, enterDelay, setOpen]);
|
|
1716
|
-
const handleLeave =
|
|
1887
|
+
const handleLeave = React9.useCallback(() => {
|
|
1717
1888
|
clearTimers();
|
|
1718
1889
|
leaveTimerRef.current = setTimeout(() => {
|
|
1719
1890
|
setOpen(false);
|
|
1720
1891
|
}, leaveDelay);
|
|
1721
1892
|
}, [clearTimers, leaveDelay, setOpen]);
|
|
1722
|
-
const handleClose =
|
|
1893
|
+
const handleClose = React9.useCallback(() => {
|
|
1723
1894
|
clearTimers();
|
|
1724
1895
|
setOpen(false);
|
|
1725
1896
|
}, [clearTimers, setOpen]);
|
|
1726
|
-
|
|
1897
|
+
React9.useEffect(() => {
|
|
1727
1898
|
return () => clearTimers();
|
|
1728
1899
|
}, [clearTimers]);
|
|
1729
|
-
const triggerChild =
|
|
1730
|
-
const triggerElement =
|
|
1900
|
+
const triggerChild = React9__default.default.Children.only(children);
|
|
1901
|
+
const triggerElement = React9__default.default.cloneElement(triggerChild, {
|
|
1731
1902
|
onMouseEnter: (e) => {
|
|
1732
1903
|
handleEnter();
|
|
1733
1904
|
triggerChild.props.onMouseEnter?.(e);
|
|
@@ -1883,10 +2054,10 @@ var variantClasses2 = {
|
|
|
1883
2054
|
circle: "rh-rounded-full",
|
|
1884
2055
|
square: "rh-rounded-sm"
|
|
1885
2056
|
};
|
|
1886
|
-
var Avatar =
|
|
1887
|
-
const [imgError, setImgError] =
|
|
2057
|
+
var Avatar = React9.forwardRef(function Avatar2({ src, alt = "", initials, size = "md", variant = "circle", colorFromName = false, className = "", style, ...rest }, ref) {
|
|
2058
|
+
const [imgError, setImgError] = React9.useState(false);
|
|
1888
2059
|
const showImage = src && !imgError;
|
|
1889
|
-
const avatarColors =
|
|
2060
|
+
const avatarColors = React9.useMemo(() => {
|
|
1890
2061
|
if (!colorFromName) return null;
|
|
1891
2062
|
const name = initials || alt || "";
|
|
1892
2063
|
return name ? getAvatarColors(name) : null;
|
|
@@ -1923,7 +2094,7 @@ var Avatar = React8.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
1923
2094
|
}
|
|
1924
2095
|
);
|
|
1925
2096
|
});
|
|
1926
|
-
var
|
|
2097
|
+
var PRESET_COLORS4 = /* @__PURE__ */ new Set([
|
|
1927
2098
|
"primary",
|
|
1928
2099
|
"secondary",
|
|
1929
2100
|
"danger",
|
|
@@ -1931,7 +2102,7 @@ var PRESET_COLORS3 = /* @__PURE__ */ new Set([
|
|
|
1931
2102
|
"success",
|
|
1932
2103
|
"info"
|
|
1933
2104
|
]);
|
|
1934
|
-
var
|
|
2105
|
+
var isPresetColor4 = (color) => PRESET_COLORS4.has(color);
|
|
1935
2106
|
var activePresetClasses = {
|
|
1936
2107
|
primary: "rh-bg-primary rh-text-surface rh-border-primary",
|
|
1937
2108
|
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary",
|
|
@@ -1979,7 +2150,7 @@ function getCustomColorStyles(color, active) {
|
|
|
1979
2150
|
color
|
|
1980
2151
|
};
|
|
1981
2152
|
}
|
|
1982
|
-
var Tag =
|
|
2153
|
+
var Tag = React9.forwardRef(function Tag2({
|
|
1983
2154
|
color = "primary",
|
|
1984
2155
|
size = "md",
|
|
1985
2156
|
active = false,
|
|
@@ -1992,7 +2163,7 @@ var Tag = React8.forwardRef(function Tag2({
|
|
|
1992
2163
|
children,
|
|
1993
2164
|
...rest
|
|
1994
2165
|
}, ref) {
|
|
1995
|
-
const preset =
|
|
2166
|
+
const preset = isPresetColor4(color);
|
|
1996
2167
|
const clickable = !!rest.onClick && !disabled;
|
|
1997
2168
|
const colorClasses3 = preset ? active ? activePresetClasses[color] : inactivePresetClasses[color] : "";
|
|
1998
2169
|
const hoverClasses = clickable && preset ? active ? hoverActivePresetClasses[color] : hoverInactivePresetClasses[color] : clickable ? "hover:rh-brightness-95" : "";
|
|
@@ -2066,7 +2237,7 @@ var addButtonSizeClasses = {
|
|
|
2066
2237
|
md: "rh-w-5 rh-h-5",
|
|
2067
2238
|
lg: "rh-w-5 rh-h-5"
|
|
2068
2239
|
};
|
|
2069
|
-
var TagInput =
|
|
2240
|
+
var TagInput = React9.forwardRef(function TagInput2({
|
|
2070
2241
|
label,
|
|
2071
2242
|
subtitle,
|
|
2072
2243
|
options = [],
|
|
@@ -2081,10 +2252,10 @@ var TagInput = React8.forwardRef(function TagInput2({
|
|
|
2081
2252
|
className = "",
|
|
2082
2253
|
wrapperClassName = ""
|
|
2083
2254
|
}, ref) {
|
|
2084
|
-
const inputId =
|
|
2085
|
-
const [isOpen, setIsOpen] =
|
|
2086
|
-
const containerRef =
|
|
2087
|
-
|
|
2255
|
+
const inputId = React9__default.default.useId();
|
|
2256
|
+
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2257
|
+
const containerRef = React9.useRef(null);
|
|
2258
|
+
React9.useEffect(() => {
|
|
2088
2259
|
const handleClickOutside = (event) => {
|
|
2089
2260
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2090
2261
|
setIsOpen(false);
|
|
@@ -2306,7 +2477,7 @@ var TagInput = React8.forwardRef(function TagInput2({
|
|
|
2306
2477
|
}
|
|
2307
2478
|
);
|
|
2308
2479
|
});
|
|
2309
|
-
var ProgressBar =
|
|
2480
|
+
var ProgressBar = React9.forwardRef(function ProgressBar2({ value, label, size = "sm", showPercentage = true, barColor, bgColor, className = "" }, ref) {
|
|
2310
2481
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
2311
2482
|
if (size === "lg") {
|
|
2312
2483
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2374,7 +2545,7 @@ var ProgressBar = React8.forwardRef(function ProgressBar2({ value, label, size =
|
|
|
2374
2545
|
}
|
|
2375
2546
|
);
|
|
2376
2547
|
});
|
|
2377
|
-
var
|
|
2548
|
+
var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
2378
2549
|
"primary",
|
|
2379
2550
|
"secondary",
|
|
2380
2551
|
"danger",
|
|
@@ -2382,7 +2553,7 @@ var PRESET_COLORS4 = /* @__PURE__ */ new Set([
|
|
|
2382
2553
|
"success",
|
|
2383
2554
|
"info"
|
|
2384
2555
|
]);
|
|
2385
|
-
var
|
|
2556
|
+
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
2386
2557
|
var sizeClasses10 = {
|
|
2387
2558
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
2388
2559
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
@@ -2412,7 +2583,7 @@ function ToggleGroupInner({
|
|
|
2412
2583
|
className = "",
|
|
2413
2584
|
...rest
|
|
2414
2585
|
}, ref) {
|
|
2415
|
-
const preset =
|
|
2586
|
+
const preset = isPresetColor5(color);
|
|
2416
2587
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2417
2588
|
"div",
|
|
2418
2589
|
{
|
|
@@ -2462,7 +2633,7 @@ function ToggleGroupInner({
|
|
|
2462
2633
|
}
|
|
2463
2634
|
);
|
|
2464
2635
|
}
|
|
2465
|
-
var ToggleGroup =
|
|
2636
|
+
var ToggleGroup = React9.forwardRef(ToggleGroupInner);
|
|
2466
2637
|
var variantClasses3 = {
|
|
2467
2638
|
elevated: "rh-bg-surface rh-shadow-md rh-border-0",
|
|
2468
2639
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
@@ -2482,7 +2653,7 @@ var paddingClasses = {
|
|
|
2482
2653
|
md: "rh-p-4",
|
|
2483
2654
|
lg: "rh-p-6"
|
|
2484
2655
|
};
|
|
2485
|
-
var Card =
|
|
2656
|
+
var Card = React9.forwardRef(function Card2({
|
|
2486
2657
|
variant = "outlined",
|
|
2487
2658
|
radius = "sm",
|
|
2488
2659
|
padding = "md",
|
|
@@ -2514,7 +2685,7 @@ var Card = React8.forwardRef(function Card2({
|
|
|
2514
2685
|
}
|
|
2515
2686
|
);
|
|
2516
2687
|
});
|
|
2517
|
-
var CardHeader =
|
|
2688
|
+
var CardHeader = React9.forwardRef(function CardHeader2({ className = "", children, ...rest }, ref) {
|
|
2518
2689
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2519
2690
|
"div",
|
|
2520
2691
|
{
|
|
@@ -2525,10 +2696,10 @@ var CardHeader = React8.forwardRef(function CardHeader2({ className = "", childr
|
|
|
2525
2696
|
}
|
|
2526
2697
|
);
|
|
2527
2698
|
});
|
|
2528
|
-
var CardContent =
|
|
2699
|
+
var CardContent = React9.forwardRef(function CardContent2({ className = "", children, ...rest }, ref) {
|
|
2529
2700
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: ["rh-mt-2", className].filter(Boolean).join(" "), ...rest, children });
|
|
2530
2701
|
});
|
|
2531
|
-
var CardFooter =
|
|
2702
|
+
var CardFooter = React9.forwardRef(function CardFooter2({ className = "", children, ...rest }, ref) {
|
|
2532
2703
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2533
2704
|
"div",
|
|
2534
2705
|
{
|
|
@@ -2542,7 +2713,7 @@ var CardFooter = React8.forwardRef(function CardFooter2({ className = "", childr
|
|
|
2542
2713
|
}
|
|
2543
2714
|
);
|
|
2544
2715
|
});
|
|
2545
|
-
var
|
|
2716
|
+
var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
2546
2717
|
"primary",
|
|
2547
2718
|
"secondary",
|
|
2548
2719
|
"danger",
|
|
@@ -2550,7 +2721,7 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
2550
2721
|
"success",
|
|
2551
2722
|
"info"
|
|
2552
2723
|
]);
|
|
2553
|
-
var
|
|
2724
|
+
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
2554
2725
|
var sizeClasses11 = {
|
|
2555
2726
|
xs: "rh-w-3 rh-h-3",
|
|
2556
2727
|
sm: "rh-w-4 rh-h-4",
|
|
@@ -2566,8 +2737,8 @@ var colorClasses = {
|
|
|
2566
2737
|
success: "rh-text-success",
|
|
2567
2738
|
info: "rh-text-info"
|
|
2568
2739
|
};
|
|
2569
|
-
var Spinner =
|
|
2570
|
-
const preset =
|
|
2740
|
+
var Spinner = React9.forwardRef(function Spinner2({ size = "md", color = "primary", label = "Carregando...", className = "", style, ...rest }, ref) {
|
|
2741
|
+
const preset = isPresetColor6(color);
|
|
2571
2742
|
const colorClass = preset ? colorClasses[color] : "";
|
|
2572
2743
|
const customStyle = preset ? style : { ...style, color };
|
|
2573
2744
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2776,7 +2947,7 @@ function TableInner({
|
|
|
2776
2947
|
}
|
|
2777
2948
|
) });
|
|
2778
2949
|
}
|
|
2779
|
-
var Table =
|
|
2950
|
+
var Table = React9.forwardRef(TableInner);
|
|
2780
2951
|
var defaultElements = {
|
|
2781
2952
|
h1: "h1",
|
|
2782
2953
|
h2: "h2",
|
|
@@ -2786,66 +2957,105 @@ var defaultElements = {
|
|
|
2786
2957
|
h6: "h6",
|
|
2787
2958
|
bodyLg: "p",
|
|
2788
2959
|
body: "p",
|
|
2960
|
+
bodySm: "p",
|
|
2789
2961
|
label: "span",
|
|
2790
2962
|
labelSm: "span",
|
|
2963
|
+
labelLg: "span",
|
|
2964
|
+
formLabel: "label",
|
|
2965
|
+
formText: "span",
|
|
2966
|
+
formHelper: "span",
|
|
2967
|
+
sectionTitle: "h3",
|
|
2968
|
+
modalTitle: "h2",
|
|
2791
2969
|
caption: "span",
|
|
2792
2970
|
captionSm: "span",
|
|
2793
2971
|
menu: "span",
|
|
2794
|
-
overline: "span"
|
|
2972
|
+
overline: "span",
|
|
2973
|
+
link: "span"
|
|
2795
2974
|
};
|
|
2796
2975
|
var variantClasses4 = {
|
|
2797
2976
|
// Headings - Sora font
|
|
2798
2977
|
h1: "rh-text-4xl rh-font-bold rh-leading-tight rh-font-display",
|
|
2799
|
-
//
|
|
2978
|
+
// 36px Sora Bold
|
|
2800
2979
|
h2: "rh-text-2xl rh-font-bold rh-leading-snug rh-font-display",
|
|
2801
|
-
// 24px
|
|
2980
|
+
// 24px Sora Bold
|
|
2802
2981
|
h3: "rh-text-xl rh-font-semibold rh-leading-snug rh-font-display",
|
|
2803
|
-
// 20px
|
|
2982
|
+
// 20px Sora SemiBold
|
|
2804
2983
|
h4: "rh-text-lg rh-font-semibold rh-leading-snug rh-font-display",
|
|
2805
|
-
// 18px
|
|
2984
|
+
// 18px Sora SemiBold
|
|
2806
2985
|
h5: "rh-text-base rh-font-bold rh-leading-normal rh-font-display",
|
|
2807
2986
|
// 16px Sora Bold
|
|
2808
2987
|
h6: "rh-text-sm rh-font-bold rh-leading-normal rh-font-display",
|
|
2809
2988
|
// 14px Sora Bold
|
|
2810
2989
|
// Body - Inter font
|
|
2811
2990
|
bodyLg: "rh-text-base rh-font-normal rh-leading-normal rh-font-body",
|
|
2812
|
-
// 16px
|
|
2991
|
+
// 16px Inter
|
|
2813
2992
|
body: "rh-text-sm rh-font-normal rh-leading-normal rh-font-body",
|
|
2814
|
-
// 14px
|
|
2993
|
+
// 14px Inter
|
|
2994
|
+
bodySm: "rh-text-xs rh-font-normal rh-leading-normal rh-font-body",
|
|
2995
|
+
// 12px Inter
|
|
2815
2996
|
// Labels - Inter font
|
|
2816
2997
|
label: "rh-text-sm rh-font-medium rh-leading-normal rh-font-body",
|
|
2817
|
-
// 14px Medium
|
|
2818
|
-
labelSm: "rh-text-
|
|
2819
|
-
//
|
|
2998
|
+
// 14px Inter Medium
|
|
2999
|
+
labelSm: "rh-text-xs rh-font-medium rh-leading-normal rh-font-body",
|
|
3000
|
+
// 12px Inter Medium
|
|
3001
|
+
labelLg: "rh-text-base rh-font-medium rh-leading-normal rh-font-body",
|
|
3002
|
+
// 16px Inter Medium
|
|
3003
|
+
// Form specific - Inter font (mais usados no projeto)
|
|
3004
|
+
formLabel: "rh-text-sm rh-font-semibold rh-leading-normal rh-font-body",
|
|
3005
|
+
// 14px Inter SemiBold
|
|
3006
|
+
formText: "rh-text-sm rh-font-normal rh-leading-normal rh-font-body",
|
|
3007
|
+
// 14px Inter Normal
|
|
3008
|
+
formHelper: "rh-text-xs rh-font-normal rh-leading-normal rh-font-body",
|
|
3009
|
+
// 12px Inter Normal
|
|
3010
|
+
// Section titles - Inter font
|
|
3011
|
+
sectionTitle: "rh-text-base rh-font-semibold rh-leading-normal rh-font-body",
|
|
3012
|
+
// 16px Inter SemiBold (Dados da empresa:)
|
|
3013
|
+
modalTitle: "rh-text-base rh-font-bold rh-leading-normal rh-font-display",
|
|
3014
|
+
// 16px Sora Bold (títulos de modal)
|
|
2820
3015
|
// Captions - Inter font
|
|
2821
3016
|
caption: "rh-text-xs rh-font-normal rh-leading-normal rh-font-body",
|
|
2822
|
-
// 12px
|
|
3017
|
+
// 12px Inter
|
|
2823
3018
|
captionSm: "rh-text-2xs rh-font-normal rh-leading-tight rh-font-body",
|
|
2824
|
-
// 10px
|
|
2825
|
-
// Special
|
|
3019
|
+
// 10px Inter
|
|
3020
|
+
// Special
|
|
2826
3021
|
menu: "rh-text-xs rh-font-bold rh-leading-normal rh-font-display",
|
|
2827
3022
|
// 12px Sora Bold
|
|
2828
|
-
overline: "rh-text-2xs rh-font-semibold rh-leading-tight rh-font-body rh-tracking-wide"
|
|
2829
|
-
// 10px Inter SemiBold
|
|
3023
|
+
overline: "rh-text-2xs rh-font-semibold rh-leading-tight rh-font-body rh-tracking-wide rh-uppercase",
|
|
3024
|
+
// 10px Inter SemiBold UPPERCASE
|
|
3025
|
+
link: "rh-text-sm rh-font-medium rh-leading-normal rh-font-body rh-underline"
|
|
3026
|
+
// 14px Inter Medium underline
|
|
2830
3027
|
};
|
|
2831
3028
|
var colorClasses2 = {
|
|
2832
3029
|
default: "rh-text-text",
|
|
2833
3030
|
muted: "rh-text-text-muted",
|
|
2834
3031
|
primary: "rh-text-primary",
|
|
3032
|
+
secondary: "rh-text-secondary",
|
|
2835
3033
|
danger: "rh-text-danger",
|
|
2836
3034
|
success: "rh-text-success",
|
|
2837
|
-
warning: "rh-text-warning"
|
|
3035
|
+
warning: "rh-text-warning",
|
|
3036
|
+
info: "rh-text-info"
|
|
2838
3037
|
};
|
|
2839
|
-
var Typography =
|
|
3038
|
+
var Typography = React9.forwardRef(function Typography2({
|
|
3039
|
+
variant = "body",
|
|
3040
|
+
color = "default",
|
|
3041
|
+
bold = false,
|
|
3042
|
+
semibold = false,
|
|
3043
|
+
medium = false,
|
|
3044
|
+
as,
|
|
3045
|
+
className = "",
|
|
3046
|
+
children,
|
|
3047
|
+
...rest
|
|
3048
|
+
}, ref) {
|
|
2840
3049
|
const element = as ?? defaultElements[variant];
|
|
2841
|
-
|
|
3050
|
+
const weightClass = bold ? "rh-font-bold" : semibold ? "rh-font-semibold" : medium ? "rh-font-medium" : "";
|
|
3051
|
+
return React9__default.default.createElement(
|
|
2842
3052
|
element,
|
|
2843
3053
|
{
|
|
2844
3054
|
ref,
|
|
2845
3055
|
className: [
|
|
2846
3056
|
variantClasses4[variant],
|
|
2847
3057
|
colorClasses2[color],
|
|
2848
|
-
|
|
3058
|
+
weightClass,
|
|
2849
3059
|
className
|
|
2850
3060
|
].filter(Boolean).join(" "),
|
|
2851
3061
|
...rest
|
|
@@ -2890,7 +3100,7 @@ function getVisiblePages(currentPage, totalPages, maxVisible) {
|
|
|
2890
3100
|
}
|
|
2891
3101
|
return pages;
|
|
2892
3102
|
}
|
|
2893
|
-
var Pagination =
|
|
3103
|
+
var Pagination = React9.forwardRef(function Pagination2({
|
|
2894
3104
|
currentPage,
|
|
2895
3105
|
totalPages,
|
|
2896
3106
|
onPageChange,
|
|
@@ -2899,7 +3109,7 @@ var Pagination = React8.forwardRef(function Pagination2({
|
|
|
2899
3109
|
className = "",
|
|
2900
3110
|
disabled = false
|
|
2901
3111
|
}, ref) {
|
|
2902
|
-
const visiblePages =
|
|
3112
|
+
const visiblePages = React9.useMemo(
|
|
2903
3113
|
() => getVisiblePages(currentPage, totalPages, maxVisible),
|
|
2904
3114
|
[currentPage, totalPages, maxVisible]
|
|
2905
3115
|
);
|
|
@@ -3006,7 +3216,7 @@ var Pagination = React8.forwardRef(function Pagination2({
|
|
|
3006
3216
|
}
|
|
3007
3217
|
);
|
|
3008
3218
|
});
|
|
3009
|
-
var Container =
|
|
3219
|
+
var Container = React9.forwardRef(
|
|
3010
3220
|
function Container2({ fluid = false, className = "", children, ...rest }, ref) {
|
|
3011
3221
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3012
3222
|
"div",
|
|
@@ -3038,7 +3248,7 @@ var colsClasses = {
|
|
|
3038
3248
|
11: "rh-grid-cols-11",
|
|
3039
3249
|
12: "rh-grid-cols-12"
|
|
3040
3250
|
};
|
|
3041
|
-
var GridContainer =
|
|
3251
|
+
var GridContainer = React9.forwardRef(
|
|
3042
3252
|
function GridContainer2({ columns, spacing, className = "", style, children, ...rest }, ref) {
|
|
3043
3253
|
const colClass = columns ? colsClasses[columns] : "rh-grid-cols-4 desktop-xs:rh-grid-cols-12";
|
|
3044
3254
|
const gapStyle = spacing !== void 0 ? { gap: `${spacing}px`, ...style } : style;
|
|
@@ -3139,7 +3349,7 @@ var desktopLgSpanClasses = {
|
|
|
3139
3349
|
11: "desktop-lg:rh-col-span-11",
|
|
3140
3350
|
12: "desktop-lg:rh-col-span-12"
|
|
3141
3351
|
};
|
|
3142
|
-
var GridItem =
|
|
3352
|
+
var GridItem = React9.forwardRef(
|
|
3143
3353
|
function GridItem2({
|
|
3144
3354
|
mobile = 4,
|
|
3145
3355
|
mobileSm,
|
|
@@ -3197,6 +3407,9 @@ exports.NeutralIcon = NeutralIcon;
|
|
|
3197
3407
|
exports.Pagination = Pagination;
|
|
3198
3408
|
exports.PlusIcon = PlusIcon;
|
|
3199
3409
|
exports.ProgressBar = ProgressBar;
|
|
3410
|
+
exports.Radio = Radio;
|
|
3411
|
+
exports.RadioGroup = RadioGroup;
|
|
3412
|
+
exports.RadioOption = RadioOption;
|
|
3200
3413
|
exports.RehagroProvider = RehagroProvider;
|
|
3201
3414
|
exports.SearchIcon = SearchIcon;
|
|
3202
3415
|
exports.Select = Select;
|