@react-stately/radio 3.5.0 → 3.6.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/dist/main.js CHANGED
@@ -28,7 +28,8 @@ function $307db30b5687e2e8$export$bca9d026f8e704eb(props) {
28
28
  lastFocusedValue: lastFocusedValue,
29
29
  setLastFocusedValue: setLastFocusedValue,
30
30
  isDisabled: props.isDisabled || false,
31
- isReadOnly: props.isReadOnly || false
31
+ isReadOnly: props.isReadOnly || false,
32
+ validationState: props.validationState
32
33
  };
33
34
  }
34
35
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AC2CA,GAAG,CAAC,8BAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;AACrD,GAAG,CAAC,uBAAC,GAAG,CAAC;SAMO,yCAAkB,CAAC,KAAsB,EAAoB,CAAC;IAC5E,EAAmG,AAAnG,iGAAmG;IACnG,GAAG,CAAC,IAAI,GAAG,oBAAO,KAAO,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,8BAAQ,CAAC,CAAC,IAAI,uBAAC;MAAI,CAAC;QAAA,KAAK,CAAC,IAAI;IAAA,CAAC;IACrF,GAAG,EAAE,aAAa,EAAE,WAAW,IAAI,2CAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ;IACrG,GAAG,EAAE,gBAAgB,EAAE,mBAAmB,IAAI,qBAAQ,CAAC,IAAI;IAE3D,GAAG,CAAC,gBAAgB,IAAI,KAAK,GAAK,CAAC;QACjC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EACxC,WAAW,CAAC,KAAK;IAErB,CAAC;IAED,MAAM,CAAC,CAAC;cACN,IAAI;uBACJ,aAAa;0BACb,gBAAgB;0BAChB,gBAAgB;6BAChB,mBAAmB;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;IACvC,CAAC;AACH,CAAC","sources":["packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/useRadioGroupState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RadioGroupProps} from '@react-types/radio';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo, useState} from 'react';\n\nexport interface RadioGroupState {\n /**\n * The name for the group, used for native form submission.\n * @deprecated\n * @private\n */\n readonly name: string,\n\n /** Whether the radio group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the radio group is read only. */\n readonly isReadOnly: boolean,\n\n /** The currently selected value. */\n readonly selectedValue: string | null,\n\n /** Sets the selected value. */\n setSelectedValue(value: string): void,\n\n /** The value of the last focused radio. */\n readonly lastFocusedValue: string | null,\n\n /** Sets the last focused value. */\n setLastFocusedValue(value: string): void\n}\n\nlet instance = Math.round(Math.random() * 10000000000);\nlet i = 0;\n\n/**\n * Provides state management for a radio group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useRadioGroupState(props: RadioGroupProps): RadioGroupState {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = useMemo(() => props.name || `radio-group-${instance}-${++i}`, [props.name]);\n let [selectedValue, setSelected] = useControlledState(props.value, props.defaultValue, props.onChange);\n let [lastFocusedValue, setLastFocusedValue] = useState(null);\n\n let setSelectedValue = (value) => {\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n }\n };\n\n return {\n name,\n selectedValue,\n setSelectedValue,\n lastFocusedValue,\n setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AC+CA,GAAG,CAAC,8BAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;AACrD,GAAG,CAAC,uBAAC,GAAG,CAAC;SAMO,yCAAkB,CAAC,KAAsB,EAAoB,CAAC;IAC5E,EAAmG,AAAnG,iGAAmG;IACnG,GAAG,CAAC,IAAI,GAAG,oBAAO,KAAO,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,8BAAQ,CAAC,CAAC,IAAI,uBAAC;MAAI,CAAC;QAAA,KAAK,CAAC,IAAI;IAAA,CAAC;IACrF,GAAG,EAAE,aAAa,EAAE,WAAW,IAAI,2CAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ;IACrG,GAAG,EAAE,gBAAgB,EAAE,mBAAmB,IAAI,qBAAQ,CAAC,IAAI;IAE3D,GAAG,CAAC,gBAAgB,IAAI,KAAK,GAAK,CAAC;QACjC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EACxC,WAAW,CAAC,KAAK;IAErB,CAAC;IAED,MAAM,CAAC,CAAC;cACN,IAAI;uBACJ,aAAa;0BACb,gBAAgB;0BAChB,gBAAgB;6BAChB,mBAAmB;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,eAAe,EAAE,KAAK,CAAC,eAAe;IACxC,CAAC;AACH,CAAC","sources":["packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/useRadioGroupState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RadioGroupProps} from '@react-types/radio';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo, useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport interface RadioGroupState {\n /**\n * The name for the group, used for native form submission.\n * @deprecated\n * @private\n */\n readonly name: string,\n\n /** Whether the radio group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the radio group is read only. */\n readonly isReadOnly: boolean,\n\n /** The currently selected value. */\n readonly selectedValue: string | null,\n\n /** Sets the selected value. */\n setSelectedValue(value: string): void,\n\n /** The value of the last focused radio. */\n readonly lastFocusedValue: string | null,\n\n /** Sets the last focused value. */\n setLastFocusedValue(value: string): void,\n\n /** The current validation state of the radio group. */\n validationState: ValidationState\n}\n\nlet instance = Math.round(Math.random() * 10000000000);\nlet i = 0;\n\n/**\n * Provides state management for a radio group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useRadioGroupState(props: RadioGroupProps): RadioGroupState {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = useMemo(() => props.name || `radio-group-${instance}-${++i}`, [props.name]);\n let [selectedValue, setSelected] = useControlledState(props.value, props.defaultValue, props.onChange);\n let [lastFocusedValue, setLastFocusedValue] = useState(null);\n\n let setSelectedValue = (value) => {\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n }\n };\n\n return {\n name,\n selectedValue,\n setSelectedValue,\n lastFocusedValue,\n setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n validationState: props.validationState\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -23,7 +23,8 @@ function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
23
23
  lastFocusedValue: lastFocusedValue,
24
24
  setLastFocusedValue: setLastFocusedValue,
25
25
  isDisabled: props.isDisabled || false,
26
- isReadOnly: props.isReadOnly || false
26
+ isReadOnly: props.isReadOnly || false,
27
+ validationState: props.validationState
27
28
  };
28
29
  }
29
30
 
@@ -1 +1 @@
1
- {"mappings":";;;;;AC2CA,GAAG,CAAC,8BAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;AACrD,GAAG,CAAC,uBAAC,GAAG,CAAC;SAMO,yCAAkB,CAAC,KAAsB,EAAoB,CAAC;IAC5E,EAAmG,AAAnG,iGAAmG;IACnG,GAAG,CAAC,IAAI,GAAG,cAAO,KAAO,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,8BAAQ,CAAC,CAAC,IAAI,uBAAC;MAAI,CAAC;QAAA,KAAK,CAAC,IAAI;IAAA,CAAC;IACrF,GAAG,EAAE,aAAa,EAAE,WAAW,IAAI,yBAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ;IACrG,GAAG,EAAE,gBAAgB,EAAE,mBAAmB,IAAI,eAAQ,CAAC,IAAI;IAE3D,GAAG,CAAC,gBAAgB,IAAI,KAAK,GAAK,CAAC;QACjC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EACxC,WAAW,CAAC,KAAK;IAErB,CAAC;IAED,MAAM,CAAC,CAAC;cACN,IAAI;uBACJ,aAAa;0BACb,gBAAgB;0BAChB,gBAAgB;6BAChB,mBAAmB;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;IACvC,CAAC;AACH,CAAC","sources":["packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/useRadioGroupState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RadioGroupProps} from '@react-types/radio';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo, useState} from 'react';\n\nexport interface RadioGroupState {\n /**\n * The name for the group, used for native form submission.\n * @deprecated\n * @private\n */\n readonly name: string,\n\n /** Whether the radio group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the radio group is read only. */\n readonly isReadOnly: boolean,\n\n /** The currently selected value. */\n readonly selectedValue: string | null,\n\n /** Sets the selected value. */\n setSelectedValue(value: string): void,\n\n /** The value of the last focused radio. */\n readonly lastFocusedValue: string | null,\n\n /** Sets the last focused value. */\n setLastFocusedValue(value: string): void\n}\n\nlet instance = Math.round(Math.random() * 10000000000);\nlet i = 0;\n\n/**\n * Provides state management for a radio group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useRadioGroupState(props: RadioGroupProps): RadioGroupState {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = useMemo(() => props.name || `radio-group-${instance}-${++i}`, [props.name]);\n let [selectedValue, setSelected] = useControlledState(props.value, props.defaultValue, props.onChange);\n let [lastFocusedValue, setLastFocusedValue] = useState(null);\n\n let setSelectedValue = (value) => {\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n }\n };\n\n return {\n name,\n selectedValue,\n setSelectedValue,\n lastFocusedValue,\n setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;AC+CA,GAAG,CAAC,8BAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;AACrD,GAAG,CAAC,uBAAC,GAAG,CAAC;SAMO,yCAAkB,CAAC,KAAsB,EAAoB,CAAC;IAC5E,EAAmG,AAAnG,iGAAmG;IACnG,GAAG,CAAC,IAAI,GAAG,cAAO,KAAO,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,8BAAQ,CAAC,CAAC,IAAI,uBAAC;MAAI,CAAC;QAAA,KAAK,CAAC,IAAI;IAAA,CAAC;IACrF,GAAG,EAAE,aAAa,EAAE,WAAW,IAAI,yBAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ;IACrG,GAAG,EAAE,gBAAgB,EAAE,mBAAmB,IAAI,eAAQ,CAAC,IAAI;IAE3D,GAAG,CAAC,gBAAgB,IAAI,KAAK,GAAK,CAAC;QACjC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EACxC,WAAW,CAAC,KAAK;IAErB,CAAC;IAED,MAAM,CAAC,CAAC;cACN,IAAI;uBACJ,aAAa;0BACb,gBAAgB;0BAChB,gBAAgB;6BAChB,mBAAmB;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;QACrC,eAAe,EAAE,KAAK,CAAC,eAAe;IACxC,CAAC;AACH,CAAC","sources":["packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/useRadioGroupState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RadioGroupProps} from '@react-types/radio';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo, useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport interface RadioGroupState {\n /**\n * The name for the group, used for native form submission.\n * @deprecated\n * @private\n */\n readonly name: string,\n\n /** Whether the radio group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the radio group is read only. */\n readonly isReadOnly: boolean,\n\n /** The currently selected value. */\n readonly selectedValue: string | null,\n\n /** Sets the selected value. */\n setSelectedValue(value: string): void,\n\n /** The value of the last focused radio. */\n readonly lastFocusedValue: string | null,\n\n /** Sets the last focused value. */\n setLastFocusedValue(value: string): void,\n\n /** The current validation state of the radio group. */\n validationState: ValidationState\n}\n\nlet instance = Math.round(Math.random() * 10000000000);\nlet i = 0;\n\n/**\n * Provides state management for a radio group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useRadioGroupState(props: RadioGroupProps): RadioGroupState {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = useMemo(() => props.name || `radio-group-${instance}-${++i}`, [props.name]);\n let [selectedValue, setSelected] = useControlledState(props.value, props.defaultValue, props.onChange);\n let [lastFocusedValue, setLastFocusedValue] = useState(null);\n\n let setSelectedValue = (value) => {\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n }\n };\n\n return {\n name,\n selectedValue,\n setSelectedValue,\n lastFocusedValue,\n setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n validationState: props.validationState\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { RadioGroupProps } from "@react-types/radio";
2
+ import { ValidationState } from "@react-types/shared";
2
3
  export interface RadioGroupState {
3
4
  /**
4
5
  * The name for the group, used for native form submission.
@@ -18,6 +19,8 @@ export interface RadioGroupState {
18
19
  readonly lastFocusedValue: string | null;
19
20
  /** Sets the last focused value. */
20
21
  setLastFocusedValue(value: string): void;
22
+ /** The current validation state of the radio group. */
23
+ validationState: ValidationState;
21
24
  }
22
25
  /**
23
26
  * Provides state management for a radio group component. Provides a name for the group,
@@ -1 +1 @@
1
- {"mappings":";AAgBA;IACE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,oCAAoC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,+BAA+B;IAC/B,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,mCAAmC;IACnC,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACzC;AAKD;;;GAGG;AACH,mCAAmC,KAAK,EAAE,eAAe,GAAG,eAAe,CAqB1E;ACzDD,YAAY,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-stately/radio/src/packages/@react-stately/radio/src/useRadioGroupState.ts","packages/@react-stately/radio/src/packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiBA;IACE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,oCAAoC;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,+BAA+B;IAC/B,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,mCAAmC;IACnC,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,uDAAuD;IACvD,eAAe,EAAE,eAAe,CAAA;CACjC;AAKD;;;GAGG;AACH,mCAAmC,KAAK,EAAE,eAAe,GAAG,eAAe,CAsB1E;AC9DD,YAAY,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-stately/radio/src/packages/@react-stately/radio/src/useRadioGroupState.ts","packages/@react-stately/radio/src/packages/@react-stately/radio/src/index.ts","packages/@react-stately/radio/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useRadioGroupState} from './useRadioGroupState';\n\nexport type {RadioGroupProps} from '@react-types/radio';\nexport type {RadioGroupState} from './useRadioGroupState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/radio",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -19,7 +19,8 @@
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
21
  "@react-stately/utils": "^3.5.1",
22
- "@react-types/radio": "^3.2.2"
22
+ "@react-types/radio": "^3.3.0",
23
+ "@react-types/shared": "^3.15.0"
23
24
  },
24
25
  "peerDependencies": {
25
26
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -27,5 +28,5 @@
27
28
  "publishConfig": {
28
29
  "access": "public"
29
30
  },
30
- "gitHead": "cd7c0ec917122c7612f653c22f8ed558f8b66ecd"
31
+ "gitHead": "9202ef59e8c104dd06ffe33148445ef7932a5d1b"
31
32
  }
@@ -13,6 +13,7 @@
13
13
  import {RadioGroupProps} from '@react-types/radio';
14
14
  import {useControlledState} from '@react-stately/utils';
15
15
  import {useMemo, useState} from 'react';
16
+ import {ValidationState} from '@react-types/shared';
16
17
 
17
18
  export interface RadioGroupState {
18
19
  /**
@@ -38,7 +39,10 @@ export interface RadioGroupState {
38
39
  readonly lastFocusedValue: string | null,
39
40
 
40
41
  /** Sets the last focused value. */
41
- setLastFocusedValue(value: string): void
42
+ setLastFocusedValue(value: string): void,
43
+
44
+ /** The current validation state of the radio group. */
45
+ validationState: ValidationState
42
46
  }
43
47
 
44
48
  let instance = Math.round(Math.random() * 10000000000);
@@ -67,6 +71,7 @@ export function useRadioGroupState(props: RadioGroupProps): RadioGroupState {
67
71
  lastFocusedValue,
68
72
  setLastFocusedValue,
69
73
  isDisabled: props.isDisabled || false,
70
- isReadOnly: props.isReadOnly || false
74
+ isReadOnly: props.isReadOnly || false,
75
+ validationState: props.validationState
71
76
  };
72
77
  }