@khanacademy/wonder-blocks-form 4.3.1 → 4.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @khanacademy/wonder-blocks-form
2
2
 
3
+ ## 4.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [8c77f29d]
8
+ - Updated dependencies [674a1e5c]
9
+ - Updated dependencies [674a1e5c]
10
+ - Updated dependencies [674a1e5c]
11
+ - @khanacademy/wonder-blocks-clickable@4.0.0
12
+ - @khanacademy/wonder-blocks-core@6.0.0
13
+ - @khanacademy/wonder-blocks-icon@2.1.1
14
+ - @khanacademy/wonder-blocks-layout@2.0.17
15
+ - @khanacademy/wonder-blocks-typography@2.1.3
16
+
17
+ ## 4.3.2
18
+
19
+ ### Patch Changes
20
+
21
+ - 4f8133ed: Fix props so `variants` doesn't show up in underlying input attributes
22
+ - Updated dependencies [ec6a33a4]
23
+ - Updated dependencies [1344436f]
24
+ - @khanacademy/wonder-blocks-icon@2.1.0
25
+ - @khanacademy/wonder-blocks-core@5.4.0
26
+ - @khanacademy/wonder-blocks-clickable@3.1.3
27
+ - @khanacademy/wonder-blocks-layout@2.0.16
28
+ - @khanacademy/wonder-blocks-typography@2.1.2
29
+
3
30
  ## 4.3.1
4
31
 
5
32
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -35,7 +35,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
35
35
  return target;
36
36
  }
37
37
 
38
- const _excluded$4 = ["checked", "disabled", "error", "groupName", "id", "testId"];
38
+ const _excluded$5 = ["checked", "disabled", "error", "groupName", "id", "testId"];
39
39
  function mapCheckedToAriaChecked(value) {
40
40
  switch (value) {
41
41
  case true:
@@ -71,7 +71,7 @@ const CheckboxCore = React.forwardRef(function CheckboxCore(props, ref) {
71
71
  id,
72
72
  testId
73
73
  } = props,
74
- sharedProps = _objectWithoutPropertiesLoose(props, _excluded$4);
74
+ sharedProps = _objectWithoutPropertiesLoose(props, _excluded$5);
75
75
  const innerRef = React.useRef(null);
76
76
  React.useEffect(() => {
77
77
  if (innerRef.current != null) {
@@ -209,7 +209,7 @@ const _generateStyles$1 = (checked, error) => {
209
209
  return styles$5[styleKey];
210
210
  };
211
211
 
212
- const _excluded$3 = ["checked", "disabled", "error", "groupName", "id", "testId"];
212
+ const _excluded$4 = ["checked", "disabled", "error", "groupName", "id", "testId"];
213
213
  const {
214
214
  blue,
215
215
  red,
@@ -232,7 +232,7 @@ const RadioCore = React.forwardRef(function RadioCore(props, ref) {
232
232
  id,
233
233
  testId
234
234
  } = props,
235
- sharedProps = _objectWithoutPropertiesLoose(props, _excluded$3);
235
+ sharedProps = _objectWithoutPropertiesLoose(props, _excluded$4);
236
236
  const stateStyles = _generateStyles(checked, error);
237
237
  const defaultStyle = [sharedStyles.inputReset, sharedStyles.default, !disabled && stateStyles.default, disabled && sharedStyles.disabled];
238
238
  return React.createElement(React.Fragment, null, React.createElement(StyledInput$1, _extends({}, sharedProps, {
@@ -354,19 +354,21 @@ const _generateStyles = (checked, error) => {
354
354
  return styles$4[styleKey];
355
355
  };
356
356
 
357
+ const _excluded$3 = ["checked", "description", "disabled", "error", "id", "label", "onChange", "style", "className", "variant"];
357
358
  const ChoiceInternal = React.forwardRef(function ChoiceInternal(props, ref) {
358
359
  const {
359
- checked,
360
- description,
361
- disabled = false,
362
- error = false,
363
- id,
364
- label,
365
- onChange,
366
- style,
367
- className,
368
- variant
369
- } = props;
360
+ checked,
361
+ description,
362
+ disabled = false,
363
+ error = false,
364
+ id,
365
+ label,
366
+ onChange,
367
+ style,
368
+ className,
369
+ variant
370
+ } = props,
371
+ coreProps = _objectWithoutPropertiesLoose(props, _excluded$3);
370
372
  const handleClick = () => {
371
373
  if (variant === "radio" && checked) {
372
374
  return;
@@ -406,8 +408,9 @@ const ChoiceInternal = React.forwardRef(function ChoiceInternal(props, ref) {
406
408
  }, React.createElement(View, {
407
409
  style: styles$3.wrapper,
408
410
  tabIndex: -1
409
- }, React.createElement(ChoiceCore, _extends({}, props, {
411
+ }, React.createElement(ChoiceCore, _extends({}, coreProps, {
410
412
  id: uniqueId,
413
+ checked: checked,
411
414
  "aria-describedby": descriptionId,
412
415
  onClick: handleClick,
413
416
  disabled: disabled,
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
64
64
  return target;
65
65
  }
66
66
 
67
- const _excluded$4 = ["checked", "disabled", "error", "groupName", "id", "testId"];
67
+ const _excluded$5 = ["checked", "disabled", "error", "groupName", "id", "testId"];
68
68
  function mapCheckedToAriaChecked(value) {
69
69
  switch (value) {
70
70
  case true:
@@ -100,7 +100,7 @@ const CheckboxCore = React__namespace.forwardRef(function CheckboxCore(props, re
100
100
  id,
101
101
  testId
102
102
  } = props,
103
- sharedProps = _objectWithoutPropertiesLoose(props, _excluded$4);
103
+ sharedProps = _objectWithoutPropertiesLoose(props, _excluded$5);
104
104
  const innerRef = React__namespace.useRef(null);
105
105
  React__namespace.useEffect(() => {
106
106
  if (innerRef.current != null) {
@@ -238,7 +238,7 @@ const _generateStyles$1 = (checked, error) => {
238
238
  return styles$5[styleKey];
239
239
  };
240
240
 
241
- const _excluded$3 = ["checked", "disabled", "error", "groupName", "id", "testId"];
241
+ const _excluded$4 = ["checked", "disabled", "error", "groupName", "id", "testId"];
242
242
  const {
243
243
  blue,
244
244
  red,
@@ -261,7 +261,7 @@ const RadioCore = React__namespace.forwardRef(function RadioCore(props, ref) {
261
261
  id,
262
262
  testId
263
263
  } = props,
264
- sharedProps = _objectWithoutPropertiesLoose(props, _excluded$3);
264
+ sharedProps = _objectWithoutPropertiesLoose(props, _excluded$4);
265
265
  const stateStyles = _generateStyles(checked, error);
266
266
  const defaultStyle = [sharedStyles.inputReset, sharedStyles.default, !disabled && stateStyles.default, disabled && sharedStyles.disabled];
267
267
  return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(StyledInput$1, _extends({}, sharedProps, {
@@ -383,19 +383,21 @@ const _generateStyles = (checked, error) => {
383
383
  return styles$4[styleKey];
384
384
  };
385
385
 
386
+ const _excluded$3 = ["checked", "description", "disabled", "error", "id", "label", "onChange", "style", "className", "variant"];
386
387
  const ChoiceInternal = React__namespace.forwardRef(function ChoiceInternal(props, ref) {
387
388
  const {
388
- checked,
389
- description,
390
- disabled = false,
391
- error = false,
392
- id,
393
- label,
394
- onChange,
395
- style,
396
- className,
397
- variant
398
- } = props;
389
+ checked,
390
+ description,
391
+ disabled = false,
392
+ error = false,
393
+ id,
394
+ label,
395
+ onChange,
396
+ style,
397
+ className,
398
+ variant
399
+ } = props,
400
+ coreProps = _objectWithoutPropertiesLoose(props, _excluded$3);
399
401
  const handleClick = () => {
400
402
  if (variant === "radio" && checked) {
401
403
  return;
@@ -435,8 +437,9 @@ const ChoiceInternal = React__namespace.forwardRef(function ChoiceInternal(props
435
437
  }, React__namespace.createElement(wonderBlocksCore.View, {
436
438
  style: styles$3.wrapper,
437
439
  tabIndex: -1
438
- }, React__namespace.createElement(ChoiceCore, _extends({}, props, {
440
+ }, React__namespace.createElement(ChoiceCore, _extends({}, coreProps, {
439
441
  id: uniqueId,
442
+ checked: checked,
440
443
  "aria-describedby": descriptionId,
441
444
  onClick: handleClick,
442
445
  disabled: disabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-form",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
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": "^3.1.2",
19
+ "@khanacademy/wonder-blocks-clickable": "^4.0.0",
20
20
  "@khanacademy/wonder-blocks-color": "^2.0.1",
21
- "@khanacademy/wonder-blocks-core": "^5.3.1",
22
- "@khanacademy/wonder-blocks-icon": "^2.0.15",
23
- "@khanacademy/wonder-blocks-layout": "^2.0.15",
21
+ "@khanacademy/wonder-blocks-core": "^6.0.0",
22
+ "@khanacademy/wonder-blocks-icon": "^2.1.1",
23
+ "@khanacademy/wonder-blocks-layout": "^2.0.17",
24
24
  "@khanacademy/wonder-blocks-spacing": "^4.0.1",
25
- "@khanacademy/wonder-blocks-typography": "^2.1.1"
25
+ "@khanacademy/wonder-blocks-typography": "^2.1.3"
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.9.7"
32
+ "@khanacademy/wb-dev-build-settings": "^1.0.0"
33
33
  }
34
- }
34
+ }
@@ -66,13 +66,11 @@ type Props = AriaProps & {
66
66
  error = false,
67
67
  id,
68
68
  label,
69
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
70
69
  onChange,
71
70
  style,
72
71
  className,
73
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
72
  variant,
75
- // ...coreProps
73
+ ...coreProps
76
74
  } = props;
77
75
 
78
76
  const handleClick: () => void = () => {
@@ -140,8 +138,9 @@ type Props = AriaProps & {
140
138
  tabIndex={-1}
141
139
  >
142
140
  <ChoiceCore
143
- {...props}
141
+ {...coreProps}
144
142
  id={uniqueId}
143
+ checked={checked}
145
144
  aria-describedby={descriptionId}
146
145
  onClick={handleClick}
147
146
  disabled={disabled}