@atom-learning/components 1.8.0 → 1.8.1

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,3 +1,12 @@
1
+ ## [1.8.1](https://github.com/Atom-Learning/components/compare/v1.8.0...v1.8.1) (2022-05-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * allow on change handler in radio button field ([4ddb262](https://github.com/Atom-Learning/components/commit/4ddb2629673367deb382ecae8e5e991c1a6d40b2))
7
+ * simplify radio button field `onValueChange` example ([b572256](https://github.com/Atom-Learning/components/commit/b572256b96cfe2ff229d315349fd323f5743b537))
8
+ * use userEvent to simulate radio click ([1a78bf1](https://github.com/Atom-Learning/components/commit/1a78bf1af93347cbc90bf7fe45a31c0567505f5b))
9
+
1
10
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
2
11
 
3
12
 
@@ -10,6 +10,7 @@ declare type RadioButtonFieldProps = {
10
10
  direction?: 'row' | 'column';
11
11
  description?: string;
12
12
  validation?: ValidationOptions;
13
+ onValueChange?: (value: string) => void;
13
14
  };
14
15
  export declare const RadioButtonField: React.FC<RadioButtonFieldProps> & {
15
16
  Item: typeof RadioField;
@@ -1 +1 @@
1
- import{createElement as o}from"react";import{useFormContext as a,Controller as F}from"react-hook-form";import{Description as B}from"../field-wrapper/FieldDescription.js";import"../form/Form.js";import{useFieldError as R}from"../form/useFieldError.js";import{Label as b}from"../label/Label.js";import"../radio-button/RadioButton.js";import{RadioButtonGroup as C}from"../radio-button/RadioButtonGroup.js";import{ValidationError as E}from"../validation-error/ValidationError.js";import{styled as $}from"../../stitches.js";import{RadioField as g}from"./RadioField.js";const q=$("fieldset",{all:"unset"}),e=({children:s,css:n,direction:p="column",defaultValue:t,description:m,label:d,name:i,validation:r})=>{const{control:u}=a(),{error:l}=R(i);return o(q,{css:n},o(b,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(r==null?void 0:r.required)},d),m&&o(B,{css:{mb:"$3"}},m),o(F,{control:u,name:i,rules:r,defaultValue:t,render:({onChange:c,value:f})=>o(C,{direction:p,defaultValue:t,onValueChange:c,value:f},s)}),l&&o(E,{css:{mt:"$2"}},l))};e.Item=g,e.displayName="RadioButtonField";export{e as RadioButtonField};
1
+ import{createElement as o}from"react";import{useFormContext as B,Controller as R}from"react-hook-form";import{Description as b}from"../field-wrapper/FieldDescription.js";import"../form/Form.js";import{useFieldError as E}from"../form/useFieldError.js";import{Label as $}from"../label/Label.js";import"../radio-button/RadioButton.js";import{RadioButtonGroup as q}from"../radio-button/RadioButtonGroup.js";import{ValidationError as x}from"../validation-error/ValidationError.js";import{styled as y}from"../../stitches.js";import{RadioField as C}from"./RadioField.js";const g=y("fieldset",{all:"unset"}),t=({children:d,css:p,direction:u="column",defaultValue:e,description:m,label:c,name:i,validation:r,onValueChange:l})=>{const{control:f}=B(),{error:s}=E(i);return o(g,{css:p},o($,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(r==null?void 0:r.required)},c),m&&o(b,{css:{mb:"$3"}},m),o(R,{control:f,name:i,rules:r,defaultValue:e,render:({onChange:F,value:a})=>o(q,{direction:u,defaultValue:e,onValueChange:n=>{F(n),l==null||l(n)},value:a},d)}),s&&o(x,{css:{mt:"$2"}},s))};t.Item=C,t.displayName="RadioButtonField";export{t as RadioButtonField};