@trackunit/react-form-components 1.0.8 → 1.0.10

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/index.cjs.js CHANGED
@@ -512,6 +512,12 @@ const cvaCheckbox = cssClassVarianceUtilities.cvaMerge([
512
512
  "active:bg-slate-300",
513
513
  "group-active:ring-0",
514
514
  "group-active:ring-inset",
515
+ "hover:bg-slate-300",
516
+ "hover:border-slate-300",
517
+ "group-hover:bg-slate-300",
518
+ "group-hover:border-slate-300",
519
+ "active:bg-slate-300",
520
+ "group-active:ring-0",
515
521
  ],
516
522
  false: "",
517
523
  },
@@ -578,7 +584,7 @@ const Checkbox = React__namespace.forwardRef(({ className, dataTestId = "checkbo
578
584
  const icon = indeterminate ? (jsxRuntime.jsx(IndeterminateIcon, { className: cvaCheckboxIcon() })) : (checked && jsxRuntime.jsx(CheckIcon, { className: cvaCheckboxIcon() }));
579
585
  const internalRef = React__namespace.useRef(null);
580
586
  const labelRef = React__namespace.useRef(null);
581
- const textIsCutOff = reactComponents.useIsTextCutOff(labelRef.current);
587
+ const textIsCutOff = reactComponents.useIsTextCutOff(labelRef);
582
588
  const isReadonly = disabled || readOnly;
583
589
  const onKeyPress = e => {
584
590
  var _a, _b;
@@ -1488,8 +1494,8 @@ const RadioItem = ({ label, value, dataTestId, className, description, suffix, .
1488
1494
  const isChecked = (groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.value) === value;
1489
1495
  const labelRef = React.useRef(null);
1490
1496
  const descriptionRef = React.useRef(null);
1491
- const labelTextIsCutOff = reactComponents.useIsTextCutOff(labelRef.current);
1492
- const descriptionTextIsCutOff = reactComponents.useIsTextCutOff(descriptionRef.current);
1497
+ const labelTextIsCutOff = reactComponents.useIsTextCutOff(labelRef);
1498
+ const descriptionTextIsCutOff = reactComponents.useIsTextCutOff(descriptionRef);
1493
1499
  const descriptionId = description ? `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id}-${value}-description` : undefined;
1494
1500
  const inputId = `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id}-${value}`;
1495
1501
  return (jsxRuntime.jsxs("label", { className: cvaRadioItemWrapper({ className }), "data-testid": dataTestId ? `${dataTestId}-Wrapper` : undefined, htmlFor: inputId, children: [jsxRuntime.jsx("input", { "aria-describedby": descriptionId, checked: isChecked, className: cvaRadioItem({
package/index.esm.js CHANGED
@@ -493,6 +493,12 @@ const cvaCheckbox = cvaMerge([
493
493
  "active:bg-slate-300",
494
494
  "group-active:ring-0",
495
495
  "group-active:ring-inset",
496
+ "hover:bg-slate-300",
497
+ "hover:border-slate-300",
498
+ "group-hover:bg-slate-300",
499
+ "group-hover:border-slate-300",
500
+ "active:bg-slate-300",
501
+ "group-active:ring-0",
496
502
  ],
497
503
  false: "",
498
504
  },
@@ -559,7 +565,7 @@ const Checkbox = React.forwardRef(({ className, dataTestId = "checkbox", onChang
559
565
  const icon = indeterminate ? (jsx(IndeterminateIcon, { className: cvaCheckboxIcon() })) : (checked && jsx(CheckIcon, { className: cvaCheckboxIcon() }));
560
566
  const internalRef = React.useRef(null);
561
567
  const labelRef = React.useRef(null);
562
- const textIsCutOff = useIsTextCutOff(labelRef.current);
568
+ const textIsCutOff = useIsTextCutOff(labelRef);
563
569
  const isReadonly = disabled || readOnly;
564
570
  const onKeyPress = e => {
565
571
  var _a, _b;
@@ -1469,8 +1475,8 @@ const RadioItem = ({ label, value, dataTestId, className, description, suffix, .
1469
1475
  const isChecked = (groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.value) === value;
1470
1476
  const labelRef = useRef(null);
1471
1477
  const descriptionRef = useRef(null);
1472
- const labelTextIsCutOff = useIsTextCutOff(labelRef.current);
1473
- const descriptionTextIsCutOff = useIsTextCutOff(descriptionRef.current);
1478
+ const labelTextIsCutOff = useIsTextCutOff(labelRef);
1479
+ const descriptionTextIsCutOff = useIsTextCutOff(descriptionRef);
1474
1480
  const descriptionId = description ? `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id}-${value}-description` : undefined;
1475
1481
  const inputId = `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id}-${value}`;
1476
1482
  return (jsxs("label", { className: cvaRadioItemWrapper({ className }), "data-testid": dataTestId ? `${dataTestId}-Wrapper` : undefined, htmlFor: inputId, children: [jsx("input", { "aria-describedby": descriptionId, checked: isChecked, className: cvaRadioItem({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -18,7 +18,7 @@
18
18
  "react-hook-form": "7.53.1",
19
19
  "tailwind-merge": "^2.0.0",
20
20
  "@trackunit/css-class-variance-utilities": "^1.0.1",
21
- "@trackunit/react-components": "^1.0.8",
21
+ "@trackunit/react-components": "^1.0.9",
22
22
  "@trackunit/ui-icons": "^1.0.1",
23
23
  "@trackunit/shared-utils": "^1.0.2",
24
24
  "@trackunit/i18n-library-translation": "^1.0.3"