qstd 0.3.40 → 0.3.41
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/block/checkbox.d.ts.map +1 -1
- package/dist/react/index.cjs +17 -3
- package/dist/react/index.js +17 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/block/checkbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAO9B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/block/checkbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAO9B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,2CAgH5D"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -3746,7 +3746,13 @@ var Base6 = base;
|
|
|
3746
3746
|
var Svg = motionTags.svg;
|
|
3747
3747
|
var CheckboxBtn = motionTags.button;
|
|
3748
3748
|
function Checkbox(props) {
|
|
3749
|
-
const {
|
|
3749
|
+
const {
|
|
3750
|
+
children,
|
|
3751
|
+
onClick: _onClick,
|
|
3752
|
+
onAnimationStart: _onAnimationStart,
|
|
3753
|
+
onAnimationComplete: _onAnimationComplete,
|
|
3754
|
+
...rest
|
|
3755
|
+
} = props;
|
|
3750
3756
|
const [checked, setChecked] = React13__namespace.default.useState(false);
|
|
3751
3757
|
const [indeterminate, setIndeterminate] = React13__namespace.default.useState(false);
|
|
3752
3758
|
React13__namespace.default.useEffect(() => {
|
|
@@ -3756,6 +3762,10 @@ function Checkbox(props) {
|
|
|
3756
3762
|
setIndeterminate(!!rest.indeterminate);
|
|
3757
3763
|
}, [rest.indeterminate]);
|
|
3758
3764
|
const isIndeterminate = typeof rest.indeterminate === "boolean";
|
|
3765
|
+
const checkboxSelector = rest._checkbox;
|
|
3766
|
+
const hasCheckboxBg = checkboxSelector && hasAnyProp(checkboxSelector, ["bg", "background", "backgroundColor"]);
|
|
3767
|
+
const checkedSelector = rest._checked;
|
|
3768
|
+
const hasCheckedBg = checkedSelector && hasAnyProp(checkedSelector, ["bg", "background", "backgroundColor"]);
|
|
3759
3769
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3760
3770
|
Base6,
|
|
3761
3771
|
{
|
|
@@ -3780,8 +3790,12 @@ function Checkbox(props) {
|
|
|
3780
3790
|
cursor: "pointer",
|
|
3781
3791
|
boxSizing: "border-box",
|
|
3782
3792
|
outline: "none !important",
|
|
3783
|
-
|
|
3784
|
-
|
|
3793
|
+
...!hasCheckboxBg && {
|
|
3794
|
+
bg: { base: "neutral.200", _dark: "neutral.700" }
|
|
3795
|
+
},
|
|
3796
|
+
...!hasCheckedBg && {
|
|
3797
|
+
_checked: { bg: "blue.500", transition: ".14s background ease-out" }
|
|
3798
|
+
},
|
|
3785
3799
|
_active: { scale: 0.9 },
|
|
3786
3800
|
color: "neutral.100",
|
|
3787
3801
|
transition: ".14s background ease-out .1s",
|
package/dist/react/index.js
CHANGED
|
@@ -3723,7 +3723,13 @@ var Base6 = base;
|
|
|
3723
3723
|
var Svg = motionTags.svg;
|
|
3724
3724
|
var CheckboxBtn = motionTags.button;
|
|
3725
3725
|
function Checkbox(props) {
|
|
3726
|
-
const {
|
|
3726
|
+
const {
|
|
3727
|
+
children,
|
|
3728
|
+
onClick: _onClick,
|
|
3729
|
+
onAnimationStart: _onAnimationStart,
|
|
3730
|
+
onAnimationComplete: _onAnimationComplete,
|
|
3731
|
+
...rest
|
|
3732
|
+
} = props;
|
|
3727
3733
|
const [checked, setChecked] = React13__default.useState(false);
|
|
3728
3734
|
const [indeterminate, setIndeterminate] = React13__default.useState(false);
|
|
3729
3735
|
React13__default.useEffect(() => {
|
|
@@ -3733,6 +3739,10 @@ function Checkbox(props) {
|
|
|
3733
3739
|
setIndeterminate(!!rest.indeterminate);
|
|
3734
3740
|
}, [rest.indeterminate]);
|
|
3735
3741
|
const isIndeterminate = typeof rest.indeterminate === "boolean";
|
|
3742
|
+
const checkboxSelector = rest._checkbox;
|
|
3743
|
+
const hasCheckboxBg = checkboxSelector && hasAnyProp(checkboxSelector, ["bg", "background", "backgroundColor"]);
|
|
3744
|
+
const checkedSelector = rest._checked;
|
|
3745
|
+
const hasCheckedBg = checkedSelector && hasAnyProp(checkedSelector, ["bg", "background", "backgroundColor"]);
|
|
3736
3746
|
return /* @__PURE__ */ jsxs(
|
|
3737
3747
|
Base6,
|
|
3738
3748
|
{
|
|
@@ -3757,8 +3767,12 @@ function Checkbox(props) {
|
|
|
3757
3767
|
cursor: "pointer",
|
|
3758
3768
|
boxSizing: "border-box",
|
|
3759
3769
|
outline: "none !important",
|
|
3760
|
-
|
|
3761
|
-
|
|
3770
|
+
...!hasCheckboxBg && {
|
|
3771
|
+
bg: { base: "neutral.200", _dark: "neutral.700" }
|
|
3772
|
+
},
|
|
3773
|
+
...!hasCheckedBg && {
|
|
3774
|
+
_checked: { bg: "blue.500", transition: ".14s background ease-out" }
|
|
3775
|
+
},
|
|
3762
3776
|
_active: { scale: 0.9 },
|
|
3763
3777
|
color: "neutral.100",
|
|
3764
3778
|
transition: ".14s background ease-out .1s",
|