@semcore/radio 16.2.0 → 16.2.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/lib/es6/Radio.js CHANGED
@@ -12,36 +12,36 @@ import { assignProps as _assignProps4 } from "@semcore/core";
12
12
  import { assignProps as _assignProps3 } from "@semcore/core";
13
13
  import { assignProps as _assignProps2 } from "@semcore/core";
14
14
  import { assignProps as _assignProps } from "@semcore/core";
15
- var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor", "children", "Children"];
16
- import { Flex, Box, InvalidStateBox } from '@semcore/base-components';
17
- import { createComponent, Component, sstyled, Root } from '@semcore/core';
18
- import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
15
+ var _excluded = ["size", "state", "theme", "keyboardFocused", "value", "tag", "disabled", "includeInputProps", "resolveColor"],
16
+ _excluded2 = ["children", "Children"];
17
+ import { createComponent, Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';
18
+ import assignProps, { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
19
19
  import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
20
20
  import getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';
21
21
  import logger from '@semcore/core/lib/utils/logger';
22
22
  import { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';
23
+ import { Flex, Box, InvalidStateBox } from '@semcore/flex-box';
23
24
  import { Text as TypographyText } from '@semcore/typography';
24
25
  import React from 'react';
25
26
  /*!__reshadow-styles__:"./style/radio.shadow.css"*/
26
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SRadio_1p42f_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1p42f_gg_ .___SText_1p42f_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___SRadio_1p42f_gg_ .___SText_1p42f_gg_.__color_1p42f_gg_{color:var(--color_1p42f)}.___SRadio_1p42f_gg_.__disabled_1p42f_gg_{pointer-events:none}.___SValue_1p42f_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1p42f_gg_::after,.___SValue_1p42f_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255))}.___SValue_1p42f_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1p42f_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1p42f_gg_.__disabled_1p42f_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_1p42f_gg_._size_m_1p42f_gg_{width:16px;height:16px}.___SValue_1p42f_gg_._size_m_1p42f_gg_ .___SInvalidPattern_1p42f_gg_:before{width:14px;height:14px}.___SValue_1p42f_gg_._size_l_1p42f_gg_{width:20px;height:20px}.___SValue_1p42f_gg_._size_l_1p42f_gg_ .___SInvalidPattern_1p42f_gg_:before{width:18px;height:18px}.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@supports (color:color(display-p3 0 0 0%)){.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{border-color:var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100))}@supports (color:color(display-p3 0 0 0%)){.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100))}@media (color-gamut:p3){.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.95478 0.398 0.38923))}}}.___SControl_1p42f_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1p42f_gg_:checked~.___SValue_1p42f_gg_._size_m_1p42f_gg_::after{width:6px;height:6px}.___SControl_1p42f_gg_:checked~.___SValue_1p42f_gg_._size_l_1p42f_gg_::after{width:8px;height:8px}.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{border-color:var(--intergalactic-border-info-active, rgb(135, 150, 239));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_normal_1p42f_gg_::before{outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SControl_1p42f_gg_:checked:focus-visible~.___SValue_1p42f_gg_::before,.___SControl_1p42f_gg_:checked~.___SValue_1p42f_gg_::before{border-color:var(--intergalactic-control-primary-info, rgb(26, 30, 26));background-color:var(--intergalactic-control-primary-info, rgb(26, 30, 26))}.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.95478 0.398 0.38923));outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}@supports (color:oklab(0%0 0%)){.___SControl_1p42f_gg_:focus-visible+.___SValue_1p42f_gg_._state_invalid_1p42f_gg_::before{outline-color:var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652))}}.___SControl_1p42f_gg_:checked~.___SValue_1p42f_gg_.__theme_1p42f_gg_::before{border-color:var(--theme_1p42f);background-color:var(--theme_1p42f)}.___SValue_1p42f_gg_._state_normal_1p42f_gg_.__theme_1p42f_gg_::before{border-color:var(--theme_1p42f)}.___SInvalidPattern_1p42f_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1p42f_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgb(255, 99, 100) 0, rgb(255, 99, 100) 1px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255))}@supports (color:color(display-p3 0 0 0%)){.___SInvalidPattern_1p42f_gg_:before{background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgb(255, 99, 100) 0, rgb(255, 99, 100) 1px, transparent 0, transparent 50%))}@media (color-gamut:p3){.___SInvalidPattern_1p42f_gg_:before{background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, color(display-p3 0.95478 0.398 0.38923) 0, color(display-p3 0.95478 0.398 0.38923) 1px, transparent 0, transparent 50%))}}}", /*__inner_css_end__*/"1p42f_gg_"),
27
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SRadio_1382i_gg_{display:inline-flex;align-items:flex-start;cursor:pointer}.___SRadio_1382i_gg_ .___SText_1382i_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___SRadio_1382i_gg_ .___SText_1382i_gg_.__color_1382i_gg_{color:var(--color_1382i)}.___SRadio_1382i_gg_.__disabled_1382i_gg_{pointer-events:none}.___SText_1382i_gg_._size_m_1382i_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1382i_gg_._size_l_1382i_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SValue_1382i_gg_{position:relative;flex-shrink:0;padding:0;outline:0;z-index:0;margin-top:var(--intergalactic-spacing-05x, 2px)}.___SValue_1382i_gg_::after,.___SValue_1382i_gg_::before{content:\"\";position:absolute;right:0;bottom:0;border-radius:50%;background:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255))}.___SValue_1382i_gg_::before{top:0;left:0;border:1px solid;transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___SValue_1382i_gg_::after{top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0}.___SValue_1382i_gg_.__disabled_1382i_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_1382i_gg_._size_m_1382i_gg_{width:16px;height:16px}.___SValue_1382i_gg_._size_m_1382i_gg_ .___SInvalidPattern_1382i_gg_:before{width:14px;height:14px}.___SValue_1382i_gg_._size_l_1382i_gg_{width:20px;height:20px}.___SValue_1382i_gg_._size_l_1382i_gg_ .___SInvalidPattern_1382i_gg_:before{width:18px;height:18px}.___SValue_1382i_gg_._state_normal_1382i_gg_::before{border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@supports (color:color(display-p3 0 0 0%)){.___SValue_1382i_gg_._state_normal_1382i_gg_::before{border-color:var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SValue_1382i_gg_._state_normal_1382i_gg_::before{border-color:var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56))}@supports (color:color(display-p3 0 0 0%)){.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56))}@media (color-gamut:p3){.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.918 0.19866 0.14259 / 0.56))}}}.___SControl_1382i_gg_{position:absolute;clip:rect(1px,1px,1px,1px)}.___SControl_1382i_gg_:checked~.___SValue_1382i_gg_._size_m_1382i_gg_::after{width:6px;height:6px}.___SControl_1382i_gg_:checked~.___SValue_1382i_gg_._size_l_1382i_gg_::after{width:8px;height:8px}.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_normal_1382i_gg_::before{border-color:var(--intergalactic-border-info-active, rgba(0, 40, 230, 0.419));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_normal_1382i_gg_::before{outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_normal_1382i_gg_::before{outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SControl_1382i_gg_:checked:focus-visible~.___SValue_1382i_gg_::before,.___SControl_1382i_gg_:checked~.___SValue_1382i_gg_::before{border-color:var(--intergalactic-control-primary-info, rgb(26, 30, 26));background-color:var(--intergalactic-control-primary-info, rgb(26, 30, 26))}.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, rgba(255, 0, 4, 0.56));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{border-color:var(--intergalactic-border-critical-active, color(display-p3 0.918 0.19866 0.14259 / 0.56));outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}@supports (color:oklab(0%0 0%)){.___SControl_1382i_gg_:focus-visible+.___SValue_1382i_gg_._state_invalid_1382i_gg_::before{outline-color:var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652))}}.___SControl_1382i_gg_:checked~.___SValue_1382i_gg_.__theme_1382i_gg_::before{border-color:var(--theme_1382i);background-color:var(--theme_1382i)}.___SValue_1382i_gg_._state_normal_1382i_gg_.__theme_1382i_gg_::before{border-color:var(--theme_1382i)}.___SInvalidPattern_1382i_gg_{background:0 0;overflow:hidden}.___SInvalidPattern_1382i_gg_:before{content:\"\";position:absolute;top:1px;left:1px;border-radius:50%;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(255, 0, 4, 0.56) 0, rgba(255, 0, 4, 0.56) 1px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255))}@supports (color:color(display-p3 0 0 0%)){.___SInvalidPattern_1382i_gg_:before{background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(255, 0, 4, 0.56) 0, rgba(255, 0, 4, 0.56) 1px, transparent 0, transparent 50%))}@media (color-gamut:p3){.___SInvalidPattern_1382i_gg_:before{background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, color(display-p3 0.918 0.19866 0.14259 / 0.56) 0, color(display-p3 0.918 0.19866 0.14259 / 0.56) 1px, transparent 0, transparent 50%))}}}", /*__inner_css_end__*/"1382i_gg_"),
27
28
  /*__reshadow_css_end__*/
28
29
  {
29
- "__SRadio": "___SRadio_1p42f_gg_",
30
- "_disabled": "__disabled_1p42f_gg_",
31
- "__SValue": "___SValue_1p42f_gg_",
32
- "_state_normal": "_state_normal_1p42f_gg_",
33
- "_state_invalid": "_state_invalid_1p42f_gg_",
34
- "__SControl": "___SControl_1p42f_gg_",
35
- "_size_m": "_size_m_1p42f_gg_",
36
- "_size_l": "_size_l_1p42f_gg_",
37
- "_theme": "__theme_1p42f_gg_",
38
- "--theme": "--theme_1p42f",
39
- "__SText": "___SText_1p42f_gg_",
40
- "_color": "__color_1p42f_gg_",
41
- "--color": "--color_1p42f",
42
- "__SInvalidPattern": "___SInvalidPattern_1p42f_gg_"
30
+ "__SRadio": "___SRadio_1382i_gg_",
31
+ "_disabled": "__disabled_1382i_gg_",
32
+ "__SText": "___SText_1382i_gg_",
33
+ "_size_m": "_size_m_1382i_gg_",
34
+ "_size_l": "_size_l_1382i_gg_",
35
+ "__SValue": "___SValue_1382i_gg_",
36
+ "_state_normal": "_state_normal_1382i_gg_",
37
+ "_state_invalid": "_state_invalid_1382i_gg_",
38
+ "__SControl": "___SControl_1382i_gg_",
39
+ "_theme": "__theme_1382i_gg_",
40
+ "--theme": "--theme_1382i",
41
+ "_color": "__color_1382i_gg_",
42
+ "--color": "--color_1382i",
43
+ "__SInvalidPattern": "___SInvalidPattern_1382i_gg_"
43
44
  });
44
- var RadioContext = /*#__PURE__*/React.createContext({});
45
45
  var RadioGroupRoot = /*#__PURE__*/function (_Component) {
46
46
  function RadioGroupRoot() {
47
47
  _classCallCheck(this, RadioGroupRoot);
@@ -91,9 +91,7 @@ _defineProperty(RadioGroupRoot, "displayName", 'RadioGroup');
91
91
  _defineProperty(RadioGroupRoot, "defaultProps", {
92
92
  defaultValue: null
93
93
  });
94
- var RadioGroup = createComponent(RadioGroupRoot, {}, {
95
- context: RadioContext
96
- });
94
+ var RadioGroup = createComponent(RadioGroupRoot);
97
95
  var RadioRoot = /*#__PURE__*/function (_Component2) {
98
96
  function RadioRoot() {
99
97
  var _this;
@@ -102,7 +100,6 @@ var RadioRoot = /*#__PURE__*/function (_Component2) {
102
100
  args[_key] = arguments[_key];
103
101
  }
104
102
  _this = _callSuper(this, RadioRoot, [].concat(args));
105
- _defineProperty(_this, "context", {});
106
103
  _defineProperty(_this, "state", {
107
104
  hoistedDisabled: undefined
108
105
  });
@@ -118,16 +115,15 @@ var RadioRoot = /*#__PURE__*/function (_Component2) {
118
115
  return _createClass(RadioRoot, [{
119
116
  key: "getTextProps",
120
117
  value: function getTextProps() {
121
- var _this$context$size;
122
- var _this$asProps2 = this.asProps,
123
- _this$asProps2$size = _this$asProps2.size,
124
- size = _this$asProps2$size === void 0 ? (_this$context$size = this.context.size) !== null && _this$context$size !== void 0 ? _this$context$size : 'm' : _this$asProps2$size,
125
- _this$asProps2$disabl = _this$asProps2.disabled,
126
- disabled = _this$asProps2$disabl === void 0 ? this.context.disabled : _this$asProps2$disabl,
127
- label = _this$asProps2.label;
118
+ // The default values are here, since you cannot rewrite out of context
119
+ var _assignProps6 = assignProps(this.asProps, this.context),
120
+ _assignProps6$size = _assignProps6.size,
121
+ size = _assignProps6$size === void 0 ? 'm' : _assignProps6$size,
122
+ disabled = _assignProps6.disabled,
123
+ label = _assignProps6.label;
128
124
  var hoistedDisabled = this.state.hoistedDisabled;
129
125
  var textProps = {
130
- size: size === 'm' ? 200 : 300,
126
+ size: size,
131
127
  children: label,
132
128
  disabled: disabled !== null && disabled !== void 0 ? disabled : hoistedDisabled,
133
129
  hoistDisabled: this.hoistDisabled,
@@ -138,21 +134,19 @@ var RadioRoot = /*#__PURE__*/function (_Component2) {
138
134
  }, {
139
135
  key: "getValueProps",
140
136
  value: function getValueProps() {
141
- var _this$context$size2, _this$props$size;
142
- var _this$asProps3 = this.asProps,
143
- _this$asProps3$state = _this$asProps3.state,
144
- state = _this$asProps3$state === void 0 ? 'normal' : _this$asProps3$state,
145
- _this$asProps3$size = _this$asProps3.size,
146
- size = _this$asProps3$size === void 0 ? (_this$context$size2 = this.context.size) !== null && _this$context$size2 !== void 0 ? _this$context$size2 : 'm' : _this$asProps3$size,
147
- _this$asProps3$theme = _this$asProps3.theme,
148
- theme = _this$asProps3$theme === void 0 ? this.context.theme : _this$asProps3$theme,
149
- _this$asProps3$disabl = _this$asProps3.disabled,
150
- disabled = _this$asProps3$disabl === void 0 ? this.context.disabled : _this$asProps3$disabl,
151
- _this$asProps3$name = _this$asProps3.name,
152
- name = _this$asProps3$name === void 0 ? this.context.name : _this$asProps3$name;
153
- var _this$asProps4 = this.asProps,
154
- value = _this$asProps4.value,
155
- checked = _this$asProps4.checked;
137
+ var _this$props$size;
138
+ // The default values are here, since you cannot rewrite out of context
139
+ var _assignProps7 = assignProps(this.asProps, this.context),
140
+ _assignProps7$size = _assignProps7.size,
141
+ size = _assignProps7$size === void 0 ? 'm' : _assignProps7$size,
142
+ _assignProps7$state = _assignProps7.state,
143
+ state = _assignProps7$state === void 0 ? 'normal' : _assignProps7$state,
144
+ theme = _assignProps7.theme,
145
+ disabled = _assignProps7.disabled,
146
+ name = _assignProps7.name;
147
+ var _this$asProps2 = this.asProps,
148
+ value = _this$asProps2.value,
149
+ checked = _this$asProps2.checked;
156
150
  var hoistedDisabled = this.state.hoistedDisabled;
157
151
  return {
158
152
  size: (_this$props$size = this.props.size) !== null && _this$props$size !== void 0 ? _this$props$size : size,
@@ -172,10 +166,10 @@ var RadioRoot = /*#__PURE__*/function (_Component2) {
172
166
  var _ref2 = this.asProps,
173
167
  _ref6;
174
168
  var SRadio = Box;
175
- var _this$asProps5 = this.asProps,
176
- styles = _this$asProps5.styles,
177
- Children = _this$asProps5.Children,
178
- hasChildren = _this$asProps5.children;
169
+ var _this$asProps3 = this.asProps,
170
+ styles = _this$asProps3.styles,
171
+ Children = _this$asProps3.Children,
172
+ hasChildren = _this$asProps3.children;
179
173
  return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SRadio, _ref6.cn("SRadio", _objectSpread({}, _assignProps2({
180
174
  "tag": 'label',
181
175
  "__excludeProps": ['onChange', 'label', 'disabled']
@@ -185,7 +179,7 @@ var RadioRoot = /*#__PURE__*/function (_Component2) {
185
179
  }(Component);
186
180
  _defineProperty(RadioRoot, "displayName", 'Radio');
187
181
  _defineProperty(RadioRoot, "style", style);
188
- _defineProperty(RadioRoot, "contextType", RadioContext);
182
+ _defineProperty(RadioRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
189
183
  var ValueRoot = /*#__PURE__*/function (_Component3) {
190
184
  function ValueRoot() {
191
185
  var _this2;
@@ -194,10 +188,9 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
194
188
  args[_key2] = arguments[_key2];
195
189
  }
196
190
  _this2 = _callSuper(this, ValueRoot, [].concat(args));
197
- _defineProperty(_this2, "context", {});
198
191
  _defineProperty(_this2, "bindHandlerChange", function (value) {
199
192
  return function (e) {
200
- if (typeof _this2.context.onChange === 'function' && value !== undefined) {
193
+ if (typeof _this2.context.onChange === 'function') {
201
194
  _this2.context.onChange(value, e);
202
195
  }
203
196
  };
@@ -218,50 +211,52 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
218
211
  key: "getControlProps",
219
212
  value: function getControlProps() {
220
213
  var currentValue = this.context.value;
221
- var _this$asProps6 = this.asProps,
222
- forwardRef = _this$asProps6.forwardRef,
223
- includeInputProps = _this$asProps6.includeInputProps,
224
- state = _this$asProps6.state,
225
- value = _this$asProps6.value;
226
- var onChange = this.props.onChange;
214
+ var _this$asProps4 = this.asProps,
215
+ forwardRef = _this$asProps4.forwardRef,
216
+ includeInputProps = _this$asProps4.includeInputProps,
217
+ state = _this$asProps4.state,
218
+ value = _this$asProps4.value;
227
219
  var _getInputProps = getInputProps(this.asProps, includeInputProps),
228
220
  _getInputProps2 = _slicedToArray(_getInputProps, 1),
229
221
  commonControlProps = _getInputProps2[0];
230
222
  var inputValue = value !== null && value !== void 0 ? value : '';
231
- return _objectSpread(_objectSpread({
223
+ var controlProps = _objectSpread(_objectSpread({
232
224
  ref: forwardRef,
233
225
  state: state
234
226
  }, commonControlProps), {}, {
235
227
  value: inputValue
236
- }, currentValue !== undefined ? {
237
- checked: currentValue === inputValue,
238
- onChange: callAllEventHandlers(onChange, this.bindHandlerChange(inputValue))
239
- } : {});
228
+ });
229
+ if (currentValue !== undefined) {
230
+ var onChange = this.props.onChange;
231
+ controlProps.checked = currentValue === inputValue;
232
+ controlProps.onChange = callAllEventHandlers(onChange, this.bindHandlerChange(inputValue));
233
+ }
234
+ return controlProps;
240
235
  }
241
236
  }, {
242
237
  key: "getRadioMarkProps",
243
238
  value: function getRadioMarkProps() {
244
239
  var currentValue = this.context.value;
245
- var _this$asProps7 = this.asProps,
246
- size = _this$asProps7.size,
247
- state = _this$asProps7.state,
248
- theme = _this$asProps7.theme,
249
- keyboardFocused = _this$asProps7.keyboardFocused,
250
- value = _this$asProps7.value,
251
- tag = _this$asProps7.tag,
252
- disabled = _this$asProps7.disabled,
253
- includeInputProps = _this$asProps7.includeInputProps,
254
- resolveColor = _this$asProps7.resolveColor,
255
- children = _this$asProps7.children,
256
- Children = _this$asProps7.Children,
257
- other = _objectWithoutProperties(_this$asProps7, _excluded);
258
- var onClick = this.props.onClick;
240
+ var _this$asProps5 = this.asProps,
241
+ size = _this$asProps5.size,
242
+ state = _this$asProps5.state,
243
+ theme = _this$asProps5.theme,
244
+ keyboardFocused = _this$asProps5.keyboardFocused,
245
+ value = _this$asProps5.value,
246
+ tag = _this$asProps5.tag,
247
+ disabled = _this$asProps5.disabled,
248
+ includeInputProps = _this$asProps5.includeInputProps,
249
+ resolveColor = _this$asProps5.resolveColor,
250
+ other = _objectWithoutProperties(_this$asProps5, _excluded);
259
251
  var _getInputProps3 = getInputProps(other, includeInputProps),
260
252
  _getInputProps4 = _slicedToArray(_getInputProps3, 2),
261
253
  commonControlProps = _getInputProps4[0],
262
254
  radioMarkProps = _getInputProps4[1];
255
+ var _children = radioMarkProps.children,
256
+ _Children = radioMarkProps.Children,
257
+ propsWithoutChildren = _objectWithoutProperties(radioMarkProps, _excluded2);
263
258
  var inputValue = value !== null && value !== void 0 ? value : '';
264
- return _objectSpread(_objectSpread({
259
+ var markProps = _objectSpread({
265
260
  theme: theme,
266
261
  size: size,
267
262
  state: state,
@@ -269,9 +264,14 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
269
264
  disabled: disabled,
270
265
  resolveColor: resolveColor,
271
266
  checked: commonControlProps.checked
272
- }, radioMarkProps), currentValue !== undefined && tag !== 'label' ? {
273
- onClick: callAllEventHandlers(onClick, this.bindHandlerChange(inputValue))
274
- } : {});
267
+ }, propsWithoutChildren);
268
+ if (currentValue !== undefined) {
269
+ var onClick = this.props.onClick;
270
+ if (tag !== 'label') {
271
+ markProps.onClick = callAllEventHandlers(onClick, this.bindHandlerChange(inputValue));
272
+ }
273
+ }
274
+ return markProps;
275
275
  }
276
276
  }, {
277
277
  key: "componentDidUpdate",
@@ -291,10 +291,10 @@ var ValueRoot = /*#__PURE__*/function (_Component3) {
291
291
  key: "render",
292
292
  value: function render() {
293
293
  var _ref8;
294
- var _this$asProps8 = this.asProps,
295
- styles = _this$asProps8.styles,
296
- hasChildren = _this$asProps8.children,
297
- Children = _this$asProps8.Children;
294
+ var _this$asProps6 = this.asProps,
295
+ styles = _this$asProps6.styles,
296
+ hasChildren = _this$asProps6.children,
297
+ Children = _this$asProps6.Children;
298
298
  if (!hasChildren) {
299
299
  var _ref7;
300
300
  return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Radio.Value.Control, null), /*#__PURE__*/React.createElement(Radio.Value.RadioMark, null));
@@ -309,7 +309,7 @@ _defineProperty(ValueRoot, "defaultProps", {
309
309
  });
310
310
  _defineProperty(ValueRoot, "enhance", [resolveColorEnhance()]);
311
311
  _defineProperty(ValueRoot, "displayName", 'Value');
312
- _defineProperty(ValueRoot, "contextType", RadioContext);
312
+ _defineProperty(ValueRoot, "contextType", RadioGroup[CONTEXT_COMPONENT]);
313
313
  _defineProperty(ValueRoot, "style", style);
314
314
  function Control(props) {
315
315
  var _ref3 = arguments[0],
@@ -323,6 +323,7 @@ function Control(props) {
323
323
  "aria-invalid": state === 'invalid'
324
324
  }, _ref3))));
325
325
  }
326
+ ;
326
327
  Control.displayName = 'Control';
327
328
  function RadioMark(props) {
328
329
  var _ref4 = arguments[0],
@@ -359,6 +360,7 @@ function Text(props) {
359
360
  }, _ref5))));
360
361
  }
361
362
  Text.displayName = 'Text';
363
+ export { inputProps, RadioGroup };
362
364
  var Value = createComponent(ValueRoot, {
363
365
  Control: Control,
364
366
  RadioMark: RadioMark
@@ -370,6 +372,5 @@ var Radio = createComponent(RadioRoot, {
370
372
  export var wrapRadioGroup = function wrapRadioGroup(wrapper) {
371
373
  return wrapper;
372
374
  };
373
- export { inputProps, RadioGroup };
374
375
  export default Radio;
375
376
  //# sourceMappingURL=Radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["Flex","Box","InvalidStateBox","createComponent","Component","sstyled","Root","callAllEventHandlers","resolveColorEnhance","getInputProps","inputProps","logger","useColorResolver","Text","TypographyText","React","style","_sstyled","insert","RadioContext","createContext","RadioGroupRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","context","RadioRoot","_Component2","_this","_len","length","args","Array","_key","concat","hoistedDisabled","undefined","warn","setState","getTextProps","_this$context$size","_this$asProps2","_this$asProps2$size","_this$asProps2$disabl","label","state","textProps","children","hoistDisabled","rootDisabled","props","getValueProps","_this$context$size2","_this$props$size","_this$asProps3","_this$asProps3$state","_this$asProps3$size","_this$asProps3$theme","_this$asProps3$disabl","_this$asProps3$name","_this$asProps4","checked","_ref2","_ref6","SRadio","_this$asProps5","styles","hasChildren","cn","_objectSpread","_assignProps2","Fragment","Radio","Value","ValueRoot","_Component3","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps6","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","ref","bindHandlerChange","getRadioMarkProps","_this$asProps7","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","onClick","_getInputProps3","_getInputProps4","radioMarkProps","componentDidUpdate","componentDidMount","_ref8","_this$asProps8","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref0","SValue","SInvalidPattern","_assignProps4","_ref5","_ref1","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.tsx"],"sourcesContent":["import { Flex, Box, InvalidStateBox } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';\nimport logger from '@semcore/core/lib/utils/logger';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\nimport { Text as TypographyText } from '@semcore/typography';\nimport React from 'react';\n\nimport type { NSRadio } from './Radio.type';\nimport style from './style/radio.shadow.css';\n\nconst RadioContext = React.createContext<{\n onChange?: NSRadio.Group.Props['onChange'];\n value?: NSRadio.Group.Props['value'];\n theme?: NSRadio.Group.Props['theme'];\n size?: NSRadio.Group.Props['size'];\n name?: NSRadio.Group.Props['name'];\n disabled?: NSRadio.Group.Props['disabled'];\n}>({});\n\nclass RadioGroupRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSRadio.Group.Component>,\n [],\n { value: null }\n> {\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, {}, { context: RadioContext }) as unknown as NSRadio.Group.Component;\n\nclass RadioRoot extends Component<Intergalactic.InternalTypings.InferComponentProps<NSRadio.Component>> {\n static displayName = 'Radio';\n static style = style;\n static contextType = RadioContext;\n\n context: React.ContextType<typeof RadioContext> = {};\n\n state = {\n hoistedDisabled: undefined,\n };\n\n hoistDisabled = (disabled: NSRadio.Props['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 const { size = this.context.size ?? 'm', disabled = this.context.disabled, label } = this.asProps;\n\n const { hoistedDisabled } = this.state;\n\n const textProps = {\n size: size === 'm' ? 200 : 300,\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 const {\n state = 'normal',\n size = this.context.size ?? 'm',\n theme = this.context.theme,\n disabled = this.context.disabled,\n name = this.context.name,\n } = this.asProps;\n\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 ? (\n <Children />\n )\n : (\n <>\n <Radio.Value />\n <Radio.Text />\n </>\n )}\n </SRadio>,\n );\n }\n}\n\nclass ValueRoot extends Component<\n Intergalactic.InternalTypings.InferChildComponentProps<NSRadio.Value.Component, typeof RadioRoot, 'Value'>,\n typeof ValueRoot.enhance,\n { checked: (e: React.ChangeEvent<HTMLInputElement>) => boolean }\n> {\n context: React.ContextType<typeof RadioContext> = {};\n\n static defaultProps = {\n includeInputProps: inputProps,\n defaultChecked: false,\n };\n\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'Value';\n static contextType = RadioContext;\n static style = style;\n\n bindHandlerChange = (value: NSRadio.Props['value']) => (e: React.ChangeEvent<HTMLInputElement>) => {\n if (typeof this.context.onChange === 'function' && value !== undefined) {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e: React.ChangeEvent<HTMLInputElement>) => e.target.checked,\n };\n }\n\n getControlProps() {\n const { value: currentValue } = this.context;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const { onChange } = this.props;\n\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n return {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n ...(currentValue !== undefined\n ? {\n checked: currentValue === inputValue,\n onChange: callAllEventHandlers(onChange, this.bindHandlerChange(inputValue)),\n }\n : {}),\n };\n }\n\n getRadioMarkProps() {\n const { value: currentValue } = this.context;\n const {\n size,\n state,\n theme,\n keyboardFocused,\n value,\n tag,\n disabled,\n includeInputProps,\n resolveColor,\n children,\n Children,\n ...other\n } = this.asProps;\n const { onClick } = this.props;\n const [commonControlProps, radioMarkProps] = getInputProps(other, includeInputProps);\n const inputValue = value ?? '';\n\n return {\n theme,\n size,\n state,\n keyboardFocused,\n disabled,\n resolveColor,\n checked: commonControlProps.checked,\n ...radioMarkProps,\n ...(currentValue !== undefined && tag !== 'label'\n ? {\n onClick: callAllEventHandlers(onClick, this.bindHandlerChange(inputValue)),\n }\n : {}),\n };\n }\n\n componentDidUpdate() {\n if (this.asProps.rootDisabled !== this.asProps.disabled) {\n this.asProps.hoistDisabled(this.asProps.disabled);\n }\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\nfunction Control(\n props: Intergalactic.InternalTypings.InferChildComponentProps<\n NSRadio.Value.Control.Component,\n typeof ValueRoot,\n 'Control'\n >,\n) {\n const SControl = Root;\n const { styles, state } = props;\n\n return sstyled(styles)(<SControl render={Box} tag='input' type='radio' aria-invalid={state === 'invalid'} />);\n}\nControl.displayName = 'Control';\n\nfunction RadioMark(\n props: Intergalactic.InternalTypings.InferChildComponentProps<\n NSRadio.Value.Mark.Component,\n typeof ValueRoot,\n 'RadioMark'\n >,\n) {\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\nfunction Text(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSRadio.Text.Component, typeof RadioRoot, 'Text'>,\n) {\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)(<SText render={TypographyText} tag='span' use:color={resolveColor(color)} />);\n}\nText.displayName = 'Text';\n\nconst Value = createComponent(ValueRoot, {\n Control,\n RadioMark,\n}) as NSRadio.Value.Component;\n\nconst Radio = createComponent(RadioRoot, {\n Text,\n Value,\n}) as NSRadio.Component;\n\nexport const wrapRadioGroup = <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<NSRadio.Group.Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => wrapper as NSRadio.Group.Component<PropsExtending>;\n\nexport { inputProps, RadioGroup };\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAASA,IAAI,EAAEC,GAAG,EAAEC,eAAe,QAAQ,0BAA0B;AAErE,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,aAAa,IAAIC,UAAU,QAAQ,oCAAoC;AAC9E,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAAS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B,KAAK,CAAvBgB,MAAM;IAAE6D,KAAK,GAAK7E,KAAK,CAAf6E,KAAK;EAErBtI,KAAK,CAACuI,SAAS,CAAC,YAAM;IACpB,IAAI9E,KAAK,CAACD,YAAY,KAAKC,KAAK,CAAClC,QAAQ,EAAE;MACzCkC,KAAK,CAACF,aAAa,CAACE,KAAK,CAAClC,QAAQ,CAAC;IACrC;EACF,CAAC,EAAE,CAACkC,KAAK,CAACD,YAAY,EAAEC,KAAK,CAAClC,QAAQ,EAAEkC,KAAK,CAACF,aAAa,CAAC,CAAC;EAC7D,IAAMiD,YAAY,GAAG3G,gBAAgB,CAAC,CAAC;EAEvC,OAAAuI,KAAA,GAAO9I,OAAO,CAACmF,MAAM,CAAC,eAACzE,KAAA,CAAA2B,aAAA,CAAC0G,KAAK,EAAAD,KAAA,CAAAzD,EAAA,UAAAC,aAAA,KAAA4D,aAAA;IAAA,OAA6B,MAAM;IAAA,aAAYhC,YAAY,CAAC8B,KAAK;EAAC,GAAAH,KAAA,GAAG,CAAC;AACrG;AACArI,IAAI,CAAC+H,WAAW,GAAG,MAAM;AAEzB,IAAM7C,KAAK,GAAG5F,eAAe,CAAC6F,SAAS,EAAE;EACvCoC,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAA4B;AAE7B,IAAMvC,KAAK,GAAG3F,eAAe,CAAC6C,SAAS,EAAE;EACvCnC,IAAI,EAAJA,IAAI;EACJkF,KAAK,EAALA;AACF,CAAC,CAAsB;AAEvB,OAAO,IAAMyD,cAAc,GAAG,SAAjBA,cAAcA,CACzBC,OAKoB;EAAA,OACjBA,OAAO;AAAA,CAA2C;AAEvD,SAAS/I,UAAU,EAAEoC,UAAU;AAE/B,eAAegD,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Radio.js","names":["createComponent","Component","CONTEXT_COMPONENT","sstyled","Root","assignProps","callAllEventHandlers","resolveColorEnhance","getInputProps","inputProps","logger","useColorResolver","Flex","Box","InvalidStateBox","Text","TypographyText","React","style","_sstyled","insert","RadioGroupRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","uncontrolledProps","setContext","_this$asProps","asProps","theme","size","name","onChange","disabled","render","_ref","Children","createElement","_assignProps","_defineProperty","defaultValue","RadioGroup","RadioRoot","_Component2","_this","_len","length","args","Array","_key","concat","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","_this2","_len2","_key2","e","target","getControlProps","currentValue","_this$asProps4","forwardRef","includeInputProps","_getInputProps","_getInputProps2","_slicedToArray","commonControlProps","inputValue","controlProps","ref","bindHandlerChange","getRadioMarkProps","_this$asProps5","keyboardFocused","tag","resolveColor","other","_objectWithoutProperties","_excluded","_getInputProps3","_getInputProps4","radioMarkProps","_children","_Children","propsWithoutChildren","_excluded2","markProps","onClick","componentDidUpdate","componentDidMount","_ref8","_this$asProps6","_ref7","Control","RadioMark","defaultChecked","_ref3","arguments[0]","_ref9","SControl","_assignProps3","displayName","_ref4","_ref0","SValue","SInvalidPattern","_assignProps4","_ref5","_ref1","SText","color","useEffect","_assignProps5","wrapRadioGroup","wrapper"],"sources":["../../src/Radio.jsx"],"sourcesContent":["import { createComponent, Component, CONTEXT_COMPONENT, sstyled, Root } from '@semcore/core';\nimport assignProps, { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport getInputProps, { inputProps } from '@semcore/core/lib/utils/inputProps';\nimport logger from '@semcore/core/lib/utils/logger';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\nimport { Flex, Box, InvalidStateBox } from '@semcore/flex-box';\nimport { Text as TypographyText } from '@semcore/typography';\nimport React from 'react';\n\nimport style from './style/radio.shadow.css';\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 ? (\n <Children />\n )\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\n static enhance = [resolveColorEnhance()];\n static displayName = 'Value';\n static contextType = RadioGroup[CONTEXT_COMPONENT];\n static style = style;\n\n bindHandlerChange = (value) => (e) => {\n if (typeof this.context.onChange === 'function') {\n this.context.onChange(value, e);\n }\n };\n\n uncontrolledProps() {\n return {\n checked: (e) => e.target.checked,\n };\n }\n\n getControlProps() {\n const currentValue = this.context.value;\n const { forwardRef, includeInputProps, state, value } = this.asProps;\n const [commonControlProps] = getInputProps(this.asProps, includeInputProps);\n const inputValue = value ?? '';\n\n const controlProps = {\n ref: forwardRef,\n state,\n ...commonControlProps,\n value: inputValue,\n };\n\n if (currentValue !== undefined) {\n const { onChange } = 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, 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\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\nfunction 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\nfunction 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\nfunction 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,SAASA,eAAe,EAAEC,SAAS,EAAEC,iBAAiB,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC5F,OAAOC,WAAW,IAAIC,oBAAoB,QAAQ,qCAAqC;AACvF,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,aAAa,IAAIC,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YAAY,GAAGvG,gBAAgB,CAAC,CAAC;EAEvC,OAAAwI,KAAA,GAAOhJ,OAAO,CAAC+E,MAAM,CAAC,eACpBjE,KAAA,CAAAyB,aAAA,CAAC0G,KAAK,EAAAD,KAAA,CAAA/D,EAAA,UAAAC,aAAA,KAAAkE,aAAA;IAAA,OAA6B,MAAM;IAAA,aAAYrC,YAAY,CAACmC,KAAK;EAAC,GAAAH,KAAA,GAAG,CAAC;AAEhF;AACAnI,IAAI,CAAC6H,WAAW,GAAG,MAAM;AAEzB,SAASnI,UAAU,EAAEqC,UAAU;AAE/B,IAAM2C,KAAK,GAAGzF,eAAe,CAAC0F,SAAS,EAAE;EACvC0C,OAAO,EAAPA,OAAO;EACPC,SAAS,EAATA;AACF,CAAC,CAAC;AAEF,IAAM7C,KAAK,GAAGxF,eAAe,CAAC+C,SAAS,EAAE;EACvChC,IAAI,EAAJA,IAAI;EACJ0E,KAAK,EAALA;AACF,CAAC,CAAC;AAEF,OAAO,IAAM+D,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAElD,eAAejE,KAAK","ignoreList":[]}
@@ -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 type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { Box, BoxProps, Flex } from '@semcore/flex-box';\nimport type { Text } from '@semcore/typography';\nimport type React from 'react';\n\nexport type RadioSize = 'm' | 'l';\nexport type RadioState = 'normal' | 'invalid';\nexport type RadioValue = string | number | boolean;\n\n/** @deprecated */\nexport interface IRadioProps extends RadioProps, UnknownProperties {}\nexport type RadioProps = BoxProps & {\n /** Radio item value **/\n value?: RadioValue;\n\n /** Radio item checked flag **/\n checked?: boolean;\n\n /**\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * Radio button size\n * @default m\n **/\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Radio item text **/\n label?: string;\n /** Blocks access and changes to the radio item **/\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioGroupProps extends RadioGroupProps, UnknownProperties {\n /**\n * HTML tag name for the displayed item\n */\n tag?: React.ElementType | string;\n}\nexport type RadioGroupProps<T extends RadioValue = RadioValue> = {\n /** Radio group name */\n name?: string;\n /** Active default value */\n defaultValue?: T;\n /** Active value */\n value?: T;\n /** Called when the selected element is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLInputElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Radio button size */\n size?: RadioSize;\n /** The theme of the radio button that you can send your color to */\n theme?: string;\n /** Blocks access and changes to the form field */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioValueProps extends RadioValueProps, UnknownProperties {}\nexport type RadioValueProps = BoxProps & {\n /** List of elements that can be put on a hidden input */\n includeInputProps?: string[];\n /**\n * @deprecated set `state` on root Radio instead\n * The value displaying the state of the component\n * @default normal\n */\n state?: RadioState;\n /**\n * @deprecated\n * The theme of the radio button that you can send your color to\n */\n theme?: string;\n /**\n * @deprecated set `size` on root RadioGroup instead\n * Radio button size\n */\n size?: RadioSize;\n /**\n * @deprecated set `value` on root Radio instead\n * The element value is required for RadioGroup\n */\n value?: RadioValue;\n /**\n * @deprecated set `defaultValue` on root RadioGroup instead\n * Default value if `value` property is not provided\n */\n defaultValue?: RadioValue;\n /**\n * @deprecated set `onChange` on root RadioGroup instead\n * Called when the value changes\n */\n onChange?: (value: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n /**\n * @deprecated set `disabled` on root Radio instead\n * Blocks access and changes to the form field\n */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IRadioCtx extends RadioCtx, UnknownProperties {}\nexport type RadioCtx = {\n getValueProps: PropGetterFn;\n getTextProps: PropGetterFn;\n};\n\ntype IntergalacticRadioGroupComponent<PropsExtending = {}> = (<\n Value extends RadioValue,\n Tag extends Intergalactic.Tag = typeof Flex,\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, typeof Flex, RadioGroupProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.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":"","ignoreList":[]}
package/lib/es6/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { default, wrapRadioGroup, RadioGroup } from './Radio';
2
- export * from './Radio.type';
1
+ export { default } from './Radio';
2
+ export * from './Radio';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","wrapRadioGroup","RadioGroup"],"sources":["../../src/index.ts"],"sourcesContent":["export { default, wrapRadioGroup, RadioGroup } from './Radio';\nexport * from './Radio.type';\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,cAAc,EAAEC,UAAU,QAAQ,SAAS;AAC7D,cAAc,cAAc","ignoreList":[]}
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","ignoreList":[]}
@@ -17,6 +17,16 @@ SRadio[disabled] {
17
17
  pointer-events: none;
18
18
  }
19
19
 
20
+ SText[size='m'] {
21
+ font-size: var(--intergalactic-fs-200, 14px);
22
+ line-height: var(--intergalactic-lh-200, 142%);
23
+ }
24
+
25
+ SText[size='l'] {
26
+ font-size: var(--intergalactic-fs-300, 16px);
27
+ line-height: var(--intergalactic-lh-300, 150%);
28
+ }
29
+
20
30
  SValue {
21
31
  position: relative;
22
32
  flex-shrink: 0;
@@ -86,7 +96,7 @@ SValue[state='normal']::before {
86
96
  }
87
97
 
88
98
  SValue[state='invalid']::before {
89
- border-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
99
+ border-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
90
100
  }
91
101
 
92
102
  SControl {
@@ -105,7 +115,7 @@ SControl:checked~SValue[size='l']::after {
105
115
  }
106
116
 
107
117
  SControl:focus-visible+SValue[state='normal']::before {
108
- border-color: var(--intergalactic-border-info-active, oklch(0.7 0.131 275.2));
118
+ border-color: var(--intergalactic-border-info-active, oklch(0.443 0.273 264.2 / 0.419));
109
119
  @mixin focus-outline-mixin;
110
120
  }
111
121
 
@@ -116,7 +126,7 @@ SControl:checked:focus-visible~SValue::before {
116
126
  }
117
127
 
118
128
  SControl:focus-visible+SValue[state='invalid']::before {
119
- border-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
129
+ border-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
120
130
  @mixin focus-outline-mixin;
121
131
  outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
122
132
  }
@@ -140,7 +150,7 @@ SInvalidPattern {
140
150
  top: 1px;
141
151
  left: 1px;
142
152
  border-radius: 50%;
143
- background-image: var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, oklch(0.7 0.21 23) 0, oklch(0.7 0.21 23) 1px, transparent 0, transparent 50%));
153
+ background-image: var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, oklch(0.628 0.258 29 / 0.56) 0, oklch(0.628 0.258 29 / 0.56) 1px, transparent 0, transparent 50%));
144
154
  background-size: 6px 6px;
145
155
  background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
146
156
  }