@react-spectrum/radio 3.0.0-nightly.1246 → 3.0.0-nightly.1258
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 +0 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +0 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/RadioGroup.tsx +0 -1
- package/src/context.ts +0 -1
package/dist/main.js
CHANGED
@@ -211,7 +211,6 @@ function $e125f55143423f8d3ecf034e5ae37$var$RadioGroup(props, ref) {
|
|
211
211
|
}, /*#__PURE__*/_react.createElement($dc0e5d54409e9454b207deef7914e49$export$RadioContext.Provider, {
|
212
212
|
value: {
|
213
213
|
isEmphasized,
|
214
|
-
isRequired,
|
215
214
|
validationState,
|
216
215
|
state
|
217
216
|
}
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,2CAAiB;AACf,oBAAkB,uBADH;AAEf,0BAAwB,6BAFT;AAGf,2BAAyB,8BAHV;AAIf,gBAAc,mBAJC;AAKf,0BAAwB,6BALT;AAMf,gCAA8B,mCANf;AAOf,gBAAc,mBAPC;AAQf,2BAAyB,8BARV;AASf,gBAAc;AATC,CAAjB;;ACuBO,MAAMG,oDAAY,gBAAGC,MAAK,CAACC,aAAN,CAA8C,IAA9C,CAArB;;AAEA,SAASC,wDAAT,GAA+C;AACpD,SAAOC,UAAU,CAACJ,oDAAD,CAAjB;AACD;;;;ACLD,SAASK,0CAAT,CAAeC,KAAf,EAA0CC,GAA1C,EAA+E;AAC7E,MAAI;AACFC,IAAAA,UADE;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AAD;AAAkBqB,IAAAA;AAAlB,MAAgCC,aAAa,CAACrC,KAAD,EAAQkB,KAAR,CAAjD;AAEA,sBACE,4DACMZ,UADN,EAEMS,eAFN;AAGE,IAAA,SAAS,EACPM,UAAU,mDAER,qBAFQ,EAGR;AACE,2CAAqCU,aAAa,KAAK;AADzD,KAHQ,EAMR;AACAV,IAAAA,UAAU,kDAER,gBAFQ,CAPF,EAWRf,UAAU,CAACgB,SAXH,CAJd;AAkBE,IAAA,GAAG,EAAET;AAlBP,MAmBGiB,KAAK,iBACJ,qBAAC,KAAD,kCACMM,UADN;AAEE,IAAA,WAAW,EAAC,MAFd;AAGE,IAAA,aAAa,EAAEL,aAHjB;AAIE,IAAA,UAAU,EAAEC,UAJd;AAKE,IAAA,UAAU,EAAEJ,UALd;AAME,IAAA,kBAAkB,EAAEC;AANtB,MAOGC,KAPH,CApBJ,eA8BE;AACE,IAAA,SAAS,EACPT,UAAU,mDAER,2BAFQ,EAGR;AACE,+CAAyCY,WAAW,KAAK;AAD3D,KAHQ;AAFd,kBAUE,0EAAc,QAAd;AACE,IAAA,KAAK,EAAE;AACLjB,MAAAA,YADK;AAELY,MAAAA,UAFK;AAGLX,MAAAA,eAHK;AAILC,MAAAA;AAJK;AADT,KAOGf,QAPH,CAVF,CA9BF,CADF;AAqDD;AAED;;;;;;AAIA,MAAMmC,UAAW,gBAAG3C,MAAK,CAAC6B,UAAN,CAAiBC,6CAAjB,CAApB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/radio/vars.css","./packages/@react-spectrum/radio/src/context.ts","./packages/@react-spectrum/radio/src/Radio.tsx","./node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","./node_modules/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","./packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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\n@import './index.css';\n@import './skin.css';\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isRequired?: boolean,\n isEmphasized?: boolean,\n name?: string,\n validationState?: 'valid' | 'invalid',\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext);\n}\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\nfunction Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n validationState,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': validationState === 'invalid',\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\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\n@import './index.css';\n@import './skin.css';\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\n@import './index.css';\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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, LabelPosition} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\nfunction RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n isRequired,\n necessityIndicator,\n label,\n labelPosition = 'top' as LabelPosition,\n labelAlign,\n validationState,\n children,\n orientation = 'vertical',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n\n let state = useRadioGroupState(props);\n let {radioGroupProps, labelProps} = useRadioGroup(props, state);\n\n return (\n <div\n {...styleProps}\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup',\n {\n 'spectrum-FieldGroup--positionSide': labelPosition === 'side'\n },\n // This is so radio works inside a <Form>\n classNames(\n labelStyles,\n 'spectrum-Field'\n ),\n styleProps.className\n )\n }\n ref={domRef}>\n {label &&\n <Label\n {...labelProps}\n elementType=\"span\"\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}>\n {label}\n </Label>\n }\n <div\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n isRequired,\n validationState,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </div>\n );\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":["$parcel$interopDefault","a","__esModule","default","RadioContext","React","createContext","useRadioProvider","useContext","Radio","props","ref","isDisabled","children","autoFocus","otherProps","styleProps","useStyleProps","hoverProps","isHovered","useHover","inputRef","useRef","domRef","useFocusableRef","radioGroupProps","isEmphasized","validationState","state","inputProps","useRadio","classNames","className","_Radio","forwardRef","RadioGroup","useProviderProps","useFormProps","isRequired","necessityIndicator","label","labelPosition","labelAlign","orientation","useDOMRef","useRadioGroupState","labelProps","useRadioGroup","_RadioGroup"],"version":3,"file":"main.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,2CAAiB;AACf,oBAAkB,uBADH;AAEf,0BAAwB,6BAFT;AAGf,2BAAyB,8BAHV;AAIf,gBAAc,mBAJC;AAKf,0BAAwB,6BALT;AAMf,gCAA8B,mCANf;AAOf,gBAAc,mBAPC;AAQf,2BAAyB,8BARV;AASf,gBAAc;AATC,CAAjB;;ACsBO,MAAMG,oDAAY,gBAAGC,MAAK,CAACC,aAAN,CAA8C,IAA9C,CAArB;;AAEA,SAASC,wDAAT,GAA+C;AACpD,SAAOC,UAAU,CAACJ,oDAAD,CAAjB;AACD;;;;ACJD,SAASK,0CAAT,CAAeC,KAAf,EAA0CC,GAA1C,EAA+E;AAC7E,MAAI;AACFC,IAAAA,UADE;AAEFC,IAAAA,QAFE;AAGFC,IAAAA;AAHE,MAKAJ,KALJ;AAAA,MAIKK,UAJL,oDAKIL,KALJ;;AAMA,MAAI;AAACM,IAAAA;AAAD,MAAeC,aAAa,CAACF,UAAD,CAAhC;AACA,MAAI;AAACG,IAAAA,UAAD;AA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,KAAK;AADzD,KAHQ,EAMR;AACAV,IAAAA,UAAU,kDAER,gBAFQ,CAPF,EAWRf,UAAU,CAACgB,SAXH,CAJd;AAkBE,IAAA,GAAG,EAAET;AAlBP,MAmBGiB,KAAK,iBACJ,qBAAC,KAAD,kCACMM,UADN;AAEE,IAAA,WAAW,EAAC,MAFd;AAGE,IAAA,aAAa,EAAEL,aAHjB;AAIE,IAAA,UAAU,EAAEC,UAJd;AAKE,IAAA,UAAU,EAAEJ,UALd;AAME,IAAA,kBAAkB,EAAEC;AANtB,MAOGC,KAPH,CApBJ,eA8BE;AACE,IAAA,SAAS,EACPT,UAAU,mDAER,2BAFQ,EAGR;AACE,+CAAyCY,WAAW,KAAK;AAD3D,KAHQ;AAFd,kBAUE,0EAAc,QAAd;AACE,IAAA,KAAK,EAAE;AACLjB,MAAAA,YADK;AAELC,MAAAA,eAFK;AAGLC,MAAAA;AAHK;AADT,KAMGf,QANH,CAVF,CA9BF,CADF;AAoDD;AAED;;;;;;AAIA,MAAMmC,UAAW,gBAAG3C,MAAK,CAAC6B,UAAN,CAAiBC,6CAAjB,CAApB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/radio/vars.css","./packages/@react-spectrum/radio/src/context.ts","./packages/@react-spectrum/radio/src/Radio.tsx","./node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","./node_modules/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","./packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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\n@import './index.css';\n@import './skin.css';\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n validationState?: 'valid' | 'invalid',\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext);\n}\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\nfunction Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n validationState,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': validationState === 'invalid',\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\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\n@import './index.css';\n@import './skin.css';\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\n@import './index.css';\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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, LabelPosition} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\nfunction RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n isRequired,\n necessityIndicator,\n label,\n labelPosition = 'top' as LabelPosition,\n labelAlign,\n validationState,\n children,\n orientation = 'vertical',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n\n let state = useRadioGroupState(props);\n let {radioGroupProps, labelProps} = useRadioGroup(props, state);\n\n return (\n <div\n {...styleProps}\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup',\n {\n 'spectrum-FieldGroup--positionSide': labelPosition === 'side'\n },\n // This is so radio works inside a <Form>\n classNames(\n labelStyles,\n 'spectrum-Field'\n ),\n styleProps.className\n )\n }\n ref={domRef}>\n {label &&\n <Label\n {...labelProps}\n elementType=\"span\"\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}>\n {label}\n </Label>\n }\n <div\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n validationState,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </div>\n );\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":["$parcel$interopDefault","a","__esModule","default","RadioContext","React","createContext","useRadioProvider","useContext","Radio","props","ref","isDisabled","children","autoFocus","otherProps","styleProps","useStyleProps","hoverProps","isHovered","useHover","inputRef","useRef","domRef","useFocusableRef","radioGroupProps","isEmphasized","validationState","state","inputProps","useRadio","classNames","className","_Radio","forwardRef","RadioGroup","useProviderProps","useFormProps","isRequired","necessityIndicator","label","labelPosition","labelAlign","orientation","useDOMRef","useRadioGroupState","labelProps","useRadioGroup","_RadioGroup"],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
@@ -171,7 +171,6 @@ function $cc551574103dc5b9b788866e53c$var$RadioGroup(props, ref) {
|
|
171
171
|
}, /*#__PURE__*/_react.createElement($ab95946e1e830e3cfac331e9d67ee25$export$RadioContext.Provider, {
|
172
172
|
value: {
|
173
173
|
isEmphasized,
|
174
|
-
isRequired,
|
175
174
|
validationState,
|
176
175
|
state
|
177
176
|
}
|
package/dist/module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,0CAAiB;AACf,oBAAkB,uBADH;AAEf,0BAAwB,6BAFT;AAGf,2BAAyB,8BAHV;AAIf,gBAAc,mBAJC;AAKf,0BAAwB,6BALT;AAMf,gCAA8B,mCANf;AAOf,gBAAc,mBAPC;AAQf,2BAAyB,8BARV;AASf,gBAAc;AATC,CAAjB;;ACuBO,MAAMG,oDAAY,gBAAGC,MAAK,CAACC,aAAN,CAA8C,IAA9C,CAArB;;AAEA,SAASC,wDAAT,GAA+C;AACpD,SAAOC,UAAU,CAACJ,oDAAD,CAAjB;AACD;;;;ACLD,SAASK,yCAAT,CAAeC,KAAf,EAA0CC,GAA1C,EAA+E;AAC7E,MAAI;AACFC,IAAAA,UADE;AAEFC,IAAAA,QAFE;AAGFC,IAAAA;AAHE,MAKAJ,KALJ;AAAA,MAIKK,UAJL,uDAKIL,KALJ;;AAMA,MAAI;AAACM,IAAAA;AAAD,MAAeC,aAAa,CAACF,UAAD,CAAhC;AACA,MAAI;AAACG,IA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AAqCU,aAAa,KAAK;AADzD,KAHQ,EAMR;AACAV,IAAAA,UAAU,qDAER,gBAFQ,CAPF,EAWRf,UAAU,CAACgB,SAXH,CAJd;AAkBE,IAAA,GAAG,EAAET;AAlBP,MAmBGiB,KAAK,iBACJ,qBAAC,KAAD,qCACMM,UADN;AAEE,IAAA,WAAW,EAAC,MAFd;AAGE,IAAA,aAAa,EAAEL,aAHjB;AAIE,IAAA,UAAU,EAAEC,UAJd;AAKE,IAAA,UAAU,EAAEJ,UALd;AAME,IAAA,kBAAkB,EAAEC;AANtB,MAOGC,KAPH,CApBJ,eA8BE;AACE,IAAA,SAAS,EACPT,UAAU,kDAER,2BAFQ,EAGR;AACE,+CAAyCY,WAAW,KAAK;AAD3D,KAHQ;AAFd,kBAUE,0EAAc,QAAd;AACE,IAAA,KAAK,EAAE;AACLjB,MAAAA,YADK;AAELY,MAAAA,UAFK;AAGLX,MAAAA,eAHK;AAILC,MAAAA;AAJK;AADT,KAOGf,QAPH,CAVF,CA9BF,CADF;AAqDD;AAED;;;;;;OAIA,MAAMmC,UAAW,gBAAG3C,MAAK,CAAC6B,UAAN,CAAiBC,2CAAjB,CAApB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/radio/vars.css","./packages/@react-spectrum/radio/src/context.ts","./packages/@react-spectrum/radio/src/Radio.tsx","./node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","./node_modules/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","./packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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\n@import './index.css';\n@import './skin.css';\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isRequired?: boolean,\n isEmphasized?: boolean,\n name?: string,\n validationState?: 'valid' | 'invalid',\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext);\n}\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\nfunction Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n validationState,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': validationState === 'invalid',\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\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\n@import './index.css';\n@import './skin.css';\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\n@import './index.css';\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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, LabelPosition} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\nfunction RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n isRequired,\n necessityIndicator,\n label,\n labelPosition = 'top' as LabelPosition,\n labelAlign,\n validationState,\n children,\n orientation = 'vertical',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n\n let state = useRadioGroupState(props);\n let {radioGroupProps, labelProps} = useRadioGroup(props, state);\n\n return (\n <div\n {...styleProps}\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup',\n {\n 'spectrum-FieldGroup--positionSide': labelPosition === 'side'\n },\n // This is so radio works inside a <Form>\n classNames(\n labelStyles,\n 'spectrum-Field'\n ),\n styleProps.className\n )\n }\n ref={domRef}>\n {label &&\n <Label\n {...labelProps}\n elementType=\"span\"\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}>\n {label}\n </Label>\n }\n <div\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n isRequired,\n validationState,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </div>\n );\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":["$parcel$interopDefault","a","__esModule","default","RadioContext","React","createContext","useRadioProvider","useContext","Radio","props","ref","isDisabled","children","autoFocus","otherProps","styleProps","useStyleProps","hoverProps","isHovered","useHover","inputRef","useRef","domRef","useFocusableRef","radioGroupProps","isEmphasized","validationState","state","inputProps","useRadio","classNames","className","_Radio","forwardRef","RadioGroup","useProviderProps","useFormProps","isRequired","necessityIndicator","label","labelPosition","labelAlign","orientation","useDOMRef","useRadioGroupState","labelProps","useRadioGroup","_RadioGroup"],"version":3,"file":"module.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,0CAAiB;AACf,oBAAkB,uBADH;AAEf,0BAAwB,6BAFT;AAGf,2BAAyB,8BAHV;AAIf,gBAAc,mBAJC;AAKf,0BAAwB,6BALT;AAMf,gCAA8B,mCANf;AAOf,gBAAc,mBAPC;AAQf,2BAAyB,8BARV;AASf,gBAAc;AATC,CAAjB;;ACsBO,MAAMG,oDAAY,gBAAGC,MAAK,CAACC,aAAN,CAA8C,IAA9C,CAArB;;AAEA,SAASC,wDAAT,GAA+C;AACpD,SAAOC,UAAU,CAACJ,oDAAD,CAAjB;AACD;;;;ACJD,SAASK,yCAAT,CAAeC,KAAf,EAA0CC,GAA1C,EAA+E;AAC7E,MAAI;AACFC,IAAAA,UADE;AAEFC,IAAAA,QAFE;AAGFC,IAAAA;AAHE,MAKAJ,KALJ;AAAA,MAIKK,UAJL,uDAKIL,KALJ;;AAMA,MAAI;AAACM,IAAAA;AAAD,MAAeC,aAAa,CAACF,UAAD,CAAhC;AACA,MAAI;AAACG,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA0BC,QAAQ,CAAC;AAACR,IAAAA;AAAD,GAAD,CAAtC;AAEA,MAAIS,QAAQ,GAAGC,MAAM,CAAmB,IAAnB,CAArB;AACA,MAAIC,MAAM,GAAGC,eAAe,CAACb,GAAD,EAAMU,QAAN,CAA5B;AAEA,MAAII,eAAe,GAAG,0DAAtB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AAa,EAAEL,aAHjB;AAIE,IAAA,UAAU,EAAEC,UAJd;AAKE,IAAA,UAAU,EAAEJ,UALd;AAME,IAAA,kBAAkB,EAAEC;AANtB,MAOGC,KAPH,CApBJ,eA8BE;AACE,IAAA,SAAS,EACPT,UAAU,kDAER,2BAFQ,EAGR;AACE,+CAAyCY,WAAW,KAAK;AAD3D,KAHQ;AAFd,kBAUE,0EAAc,QAAd;AACE,IAAA,KAAK,EAAE;AACLjB,MAAAA,YADK;AAELC,MAAAA,eAFK;AAGLC,MAAAA;AAHK;AADT,KAMGf,QANH,CAVF,CA9BF,CADF;AAoDD;AAED;;;;;;OAIA,MAAMmC,UAAW,gBAAG3C,MAAK,CAAC6B,UAAN,CAAiBC,2CAAjB,CAApB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/radio/vars.css","./packages/@react-spectrum/radio/src/context.ts","./packages/@react-spectrum/radio/src/Radio.tsx","./node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","./node_modules/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","./packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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\n@import './index.css';\n@import './skin.css';\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n validationState?: 'valid' | 'invalid',\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext);\n}\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\nfunction Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n validationState,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': validationState === 'invalid',\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\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\n@import './index.css';\n@import './skin.css';\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\n@import './index.css';\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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, LabelPosition} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\nfunction RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n isRequired,\n necessityIndicator,\n label,\n labelPosition = 'top' as LabelPosition,\n labelAlign,\n validationState,\n children,\n orientation = 'vertical',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n\n let state = useRadioGroupState(props);\n let {radioGroupProps, labelProps} = useRadioGroup(props, state);\n\n return (\n <div\n {...styleProps}\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup',\n {\n 'spectrum-FieldGroup--positionSide': labelPosition === 'side'\n },\n // This is so radio works inside a <Form>\n classNames(\n labelStyles,\n 'spectrum-Field'\n ),\n styleProps.className\n )\n }\n ref={domRef}>\n {label &&\n <Label\n {...labelProps}\n elementType=\"span\"\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}>\n {label}\n </Label>\n }\n <div\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n validationState,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </div>\n );\n}\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":["$parcel$interopDefault","a","__esModule","default","RadioContext","React","createContext","useRadioProvider","useContext","Radio","props","ref","isDisabled","children","autoFocus","otherProps","styleProps","useStyleProps","hoverProps","isHovered","useHover","inputRef","useRef","domRef","useFocusableRef","radioGroupProps","isEmphasized","validationState","state","inputProps","useRadio","classNames","className","_Radio","forwardRef","RadioGroup","useProviderProps","useFormProps","isRequired","necessityIndicator","label","labelPosition","labelAlign","orientation","useDOMRef","useRadioGroupState","labelProps","useRadioGroup","_RadioGroup"],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"A;A;ACoFA;A;A;GAGG;AACH,OAAA,MAAM,qKAA0B,CAAC;
|
1
|
+
{"mappings":"A;A;ACoFA;A;A;GAGG;AACH,OAAA,MAAM,qKAA0B,CAAC;ACYjC;A;A;GAGG;AACH,OAAA,MAAM,qJAA0C,CAAC","sources":["./packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/context.ts","./packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/Radio.tsx","./packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/RadioGroup.tsx","./packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/index.ts"],"sourcesContent":[null,null,null,null],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/radio",
|
3
|
-
"version": "3.0.0-nightly.
|
3
|
+
"version": "3.0.0-nightly.1258+d6b47064c",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -32,18 +32,18 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@babel/runtime": "^7.6.2",
|
35
|
-
"@react-aria/focus": "3.0.0-nightly.
|
36
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
37
|
-
"@react-aria/radio": "3.0.0-nightly.
|
38
|
-
"@react-spectrum/form": "3.0.0-nightly.
|
39
|
-
"@react-spectrum/label": "3.4.1-nightly.
|
40
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
41
|
-
"@react-stately/radio": "3.0.0-nightly.
|
42
|
-
"@react-types/radio": "3.0.0-nightly.
|
43
|
-
"@react-types/shared": "3.0.0-nightly.
|
35
|
+
"@react-aria/focus": "3.0.0-nightly.1258+d6b47064c",
|
36
|
+
"@react-aria/interactions": "3.0.0-nightly.1258+d6b47064c",
|
37
|
+
"@react-aria/radio": "3.0.0-nightly.1258+d6b47064c",
|
38
|
+
"@react-spectrum/form": "3.0.0-nightly.1258+d6b47064c",
|
39
|
+
"@react-spectrum/label": "3.4.1-nightly.2944+d6b47064c",
|
40
|
+
"@react-spectrum/utils": "3.0.0-nightly.1258+d6b47064c",
|
41
|
+
"@react-stately/radio": "3.0.0-nightly.1258+d6b47064c",
|
42
|
+
"@react-types/radio": "3.0.0-nightly.1258+d6b47064c",
|
43
|
+
"@react-types/shared": "3.0.0-nightly.1258+d6b47064c"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
46
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.1258+d6b47064c"
|
47
47
|
},
|
48
48
|
"peerDependencies": {
|
49
49
|
"@react-spectrum/provider": "^3.0.0",
|
@@ -52,5 +52,5 @@
|
|
52
52
|
"publishConfig": {
|
53
53
|
"access": "public"
|
54
54
|
},
|
55
|
-
"gitHead": "
|
55
|
+
"gitHead": "d6b47064ce98bfff50903e6e3147c6f88147de15"
|
56
56
|
}
|
package/src/RadioGroup.tsx
CHANGED
package/src/context.ts
CHANGED