@semcore/radio 6.41.1-prerelease.2 → 6.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [6.42.0] - 2025-02-03
6
+
7
+ ### Changed
8
+
9
+ - Version minor update due to children dependencies update (`@semcore/utils` [4.44.1 ~> 4.45.0], `@semcore/flex-box` [5.39.1 ~> 5.40.0], `@semcore/core` [2.37.1 ~> 2.38.0]).
10
+
5
11
  ## [6.41.1] - 2024-12-30
6
12
 
7
13
  ### Changed
package/lib/cjs/Radio.js CHANGED
@@ -13,15 +13,15 @@ Object.defineProperty(exports, "inputProps", {
13
13
  }
14
14
  });
15
15
  exports.wrapRadioGroup = void 0;
16
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
18
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
19
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
20
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
21
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
22
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
24
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
17
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
18
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
19
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
20
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
21
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
22
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
23
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
24
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
25
25
  var _index = require("@semcore/utils/lib/core/index");
26
26
  var _core = _interopRequireWildcard(require("@semcore/core"));
27
27
  var _react = _interopRequireDefault(require("react"));
@@ -36,22 +36,22 @@ var _typography = require("@semcore/typography");
36
36
  var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"],
37
37
  _excluded2 = ["children", "Children"];
38
38
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
39
- var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SRadio_1xokd_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1xokd_gg_ .___SText_1xokd_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1xokd_gg_ .___SText_1xokd_gg_.__color_1xokd_gg_{color:var(--color_1xokd)}.___SRadio_1xokd_gg_.__disabled_1xokd_gg_{pointer-events:none}.___SText_1xokd_gg_._size_m_1xokd_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1xokd_gg_._size_l_1xokd_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1xokd_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1xokd_gg_::after,.___SValue_1xokd_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1xokd_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1xokd_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1xokd_gg_.__disabled_1xokd_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_1xokd_gg_._size_m_1xokd_gg_{width:16px;height:16px}.___SValue_1xokd_gg_._size_m_1xokd_gg_ .___SInvalidPattern_1xokd_gg_:before{width:14px;height:14px}.___SValue_1xokd_gg_._size_l_1xokd_gg_{width:20px;height:20px}.___SValue_1xokd_gg_._size_l_1xokd_gg_ .___SInvalidPattern_1xokd_gg_:before{width:18px;height:18px}.___SValue_1xokd_gg_._state_normal_1xokd_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1xokd_gg_._state_invalid_1xokd_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1xokd_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_._size_m_1xokd_gg_::after{width:6px;height:6px}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_._size_l_1xokd_gg_::after{width:8px;height:8px}.___SValue_1xokd_gg_._state_normal_1xokd_gg_.__keyboardFocused_1xokd_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_1xokd_gg_._state_invalid_1xokd_gg_.__keyboardFocused_1xokd_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_.__theme_1xokd_gg_::before{border-color:var(--theme_1xokd);background-color:var(--theme_1xokd)}.___SValue_1xokd_gg_._state_normal_1xokd_gg_.__theme_1xokd_gg_::before{border-color:var(--theme_1xokd)}.___SInvalidPattern_1xokd_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1xokd_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__*/, "1xokd_gg_") /*__reshadow_css_end__*/, {
40
- "__SRadio": "___SRadio_1xokd_gg_",
41
- "_disabled": "__disabled_1xokd_gg_",
42
- "__SText": "___SText_1xokd_gg_",
43
- "_size_m": "_size_m_1xokd_gg_",
44
- "_size_l": "_size_l_1xokd_gg_",
45
- "__SValue": "___SValue_1xokd_gg_",
46
- "_state_normal": "_state_normal_1xokd_gg_",
47
- "_state_invalid": "_state_invalid_1xokd_gg_",
48
- "__SControl": "___SControl_1xokd_gg_",
49
- "_keyboardFocused": "__keyboardFocused_1xokd_gg_",
50
- "_theme": "__theme_1xokd_gg_",
51
- "--theme": "--theme_1xokd",
52
- "_color": "__color_1xokd_gg_",
53
- "--color": "--color_1xokd",
54
- "__SInvalidPattern": "___SInvalidPattern_1xokd_gg_"
39
+ var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SRadio_1oep7_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1oep7_gg_ .___SText_1oep7_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1oep7_gg_ .___SText_1oep7_gg_.__color_1oep7_gg_{color:var(--color_1oep7)}.___SRadio_1oep7_gg_.__disabled_1oep7_gg_{pointer-events:none}.___SText_1oep7_gg_._size_m_1oep7_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1oep7_gg_._size_l_1oep7_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1oep7_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1oep7_gg_::after,.___SValue_1oep7_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1oep7_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1oep7_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1oep7_gg_.__disabled_1oep7_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_1oep7_gg_._size_m_1oep7_gg_{width:16px;height:16px}.___SValue_1oep7_gg_._size_m_1oep7_gg_ .___SInvalidPattern_1oep7_gg_:before{width:14px;height:14px}.___SValue_1oep7_gg_._size_l_1oep7_gg_{width:20px;height:20px}.___SValue_1oep7_gg_._size_l_1oep7_gg_ .___SInvalidPattern_1oep7_gg_:before{width:18px;height:18px}.___SValue_1oep7_gg_._state_normal_1oep7_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1oep7_gg_._state_invalid_1oep7_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1oep7_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_._size_m_1oep7_gg_::after{width:6px;height:6px}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_._size_l_1oep7_gg_::after{width:8px;height:8px}.___SValue_1oep7_gg_._state_normal_1oep7_gg_.__keyboardFocused_1oep7_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_1oep7_gg_._state_invalid_1oep7_gg_.__keyboardFocused_1oep7_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_.__theme_1oep7_gg_::before{border-color:var(--theme_1oep7);background-color:var(--theme_1oep7)}.___SValue_1oep7_gg_._state_normal_1oep7_gg_.__theme_1oep7_gg_::before{border-color:var(--theme_1oep7)}.___SInvalidPattern_1oep7_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1oep7_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__*/, "1oep7_gg_") /*__reshadow_css_end__*/, {
40
+ "__SRadio": "___SRadio_1oep7_gg_",
41
+ "_disabled": "__disabled_1oep7_gg_",
42
+ "__SText": "___SText_1oep7_gg_",
43
+ "_size_m": "_size_m_1oep7_gg_",
44
+ "_size_l": "_size_l_1oep7_gg_",
45
+ "__SValue": "___SValue_1oep7_gg_",
46
+ "_state_normal": "_state_normal_1oep7_gg_",
47
+ "_state_invalid": "_state_invalid_1oep7_gg_",
48
+ "__SControl": "___SControl_1oep7_gg_",
49
+ "_keyboardFocused": "__keyboardFocused_1oep7_gg_",
50
+ "_theme": "__theme_1oep7_gg_",
51
+ "--theme": "--theme_1oep7",
52
+ "_color": "__color_1oep7_gg_",
53
+ "--color": "--color_1oep7",
54
+ "__SInvalidPattern": "___SInvalidPattern_1oep7_gg_"
55
55
  });
56
56
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
57
57
  (0, _inherits2["default"])(RadioGroupRoot, _Component);
@@ -1,12 +1,12 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/createClass";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
- import _createSuper from "@babel/runtime/helpers/createSuper";
9
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
7
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
10
  import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
11
11
  import { assignProps as _assignProps5 } from "@semcore/core";
12
12
  import { assignProps as _assignProps4 } from "@semcore/core";
@@ -24,22 +24,22 @@ import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance
24
24
  import getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';
25
25
  import { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';
26
26
  /*__reshadow-styles__:"./style/radio.shadow.css"*/
27
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_1xokd_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1xokd_gg_ .___SText_1xokd_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1xokd_gg_ .___SText_1xokd_gg_.__color_1xokd_gg_{color:var(--color_1xokd)}.___SRadio_1xokd_gg_.__disabled_1xokd_gg_{pointer-events:none}.___SText_1xokd_gg_._size_m_1xokd_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1xokd_gg_._size_l_1xokd_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1xokd_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1xokd_gg_::after,.___SValue_1xokd_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1xokd_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1xokd_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1xokd_gg_.__disabled_1xokd_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_1xokd_gg_._size_m_1xokd_gg_{width:16px;height:16px}.___SValue_1xokd_gg_._size_m_1xokd_gg_ .___SInvalidPattern_1xokd_gg_:before{width:14px;height:14px}.___SValue_1xokd_gg_._size_l_1xokd_gg_{width:20px;height:20px}.___SValue_1xokd_gg_._size_l_1xokd_gg_ .___SInvalidPattern_1xokd_gg_:before{width:18px;height:18px}.___SValue_1xokd_gg_._state_normal_1xokd_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1xokd_gg_._state_invalid_1xokd_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1xokd_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_._size_m_1xokd_gg_::after{width:6px;height:6px}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_._size_l_1xokd_gg_::after{width:8px;height:8px}.___SValue_1xokd_gg_._state_normal_1xokd_gg_.__keyboardFocused_1xokd_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_1xokd_gg_._state_invalid_1xokd_gg_.__keyboardFocused_1xokd_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1xokd_gg_:checked~.___SValue_1xokd_gg_.__theme_1xokd_gg_::before{border-color:var(--theme_1xokd);background-color:var(--theme_1xokd)}.___SValue_1xokd_gg_._state_normal_1xokd_gg_.__theme_1xokd_gg_::before{border-color:var(--theme_1xokd)}.___SInvalidPattern_1xokd_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1xokd_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__*/, "1xokd_gg_") /*__reshadow_css_end__*/, {
28
- "__SRadio": "___SRadio_1xokd_gg_",
29
- "_disabled": "__disabled_1xokd_gg_",
30
- "__SText": "___SText_1xokd_gg_",
31
- "_size_m": "_size_m_1xokd_gg_",
32
- "_size_l": "_size_l_1xokd_gg_",
33
- "__SValue": "___SValue_1xokd_gg_",
34
- "_state_normal": "_state_normal_1xokd_gg_",
35
- "_state_invalid": "_state_invalid_1xokd_gg_",
36
- "__SControl": "___SControl_1xokd_gg_",
37
- "_keyboardFocused": "__keyboardFocused_1xokd_gg_",
38
- "_theme": "__theme_1xokd_gg_",
39
- "--theme": "--theme_1xokd",
40
- "_color": "__color_1xokd_gg_",
41
- "--color": "--color_1xokd",
42
- "__SInvalidPattern": "___SInvalidPattern_1xokd_gg_"
27
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadio_1oep7_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1oep7_gg_ .___SText_1oep7_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, #191b23)}.___SRadio_1oep7_gg_ .___SText_1oep7_gg_.__color_1oep7_gg_{color:var(--color_1oep7)}.___SRadio_1oep7_gg_.__disabled_1oep7_gg_{pointer-events:none}.___SText_1oep7_gg_._size_m_1oep7_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1oep7_gg_._size_l_1oep7_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1oep7_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1oep7_gg_::after,.___SValue_1oep7_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SValue_1oep7_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1oep7_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1oep7_gg_.__disabled_1oep7_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_1oep7_gg_._size_m_1oep7_gg_{width:16px;height:16px}.___SValue_1oep7_gg_._size_m_1oep7_gg_ .___SInvalidPattern_1oep7_gg_:before{width:14px;height:14px}.___SValue_1oep7_gg_._size_l_1oep7_gg_{width:20px;height:20px}.___SValue_1oep7_gg_._size_l_1oep7_gg_ .___SInvalidPattern_1oep7_gg_:before{width:18px;height:18px}.___SValue_1oep7_gg_._state_normal_1oep7_gg_::before{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SValue_1oep7_gg_._state_invalid_1oep7_gg_::before{border-color:var(--intergalactic-border-critical-active, #d1002f)}.___SControl_1oep7_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_::before{border-color:var(--intergalactic-control-primary-info, #008ff8);background-color:var(--intergalactic-control-primary-info, #008ff8)}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_._size_m_1oep7_gg_::after{width:6px;height:6px}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_._size_l_1oep7_gg_::after{width:8px;height:8px}.___SValue_1oep7_gg_._state_normal_1oep7_gg_.__keyboardFocused_1oep7_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_1oep7_gg_._state_invalid_1oep7_gg_.__keyboardFocused_1oep7_gg_::before{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SControl_1oep7_gg_:checked~.___SValue_1oep7_gg_.__theme_1oep7_gg_::before{border-color:var(--theme_1oep7);background-color:var(--theme_1oep7)}.___SValue_1oep7_gg_._state_normal_1oep7_gg_.__theme_1oep7_gg_::before{border-color:var(--theme_1oep7)}.___SInvalidPattern_1oep7_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1oep7_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__*/, "1oep7_gg_") /*__reshadow_css_end__*/, {
28
+ "__SRadio": "___SRadio_1oep7_gg_",
29
+ "_disabled": "__disabled_1oep7_gg_",
30
+ "__SText": "___SText_1oep7_gg_",
31
+ "_size_m": "_size_m_1oep7_gg_",
32
+ "_size_l": "_size_l_1oep7_gg_",
33
+ "__SValue": "___SValue_1oep7_gg_",
34
+ "_state_normal": "_state_normal_1oep7_gg_",
35
+ "_state_invalid": "_state_invalid_1oep7_gg_",
36
+ "__SControl": "___SControl_1oep7_gg_",
37
+ "_keyboardFocused": "__keyboardFocused_1oep7_gg_",
38
+ "_theme": "__theme_1oep7_gg_",
39
+ "--theme": "--theme_1oep7",
40
+ "_color": "__color_1oep7_gg_",
41
+ "--color": "--color_1oep7",
42
+ "__SInvalidPattern": "___SInvalidPattern_1oep7_gg_"
43
43
  });
44
44
  import logger from '@semcore/utils/lib/logger';
45
45
  import { Text as TypographyText } from '@semcore/typography';
@@ -381,4 +381,4 @@ export var wrapRadioGroup = function wrapRadioGroup(wrapper) {
381
381
  return wrapper;
382
382
  };
383
383
  export default Radio;
384
- //# sourceMappingURL=Radio.js.map
384
+ //# sourceMappingURL=Radio.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.mjs","names":["React","createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","Flex","Box","InvalidStateBox","assignProps","callAllEventHandlers","keyboardFocusEnhance","resolveColorEnhance","getInputProps","inputProps","useColorResolver","style","_sstyled","insert","logger","Text","TypographyText","RadioGroupRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","hoistedDisabled","undefined","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","_this$asProps3","styles","hasChildren","cn","_objectSpread","_assignProps2","Fragment","Radio","Value","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","_excluded2","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref10","SValue","SInvalidPattern","_assignProps4","_ref5","_ref11","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC5F,SAASC,IAAI,EAAEC,GAAG,EAAEC,eAAe,QAAQ,mBAAmB;AAC9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AAM;IAAEmE,KAAK,GAAK/E,KAAK,CAAf+E,KAAK;EAErB3J,KAAK,CAAC4J,SAAS,CAAC,YAAM;IACpB,IAAIhF,KAAK,CAACD,YAAY,KAAKC,KAAK,CAACnC,QAAQ,EAAE;MACzCmC,KAAK,CAACF,aAAa,CAACE,KAAK,CAACnC,QAAQ,CAAC;IACrC;EACF,CAAC,EAAE,CAACmC,KAAK,CAACD,YAAY,EAAEC,KAAK,CAACnC,QAAQ,EAAEmC,KAAK,CAACF,aAAa,CAAC,CAAC;EAC7D,IAAMiD,YAAY,GAAG5G,gBAAgB,EAAE;EAEvC,OAAA0I,MAAA,GAAOrJ,OAAO,CAACoF,MAAM,CAAC,eACpBxF,KAAA,CAAA6C,aAAA,CAAC6G,KAAK,EAAAD,MAAA,CAAA/D,EAAA,UAAAC,aAAA,KAAAkE,aAAA;IAAA,OAA6B,MAAM;IAAA,aAAYlC,YAAY,CAACgC,KAAK;EAAC,GAAAH,KAAA,IAAI;AAEhF,CAAC;AACDpI,IAAI,CAAC8H,WAAW,GAAG,MAAM;AAEzB,SAASpI,UAAU,EAAEmC,UAAU;AAE/B,IAAM8C,KAAK,GAAG9F,eAAe,CAAC+F,SAAS,EAAE;EACvC0C,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAAC;AAEF,IAAM7C,KAAK,GAAG7F,eAAe,CAACiD,SAAS,EAAE;EACvC9B,IAAI,EAAJA,IAAI;EACJ2E,KAAK,EAALA;AACF,CAAC,CAAC;AAEF,OAAO,IAAM+D,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAElD,eAAejE,KAAK"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mjs","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,3 +1,3 @@
1
1
  export { default } from './Radio';
2
2
  export * from './Radio';
3
- //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["default"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Radio';\nexport * from './Radio';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS;AACjC,cAAc,SAAS"}
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@semcore/radio",
3
3
  "description": "Semrush Radio Component",
4
- "version": "6.41.1-prerelease.2",
4
+ "version": "6.42.0",
5
5
  "main": "lib/cjs/index.js",
6
- "module": "lib/es6/index.js",
6
+ "module": "lib/es6/index.mjs",
7
7
  "typings": "lib/types/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/utils": "4.44.1-prerelease.2",
13
- "@semcore/flex-box": "5.39.1-prerelease.2",
14
- "@semcore/typography": "5.48.1-prerelease.2"
12
+ "@semcore/utils": "4.45.0",
13
+ "@semcore/flex-box": "5.40.0",
14
+ "@semcore/typography": "5.50.0"
15
15
  },
16
16
  "peerDependencies": {
17
- "@semcore/core": "^2.37.1-prerelease.2",
17
+ "@semcore/core": "^2.17.5",
18
18
  "react": "16.8 - 18",
19
19
  "react-dom": "16.8 - 18"
20
20
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.js","names":["React","createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","Flex","Box","InvalidStateBox","assignProps","callAllEventHandlers","keyboardFocusEnhance","resolveColorEnhance","getInputProps","inputProps","useColorResolver","style","_sstyled","insert","logger","Text","TypographyText","RadioGroupRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","RadioRoot","_Component2","_super2","_this","_len","length","args","Array","_key","call","concat","_assertThisInitialized","hoistedDisabled","undefined","warn","setState","getTextProps","_assignProps6","context","_assignProps6$size","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$props$size","_assignProps7","_assignProps7$size","_assignProps7$state","_this$asProps2","checked","_ref2","_ref6","SRadio","_this$asProps3","styles","hasChildren","cn","_objectSpread","_assignProps2","Fragment","Radio","Value","ValueRoot","_Component3","_super3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","controlProps","ref","_this$props","onClick","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","_getInputProps3","_getInputProps4","radioMarkProps","propsWithoutChildren","_excluded2","markProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref10","SValue","SInvalidPattern","_assignProps4","_ref5","_ref11","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport assignProps, { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/utils/lib/inputProps';\nimport { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';\n\nimport style from './style/radio.shadow.css';\nimport logger from '@semcore/utils/lib/logger';\nimport { Text as TypographyText } from '@semcore/typography';\n\nclass RadioGroupRoot extends Component {\n static displayName = 'RadioGroup';\n\n static defaultProps = {\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n setContext() {\n const { theme, size, name, value, onChange, disabled } = this.asProps;\n\n return {\n onChange,\n value,\n theme,\n size,\n name,\n disabled,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n\n return (\n <Root render={Flex} direction='column' role='group' __excludeProps={['onChange']}>\n <Children />\n </Root>\n );\n }\n}\n\nconst RadioGroup = createComponent(RadioGroupRoot);\n\nclass RadioRoot extends Component {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled) => {\n logger.warn(\n true,\n `Don't set disabled on Radio.Value or Radio.Text, set it on Radio or on RadioGroup (for all items) instead. Otherwise it will produce wrong SSR output.`,\n this.asProps['data-ui-name'],\n );\n this.setState({ hoistedDisabled: disabled });\n };\n\n getTextProps() {\n // The default values are here, since you cannot rewrite out of context\n const { size = 'm', disabled, label } = assignProps(this.asProps, this.context);\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size,\n children: label,\n disabled: disabled ?? hoistedDisabled,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n\n return textProps;\n }\n\n getValueProps() {\n // The default values are here, since you cannot rewrite out of context\n const {\n size = 'm',\n state = 'normal',\n theme,\n disabled,\n name,\n } = assignProps(this.asProps, this.context);\n const { value, checked } = this.asProps;\n const { hoistedDisabled } = this.state;\n\n return {\n size: this.props.size ?? size,\n disabled: disabled ?? hoistedDisabled,\n state: state,\n theme,\n value,\n checked,\n name,\n hoistDisabled: this.hoistDisabled,\n rootDisabled: this.props.disabled,\n };\n }\n\n render() {\n const SRadio = Root;\n const { styles, Children, children: hasChildren } = this.asProps;\n\n return sstyled(styles)(\n <SRadio render={Box} tag='label' __excludeProps={['onChange', 'label', 'disabled']}>\n {hasChildren ? (\n <Children />\n ) : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component {\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n static enhance = [keyboardFocusEnhance(), resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange, onClick } = this.props;\n\n controlProps.checked = currentValue === inputValue;\n controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));\n }\n\n return controlProps;\n }\n\n getRadioMarkProps() {\n const currentValue = this.context.value;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n ...other\n } = this.asProps;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const { children, Children, ...propsWithoutChildren } = radioMarkProps;\n const inputValue = value ?? '';\n\n const markProps = {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...propsWithoutChildren,\n };\n\n if (currentValue !== undefined) {\n const { onClick } = this.props;\n\n if (tag !== 'label') {\n markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));\n }\n }\n\n return markProps;\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n componentDidMount() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\n }\n\n render() {\n const { styles, children: hasChildren, Children } = this.asProps;\n\n if (!hasChildren) {\n return sstyled(styles)(\n <>\n <Radio.Value.Control />\n <Radio.Value.RadioMark />\n </>,\n );\n }\n\n return sstyled(styles)(<Children />);\n }\n}\n\nconst Control = (props) => {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(\n <SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />,\n );\n};\nControl.displayName = 'Control';\n\nconst RadioMark = (props) => {\n const SValue = Root;\n const SInvalidPattern = InvalidStateBox;\n const { theme, styles, resolveColor, state, checked } = props;\n\n return sstyled(styles)(\n <SValue render={Box} tag='div' use:theme={resolveColor(theme)} aria-hidden={true}>\n {state === 'invalid' && !checked && <SInvalidPattern />}\n </SValue>,\n );\n};\nRadioMark.displayName = 'RadioMark';\n\nconst Text = (props) => {\n const SText = Root;\n const { styles, color } = props;\n\n React.useEffect(() => {\n if (props.rootDisabled !== props.disabled) {\n props.hoistDisabled(props.disabled);\n }\n }, [props.rootDisabled, props.disabled, props.hoistDisabled]);\n const resolveColor = useColorResolver();\n\n return sstyled(styles)(\n <SText render={TypographyText} tag='span' use:color={resolveColor(color)} />,\n );\n};\nText.displayName = 'Text';\n\nexport { inputProps, RadioGroup };\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n});\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n});\n\nexport const wrapRadioGroup = (wrapper) => wrapper;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC5F,SAASC,IAAI,EAAEC,GAAG,EAAEC,eAAe,QAAQ,mBAAmB;AAC9D,OAAOC,WAAW,IAAIC,oBAAoB,QAAQ,gCAAgC;AAClF,OAAOC,oBAAoB,MAAM,kDAAkD;AACnF,OAAOC,mBAAmB,MAAM,iDAAiD;AACjF,OAAOC,aAAa,IAAIC,UAAU,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AE;MACzCmC,KAAK,CAACF,aAAa,CAACE,KAAK,CAACnC,QAAQ,CAAC;IACrC;EACF,CAAC,EAAE,CAACmC,KAAK,CAACD,YAAY,EAAEC,KAAK,CAACnC,QAAQ,EAAEmC,KAAK,CAACF,aAAa,CAAC,CAAC;EAC7D,IAAMiD,YAAY,GAAG5G,gBAAgB,EAAE;EAEvC,OAAA0I,MAAA,GAAOrJ,OAAO,CAACoF,MAAM,CAAC,eACpBxF,KAAA,CAAA6C,aAAA,CAAC6G,KAAK,EAAAD,MAAA,CAAA/D,EAAA,UAAAC,aAAA,KAAAkE,aAAA;IAAA,OAA6B,MAAM;IAAA,aAAYlC,YAAY,CAACgC,KAAK;EAAC,GAAAH,KAAA,IAAI;AAEhF,CAAC;AACDpI,IAAI,CAAC8H,WAAW,GAAG,MAAM;AAEzB,SAASpI,UAAU,EAAEmC,UAAU;AAE/B,IAAM8C,KAAK,GAAG9F,eAAe,CAAC+F,SAAS,EAAE;EACvC0C,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAAC;AAEF,IAAM7C,KAAK,GAAG7F,eAAe,CAACiD,SAAS,EAAE;EACvC9B,IAAI,EAAJA,IAAI;EACJ2E,KAAK,EAALA;AACF,CAAC,CAAC;AAEF,OAAO,IAAM+D,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAElD,eAAejE,KAAK"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Radio';\nexport * from './Radio';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS;AACjC,cAAc,SAAS"}