@semcore/radio 6.43.2-prerelease.5 → 6.43.3-prerelease.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [6.43.3] - 2025-05-09
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/utils` [4.48.2 ~> 4.48.4], `@semcore/flex-box` [5.41.2 ~> 5.41.3], `@semcore/core` [2.39.2 ~> 2.39.3]).
10
+
5
11
  ## [6.43.2] - 2025-04-04
6
12
 
7
13
  ### Changed
package/lib/cjs/Radio.js CHANGED
@@ -35,23 +35,25 @@ var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
35
35
  var _typography = require("@semcore/typography");
36
36
  var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"],
37
37
  _excluded2 = ["children", "Children"];
38
- /*__reshadow-styles__:"./style/radio.shadow.css"*/
39
- var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SRadio_129k5_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_129k5_gg_ .___SText_129k5_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_129k5_gg_ .___SText_129k5_gg_.__color_129k5_gg_{color:var(--color_129k5)}.___SRadio_129k5_gg_.__disabled_129k5_gg_{pointer-events:none}.___SText_129k5_gg_._size_m_129k5_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_129k5_gg_._size_l_129k5_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_129k5_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_129k5_gg_::after,.___SValue_129k5_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_129k5_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_129k5_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_129k5_gg_.__disabled_129k5_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_129k5_gg_._size_m_129k5_gg_{width:16px;height:16px}.___SValue_129k5_gg_._size_m_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:14px;height:14px}.___SValue_129k5_gg_._size_l_129k5_gg_{width:20px;height:20px}.___SValue_129k5_gg_._size_l_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:18px;height:18px}.___SValue_129k5_gg_._state_normal_129k5_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_129k5_gg_._state_invalid_129k5_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_129k5_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_m_129k5_gg_::after{width:6px;height:6px}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_l_129k5_gg_::after{width:8px;height:8px}.___SValue_129k5_gg_._state_normal_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_129k5_gg_._state_invalid_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5);background-color:var(--theme_129k5)}.___SValue_129k5_gg_._state_normal_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5)}.___SInvalidPattern_129k5_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_129k5_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}" /*__inner_css_end__*/, "129k5_gg_") /*__reshadow_css_end__*/, {
40
- "__SRadio": "___SRadio_129k5_gg_",
41
- "_disabled": "__disabled_129k5_gg_",
42
- "__SText": "___SText_129k5_gg_",
43
- "_size_m": "_size_m_129k5_gg_",
44
- "_size_l": "_size_l_129k5_gg_",
45
- "__SValue": "___SValue_129k5_gg_",
46
- "_state_normal": "_state_normal_129k5_gg_",
47
- "_state_invalid": "_state_invalid_129k5_gg_",
48
- "__SControl": "___SControl_129k5_gg_",
49
- "_keyboardFocused": "__keyboardFocused_129k5_gg_",
50
- "_theme": "__theme_129k5_gg_",
51
- "--theme": "--theme_129k5",
52
- "_color": "__color_129k5_gg_",
53
- "--color": "--color_129k5",
54
- "__SInvalidPattern": "___SInvalidPattern_129k5_gg_"
38
+ /*!__reshadow-styles__:"./style/radio.shadow.css"*/
39
+ var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SRadio_1ue59_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_.__color_1ue59_gg_{color:var(--color_1ue59)}.___SRadio_1ue59_gg_.__disabled_1ue59_gg_{pointer-events:none}.___SText_1ue59_gg_._size_m_1ue59_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1ue59_gg_._size_l_1ue59_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1ue59_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1ue59_gg_::after,.___SValue_1ue59_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1ue59_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1ue59_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1ue59_gg_.__disabled_1ue59_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_1ue59_gg_._size_m_1ue59_gg_{width:16px;height:16px}.___SValue_1ue59_gg_._size_m_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:14px;height:14px}.___SValue_1ue59_gg_._size_l_1ue59_gg_{width:20px;height:20px}.___SValue_1ue59_gg_._size_l_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:18px;height:18px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1ue59_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_m_1ue59_gg_::after{width:6px;height:6px}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_l_1ue59_gg_::after{width:8px;height:8px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59);background-color:var(--theme_1ue59)}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59)}.___SInvalidPattern_1ue59_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1ue59_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}", /*__inner_css_end__*/"1ue59_gg_"),
40
+ /*__reshadow_css_end__*/
41
+ {
42
+ "__SRadio": "___SRadio_1ue59_gg_",
43
+ "_disabled": "__disabled_1ue59_gg_",
44
+ "__SText": "___SText_1ue59_gg_",
45
+ "_size_m": "_size_m_1ue59_gg_",
46
+ "_size_l": "_size_l_1ue59_gg_",
47
+ "__SValue": "___SValue_1ue59_gg_",
48
+ "_state_normal": "_state_normal_1ue59_gg_",
49
+ "_state_invalid": "_state_invalid_1ue59_gg_",
50
+ "__SControl": "___SControl_1ue59_gg_",
51
+ "_keyboardFocused": "__keyboardFocused_1ue59_gg_",
52
+ "_theme": "__theme_1ue59_gg_",
53
+ "--theme": "--theme_1ue59",
54
+ "_color": "__color_1ue59_gg_",
55
+ "--color": "--color_1ue59",
56
+ "__SInvalidPattern": "___SInvalidPattern_1ue59_gg_"
55
57
  });
56
58
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
57
59
  (0, _inherits2["default"])(RadioGroupRoot, _Component);
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_assignProps8","_keyboardFocusEnhance","_resolveColorEnhance","_inputProps","_useColorResolver","_logger","_typography","_excluded","_excluded2","style","_index","sstyled","insert","RadioGroupRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","Flex","assignProps","Component","_defineProperty2","defaultValue","RadioGroup","createComponent","exports","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized2","hoistedDisabled","undefined","logger","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","Box","_this$asProps3","styles","hasChildren","cn","_objectSpread2","Fragment","Radio","Value","Text","CONTEXT_COMPONENT","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","getInputProps","_getInputProps2","_slicedToArray2","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","callAllEventHandlers","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties2","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","inputProps","defaultChecked","keyboardFocusEnhance","resolveColorEnhance","_ref3","arguments[0]","_ref9","SControl","displayName","_ref4","_ref10","SValue","SInvalidPattern","InvalidStateBox","_ref5","_ref11","SText","TypographyText","color","React","useEffect","useColorResolver","wrapRadioGroup","wrapper","_default"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,qBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,oBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAR,uBAAA,CAAAC,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AAGA,IAAAS,OAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAA6D,IAAAW,SAAA;EAAAC,UAAA;AAAA;AAAA,IAAAC,KAAA,+BAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAEvDC,cAAc,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,cAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,cAAA;EAAA,SAAAA,eAAA;IAAA,IAAAK,gBAAA,mBAAAL,cAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EA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AAC;EAC7D,IAAMqD,YAAY,GAAG,IAAAoC,kCAAgB,GAAE;EAEvC,OAAAN,MAAA,GAAO,IAAA9I,aAAO,EAAC0E,MAAM,CAAC,eACpBxF,MAAA,YAAAuC,aAAA,CAACsH,KAAK,EAAAD,MAAA,CAAAlE,EAAA,cAAAC,cAAA,qBAAA9F,KAAA,CAAA4C,WAAA;IAAA,OAA6B,MAAM;IAAA,aAAYqF,YAAY,CAACiC,KAAK;EAAC,GAAAJ,KAAA,IAAI;AAEhF,CAAC;AACD5D,IAAI,CAACsD,WAAW,GAAG,MAAM;AAIzB,IAAMvD,KAAK,GAAG,IAAAhD,gBAAe,EAACmD,SAAS,EAAE;EACvC0C,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAAC;AAEF,IAAM/C,KAAK,GAAG,IAAA/C,gBAAe,EAACE,SAAS,EAAE;EACvC+C,IAAI,EAAJA,IAAI;EACJD,KAAK,EAALA;AACF,CAAC,CAAC;AAEK,IAAMqE,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAACrH,OAAA,CAAAoH,cAAA,GAAAA,cAAA;AAAA,IAAAE,QAAA,GAEpCxE,KAAK;AAAA9C,OAAA,cAAAsH,QAAA"}
1
+ {"version":3,"file":"Radio.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_assignProps8","_keyboardFocusEnhance","_resolveColorEnhance","_inputProps","_useColorResolver","_logger","_typography","_excluded","_excluded2","style","_index","sstyled","insert","RadioGroupRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","Flex","assignProps","Component","_defineProperty2","defaultValue","RadioGroup","createComponent","exports","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized2","hoistedDisabled","undefined","logger","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","Box","_this$asProps3","styles","hasChildren","cn","_objectSpread2","Fragment","Radio","Value","Text","CONTEXT_COMPONENT","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","getInputProps","_getInputProps2","_slicedToArray2","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","callAllEventHandlers","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties2","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","inputProps","defaultChecked","keyboardFocusEnhance","resolveColorEnhance","_ref3","arguments[0]","_ref9","SControl","displayName","_ref4","_ref10","SValue","SInvalidPattern","InvalidStateBox","_ref5","_ref11","SText","TypographyText","color","React","useEffect","useColorResolver","wrapRadioGroup","wrapper","_default"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,qBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,oBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAR,uBAAA,CAAAC,OAAA;AAC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AAO;AAAA;AAACrH,OAAA,CAAAoH,cAAA,GAAAA,cAAA;AAAA,IAAAE,QAAA,GAEpCxE,KAAK;AAAA9C,OAAA,cAAAsH,QAAA"}
package/lib/es6/Radio.js CHANGED
@@ -23,23 +23,25 @@ import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhan
23
23
  import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
24
24
  import getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';
25
25
  import { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';
26
- /*__reshadow-styles__:"./style/radio.shadow.css"*/
27
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_129k5_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_129k5_gg_ .___SText_129k5_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_129k5_gg_ .___SText_129k5_gg_.__color_129k5_gg_{color:var(--color_129k5)}.___SRadio_129k5_gg_.__disabled_129k5_gg_{pointer-events:none}.___SText_129k5_gg_._size_m_129k5_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_129k5_gg_._size_l_129k5_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_129k5_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_129k5_gg_::after,.___SValue_129k5_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_129k5_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_129k5_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_129k5_gg_.__disabled_129k5_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_129k5_gg_._size_m_129k5_gg_{width:16px;height:16px}.___SValue_129k5_gg_._size_m_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:14px;height:14px}.___SValue_129k5_gg_._size_l_129k5_gg_{width:20px;height:20px}.___SValue_129k5_gg_._size_l_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:18px;height:18px}.___SValue_129k5_gg_._state_normal_129k5_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_129k5_gg_._state_invalid_129k5_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_129k5_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_m_129k5_gg_::after{width:6px;height:6px}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_l_129k5_gg_::after{width:8px;height:8px}.___SValue_129k5_gg_._state_normal_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_129k5_gg_._state_invalid_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5);background-color:var(--theme_129k5)}.___SValue_129k5_gg_._state_normal_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5)}.___SInvalidPattern_129k5_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_129k5_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}" /*__inner_css_end__*/, "129k5_gg_") /*__reshadow_css_end__*/, {
28
- "__SRadio": "___SRadio_129k5_gg_",
29
- "_disabled": "__disabled_129k5_gg_",
30
- "__SText": "___SText_129k5_gg_",
31
- "_size_m": "_size_m_129k5_gg_",
32
- "_size_l": "_size_l_129k5_gg_",
33
- "__SValue": "___SValue_129k5_gg_",
34
- "_state_normal": "_state_normal_129k5_gg_",
35
- "_state_invalid": "_state_invalid_129k5_gg_",
36
- "__SControl": "___SControl_129k5_gg_",
37
- "_keyboardFocused": "__keyboardFocused_129k5_gg_",
38
- "_theme": "__theme_129k5_gg_",
39
- "--theme": "--theme_129k5",
40
- "_color": "__color_129k5_gg_",
41
- "--color": "--color_129k5",
42
- "__SInvalidPattern": "___SInvalidPattern_129k5_gg_"
26
+ /*!__reshadow-styles__:"./style/radio.shadow.css"*/
27
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_1ue59_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_.__color_1ue59_gg_{color:var(--color_1ue59)}.___SRadio_1ue59_gg_.__disabled_1ue59_gg_{pointer-events:none}.___SText_1ue59_gg_._size_m_1ue59_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1ue59_gg_._size_l_1ue59_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1ue59_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1ue59_gg_::after,.___SValue_1ue59_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1ue59_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1ue59_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1ue59_gg_.__disabled_1ue59_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_1ue59_gg_._size_m_1ue59_gg_{width:16px;height:16px}.___SValue_1ue59_gg_._size_m_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:14px;height:14px}.___SValue_1ue59_gg_._size_l_1ue59_gg_{width:20px;height:20px}.___SValue_1ue59_gg_._size_l_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:18px;height:18px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1ue59_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_m_1ue59_gg_::after{width:6px;height:6px}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_l_1ue59_gg_::after{width:8px;height:8px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59);background-color:var(--theme_1ue59)}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59)}.___SInvalidPattern_1ue59_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1ue59_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}", /*__inner_css_end__*/"1ue59_gg_"),
28
+ /*__reshadow_css_end__*/
29
+ {
30
+ "__SRadio": "___SRadio_1ue59_gg_",
31
+ "_disabled": "__disabled_1ue59_gg_",
32
+ "__SText": "___SText_1ue59_gg_",
33
+ "_size_m": "_size_m_1ue59_gg_",
34
+ "_size_l": "_size_l_1ue59_gg_",
35
+ "__SValue": "___SValue_1ue59_gg_",
36
+ "_state_normal": "_state_normal_1ue59_gg_",
37
+ "_state_invalid": "_state_invalid_1ue59_gg_",
38
+ "__SControl": "___SControl_1ue59_gg_",
39
+ "_keyboardFocused": "__keyboardFocused_1ue59_gg_",
40
+ "_theme": "__theme_1ue59_gg_",
41
+ "--theme": "--theme_1ue59",
42
+ "_color": "__color_1ue59_gg_",
43
+ "--color": "--color_1ue59",
44
+ "__SInvalidPattern": "___SInvalidPattern_1ue59_gg_"
43
45
  });
44
46
  import logger from '@semcore/utils/lib/logger';
45
47
  import { Text as TypographyText } from '@semcore/typography';
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["React","createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","Flex","Box","InvalidStateBox","assignProps","callAllEventHandlers","keyboardFocusEnhance","resolveColorEnhance","getInputProps","inputProps","useColorResolver","style","_sstyled","insert","logger","Text","TypographyText","RadioGroupRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","hoistedDisabled","undefined","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","_this$asProps3","styles","hasChildren","cn","_objectSpread","_assignProps2","Fragment","Radio","Value","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","_excluded2","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref10","SValue","SInvalidPattern","_assignProps4","_ref5","_ref11","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,I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styled","Root","Flex","Box","InvalidStateBox","assignProps","callAllEventHandlers","keyboardFocusEnhance","resolveColorEnhance","getInputProps","inputProps","useColorResolver","style","_sstyled","insert","logger","Text","TypographyText","RadioGroupRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","hoistedDisabled","undefined","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","_this$asProps3","styles","hasChildren","cn","_objectSpread","_assignProps2","Fragment","Radio","Value","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","_excluded2","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref10","SValue","SInvalidPattern","_assignProps4","_ref5","_ref11","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,M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mjs CHANGED
@@ -1,273 +1,333 @@
1
- import N from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import G from "@babel/runtime/helpers/esm/slicedToArray";
3
- import v from "@babel/runtime/helpers/esm/objectSpread2";
4
- import R from "@babel/runtime/helpers/esm/assertThisInitialized";
5
- import V from "@babel/runtime/helpers/esm/classCallCheck";
6
- import z from "@babel/runtime/helpers/esm/createClass";
7
- import D from "@babel/runtime/helpers/esm/inherits";
8
- import T from "@babel/runtime/helpers/esm/createSuper";
9
- import g from "@babel/runtime/helpers/esm/defineProperty";
10
- import { sstyled as Y } from "@semcore/utils/lib/core/index";
11
- import w, { CONTEXT_COMPONENT as j, assignProps as P, Component as E, sstyled as m } from "@semcore/core";
12
- import l from "react";
13
- import { Flex as Z, Box as I, InvalidStateBox as ee } from "@semcore/flex-box";
14
- import A, { callAllEventHandlers as H } from "@semcore/utils/lib/assignProps";
15
- import re from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
16
- import te from "@semcore/utils/lib/enhances/resolveColorEnhance";
17
- import O, { inputProps as ae } from "@semcore/utils/lib/inputProps";
18
- import { inputProps as Ie } from "@semcore/utils/lib/inputProps";
19
- import { useColorResolver as oe } from "@semcore/utils/lib/use/useColorResolver";
20
- import _e from "@semcore/utils/lib/logger";
21
- import { Text as ie } from "@semcore/typography";
22
- var ne = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"], le = ["children", "Children"], B = (
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
7
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
+ import { sstyled } from "@semcore/utils/lib/core/index";
11
+ import createComponent, { CONTEXT_COMPONENT, assignProps, Component, sstyled as sstyled$1 } from "@semcore/core";
12
+ import React from "react";
13
+ import { Flex, Box, InvalidStateBox } from "@semcore/flex-box";
14
+ import assignProps$1, { callAllEventHandlers } from "@semcore/utils/lib/assignProps";
15
+ import keyboardFocusEnhance from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
16
+ import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
17
+ import getInputProps, { inputProps } from "@semcore/utils/lib/inputProps";
18
+ import { inputProps as inputProps2 } from "@semcore/utils/lib/inputProps";
19
+ import { useColorResolver } from "@semcore/utils/lib/use/useColorResolver";
20
+ import logger from "@semcore/utils/lib/logger";
21
+ import { Text as Text$1 } from "@semcore/typography";
22
+ var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"], _excluded2 = ["children", "Children"];
23
+ /*!__reshadow-styles__:"./style/radio.shadow.css"*/
24
+ var style = (
23
25
  /*__reshadow_css_start__*/
24
- (Y.insert(
26
+ (sstyled.insert(
25
27
  /*__inner_css_start__*/
26
- '.___SRadio_129k5_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_129k5_gg_ .___SText_129k5_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_129k5_gg_ .___SText_129k5_gg_.__color_129k5_gg_{color:var(--color_129k5)}.___SRadio_129k5_gg_.__disabled_129k5_gg_{pointer-events:none}.___SText_129k5_gg_._size_m_129k5_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_129k5_gg_._size_l_129k5_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_129k5_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_129k5_gg_::after,.___SValue_129k5_gg_::before{content:"";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_129k5_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_129k5_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_129k5_gg_.__disabled_129k5_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_129k5_gg_._size_m_129k5_gg_{width:16px;height:16px}.___SValue_129k5_gg_._size_m_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:14px;height:14px}.___SValue_129k5_gg_._size_l_129k5_gg_{width:20px;height:20px}.___SValue_129k5_gg_._size_l_129k5_gg_ .___SInvalidPattern_129k5_gg_:before{width:18px;height:18px}.___SValue_129k5_gg_._state_normal_129k5_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_129k5_gg_._state_invalid_129k5_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_129k5_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_m_129k5_gg_::after{width:6px;height:6px}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_._size_l_129k5_gg_::after{width:8px;height:8px}.___SValue_129k5_gg_._state_normal_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_129k5_gg_._state_invalid_129k5_gg_.__keyboardFocused_129k5_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_129k5_gg_:checked~.___SValue_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5);background-color:var(--theme_129k5)}.___SValue_129k5_gg_._state_normal_129k5_gg_.__theme_129k5_gg_::before{border-color:var(--theme_129k5)}.___SInvalidPattern_129k5_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_129k5_gg_:before{content:"";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}',
27
- "129k5_gg_"
28
- ), {
29
- __SRadio: "___SRadio_129k5_gg_",
30
- _disabled: "__disabled_129k5_gg_",
31
- __SText: "___SText_129k5_gg_",
32
- _size_m: "_size_m_129k5_gg_",
33
- _size_l: "_size_l_129k5_gg_",
34
- __SValue: "___SValue_129k5_gg_",
35
- _state_normal: "_state_normal_129k5_gg_",
36
- _state_invalid: "_state_invalid_129k5_gg_",
37
- __SControl: "___SControl_129k5_gg_",
38
- _keyboardFocused: "__keyboardFocused_129k5_gg_",
39
- _theme: "__theme_129k5_gg_",
40
- "--theme": "--theme_129k5",
41
- _color: "__color_129k5_gg_",
42
- "--color": "--color_129k5",
43
- __SInvalidPattern: "___SInvalidPattern_129k5_gg_"
28
+ '.___SRadio_1ue59_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1ue59_gg_ .___SText_1ue59_gg_.__color_1ue59_gg_{color:var(--color_1ue59)}.___SRadio_1ue59_gg_.__disabled_1ue59_gg_{pointer-events:none}.___SText_1ue59_gg_._size_m_1ue59_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1ue59_gg_._size_l_1ue59_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1ue59_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1ue59_gg_::after,.___SValue_1ue59_gg_::before{content:"";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1ue59_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1ue59_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1ue59_gg_.__disabled_1ue59_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_1ue59_gg_._size_m_1ue59_gg_{width:16px;height:16px}.___SValue_1ue59_gg_._size_m_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:14px;height:14px}.___SValue_1ue59_gg_._size_l_1ue59_gg_{width:20px;height:20px}.___SValue_1ue59_gg_._size_l_1ue59_gg_ .___SInvalidPattern_1ue59_gg_:before{width:18px;height:18px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1ue59_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_m_1ue59_gg_::after{width:6px;height:6px}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_._size_l_1ue59_gg_::after{width:8px;height:8px}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SValue_1ue59_gg_._state_invalid_1ue59_gg_.__keyboardFocused_1ue59_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1ue59_gg_:checked~.___SValue_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59);background-color:var(--theme_1ue59)}.___SValue_1ue59_gg_._state_normal_1ue59_gg_.__theme_1ue59_gg_::before{border-color:var(--theme_1ue59)}.___SInvalidPattern_1ue59_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1ue59_gg_:before{content:"";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}',
29
+ /*__inner_css_end__*/
30
+ "1ue59_gg_"
31
+ ), /*__reshadow_css_end__*/
32
+ {
33
+ "__SRadio": "___SRadio_1ue59_gg_",
34
+ "_disabled": "__disabled_1ue59_gg_",
35
+ "__SText": "___SText_1ue59_gg_",
36
+ "_size_m": "_size_m_1ue59_gg_",
37
+ "_size_l": "_size_l_1ue59_gg_",
38
+ "__SValue": "___SValue_1ue59_gg_",
39
+ "_state_normal": "_state_normal_1ue59_gg_",
40
+ "_state_invalid": "_state_invalid_1ue59_gg_",
41
+ "__SControl": "___SControl_1ue59_gg_",
42
+ "_keyboardFocused": "__keyboardFocused_1ue59_gg_",
43
+ "_theme": "__theme_1ue59_gg_",
44
+ "--theme": "--theme_1ue59",
45
+ "_color": "__color_1ue59_gg_",
46
+ "--color": "--color_1ue59",
47
+ "__SInvalidPattern": "___SInvalidPattern_1ue59_gg_"
44
48
  })
45
- ), $ = /* @__PURE__ */ function(c) {
46
- D(i, c);
47
- var o = T(i);
48
- function i() {
49
- return V(this, i), o.apply(this, arguments);
49
+ );
50
+ var RadioGroupRoot = /* @__PURE__ */ function(_Component) {
51
+ _inherits(RadioGroupRoot2, _Component);
52
+ var _super = _createSuper(RadioGroupRoot2);
53
+ function RadioGroupRoot2() {
54
+ _classCallCheck(this, RadioGroupRoot2);
55
+ return _super.apply(this, arguments);
50
56
  }
51
- return z(i, [{
57
+ _createClass(RadioGroupRoot2, [{
52
58
  key: "uncontrolledProps",
53
- value: function() {
59
+ value: function uncontrolledProps() {
54
60
  return {
55
61
  value: null
56
62
  };
57
63
  }
58
64
  }, {
59
65
  key: "setContext",
60
- value: function() {
61
- var r = this.asProps, e = r.theme, a = r.size, _ = r.name, n = r.value, s = r.onChange, d = r.disabled;
66
+ value: function setContext() {
67
+ var _this$asProps = this.asProps, theme = _this$asProps.theme, size = _this$asProps.size, name = _this$asProps.name, value = _this$asProps.value, onChange = _this$asProps.onChange, disabled = _this$asProps.disabled;
62
68
  return {
63
- onChange: s,
64
- value: n,
65
- theme: e,
66
- size: a,
67
- name: _,
68
- disabled: d
69
+ onChange,
70
+ value,
71
+ theme,
72
+ size,
73
+ name,
74
+ disabled
69
75
  };
70
76
  }
71
77
  }, {
72
78
  key: "render",
73
- value: function() {
74
- var r = this.asProps, e = this.asProps.Children;
75
- return /* @__PURE__ */ l.createElement(Z, P({
76
- direction: "column",
77
- role: "group",
78
- __excludeProps: ["onChange"]
79
- }, r), /* @__PURE__ */ l.createElement(e, null));
79
+ value: function render() {
80
+ var _ref = this.asProps;
81
+ var Children = this.asProps.Children;
82
+ return /* @__PURE__ */ React.createElement(Flex, assignProps({
83
+ "direction": "column",
84
+ "role": "group",
85
+ "__excludeProps": ["onChange"]
86
+ }, _ref), /* @__PURE__ */ React.createElement(Children, null));
80
87
  }
81
- }]), i;
82
- }(E);
83
- g($, "displayName", "RadioGroup");
84
- g($, "defaultProps", {
88
+ }]);
89
+ return RadioGroupRoot2;
90
+ }(Component);
91
+ _defineProperty(RadioGroupRoot, "displayName", "RadioGroup");
92
+ _defineProperty(RadioGroupRoot, "defaultProps", {
85
93
  defaultValue: null
86
94
  });
87
- var U = w($), S = /* @__PURE__ */ function(c) {
88
- D(i, c);
89
- var o = T(i);
90
- function i() {
91
- var t;
92
- V(this, i);
93
- for (var r = arguments.length, e = new Array(r), a = 0; a < r; a++)
94
- e[a] = arguments[a];
95
- return t = o.call.apply(o, [this].concat(e)), g(R(t), "state", {
95
+ var RadioGroup = createComponent(RadioGroupRoot);
96
+ var RadioRoot = /* @__PURE__ */ function(_Component2) {
97
+ _inherits(RadioRoot2, _Component2);
98
+ var _super2 = _createSuper(RadioRoot2);
99
+ function RadioRoot2() {
100
+ var _this;
101
+ _classCallCheck(this, RadioRoot2);
102
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
103
+ args[_key] = arguments[_key];
104
+ }
105
+ _this = _super2.call.apply(_super2, [this].concat(args));
106
+ _defineProperty(_assertThisInitialized(_this), "state", {
96
107
  hoistedDisabled: void 0
97
- }), g(R(t), "hoistDisabled", function(_) {
98
- _e.warn(!0, "Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.", t.asProps["data-ui-name"]), t.setState({
99
- hoistedDisabled: _
108
+ });
109
+ _defineProperty(_assertThisInitialized(_this), "hoistDisabled", function(disabled) {
110
+ logger.warn(true, "Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.", _this.asProps["data-ui-name"]);
111
+ _this.setState({
112
+ hoistedDisabled: disabled
100
113
  });
101
- }), t;
114
+ });
115
+ return _this;
102
116
  }
103
- return z(i, [{
117
+ _createClass(RadioRoot2, [{
104
118
  key: "getTextProps",
105
- value: function() {
106
- var r = A(this.asProps, this.context), e = r.size, a = e === void 0 ? "m" : e, _ = r.disabled, n = r.label, s = this.state.hoistedDisabled, d = {
107
- size: a,
108
- children: n,
109
- disabled: _ ?? s,
119
+ value: function getTextProps() {
120
+ var _assignProps6 = assignProps$1(this.asProps, this.context), _assignProps6$size = _assignProps6.size, size = _assignProps6$size === void 0 ? "m" : _assignProps6$size, disabled = _assignProps6.disabled, label = _assignProps6.label;
121
+ var hoistedDisabled = this.state.hoistedDisabled;
122
+ var textProps = {
123
+ size,
124
+ children: label,
125
+ disabled: disabled !== null && disabled !== void 0 ? disabled : hoistedDisabled,
110
126
  hoistDisabled: this.hoistDisabled,
111
127
  rootDisabled: this.props.disabled
112
128
  };
113
- return d;
129
+ return textProps;
114
130
  }
115
131
  }, {
116
132
  key: "getValueProps",
117
- value: function() {
118
- var r, e = A(this.asProps, this.context), a = e.size, _ = a === void 0 ? "m" : a, n = e.state, s = n === void 0 ? "normal" : n, d = e.theme, p = e.disabled, b = e.name, u = this.asProps, h = u.value, f = u.checked, x = this.state.hoistedDisabled;
133
+ value: function getValueProps() {
134
+ var _this$props$size;
135
+ var _assignProps7 = assignProps$1(this.asProps, this.context), _assignProps7$size = _assignProps7.size, size = _assignProps7$size === void 0 ? "m" : _assignProps7$size, _assignProps7$state = _assignProps7.state, state = _assignProps7$state === void 0 ? "normal" : _assignProps7$state, theme = _assignProps7.theme, disabled = _assignProps7.disabled, name = _assignProps7.name;
136
+ var _this$asProps2 = this.asProps, value = _this$asProps2.value, checked = _this$asProps2.checked;
137
+ var hoistedDisabled = this.state.hoistedDisabled;
119
138
  return {
120
- size: (r = this.props.size) !== null && r !== void 0 ? r : _,
121
- disabled: p ?? x,
122
- state: s,
123
- theme: d,
124
- value: h,
125
- checked: f,
126
- name: b,
139
+ size: (_this$props$size = this.props.size) !== null && _this$props$size !== void 0 ? _this$props$size : size,
140
+ disabled: disabled !== null && disabled !== void 0 ? disabled : hoistedDisabled,
141
+ state,
142
+ theme,
143
+ value,
144
+ checked,
145
+ name,
127
146
  hoistDisabled: this.hoistDisabled,
128
147
  rootDisabled: this.props.disabled
129
148
  };
130
149
  }
131
150
  }, {
132
151
  key: "render",
133
- value: function() {
134
- var r = this.asProps, e, a = I, _ = this.asProps, n = _.styles, s = _.Children, d = _.children;
135
- return e = m(n), /* @__PURE__ */ l.createElement(a, e.cn("SRadio", v({}, P({
136
- tag: "label",
137
- __excludeProps: ["onChange", "label", "disabled"]
138
- }, r))), d ? /* @__PURE__ */ l.createElement(s, e.cn("Children", {})) : /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(C.Value, null), /* @__PURE__ */ l.createElement(C.Text, null)));
152
+ value: function render() {
153
+ var _ref2 = this.asProps, _ref6;
154
+ var SRadio = Box;
155
+ var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, Children = _this$asProps3.Children, hasChildren = _this$asProps3.children;
156
+ return _ref6 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SRadio, _ref6.cn("SRadio", _objectSpread({}, assignProps({
157
+ "tag": "label",
158
+ "__excludeProps": ["onChange", "label", "disabled"]
159
+ }, _ref2))), hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {})) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio.Value, null), /* @__PURE__ */ React.createElement(Radio.Text, null)));
160
+ }
161
+ }]);
162
+ return RadioRoot2;
163
+ }(Component);
164
+ _defineProperty(RadioRoot, "displayName", "Radio");
165
+ _defineProperty(RadioRoot, "style", style);
166
+ _defineProperty(RadioRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
167
+ var ValueRoot = /* @__PURE__ */ function(_Component3) {
168
+ _inherits(ValueRoot2, _Component3);
169
+ var _super3 = _createSuper(ValueRoot2);
170
+ function ValueRoot2() {
171
+ var _this2;
172
+ _classCallCheck(this, ValueRoot2);
173
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
174
+ args[_key2] = arguments[_key2];
139
175
  }
140
- }]), i;
141
- }(E);
142
- g(S, "displayName", "Radio");
143
- g(S, "style", B);
144
- g(S, "contextType", U[j]);
145
- var k = /* @__PURE__ */ function(c) {
146
- D(i, c);
147
- var o = T(i);
148
- function i() {
149
- var t;
150
- V(this, i);
151
- for (var r = arguments.length, e = new Array(r), a = 0; a < r; a++)
152
- e[a] = arguments[a];
153
- return t = o.call.apply(o, [this].concat(e)), g(R(t), "bindHandlerChange", function(_) {
154
- return function(n) {
155
- typeof t.context.onChange == "function" && t.context.onChange(_, n);
176
+ _this2 = _super3.call.apply(_super3, [this].concat(args));
177
+ _defineProperty(_assertThisInitialized(_this2), "bindHandlerChange", function(value) {
178
+ return function(e) {
179
+ if (typeof _this2.context.onChange === "function") {
180
+ _this2.context.onChange(value, e);
181
+ }
156
182
  };
157
- }), t;
183
+ });
184
+ return _this2;
158
185
  }
159
- return z(i, [{
186
+ _createClass(ValueRoot2, [{
160
187
  key: "uncontrolledProps",
161
- value: function() {
188
+ value: function uncontrolledProps() {
162
189
  return {
163
- checked: function(e) {
190
+ checked: function checked(e) {
164
191
  return e.target.checked;
165
192
  }
166
193
  };
167
194
  }
168
195
  }, {
169
196
  key: "getControlProps",
170
- value: function() {
171
- var r = this.context.value, e = this.asProps, a = e.forwardRef, _ = e.includeInputProps, n = e.state, s = e.value, d = O(this.asProps, _), p = G(d, 1), b = p[0], u = s ?? "", h = v(v({
172
- ref: a,
173
- state: n
174
- }, b), {}, {
175
- value: u
197
+ value: function getControlProps() {
198
+ var currentValue = this.context.value;
199
+ var _this$asProps4 = this.asProps, forwardRef = _this$asProps4.forwardRef, includeInputProps = _this$asProps4.includeInputProps, state = _this$asProps4.state, value = _this$asProps4.value;
200
+ var _getInputProps = getInputProps(this.asProps, includeInputProps), _getInputProps2 = _slicedToArray(_getInputProps, 1), commonControlProps = _getInputProps2[0];
201
+ var inputValue = value !== null && value !== void 0 ? value : "";
202
+ var controlProps = _objectSpread(_objectSpread({
203
+ ref: forwardRef,
204
+ state
205
+ }, commonControlProps), {}, {
206
+ value: inputValue
176
207
  });
177
- if (r !== void 0) {
178
- var f = this.props, x = f.onChange;
179
- f.onClick, h.checked = r === u, h.onChange = H(x, this.bindHandlerChange(u));
208
+ if (currentValue !== void 0) {
209
+ var _this$props = this.props, onChange = _this$props.onChange;
210
+ _this$props.onClick;
211
+ controlProps.checked = currentValue === inputValue;
212
+ controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));
180
213
  }
181
- return h;
214
+ return controlProps;
182
215
  }
183
216
  }, {
184
217
  key: "getRadioMarkProps",
185
- value: function() {
186
- var r = this.context.value, e = this.asProps, a = e.size, _ = e.state, n = e.theme, s = e.keyboardFocused, d = e.value, p = e.tag, b = e.disabled, u = e.includeInputProps, h = e.resolveColor, f = N(e, ne), x = O(f, u), F = G(x, 2), J = F[0], y = F[1];
187
- y.children, y.Children;
188
- var K = N(y, le), L = d ?? "", M = v({
189
- theme: n,
190
- size: a,
191
- state: _,
192
- keyboardFocused: s,
193
- disabled: b,
194
- resolveColor: h,
195
- checked: J.checked
196
- }, K);
197
- if (r !== void 0) {
198
- var Q = this.props.onClick;
199
- p !== "label" && (M.onClick = H(Q, this.bindHandlerChange(L)));
218
+ value: function getRadioMarkProps() {
219
+ var currentValue = this.context.value;
220
+ var _this$asProps5 = this.asProps, size = _this$asProps5.size, state = _this$asProps5.state, theme = _this$asProps5.theme, keyboardFocused = _this$asProps5.keyboardFocused, value = _this$asProps5.value, tag = _this$asProps5.tag, disabled = _this$asProps5.disabled, includeInputProps = _this$asProps5.includeInputProps, resolveColor = _this$asProps5.resolveColor, other = _objectWithoutProperties(_this$asProps5, _excluded);
221
+ var _getInputProps3 = getInputProps(other, includeInputProps), _getInputProps4 = _slicedToArray(_getInputProps3, 2), commonControlProps = _getInputProps4[0], radioMarkProps = _getInputProps4[1];
222
+ radioMarkProps.children;
223
+ radioMarkProps.Children;
224
+ var propsWithoutChildren = _objectWithoutProperties(radioMarkProps, _excluded2);
225
+ var inputValue = value !== null && value !== void 0 ? value : "";
226
+ var markProps = _objectSpread({
227
+ theme,
228
+ size,
229
+ state,
230
+ keyboardFocused,
231
+ disabled,
232
+ resolveColor,
233
+ checked: commonControlProps.checked
234
+ }, propsWithoutChildren);
235
+ if (currentValue !== void 0) {
236
+ var onClick = this.props.onClick;
237
+ if (tag !== "label") {
238
+ markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));
239
+ }
200
240
  }
201
- return M;
241
+ return markProps;
202
242
  }
203
243
  }, {
204
244
  key: "componentDidUpdate",
205
- value: function() {
206
- this.asProps.rootDisabled !== this.asProps.disabled && this.asProps.hoistDisabled(this.asProps.disabled);
245
+ value: function componentDidUpdate() {
246
+ if (this.asProps.rootDisabled !== this.asProps.disabled) {
247
+ this.asProps.hoistDisabled(this.asProps.disabled);
248
+ }
207
249
  }
208
250
  }, {
209
251
  key: "componentDidMount",
210
- value: function() {
211
- this.asProps.rootDisabled !== this.asProps.disabled && this.asProps.hoistDisabled(this.asProps.disabled);
252
+ value: function componentDidMount() {
253
+ if (this.asProps.rootDisabled !== this.asProps.disabled) {
254
+ this.asProps.hoistDisabled(this.asProps.disabled);
255
+ }
212
256
  }
213
257
  }, {
214
258
  key: "render",
215
- value: function() {
216
- var r, e = this.asProps, a = e.styles, _ = e.children, n = e.Children;
217
- return _ ? (r = m(a), /* @__PURE__ */ l.createElement(n, r.cn("Children", {}))) : (m(a), /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(C.Value.Control, null), /* @__PURE__ */ l.createElement(C.Value.RadioMark, null)));
259
+ value: function render() {
260
+ var _ref8;
261
+ var _this$asProps6 = this.asProps, styles = _this$asProps6.styles, hasChildren = _this$asProps6.children, Children = _this$asProps6.Children;
262
+ if (!hasChildren) {
263
+ return sstyled$1(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio.Value.Control, null), /* @__PURE__ */ React.createElement(Radio.Value.RadioMark, null));
264
+ }
265
+ return _ref8 = sstyled$1(styles), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}));
218
266
  }
219
- }]), i;
220
- }(E);
221
- g(k, "defaultProps", {
222
- includeInputProps: ae,
223
- defaultChecked: !1
267
+ }]);
268
+ return ValueRoot2;
269
+ }(Component);
270
+ _defineProperty(ValueRoot, "defaultProps", {
271
+ includeInputProps: inputProps,
272
+ defaultChecked: false
224
273
  });
225
- g(k, "enhance", [re(), te()]);
226
- g(k, "displayName", "Value");
227
- g(k, "contextType", U[j]);
228
- g(k, "style", B);
229
- var W = function(o) {
230
- var i = arguments[0], t, r = I, e = o.styles, a = o.state;
231
- return t = m(e), /* @__PURE__ */ l.createElement(r, t.cn("SControl", v({}, P({
232
- tag: "input",
233
- type: "radio",
234
- "aria-invalid": a === "invalid"
235
- }, i))));
274
+ _defineProperty(ValueRoot, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
275
+ _defineProperty(ValueRoot, "displayName", "Value");
276
+ _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
277
+ _defineProperty(ValueRoot, "style", style);
278
+ var Control = function Control2(props) {
279
+ var _ref3 = arguments[0], _ref9;
280
+ var SControl = Box;
281
+ var styles = props.styles, state = props.state;
282
+ return _ref9 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SControl, _ref9.cn("SControl", _objectSpread({}, assignProps({
283
+ "tag": "input",
284
+ "type": "radio",
285
+ "aria-invalid": state === "invalid"
286
+ }, _ref3))));
236
287
  };
237
- W.displayName = "Control";
238
- var X = function(o) {
239
- var i = arguments[0], t, r = I, e = ee, a = o.theme, _ = o.styles, n = o.resolveColor, s = o.state, d = o.checked;
240
- return t = m(_), /* @__PURE__ */ l.createElement(r, t.cn("SValue", v({}, P({
241
- tag: "div",
242
- "use:theme": n(a),
243
- "aria-hidden": !0
244
- }, i))), s === "invalid" && !d && /* @__PURE__ */ l.createElement(e, t.cn("SInvalidPattern", {})));
288
+ Control.displayName = "Control";
289
+ var RadioMark = function RadioMark2(props) {
290
+ var _ref4 = arguments[0], _ref10;
291
+ var SValue = Box;
292
+ var SInvalidPattern = InvalidStateBox;
293
+ var theme = props.theme, styles = props.styles, resolveColor = props.resolveColor, state = props.state, checked = props.checked;
294
+ return _ref10 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SValue, _ref10.cn("SValue", _objectSpread({}, assignProps({
295
+ "tag": "div",
296
+ "use:theme": resolveColor(theme),
297
+ "aria-hidden": true
298
+ }, _ref4))), state === "invalid" && !checked && /* @__PURE__ */ React.createElement(SInvalidPattern, _ref10.cn("SInvalidPattern", {})));
245
299
  };
246
- X.displayName = "RadioMark";
247
- var q = function(o) {
248
- var i = arguments[0], t, r = ie, e = o.styles, a = o.color;
249
- l.useEffect(function() {
250
- o.rootDisabled !== o.disabled && o.hoistDisabled(o.disabled);
251
- }, [o.rootDisabled, o.disabled, o.hoistDisabled]);
252
- var _ = oe();
253
- return t = m(e), /* @__PURE__ */ l.createElement(r, t.cn("SText", v({}, P({
254
- tag: "span",
255
- "use:color": _(a)
256
- }, i))));
300
+ RadioMark.displayName = "RadioMark";
301
+ var Text = function Text2(props) {
302
+ var _ref5 = arguments[0], _ref11;
303
+ var SText = Text$1;
304
+ var styles = props.styles, color = props.color;
305
+ React.useEffect(function() {
306
+ if (props.rootDisabled !== props.disabled) {
307
+ props.hoistDisabled(props.disabled);
308
+ }
309
+ }, [props.rootDisabled, props.disabled, props.hoistDisabled]);
310
+ var resolveColor = useColorResolver();
311
+ return _ref11 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SText, _ref11.cn("SText", _objectSpread({}, assignProps({
312
+ "tag": "span",
313
+ "use:color": resolveColor(color)
314
+ }, _ref5))));
257
315
  };
258
- q.displayName = "Text";
259
- var se = w(k, {
260
- Control: W,
261
- RadioMark: X
262
- }), C = w(S, {
263
- Text: q,
264
- Value: se
265
- }), Te = function(o) {
266
- return o;
316
+ Text.displayName = "Text";
317
+ var Value = createComponent(ValueRoot, {
318
+ Control,
319
+ RadioMark
320
+ });
321
+ var Radio = createComponent(RadioRoot, {
322
+ Text,
323
+ Value
324
+ });
325
+ var wrapRadioGroup = function wrapRadioGroup2(wrapper) {
326
+ return wrapper;
267
327
  };
268
328
  export {
269
- U as RadioGroup,
270
- C as default,
271
- Ie as inputProps,
272
- Te as wrapRadioGroup
329
+ RadioGroup,
330
+ Radio as default,
331
+ inputProps2 as inputProps,
332
+ wrapRadioGroup
273
333
  };
package/lib/esm/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { RadioGroup as p, default as a, wrapRadioGroup as t } from "./Radio.mjs";
2
- import { inputProps as d } from "@semcore/utils/lib/inputProps";
1
+ import { RadioGroup, default as default2, wrapRadioGroup } from "./Radio.mjs";
2
+ import { inputProps } from "@semcore/utils/lib/inputProps";
3
3
  export {
4
- p as RadioGroup,
5
- a as default,
6
- d as inputProps,
7
- t as wrapRadioGroup
4
+ RadioGroup,
5
+ default2 as default,
6
+ inputProps,
7
+ wrapRadioGroup
8
8
  };
@@ -0,0 +1,154 @@
1
+ SRadio {
2
+ display: inline-flex;
3
+ align-items: flex-start;
4
+ cursor: pointer;
5
+
6
+ SText {
7
+ margin-left: var(--intergalactic-spacing-2x, 8px);
8
+ color: var(--intergalactic-text-primary, #191b23);
9
+ }
10
+
11
+ SText[color] {
12
+ color: var(--color);
13
+ }
14
+ }
15
+
16
+ SRadio[disabled] {
17
+ pointer-events: none;
18
+ }
19
+
20
+ SText[size='m'] {
21
+ font-size: var(--intergalactic-fs-200, 14px);
22
+ line-height: var(--intergalactic-lh-200, 142%);
23
+ }
24
+
25
+ SText[size='l'] {
26
+ font-size: var(--intergalactic-fs-300, 16px);
27
+ line-height: var(--intergalactic-lh-300, 150%);
28
+ }
29
+
30
+ SValue {
31
+ position: relative;
32
+ flex-shrink: 0;
33
+ padding: 0;
34
+ outline: none;
35
+ z-index: 0;
36
+
37
+ margin-top: var(--intergalactic-spacing-05x, 2px);
38
+
39
+ &::before {
40
+ content: '';
41
+ position: absolute;
42
+ top: 0;
43
+ left: 0;
44
+ right: 0;
45
+ bottom: 0;
46
+ background: var(--intergalactic-bg-primary-neutral, #ffffff);
47
+ border: 1px solid;
48
+ border-radius: 50%;
49
+ transition: calc(var(--intergalactic-duration-control, 200) * 1ms) all ease-in-out;
50
+ }
51
+
52
+ &::after {
53
+ content: '';
54
+ position: absolute;
55
+ right: 0;
56
+ bottom: 0;
57
+ top: 50%;
58
+ left: 50%;
59
+ transform: translate(-50%, -50%);
60
+ width: 0;
61
+ height: 0;
62
+ border-radius: 50%;
63
+ background: var(--intergalactic-bg-primary-neutral, #ffffff);
64
+ }
65
+ }
66
+
67
+ SValue[disabled] {
68
+ opacity: var(--intergalactic-disabled-opacity, 0.3);
69
+ cursor: default;
70
+ pointer-events: none;
71
+ user-select: none;
72
+ }
73
+
74
+ SValue[size='m'] {
75
+ width: 16px;
76
+ height: 16px;
77
+
78
+ SInvalidPattern:before {
79
+ width: 14px;
80
+ height: 14px;
81
+ }
82
+ }
83
+
84
+ SValue[size='l'] {
85
+ width: 20px;
86
+ height: 20px;
87
+
88
+ SInvalidPattern:before {
89
+ width: 18px;
90
+ height: 18px;
91
+ }
92
+ }
93
+
94
+ SValue[state='normal']::before {
95
+ border-color: var(--intergalactic-border-primary, #c4c7cf);
96
+ }
97
+
98
+ SValue[state='invalid']::before {
99
+ border-color: var(--intergalactic-border-critical-active, #d1002f);
100
+ }
101
+
102
+ SControl {
103
+ position: absolute;
104
+ clip: rect(1px, 1px, 1px, 1px);
105
+ }
106
+
107
+ SControl:checked~SValue::before {
108
+ border-color: var(--intergalactic-control-primary-info, #008ff8);
109
+ background-color: var(--intergalactic-control-primary-info, #008ff8);
110
+ }
111
+
112
+ SControl:checked~SValue[size='m']::after {
113
+ width: 6px;
114
+ height: 6px;
115
+ }
116
+
117
+ SControl:checked~SValue[size='l']::after {
118
+ width: 8px;
119
+ height: 8px;
120
+ }
121
+
122
+ SValue[state='normal'][keyboardFocused]::before {
123
+ box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
124
+ border-color: var(--intergalactic-border-info-active, #006dca);
125
+ }
126
+
127
+ SValue[state='invalid'][keyboardFocused]::before {
128
+ box-shadow: var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5));
129
+ }
130
+
131
+ SControl:checked~SValue[theme]::before {
132
+ border-color: var(--theme);
133
+ background-color: var(--theme);
134
+ }
135
+
136
+ SValue[state='normal'][theme]::before {
137
+ border-color: var(--theme);
138
+ }
139
+
140
+ SInvalidPattern {
141
+ background: transparent;
142
+ overflow: hidden;
143
+
144
+ &:before {
145
+ content: "";
146
+ position: absolute;
147
+ top: 1px;
148
+ left: 1px;
149
+ border-radius: 50%;
150
+ background-image: var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));
151
+ background-size: 6px 6px;
152
+ background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
153
+ }
154
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/radio",
3
3
  "description": "Semrush Radio Component",
4
- "version": "6.43.2-prerelease.5",
4
+ "version": "6.43.3-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,12 +14,12 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/utils": "4.48.2-prerelease.5",
18
- "@semcore/flex-box": "5.41.2-prerelease.5",
19
- "@semcore/typography": "5.52.2-prerelease.5"
17
+ "@semcore/utils": "4.48.4-prerelease.0",
18
+ "@semcore/flex-box": "5.41.3-prerelease.0",
19
+ "@semcore/typography": "5.53.1-prerelease.0"
20
20
  },
21
21
  "peerDependencies": {
22
- "@semcore/core": "^2.39.2-prerelease.5",
22
+ "@semcore/core": "^2.39.3-prerelease.0",
23
23
  "react": "16.8 - 18",
24
24
  "react-dom": "16.8 - 18"
25
25
  },