@draftbit/core 42.4.6-75ef33.0 → 42.4.6-7e6a42.0
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/lib/commonjs/components/Checkbox/Checkbox.js +6 -27
- package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +7 -13
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Switch.js +2 -1
- package/lib/commonjs/components/Switch.js.map +1 -1
- package/lib/commonjs/mappings/Checkbox.js +0 -11
- package/lib/commonjs/mappings/Checkbox.js.map +1 -1
- package/lib/commonjs/mappings/TextInput.js +1 -4
- package/lib/commonjs/mappings/TextInput.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +5 -24
- package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/Checkbox/CheckboxRow.js +7 -13
- package/lib/module/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/module/components/Switch.js +2 -1
- package/lib/module/components/Switch.js.map +1 -1
- package/lib/module/mappings/Checkbox.js +0 -11
- package/lib/module/mappings/Checkbox.js.map +1 -1
- package/lib/module/mappings/TextInput.js +1 -4
- package/lib/module/mappings/TextInput.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -9
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +1 -12
- package/lib/typescript/src/components/Switch.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Checkbox/Checkbox.js +8 -24
- package/src/components/Checkbox/Checkbox.tsx +10 -34
- package/src/components/Checkbox/CheckboxRow.js +7 -13
- package/src/components/Checkbox/CheckboxRow.tsx +8 -19
- package/src/components/Switch.js +2 -2
- package/src/components/Switch.tsx +2 -1
- package/src/mappings/Checkbox.js +0 -11
- package/src/mappings/TextInput.js +0 -4
|
@@ -107,6 +107,7 @@ function Row({
|
|
|
107
107
|
direction = RowDirection.Row,
|
|
108
108
|
style,
|
|
109
109
|
value,
|
|
110
|
+
defaultValue,
|
|
110
111
|
disabled,
|
|
111
112
|
onValueChange,
|
|
112
113
|
activeTrackColor,
|
|
@@ -116,7 +117,7 @@ function Row({
|
|
|
116
117
|
theme,
|
|
117
118
|
...rest
|
|
118
119
|
}: Props & RowProps) {
|
|
119
|
-
const [checked, setChecked] = React.useState(value);
|
|
120
|
+
const [checked, setChecked] = React.useState(value || defaultValue);
|
|
120
121
|
|
|
121
122
|
React.useEffect(() => {
|
|
122
123
|
if (value !== checked) {
|
package/src/mappings/Checkbox.js
CHANGED
|
@@ -32,12 +32,6 @@ export const SEED_DATA = {
|
|
|
32
32
|
description: "Color for the button when the checkbox is unchecked",
|
|
33
33
|
defaultValue: null,
|
|
34
34
|
}),
|
|
35
|
-
indeterminateColor: createColorProp({
|
|
36
|
-
group: GROUPS.basic,
|
|
37
|
-
label: "Indeterminate Color",
|
|
38
|
-
description: "Color for the button when the checkbox is indeterminate",
|
|
39
|
-
defaultValue: null,
|
|
40
|
-
}),
|
|
41
35
|
disabled: createBoolProp({
|
|
42
36
|
label: "Disabled",
|
|
43
37
|
description: "Whether the checkbox is disabled",
|
|
@@ -57,10 +51,5 @@ export const SEED_DATA = {
|
|
|
57
51
|
description: 'Icon to show when the checkbox status is "unchecked"',
|
|
58
52
|
defaultValue: null,
|
|
59
53
|
}),
|
|
60
|
-
indeterminateIcon: createIconProp({
|
|
61
|
-
label: "Indeterminate Icon",
|
|
62
|
-
description: 'Icon to show when the checkbox status is "indeterminate"',
|
|
63
|
-
defaultValue: null,
|
|
64
|
-
}),
|
|
65
54
|
},
|
|
66
55
|
};
|