@semcore/radio 6.43.1 → 16.0.0-prerelease.10

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
+ ## [16.0.0] - 2025-02-13
6
+
7
+ ### Changed
8
+
9
+ - `keyboardFocusEnhance` to css `:focus-visible` property.
10
+
5
11
  ## [6.43.1] - 2025-03-20
6
12
 
7
13
  ### Changed
package/lib/cjs/Radio.js CHANGED
@@ -22,36 +22,33 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
22
22
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
23
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
24
24
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
- var _index = require("@semcore/utils/lib/core/index");
26
- var _core = _interopRequireWildcard(require("@semcore/core"));
25
+ var _core = require("@semcore/core");
27
26
  var _react = _interopRequireDefault(require("react"));
28
27
  var _flexBox = require("@semcore/flex-box");
29
- var _assignProps8 = _interopRequireWildcard(require("@semcore/utils/lib/assignProps"));
30
- var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
31
- var _resolveColorEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/resolveColorEnhance"));
32
- var _inputProps = _interopRequireWildcard(require("@semcore/utils/lib/inputProps"));
33
- var _useColorResolver = require("@semcore/utils/lib/use/useColorResolver");
34
- var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
28
+ var _assignProps8 = _interopRequireWildcard(require("@semcore/core/lib/utils/assignProps"));
29
+ var _resolveColorEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/resolveColorEnhance"));
30
+ var _inputProps = _interopRequireWildcard(require("@semcore/core/lib/utils/inputProps"));
31
+ var _useColorResolver = require("@semcore/core/lib/utils/use/useColorResolver");
32
+ var _logger = _interopRequireDefault(require("@semcore/core/lib/utils/logger"));
35
33
  var _typography = require("@semcore/typography");
36
34
  var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"],
37
35
  _excluded2 = ["children", "Children"];
38
36
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
39
- var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SRadio_n8xmt_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_.__color_n8xmt_gg_{color:var(--color_n8xmt)}.___SRadio_n8xmt_gg_.__disabled_n8xmt_gg_{pointer-events:none}.___SText_n8xmt_gg_._size_m_n8xmt_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_n8xmt_gg_._size_l_n8xmt_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_n8xmt_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_n8xmt_gg_::after,.___SValue_n8xmt_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_n8xmt_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_n8xmt_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_n8xmt_gg_.__disabled_n8xmt_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_n8xmt_gg_._size_m_n8xmt_gg_{width:16px;height:16px}.___SValue_n8xmt_gg_._size_m_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:14px;height:14px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_{width:20px;height:20px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:18px;height:18px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_n8xmt_gg_._state_invalid_n8xmt_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_n8xmt_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_m_n8xmt_gg_::after{width:6px;height:6px}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_l_n8xmt_gg_::after{width:8px;height:8px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__keyboardFocused_n8xmt_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_n8xmt_gg_._state_invalid_n8xmt_gg_.__keyboardFocused_n8xmt_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt);background-color:var(--theme_n8xmt)}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt)}.___SInvalidPattern_n8xmt_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_n8xmt_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__*/, "n8xmt_gg_") /*__reshadow_css_end__*/, {
40
- "__SRadio": "___SRadio_n8xmt_gg_",
41
- "_disabled": "__disabled_n8xmt_gg_",
42
- "__SText": "___SText_n8xmt_gg_",
43
- "_size_m": "_size_m_n8xmt_gg_",
44
- "_size_l": "_size_l_n8xmt_gg_",
45
- "__SValue": "___SValue_n8xmt_gg_",
46
- "_state_normal": "_state_normal_n8xmt_gg_",
47
- "_state_invalid": "_state_invalid_n8xmt_gg_",
48
- "__SControl": "___SControl_n8xmt_gg_",
49
- "_keyboardFocused": "__keyboardFocused_n8xmt_gg_",
50
- "_theme": "__theme_n8xmt_gg_",
51
- "--theme": "--theme_n8xmt",
52
- "_color": "__color_n8xmt_gg_",
53
- "--color": "--color_n8xmt",
54
- "__SInvalidPattern": "___SInvalidPattern_n8xmt_gg_"
37
+ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SRadio_lyu5n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_.__color_lyu5n_gg_{color:var(--color_lyu5n)}.___SRadio_lyu5n_gg_.__disabled_lyu5n_gg_{pointer-events:none}.___SText_lyu5n_gg_._size_m_lyu5n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_lyu5n_gg_._size_l_lyu5n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_lyu5n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_lyu5n_gg_::after,.___SValue_lyu5n_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_lyu5n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_lyu5n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_lyu5n_gg_.__disabled_lyu5n_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_lyu5n_gg_._size_m_lyu5n_gg_{width:16px;height:16px}.___SValue_lyu5n_gg_._size_m_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:14px;height:14px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_{width:20px;height:20px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:18px;height:18px}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_lyu5n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_m_lyu5n_gg_::after{width:6px;height:6px}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_l_lyu5n_gg_::after{width:8px;height:8px}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_normal_lyu5n_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)}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n);background-color:var(--theme_lyu5n)}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n)}.___SInvalidPattern_lyu5n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_lyu5n_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__*/, "lyu5n_gg_") /*__reshadow_css_end__*/, {
38
+ "__SRadio": "___SRadio_lyu5n_gg_",
39
+ "_disabled": "__disabled_lyu5n_gg_",
40
+ "__SText": "___SText_lyu5n_gg_",
41
+ "_size_m": "_size_m_lyu5n_gg_",
42
+ "_size_l": "_size_l_lyu5n_gg_",
43
+ "__SValue": "___SValue_lyu5n_gg_",
44
+ "_state_normal": "_state_normal_lyu5n_gg_",
45
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
46
+ "__SControl": "___SControl_lyu5n_gg_",
47
+ "_theme": "__theme_lyu5n_gg_",
48
+ "--theme": "--theme_lyu5n",
49
+ "_color": "__color_lyu5n_gg_",
50
+ "--color": "--color_lyu5n",
51
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
55
52
  });
56
53
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
57
54
  (0, _inherits2["default"])(RadioGroupRoot, _Component);
@@ -104,7 +101,7 @@ var RadioGroupRoot = /*#__PURE__*/function (_Component) {
104
101
  (0, _defineProperty2["default"])(RadioGroupRoot, "defaultProps", {
105
102
  defaultValue: null
106
103
  });
107
- var RadioGroup = (0, _core["default"])(RadioGroupRoot);
104
+ var RadioGroup = (0, _core.createComponent)(RadioGroupRoot);
108
105
  exports.RadioGroup = RadioGroup;
109
106
  var RadioRoot = /*#__PURE__*/function (_Component2) {
110
107
  (0, _inherits2["default"])(RadioRoot, _Component2);
@@ -327,7 +324,7 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
327
324
  includeInputProps: _inputProps.inputProps,
328
325
  defaultChecked: false
329
326
  });
330
- (0, _defineProperty2["default"])(ValueRoot, "enhance", [(0, _keyboardFocusEnhance["default"])(), (0, _resolveColorEnhance["default"])()]);
327
+ (0, _defineProperty2["default"])(ValueRoot, "enhance", [(0, _resolveColorEnhance["default"])()]);
331
328
  (0, _defineProperty2["default"])(ValueRoot, "displayName", 'Value');
332
329
  (0, _defineProperty2["default"])(ValueRoot, "contextType", RadioGroup[_core.CONTEXT_COMPONENT]);
333
330
  (0, _defineProperty2["default"])(ValueRoot, "style", style);
@@ -379,11 +376,11 @@ var Text = function Text(props) {
379
376
  }, _ref5))));
380
377
  };
381
378
  Text.displayName = 'Text';
382
- var Value = (0, _core["default"])(ValueRoot, {
379
+ var Value = (0, _core.createComponent)(ValueRoot, {
383
380
  Control: Control,
384
381
  RadioMark: RadioMark
385
382
  });
386
- var Radio = (0, _core["default"])(RadioRoot, {
383
+ var Radio = (0, _core.createComponent)(RadioRoot, {
387
384
  Text: Text,
388
385
  Value: Value
389
386
  });
@@ -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,GAA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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","require","_react","_interopRequireDefault","_flexBox","_assignProps8","_interopRequireWildcard","_resolveColorEnhance","_inputProps","_useColorResolver","_logger","_typography","_excluded","_excluded2","style","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","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/core/lib/utils/assignProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/core/lib/utils/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 = [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,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAF,uBAAA,CAAAL,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,+BAAAd,KAAA,CAAAe,OAAA,CAAAC,MAAA;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;EAAA,IAAAC,aAAA,aAAAR,cAAA;IAAAS,GAAA;IAAAC,KAAA,EAOlB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aAAO,EAAC0E,MAAM,CAAC,eACpBvF,MAAA,YAAAsC,aAAA,CAACqH,KAAK,EAAAD,MAAA,CAAAjE,EAAA,cAAAC,cAAA,qBAAA5F,KAAA,CAAA0C,WAAA;IAAA,OAA6B,MAAM;IAAA,aAAYqF,YAAY,CAACgC,KAAK;EAAC,GAAAJ,KAAA,IAAI;AAEhF,CAAC;AACD3D,IAAI,CAACqD,WAAW,GAAG,MAAM;AAIzB,IAAMtD,KAAK,GAAG,IAAAhD,qBAAe,EAACmD,SAAS,EAAE;EACvC0C,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAAC;AAEF,IAAM/C,KAAK,GAAG,IAAA/C,qBAAe,EAACE,SAAS,EAAE;EACvC+C,IAAI,EAAJA,IAAI;EACJD,KAAK,EAALA;AACF,CAAC,CAAC;AAEK,IAAMoE,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAACpH,OAAA,CAAAmH,cAAA,GAAAA,cAAA;AAAA,IAAAE,QAAA,GAEpCvE,KAAK;AAAA9C,OAAA,cAAAqH,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}
@@ -119,12 +119,12 @@ SControl:checked~SValue[size='l']::after {
119
119
  height: 8px;
120
120
  }
121
121
 
122
- SValue[state='normal'][keyboardFocused]::before {
122
+ SControl:focus-visible + SValue[state='normal']::before {
123
123
  box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
124
124
  border-color: var(--intergalactic-border-info-active, #006dca);
125
125
  }
126
126
 
127
- SValue[state='invalid'][keyboardFocused]::before {
127
+ SControl:focus-visible + SValue[state='invalid']::before {
128
128
  box-shadow: var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5));
129
129
  }
130
130
 
package/lib/es6/Radio.js CHANGED
@@ -7,7 +7,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _createSuper from "@babel/runtime/helpers/createSuper";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
10
+ import { sstyled as _sstyled } from "@semcore/core";
11
11
  import { assignProps as _assignProps5 } from "@semcore/core";
12
12
  import { assignProps as _assignProps4 } from "@semcore/core";
13
13
  import { assignProps as _assignProps3 } from "@semcore/core";
@@ -16,32 +16,30 @@ import { assignProps as _assignProps } from "@semcore/core";
16
16
  var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"],
17
17
  _excluded2 = ["children", "Children"];
18
18
  import React from 'react';
19
- import createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';
19
+ import { createComponent, Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';
20
20
  import { Flex, Box, InvalidStateBox } from '@semcore/flex-box';
21
- import assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
22
- import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
23
- import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
24
- import getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';
25
- import { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';
21
+ import assignProps, { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
22
+ import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
23
+ import getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';
24
+ import { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';
26
25
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
27
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_n8xmt_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_.__color_n8xmt_gg_{color:var(--color_n8xmt)}.___SRadio_n8xmt_gg_.__disabled_n8xmt_gg_{pointer-events:none}.___SText_n8xmt_gg_._size_m_n8xmt_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_n8xmt_gg_._size_l_n8xmt_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_n8xmt_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_n8xmt_gg_::after,.___SValue_n8xmt_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_n8xmt_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_n8xmt_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_n8xmt_gg_.__disabled_n8xmt_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_n8xmt_gg_._size_m_n8xmt_gg_{width:16px;height:16px}.___SValue_n8xmt_gg_._size_m_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:14px;height:14px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_{width:20px;height:20px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:18px;height:18px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_n8xmt_gg_._state_invalid_n8xmt_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_n8xmt_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_m_n8xmt_gg_::after{width:6px;height:6px}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_l_n8xmt_gg_::after{width:8px;height:8px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__keyboardFocused_n8xmt_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_n8xmt_gg_._state_invalid_n8xmt_gg_.__keyboardFocused_n8xmt_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt);background-color:var(--theme_n8xmt)}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt)}.___SInvalidPattern_n8xmt_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_n8xmt_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__*/, "n8xmt_gg_") /*__reshadow_css_end__*/, {
28
- "__SRadio": "___SRadio_n8xmt_gg_",
29
- "_disabled": "__disabled_n8xmt_gg_",
30
- "__SText": "___SText_n8xmt_gg_",
31
- "_size_m": "_size_m_n8xmt_gg_",
32
- "_size_l": "_size_l_n8xmt_gg_",
33
- "__SValue": "___SValue_n8xmt_gg_",
34
- "_state_normal": "_state_normal_n8xmt_gg_",
35
- "_state_invalid": "_state_invalid_n8xmt_gg_",
36
- "__SControl": "___SControl_n8xmt_gg_",
37
- "_keyboardFocused": "__keyboardFocused_n8xmt_gg_",
38
- "_theme": "__theme_n8xmt_gg_",
39
- "--theme": "--theme_n8xmt",
40
- "_color": "__color_n8xmt_gg_",
41
- "--color": "--color_n8xmt",
42
- "__SInvalidPattern": "___SInvalidPattern_n8xmt_gg_"
26
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_lyu5n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_.__color_lyu5n_gg_{color:var(--color_lyu5n)}.___SRadio_lyu5n_gg_.__disabled_lyu5n_gg_{pointer-events:none}.___SText_lyu5n_gg_._size_m_lyu5n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_lyu5n_gg_._size_l_lyu5n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_lyu5n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_lyu5n_gg_::after,.___SValue_lyu5n_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_lyu5n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_lyu5n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_lyu5n_gg_.__disabled_lyu5n_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_lyu5n_gg_._size_m_lyu5n_gg_{width:16px;height:16px}.___SValue_lyu5n_gg_._size_m_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:14px;height:14px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_{width:20px;height:20px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:18px;height:18px}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_lyu5n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_m_lyu5n_gg_::after{width:6px;height:6px}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_l_lyu5n_gg_::after{width:8px;height:8px}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_normal_lyu5n_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)}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n);background-color:var(--theme_lyu5n)}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n)}.___SInvalidPattern_lyu5n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_lyu5n_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__*/, "lyu5n_gg_") /*__reshadow_css_end__*/, {
27
+ "__SRadio": "___SRadio_lyu5n_gg_",
28
+ "_disabled": "__disabled_lyu5n_gg_",
29
+ "__SText": "___SText_lyu5n_gg_",
30
+ "_size_m": "_size_m_lyu5n_gg_",
31
+ "_size_l": "_size_l_lyu5n_gg_",
32
+ "__SValue": "___SValue_lyu5n_gg_",
33
+ "_state_normal": "_state_normal_lyu5n_gg_",
34
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
35
+ "__SControl": "___SControl_lyu5n_gg_",
36
+ "_theme": "__theme_lyu5n_gg_",
37
+ "--theme": "--theme_lyu5n",
38
+ "_color": "__color_lyu5n_gg_",
39
+ "--color": "--color_lyu5n",
40
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
43
41
  });
44
- import logger from '@semcore/utils/lib/logger';
42
+ import logger from '@semcore/core/lib/utils/logger';
45
43
  import { Text as TypographyText } from '@semcore/typography';
46
44
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
47
45
  _inherits(RadioGroupRoot, _Component);
@@ -316,7 +314,7 @@ _defineProperty(ValueRoot, "defaultProps", {
316
314
  includeInputProps: inputProps,
317
315
  defaultChecked: false
318
316
  });
319
- _defineProperty(ValueRoot, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
317
+ _defineProperty(ValueRoot, "enhance", [resolveColorEnhance()]);
320
318
  _defineProperty(ValueRoot, "displayName", 'Value');
321
319
  _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
322
320
  _defineProperty(ValueRoot, "style", style);
@@ -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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AAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAElD,eAAejE,KAAK"}
1
+ {"version":3,"file":"Radio.js","names":["React","createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","Flex","Box","InvalidStateBox","assignProps","callAllEventHandlers","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/core/lib/utils/assignProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/core/lib/utils/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 = [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\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.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';\nimport { Text } from '@semcore/typography';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps &\n KeyboardFocusProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n };\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', typeof Flex, RadioGroupProps>;\n\nexport type RadioValueControlProps = {};\nexport type RadioValueMarkProps = {};\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps> & {\n Control: Intergalactic.Component<'input', RadioValueControlProps>;\n RadioMark: Intergalactic.Component<typeof Box, RadioValueMarkProps>;\n };\n Text: typeof Text;\n};\n\ndeclare const wrapRadioGroup: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticRadioGroupComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticRadioGroupComponent<PropsExtending>;\nexport { wrapRadioGroup };\n\nexport default Radio;\n"],"mappings":""}
@@ -119,12 +119,12 @@ SControl:checked~SValue[size='l']::after {
119
119
  height: 8px;
120
120
  }
121
121
 
122
- SValue[state='normal'][keyboardFocused]::before {
122
+ SControl:focus-visible + SValue[state='normal']::before {
123
123
  box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
124
124
  border-color: var(--intergalactic-border-info-active, #006dca);
125
125
  }
126
126
 
127
- SValue[state='invalid'][keyboardFocused]::before {
127
+ SControl:focus-visible + SValue[state='invalid']::before {
128
128
  box-shadow: var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5));
129
129
  }
130
130
 
package/lib/esm/Radio.mjs CHANGED
@@ -1,273 +1,327 @@
1
- import N from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import G from "@babel/runtime/helpers/esm/slicedToArray";
3
- import h 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 C, Component as E, sstyled as v } 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 te from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
16
- import re 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 ne from "@semcore/utils/lib/logger";
21
- import { Text as _e } from "@semcore/typography";
22
- var ie = ["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, createComponent, CONTEXT_COMPONENT, assignProps, Component } from "@semcore/core";
11
+ import React from "react";
12
+ import { Flex, Box, InvalidStateBox } from "@semcore/flex-box";
13
+ import assignProps$1, { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
14
+ import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
15
+ import getInputProps, { inputProps } from "@semcore/core/lib/utils/inputProps";
16
+ import { inputProps as inputProps2 } from "@semcore/core/lib/utils/inputProps";
17
+ import { useColorResolver } from "@semcore/core/lib/utils/use/useColorResolver";
18
+ import logger from "@semcore/core/lib/utils/logger";
19
+ import { Text as Text$1 } from "@semcore/typography";
20
+ var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"], _excluded2 = ["children", "Children"];
21
+ var style = (
23
22
  /*__reshadow_css_start__*/
24
- (Y.insert(
23
+ (sstyled.insert(
25
24
  /*__inner_css_start__*/
26
- '.___SRadio_n8xmt_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_n8xmt_gg_ .___SText_n8xmt_gg_.__color_n8xmt_gg_{color:var(--color_n8xmt)}.___SRadio_n8xmt_gg_.__disabled_n8xmt_gg_{pointer-events:none}.___SText_n8xmt_gg_._size_m_n8xmt_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_n8xmt_gg_._size_l_n8xmt_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_n8xmt_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_n8xmt_gg_::after,.___SValue_n8xmt_gg_::before{content:"";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_n8xmt_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_n8xmt_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_n8xmt_gg_.__disabled_n8xmt_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_n8xmt_gg_._size_m_n8xmt_gg_{width:16px;height:16px}.___SValue_n8xmt_gg_._size_m_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:14px;height:14px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_{width:20px;height:20px}.___SValue_n8xmt_gg_._size_l_n8xmt_gg_ .___SInvalidPattern_n8xmt_gg_:before{width:18px;height:18px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_n8xmt_gg_._state_invalid_n8xmt_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_n8xmt_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_m_n8xmt_gg_::after{width:6px;height:6px}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_._size_l_n8xmt_gg_::after{width:8px;height:8px}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__keyboardFocused_n8xmt_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_n8xmt_gg_._state_invalid_n8xmt_gg_.__keyboardFocused_n8xmt_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_n8xmt_gg_:checked~.___SValue_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt);background-color:var(--theme_n8xmt)}.___SValue_n8xmt_gg_._state_normal_n8xmt_gg_.__theme_n8xmt_gg_::before{border-color:var(--theme_n8xmt)}.___SInvalidPattern_n8xmt_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_n8xmt_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
- "n8xmt_gg_"
25
+ '.___SRadio_lyu5n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_lyu5n_gg_ .___SText_lyu5n_gg_.__color_lyu5n_gg_{color:var(--color_lyu5n)}.___SRadio_lyu5n_gg_.__disabled_lyu5n_gg_{pointer-events:none}.___SText_lyu5n_gg_._size_m_lyu5n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_lyu5n_gg_._size_l_lyu5n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_lyu5n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_lyu5n_gg_::after,.___SValue_lyu5n_gg_::before{content:"";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_lyu5n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_lyu5n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_lyu5n_gg_.__disabled_lyu5n_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_lyu5n_gg_._size_m_lyu5n_gg_{width:16px;height:16px}.___SValue_lyu5n_gg_._size_m_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:14px;height:14px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_{width:20px;height:20px}.___SValue_lyu5n_gg_._size_l_lyu5n_gg_ .___SInvalidPattern_lyu5n_gg_:before{width:18px;height:18px}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_lyu5n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_m_lyu5n_gg_::after{width:6px;height:6px}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_._size_l_lyu5n_gg_::after{width:8px;height:8px}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_normal_lyu5n_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)}.___SControl_lyu5n_gg_:focus-visible+.___SValue_lyu5n_gg_._state_invalid_lyu5n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_lyu5n_gg_:checked~.___SValue_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n);background-color:var(--theme_lyu5n)}.___SValue_lyu5n_gg_._state_normal_lyu5n_gg_.__theme_lyu5n_gg_::before{border-color:var(--theme_lyu5n)}.___SInvalidPattern_lyu5n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_lyu5n_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)}',
26
+ "lyu5n_gg_"
28
27
  ), {
29
- __SRadio: "___SRadio_n8xmt_gg_",
30
- _disabled: "__disabled_n8xmt_gg_",
31
- __SText: "___SText_n8xmt_gg_",
32
- _size_m: "_size_m_n8xmt_gg_",
33
- _size_l: "_size_l_n8xmt_gg_",
34
- __SValue: "___SValue_n8xmt_gg_",
35
- _state_normal: "_state_normal_n8xmt_gg_",
36
- _state_invalid: "_state_invalid_n8xmt_gg_",
37
- __SControl: "___SControl_n8xmt_gg_",
38
- _keyboardFocused: "__keyboardFocused_n8xmt_gg_",
39
- _theme: "__theme_n8xmt_gg_",
40
- "--theme": "--theme_n8xmt",
41
- _color: "__color_n8xmt_gg_",
42
- "--color": "--color_n8xmt",
43
- __SInvalidPattern: "___SInvalidPattern_n8xmt_gg_"
28
+ "__SRadio": "___SRadio_lyu5n_gg_",
29
+ "_disabled": "__disabled_lyu5n_gg_",
30
+ "__SText": "___SText_lyu5n_gg_",
31
+ "_size_m": "_size_m_lyu5n_gg_",
32
+ "_size_l": "_size_l_lyu5n_gg_",
33
+ "__SValue": "___SValue_lyu5n_gg_",
34
+ "_state_normal": "_state_normal_lyu5n_gg_",
35
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
36
+ "__SControl": "___SControl_lyu5n_gg_",
37
+ "_theme": "__theme_lyu5n_gg_",
38
+ "--theme": "--theme_lyu5n",
39
+ "_color": "__color_lyu5n_gg_",
40
+ "--color": "--color_lyu5n",
41
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
44
42
  })
45
- ), $ = /* @__PURE__ */ function(c) {
46
- D(_, c);
47
- var o = T(_);
48
- function _() {
49
- return V(this, _), o.apply(this, arguments);
43
+ );
44
+ var RadioGroupRoot = /* @__PURE__ */ function(_Component) {
45
+ _inherits(RadioGroupRoot2, _Component);
46
+ var _super = _createSuper(RadioGroupRoot2);
47
+ function RadioGroupRoot2() {
48
+ _classCallCheck(this, RadioGroupRoot2);
49
+ return _super.apply(this, arguments);
50
50
  }
51
- return z(_, [{
51
+ _createClass(RadioGroupRoot2, [{
52
52
  key: "uncontrolledProps",
53
- value: function() {
53
+ value: function uncontrolledProps() {
54
54
  return {
55
55
  value: null
56
56
  };
57
57
  }
58
58
  }, {
59
59
  key: "setContext",
60
- value: function() {
61
- var t = this.asProps, e = t.theme, a = t.size, n = t.name, i = t.value, s = t.onChange, d = t.disabled;
60
+ value: function setContext() {
61
+ 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
62
  return {
63
- onChange: s,
64
- value: i,
65
- theme: e,
66
- size: a,
67
- name: n,
68
- disabled: d
63
+ onChange,
64
+ value,
65
+ theme,
66
+ size,
67
+ name,
68
+ disabled
69
69
  };
70
70
  }
71
71
  }, {
72
72
  key: "render",
73
- value: function() {
74
- var t = this.asProps, e = this.asProps.Children;
75
- return /* @__PURE__ */ l.createElement(Z, C({
76
- direction: "column",
77
- role: "group",
78
- __excludeProps: ["onChange"]
79
- }, t), /* @__PURE__ */ l.createElement(e, null));
73
+ value: function render() {
74
+ var _ref = this.asProps;
75
+ var Children = this.asProps.Children;
76
+ return /* @__PURE__ */ React.createElement(Flex, assignProps({
77
+ "direction": "column",
78
+ "role": "group",
79
+ "__excludeProps": ["onChange"]
80
+ }, _ref), /* @__PURE__ */ React.createElement(Children, null));
80
81
  }
81
- }]), _;
82
- }(E);
83
- g($, "displayName", "RadioGroup");
84
- g($, "defaultProps", {
82
+ }]);
83
+ return RadioGroupRoot2;
84
+ }(Component);
85
+ _defineProperty(RadioGroupRoot, "displayName", "RadioGroup");
86
+ _defineProperty(RadioGroupRoot, "defaultProps", {
85
87
  defaultValue: null
86
88
  });
87
- var U = w($), y = /* @__PURE__ */ function(c) {
88
- D(_, c);
89
- var o = T(_);
90
- function _() {
91
- var r;
92
- V(this, _);
93
- for (var t = arguments.length, e = new Array(t), a = 0; a < t; a++)
94
- e[a] = arguments[a];
95
- return r = o.call.apply(o, [this].concat(e)), g(R(r), "state", {
89
+ var RadioGroup = createComponent(RadioGroupRoot);
90
+ var RadioRoot = /* @__PURE__ */ function(_Component2) {
91
+ _inherits(RadioRoot2, _Component2);
92
+ var _super2 = _createSuper(RadioRoot2);
93
+ function RadioRoot2() {
94
+ var _this;
95
+ _classCallCheck(this, RadioRoot2);
96
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
97
+ args[_key] = arguments[_key];
98
+ }
99
+ _this = _super2.call.apply(_super2, [this].concat(args));
100
+ _defineProperty(_assertThisInitialized(_this), "state", {
96
101
  hoistedDisabled: void 0
97
- }), g(R(r), "hoistDisabled", function(n) {
98
- ne.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.", r.asProps["data-ui-name"]), r.setState({
99
- hoistedDisabled: n
102
+ });
103
+ _defineProperty(_assertThisInitialized(_this), "hoistDisabled", function(disabled) {
104
+ 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"]);
105
+ _this.setState({
106
+ hoistedDisabled: disabled
100
107
  });
101
- }), r;
108
+ });
109
+ return _this;
102
110
  }
103
- return z(_, [{
111
+ _createClass(RadioRoot2, [{
104
112
  key: "getTextProps",
105
- value: function() {
106
- var t = A(this.asProps, this.context), e = t.size, a = e === void 0 ? "m" : e, n = t.disabled, i = t.label, s = this.state.hoistedDisabled, d = {
107
- size: a,
108
- children: i,
109
- disabled: n ?? s,
113
+ value: function getTextProps() {
114
+ 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;
115
+ var hoistedDisabled = this.state.hoistedDisabled;
116
+ var textProps = {
117
+ size,
118
+ children: label,
119
+ disabled: disabled !== null && disabled !== void 0 ? disabled : hoistedDisabled,
110
120
  hoistDisabled: this.hoistDisabled,
111
121
  rootDisabled: this.props.disabled
112
122
  };
113
- return d;
123
+ return textProps;
114
124
  }
115
125
  }, {
116
126
  key: "getValueProps",
117
- value: function() {
118
- var t, e = A(this.asProps, this.context), a = e.size, n = a === void 0 ? "m" : a, i = e.state, s = i === void 0 ? "normal" : i, d = e.theme, m = e.disabled, b = e.name, u = this.asProps, p = u.value, x = u.checked, P = this.state.hoistedDisabled;
127
+ value: function getValueProps() {
128
+ var _this$props$size;
129
+ 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;
130
+ var _this$asProps2 = this.asProps, value = _this$asProps2.value, checked = _this$asProps2.checked;
131
+ var hoistedDisabled = this.state.hoistedDisabled;
119
132
  return {
120
- size: (t = this.props.size) !== null && t !== void 0 ? t : n,
121
- disabled: m ?? P,
122
- state: s,
123
- theme: d,
124
- value: p,
125
- checked: x,
126
- name: b,
133
+ size: (_this$props$size = this.props.size) !== null && _this$props$size !== void 0 ? _this$props$size : size,
134
+ disabled: disabled !== null && disabled !== void 0 ? disabled : hoistedDisabled,
135
+ state,
136
+ theme,
137
+ value,
138
+ checked,
139
+ name,
127
140
  hoistDisabled: this.hoistDisabled,
128
141
  rootDisabled: this.props.disabled
129
142
  };
130
143
  }
131
144
  }, {
132
145
  key: "render",
133
- value: function() {
134
- var t = this.asProps, e, a = I, n = this.asProps, i = n.styles, s = n.Children, d = n.children;
135
- return e = v(i), /* @__PURE__ */ l.createElement(a, e.cn("SRadio", h({}, C({
136
- tag: "label",
137
- __excludeProps: ["onChange", "label", "disabled"]
138
- }, t))), d ? /* @__PURE__ */ l.createElement(s, e.cn("Children", {})) : /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(S.Value, null), /* @__PURE__ */ l.createElement(S.Text, null)));
146
+ value: function render() {
147
+ var _ref2 = this.asProps, _ref6;
148
+ var SRadio = Box;
149
+ var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, Children = _this$asProps3.Children, hasChildren = _this$asProps3.children;
150
+ return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SRadio, _ref6.cn("SRadio", _objectSpread({}, assignProps({
151
+ "tag": "label",
152
+ "__excludeProps": ["onChange", "label", "disabled"]
153
+ }, _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)));
154
+ }
155
+ }]);
156
+ return RadioRoot2;
157
+ }(Component);
158
+ _defineProperty(RadioRoot, "displayName", "Radio");
159
+ _defineProperty(RadioRoot, "style", style);
160
+ _defineProperty(RadioRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
161
+ var ValueRoot = /* @__PURE__ */ function(_Component3) {
162
+ _inherits(ValueRoot2, _Component3);
163
+ var _super3 = _createSuper(ValueRoot2);
164
+ function ValueRoot2() {
165
+ var _this2;
166
+ _classCallCheck(this, ValueRoot2);
167
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
168
+ args[_key2] = arguments[_key2];
139
169
  }
140
- }]), _;
141
- }(E);
142
- g(y, "displayName", "Radio");
143
- g(y, "style", B);
144
- g(y, "contextType", U[j]);
145
- var f = /* @__PURE__ */ function(c) {
146
- D(_, c);
147
- var o = T(_);
148
- function _() {
149
- var r;
150
- V(this, _);
151
- for (var t = arguments.length, e = new Array(t), a = 0; a < t; a++)
152
- e[a] = arguments[a];
153
- return r = o.call.apply(o, [this].concat(e)), g(R(r), "bindHandlerChange", function(n) {
154
- return function(i) {
155
- typeof r.context.onChange == "function" && r.context.onChange(n, i);
170
+ _this2 = _super3.call.apply(_super3, [this].concat(args));
171
+ _defineProperty(_assertThisInitialized(_this2), "bindHandlerChange", function(value) {
172
+ return function(e) {
173
+ if (typeof _this2.context.onChange === "function") {
174
+ _this2.context.onChange(value, e);
175
+ }
156
176
  };
157
- }), r;
177
+ });
178
+ return _this2;
158
179
  }
159
- return z(_, [{
180
+ _createClass(ValueRoot2, [{
160
181
  key: "uncontrolledProps",
161
- value: function() {
182
+ value: function uncontrolledProps() {
162
183
  return {
163
- checked: function(e) {
184
+ checked: function checked(e) {
164
185
  return e.target.checked;
165
186
  }
166
187
  };
167
188
  }
168
189
  }, {
169
190
  key: "getControlProps",
170
- value: function() {
171
- var t = this.context.value, e = this.asProps, a = e.forwardRef, n = e.includeInputProps, i = e.state, s = e.value, d = O(this.asProps, n), m = G(d, 1), b = m[0], u = s ?? "", p = h(h({
172
- ref: a,
173
- state: i
174
- }, b), {}, {
175
- value: u
191
+ value: function getControlProps() {
192
+ var currentValue = this.context.value;
193
+ var _this$asProps4 = this.asProps, forwardRef = _this$asProps4.forwardRef, includeInputProps = _this$asProps4.includeInputProps, state = _this$asProps4.state, value = _this$asProps4.value;
194
+ var _getInputProps = getInputProps(this.asProps, includeInputProps), _getInputProps2 = _slicedToArray(_getInputProps, 1), commonControlProps = _getInputProps2[0];
195
+ var inputValue = value !== null && value !== void 0 ? value : "";
196
+ var controlProps = _objectSpread(_objectSpread({
197
+ ref: forwardRef,
198
+ state
199
+ }, commonControlProps), {}, {
200
+ value: inputValue
176
201
  });
177
- if (t !== void 0) {
178
- var x = this.props, P = x.onChange;
179
- x.onClick, p.checked = t === u, p.onChange = H(P, this.bindHandlerChange(u));
202
+ if (currentValue !== void 0) {
203
+ var _this$props = this.props, onChange = _this$props.onChange;
204
+ _this$props.onClick;
205
+ controlProps.checked = currentValue === inputValue;
206
+ controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));
180
207
  }
181
- return p;
208
+ return controlProps;
182
209
  }
183
210
  }, {
184
211
  key: "getRadioMarkProps",
185
- value: function() {
186
- var t = this.context.value, e = this.asProps, a = e.size, n = e.state, i = e.theme, s = e.keyboardFocused, d = e.value, m = e.tag, b = e.disabled, u = e.includeInputProps, p = e.resolveColor, x = N(e, ie), P = O(x, u), F = G(P, 2), J = F[0], k = F[1];
187
- k.children, k.Children;
188
- var K = N(k, le), L = d ?? "", M = h({
189
- theme: i,
190
- size: a,
191
- state: n,
192
- keyboardFocused: s,
193
- disabled: b,
194
- resolveColor: p,
195
- checked: J.checked
196
- }, K);
197
- if (t !== void 0) {
198
- var Q = this.props.onClick;
199
- m !== "label" && (M.onClick = H(Q, this.bindHandlerChange(L)));
212
+ value: function getRadioMarkProps() {
213
+ var currentValue = this.context.value;
214
+ 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);
215
+ var _getInputProps3 = getInputProps(other, includeInputProps), _getInputProps4 = _slicedToArray(_getInputProps3, 2), commonControlProps = _getInputProps4[0], radioMarkProps = _getInputProps4[1];
216
+ radioMarkProps.children;
217
+ radioMarkProps.Children;
218
+ var propsWithoutChildren = _objectWithoutProperties(radioMarkProps, _excluded2);
219
+ var inputValue = value !== null && value !== void 0 ? value : "";
220
+ var markProps = _objectSpread({
221
+ theme,
222
+ size,
223
+ state,
224
+ keyboardFocused,
225
+ disabled,
226
+ resolveColor,
227
+ checked: commonControlProps.checked
228
+ }, propsWithoutChildren);
229
+ if (currentValue !== void 0) {
230
+ var onClick = this.props.onClick;
231
+ if (tag !== "label") {
232
+ markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));
233
+ }
200
234
  }
201
- return M;
235
+ return markProps;
202
236
  }
203
237
  }, {
204
238
  key: "componentDidUpdate",
205
- value: function() {
206
- this.asProps.rootDisabled !== this.asProps.disabled && this.asProps.hoistDisabled(this.asProps.disabled);
239
+ value: function componentDidUpdate() {
240
+ if (this.asProps.rootDisabled !== this.asProps.disabled) {
241
+ this.asProps.hoistDisabled(this.asProps.disabled);
242
+ }
207
243
  }
208
244
  }, {
209
245
  key: "componentDidMount",
210
- value: function() {
211
- this.asProps.rootDisabled !== this.asProps.disabled && this.asProps.hoistDisabled(this.asProps.disabled);
246
+ value: function componentDidMount() {
247
+ if (this.asProps.rootDisabled !== this.asProps.disabled) {
248
+ this.asProps.hoistDisabled(this.asProps.disabled);
249
+ }
212
250
  }
213
251
  }, {
214
252
  key: "render",
215
- value: function() {
216
- var t, e = this.asProps, a = e.styles, n = e.children, i = e.Children;
217
- return n ? (t = v(a), /* @__PURE__ */ l.createElement(i, t.cn("Children", {}))) : (v(a), /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(S.Value.Control, null), /* @__PURE__ */ l.createElement(S.Value.RadioMark, null)));
253
+ value: function render() {
254
+ var _ref8;
255
+ var _this$asProps6 = this.asProps, styles = _this$asProps6.styles, hasChildren = _this$asProps6.children, Children = _this$asProps6.Children;
256
+ if (!hasChildren) {
257
+ return sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio.Value.Control, null), /* @__PURE__ */ React.createElement(Radio.Value.RadioMark, null));
258
+ }
259
+ return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}));
218
260
  }
219
- }]), _;
220
- }(E);
221
- g(f, "defaultProps", {
222
- includeInputProps: ae,
223
- defaultChecked: !1
261
+ }]);
262
+ return ValueRoot2;
263
+ }(Component);
264
+ _defineProperty(ValueRoot, "defaultProps", {
265
+ includeInputProps: inputProps,
266
+ defaultChecked: false
224
267
  });
225
- g(f, "enhance", [te(), re()]);
226
- g(f, "displayName", "Value");
227
- g(f, "contextType", U[j]);
228
- g(f, "style", B);
229
- var W = function(o) {
230
- var _ = arguments[0], r, t = I, e = o.styles, a = o.state;
231
- return r = v(e), /* @__PURE__ */ l.createElement(t, r.cn("SControl", h({}, C({
232
- tag: "input",
233
- type: "radio",
234
- "aria-invalid": a === "invalid"
235
- }, _))));
268
+ _defineProperty(ValueRoot, "enhance", [resolveColorEnhance()]);
269
+ _defineProperty(ValueRoot, "displayName", "Value");
270
+ _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
271
+ _defineProperty(ValueRoot, "style", style);
272
+ var Control = function Control2(props) {
273
+ var _ref3 = arguments[0], _ref9;
274
+ var SControl = Box;
275
+ var styles = props.styles, state = props.state;
276
+ return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SControl, _ref9.cn("SControl", _objectSpread({}, assignProps({
277
+ "tag": "input",
278
+ "type": "radio",
279
+ "aria-invalid": state === "invalid"
280
+ }, _ref3))));
236
281
  };
237
- W.displayName = "Control";
238
- var X = function(o) {
239
- var _ = arguments[0], r, t = I, e = ee, a = o.theme, n = o.styles, i = o.resolveColor, s = o.state, d = o.checked;
240
- return r = v(n), /* @__PURE__ */ l.createElement(t, r.cn("SValue", h({}, C({
241
- tag: "div",
242
- "use:theme": i(a),
243
- "aria-hidden": !0
244
- }, _))), s === "invalid" && !d && /* @__PURE__ */ l.createElement(e, r.cn("SInvalidPattern", {})));
282
+ Control.displayName = "Control";
283
+ var RadioMark = function RadioMark2(props) {
284
+ var _ref4 = arguments[0], _ref10;
285
+ var SValue = Box;
286
+ var SInvalidPattern = InvalidStateBox;
287
+ var theme = props.theme, styles = props.styles, resolveColor = props.resolveColor, state = props.state, checked = props.checked;
288
+ return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SValue, _ref10.cn("SValue", _objectSpread({}, assignProps({
289
+ "tag": "div",
290
+ "use:theme": resolveColor(theme),
291
+ "aria-hidden": true
292
+ }, _ref4))), state === "invalid" && !checked && /* @__PURE__ */ React.createElement(SInvalidPattern, _ref10.cn("SInvalidPattern", {})));
245
293
  };
246
- X.displayName = "RadioMark";
247
- var q = function(o) {
248
- var _ = arguments[0], r, t = _e, 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 n = oe();
253
- return r = v(e), /* @__PURE__ */ l.createElement(t, r.cn("SText", h({}, C({
254
- tag: "span",
255
- "use:color": n(a)
256
- }, _))));
294
+ RadioMark.displayName = "RadioMark";
295
+ var Text = function Text2(props) {
296
+ var _ref5 = arguments[0], _ref11;
297
+ var SText = Text$1;
298
+ var styles = props.styles, color = props.color;
299
+ React.useEffect(function() {
300
+ if (props.rootDisabled !== props.disabled) {
301
+ props.hoistDisabled(props.disabled);
302
+ }
303
+ }, [props.rootDisabled, props.disabled, props.hoistDisabled]);
304
+ var resolveColor = useColorResolver();
305
+ return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref11.cn("SText", _objectSpread({}, assignProps({
306
+ "tag": "span",
307
+ "use:color": resolveColor(color)
308
+ }, _ref5))));
257
309
  };
258
- q.displayName = "Text";
259
- var se = w(f, {
260
- Control: W,
261
- RadioMark: X
262
- }), S = w(y, {
263
- Text: q,
264
- Value: se
265
- }), Te = function(o) {
266
- return o;
310
+ Text.displayName = "Text";
311
+ var Value = createComponent(ValueRoot, {
312
+ Control,
313
+ RadioMark
314
+ });
315
+ var Radio = createComponent(RadioRoot, {
316
+ Text,
317
+ Value
318
+ });
319
+ var wrapRadioGroup = function wrapRadioGroup2(wrapper) {
320
+ return wrapper;
267
321
  };
268
322
  export {
269
- U as RadioGroup,
270
- S as default,
271
- Ie as inputProps,
272
- Te as wrapRadioGroup
323
+ RadioGroup,
324
+ Radio as default,
325
+ inputProps2 as inputProps,
326
+ wrapRadioGroup
273
327
  };
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/core/lib/utils/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
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
3
3
  import { Box, BoxProps, Flex } from '@semcore/flex-box';
4
- import { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
4
+ import { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
5
5
  import { Text } from '@semcore/typography';
6
6
 
7
7
  export type RadioSize = 'm' | 'l';
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.1",
4
+ "version": "16.0.0-prerelease.10",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,14 +14,11 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/utils": "4.48.1",
18
- "@semcore/flex-box": "5.41.1",
19
- "@semcore/typography": "5.52.1"
17
+ "@semcore/flex-box": "16.0.0-prerelease.10",
18
+ "@semcore/typography": "16.0.0-prerelease.10"
20
19
  },
21
20
  "peerDependencies": {
22
- "@semcore/core": "^2.17.5",
23
- "react": "16.8 - 18",
24
- "react-dom": "16.8 - 18"
21
+ "@semcore/base-components": "^16.0.0-prerelease.10"
25
22
  },
26
23
  "repository": {
27
24
  "type": "git",