@khanacademy/wonder-blocks-form 3.1.6 → 3.1.8
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/CHANGELOG.md +24 -0
- package/dist/es/index.js +8 -8
- package/package.json +7 -7
- package/src/components/labeled-text-field.js +5 -11
- package/src/components/text-field.js +5 -12
- package/dist/index.js +0 -1737
- package/docs.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-form
|
|
2
2
|
|
|
3
|
+
## 3.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @khanacademy/wonder-blocks-clickable@2.4.3
|
|
8
|
+
- @khanacademy/wonder-blocks-core@4.6.1
|
|
9
|
+
- @khanacademy/wonder-blocks-icon@1.2.34
|
|
10
|
+
- @khanacademy/wonder-blocks-layout@1.4.14
|
|
11
|
+
- @khanacademy/wonder-blocks-typography@1.1.36
|
|
12
|
+
|
|
13
|
+
## 3.1.7
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- cfbf454c: Rename `TextFieldInternal` to `TextField` (same with `LabeledTextField`)
|
|
18
|
+
- Updated dependencies [b561425a]
|
|
19
|
+
- Updated dependencies [a566e232]
|
|
20
|
+
- Updated dependencies [d2b21a6e]
|
|
21
|
+
- @khanacademy/wonder-blocks-core@4.6.0
|
|
22
|
+
- @khanacademy/wonder-blocks-clickable@2.4.2
|
|
23
|
+
- @khanacademy/wonder-blocks-icon@1.2.33
|
|
24
|
+
- @khanacademy/wonder-blocks-layout@1.4.13
|
|
25
|
+
- @khanacademy/wonder-blocks-typography@1.1.35
|
|
26
|
+
|
|
3
27
|
## 3.1.6
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -641,7 +641,7 @@ class RadioGroup extends React.Component {
|
|
|
641
641
|
const _excluded = ["id", "type", "value", "disabled", "onKeyDown", "placeholder", "light", "style", "testId", "readOnly", "autoComplete", "forwardedRef", "onFocus", "onBlur", "onValidate", "validate", "onChange", "required"];
|
|
642
642
|
const defaultErrorMessage = "This field is required.";
|
|
643
643
|
|
|
644
|
-
class
|
|
644
|
+
class TextField extends React.Component {
|
|
645
645
|
constructor(props) {
|
|
646
646
|
super(props);
|
|
647
647
|
this.state = {
|
|
@@ -762,7 +762,7 @@ class TextFieldInternal extends React.Component {
|
|
|
762
762
|
|
|
763
763
|
}
|
|
764
764
|
|
|
765
|
-
|
|
765
|
+
TextField.defaultProps = {
|
|
766
766
|
type: "text",
|
|
767
767
|
disabled: false,
|
|
768
768
|
light: false
|
|
@@ -817,7 +817,7 @@ const styles$1 = StyleSheet.create({
|
|
|
817
817
|
boxShadow: `0px 0px 0px 1px ${Color.red}, 0px 0px 0px 2px ${Color.white}`
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
|
-
|
|
820
|
+
var TextField$1 = React.forwardRef((props, ref) => React.createElement(TextField, _extends({}, props, {
|
|
821
821
|
forwardedRef: ref
|
|
822
822
|
})));
|
|
823
823
|
|
|
@@ -911,7 +911,7 @@ const styles = StyleSheet.create({
|
|
|
911
911
|
}
|
|
912
912
|
});
|
|
913
913
|
|
|
914
|
-
class
|
|
914
|
+
class LabeledTextField extends React.Component {
|
|
915
915
|
constructor(props) {
|
|
916
916
|
super(props);
|
|
917
917
|
|
|
@@ -988,7 +988,7 @@ class LabeledTextFieldInternal extends React.Component {
|
|
|
988
988
|
id: uniqueId,
|
|
989
989
|
testId: testId,
|
|
990
990
|
style: style,
|
|
991
|
-
field: React.createElement(TextField, {
|
|
991
|
+
field: React.createElement(TextField$1, {
|
|
992
992
|
id: `${uniqueId}-field`,
|
|
993
993
|
"aria-describedby": ariaDescribedby ? ariaDescribedby : `${uniqueId}-error`,
|
|
994
994
|
"aria-invalid": this.state.error ? "true" : "false",
|
|
@@ -1019,13 +1019,13 @@ class LabeledTextFieldInternal extends React.Component {
|
|
|
1019
1019
|
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
|
|
1022
|
+
LabeledTextField.defaultProps = {
|
|
1023
1023
|
type: "text",
|
|
1024
1024
|
disabled: false,
|
|
1025
1025
|
light: false
|
|
1026
1026
|
};
|
|
1027
|
-
|
|
1027
|
+
var labeledTextField = React.forwardRef((props, ref) => React.createElement(LabeledTextField, _extends({}, props, {
|
|
1028
1028
|
forwardedRef: ref
|
|
1029
1029
|
})));
|
|
1030
1030
|
|
|
1031
|
-
export { Checkbox, CheckboxGroup, Choice, LabeledTextField, RadioGroup, TextField };
|
|
1031
|
+
export { Checkbox, CheckboxGroup, Choice, labeledTextField as LabeledTextField, RadioGroup, TextField$1 as TextField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-form",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Form components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^2.4.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^2.4.3",
|
|
20
20
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
22
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
23
|
-
"@khanacademy/wonder-blocks-layout": "^1.4.
|
|
21
|
+
"@khanacademy/wonder-blocks-core": "^4.6.1",
|
|
22
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.34",
|
|
23
|
+
"@khanacademy/wonder-blocks-layout": "^1.4.14",
|
|
24
24
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
25
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
25
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.36"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"aphrodite": "^1.2.5",
|
|
29
29
|
"react": "16.14.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"wb-dev-build-settings": "^0.
|
|
32
|
+
"wb-dev-build-settings": "^0.6.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -163,15 +163,11 @@ type State = {|
|
|
|
163
163
|
focused: boolean,
|
|
164
164
|
|};
|
|
165
165
|
|
|
166
|
-
// TODO(WB-1081): Change class name back to LabeledTextField after Styleguidist is gone.
|
|
167
166
|
/**
|
|
168
167
|
* A LabeledTextField is an element used to accept a single line of text
|
|
169
168
|
* from the user paired with a label, description, and error field elements.
|
|
170
169
|
*/
|
|
171
|
-
class
|
|
172
|
-
PropsWithForwardRef,
|
|
173
|
-
State,
|
|
174
|
-
> {
|
|
170
|
+
class LabeledTextField extends React.Component<PropsWithForwardRef, State> {
|
|
175
171
|
static defaultProps: DefaultProps = {
|
|
176
172
|
type: "text",
|
|
177
173
|
disabled: false,
|
|
@@ -288,7 +284,7 @@ class LabeledTextFieldInternal extends React.Component<
|
|
|
288
284
|
}
|
|
289
285
|
|
|
290
286
|
type ExportProps = $Diff<
|
|
291
|
-
React.ElementConfig<typeof
|
|
287
|
+
React.ElementConfig<typeof LabeledTextField>,
|
|
292
288
|
WithForwardRef,
|
|
293
289
|
>;
|
|
294
290
|
|
|
@@ -312,9 +308,7 @@ type ExportProps = $Diff<
|
|
|
312
308
|
* />
|
|
313
309
|
* ```
|
|
314
310
|
*/
|
|
315
|
-
const LabeledTextField: React.AbstractComponent<ExportProps, HTMLInputElement> =
|
|
316
|
-
React.forwardRef<ExportProps, HTMLInputElement>((props, ref) => (
|
|
317
|
-
<LabeledTextFieldInternal {...props} forwardedRef={ref} />
|
|
318
|
-
));
|
|
319
311
|
|
|
320
|
-
export default
|
|
312
|
+
export default (React.forwardRef<ExportProps, HTMLInputElement>(
|
|
313
|
+
(props, ref) => <LabeledTextField {...props} forwardedRef={ref} />,
|
|
314
|
+
): React.AbstractComponent<ExportProps, HTMLInputElement>);
|
|
@@ -146,11 +146,10 @@ type State = {|
|
|
|
146
146
|
focused: boolean,
|
|
147
147
|
|};
|
|
148
148
|
|
|
149
|
-
// TODO(WB-1081): Change class name back to TextField after Styleguidist is gone.
|
|
150
149
|
/**
|
|
151
150
|
* A TextField is an element used to accept a single line of text from the user.
|
|
152
151
|
*/
|
|
153
|
-
class
|
|
152
|
+
class TextField extends React.Component<PropsWithForwardRef, State> {
|
|
154
153
|
static defaultProps: DefaultProps = {
|
|
155
154
|
type: "text",
|
|
156
155
|
disabled: false,
|
|
@@ -343,10 +342,7 @@ const styles = StyleSheet.create({
|
|
|
343
342
|
},
|
|
344
343
|
});
|
|
345
344
|
|
|
346
|
-
type ExportProps = $Diff<
|
|
347
|
-
React.ElementConfig<typeof TextFieldInternal>,
|
|
348
|
-
WithForwardRef,
|
|
349
|
-
>;
|
|
345
|
+
type ExportProps = $Diff<React.ElementConfig<typeof TextField>, WithForwardRef>;
|
|
350
346
|
|
|
351
347
|
/**
|
|
352
348
|
* A TextField is an element used to accept a single line of text from the user.
|
|
@@ -365,9 +361,6 @@ type ExportProps = $Diff<
|
|
|
365
361
|
* />
|
|
366
362
|
* ```
|
|
367
363
|
*/
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
));
|
|
372
|
-
|
|
373
|
-
export default TextField;
|
|
364
|
+
export default (React.forwardRef<ExportProps, HTMLInputElement>(
|
|
365
|
+
(props, ref) => <TextField {...props} forwardedRef={ref} />,
|
|
366
|
+
): React.AbstractComponent<ExportProps, HTMLInputElement>);
|