@rehagro/ui 1.0.11 → 1.0.13

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.js CHANGED
@@ -44,7 +44,9 @@ var TOKEN_MAP = {
44
44
  inputHeightLg: { var: "--rh-input-height-lg", isColor: false },
45
45
  inputPxSm: { var: "--rh-input-px-sm", isColor: false },
46
46
  inputPxMd: { var: "--rh-input-px-md", isColor: false },
47
- inputPxLg: { var: "--rh-input-px-lg", isColor: false }
47
+ inputPxLg: { var: "--rh-input-px-lg", isColor: false },
48
+ fontFamilyBody: { var: "--rh-font-family", isColor: false },
49
+ fontFamilyDisplay: { var: "--rh-font-family-display", isColor: false }
48
50
  };
49
51
  var DeleteIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
50
52
  "svg",
@@ -351,27 +353,19 @@ var Toast = React8.forwardRef(function Toast2({
351
353
  className: [
352
354
  "rh-flex rh-items-start rh-gap-3",
353
355
  "rh-w-80 rh-rounded-sm rh-border rh-p-4",
354
- "rh-shadow-md rh-font-sans",
356
+ "rh-shadow-md rh-font-body",
355
357
  containerStyles[styleKey],
356
358
  className
357
359
  ].filter(Boolean).join(" "),
358
360
  ...rest,
359
361
  children: [
360
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-flex-shrink-0 rh-mt-0.5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
361
- Icon,
362
- {
363
- className: ["rh-w-5 rh-h-5", iconStyles[styleKey]].filter(Boolean).join(" ")
364
- }
365
- ) }),
362
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-flex-shrink-0 rh-mt-0.5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: ["rh-w-5 rh-h-5", iconStyles[styleKey]].filter(Boolean).join(" ") }) }),
366
363
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex-1 rh-min-w-0", children: [
367
364
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rh-text-sm rh-font-semibold rh-leading-tight", children: title }),
368
365
  description && /* @__PURE__ */ jsxRuntime.jsx(
369
366
  "p",
370
367
  {
371
- className: [
372
- "rh-mt-1 rh-text-sm rh-leading-normal",
373
- descriptionStyles[styleKey]
374
- ].filter(Boolean).join(" "),
368
+ className: ["rh-mt-1 rh-text-sm rh-leading-normal", descriptionStyles[styleKey]].filter(Boolean).join(" "),
375
369
  children: description
376
370
  }
377
371
  ),
@@ -735,7 +729,7 @@ var Button = React8.forwardRef(function Button2({
735
729
  style: computedStyle,
736
730
  className: [
737
731
  "rh-inline-flex rh-items-center rh-justify-center rh-gap-2",
738
- "rh-border rh-font-sans rh-font-medium",
732
+ "rh-border rh-font-display rh-font-medium",
739
733
  "rh-transition-colors rh-duration-150",
740
734
  "focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
741
735
  preset && !hasCustomHover ? variantColorClasses[variant][color] : "",
@@ -868,7 +862,7 @@ var IconButton = React8.forwardRef(function IconButton2({
868
862
  style: computedStyle,
869
863
  className: [
870
864
  "rh-inline-flex rh-items-center rh-justify-center",
871
- "rh-border rh-font-sans",
865
+ "rh-border rh-font-display",
872
866
  "rh-transition-colors rh-duration-150",
873
867
  "focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
874
868
  preset ? variantColorClasses2[variant][color] : "hover:rh-brightness-90",
@@ -966,7 +960,7 @@ var TextInput = React8.forwardRef(function TextInput2({
966
960
  return /* @__PURE__ */ jsxRuntime.jsxs(
967
961
  "div",
968
962
  {
969
- className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-sans", wrapperClassName].filter(Boolean).join(" "),
963
+ className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-body", wrapperClassName].filter(Boolean).join(" "),
970
964
  children: [
971
965
  label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
972
966
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${labelWeightClasses[labelWeight]} rh-text-text`, children: label }),
@@ -977,7 +971,7 @@ var TextInput = React8.forwardRef(function TextInput2({
977
971
  {
978
972
  className: [
979
973
  "rh-flex rh-items-center rh-gap-2",
980
- "rh-border rh-bg-surface rh-font-sans",
974
+ "rh-border rh-bg-surface rh-font-body",
981
975
  "rh-transition-colors rh-duration-150",
982
976
  statusClasses[status],
983
977
  radiusClasses3[radius],
@@ -1115,7 +1109,7 @@ var Checkbox = React8.forwardRef(function Checkbox2({
1115
1109
  {
1116
1110
  htmlFor: inputId,
1117
1111
  className: [
1118
- "rh-inline-flex rh-items-center rh-gap-2 rh-font-sans rh-select-none",
1112
+ "rh-inline-flex rh-items-center rh-gap-2 rh-font-body rh-select-none",
1119
1113
  disabled ? "rh-cursor-not-allowed rh-opacity-50" : "rh-cursor-pointer",
1120
1114
  className
1121
1115
  ].filter(Boolean).join(" "),
@@ -1234,319 +1228,307 @@ var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
1234
1228
  )
1235
1229
  }
1236
1230
  );
1237
- var Select = React8.forwardRef(
1238
- function Select2(props, ref) {
1239
- const {
1240
- options,
1241
- label,
1242
- subtitle,
1243
- placeholder = "Select",
1244
- status = "default",
1245
- size = "md",
1246
- radius = "xs",
1247
- helperText,
1248
- disabled = false,
1249
- className = "",
1250
- wrapperClassName = "",
1251
- multiple = false
1252
- } = props;
1253
- const triggerId = React8__default.default.useId();
1254
- const listboxId = React8__default.default.useId();
1255
- const helperId = React8__default.default.useId();
1256
- const [isOpen, setIsOpen] = React8__default.default.useState(false);
1257
- const [activeIndex, setActiveIndex] = React8__default.default.useState(-1);
1258
- const wrapperRef = React8__default.default.useRef(null);
1259
- const innerRef = React8__default.default.useRef(null);
1260
- const listboxRef = React8__default.default.useRef(null);
1261
- React8__default.default.useImperativeHandle(ref, () => innerRef.current);
1262
- const [internalValue, setInternalValue] = React8__default.default.useState(() => {
1263
- if (props.defaultValue !== void 0) {
1264
- return Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];
1231
+ var Select = React8.forwardRef(function Select2(props, ref) {
1232
+ const {
1233
+ options,
1234
+ label,
1235
+ subtitle,
1236
+ placeholder = "Select",
1237
+ status = "default",
1238
+ size = "md",
1239
+ radius = "xs",
1240
+ helperText,
1241
+ disabled = false,
1242
+ className = "",
1243
+ wrapperClassName = "",
1244
+ multiple = false
1245
+ } = props;
1246
+ const triggerId = React8__default.default.useId();
1247
+ const listboxId = React8__default.default.useId();
1248
+ const helperId = React8__default.default.useId();
1249
+ const [isOpen, setIsOpen] = React8__default.default.useState(false);
1250
+ const [activeIndex, setActiveIndex] = React8__default.default.useState(-1);
1251
+ const wrapperRef = React8__default.default.useRef(null);
1252
+ const innerRef = React8__default.default.useRef(null);
1253
+ const listboxRef = React8__default.default.useRef(null);
1254
+ React8__default.default.useImperativeHandle(ref, () => innerRef.current);
1255
+ const [internalValue, setInternalValue] = React8__default.default.useState(() => {
1256
+ if (props.defaultValue !== void 0) {
1257
+ return Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue];
1258
+ }
1259
+ return [];
1260
+ });
1261
+ const isControlled = props.value !== void 0;
1262
+ const selectedValues = isControlled ? Array.isArray(props.value) ? props.value : props.value !== void 0 ? [props.value] : [] : internalValue;
1263
+ const enabledOptions = options.filter((o) => !o.disabled);
1264
+ const handleSelect = (optionValue) => {
1265
+ if (multiple) {
1266
+ const next = selectedValues.includes(optionValue) ? selectedValues.filter((v) => v !== optionValue) : [...selectedValues, optionValue];
1267
+ if (!isControlled) setInternalValue(next);
1268
+ props.onChange?.(next);
1269
+ } else {
1270
+ const next = [optionValue];
1271
+ if (!isControlled) setInternalValue(next);
1272
+ props.onChange?.(optionValue);
1273
+ setIsOpen(false);
1274
+ innerRef.current?.focus();
1275
+ }
1276
+ };
1277
+ const displayText = React8__default.default.useMemo(() => {
1278
+ if (selectedValues.length === 0) return null;
1279
+ if (!multiple) {
1280
+ return options.find((o) => o.value === selectedValues[0])?.label ?? null;
1281
+ }
1282
+ const selectedLabels = selectedValues.map((v) => options.find((o) => o.value === v)?.label).filter(Boolean);
1283
+ if (selectedLabels.length === 0) return null;
1284
+ if (selectedLabels.length === 1) return selectedLabels[0];
1285
+ return `${selectedLabels.length} selected`;
1286
+ }, [selectedValues, options, multiple]);
1287
+ React8__default.default.useEffect(() => {
1288
+ if (!isOpen) return;
1289
+ const handleClickOutside = (e) => {
1290
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
1291
+ setIsOpen(false);
1265
1292
  }
1266
- return [];
1267
- });
1268
- const isControlled = props.value !== void 0;
1269
- const selectedValues = isControlled ? Array.isArray(props.value) ? props.value : props.value !== void 0 ? [props.value] : [] : internalValue;
1270
- const enabledOptions = options.filter((o) => !o.disabled);
1271
- const handleSelect = (optionValue) => {
1272
- if (multiple) {
1273
- const next = selectedValues.includes(optionValue) ? selectedValues.filter((v) => v !== optionValue) : [...selectedValues, optionValue];
1274
- if (!isControlled) setInternalValue(next);
1275
- props.onChange?.(next);
1276
- } else {
1277
- const next = [optionValue];
1278
- if (!isControlled) setInternalValue(next);
1279
- props.onChange?.(optionValue);
1293
+ };
1294
+ document.addEventListener("mousedown", handleClickOutside);
1295
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1296
+ }, [isOpen]);
1297
+ React8__default.default.useEffect(() => {
1298
+ if (!isOpen) return;
1299
+ const handleEscape = (e) => {
1300
+ if (e.key === "Escape") {
1280
1301
  setIsOpen(false);
1281
1302
  innerRef.current?.focus();
1282
1303
  }
1283
1304
  };
1284
- const displayText = React8__default.default.useMemo(() => {
1285
- if (selectedValues.length === 0) return null;
1286
- if (!multiple) {
1287
- return options.find((o) => o.value === selectedValues[0])?.label ?? null;
1288
- }
1289
- const selectedLabels = selectedValues.map((v) => options.find((o) => o.value === v)?.label).filter(Boolean);
1290
- if (selectedLabels.length === 0) return null;
1291
- if (selectedLabels.length === 1) return selectedLabels[0];
1292
- return `${selectedLabels.length} selected`;
1293
- }, [selectedValues, options, multiple]);
1294
- React8__default.default.useEffect(() => {
1295
- if (!isOpen) return;
1296
- const handleClickOutside = (e) => {
1297
- if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
1298
- setIsOpen(false);
1299
- }
1300
- };
1301
- document.addEventListener("mousedown", handleClickOutside);
1302
- return () => document.removeEventListener("mousedown", handleClickOutside);
1303
- }, [isOpen]);
1304
- React8__default.default.useEffect(() => {
1305
- if (!isOpen) return;
1306
- const handleEscape = (e) => {
1307
- if (e.key === "Escape") {
1308
- setIsOpen(false);
1309
- innerRef.current?.focus();
1310
- }
1311
- };
1312
- document.addEventListener("keydown", handleEscape);
1313
- return () => document.removeEventListener("keydown", handleEscape);
1314
- }, [isOpen]);
1315
- React8__default.default.useEffect(() => {
1316
- if (!isOpen || activeIndex < 0) return;
1317
- const listbox = listboxRef.current;
1318
- if (!listbox) return;
1319
- const activeEl = listbox.children[activeIndex];
1320
- if (typeof activeEl?.scrollIntoView === "function") {
1321
- activeEl.scrollIntoView({ block: "nearest" });
1322
- }
1323
- }, [activeIndex, isOpen]);
1324
- React8__default.default.useEffect(() => {
1325
- if (isOpen) {
1326
- const firstSelectedIdx = options.findIndex(
1327
- (o) => !o.disabled && selectedValues.includes(o.value)
1328
- );
1329
- setActiveIndex(firstSelectedIdx >= 0 ? firstSelectedIdx : 0);
1330
- } else {
1331
- setActiveIndex(-1);
1332
- }
1333
- }, [isOpen]);
1334
- const handleKeyDown = (e) => {
1335
- if (disabled) return;
1336
- switch (e.key) {
1337
- case "ArrowDown":
1338
- case "Down": {
1339
- e.preventDefault();
1340
- if (!isOpen) {
1341
- setIsOpen(true);
1342
- return;
1343
- }
1344
- setActiveIndex((prev) => {
1345
- for (let i = prev + 1; i < options.length; i++) {
1346
- if (!options[i].disabled) return i;
1347
- }
1348
- return prev;
1349
- });
1350
- break;
1351
- }
1352
- case "ArrowUp":
1353
- case "Up": {
1354
- e.preventDefault();
1355
- if (!isOpen) {
1356
- setIsOpen(true);
1357
- return;
1358
- }
1359
- setActiveIndex((prev) => {
1360
- for (let i = prev - 1; i >= 0; i--) {
1361
- if (!options[i].disabled) return i;
1362
- }
1363
- return prev;
1364
- });
1365
- break;
1305
+ document.addEventListener("keydown", handleEscape);
1306
+ return () => document.removeEventListener("keydown", handleEscape);
1307
+ }, [isOpen]);
1308
+ React8__default.default.useEffect(() => {
1309
+ if (!isOpen || activeIndex < 0) return;
1310
+ const listbox = listboxRef.current;
1311
+ if (!listbox) return;
1312
+ const activeEl = listbox.children[activeIndex];
1313
+ if (typeof activeEl?.scrollIntoView === "function") {
1314
+ activeEl.scrollIntoView({ block: "nearest" });
1315
+ }
1316
+ }, [activeIndex, isOpen]);
1317
+ React8__default.default.useEffect(() => {
1318
+ if (isOpen) {
1319
+ const firstSelectedIdx = options.findIndex(
1320
+ (o) => !o.disabled && selectedValues.includes(o.value)
1321
+ );
1322
+ setActiveIndex(firstSelectedIdx >= 0 ? firstSelectedIdx : 0);
1323
+ } else {
1324
+ setActiveIndex(-1);
1325
+ }
1326
+ }, [isOpen]);
1327
+ const handleKeyDown = (e) => {
1328
+ if (disabled) return;
1329
+ switch (e.key) {
1330
+ case "ArrowDown":
1331
+ case "Down": {
1332
+ e.preventDefault();
1333
+ if (!isOpen) {
1334
+ setIsOpen(true);
1335
+ return;
1366
1336
  }
1367
- case "Enter":
1368
- case " ": {
1369
- e.preventDefault();
1370
- if (!isOpen) {
1371
- setIsOpen(true);
1372
- } else if (activeIndex >= 0 && !options[activeIndex].disabled) {
1373
- handleSelect(options[activeIndex].value);
1337
+ setActiveIndex((prev) => {
1338
+ for (let i = prev + 1; i < options.length; i++) {
1339
+ if (!options[i].disabled) return i;
1374
1340
  }
1375
- break;
1341
+ return prev;
1342
+ });
1343
+ break;
1344
+ }
1345
+ case "ArrowUp":
1346
+ case "Up": {
1347
+ e.preventDefault();
1348
+ if (!isOpen) {
1349
+ setIsOpen(true);
1350
+ return;
1376
1351
  }
1377
- case "Home": {
1378
- e.preventDefault();
1379
- if (isOpen) {
1380
- const idx = enabledOptions.length > 0 ? options.indexOf(enabledOptions[0]) : 0;
1381
- setActiveIndex(idx);
1352
+ setActiveIndex((prev) => {
1353
+ for (let i = prev - 1; i >= 0; i--) {
1354
+ if (!options[i].disabled) return i;
1382
1355
  }
1383
- break;
1356
+ return prev;
1357
+ });
1358
+ break;
1359
+ }
1360
+ case "Enter":
1361
+ case " ": {
1362
+ e.preventDefault();
1363
+ if (!isOpen) {
1364
+ setIsOpen(true);
1365
+ } else if (activeIndex >= 0 && !options[activeIndex].disabled) {
1366
+ handleSelect(options[activeIndex].value);
1384
1367
  }
1385
- case "End": {
1386
- e.preventDefault();
1387
- if (isOpen) {
1388
- const idx = enabledOptions.length > 0 ? options.indexOf(enabledOptions[enabledOptions.length - 1]) : options.length - 1;
1389
- setActiveIndex(idx);
1390
- }
1391
- break;
1368
+ break;
1369
+ }
1370
+ case "Home": {
1371
+ e.preventDefault();
1372
+ if (isOpen) {
1373
+ const idx = enabledOptions.length > 0 ? options.indexOf(enabledOptions[0]) : 0;
1374
+ setActiveIndex(idx);
1392
1375
  }
1393
- case "Tab": {
1394
- if (isOpen) setIsOpen(false);
1395
- break;
1376
+ break;
1377
+ }
1378
+ case "End": {
1379
+ e.preventDefault();
1380
+ if (isOpen) {
1381
+ const idx = enabledOptions.length > 0 ? options.indexOf(enabledOptions[enabledOptions.length - 1]) : options.length - 1;
1382
+ setActiveIndex(idx);
1396
1383
  }
1384
+ break;
1397
1385
  }
1398
- };
1399
- return /* @__PURE__ */ jsxRuntime.jsxs(
1400
- "div",
1401
- {
1402
- ref: wrapperRef,
1403
- className: [
1404
- "rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-sans",
1405
- wrapperClassName
1406
- ].filter(Boolean).join(" "),
1407
- children: [
1408
- label && /* @__PURE__ */ jsxRuntime.jsxs(
1409
- "label",
1410
- {
1411
- id: `${triggerId}-label`,
1412
- className: "rh-flex rh-items-baseline rh-gap-1",
1413
- children: [
1414
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
1415
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
1416
- ]
1417
- }
1418
- ),
1419
- /* @__PURE__ */ jsxRuntime.jsxs(
1420
- "button",
1421
- {
1422
- ref: innerRef,
1423
- id: triggerId,
1424
- type: "button",
1425
- role: "combobox",
1426
- "aria-expanded": isOpen,
1427
- "aria-haspopup": "listbox",
1428
- "aria-controls": listboxId,
1429
- "aria-labelledby": label ? `${triggerId}-label` : void 0,
1430
- "aria-describedby": helperText ? helperId : void 0,
1431
- "aria-invalid": status === "error" || void 0,
1432
- "aria-disabled": disabled || void 0,
1433
- disabled,
1434
- onClick: () => !disabled && setIsOpen((o) => !o),
1435
- onKeyDown: handleKeyDown,
1436
- className: [
1437
- "rh-flex rh-items-center rh-justify-between rh-gap-2",
1438
- "rh-border rh-bg-surface rh-font-sans",
1439
- "rh-transition-colors rh-duration-150",
1440
- "rh-text-left rh-w-full",
1441
- statusClasses2[status],
1442
- radiusClasses4[radius],
1443
- sizeClasses5[size],
1444
- disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
1445
- className
1446
- ].filter(Boolean).join(" "),
1447
- children: [
1448
- /* @__PURE__ */ jsxRuntime.jsx(
1449
- "span",
1450
- {
1451
- className: [
1452
- "rh-flex-1 rh-truncate",
1453
- displayText ? "rh-text-text" : "rh-text-text-muted"
1454
- ].join(" "),
1455
- children: displayText ?? placeholder
1456
- }
1457
- ),
1458
- /* @__PURE__ */ jsxRuntime.jsx(
1459
- ChevronIcon,
1460
- {
1461
- className: [
1462
- "rh-w-5 rh-h-5 rh-shrink-0 rh-text-text-muted rh-transition-transform rh-duration-150",
1463
- isOpen ? "rh-rotate-180" : ""
1464
- ].filter(Boolean).join(" ")
1465
- }
1466
- )
1467
- ]
1468
- }
1469
- ),
1470
- isOpen && /* @__PURE__ */ jsxRuntime.jsx(
1471
- "ul",
1472
- {
1473
- ref: listboxRef,
1474
- id: listboxId,
1475
- role: "listbox",
1476
- "aria-labelledby": label ? `${triggerId}-label` : triggerId,
1477
- "aria-multiselectable": multiple || void 0,
1478
- tabIndex: -1,
1479
- className: [
1480
- "rh-absolute rh-z-50 rh-w-full rh-mt-1",
1481
- "rh-border rh-border-border rh-bg-surface",
1482
- "rh-shadow-md rh-overflow-auto rh-max-h-60",
1483
- "rh-py-1",
1484
- dropdownRadiusClasses[radius]
1485
- ].filter(Boolean).join(" "),
1486
- style: { top: "100%" },
1487
- children: options.map((option, index) => {
1488
- const isSelected = selectedValues.includes(option.value);
1489
- const isActive = index === activeIndex;
1490
- const isDisabled = option.disabled;
1491
- return /* @__PURE__ */ jsxRuntime.jsxs(
1492
- "li",
1493
- {
1494
- id: `${listboxId}-option-${index}`,
1495
- role: "option",
1496
- "aria-selected": isSelected,
1497
- "aria-disabled": isDisabled || void 0,
1498
- onClick: () => {
1499
- if (!isDisabled) handleSelect(option.value);
1500
- },
1501
- onMouseEnter: () => {
1502
- if (!isDisabled) setActiveIndex(index);
1503
- },
1504
- className: [
1505
- "rh-flex rh-items-center rh-justify-between rh-gap-2",
1506
- "rh-transition-colors rh-duration-150",
1507
- optionSizeClasses[size],
1508
- isDisabled ? "rh-opacity-50 rh-cursor-not-allowed" : "rh-cursor-pointer",
1509
- isActive && !isDisabled ? "rh-bg-background" : "",
1510
- isSelected && !isActive ? "rh-bg-primary/5" : ""
1511
- ].filter(Boolean).join(" "),
1512
- children: [
1513
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-flex-1 rh-truncate rh-text-text", children: option.label }),
1514
- multiple ? /* @__PURE__ */ jsxRuntime.jsx(
1515
- "span",
1516
- {
1517
- className: [
1518
- "rh-inline-flex rh-items-center rh-justify-center",
1519
- "rh-w-5 rh-h-5 rh-shrink-0",
1520
- "rh-border rh-rounded-xxs rh-transition-colors rh-duration-150",
1521
- isSelected ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-border-border rh-bg-surface"
1522
- ].filter(Boolean).join(" "),
1523
- "aria-hidden": "true",
1524
- children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "rh-w-3 rh-h-3" })
1525
- }
1526
- ) : isSelected && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "rh-w-3.5 rh-h-3.5 rh-shrink-0 rh-text-primary" })
1527
- ]
1528
- },
1529
- option.value
1530
- );
1531
- })
1532
- }
1533
- ),
1534
- helperText && /* @__PURE__ */ jsxRuntime.jsx(
1535
- "span",
1536
- {
1537
- id: helperId,
1538
- className: [
1539
- "rh-flex rh-items-center rh-gap-1 rh-text-xs",
1540
- helperStatusClasses2[status]
1541
- ].join(" "),
1542
- children: helperText
1543
- }
1544
- )
1545
- ]
1386
+ case "Tab": {
1387
+ if (isOpen) setIsOpen(false);
1388
+ break;
1546
1389
  }
1547
- );
1548
- }
1549
- );
1390
+ }
1391
+ };
1392
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1393
+ "div",
1394
+ {
1395
+ ref: wrapperRef,
1396
+ className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
1397
+ children: [
1398
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
1399
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
1400
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
1401
+ ] }),
1402
+ /* @__PURE__ */ jsxRuntime.jsxs(
1403
+ "button",
1404
+ {
1405
+ ref: innerRef,
1406
+ id: triggerId,
1407
+ type: "button",
1408
+ role: "combobox",
1409
+ "aria-expanded": isOpen,
1410
+ "aria-haspopup": "listbox",
1411
+ "aria-controls": listboxId,
1412
+ "aria-labelledby": label ? `${triggerId}-label` : void 0,
1413
+ "aria-describedby": helperText ? helperId : void 0,
1414
+ "aria-invalid": status === "error" || void 0,
1415
+ "aria-disabled": disabled || void 0,
1416
+ disabled,
1417
+ onClick: () => !disabled && setIsOpen((o) => !o),
1418
+ onKeyDown: handleKeyDown,
1419
+ className: [
1420
+ "rh-flex rh-items-center rh-justify-between rh-gap-2",
1421
+ "rh-border rh-bg-surface rh-font-body",
1422
+ "rh-transition-colors rh-duration-150",
1423
+ "rh-text-left rh-w-full",
1424
+ statusClasses2[status],
1425
+ radiusClasses4[radius],
1426
+ sizeClasses5[size],
1427
+ disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
1428
+ className
1429
+ ].filter(Boolean).join(" "),
1430
+ children: [
1431
+ /* @__PURE__ */ jsxRuntime.jsx(
1432
+ "span",
1433
+ {
1434
+ className: [
1435
+ "rh-flex-1 rh-truncate",
1436
+ displayText ? "rh-text-text" : "rh-text-text-muted"
1437
+ ].join(" "),
1438
+ children: displayText ?? placeholder
1439
+ }
1440
+ ),
1441
+ /* @__PURE__ */ jsxRuntime.jsx(
1442
+ ChevronIcon,
1443
+ {
1444
+ className: [
1445
+ "rh-w-5 rh-h-5 rh-shrink-0 rh-text-text-muted rh-transition-transform rh-duration-150",
1446
+ isOpen ? "rh-rotate-180" : ""
1447
+ ].filter(Boolean).join(" ")
1448
+ }
1449
+ )
1450
+ ]
1451
+ }
1452
+ ),
1453
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx(
1454
+ "ul",
1455
+ {
1456
+ ref: listboxRef,
1457
+ id: listboxId,
1458
+ role: "listbox",
1459
+ "aria-labelledby": label ? `${triggerId}-label` : triggerId,
1460
+ "aria-multiselectable": multiple || void 0,
1461
+ tabIndex: -1,
1462
+ className: [
1463
+ "rh-absolute rh-z-50 rh-w-full rh-mt-1",
1464
+ "rh-border rh-border-border rh-bg-surface",
1465
+ "rh-shadow-md rh-overflow-auto rh-max-h-60",
1466
+ "rh-py-1",
1467
+ dropdownRadiusClasses[radius]
1468
+ ].filter(Boolean).join(" "),
1469
+ style: { top: "100%" },
1470
+ children: options.map((option, index) => {
1471
+ const isSelected = selectedValues.includes(option.value);
1472
+ const isActive = index === activeIndex;
1473
+ const isDisabled = option.disabled;
1474
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1475
+ "li",
1476
+ {
1477
+ id: `${listboxId}-option-${index}`,
1478
+ role: "option",
1479
+ "aria-selected": isSelected,
1480
+ "aria-disabled": isDisabled || void 0,
1481
+ onClick: () => {
1482
+ if (!isDisabled) handleSelect(option.value);
1483
+ },
1484
+ onMouseEnter: () => {
1485
+ if (!isDisabled) setActiveIndex(index);
1486
+ },
1487
+ className: [
1488
+ "rh-flex rh-items-center rh-justify-between rh-gap-2",
1489
+ "rh-transition-colors rh-duration-150",
1490
+ optionSizeClasses[size],
1491
+ isDisabled ? "rh-opacity-50 rh-cursor-not-allowed" : "rh-cursor-pointer",
1492
+ isActive && !isDisabled ? "rh-bg-background" : "",
1493
+ isSelected && !isActive ? "rh-bg-primary/5" : ""
1494
+ ].filter(Boolean).join(" "),
1495
+ children: [
1496
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-flex-1 rh-truncate rh-text-text", children: option.label }),
1497
+ multiple ? /* @__PURE__ */ jsxRuntime.jsx(
1498
+ "span",
1499
+ {
1500
+ className: [
1501
+ "rh-inline-flex rh-items-center rh-justify-center",
1502
+ "rh-w-5 rh-h-5 rh-shrink-0",
1503
+ "rh-border rh-rounded-xxs rh-transition-colors rh-duration-150",
1504
+ isSelected ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-border-border rh-bg-surface"
1505
+ ].filter(Boolean).join(" "),
1506
+ "aria-hidden": "true",
1507
+ children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "rh-w-3 rh-h-3" })
1508
+ }
1509
+ ) : isSelected && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "rh-w-3.5 rh-h-3.5 rh-shrink-0 rh-text-primary" })
1510
+ ]
1511
+ },
1512
+ option.value
1513
+ );
1514
+ })
1515
+ }
1516
+ ),
1517
+ helperText && /* @__PURE__ */ jsxRuntime.jsx(
1518
+ "span",
1519
+ {
1520
+ id: helperId,
1521
+ className: [
1522
+ "rh-flex rh-items-center rh-gap-1 rh-text-xs",
1523
+ helperStatusClasses2[status]
1524
+ ].join(" "),
1525
+ children: helperText
1526
+ }
1527
+ )
1528
+ ]
1529
+ }
1530
+ );
1531
+ });
1550
1532
  var variantClasses = {
1551
1533
  light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
1552
1534
  default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
@@ -1823,7 +1805,7 @@ var Avatar = React8.forwardRef(function Avatar2({ src, alt = "", initials, size
1823
1805
  className: [
1824
1806
  "rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
1825
1807
  avatarColors ? "" : "rh-bg-primary rh-text-surface",
1826
- "rh-font-sans rh-font-medium rh-select-none",
1808
+ "rh-font-display rh-font-medium rh-select-none",
1827
1809
  sizeClasses7[size],
1828
1810
  variantClasses2[variant],
1829
1811
  className
@@ -1928,7 +1910,7 @@ var Tag = React8.forwardRef(function Tag2({
1928
1910
  "aria-pressed": clickable ? active : void 0,
1929
1911
  "aria-disabled": disabled || void 0,
1930
1912
  className: [
1931
- "rh-inline-flex rh-items-center rh-font-sans rh-font-medium rh-rounded-full",
1913
+ "rh-inline-flex rh-items-center rh-font-display rh-font-medium rh-rounded-full",
1932
1914
  "rh-border rh-whitespace-nowrap rh-select-none",
1933
1915
  "rh-transition-colors rh-duration-150",
1934
1916
  "rh-cursor-pointer",
@@ -1988,228 +1970,121 @@ var addButtonSizeClasses = {
1988
1970
  md: "rh-w-5 rh-h-5",
1989
1971
  lg: "rh-w-5 rh-h-5"
1990
1972
  };
1991
- var TagInput = React8.forwardRef(
1992
- function TagInput2({
1993
- label,
1994
- subtitle,
1995
- options = [],
1996
- value = [],
1997
- onChange,
1998
- placeholder,
1999
- status = "default",
2000
- size = "md",
2001
- radius = "md",
2002
- helperText,
2003
- disabled,
2004
- className = "",
2005
- wrapperClassName = ""
2006
- }, ref) {
2007
- const inputId = React8__default.default.useId();
2008
- const [isOpen, setIsOpen] = React8.useState(false);
2009
- const containerRef = React8.useRef(null);
2010
- React8.useEffect(() => {
2011
- const handleClickOutside = (event) => {
2012
- if (containerRef.current && !containerRef.current.contains(event.target)) {
2013
- setIsOpen(false);
2014
- }
2015
- };
2016
- document.addEventListener("mousedown", handleClickOutside);
2017
- return () => document.removeEventListener("mousedown", handleClickOutside);
2018
- }, []);
2019
- const handleRemoveTag = (tagValue) => {
2020
- if (disabled) return;
2021
- onChange(value.filter((tag) => tag.value !== tagValue));
2022
- };
2023
- const handleToggleOption = (option) => {
2024
- if (disabled) return;
2025
- const isSelected = value.some((v) => v.value === option.value);
2026
- if (isSelected) {
2027
- onChange(value.filter((v) => v.value !== option.value));
2028
- } else {
2029
- onChange([...value, option]);
1973
+ var TagInput = React8.forwardRef(function TagInput2({
1974
+ label,
1975
+ subtitle,
1976
+ options = [],
1977
+ value = [],
1978
+ onChange,
1979
+ placeholder,
1980
+ status = "default",
1981
+ size = "md",
1982
+ radius = "md",
1983
+ helperText,
1984
+ disabled,
1985
+ className = "",
1986
+ wrapperClassName = ""
1987
+ }, ref) {
1988
+ const inputId = React8__default.default.useId();
1989
+ const [isOpen, setIsOpen] = React8.useState(false);
1990
+ const containerRef = React8.useRef(null);
1991
+ React8.useEffect(() => {
1992
+ const handleClickOutside = (event) => {
1993
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
1994
+ setIsOpen(false);
2030
1995
  }
2031
1996
  };
2032
- const handleAddClick = () => {
2033
- if (disabled) return;
2034
- setIsOpen(!isOpen);
2035
- };
2036
- return /* @__PURE__ */ jsxRuntime.jsxs(
2037
- "div",
2038
- {
2039
- ref: (node) => {
2040
- if (typeof ref === "function") ref(node);
2041
- else if (ref) ref.current = node;
2042
- containerRef.current = node;
2043
- },
2044
- className: [
2045
- "rh-flex rh-flex-col rh-gap-2 rh-font-sans rh-relative",
2046
- wrapperClassName
2047
- ].filter(Boolean).join(" "),
2048
- children: [
2049
- label && /* @__PURE__ */ jsxRuntime.jsxs(
2050
- "label",
2051
- {
2052
- htmlFor: inputId,
2053
- className: "rh-flex rh-items-baseline rh-gap-1",
2054
- children: [
2055
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
2056
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
2057
- ]
2058
- }
2059
- ),
2060
- /* @__PURE__ */ jsxRuntime.jsxs(
2061
- "div",
2062
- {
2063
- onClick: disabled ? void 0 : handleAddClick,
2064
- className: [
2065
- "rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
2066
- "rh-border rh-bg-surface rh-font-sans",
2067
- "rh-transition-colors rh-duration-150",
2068
- statusClasses3[status],
2069
- radiusClasses5[radius],
2070
- sizeClasses9[size],
2071
- disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
2072
- className
2073
- ].filter(Boolean).join(" "),
2074
- children: [
2075
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-flex-row rh-flex-wrap rh-items-center rh-gap-2 rh-flex-1", children: [
2076
- value.length === 0 && placeholder && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-text-muted", children: placeholder }),
2077
- value.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
2078
- "div",
2079
- {
2080
- className: [
2081
- "rh-inline-flex rh-items-center rh-justify-center rh-gap-1",
2082
- "rh-bg-gray-200 rh-border rh-border-gray-200 rh-rounded-[4px]",
2083
- tagSizeClasses[size]
2084
- ].join(" "),
2085
- children: [
2086
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-font-semibold rh-text-gray-700", children: tag.label }),
2087
- /* @__PURE__ */ jsxRuntime.jsx(
2088
- "button",
2089
- {
2090
- type: "button",
2091
- onClick: (e) => {
2092
- e.stopPropagation();
2093
- handleRemoveTag(tag.value);
2094
- },
2095
- disabled,
2096
- className: [
2097
- "rh-flex rh-items-center rh-justify-center",
2098
- "rh-bg-white rh-rounded-full",
2099
- "rh-cursor-pointer hover:rh-bg-gray-100",
2100
- "disabled:rh-cursor-not-allowed disabled:rh-opacity-50",
2101
- deleteButtonSizeClasses[size]
2102
- ].join(" "),
2103
- "aria-label": `Remover ${tag.label}`,
2104
- children: /* @__PURE__ */ jsxRuntime.jsx(
2105
- "svg",
2106
- {
2107
- viewBox: "0 0 8 8",
2108
- fill: "none",
2109
- xmlns: "http://www.w3.org/2000/svg",
2110
- className: "rh-w-[8px] rh-h-[8px]",
2111
- children: /* @__PURE__ */ jsxRuntime.jsx(
2112
- "path",
2113
- {
2114
- d: "M6 2L2 6M2 2L6 6",
2115
- stroke: "#374151",
2116
- strokeWidth: "1.5",
2117
- strokeLinecap: "round",
2118
- strokeLinejoin: "round"
2119
- }
2120
- )
2121
- }
2122
- )
2123
- }
2124
- )
2125
- ]
2126
- },
2127
- tag.value
2128
- ))
2129
- ] }),
2130
- /* @__PURE__ */ jsxRuntime.jsx(
2131
- "button",
2132
- {
2133
- type: "button",
2134
- onClick: handleAddClick,
2135
- disabled,
2136
- className: [
2137
- "rh-flex rh-items-center rh-justify-center rh-shrink-0",
2138
- "rh-text-text-muted hover:rh-text-text",
2139
- "rh-cursor-pointer",
2140
- "disabled:rh-cursor-not-allowed disabled:rh-opacity-50",
2141
- addButtonSizeClasses[size]
2142
- ].join(" "),
2143
- "aria-label": "Adicionar",
2144
- "aria-expanded": isOpen,
2145
- children: /* @__PURE__ */ jsxRuntime.jsx(
2146
- "svg",
2147
- {
2148
- viewBox: "0 0 20 20",
2149
- fill: "none",
2150
- xmlns: "http://www.w3.org/2000/svg",
2151
- className: "rh-w-full rh-h-full",
2152
- children: /* @__PURE__ */ jsxRuntime.jsx(
2153
- "path",
2154
- {
2155
- d: "M10 4V16M4 10H16",
2156
- stroke: "currentColor",
2157
- strokeWidth: "2",
2158
- strokeLinecap: "round",
2159
- strokeLinejoin: "round"
2160
- }
2161
- )
2162
- }
2163
- )
2164
- }
2165
- )
2166
- ]
2167
- }
2168
- ),
2169
- isOpen && options.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
2170
- "div",
2171
- {
2172
- className: [
2173
- "rh-absolute rh-top-full rh-left-0 rh-right-0 rh-z-50",
2174
- "rh-mt-1 rh-bg-surface rh-border rh-border-border",
2175
- "rh-rounded-[8px] rh-shadow-lg rh-overflow-hidden"
2176
- ].join(" "),
2177
- children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "rh-max-h-[200px] rh-overflow-y-auto", children: options.map((option) => {
2178
- const isSelected = value.some((v) => v.value === option.value);
2179
- return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
2180
- "button",
1997
+ document.addEventListener("mousedown", handleClickOutside);
1998
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1999
+ }, []);
2000
+ const handleRemoveTag = (tagValue) => {
2001
+ if (disabled) return;
2002
+ onChange(value.filter((tag) => tag.value !== tagValue));
2003
+ };
2004
+ const handleToggleOption = (option) => {
2005
+ if (disabled) return;
2006
+ const isSelected = value.some((v) => v.value === option.value);
2007
+ if (isSelected) {
2008
+ onChange(value.filter((v) => v.value !== option.value));
2009
+ } else {
2010
+ onChange([...value, option]);
2011
+ }
2012
+ };
2013
+ const handleAddClick = () => {
2014
+ if (disabled) return;
2015
+ setIsOpen(!isOpen);
2016
+ };
2017
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2018
+ "div",
2019
+ {
2020
+ ref: (node) => {
2021
+ if (typeof ref === "function") ref(node);
2022
+ else if (ref) ref.current = node;
2023
+ containerRef.current = node;
2024
+ },
2025
+ className: ["rh-flex rh-flex-col rh-gap-2 rh-font-body rh-relative", wrapperClassName].filter(Boolean).join(" "),
2026
+ children: [
2027
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
2028
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
2029
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
2030
+ ] }),
2031
+ /* @__PURE__ */ jsxRuntime.jsxs(
2032
+ "div",
2033
+ {
2034
+ onClick: disabled ? void 0 : handleAddClick,
2035
+ className: [
2036
+ "rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
2037
+ "rh-border rh-bg-surface rh-font-body",
2038
+ "rh-transition-colors rh-duration-150",
2039
+ statusClasses3[status],
2040
+ radiusClasses5[radius],
2041
+ sizeClasses9[size],
2042
+ disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
2043
+ className
2044
+ ].filter(Boolean).join(" "),
2045
+ children: [
2046
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-flex-row rh-flex-wrap rh-items-center rh-gap-2 rh-flex-1", children: [
2047
+ value.length === 0 && placeholder && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-text-muted", children: placeholder }),
2048
+ value.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
2049
+ "div",
2181
2050
  {
2182
- type: "button",
2183
- onClick: () => handleToggleOption(option),
2184
2051
  className: [
2185
- "rh-w-full rh-flex rh-items-center rh-justify-between",
2186
- "rh-px-3 rh-py-3 rh-text-left",
2187
- "rh-border-b rh-border-border/50 last:rh-border-b-0",
2188
- "hover:rh-bg-gray-50 rh-transition-colors",
2189
- isSelected ? "rh-text-text" : "rh-text-text-muted"
2052
+ "rh-inline-flex rh-items-center rh-justify-center rh-gap-1",
2053
+ "rh-bg-gray-200 rh-border rh-border-gray-200 rh-rounded-[4px]",
2054
+ tagSizeClasses[size]
2190
2055
  ].join(" "),
2191
2056
  children: [
2192
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-normal", children: option.label }),
2057
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-font-semibold rh-text-gray-700", children: tag.label }),
2193
2058
  /* @__PURE__ */ jsxRuntime.jsx(
2194
- "span",
2059
+ "button",
2195
2060
  {
2061
+ type: "button",
2062
+ onClick: (e) => {
2063
+ e.stopPropagation();
2064
+ handleRemoveTag(tag.value);
2065
+ },
2066
+ disabled,
2196
2067
  className: [
2197
- "rh-w-5 rh-h-5 rh-rounded rh-border-2 rh-flex rh-items-center rh-justify-center",
2198
- isSelected ? "rh-bg-primary rh-border-primary" : "rh-bg-white rh-border-gray-300"
2068
+ "rh-flex rh-items-center rh-justify-center",
2069
+ "rh-bg-white rh-rounded-full",
2070
+ "rh-cursor-pointer hover:rh-bg-gray-100",
2071
+ "disabled:rh-cursor-not-allowed disabled:rh-opacity-50",
2072
+ deleteButtonSizeClasses[size]
2199
2073
  ].join(" "),
2200
- children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
2074
+ "aria-label": `Remover ${tag.label}`,
2075
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2201
2076
  "svg",
2202
2077
  {
2203
- viewBox: "0 0 12 12",
2078
+ viewBox: "0 0 8 8",
2204
2079
  fill: "none",
2205
2080
  xmlns: "http://www.w3.org/2000/svg",
2206
- className: "rh-w-3 rh-h-3",
2081
+ className: "rh-w-[8px] rh-h-[8px]",
2207
2082
  children: /* @__PURE__ */ jsxRuntime.jsx(
2208
2083
  "path",
2209
2084
  {
2210
- d: "M2 6L5 9L10 3",
2211
- stroke: "white",
2212
- strokeWidth: "2",
2085
+ d: "M6 2L2 6M2 2L6 6",
2086
+ stroke: "#374151",
2087
+ strokeWidth: "1.5",
2213
2088
  strokeLinecap: "round",
2214
2089
  strokeLinejoin: "round"
2215
2090
  }
@@ -2219,101 +2094,142 @@ var TagInput = React8.forwardRef(
2219
2094
  }
2220
2095
  )
2221
2096
  ]
2222
- }
2223
- ) }, option.value);
2224
- }) })
2225
- }
2226
- ),
2227
- helperText && /* @__PURE__ */ jsxRuntime.jsx(
2228
- "span",
2229
- {
2230
- id: `${inputId}-helper`,
2231
- className: [
2232
- "rh-flex rh-items-center rh-gap-1 rh-text-xs",
2233
- helperStatusClasses3[status]
2234
- ].join(" "),
2235
- children: helperText
2236
- }
2237
- )
2238
- ]
2239
- }
2240
- );
2241
- }
2242
- );
2243
- var ProgressBar = React8.forwardRef(
2244
- function ProgressBar2({
2245
- value,
2246
- label,
2247
- size = "sm",
2248
- showPercentage = true,
2249
- barColor,
2250
- bgColor,
2251
- className = ""
2252
- }, ref) {
2253
- const clampedValue = Math.min(100, Math.max(0, value));
2254
- if (size === "lg") {
2255
- return /* @__PURE__ */ jsxRuntime.jsxs(
2256
- "div",
2257
- {
2258
- ref,
2259
- className: [
2260
- "rh-flex rh-flex-col rh-items-start rh-gap-2 rh-font-sans",
2261
- className
2262
- ].filter(Boolean).join(" "),
2263
- children: [
2264
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-flex-row rh-justify-between rh-items-start rh-w-full", children: [
2265
- label && /* @__PURE__ */ jsxRuntime.jsx(
2266
- "span",
2097
+ },
2098
+ tag.value
2099
+ ))
2100
+ ] }),
2101
+ /* @__PURE__ */ jsxRuntime.jsx(
2102
+ "button",
2267
2103
  {
2268
- className: "rh-font-sora rh-font-bold rh-text-base rh-leading-6 rh-text-[#374151] rh-flex-1",
2269
- children: label
2104
+ type: "button",
2105
+ onClick: handleAddClick,
2106
+ disabled,
2107
+ className: [
2108
+ "rh-flex rh-items-center rh-justify-center rh-shrink-0",
2109
+ "rh-text-text-muted hover:rh-text-text",
2110
+ "rh-cursor-pointer",
2111
+ "disabled:rh-cursor-not-allowed disabled:rh-opacity-50",
2112
+ addButtonSizeClasses[size]
2113
+ ].join(" "),
2114
+ "aria-label": "Adicionar",
2115
+ "aria-expanded": isOpen,
2116
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2117
+ "svg",
2118
+ {
2119
+ viewBox: "0 0 20 20",
2120
+ fill: "none",
2121
+ xmlns: "http://www.w3.org/2000/svg",
2122
+ className: "rh-w-full rh-h-full",
2123
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2124
+ "path",
2125
+ {
2126
+ d: "M10 4V16M4 10H16",
2127
+ stroke: "currentColor",
2128
+ strokeWidth: "2",
2129
+ strokeLinecap: "round",
2130
+ strokeLinejoin: "round"
2131
+ }
2132
+ )
2133
+ }
2134
+ )
2270
2135
  }
2271
- ),
2272
- showPercentage && /* @__PURE__ */ jsxRuntime.jsxs(
2273
- "span",
2136
+ )
2137
+ ]
2138
+ }
2139
+ ),
2140
+ isOpen && options.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
2141
+ "div",
2142
+ {
2143
+ className: [
2144
+ "rh-absolute rh-top-full rh-left-0 rh-right-0 rh-z-50",
2145
+ "rh-mt-1 rh-bg-surface rh-border rh-border-border",
2146
+ "rh-rounded-[8px] rh-shadow-lg rh-overflow-hidden"
2147
+ ].join(" "),
2148
+ children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "rh-max-h-[200px] rh-overflow-y-auto", children: options.map((option) => {
2149
+ const isSelected = value.some((v) => v.value === option.value);
2150
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
2151
+ "button",
2274
2152
  {
2275
- className: "rh-font-inter rh-font-normal rh-text-sm rh-leading-5 rh-text-[#9CA3AF] rh-tracking-[0.025em] rh-text-right",
2153
+ type: "button",
2154
+ onClick: () => handleToggleOption(option),
2155
+ className: [
2156
+ "rh-w-full rh-flex rh-items-center rh-justify-between",
2157
+ "rh-px-3 rh-py-3 rh-text-left",
2158
+ "rh-border-b rh-border-border/50 last:rh-border-b-0",
2159
+ "hover:rh-bg-gray-50 rh-transition-colors",
2160
+ isSelected ? "rh-text-text" : "rh-text-text-muted"
2161
+ ].join(" "),
2276
2162
  children: [
2277
- clampedValue,
2278
- "%"
2163
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-normal", children: option.label }),
2164
+ /* @__PURE__ */ jsxRuntime.jsx(
2165
+ "span",
2166
+ {
2167
+ className: [
2168
+ "rh-w-5 rh-h-5 rh-rounded rh-border-2 rh-flex rh-items-center rh-justify-center",
2169
+ isSelected ? "rh-bg-primary rh-border-primary" : "rh-bg-white rh-border-gray-300"
2170
+ ].join(" "),
2171
+ children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
2172
+ "svg",
2173
+ {
2174
+ viewBox: "0 0 12 12",
2175
+ fill: "none",
2176
+ xmlns: "http://www.w3.org/2000/svg",
2177
+ className: "rh-w-3 rh-h-3",
2178
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2179
+ "path",
2180
+ {
2181
+ d: "M2 6L5 9L10 3",
2182
+ stroke: "white",
2183
+ strokeWidth: "2",
2184
+ strokeLinecap: "round",
2185
+ strokeLinejoin: "round"
2186
+ }
2187
+ )
2188
+ }
2189
+ )
2190
+ }
2191
+ )
2279
2192
  ]
2280
2193
  }
2281
- )
2282
- ] }),
2283
- /* @__PURE__ */ jsxRuntime.jsx(
2284
- "div",
2285
- {
2286
- className: "rh-w-full rh-h-1 rh-rounded-[40px] rh-overflow-hidden",
2287
- style: { backgroundColor: bgColor || "#E5E7EB" },
2288
- children: /* @__PURE__ */ jsxRuntime.jsx(
2289
- "div",
2290
- {
2291
- className: "rh-h-full rh-rounded-[40px] rh-transition-all rh-duration-300",
2292
- style: {
2293
- width: `${clampedValue}%`,
2294
- backgroundColor: barColor || "#538CC6"
2295
- }
2296
- }
2297
- )
2298
- }
2299
- )
2300
- ]
2301
- }
2302
- );
2194
+ ) }, option.value);
2195
+ }) })
2196
+ }
2197
+ ),
2198
+ helperText && /* @__PURE__ */ jsxRuntime.jsx(
2199
+ "span",
2200
+ {
2201
+ id: `${inputId}-helper`,
2202
+ className: [
2203
+ "rh-flex rh-items-center rh-gap-1 rh-text-xs",
2204
+ helperStatusClasses3[status]
2205
+ ].join(" "),
2206
+ children: helperText
2207
+ }
2208
+ )
2209
+ ]
2303
2210
  }
2211
+ );
2212
+ });
2213
+ var ProgressBar = React8.forwardRef(function ProgressBar2({ value, label, size = "sm", showPercentage = true, barColor, bgColor, className = "" }, ref) {
2214
+ const clampedValue = Math.min(100, Math.max(0, value));
2215
+ if (size === "lg") {
2304
2216
  return /* @__PURE__ */ jsxRuntime.jsxs(
2305
2217
  "div",
2306
2218
  {
2307
2219
  ref,
2308
- className: [
2309
- "rh-flex rh-flex-row rh-items-center rh-gap-2 rh-font-sans",
2310
- className
2311
- ].filter(Boolean).join(" "),
2220
+ className: ["rh-flex rh-flex-col rh-items-start rh-gap-2 rh-font-body", className].filter(Boolean).join(" "),
2312
2221
  children: [
2222
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-flex-row rh-justify-between rh-items-start rh-w-full", children: [
2223
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-font-sora rh-font-bold rh-text-base rh-leading-6 rh-text-[#374151] rh-flex-1", children: label }),
2224
+ showPercentage && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-font-inter rh-font-normal rh-text-sm rh-leading-5 rh-text-[#9CA3AF] rh-tracking-[0.025em] rh-text-right", children: [
2225
+ clampedValue,
2226
+ "%"
2227
+ ] })
2228
+ ] }),
2313
2229
  /* @__PURE__ */ jsxRuntime.jsx(
2314
2230
  "div",
2315
2231
  {
2316
- className: "rh-flex-1 rh-h-1 rh-rounded-[40px] rh-overflow-hidden",
2232
+ className: "rh-w-full rh-h-1 rh-rounded-[40px] rh-overflow-hidden",
2317
2233
  style: { backgroundColor: bgColor || "#E5E7EB" },
2318
2234
  children: /* @__PURE__ */ jsxRuntime.jsx(
2319
2235
  "div",
@@ -2326,22 +2242,42 @@ var ProgressBar = React8.forwardRef(
2326
2242
  }
2327
2243
  )
2328
2244
  }
2329
- ),
2330
- showPercentage && /* @__PURE__ */ jsxRuntime.jsxs(
2331
- "span",
2332
- {
2333
- className: "rh-font-inter rh-font-normal rh-text-sm rh-leading-5 rh-text-[#9CA3AF] rh-tracking-[0.025em] rh-text-right rh-min-w-[40px]",
2334
- children: [
2335
- clampedValue,
2336
- "%"
2337
- ]
2338
- }
2339
2245
  )
2340
2246
  ]
2341
2247
  }
2342
2248
  );
2343
2249
  }
2344
- );
2250
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2251
+ "div",
2252
+ {
2253
+ ref,
2254
+ className: ["rh-flex rh-flex-row rh-items-center rh-gap-2 rh-font-body", className].filter(Boolean).join(" "),
2255
+ children: [
2256
+ /* @__PURE__ */ jsxRuntime.jsx(
2257
+ "div",
2258
+ {
2259
+ className: "rh-flex-1 rh-h-1 rh-rounded-[40px] rh-overflow-hidden",
2260
+ style: { backgroundColor: bgColor || "#E5E7EB" },
2261
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2262
+ "div",
2263
+ {
2264
+ className: "rh-h-full rh-rounded-[40px] rh-transition-all rh-duration-300",
2265
+ style: {
2266
+ width: `${clampedValue}%`,
2267
+ backgroundColor: barColor || "#538CC6"
2268
+ }
2269
+ }
2270
+ )
2271
+ }
2272
+ ),
2273
+ showPercentage && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-font-inter rh-font-normal rh-text-sm rh-leading-5 rh-text-[#9CA3AF] rh-tracking-[0.025em] rh-text-right rh-min-w-[40px]", children: [
2274
+ clampedValue,
2275
+ "%"
2276
+ ] })
2277
+ ]
2278
+ }
2279
+ );
2280
+ });
2345
2281
  var PRESET_COLORS4 = /* @__PURE__ */ new Set([
2346
2282
  "primary",
2347
2283
  "secondary",
@@ -2409,7 +2345,7 @@ function ToggleGroupInner({
2409
2345
  onClick: () => !isDisabled && onChange(option.value),
2410
2346
  className: [
2411
2347
  "rh-flex rh-items-center rh-justify-center rh-h-full",
2412
- "rh-border-0 rh-font-sans rh-font-medium",
2348
+ "rh-border-0 rh-font-display rh-font-medium",
2413
2349
  "rh-transition-all rh-duration-150",
2414
2350
  "focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
2415
2351
  radiusClasses6[radius],
@@ -2469,7 +2405,7 @@ var Card = React8.forwardRef(function Card2({
2469
2405
  tabIndex: isInteractive ? 0 : void 0,
2470
2406
  "aria-disabled": disabled || void 0,
2471
2407
  className: [
2472
- "rh-font-sans rh-transition-all rh-duration-150",
2408
+ "rh-font-body rh-transition-all rh-duration-150",
2473
2409
  variantClasses3[variant],
2474
2410
  radiusClasses7[radius],
2475
2411
  paddingClasses[padding],
@@ -2658,10 +2594,7 @@ function TableInner({
2658
2594
  "table",
2659
2595
  {
2660
2596
  ref,
2661
- className: [
2662
- "rh-w-full rh-border-collapse rh-font-sans",
2663
- className
2664
- ].filter(Boolean).join(" "),
2597
+ className: ["rh-w-full rh-border-collapse rh-font-body", className].filter(Boolean).join(" "),
2665
2598
  ...rest,
2666
2599
  children: [
2667
2600
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "rh-border-b rh-border-border", style: headerStyle, children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(