@khanacademy/wonder-blocks-form 4.10.0 → 4.10.2

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,22 @@
1
1
  # @khanacademy/wonder-blocks-form
2
2
 
3
+ ## 4.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6999fd39]
8
+ - @khanacademy/wonder-blocks-tokens@2.1.0
9
+ - @khanacademy/wonder-blocks-clickable@4.2.9
10
+ - @khanacademy/wonder-blocks-layout@2.2.2
11
+
12
+ ## 4.10.1
13
+
14
+ ### Patch Changes
15
+
16
+ - 8c861955: Modify `RadioGroup` and `CheckboxGroup` to append `legend` as the first child in `fieldset`, so the accessibility tree can associate the legend contents with the fieldset group and announce its label correctly
17
+ - 0b3a28a7: - Combobox: Add error prop to support aria-invalid and styling changes.
18
+ - TextField: Modify aria-invalid order to be overriden by the caller.
19
+
3
20
  ## 4.10.0
4
21
 
5
22
  ### Minor Changes
package/dist/es/index.js CHANGED
@@ -467,6 +467,8 @@ const Choice = React.forwardRef(function Choice(props, ref) {
467
467
 
468
468
  const styles$3 = StyleSheet.create({
469
469
  fieldset: {
470
+ display: "flex",
471
+ flexDirection: "column",
470
472
  border: "none",
471
473
  padding: 0,
472
474
  margin: 0
@@ -513,10 +515,8 @@ const CheckboxGroup = React.forwardRef(function CheckboxGroup(props, ref) {
513
515
  const allChildren = React.Children.toArray(children).filter(Boolean);
514
516
  return React.createElement(StyledFieldset$1, {
515
517
  "data-testid": testId,
516
- style: styles$3.fieldset,
518
+ style: [styles$3.fieldset, style],
517
519
  ref: ref
518
- }, React.createElement(View, {
519
- style: style
520
520
  }, label && React.createElement(StyledLegend$1, {
521
521
  style: styles$3.legend
522
522
  }, React.createElement(LabelMedium, null, label)), description && React.createElement(LabelSmall, {
@@ -541,7 +541,7 @@ const CheckboxGroup = React.forwardRef(function CheckboxGroup(props, ref) {
541
541
  style: [index > 0 && styles$3.defaultLineGap, style],
542
542
  variant: "checkbox"
543
543
  });
544
- })));
544
+ }));
545
545
  });
546
546
 
547
547
  const StyledFieldset = addStyle("fieldset");
@@ -561,10 +561,8 @@ const RadioGroup = React.forwardRef(function RadioGroup(props, ref) {
561
561
  const allChildren = React.Children.toArray(children).filter(Boolean);
562
562
  return React.createElement(StyledFieldset, {
563
563
  "data-testid": testId,
564
- style: styles$3.fieldset,
564
+ style: [styles$3.fieldset, style],
565
565
  ref: ref
566
- }, React.createElement(View, {
567
- style: style
568
566
  }, label && React.createElement(StyledLegend, {
569
567
  style: styles$3.legend
570
568
  }, React.createElement(LabelMedium, null, label)), description && React.createElement(LabelSmall, {
@@ -589,7 +587,7 @@ const RadioGroup = React.forwardRef(function RadioGroup(props, ref) {
589
587
  style: [index > 0 && styles$3.defaultLineGap, style],
590
588
  variant: "radio"
591
589
  });
592
- })));
590
+ }));
593
591
  });
594
592
 
595
593
  const _excluded$2 = ["id", "type", "value", "name", "disabled", "onKeyDown", "placeholder", "style", "testId", "readOnly", "autoFocus", "autoComplete", "forwardedRef", "light", "onFocus", "onBlur", "onValidate", "validate", "onChange", "required"];
@@ -711,10 +709,9 @@ class TextField extends React.Component {
711
709
  readOnly: readOnly || disabled,
712
710
  autoFocus: autoFocus,
713
711
  autoComplete: autoComplete,
714
- ref: forwardedRef
715
- }, otherProps, {
712
+ ref: forwardedRef,
716
713
  "aria-invalid": this.state.error ? "true" : "false"
717
- })));
714
+ }, otherProps)));
718
715
  }
719
716
  }
720
717
  TextField.defaultProps = {
package/dist/index.js CHANGED
@@ -497,6 +497,8 @@ const Choice = React__namespace.forwardRef(function Choice(props, ref) {
497
497
 
498
498
  const styles$3 = aphrodite.StyleSheet.create({
499
499
  fieldset: {
500
+ display: "flex",
501
+ flexDirection: "column",
500
502
  border: "none",
501
503
  padding: 0,
502
504
  margin: 0
@@ -543,10 +545,8 @@ const CheckboxGroup = React__namespace.forwardRef(function CheckboxGroup(props,
543
545
  const allChildren = React__namespace.Children.toArray(children).filter(Boolean);
544
546
  return React__namespace.createElement(StyledFieldset$1, {
545
547
  "data-testid": testId,
546
- style: styles$3.fieldset,
548
+ style: [styles$3.fieldset, style],
547
549
  ref: ref
548
- }, React__namespace.createElement(wonderBlocksCore.View, {
549
- style: style
550
550
  }, label && React__namespace.createElement(StyledLegend$1, {
551
551
  style: styles$3.legend
552
552
  }, React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, label)), description && React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
@@ -571,7 +571,7 @@ const CheckboxGroup = React__namespace.forwardRef(function CheckboxGroup(props,
571
571
  style: [index > 0 && styles$3.defaultLineGap, style],
572
572
  variant: "checkbox"
573
573
  });
574
- })));
574
+ }));
575
575
  });
576
576
 
577
577
  const StyledFieldset = wonderBlocksCore.addStyle("fieldset");
@@ -591,10 +591,8 @@ const RadioGroup = React__namespace.forwardRef(function RadioGroup(props, ref) {
591
591
  const allChildren = React__namespace.Children.toArray(children).filter(Boolean);
592
592
  return React__namespace.createElement(StyledFieldset, {
593
593
  "data-testid": testId,
594
- style: styles$3.fieldset,
594
+ style: [styles$3.fieldset, style],
595
595
  ref: ref
596
- }, React__namespace.createElement(wonderBlocksCore.View, {
597
- style: style
598
596
  }, label && React__namespace.createElement(StyledLegend, {
599
597
  style: styles$3.legend
600
598
  }, React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, label)), description && React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
@@ -619,7 +617,7 @@ const RadioGroup = React__namespace.forwardRef(function RadioGroup(props, ref) {
619
617
  style: [index > 0 && styles$3.defaultLineGap, style],
620
618
  variant: "radio"
621
619
  });
622
- })));
620
+ }));
623
621
  });
624
622
 
625
623
  const _excluded$2 = ["id", "type", "value", "name", "disabled", "onKeyDown", "placeholder", "style", "testId", "readOnly", "autoFocus", "autoComplete", "forwardedRef", "light", "onFocus", "onBlur", "onValidate", "validate", "onChange", "required"];
@@ -741,10 +739,9 @@ class TextField extends React__namespace.Component {
741
739
  readOnly: readOnly || disabled,
742
740
  autoFocus: autoFocus,
743
741
  autoComplete: autoComplete,
744
- ref: forwardedRef
745
- }, otherProps, {
742
+ ref: forwardedRef,
746
743
  "aria-invalid": this.state.error ? "true" : "false"
747
- })));
744
+ }, otherProps)));
748
745
  }
749
746
  }
750
747
  TextField.defaultProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-form",
3
- "version": "4.10.0",
3
+ "version": "4.10.2",
4
4
  "design": "v1",
5
5
  "description": "Form components for Wonder Blocks.",
6
6
  "main": "dist/index.js",
@@ -16,11 +16,11 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
- "@khanacademy/wonder-blocks-clickable": "^4.2.8",
19
+ "@khanacademy/wonder-blocks-clickable": "^4.2.9",
20
20
  "@khanacademy/wonder-blocks-core": "^7.0.1",
21
21
  "@khanacademy/wonder-blocks-icon": "^4.1.5",
22
- "@khanacademy/wonder-blocks-layout": "^2.2.1",
23
- "@khanacademy/wonder-blocks-tokens": "^2.0.1",
22
+ "@khanacademy/wonder-blocks-layout": "^2.2.2",
23
+ "@khanacademy/wonder-blocks-tokens": "^2.1.0",
24
24
  "@khanacademy/wonder-blocks-typography": "^2.1.16"
25
25
  },
26
26
  "peerDependencies": {