@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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ISwitch } from './ISwitch';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
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
|
-
|
|
3704
|
+
hasFrozenState: r = !1,
|
|
3705
|
+
...o
|
|
3705
3706
|
}) {
|
|
3706
|
-
const [
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
}
|
|
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:
|
|
3714
|
-
onChange:
|
|
3716
|
+
checked: a,
|
|
3717
|
+
onChange: s,
|
|
3715
3718
|
as: we,
|
|
3716
|
-
...
|
|
3719
|
+
...o,
|
|
3717
3720
|
children: ({
|
|
3718
|
-
checked:
|
|
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",
|
|
3722
|
-
checked:
|
|
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",
|
|
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
|
});
|