@semcore/radio 6.43.4 → 16.0.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [16.0.0] - 2025-05-19
6
+
7
+ ### Break
8
+
9
+ - `keyboardFocusEnhance` to css `:focus-visible` property.
10
+
5
11
  ## [6.43.4] - 2025-05-13
6
12
 
7
13
  ### Changed
package/lib/cjs/Radio.js CHANGED
@@ -22,38 +22,35 @@ 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_mgb6n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_.__color_mgb6n_gg_{color:var(--color_mgb6n)}.___SRadio_mgb6n_gg_.__disabled_mgb6n_gg_{pointer-events:none}.___SText_mgb6n_gg_._size_m_mgb6n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_mgb6n_gg_._size_l_mgb6n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_mgb6n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_mgb6n_gg_::after,.___SValue_mgb6n_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_mgb6n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_mgb6n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_mgb6n_gg_.__disabled_mgb6n_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_mgb6n_gg_._size_m_mgb6n_gg_{width:16px;height:16px}.___SValue_mgb6n_gg_._size_m_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:14px;height:14px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_{width:20px;height:20px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:18px;height:18px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_mgb6n_gg_._state_invalid_mgb6n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_mgb6n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_m_mgb6n_gg_::after{width:6px;height:6px}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_l_mgb6n_gg_::after{width:8px;height:8px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__keyboardFocused_mgb6n_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_mgb6n_gg_._state_invalid_mgb6n_gg_.__keyboardFocused_mgb6n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n);background-color:var(--theme_mgb6n)}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n)}.___SInvalidPattern_mgb6n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_mgb6n_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__*/"mgb6n_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_"),
40
38
  /*__reshadow_css_end__*/
41
39
  {
42
- "__SRadio": "___SRadio_mgb6n_gg_",
43
- "_disabled": "__disabled_mgb6n_gg_",
44
- "__SText": "___SText_mgb6n_gg_",
45
- "_size_m": "_size_m_mgb6n_gg_",
46
- "_size_l": "_size_l_mgb6n_gg_",
47
- "__SValue": "___SValue_mgb6n_gg_",
48
- "_state_normal": "_state_normal_mgb6n_gg_",
49
- "_state_invalid": "_state_invalid_mgb6n_gg_",
50
- "__SControl": "___SControl_mgb6n_gg_",
51
- "_keyboardFocused": "__keyboardFocused_mgb6n_gg_",
52
- "_theme": "__theme_mgb6n_gg_",
53
- "--theme": "--theme_mgb6n",
54
- "_color": "__color_mgb6n_gg_",
55
- "--color": "--color_mgb6n",
56
- "__SInvalidPattern": "___SInvalidPattern_mgb6n_gg_"
40
+ "__SRadio": "___SRadio_lyu5n_gg_",
41
+ "_disabled": "__disabled_lyu5n_gg_",
42
+ "__SText": "___SText_lyu5n_gg_",
43
+ "_size_m": "_size_m_lyu5n_gg_",
44
+ "_size_l": "_size_l_lyu5n_gg_",
45
+ "__SValue": "___SValue_lyu5n_gg_",
46
+ "_state_normal": "_state_normal_lyu5n_gg_",
47
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
48
+ "__SControl": "___SControl_lyu5n_gg_",
49
+ "_theme": "__theme_lyu5n_gg_",
50
+ "--theme": "--theme_lyu5n",
51
+ "_color": "__color_lyu5n_gg_",
52
+ "--color": "--color_lyu5n",
53
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
57
54
  });
58
55
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
59
56
  (0, _inherits2["default"])(RadioGroupRoot, _Component);
@@ -106,7 +103,7 @@ var RadioGroupRoot = /*#__PURE__*/function (_Component) {
106
103
  (0, _defineProperty2["default"])(RadioGroupRoot, "defaultProps", {
107
104
  defaultValue: null
108
105
  });
109
- var RadioGroup = (0, _core["default"])(RadioGroupRoot);
106
+ var RadioGroup = (0, _core.createComponent)(RadioGroupRoot);
110
107
  exports.RadioGroup = RadioGroup;
111
108
  var RadioRoot = /*#__PURE__*/function (_Component2) {
112
109
  (0, _inherits2["default"])(RadioRoot, _Component2);
@@ -329,7 +326,7 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
329
326
  includeInputProps: _inputProps.inputProps,
330
327
  defaultChecked: false
331
328
  });
332
- (0, _defineProperty2["default"])(ValueRoot, "enhance", [(0, _keyboardFocusEnhance["default"])(), (0, _resolveColorEnhance["default"])()]);
329
+ (0, _defineProperty2["default"])(ValueRoot, "enhance", [(0, _resolveColorEnhance["default"])()]);
333
330
  (0, _defineProperty2["default"])(ValueRoot, "displayName", 'Value');
334
331
  (0, _defineProperty2["default"])(ValueRoot, "contextType", RadioGroup[_core.CONTEXT_COMPONENT]);
335
332
  (0, _defineProperty2["default"])(ValueRoot, "style", style);
@@ -381,11 +378,11 @@ var Text = function Text(props) {
381
378
  }, _ref5))));
382
379
  };
383
380
  Text.displayName = 'Text';
384
- var Value = (0, _core["default"])(ValueRoot, {
381
+ var Value = (0, _core.createComponent)(ValueRoot, {
385
382
  Control: Control,
386
383
  RadioMark: RadioMark
387
384
  });
388
- var Radio = (0, _core["default"])(RadioRoot, {
385
+ var Radio = (0, _core.createComponent)(RadioRoot, {
389
386
  Text: Text,
390
387
  Value: Value
391
388
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_assignProps8","_keyboardFocusEnhance","_resolveColorEnhance","_inputProps","_useColorResolver","_logger","_typography","_excluded","_excluded2","style","_index","sstyled","insert","RadioGroupRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","Flex","assignProps","Component","_defineProperty2","defaultValue","RadioGroup","createComponent","exports","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized2","hoistedDisabled","undefined","logger","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","Box","_this$asProps3","styles","hasChildren","cn","_objectSpread2","Fragment","Radio","Value","Text","CONTEXT_COMPONENT","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","getInputProps","_getInputProps2","_slicedToArray2","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","callAllEventHandlers","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties2","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","inputProps","defaultChecked","keyboardFocusEnhance","resolveColorEnhance","_ref3","arguments[0]","_ref9","SControl","displayName","_ref4","_ref10","SValue","SInvalidPattern","InvalidStateBox","_ref5","_ref11","SText","TypographyText","color","React","useEffect","useColorResolver","wrapRadioGroup","wrapper","_default"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sB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AAPA,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;AAAA;AAAA;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;I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AA,GAAO,IAAA7I,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 { 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 /** 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,34 +16,32 @@ 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_mgb6n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_.__color_mgb6n_gg_{color:var(--color_mgb6n)}.___SRadio_mgb6n_gg_.__disabled_mgb6n_gg_{pointer-events:none}.___SText_mgb6n_gg_._size_m_mgb6n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_mgb6n_gg_._size_l_mgb6n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_mgb6n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_mgb6n_gg_::after,.___SValue_mgb6n_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_mgb6n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_mgb6n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_mgb6n_gg_.__disabled_mgb6n_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_mgb6n_gg_._size_m_mgb6n_gg_{width:16px;height:16px}.___SValue_mgb6n_gg_._size_m_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:14px;height:14px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_{width:20px;height:20px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:18px;height:18px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_mgb6n_gg_._state_invalid_mgb6n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_mgb6n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_m_mgb6n_gg_::after{width:6px;height:6px}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_l_mgb6n_gg_::after{width:8px;height:8px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__keyboardFocused_mgb6n_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_mgb6n_gg_._state_invalid_mgb6n_gg_.__keyboardFocused_mgb6n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n);background-color:var(--theme_mgb6n)}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n)}.___SInvalidPattern_mgb6n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_mgb6n_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__*/"mgb6n_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_"),
28
27
  /*__reshadow_css_end__*/
29
28
  {
30
- "__SRadio": "___SRadio_mgb6n_gg_",
31
- "_disabled": "__disabled_mgb6n_gg_",
32
- "__SText": "___SText_mgb6n_gg_",
33
- "_size_m": "_size_m_mgb6n_gg_",
34
- "_size_l": "_size_l_mgb6n_gg_",
35
- "__SValue": "___SValue_mgb6n_gg_",
36
- "_state_normal": "_state_normal_mgb6n_gg_",
37
- "_state_invalid": "_state_invalid_mgb6n_gg_",
38
- "__SControl": "___SControl_mgb6n_gg_",
39
- "_keyboardFocused": "__keyboardFocused_mgb6n_gg_",
40
- "_theme": "__theme_mgb6n_gg_",
41
- "--theme": "--theme_mgb6n",
42
- "_color": "__color_mgb6n_gg_",
43
- "--color": "--color_mgb6n",
44
- "__SInvalidPattern": "___SInvalidPattern_mgb6n_gg_"
29
+ "__SRadio": "___SRadio_lyu5n_gg_",
30
+ "_disabled": "__disabled_lyu5n_gg_",
31
+ "__SText": "___SText_lyu5n_gg_",
32
+ "_size_m": "_size_m_lyu5n_gg_",
33
+ "_size_l": "_size_l_lyu5n_gg_",
34
+ "__SValue": "___SValue_lyu5n_gg_",
35
+ "_state_normal": "_state_normal_lyu5n_gg_",
36
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
37
+ "__SControl": "___SControl_lyu5n_gg_",
38
+ "_theme": "__theme_lyu5n_gg_",
39
+ "--theme": "--theme_lyu5n",
40
+ "_color": "__color_lyu5n_gg_",
41
+ "--color": "--color_lyu5n",
42
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
45
43
  });
46
- import logger from '@semcore/utils/lib/logger';
44
+ import logger from '@semcore/core/lib/utils/logger';
47
45
  import { Text as TypographyText } from '@semcore/typography';
48
46
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
49
47
  _inherits(RadioGroupRoot, _Component);
@@ -318,7 +316,7 @@ _defineProperty(ValueRoot, "defaultProps", {
318
316
  includeInputProps: inputProps,
319
317
  defaultChecked: false
320
318
  });
321
- _defineProperty(ValueRoot, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
319
+ _defineProperty(ValueRoot, "enhance", [resolveColorEnhance()]);
322
320
  _defineProperty(ValueRoot, "displayName", 'Value');
323
321
  _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
324
322
  _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});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings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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\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,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Content":["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 { 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 /** 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
@@ -7,17 +7,15 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
7
7
  import _inherits from "@babel/runtime/helpers/esm/inherits";
8
8
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
9
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
- import { sstyled } from "@semcore/utils/lib/core/index";
11
- import createComponent, { CONTEXT_COMPONENT, assignProps, Component, sstyled as sstyled$1 } from "@semcore/core";
10
+ import { sstyled, createComponent, CONTEXT_COMPONENT, assignProps, Component } from "@semcore/core";
12
11
  import React from "react";
13
12
  import { Flex, Box, InvalidStateBox } from "@semcore/flex-box";
14
- import assignProps$1, { callAllEventHandlers } from "@semcore/utils/lib/assignProps";
15
- import keyboardFocusEnhance from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
16
- import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
17
- import getInputProps, { inputProps } from "@semcore/utils/lib/inputProps";
18
- import { inputProps as inputProps2 } from "@semcore/utils/lib/inputProps";
19
- import { useColorResolver } from "@semcore/utils/lib/use/useColorResolver";
20
- import logger from "@semcore/utils/lib/logger";
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";
21
19
  import { Text as Text$1 } from "@semcore/typography";
22
20
  var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"], _excluded2 = ["children", "Children"];
23
21
  /*!__reshadow-styles__:"./style/radio.shadow.css"*/
@@ -25,26 +23,25 @@ var style = (
25
23
  /*__reshadow_css_start__*/
26
24
  (sstyled.insert(
27
25
  /*__inner_css_start__*/
28
- '.___SRadio_mgb6n_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_mgb6n_gg_ .___SText_mgb6n_gg_.__color_mgb6n_gg_{color:var(--color_mgb6n)}.___SRadio_mgb6n_gg_.__disabled_mgb6n_gg_{pointer-events:none}.___SText_mgb6n_gg_._size_m_mgb6n_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_mgb6n_gg_._size_l_mgb6n_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_mgb6n_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_mgb6n_gg_::after,.___SValue_mgb6n_gg_::before{content:"";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_mgb6n_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_mgb6n_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_mgb6n_gg_.__disabled_mgb6n_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_mgb6n_gg_._size_m_mgb6n_gg_{width:16px;height:16px}.___SValue_mgb6n_gg_._size_m_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:14px;height:14px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_{width:20px;height:20px}.___SValue_mgb6n_gg_._size_l_mgb6n_gg_ .___SInvalidPattern_mgb6n_gg_:before{width:18px;height:18px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_mgb6n_gg_._state_invalid_mgb6n_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_mgb6n_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_m_mgb6n_gg_::after{width:6px;height:6px}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_._size_l_mgb6n_gg_::after{width:8px;height:8px}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__keyboardFocused_mgb6n_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_mgb6n_gg_._state_invalid_mgb6n_gg_.__keyboardFocused_mgb6n_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_mgb6n_gg_:checked~.___SValue_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n);background-color:var(--theme_mgb6n)}.___SValue_mgb6n_gg_._state_normal_mgb6n_gg_.__theme_mgb6n_gg_::before{border-color:var(--theme_mgb6n)}.___SInvalidPattern_mgb6n_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_mgb6n_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
+ '.___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)}',
29
27
  /*__inner_css_end__*/
30
- "mgb6n_gg_"
28
+ "lyu5n_gg_"
31
29
  ), /*__reshadow_css_end__*/
32
30
  {
33
- "__SRadio": "___SRadio_mgb6n_gg_",
34
- "_disabled": "__disabled_mgb6n_gg_",
35
- "__SText": "___SText_mgb6n_gg_",
36
- "_size_m": "_size_m_mgb6n_gg_",
37
- "_size_l": "_size_l_mgb6n_gg_",
38
- "__SValue": "___SValue_mgb6n_gg_",
39
- "_state_normal": "_state_normal_mgb6n_gg_",
40
- "_state_invalid": "_state_invalid_mgb6n_gg_",
41
- "__SControl": "___SControl_mgb6n_gg_",
42
- "_keyboardFocused": "__keyboardFocused_mgb6n_gg_",
43
- "_theme": "__theme_mgb6n_gg_",
44
- "--theme": "--theme_mgb6n",
45
- "_color": "__color_mgb6n_gg_",
46
- "--color": "--color_mgb6n",
47
- "__SInvalidPattern": "___SInvalidPattern_mgb6n_gg_"
31
+ "__SRadio": "___SRadio_lyu5n_gg_",
32
+ "_disabled": "__disabled_lyu5n_gg_",
33
+ "__SText": "___SText_lyu5n_gg_",
34
+ "_size_m": "_size_m_lyu5n_gg_",
35
+ "_size_l": "_size_l_lyu5n_gg_",
36
+ "__SValue": "___SValue_lyu5n_gg_",
37
+ "_state_normal": "_state_normal_lyu5n_gg_",
38
+ "_state_invalid": "_state_invalid_lyu5n_gg_",
39
+ "__SControl": "___SControl_lyu5n_gg_",
40
+ "_theme": "__theme_lyu5n_gg_",
41
+ "--theme": "--theme_lyu5n",
42
+ "_color": "__color_lyu5n_gg_",
43
+ "--color": "--color_lyu5n",
44
+ "__SInvalidPattern": "___SInvalidPattern_lyu5n_gg_"
48
45
  })
49
46
  );
50
47
  var RadioGroupRoot = /* @__PURE__ */ function(_Component) {
@@ -153,7 +150,7 @@ var RadioRoot = /* @__PURE__ */ function(_Component2) {
153
150
  var _ref2 = this.asProps, _ref6;
154
151
  var SRadio = Box;
155
152
  var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, Children = _this$asProps3.Children, hasChildren = _this$asProps3.children;
156
- return _ref6 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SRadio, _ref6.cn("SRadio", _objectSpread({}, assignProps({
153
+ return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SRadio, _ref6.cn("SRadio", _objectSpread({}, assignProps({
157
154
  "tag": "label",
158
155
  "__excludeProps": ["onChange", "label", "disabled"]
159
156
  }, _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)));
@@ -260,9 +257,9 @@ var ValueRoot = /* @__PURE__ */ function(_Component3) {
260
257
  var _ref8;
261
258
  var _this$asProps6 = this.asProps, styles = _this$asProps6.styles, hasChildren = _this$asProps6.children, Children = _this$asProps6.Children;
262
259
  if (!hasChildren) {
263
- return sstyled$1(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio.Value.Control, null), /* @__PURE__ */ React.createElement(Radio.Value.RadioMark, null));
260
+ return sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radio.Value.Control, null), /* @__PURE__ */ React.createElement(Radio.Value.RadioMark, null));
264
261
  }
265
- return _ref8 = sstyled$1(styles), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}));
262
+ return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}));
266
263
  }
267
264
  }]);
268
265
  return ValueRoot2;
@@ -271,7 +268,7 @@ _defineProperty(ValueRoot, "defaultProps", {
271
268
  includeInputProps: inputProps,
272
269
  defaultChecked: false
273
270
  });
274
- _defineProperty(ValueRoot, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
271
+ _defineProperty(ValueRoot, "enhance", [resolveColorEnhance()]);
275
272
  _defineProperty(ValueRoot, "displayName", "Value");
276
273
  _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
277
274
  _defineProperty(ValueRoot, "style", style);
@@ -279,7 +276,7 @@ var Control = function Control2(props) {
279
276
  var _ref3 = arguments[0], _ref9;
280
277
  var SControl = Box;
281
278
  var styles = props.styles, state = props.state;
282
- return _ref9 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SControl, _ref9.cn("SControl", _objectSpread({}, assignProps({
279
+ return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SControl, _ref9.cn("SControl", _objectSpread({}, assignProps({
283
280
  "tag": "input",
284
281
  "type": "radio",
285
282
  "aria-invalid": state === "invalid"
@@ -291,7 +288,7 @@ var RadioMark = function RadioMark2(props) {
291
288
  var SValue = Box;
292
289
  var SInvalidPattern = InvalidStateBox;
293
290
  var theme = props.theme, styles = props.styles, resolveColor = props.resolveColor, state = props.state, checked = props.checked;
294
- return _ref10 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SValue, _ref10.cn("SValue", _objectSpread({}, assignProps({
291
+ return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SValue, _ref10.cn("SValue", _objectSpread({}, assignProps({
295
292
  "tag": "div",
296
293
  "use:theme": resolveColor(theme),
297
294
  "aria-hidden": true
@@ -308,7 +305,7 @@ var Text = function Text2(props) {
308
305
  }
309
306
  }, [props.rootDisabled, props.disabled, props.hoistDisabled]);
310
307
  var resolveColor = useColorResolver();
311
- return _ref11 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SText, _ref11.cn("SText", _objectSpread({}, assignProps({
308
+ return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref11.cn("SText", _objectSpread({}, assignProps({
312
309
  "tag": "span",
313
310
  "use:color": resolveColor(color)
314
311
  }, _ref5))));
package/lib/esm/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RadioGroup, default as default2, wrapRadioGroup } from "./Radio.mjs";
2
- import { inputProps } from "@semcore/utils/lib/inputProps";
2
+ import { inputProps } from "@semcore/core/lib/utils/inputProps";
3
3
  export {
4
4
  RadioGroup,
5
5
  default2 as default,
@@ -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
 
@@ -1,7 +1,6 @@
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';
5
4
  import { Text } from '@semcore/typography';
6
5
 
7
6
  export type RadioSize = 'm' | 'l';
@@ -63,47 +62,46 @@ export type RadioGroupProps<T extends RadioValue = RadioValue> = {
63
62
 
64
63
  /** @deprecated */
65
64
  export interface IRadioValueProps extends RadioValueProps, UnknownProperties {}
66
- export type RadioValueProps = BoxProps &
67
- KeyboardFocusProps & {
68
- /** List of elements that can be put on a hidden input */
69
- includeInputProps?: string[];
70
- /**
71
- * @deprecated set `state` on root Radio instead
72
- * The value displaying the state of the component
73
- * @default normal
74
- */
75
- state?: RadioState;
76
- /**
77
- * @deprecated
78
- * The theme of the radio button that you can send your color to
79
- */
80
- theme?: string;
81
- /**
82
- * @deprecated set `size` on root RadioGroup instead
83
- * Radio button size
84
- */
85
- size?: RadioSize;
86
- /**
87
- * @deprecated set `value` on root Radio instead
88
- * The element value is required for RadioGroup
89
- */
90
- value?: RadioValue;
91
- /**
92
- * @deprecated set `defaultValue` on root RadioGroup instead
93
- * Default value if `value` property is not provided
94
- */
95
- defaultValue?: RadioValue;
96
- /**
97
- * @deprecated set `onChange` on root RadioGroup instead
98
- * Called when the value changes
99
- */
100
- onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
101
- /**
102
- * @deprecated set `disabled` on root Radio instead
103
- * Blocks access and changes to the form field
104
- */
105
- disabled?: boolean;
106
- };
65
+ export type RadioValueProps = BoxProps & {
66
+ /** List of elements that can be put on a hidden input */
67
+ includeInputProps?: string[];
68
+ /**
69
+ * @deprecated set `state` on root Radio instead
70
+ * The value displaying the state of the component
71
+ * @default normal
72
+ */
73
+ state?: RadioState;
74
+ /**
75
+ * @deprecated
76
+ * The theme of the radio button that you can send your color to
77
+ */
78
+ theme?: string;
79
+ /**
80
+ * @deprecated set `size` on root RadioGroup instead
81
+ * Radio button size
82
+ */
83
+ size?: RadioSize;
84
+ /**
85
+ * @deprecated set `value` on root Radio instead
86
+ * The element value is required for RadioGroup
87
+ */
88
+ value?: RadioValue;
89
+ /**
90
+ * @deprecated set `defaultValue` on root RadioGroup instead
91
+ * Default value if `value` property is not provided
92
+ */
93
+ defaultValue?: RadioValue;
94
+ /**
95
+ * @deprecated set `onChange` on root RadioGroup instead
96
+ * Called when the value changes
97
+ */
98
+ onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
99
+ /**
100
+ * @deprecated set `disabled` on root Radio instead
101
+ * Blocks access and changes to the form field
102
+ */
103
+ disabled?: boolean;
104
+ };
107
105
 
108
106
  /** @deprecated */
109
107
  export interface IRadioCtx extends RadioCtx, UnknownProperties {}
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.4",
4
+ "version": "16.0.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,14 +14,11 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/utils": "4.48.5",
18
- "@semcore/flex-box": "5.41.4",
19
- "@semcore/typography": "5.53.2"
17
+ "@semcore/flex-box": "16.0.0-prerelease.0",
18
+ "@semcore/typography": "16.0.0-prerelease.0"
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.0"
25
22
  },
26
23
  "repository": {
27
24
  "type": "git",