@semcore/radio 5.6.11 → 6.0.0-beta.1

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,11 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [5.6.11] - 2023-06-30
5
+ ## [6.0.0] - 2023-07-15
6
6
 
7
- ### Changed
7
+ ### BREAK
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/utils` [3.54.0 ~> 3.54.1], `@semcore/flex-box` [4.7.32 ~> 4.7.33]).
9
+ - `RadioGroup` now wraps it's content into `Flex` container (previously it was wrapping content into `React.Fragment` by default).
10
+ - Strict, backward incompatible typings.
10
11
 
11
12
  ## [5.6.10] - 2023-06-27
12
13
 
package/lib/cjs/Radio.js CHANGED
@@ -28,19 +28,19 @@ var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/e
28
28
  var _color = _interopRequireDefault(require("@semcore/utils/lib/color"));
29
29
  var _inputProps = _interopRequireWildcard(require("@semcore/utils/lib/inputProps"));
30
30
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
31
- var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SRadio_1cxxg_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1cxxg_gg_.__disabled_1cxxg_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SText_1cxxg_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SText_1cxxg_gg_._size_m_1cxxg_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1cxxg_gg_._size_l_1cxxg_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1cxxg_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1cxxg_gg_::after,.___SValue_1cxxg_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1cxxg_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1cxxg_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1cxxg_gg_._size_m_1cxxg_gg_{width:16px;height:16px}.___SValue_1cxxg_gg_._size_l_1cxxg_gg_{width:20px;height:20px}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1cxxg_gg_._state_invalid_1cxxg_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1cxxg_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_._size_m_1cxxg_gg_::after{width:6px;height:6px}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_._size_l_1cxxg_gg_::after{width:8px;height:8px}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_.__keyboardFocused_1cxxg_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_1cxxg_gg_._state_invalid_1cxxg_gg_.__keyboardFocused_1cxxg_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_.__theme_1cxxg_gg_::before{border-color:var(--theme_1cxxg);background-color:var(--theme_1cxxg)}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_.__theme_1cxxg_gg_::before{border-color:var(--theme_1cxxg)}" /*__inner_css_end__*/, "1cxxg_gg_") /*__reshadow_css_end__*/, {
32
- "__SRadio": "___SRadio_1cxxg_gg_",
33
- "_disabled": "__disabled_1cxxg_gg_",
34
- "__SText": "___SText_1cxxg_gg_",
35
- "_size_m": "_size_m_1cxxg_gg_",
36
- "_size_l": "_size_l_1cxxg_gg_",
37
- "__SValue": "___SValue_1cxxg_gg_",
38
- "_state_normal": "_state_normal_1cxxg_gg_",
39
- "_state_invalid": "_state_invalid_1cxxg_gg_",
40
- "__SControl": "___SControl_1cxxg_gg_",
41
- "_keyboardFocused": "__keyboardFocused_1cxxg_gg_",
42
- "_theme": "__theme_1cxxg_gg_",
43
- "--theme": "--theme_1cxxg"
31
+ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SRadio_ed211_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_ed211_gg_.__disabled_ed211_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SText_ed211_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SText_ed211_gg_._size_m_ed211_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_ed211_gg_._size_l_ed211_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_ed211_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_ed211_gg_::after,.___SValue_ed211_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_ed211_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_ed211_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_ed211_gg_._size_m_ed211_gg_{width:16px;height:16px}.___SValue_ed211_gg_._size_l_ed211_gg_{width:20px;height:20px}.___SValue_ed211_gg_._state_normal_ed211_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_ed211_gg_._state_invalid_ed211_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_ed211_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_._size_m_ed211_gg_::after{width:6px;height:6px}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_._size_l_ed211_gg_::after{width:8px;height:8px}.___SValue_ed211_gg_._state_normal_ed211_gg_.__keyboardFocused_ed211_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_ed211_gg_._state_invalid_ed211_gg_.__keyboardFocused_ed211_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_.__theme_ed211_gg_::before{border-color:var(--theme_ed211);background-color:var(--theme_ed211)}.___SValue_ed211_gg_._state_normal_ed211_gg_.__theme_ed211_gg_::before{border-color:var(--theme_ed211)}" /*__inner_css_end__*/, "ed211_gg_") /*__reshadow_css_end__*/, {
32
+ "__SRadio": "___SRadio_ed211_gg_",
33
+ "_disabled": "__disabled_ed211_gg_",
34
+ "__SText": "___SText_ed211_gg_",
35
+ "_size_m": "_size_m_ed211_gg_",
36
+ "_size_l": "_size_l_ed211_gg_",
37
+ "__SValue": "___SValue_ed211_gg_",
38
+ "_state_normal": "_state_normal_ed211_gg_",
39
+ "_state_invalid": "_state_invalid_ed211_gg_",
40
+ "__SControl": "___SControl_ed211_gg_",
41
+ "_keyboardFocused": "__keyboardFocused_ed211_gg_",
42
+ "_theme": "__theme_ed211_gg_",
43
+ "--theme": "--theme_ed211"
44
44
  });
45
45
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
46
46
  (0, _inherits2["default"])(RadioGroupRoot, _Component);
@@ -79,15 +79,12 @@ var RadioGroupRoot = /*#__PURE__*/function (_Component) {
79
79
  key: "render",
80
80
  value: function render() {
81
81
  var _ref = this.asProps;
82
- var _this$asProps2 = this.asProps,
83
- Children = _this$asProps2.Children,
84
- tag = _this$asProps2.tag;
85
- if (tag) return /*#__PURE__*/_react["default"].createElement(_flexBox.Box, (0, _core.assignProps)({
86
- "tag": tag,
82
+ var Children = this.asProps.Children;
83
+ return /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, (0, _core.assignProps)({
84
+ "flexDirection": 'coumn',
87
85
  "role": 'radiogroup',
88
86
  "__excludeProps": ['onChange']
89
87
  }, _ref), /*#__PURE__*/_react["default"].createElement(Children, null));
90
- return /*#__PURE__*/_react["default"].createElement(Children, null);
91
88
  }
92
89
  }]);
93
90
  return RadioGroupRoot;
@@ -164,9 +161,9 @@ var Radio = /*#__PURE__*/function (_Component2) {
164
161
  var _ref2 = this.asProps,
165
162
  _ref4;
166
163
  var SRadio = _flexBox.Box;
167
- var _this$asProps3 = this.asProps,
168
- styles = _this$asProps3.styles,
169
- Children = _this$asProps3.Children;
164
+ var _this$asProps2 = this.asProps,
165
+ styles = _this$asProps2.styles,
166
+ Children = _this$asProps2.Children;
170
167
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SRadio, _ref4.cn("SRadio", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
171
168
  "tag": 'label'
172
169
  }, _ref2))), /*#__PURE__*/_react["default"].createElement(Children, _ref4.cn("Children", {})));
@@ -199,11 +196,11 @@ var Value = /*#__PURE__*/function (_Component3) {
199
196
  var _ref5;
200
197
  var SValue = _flexBox.Box;
201
198
  var SControl = _flexBox.Box;
202
- var _this$asProps4 = this.asProps,
203
- forwardRef = _this$asProps4.forwardRef,
204
- styles = _this$asProps4.styles,
205
- includeInputProps = _this$asProps4.includeInputProps,
206
- theme = _this$asProps4.theme;
199
+ var _this$asProps3 = this.asProps,
200
+ forwardRef = _this$asProps3.forwardRef,
201
+ styles = _this$asProps3.styles,
202
+ includeInputProps = _this$asProps3.includeInputProps,
203
+ theme = _this$asProps3.theme;
207
204
  var _getInputProps = (0, _inputProps["default"])(this.asProps, includeInputProps),
208
205
  _getInputProps2 = (0, _slicedToArray2["default"])(_getInputProps, 2),
209
206
  controlProps = _getInputProps2[0],
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_assignProps6","_keyboardFocusEnhance","_color","_inputProps","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","_this$asProps2","Children","tag","createElement","Box","assignProps","Component","_defineProperty2","state","defaultValue","RadioGroup","createComponent","exports","Radio","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized2","checked","e","context","getValueProps","props","_assignProps4","_assignProps4$state","_assignProps4$size","other","undefined","bindHandlerChange","_objectSpread2","getTextProps","_assignProps5","_assignProps5$size","_ref2","_ref4","SRadio","_this$asProps3","styles","cn","CONTEXT_COMPONENT","Value","_Component3","_super3","target","_ref5","SValue","SControl","_this$asProps4","forwardRef","includeInputProps","_getInputProps","getInputProps","_getInputProps2","_slicedToArray2","controlProps","boxProps","Fragment","resolveColor","inputProps","defaultChecked","keyboardFocusEnhance","Text","_ref3","arguments[0]","_ref6","SText","_default"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport assignProps from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColor from '@semcore/utils/lib/color';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\n\nimport style from './style/radio.shadow.css';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n state: 'normal',\n size: 'm',\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 return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children, tag } = this.asProps;\n\n if (tag)\n return (\n <Root render={Box} tag={tag} role='radiogroup' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n return <Children />;\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass Radio extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n bindHandlerChange = (value) => (checked, e) => {\n this.context.onChange(value, e);\n };\n\n getValueProps(props) {\n // The default values are here, since you cannot rewrite out of context\n const {\n state = 'normal',\n size = 'm',\n theme,\n name,\n disabled,\n } = assignProps(this.props, this.context);\n const { value } = this.context;\n const other = {};\n // if used with the context\n if (value !== undefined) {\n other['checked'] = value === props.value;\n other['onChange'] = this.bindHandlerChange(props.value);\n if (this.asProps.tag !== 'label') {\n other['onClick'] = this.bindHandlerChange(props.value);\n }\n }\n return {\n ...other,\n state,\n size,\n theme,\n name,\n disabled,\n };\n }\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm' } = assignProps(this.props, this.context);\n return {\n size: size,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label'>\n <Children />\n </SRadio>,\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance()];\n static hoistProps = ['disabled'];\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n render() {\n const SValue = Box;\n const SControl = Box;\n const { forwardRef, styles, includeInputProps, theme } = this.asProps;\n\n const [controlProps, boxProps] = getInputProps(this.asProps, includeInputProps);\n\n return sstyled(styles)(\n <>\n <SControl tag='input' type='radio' {...controlProps} />\n <SValue ref={forwardRef} use:theme={resolveColor(theme)} {...boxProps} />\n </>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} />);\n}\n\nexport { inputProps, RadioGroup };\nexport default createComponent(Radio, {\n Value,\n Text,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,qBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAR,uBAAA,CAAAC,OAAA;AAA0E;AAAA,IAAAQ,KAAA,+BAAAV,KAAA,CAAAW,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAIpEC,cAAc,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,cAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,cAAA;EAAA,SAAAA,eA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IAAA3D,gBAAA,aAJGwC,KAAK,aAKQ,CAAC,IAAAoB,gCAAoB,GAAE,CAAC;AAAA,IAAA5D,gBAAA,aALrCwC,KAAK,gBAMW,CAAC,UAAU,CAAC;AAwBlC,SAASqB,IAAIA,CAACvC,KAAK,EAAE;EAAA,IAAAwC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACnB,IAAMC,KAAK,GAE2BpE,YAAG;EADzC,IAAQwC,MAAM,GAAKf,KAAK,CAAhBe,MAAM;EACd,OAAA2B,KAAA,GAAO,IAAA/F,aAAO,EAACoE,MAAM,CAAC,eAAC5E,MAAA,YAAAmC,aAAA,CAACqE,KAAK,EAAAD,KAAA,CAAA1B,EAAA,cAAAT,cAAA,qBAAAvE,KAAA,CAAAwC,WAAA,MAAAgE,KAAA,IAAgB;AAC/C;AAAC,IAAAI,QAAA,GAGc,IAAA9D,gBAAe,EAACE,KAAK,EAAE;EACpCkC,KAAK,EAALA,KAAK;EACLqB,IAAI,EAAJA;AACF,CAAC,CAAC;AAAAxD,OAAA,cAAA6D,QAAA"}
1
+ {"version":3,"file":"Radio.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_assignProps6","_keyboardFocusEnhance","_color","_inputProps","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","state","defaultValue","RadioGroup","createComponent","exports","Radio","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized2","checked","e","context","getValueProps","props","_assignProps4","_assignProps4$state","_assignProps4$size","other","undefined","bindHandlerChange","tag","_objectSpread2","getTextProps","_assignProps5","_assignProps5$size","_ref2","_ref4","SRadio","Box","_this$asProps2","styles","cn","CONTEXT_COMPONENT","Value","_Component3","_super3","target","_ref5","SValue","SControl","_this$asProps3","forwardRef","includeInputProps","_getInputProps","getInputProps","_getInputProps2","_slicedToArray2","controlProps","boxProps","Fragment","resolveColor","inputProps","defaultChecked","keyboardFocusEnhance","Text","_ref3","arguments[0]","_ref6","SText","_default"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport assignProps from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColor from '@semcore/utils/lib/color';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\n\nimport style from './style/radio.shadow.css';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n state: 'normal',\n size: 'm',\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 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} flexDirection='coumn' role='radiogroup' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass Radio extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n bindHandlerChange = (value) => (checked, e) => {\n this.context.onChange(value, e);\n };\n\n getValueProps(props) {\n // The default values are here, since you cannot rewrite out of context\n const {\n state = 'normal',\n size = 'm',\n theme,\n name,\n disabled,\n } = assignProps(this.props, this.context);\n const { value } = this.context;\n const other = {};\n // if used with the context\n if (value !== undefined) {\n other['checked'] = value === props.value;\n other['onChange'] = this.bindHandlerChange(props.value);\n if (this.asProps.tag !== 'label') {\n other['onClick'] = this.bindHandlerChange(props.value);\n }\n }\n return {\n ...other,\n state,\n size,\n theme,\n name,\n disabled,\n };\n }\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm' } = assignProps(this.props, this.context);\n return {\n size: size,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label'>\n <Children />\n </SRadio>,\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance()];\n static hoistProps = ['disabled'];\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n render() {\n const SValue = Box;\n const SControl = Box;\n const { forwardRef, styles, includeInputProps, theme } = this.asProps;\n\n const [controlProps, boxProps] = getInputProps(this.asProps, includeInputProps);\n\n return sstyled(styles)(\n <>\n <SControl tag='input' type='radio' {...controlProps} />\n <SValue ref={forwardRef} use:theme={resolveColor(theme)} {...boxProps} />\n </>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} />);\n}\n\nexport { inputProps, RadioGroup };\nexport default createComponent(Radio, {\n Value,\n Text,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,qBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAR,uBAAA,CAAAC,OAAA;AAA0E;AAAA,IAAAQ,KAAA,+BAAAV,KAAA,CAAAW,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAIpEC,cAAc,0BAAAC,UAAA;EAAA,IAAAC,UA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AC,IAAAoB,gCAAoB,GAAE,CAAC;AAAA,IAAA9D,gBAAA,aALrC0C,KAAK,gBAMW,CAAC,UAAU,CAAC;AAwBlC,SAASqB,IAAIA,CAACzC,KAAK,EAAE;EAAA,IAAA0C,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACnB,IAAMC,KAAK,GAE2B9B,YAAG;EADzC,IAAQE,MAAM,GAAKjB,KAAK,CAAhBiB,MAAM;EACd,OAAA2B,KAAA,GAAO,IAAA/F,aAAO,EAACoE,MAAM,CAAC,eAAC5E,MAAA,YAAAiC,aAAA,CAACuE,KAAK,EAAAD,KAAA,CAAA1B,EAAA,cAAAV,cAAA,qBAAAtE,KAAA,CAAAsC,WAAA,MAAAkE,KAAA,IAAgB;AAC/C;AAAC,IAAAI,QAAA,GAGc,IAAAhE,gBAAe,EAACE,KAAK,EAAE;EACpCoC,KAAK,EAALA,KAAK;EACLqB,IAAI,EAAJA;AACF,CAAC,CAAC;AAAA1D,OAAA,cAAA+D,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport { IKeyboardFocusProps } 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\nexport interface IRadioProps extends IBoxProps {\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}\n\nexport interface IRadioGroupProps {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: RadioValue;\n /** Active value */\n value?: RadioValue;\n /** Called when the selected element is changed */\n onChange?: (value: RadioValue, e?: React.SyntheticEvent<HTMLInputElement>) => void;\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\nexport interface IRadioValueProps extends IBoxProps, IKeyboardFocusProps {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio button size */\n size?: RadioSize;\n /** The element value is required for RadioGroup */\n value?: RadioValue;\n /** Default value if `value` property is not provided */\n defaultValue?: RadioValue;\n /** Called when the value changes */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n}\n\nexport interface IRadioCtx {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n}\n\ndeclare const RadioGroup: <T>(props: CProps<IRadioGroupProps & T>) => ReturnEl;\n\nexport { RadioGroup };\n\ndeclare const Radio: (<T>(props: CProps<IRadioProps & T, IRadioCtx>) => ReturnEl) & {\n Value: <T>(props: IRadioValueProps & T) => ReturnEl;\n Text: typeof Text;\n};\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 { 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 /**\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};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\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 * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio button size */\n size?: RadioSize;\n /** The element value is required for RadioGroup */\n value?: RadioValue;\n /** Default value if `value` property is not provided */\n defaultValue?: RadioValue;\n /** Called when the value changes */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /** Blocks access and changes to the form field */\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 = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, RadioGroupProps<Value>>,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div'>;\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps>;\n Text: typeof Text;\n};\n\nexport default Radio;\n"],"mappings":""}
package/lib/es6/Radio.js CHANGED
@@ -12,25 +12,25 @@ import { assignProps as _assignProps2 } from "@semcore/core";
12
12
  import { assignProps as _assignProps } from "@semcore/core";
13
13
  import React from 'react';
14
14
  import createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';
15
- import { Box } from '@semcore/flex-box';
15
+ import { Flex, Box } from '@semcore/flex-box';
16
16
  import assignProps from '@semcore/utils/lib/assignProps';
17
17
  import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
18
18
  import resolveColor from '@semcore/utils/lib/color';
19
19
  import getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';
20
20
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
21
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_1cxxg_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1cxxg_gg_.__disabled_1cxxg_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SText_1cxxg_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SText_1cxxg_gg_._size_m_1cxxg_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1cxxg_gg_._size_l_1cxxg_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1cxxg_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1cxxg_gg_::after,.___SValue_1cxxg_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1cxxg_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1cxxg_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1cxxg_gg_._size_m_1cxxg_gg_{width:16px;height:16px}.___SValue_1cxxg_gg_._size_l_1cxxg_gg_{width:20px;height:20px}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1cxxg_gg_._state_invalid_1cxxg_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1cxxg_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_._size_m_1cxxg_gg_::after{width:6px;height:6px}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_._size_l_1cxxg_gg_::after{width:8px;height:8px}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_.__keyboardFocused_1cxxg_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_1cxxg_gg_._state_invalid_1cxxg_gg_.__keyboardFocused_1cxxg_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1cxxg_gg_:checked~.___SValue_1cxxg_gg_.__theme_1cxxg_gg_::before{border-color:var(--theme_1cxxg);background-color:var(--theme_1cxxg)}.___SValue_1cxxg_gg_._state_normal_1cxxg_gg_.__theme_1cxxg_gg_::before{border-color:var(--theme_1cxxg)}" /*__inner_css_end__*/, "1cxxg_gg_") /*__reshadow_css_end__*/, {
22
- "__SRadio": "___SRadio_1cxxg_gg_",
23
- "_disabled": "__disabled_1cxxg_gg_",
24
- "__SText": "___SText_1cxxg_gg_",
25
- "_size_m": "_size_m_1cxxg_gg_",
26
- "_size_l": "_size_l_1cxxg_gg_",
27
- "__SValue": "___SValue_1cxxg_gg_",
28
- "_state_normal": "_state_normal_1cxxg_gg_",
29
- "_state_invalid": "_state_invalid_1cxxg_gg_",
30
- "__SControl": "___SControl_1cxxg_gg_",
31
- "_keyboardFocused": "__keyboardFocused_1cxxg_gg_",
32
- "_theme": "__theme_1cxxg_gg_",
33
- "--theme": "--theme_1cxxg"
21
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_ed211_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_ed211_gg_.__disabled_ed211_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SText_ed211_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SText_ed211_gg_._size_m_ed211_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_ed211_gg_._size_l_ed211_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_ed211_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_ed211_gg_::after,.___SValue_ed211_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_ed211_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_ed211_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_ed211_gg_._size_m_ed211_gg_{width:16px;height:16px}.___SValue_ed211_gg_._size_l_ed211_gg_{width:20px;height:20px}.___SValue_ed211_gg_._state_normal_ed211_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_ed211_gg_._state_invalid_ed211_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_ed211_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_._size_m_ed211_gg_::after{width:6px;height:6px}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_._size_l_ed211_gg_::after{width:8px;height:8px}.___SValue_ed211_gg_._state_normal_ed211_gg_.__keyboardFocused_ed211_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_ed211_gg_._state_invalid_ed211_gg_.__keyboardFocused_ed211_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_ed211_gg_:checked~.___SValue_ed211_gg_.__theme_ed211_gg_::before{border-color:var(--theme_ed211);background-color:var(--theme_ed211)}.___SValue_ed211_gg_._state_normal_ed211_gg_.__theme_ed211_gg_::before{border-color:var(--theme_ed211)}" /*__inner_css_end__*/, "ed211_gg_") /*__reshadow_css_end__*/, {
22
+ "__SRadio": "___SRadio_ed211_gg_",
23
+ "_disabled": "__disabled_ed211_gg_",
24
+ "__SText": "___SText_ed211_gg_",
25
+ "_size_m": "_size_m_ed211_gg_",
26
+ "_size_l": "_size_l_ed211_gg_",
27
+ "__SValue": "___SValue_ed211_gg_",
28
+ "_state_normal": "_state_normal_ed211_gg_",
29
+ "_state_invalid": "_state_invalid_ed211_gg_",
30
+ "__SControl": "___SControl_ed211_gg_",
31
+ "_keyboardFocused": "__keyboardFocused_ed211_gg_",
32
+ "_theme": "__theme_ed211_gg_",
33
+ "--theme": "--theme_ed211"
34
34
  });
35
35
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
36
36
  _inherits(RadioGroupRoot, _Component);
@@ -69,15 +69,12 @@ var RadioGroupRoot = /*#__PURE__*/function (_Component) {
69
69
  key: "render",
70
70
  value: function render() {
71
71
  var _ref = this.asProps;
72
- var _this$asProps2 = this.asProps,
73
- Children = _this$asProps2.Children,
74
- tag = _this$asProps2.tag;
75
- if (tag) return /*#__PURE__*/React.createElement(Box, _assignProps({
76
- "tag": tag,
72
+ var Children = this.asProps.Children;
73
+ return /*#__PURE__*/React.createElement(Flex, _assignProps({
74
+ "flexDirection": 'coumn',
77
75
  "role": 'radiogroup',
78
76
  "__excludeProps": ['onChange']
79
77
  }, _ref), /*#__PURE__*/React.createElement(Children, null));
80
- return /*#__PURE__*/React.createElement(Children, null);
81
78
  }
82
79
  }]);
83
80
  return RadioGroupRoot;
@@ -153,9 +150,9 @@ var Radio = /*#__PURE__*/function (_Component2) {
153
150
  var _ref2 = this.asProps,
154
151
  _ref4;
155
152
  var SRadio = Box;
156
- var _this$asProps3 = this.asProps,
157
- styles = _this$asProps3.styles,
158
- Children = _this$asProps3.Children;
153
+ var _this$asProps2 = this.asProps,
154
+ styles = _this$asProps2.styles,
155
+ Children = _this$asProps2.Children;
159
156
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SRadio, _ref4.cn("SRadio", _objectSpread({}, _assignProps2({
160
157
  "tag": 'label'
161
158
  }, _ref2))), /*#__PURE__*/React.createElement(Children, _ref4.cn("Children", {})));
@@ -188,11 +185,11 @@ var Value = /*#__PURE__*/function (_Component3) {
188
185
  var _ref5;
189
186
  var SValue = Box;
190
187
  var SControl = Box;
191
- var _this$asProps4 = this.asProps,
192
- forwardRef = _this$asProps4.forwardRef,
193
- styles = _this$asProps4.styles,
194
- includeInputProps = _this$asProps4.includeInputProps,
195
- theme = _this$asProps4.theme;
188
+ var _this$asProps3 = this.asProps,
189
+ forwardRef = _this$asProps3.forwardRef,
190
+ styles = _this$asProps3.styles,
191
+ includeInputProps = _this$asProps3.includeInputProps,
192
+ theme = _this$asProps3.theme;
196
193
  var _getInputProps = getInputProps(this.asProps, includeInputProps),
197
194
  _getInputProps2 = _slicedToArray(_getInputProps, 2),
198
195
  controlProps = _getInputProps2[0],
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["React","createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","Box","assignProps","keyboardFocusEnhance","resolveColor","getInputProps","inputProps","style","_sstyled","insert","RadioGroupRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","_this$asProps2","Children","tag","createElement","_assignProps","_defineProperty","state","defaultValue","RadioGroup","Radio","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","checked","e","context","getValueProps","props","_assignProps4","_assignProps4$state","_assignProps4$size","other","undefined","bindHandlerChange","_objectSpread","getTextProps","_assignProps5","_assignProps5$size","_ref2","_ref4","SRadio","_this$asProps3","styles","cn","_assignProps2","Value","_Component3","_super3","target","_ref5","SValue","SControl","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","controlProps","boxProps","Fragment","defaultChecked","Text","_ref3","arguments[0]","_ref6","SText","_assignProps3"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport assignProps from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColor from '@semcore/utils/lib/color';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\n\nimport style from './style/radio.shadow.css';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n state: 'normal',\n size: 'm',\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 return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children, tag } = this.asProps;\n\n if (tag)\n return (\n <Root render={Box} tag={tag} role='radiogroup' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n return <Children />;\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass Radio extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n bindHandlerChange = (value) => (checked, e) => {\n this.context.onChange(value, e);\n };\n\n getValueProps(props) {\n // The default values are here, since you cannot rewrite out of context\n const {\n state = 'normal',\n size = 'm',\n theme,\n name,\n disabled,\n } = assignProps(this.props, this.context);\n const { value } = this.context;\n const other = {};\n // if used with the context\n if (value !== undefined) {\n other['checked'] = value === props.value;\n other['onChange'] = this.bindHandlerChange(props.value);\n if (this.asProps.tag !== 'label') {\n other['onClick'] = this.bindHandlerChange(props.value);\n }\n }\n return {\n ...other,\n state,\n size,\n theme,\n name,\n disabled,\n };\n }\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm' } = assignProps(this.props, this.context);\n return {\n size: size,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label'>\n <Children />\n </SRadio>,\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance()];\n static hoistProps = ['disabled'];\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n render() {\n const SValue = Box;\n const SControl = Box;\n const { forwardRef, styles, includeInputProps, theme } = this.asProps;\n\n const [controlProps, boxProps] = getInputProps(this.asProps, includeInputProps);\n\n return sstyled(styles)(\n <>\n <SControl tag='input' type='radio' {...controlProps} />\n <SValue ref={forwardRef} use:theme={resolveColor(theme)} {...boxProps} />\n </>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} />);\n}\n\nexport { inputProps, RadioGroup };\nexport default createComponent(Radio, {\n Value,\n Text,\n});\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC5F,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,WAAW,MAAM,gCAAgC;AACxD,OAAOC,oBAAoB,MAAM,kDAAkD;AACnF,OAAOC,YAAY,MAAM,0BAA0B;AACnD,OAAOC,aAAa,IAAIC,UAAU,QAAQ,+BAA+B;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAIpEC,cAAc,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,cAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,cAAA;EAAA,SAAAA,eAAA;IAAAK,eAAA,OAAAL,cAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,cAAA;IAAAS,GAAA;IAAAC,KAAA,EASlB,SAAAC,kBAAA,EAAoB;MAClB,OAAO;QACLD,KAAK,EAAE;MACT,CAAC;IACH;EAAC;IAAAD,GAAA;IAAAC,KAAA,EAED,SAAAE,WAAA,EAAa;MACX,IAAAC,aAAA,GAAyD,IAAI,CAACC,OAAO;QAA7DC,KAAK,GAAAF,aAAA,CAALE,KAAK;QAAEC,IAAI,GAAAH,aAAA,CAAJG,IAAI;QAAEC,IAAI,GAAAJ,aAAA,CAAJI,IAAI;QAAEP,KAAK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T_COMPONENT","sstyled","Root","Flex","Box","assignProps","keyboardFocusEnhance","resolveColor","getInputProps","inputProps","style","_sstyled","insert","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","state","defaultValue","RadioGroup","Radio","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","checked","e","context","getValueProps","props","_assignProps4","_assignProps4$state","_assignProps4$size","other","undefined","bindHandlerChange","tag","_objectSpread","getTextProps","_assignProps5","_assignProps5$size","_ref2","_ref4","SRadio","_this$asProps2","styles","cn","_assignProps2","Value","_Component3","_super3","target","_ref5","SValue","SControl","_this$asProps3","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","controlProps","boxProps","Fragment","defaultChecked","Text","_ref3","arguments[0]","_ref6","SText","_assignProps3"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport assignProps from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColor from '@semcore/utils/lib/color';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\n\nimport style from './style/radio.shadow.css';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n state: 'normal',\n size: 'm',\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 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} flexDirection='coumn' role='radiogroup' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass Radio extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n bindHandlerChange = (value) => (checked, e) => {\n this.context.onChange(value, e);\n };\n\n getValueProps(props) {\n // The default values are here, since you cannot rewrite out of context\n const {\n state = 'normal',\n size = 'm',\n theme,\n name,\n disabled,\n } = assignProps(this.props, this.context);\n const { value } = this.context;\n const other = {};\n // if used with the context\n if (value !== undefined) {\n other['checked'] = value === props.value;\n other['onChange'] = this.bindHandlerChange(props.value);\n if (this.asProps.tag !== 'label') {\n other['onClick'] = this.bindHandlerChange(props.value);\n }\n }\n return {\n ...other,\n state,\n size,\n theme,\n name,\n disabled,\n };\n }\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm' } = assignProps(this.props, this.context);\n return {\n size: size,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label'>\n <Children />\n </SRadio>,\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance()];\n static hoistProps = ['disabled'];\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n render() {\n const SValue = Box;\n const SControl = Box;\n const { forwardRef, styles, includeInputProps, theme } = this.asProps;\n\n const [controlProps, boxProps] = getInputProps(this.asProps, includeInputProps);\n\n return sstyled(styles)(\n <>\n <SControl tag='input' type='radio' {...controlProps} />\n <SValue ref={forwardRef} use:theme={resolveColor(theme)} {...boxProps} />\n </>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} />);\n}\n\nexport { inputProps, RadioGroup };\nexport default createComponent(Radio, {\n Value,\n Text,\n});\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe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AC,GAAM+D,QAAQ,GAAI,CACxE;IAEP;EAAC;EAAA,OAAAd,KAAA;AAAA,EA3BiB9E,SAAS;AAAAuC,eAAA,CAAvBuC,KAAK,kBACa;EACpBS,iBAAiB,EAAE7E,UAAU;EAC7BoF,cAAc,EAAE;AAClB,CAAC;AAAAvD,eAAA,CAJGuC,KAAK,aAKQ,CAACvE,oBAAoB,EAAE,CAAC;AAAAgC,eAAA,CALrCuC,KAAK,gBAMW,CAAC,UAAU,CAAC;AAwBlC,SAASiB,IAAIA,CAACpC,KAAK,EAAE;EAAA,IAAAqC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACnB,IAAMC,KAAK,GAE2B9F,GAAG;EADzC,IAAQsE,MAAM,GAAKhB,KAAK,CAAhBgB,MAAM;EACd,OAAAuB,KAAA,GAAOhG,OAAO,CAACyE,MAAM,CAAC,eAAC7E,KAAA,CAAAuC,aAAA,CAAC8D,KAAK,EAAAD,KAAA,CAAAtB,EAAA,UAAAT,aAAA,KAAAiC,aAAA,KAAAJ,KAAA,IAAgB;AAC/C;AAEA,SAAStF,UAAU,EAAEgC,UAAU;AAC/B,eAAe3C,eAAe,CAAC4C,KAAK,EAAE;EACpCmC,KAAK,EAALA,KAAK;EACLiB,IAAI,EAAJA;AACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport { IKeyboardFocusProps } 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\nexport interface IRadioProps extends IBoxProps {\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}\n\nexport interface IRadioGroupProps {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: RadioValue;\n /** Active value */\n value?: RadioValue;\n /** Called when the selected element is changed */\n onChange?: (value: RadioValue, e?: React.SyntheticEvent<HTMLInputElement>) => void;\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\nexport interface IRadioValueProps extends IBoxProps, IKeyboardFocusProps {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio button size */\n size?: RadioSize;\n /** The element value is required for RadioGroup */\n value?: RadioValue;\n /** Default value if `value` property is not provided */\n defaultValue?: RadioValue;\n /** Called when the value changes */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n}\n\nexport interface IRadioCtx {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n}\n\ndeclare const RadioGroup: <T>(props: CProps<IRadioGroupProps & T>) => ReturnEl;\n\nexport { RadioGroup };\n\ndeclare const Radio: (<T>(props: CProps<IRadioProps & T, IRadioCtx>) => ReturnEl) & {\n Value: <T>(props: IRadioValueProps & T) => ReturnEl;\n Text: typeof Text;\n};\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 { 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 /**\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};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\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 * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio button size */\n size?: RadioSize;\n /** The element value is required for RadioGroup */\n value?: RadioValue;\n /** Default value if `value` property is not provided */\n defaultValue?: RadioValue;\n /** Called when the value changes */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /** Blocks access and changes to the form field */\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 = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, RadioGroupProps<Value>>,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div'>;\n\ndeclare const RadioGroup: IntergalacticRadioGroupComponent;\n\nexport { RadioGroup };\n\ndeclare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {\n Value: Intergalactic.Component<'input', RadioValueProps>;\n Text: typeof Text;\n};\n\nexport default Radio;\n"],"mappings":""}
@@ -1,14 +1,16 @@
1
1
  import React from 'react';
2
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
2
+ import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
3
+ import { BoxProps, Flex } from '@semcore/flex-box';
4
+ import { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
5
5
  import { Text } from '@semcore/typography';
6
6
 
7
7
  export type RadioSize = 'm' | 'l';
8
8
  export type RadioState = 'normal' | 'invalid';
9
9
  export type RadioValue = string | number | boolean;
10
10
 
11
- export interface IRadioProps extends IBoxProps {
11
+ /** @deprecated */
12
+ export interface IRadioProps extends RadioProps, UnknownProperties {}
13
+ export type RadioProps = BoxProps & {
12
14
  /**
13
15
  * The value displaying the state of the component
14
16
  * @default normal
@@ -21,9 +23,11 @@ export interface IRadioProps extends IBoxProps {
21
23
  size?: RadioSize;
22
24
  /** The theme of the radio button that you can send your color to */
23
25
  theme?: string;
24
- }
26
+ };
25
27
 
26
- export interface IRadioGroupProps {
28
+ /** @deprecated */
29
+ export interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {}
30
+ export type RadioGroupProps<T extends RadioValue = RadioValue> = {
27
31
  /**
28
32
  * HTML tag name for the displayed item
29
33
  */
@@ -31,52 +35,67 @@ export interface IRadioGroupProps {
31
35
  /** Radio group name */
32
36
  name?: string;
33
37
  /** Active default value */
34
- defaultValue?: RadioValue;
38
+ defaultValue?: T;
35
39
  /** Active value */
36
- value?: RadioValue;
40
+ value?: T;
37
41
  /** Called when the selected element is changed */
38
- onChange?: (value: RadioValue, e?: React.SyntheticEvent<HTMLInputElement>) => void;
42
+ onChange?:
43
+ | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)
44
+ | React.Dispatch<React.SetStateAction<T>>;
39
45
  /** Radio button size */
40
46
  size?: RadioSize;
41
47
  /** The theme of the radio button that you can send your color to */
42
48
  theme?: string;
43
49
  /** Blocks access and changes to the form field */
44
50
  disabled?: boolean;
45
- }
51
+ };
46
52
 
47
- export interface IRadioValueProps extends IBoxProps, IKeyboardFocusProps {
48
- /** List of elements that can be put on a hidden input */
49
- includeInputProps?: string[];
50
- /**
51
- * The value displaying the state of the component
52
- * @default normal
53
- */
54
- state?: RadioState;
55
- /** The theme of the radio button that you can send your color to */
56
- theme?: string;
57
- /** Radio button size */
58
- size?: RadioSize;
59
- /** The element value is required for RadioGroup */
60
- value?: RadioValue;
61
- /** Default value if `value` property is not provided */
62
- defaultValue?: RadioValue;
63
- /** Called when the value changes */
64
- onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
65
- /** Blocks access and changes to the form field */
66
- disabled?: boolean;
67
- }
53
+ /** @deprecated */
54
+ export interface IRadioValueProps extends RadioValueProps, UnknownProperties {}
55
+ export type RadioValueProps = BoxProps &
56
+ KeyboardFocusProps & {
57
+ /** List of elements that can be put on a hidden input */
58
+ includeInputProps?: string[];
59
+ /**
60
+ * The value displaying the state of the component
61
+ * @default normal
62
+ */
63
+ state?: RadioState;
64
+ /** The theme of the radio button that you can send your color to */
65
+ theme?: string;
66
+ /** Radio button size */
67
+ size?: RadioSize;
68
+ /** The element value is required for RadioGroup */
69
+ value?: RadioValue;
70
+ /** Default value if `value` property is not provided */
71
+ defaultValue?: RadioValue;
72
+ /** Called when the value changes */
73
+ onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
74
+ /** Blocks access and changes to the form field */
75
+ disabled?: boolean;
76
+ };
68
77
 
69
- export interface IRadioCtx {
78
+ /** @deprecated */
79
+ export interface IRadioCtx extends RadioCtx, UnknownProperties {}
80
+ export type RadioCtx = {
70
81
  getValueProps: PropGetterFn;
71
82
  getTextProps: PropGetterFn;
72
- }
83
+ };
84
+
85
+ type IntergalacticRadioGroupComponent = (<
86
+ Value extends RadioValue,
87
+ Tag extends Intergalactic.Tag = typeof Flex,
88
+ >(
89
+ props: Intergalactic.InternalTypings.ComponentProps<Tag, RadioGroupProps<Value>>,
90
+ ) => Intergalactic.InternalTypings.ComponentRenderingResults) &
91
+ Intergalactic.InternalTypings.ComponentAdditive<'div'>;
73
92
 
74
- declare const RadioGroup: <T>(props: CProps<IRadioGroupProps & T>) => ReturnEl;
93
+ declare const RadioGroup: IntergalacticRadioGroupComponent;
75
94
 
76
95
  export { RadioGroup };
77
96
 
78
- declare const Radio: (<T>(props: CProps<IRadioProps & T, IRadioCtx>) => ReturnEl) & {
79
- Value: <T>(props: IRadioValueProps & T) => ReturnEl;
97
+ declare const Radio: Intergalactic.Component<'label', RadioProps, RadioCtx> & {
98
+ Value: Intergalactic.Component<'input', RadioValueProps>;
80
99
  Text: typeof Text;
81
100
  };
82
101
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/radio",
3
3
  "description": "Semrush Radio Component",
4
- "version": "5.6.11",
4
+ "version": "6.0.0-beta.1",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,12 +9,12 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/utils": "^3.15",
13
- "@semcore/flex-box": "^4",
14
- "@semcore/typography": "^4"
12
+ "@semcore/utils": "4.0.0-beta.1",
13
+ "@semcore/flex-box": "5.0.0-beta.1",
14
+ "@semcore/typography": "5.0.0-beta.1"
15
15
  },
16
16
  "peerDependencies": {
17
- "@semcore/core": "^1.11",
17
+ "@semcore/core": "2.0.0-beta.1",
18
18
  "react": "16.8 - 18",
19
19
  "react-dom": "16.8 - 18"
20
20
  },