@semcore/radio 5.0.11 → 5.1.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,18 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [5.1.0] - 2022-10-10
6
+
7
+ ### Changed
8
+
9
+ - Added support for React 18 🔥
10
+
11
+ ## [5.0.12] - 2022-10-04
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.37.1 ~> 3.37.2], `@semcore/flex-box` [4.5.11 ~> 4.5.12]).
16
+
5
17
  ## [5.0.11] - 2022-09-22
6
18
 
7
19
  ### Fixed
@@ -26,24 +38,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
26
38
 
27
39
  - Version patch update due to children dependencies update (`@semcore/utils` [3.36.0 ~> 3.37.0], `@semcore/flex-box` [4.5.9 ~> 4.5.10]).
28
40
 
29
- ## [5.0.7] - 2022-08-11
30
-
31
- ### Changed
32
-
33
- - Version patch update due to children dependencies update (`@semcore/utils` [3.35.1 ~> 3.36.0], `@semcore/flex-box` [4.5.8 ~> 4.5.9], `@semcore/typography` [4.0.11 ~> 4.1.0]).
34
-
35
- ## [5.0.6] - 2022-07-22
36
-
37
- ### Changed
38
-
39
- - Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/flex-box` [4.5.6 ~> 4.5.7]).
40
-
41
- ## [5.0.5] - 2022-07-07
42
-
43
- ### Changed
44
-
45
- - Version patch update due to children dependencies update (`@semcore/utils` [3.33.0 ~> 3.34.0], `@semcore/flex-box` [4.5.5 ~> 4.5.6]).
46
-
47
41
  ## [5.0.4] - 2022-06-27
48
42
 
49
43
  ### Fixed
@@ -56,12 +50,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
56
50
 
57
51
  - Version patch update due to children dependencies update (`@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/flex-box` [4.5.4 ~> 4.5.5]).
58
52
 
59
- ## [5.0.2] - 2022-05-31
60
-
61
- ### Changed
62
-
63
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/flex-box` [4.5.3 ~> 4.5.4]).
64
-
65
53
  ## [5.0.1] - 2022-05-19
66
54
 
67
55
  ### Fixed
@@ -81,12 +69,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
81
69
 
82
70
  - Version patch update due to children dependencies update (`@semcore/typography` [3.4.1 ~> 3.4.2]).
83
71
 
84
- ## [4.2.5] - 2022-03-14
85
-
86
- ### Changed
87
-
88
- - Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2], `@semcore/flex-box` [4.5.0 ~> 4.5.1]).
89
-
90
72
  ## [4.2.3] - 2022-02-24
91
73
 
92
74
  ### Added
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright ©, 2022, Semrush Inc. (written by Roman Lysov, Sergey Kobets, Mikhail Karachev, Julia Mnizhek, Elena Krasnopolskaia, Mikhail Sereniti).
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/lib/cjs/Radio.js CHANGED
@@ -62,23 +62,23 @@ var style = (
62
62
  /*__reshadow_css_start__*/
63
63
  _core.sstyled.insert(
64
64
  /*__inner_css_start__*/
65
- ".___SRadio_1egmk_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1egmk_gg_.__disabled_1egmk_gg_{opacity:0.3;cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.___SText_1egmk_gg_{margin-left:8px}.___SText_1egmk_gg_._size_m_1egmk_gg_{font-size:14px;line-height:1.42}.___SText_1egmk_gg_._size_l_1egmk_gg_{font-size:16px;line-height:1.5}.___SValue_1egmk_gg_{position:relative;flex-shrink:0;padding:0;outline:none;z-index:0;margin-top:2px}.___SValue_1egmk_gg_:before{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border:1px solid;border-radius:50%}.___SValue_1egmk_gg_:after{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-radius:50%;background:#fff}.___SValue_1egmk_gg_._size_m_1egmk_gg_{width:16px;height:16px}.___SValue_1egmk_gg_._size_l_1egmk_gg_{width:20px;height:20px}.___SValue_1egmk_gg_._state_normal_1egmk_gg_:before{border-color:#c4c7cf}.___SValue_1egmk_gg_._state_invalid_1egmk_gg_:before{border-color:#ff4953}.___SControl_1egmk_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_:before{border-color:#008ff8;background-color:#008ff8}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_._size_m_1egmk_gg_:after{width:6px;height:6px}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_._size_l_1egmk_gg_:after{width:8px;height:8px}.___SValue_1egmk_gg_._state_normal_1egmk_gg_.__keyboardFocused_1egmk_gg_:before{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);border-color:#008ff8}.___SValue_1egmk_gg_._state_invalid_1egmk_gg_.__keyboardFocused_1egmk_gg_:before{box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_.__theme_1egmk_gg_:before{border-color:var(--theme_1egmk);background-color:var(--theme_1egmk)}.___SValue_1egmk_gg_._state_normal_1egmk_gg_.__theme_1egmk_gg_:before{border-color:var(--theme_1egmk)}"
65
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SRadio_gz43v_gg_ {\n display: inline-flex;\n align-items: flex-start;\n cursor: pointer;\n}\n\n.___SRadio_gz43v_gg_.__disabled_gz43v_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.___SText_gz43v_gg_ {\n margin-left: 8px;\n}\n\n.___SText_gz43v_gg_._size_m_gz43v_gg_ {\n font-size: 14px;\n line-height: 1.42;\n}\n\n.___SText_gz43v_gg_._size_l_gz43v_gg_ {\n font-size: 16px;\n line-height: 1.5;\n}\n\n.___SValue_gz43v_gg_ {\n position: relative;\n flex-shrink: 0;\n padding: 0;\n outline: none;\n z-index: 0;\n\n margin-top: 2px\n}\n\n.___SValue_gz43v_gg_::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: #fff;\n border: 1px solid;\n border-radius: 50%;\n }\n\n.___SValue_gz43v_gg_::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 0;\n height: 0;\n border-radius: 50%;\n background: #fff;\n }\n\n.___SValue_gz43v_gg_._size_m_gz43v_gg_ {\n width: 16px;\n height: 16px;\n}\n\n.___SValue_gz43v_gg_._size_l_gz43v_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_::before {\n border-color: #c4c7cf;\n}\n\n.___SValue_gz43v_gg_._state_invalid_gz43v_gg_::before {\n border-color: #ff4953;\n}\n\n.___SControl_gz43v_gg_ {\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_::before {\n border-color: #008ff8;\n background-color: #008ff8;\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_._size_m_gz43v_gg_::after {\n width: 6px;\n height: 6px;\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_._size_l_gz43v_gg_::after {\n width: 8px;\n height: 8px;\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_.__keyboardFocused_gz43v_gg_::before {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n border-color: #008ff8;\n}\n\n.___SValue_gz43v_gg_._state_invalid_gz43v_gg_.__keyboardFocused_gz43v_gg_::before {\n box-shadow: 0px 0px 0px 3px rgba(255, 73, 83, 0.2);\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_.__theme_gz43v_gg_::before {\n border-color: var(--theme_gz43v);\n background-color: var(--theme_gz43v);\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_.__theme_gz43v_gg_::before {\n border-color: var(--theme_gz43v);\n}\n"
66
66
  /*__inner_css_end__*/
67
- , "1egmk_gg_")
67
+ , "gz43v_gg_")
68
68
  /*__reshadow_css_end__*/
69
69
  , {
70
- "__SRadio": "___SRadio_1egmk_gg_",
71
- "_disabled": "__disabled_1egmk_gg_",
72
- "__SText": "___SText_1egmk_gg_",
73
- "_size_m": "_size_m_1egmk_gg_",
74
- "_size_l": "_size_l_1egmk_gg_",
75
- "__SValue": "___SValue_1egmk_gg_",
76
- "_state_normal": "_state_normal_1egmk_gg_",
77
- "_state_invalid": "_state_invalid_1egmk_gg_",
78
- "__SControl": "___SControl_1egmk_gg_",
79
- "_keyboardFocused": "__keyboardFocused_1egmk_gg_",
80
- "_theme": "__theme_1egmk_gg_",
81
- "--theme": "--theme_1egmk"
70
+ "__SRadio": "___SRadio_gz43v_gg_",
71
+ "_disabled": "__disabled_gz43v_gg_",
72
+ "__SText": "___SText_gz43v_gg_",
73
+ "_size_m": "_size_m_gz43v_gg_",
74
+ "_size_l": "_size_l_gz43v_gg_",
75
+ "__SValue": "___SValue_gz43v_gg_",
76
+ "_state_normal": "_state_normal_gz43v_gg_",
77
+ "_state_invalid": "_state_invalid_gz43v_gg_",
78
+ "__SControl": "___SControl_gz43v_gg_",
79
+ "_keyboardFocused": "__keyboardFocused_gz43v_gg_",
80
+ "_theme": "__theme_gz43v_gg_",
81
+ "--theme": "--theme_gz43v"
82
82
  });
83
83
 
84
84
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { 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 /** 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":""}
package/lib/es6/Radio.js CHANGED
@@ -31,23 +31,23 @@ var style = (
31
31
  /*__reshadow_css_start__*/
32
32
  _sstyled.insert(
33
33
  /*__inner_css_start__*/
34
- ".___SRadio_1egmk_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1egmk_gg_.__disabled_1egmk_gg_{opacity:0.3;cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.___SText_1egmk_gg_{margin-left:8px}.___SText_1egmk_gg_._size_m_1egmk_gg_{font-size:14px;line-height:1.42}.___SText_1egmk_gg_._size_l_1egmk_gg_{font-size:16px;line-height:1.5}.___SValue_1egmk_gg_{position:relative;flex-shrink:0;padding:0;outline:none;z-index:0;margin-top:2px}.___SValue_1egmk_gg_:before{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border:1px solid;border-radius:50%}.___SValue_1egmk_gg_:after{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-radius:50%;background:#fff}.___SValue_1egmk_gg_._size_m_1egmk_gg_{width:16px;height:16px}.___SValue_1egmk_gg_._size_l_1egmk_gg_{width:20px;height:20px}.___SValue_1egmk_gg_._state_normal_1egmk_gg_:before{border-color:#c4c7cf}.___SValue_1egmk_gg_._state_invalid_1egmk_gg_:before{border-color:#ff4953}.___SControl_1egmk_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_:before{border-color:#008ff8;background-color:#008ff8}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_._size_m_1egmk_gg_:after{width:6px;height:6px}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_._size_l_1egmk_gg_:after{width:8px;height:8px}.___SValue_1egmk_gg_._state_normal_1egmk_gg_.__keyboardFocused_1egmk_gg_:before{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);border-color:#008ff8}.___SValue_1egmk_gg_._state_invalid_1egmk_gg_.__keyboardFocused_1egmk_gg_:before{box-shadow:0px 0px 0px 3px rgba(255, 73, 83, 0.2)}.___SControl_1egmk_gg_:checked~.___SValue_1egmk_gg_.__theme_1egmk_gg_:before{border-color:var(--theme_1egmk);background-color:var(--theme_1egmk)}.___SValue_1egmk_gg_._state_normal_1egmk_gg_.__theme_1egmk_gg_:before{border-color:var(--theme_1egmk)}"
34
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SRadio_gz43v_gg_ {\n display: inline-flex;\n align-items: flex-start;\n cursor: pointer;\n}\n\n.___SRadio_gz43v_gg_.__disabled_gz43v_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.___SText_gz43v_gg_ {\n margin-left: 8px;\n}\n\n.___SText_gz43v_gg_._size_m_gz43v_gg_ {\n font-size: 14px;\n line-height: 1.42;\n}\n\n.___SText_gz43v_gg_._size_l_gz43v_gg_ {\n font-size: 16px;\n line-height: 1.5;\n}\n\n.___SValue_gz43v_gg_ {\n position: relative;\n flex-shrink: 0;\n padding: 0;\n outline: none;\n z-index: 0;\n\n margin-top: 2px\n}\n\n.___SValue_gz43v_gg_::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: #fff;\n border: 1px solid;\n border-radius: 50%;\n }\n\n.___SValue_gz43v_gg_::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 0;\n height: 0;\n border-radius: 50%;\n background: #fff;\n }\n\n.___SValue_gz43v_gg_._size_m_gz43v_gg_ {\n width: 16px;\n height: 16px;\n}\n\n.___SValue_gz43v_gg_._size_l_gz43v_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_::before {\n border-color: #c4c7cf;\n}\n\n.___SValue_gz43v_gg_._state_invalid_gz43v_gg_::before {\n border-color: #ff4953;\n}\n\n.___SControl_gz43v_gg_ {\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_::before {\n border-color: #008ff8;\n background-color: #008ff8;\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_._size_m_gz43v_gg_::after {\n width: 6px;\n height: 6px;\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_._size_l_gz43v_gg_::after {\n width: 8px;\n height: 8px;\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_.__keyboardFocused_gz43v_gg_::before {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n border-color: #008ff8;\n}\n\n.___SValue_gz43v_gg_._state_invalid_gz43v_gg_.__keyboardFocused_gz43v_gg_::before {\n box-shadow: 0px 0px 0px 3px rgba(255, 73, 83, 0.2);\n}\n\n.___SControl_gz43v_gg_:checked ~ .___SValue_gz43v_gg_.__theme_gz43v_gg_::before {\n border-color: var(--theme_gz43v);\n background-color: var(--theme_gz43v);\n}\n\n.___SValue_gz43v_gg_._state_normal_gz43v_gg_.__theme_gz43v_gg_::before {\n border-color: var(--theme_gz43v);\n}\n"
35
35
  /*__inner_css_end__*/
36
- , "1egmk_gg_")
36
+ , "gz43v_gg_")
37
37
  /*__reshadow_css_end__*/
38
38
  , {
39
- "__SRadio": "___SRadio_1egmk_gg_",
40
- "_disabled": "__disabled_1egmk_gg_",
41
- "__SText": "___SText_1egmk_gg_",
42
- "_size_m": "_size_m_1egmk_gg_",
43
- "_size_l": "_size_l_1egmk_gg_",
44
- "__SValue": "___SValue_1egmk_gg_",
45
- "_state_normal": "_state_normal_1egmk_gg_",
46
- "_state_invalid": "_state_invalid_1egmk_gg_",
47
- "__SControl": "___SControl_1egmk_gg_",
48
- "_keyboardFocused": "__keyboardFocused_1egmk_gg_",
49
- "_theme": "__theme_1egmk_gg_",
50
- "--theme": "--theme_1egmk"
39
+ "__SRadio": "___SRadio_gz43v_gg_",
40
+ "_disabled": "__disabled_gz43v_gg_",
41
+ "__SText": "___SText_gz43v_gg_",
42
+ "_size_m": "_size_m_gz43v_gg_",
43
+ "_size_l": "_size_l_gz43v_gg_",
44
+ "__SValue": "___SValue_gz43v_gg_",
45
+ "_state_normal": "_state_normal_gz43v_gg_",
46
+ "_state_invalid": "_state_invalid_gz43v_gg_",
47
+ "__SControl": "___SControl_gz43v_gg_",
48
+ "_keyboardFocused": "__keyboardFocused_gz43v_gg_",
49
+ "_theme": "__theme_gz43v_gg_",
50
+ "--theme": "--theme_gz43v"
51
51
  });
52
52
 
53
53
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { 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 /** 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":""}
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@semcore/radio",
3
3
  "description": "Semrush Radio Component",
4
- "version": "5.0.11",
4
+ "version": "5.1.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
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
- "scripts": {
12
- "build": "build --source=js",
13
- "test": "jest"
14
- },
15
11
  "dependencies": {
16
12
  "@semcore/utils": "^3.15",
17
13
  "@semcore/flex-box": "^4",
@@ -19,7 +15,7 @@
19
15
  },
20
16
  "peerDependencies": {
21
17
  "@semcore/core": "^1.11",
22
- "react": "16.8 - 17"
18
+ "react": "16.8 - 18"
23
19
  },
24
20
  "jest": {
25
21
  "preset": "@semcore/jest-preset-ui"
@@ -30,6 +26,11 @@
30
26
  "directory": "semcore/radio"
31
27
  },
32
28
  "devDependencies": {
29
+ "@types/react": "18.0.21",
33
30
  "@semcore/jest-preset-ui": "1.0.0"
31
+ },
32
+ "scripts": {
33
+ "build": "pnpm semcore-builder --source=js",
34
+ "test": "jest"
34
35
  }
35
- }
36
+ }
@@ -1,78 +0,0 @@
1
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
- import { IBoxProps } from '@semcore/flex-box';
3
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
4
- import { Text } from '@semcore/typography';
5
-
6
- export type RadioSize = 'm' | 'l';
7
- export type RadioState = 'normal' | 'invalid';
8
- export type RadioValue = string | number | boolean;
9
-
10
- export interface IRadioProps extends IBoxProps {
11
- /**
12
- * The value displaying the state of the component
13
- * @default normal
14
- */
15
- state?: RadioState;
16
- /**
17
- * Radio button size
18
- * @default m
19
- **/
20
- size?: RadioSize;
21
- /** The theme of the radio button that you can send your color to */
22
- theme?: string;
23
- }
24
-
25
- export interface IRadioGroupProps {
26
- /** Radio group name */
27
- name?: string;
28
- /** Active default value */
29
- defaultValue?: RadioValue;
30
- /** Active value */
31
- value?: RadioValue;
32
- /** Called when the selected element is changed */
33
- onChange?: (value: RadioValue, e?: React.SyntheticEvent<HTMLInputElement>) => void;
34
- /** Radio button size */
35
- size?: RadioSize;
36
- /** The theme of the radio button that you can send your color to */
37
- theme?: string;
38
- /** Blocks access and changes to the form field */
39
- disabled?: boolean;
40
- }
41
-
42
- export interface IRadioValueProps extends IBoxProps, IKeyboardFocusProps {
43
- /** List of elements that can be put on a hidden input */
44
- includeInputProps?: string[];
45
- /**
46
- * The value displaying the state of the component
47
- * @default normal
48
- */
49
- state?: RadioState;
50
- /** The theme of the radio button that you can send your color to */
51
- theme?: string;
52
- /** Radio button size */
53
- size?: RadioSize;
54
- /** The element value is required for RadioGroup */
55
- value?: RadioValue;
56
- /** Default value if `value` property is not provided */
57
- defaultValue?: RadioValue;
58
- /** Called when the value changes */
59
- onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
60
- /** Blocks access and changes to the form field */
61
- disabled?: boolean;
62
- }
63
-
64
- export interface IRadioCtx {
65
- getValueProps: PropGetterFn;
66
- getTextProps: PropGetterFn;
67
- }
68
-
69
- declare const RadioGroup: <T>(props: CProps<IRadioGroupProps & T>) => ReturnEl;
70
-
71
- export { RadioGroup };
72
-
73
- declare const Radio: (<T>(props: CProps<IRadioProps & T, IRadioCtx>) => ReturnEl) & {
74
- Value: <T>(props: IRadioValueProps & T) => ReturnEl;
75
- Text: typeof Text;
76
- };
77
-
78
- export default Radio;
@@ -1,78 +0,0 @@
1
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
- import { IBoxProps } from '@semcore/flex-box';
3
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
4
- import { Text } from '@semcore/typography';
5
-
6
- export type RadioSize = 'm' | 'l';
7
- export type RadioState = 'normal' | 'invalid';
8
- export type RadioValue = string | number | boolean;
9
-
10
- export interface IRadioProps extends IBoxProps {
11
- /**
12
- * The value displaying the state of the component
13
- * @default normal
14
- */
15
- state?: RadioState;
16
- /**
17
- * Radio button size
18
- * @default m
19
- **/
20
- size?: RadioSize;
21
- /** The theme of the radio button that you can send your color to */
22
- theme?: string;
23
- }
24
-
25
- export interface IRadioGroupProps {
26
- /** Radio group name */
27
- name?: string;
28
- /** Active default value */
29
- defaultValue?: RadioValue;
30
- /** Active value */
31
- value?: RadioValue;
32
- /** Called when the selected element is changed */
33
- onChange?: (value: RadioValue, e?: React.SyntheticEvent<HTMLInputElement>) => void;
34
- /** Radio button size */
35
- size?: RadioSize;
36
- /** The theme of the radio button that you can send your color to */
37
- theme?: string;
38
- /** Blocks access and changes to the form field */
39
- disabled?: boolean;
40
- }
41
-
42
- export interface IRadioValueProps extends IBoxProps, IKeyboardFocusProps {
43
- /** List of elements that can be put on a hidden input */
44
- includeInputProps?: string[];
45
- /**
46
- * The value displaying the state of the component
47
- * @default normal
48
- */
49
- state?: RadioState;
50
- /** The theme of the radio button that you can send your color to */
51
- theme?: string;
52
- /** Radio button size */
53
- size?: RadioSize;
54
- /** The element value is required for RadioGroup */
55
- value?: RadioValue;
56
- /** Default value if `value` property is not provided */
57
- defaultValue?: RadioValue;
58
- /** Called when the value changes */
59
- onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;
60
- /** Blocks access and changes to the form field */
61
- disabled?: boolean;
62
- }
63
-
64
- export interface IRadioCtx {
65
- getValueProps: PropGetterFn;
66
- getTextProps: PropGetterFn;
67
- }
68
-
69
- declare const RadioGroup: <T>(props: CProps<IRadioGroupProps & T>) => ReturnEl;
70
-
71
- export { RadioGroup };
72
-
73
- declare const Radio: (<T>(props: CProps<IRadioProps & T, IRadioCtx>) => ReturnEl) & {
74
- Value: <T>(props: IRadioValueProps & T) => ReturnEl;
75
- Text: typeof Text;
76
- };
77
-
78
- export default Radio;