@aveonline/ui-react 1.14.2 → 1.14.3

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.
@@ -15,5 +15,9 @@ interface ISwitch {
15
15
  * The function to call when the switch is toggled.
16
16
  */
17
17
  onChange(checked: boolean): void;
18
+ /**
19
+ * Frozen state current
20
+ */
21
+ hasFrozenState?: boolean;
18
22
  }
19
23
  export type { ISwitch };
@@ -1,7 +1,7 @@
1
1
  import type { ISwitch } from './ISwitch';
2
2
  /**
3
- * Atoms: Switch
3
+ * Atom: Switch
4
4
  * Switches toggle the state of a single item on or off.
5
5
  */
6
- declare function Switch({ onChange, isSelected, isDisabled, name, ...props }: ISwitch): JSX.Element;
6
+ declare function Switch({ onChange, isSelected, isDisabled, name, hasFrozenState, ...props }: ISwitch): JSX.Element;
7
7
  export default Switch;
package/dist/ui-react.mjs CHANGED
@@ -3701,30 +3701,33 @@ function D8({
3701
3701
  isSelected: t = !1,
3702
3702
  isDisabled: n,
3703
3703
  name: i = "",
3704
- ...r
3704
+ hasFrozenState: r = !1,
3705
+ ...o
3705
3706
  }) {
3706
- const [o, a] = j(t), l = (u) => {
3707
- a(u), e(u);
3708
- }, s = ({
3709
- checked: u
3710
- }) => n ? "bg-surface-disabled" : u ? "bg-action-primary-default" : "bg-action-primary-disabled";
3707
+ const [a, l] = j(t), s = (c) => {
3708
+ if (r)
3709
+ return l(!c), e(!c);
3710
+ l(c), e(c);
3711
+ }, u = ({
3712
+ checked: c
3713
+ }) => n ? "bg-surface-disabled" : c ? "bg-action-primary-default" : "bg-action-primary-disabled";
3711
3714
  return /* @__PURE__ */ d(Ks, {
3712
3715
  name: i,
3713
- checked: o,
3714
- onChange: l,
3716
+ checked: a,
3717
+ onChange: s,
3715
3718
  as: we,
3716
- ...r,
3719
+ ...o,
3717
3720
  children: ({
3718
- checked: u
3721
+ checked: c
3719
3722
  }) => /* @__PURE__ */ M("button", {
3720
3723
  disabled: n,
3721
- className: D("relative inline-flex h-6 w-12 items-center rounded-full", s({
3722
- checked: u
3724
+ className: D("relative inline-flex h-6 w-12 items-center rounded-full", u({
3725
+ checked: c
3723
3726
  })),
3724
3727
  children: [/* @__PURE__ */ d("span", {
3725
3728
  className: "sr-only"
3726
3729
  }), /* @__PURE__ */ d("span", {
3727
- className: D("inline-block h-4 w-4 transform rounded-full transition", u ? "translate-x-7" : "translate-x-1", n ? "bg-icon-disabled" : "bg-icon-on")
3730
+ className: D("inline-block h-4 w-4 transform rounded-full transition", c ? "translate-x-7" : "translate-x-1", n ? "bg-icon-disabled" : "bg-icon-on")
3728
3731
  })]
3729
3732
  })
3730
3733
  });