infinity-ui-elements 1.8.59 → 1.8.61

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.esm.js CHANGED
@@ -38,9 +38,10 @@ import { flexRender } from '@tanstack/react-table';
38
38
  */
39
39
  const iconRegistry = {
40
40
  // Tick/Check icon
41
- tick: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
42
- <path d="M10.364 15.1924L19.5564 6L20.9706 7.41421L10.364 18.0208L4 11.6569L5.41422 10.2427L10.364 15.1924Z" fill="#081416"/>
43
- </svg>`,
41
+ tick: `<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
42
+ <path d="M7.99907 1.77063L8.63188 2.42981L8.69829 2.49915L8.63188 2.56848L3.88188 7.50891L3.80962 7.58411L3.73833 7.50891L0.887741 4.54504L0.821335 4.47571L0.887741 4.40637L1.52153 3.74719L1.5938 3.672L1.66508 3.74719L3.80962 5.97766L7.85454 1.77063L7.9268 1.69543L7.99907 1.77063Z" fill="white" stroke="white" stroke-width="0.2"/>
43
+ </svg>
44
+ `,
44
45
  // Alias: check points to the same icon as tick
45
46
  check: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
47
  <path d="M10.364 15.1924L19.5564 6L20.9706 7.41421L10.364 18.0208L4 11.6569L5.41422 10.2427L10.364 15.1924Z" fill="#081416"/>
@@ -1493,9 +1494,9 @@ FormFooter.displayName = "FormFooter";
1493
1494
  const checkboxVariants = cva("relative inline-flex items-center justify-center shrink-0 transition-all cursor-pointer box-border", {
1494
1495
  variants: {
1495
1496
  size: {
1496
- small: "w-[10px] h-[10px] rounded-small border-[1.5px]",
1497
- medium: "w-[12px] h-[12px] rounded-small border-[1.5px]",
1498
- large: "w-[16px] h-[16px] rounded-medium border-[2px]",
1497
+ small: "w-[14px] h-[14px] rounded-small border-[1.5px]",
1498
+ medium: "w-[16px] h-[16px] rounded-small border-[1.5px]",
1499
+ large: "w-[20px] h-[20px] rounded-medium border-[2px]",
1499
1500
  },
1500
1501
  validationState: {
1501
1502
  none: "",
@@ -1563,7 +1564,6 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1563
1564
  const [internalChecked, setInternalChecked] = React.useState(false);
1564
1565
  const [showRipple, setShowRipple] = React.useState(false);
1565
1566
  const inputRef = React.useRef(null);
1566
- const rippleTimeoutRef = React.useRef(null);
1567
1567
  // Use forwarded ref or internal ref
1568
1568
  React.useImperativeHandle(ref, () => inputRef.current);
1569
1569
  const isChecked = checked !== undefined ? checked : internalChecked;
@@ -1573,14 +1573,6 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1573
1573
  inputRef.current.indeterminate = isIndeterminate;
1574
1574
  }
1575
1575
  }, [isIndeterminate]);
1576
- // Cleanup timeout on unmount
1577
- React.useEffect(() => {
1578
- return () => {
1579
- if (rippleTimeoutRef.current) {
1580
- clearTimeout(rippleTimeoutRef.current);
1581
- }
1582
- };
1583
- }, []);
1584
1576
  const handleChange = (e) => {
1585
1577
  if (onChange) {
1586
1578
  onChange(e);
@@ -1590,28 +1582,31 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1590
1582
  }
1591
1583
  };
1592
1584
  const triggerRipple = () => {
1593
- if (!isDisabled && !showRipple) {
1594
- // Clear any existing timeout
1595
- if (rippleTimeoutRef.current) {
1596
- clearTimeout(rippleTimeoutRef.current);
1597
- }
1585
+ if (!isDisabled) {
1598
1586
  setShowRipple(true);
1599
- rippleTimeoutRef.current = setTimeout(() => {
1587
+ setTimeout(() => {
1600
1588
  setShowRipple(false);
1601
- rippleTimeoutRef.current = null;
1602
- }, 400); // Match animation duration (0.4s)
1589
+ }, 360); // Match animation duration (0.36s)
1603
1590
  }
1604
1591
  };
1605
1592
  const handleContainerClick = () => {
1606
1593
  if (!isDisabled && inputRef.current) {
1607
- triggerRipple();
1594
+ // Only show ripple when checking or entering indeterminate state (not unchecking)
1595
+ const willBeChecked = !isChecked || isIndeterminate;
1596
+ if (willBeChecked) {
1597
+ triggerRipple();
1598
+ }
1608
1599
  inputRef.current.click();
1609
1600
  }
1610
1601
  };
1611
1602
  const handleKeyDown = (e) => {
1612
1603
  if ((e.key === " " || e.key === "Enter") && !isDisabled) {
1613
1604
  e.preventDefault();
1614
- triggerRipple();
1605
+ // Only show ripple when checking or entering indeterminate state (not unchecking)
1606
+ const willBeChecked = !isChecked || isIndeterminate;
1607
+ if (willBeChecked) {
1608
+ triggerRipple();
1609
+ }
1615
1610
  inputRef.current?.click();
1616
1611
  }
1617
1612
  };
@@ -1620,23 +1615,23 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
1620
1615
  small: {
1621
1616
  gap: "gap-2",
1622
1617
  labelSize: "text-body-small-regular",
1623
- iconSize: 10,
1618
+ iconSize: 7,
1624
1619
  },
1625
1620
  medium: {
1626
1621
  gap: "gap-2",
1627
1622
  labelSize: "text-body-small-regular",
1628
- iconSize: 12,
1623
+ iconSize: 9.6,
1629
1624
  },
1630
1625
  large: {
1631
1626
  gap: "gap-3",
1632
1627
  labelSize: "text-body-medium-regular",
1633
- iconSize: 14,
1628
+ iconSize: 13.33,
1634
1629
  },
1635
1630
  };
1636
1631
  const config = sizeConfig[size];
1637
1632
  // Determine if we should show the error text
1638
1633
  const shouldShowError = errorText && showErrorText;
1639
- return (jsxs("div", { className: cn("inline-flex flex-col px-2", containerClassName), children: [jsxs("div", { className: cn("inline-flex items-center", config.gap, isDisabled ? "cursor-not-allowed" : "cursor-pointer"), onClick: handleContainerClick, onKeyDown: handleKeyDown, role: "checkbox", "aria-checked": isIndeterminate ? "mixed" : isChecked, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : 0, children: [jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsx("div", { className: cn("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full pointer-events-none w-full h-full", validationState === "error"
1634
+ return (jsxs("div", { className: cn("inline-flex flex-col py-0.5", containerClassName), children: [jsxs("div", { className: cn("inline-flex items-center", config.gap, isDisabled ? "cursor-not-allowed" : "cursor-pointer"), onClick: handleContainerClick, onKeyDown: handleKeyDown, role: "checkbox", "aria-checked": isIndeterminate ? "mixed" : isChecked, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : 0, children: [jsx("input", { ref: inputRef, type: "checkbox", className: "sr-only", checked: isChecked, onChange: handleChange, disabled: isDisabled, ...props }), jsxs("div", { className: "relative inline-flex shrink-0", children: [showRipple && (jsx("div", { className: cn("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full pointer-events-none w-full h-full", validationState === "error"
1640
1635
  ? "bg-action-outline-negative-faded"
1641
1636
  : "bg-action-outline-primary-faded"), style: {
1642
1637
  animation: "var(--animate-checkbox-ripple)",
@@ -2851,6 +2846,7 @@ const textFieldVariants = cva("relative flex items-center gap-3 border rounded-l
2851
2846
  hover:border-action-outline-neutral-faded-hover
2852
2847
  hover:bg-action-fill-neutral-faded-hover
2853
2848
  focus-within:border-action-outline-primary-default
2849
+ focus-within:bg-white!
2854
2850
  focus-within:ring-2
2855
2851
  ring-surface-outline-primary-muted`,
2856
2852
  positive: `
@@ -4680,10 +4676,12 @@ const textAreaVariants = cva("relative flex flex-col border rounded-large transi
4680
4676
  validationState: {
4681
4677
  none: `
4682
4678
  border-action-outline-neutral-faded
4683
- hover:border-action-outline-primary-hover
4684
- focus-within:border-action-outline-primary-hover
4679
+ hover:border-action-outline-neutral-faded-hover
4680
+ hover:bg-action-fill-neutral-faded-hover
4681
+ focus-within:border-action-outline-primary-default
4682
+ focus-within:bg-white!
4685
4683
  focus-within:ring-2
4686
- ring-action-outline-primary-faded-hover`,
4684
+ ring-surface-outline-primary-muted`,
4687
4685
  positive: `
4688
4686
  border-action-outline-positive-default
4689
4687
  focus-within:border-action-outline-positive-hover
@@ -4696,11 +4694,13 @@ const textAreaVariants = cva("relative flex flex-col border rounded-large transi
4696
4694
  },
4697
4695
  isDisabled: {
4698
4696
  true: `
4699
- border-[var(--border-width-thinner)]
4700
- hover:border-action-outline-neutral-disabled
4697
+ border
4701
4698
  border-action-outline-neutral-disabled
4702
- bg-surface-fill-neutral-intense cursor-not-allowed opacity-60`,
4703
- false: "bg-surface-fill-neutral-intense",
4699
+ hover:border-action-outline-neutral-disabled
4700
+ bg-surface-fill-neutral-intense
4701
+ hover:bg-surface-fill-neutral-intense
4702
+ cursor-not-allowed`,
4703
+ false: "",
4704
4704
  },
4705
4705
  },
4706
4706
  defaultVariants: {