@idds/react 1.5.11 → 1.5.12

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.es.js CHANGED
@@ -10470,7 +10470,9 @@ function Toggle({
10470
10470
  "aria-describedby": ariaDescribedBy,
10471
10471
  id,
10472
10472
  name,
10473
- value
10473
+ value,
10474
+ color,
10475
+ ...rest
10474
10476
  }) {
10475
10477
  const isControlled = controlledChecked !== void 0;
10476
10478
  const [internalChecked, setInternalChecked] = useState(defaultChecked);
@@ -10558,6 +10560,7 @@ function Toggle({
10558
10560
  "ina-toggle__thumb--disabled": disabled
10559
10561
  }
10560
10562
  );
10563
+ const trackStyle = checked && color && !disabled ? { backgroundColor: color, borderColor: color } : {};
10561
10564
  return /* @__PURE__ */ jsxs(
10562
10565
  "div",
10563
10566
  {
@@ -10571,6 +10574,7 @@ function Toggle({
10571
10574
  /* @__PURE__ */ jsx(
10572
10575
  "input",
10573
10576
  {
10577
+ ...rest,
10574
10578
  type: "checkbox",
10575
10579
  id,
10576
10580
  name,
@@ -10586,7 +10590,14 @@ function Toggle({
10586
10590
  readOnly: true
10587
10591
  }
10588
10592
  ),
10589
- /* @__PURE__ */ jsx("div", { className: trackClasses, style: { pointerEvents: "none" }, children: /* @__PURE__ */ jsx("div", { className: thumbClasses }) })
10593
+ /* @__PURE__ */ jsx(
10594
+ "div",
10595
+ {
10596
+ className: trackClasses,
10597
+ style: { pointerEvents: "none", ...trackStyle },
10598
+ children: /* @__PURE__ */ jsx("div", { className: thumbClasses })
10599
+ }
10600
+ )
10590
10601
  ]
10591
10602
  }
10592
10603
  );