@semcore/button 4.0.13 → 4.0.16

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,24 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [4.0.16] - 2022-08-30
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.37.0 ~> 3.37.1]).
10
+
11
+ ## [4.0.15] - 2022-08-29
12
+
13
+ ### Fixed
14
+
15
+ - Fixed aria warning detection.
16
+
17
+ ## [4.0.14] - 2022-08-24
18
+
19
+ ### Fixed
20
+
21
+ - Update version `@semcore/utils` to use additional functions.
22
+
5
23
  ## [4.0.13] - 2022-08-19
6
24
 
7
25
  ### Added
@@ -72,7 +90,8 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
72
90
 
73
91
  ### Changed
74
92
 
75
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/flex-box` [4.5.1 ~> 4.5.3]).
93
+ - Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1]
94
+ , `@semcore/flex-box` [4.5.1 ~> 4.5.3]).
76
95
 
77
96
  ## [4.0.1] - 2022-05-19
78
97
 
package/lib/cjs/Button.js CHANGED
@@ -37,6 +37,8 @@ var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
37
37
 
38
38
  var _reactToText = _interopRequireDefault(require("@semcore/utils/lib/reactToText"));
39
39
 
40
+ var _getOriginChildren = _interopRequireDefault(require("@semcore/utils/lib/getOriginChildren"));
41
+
40
42
  var _SpinButton = _interopRequireDefault(require("./SpinButton"));
41
43
 
42
44
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -56,36 +58,36 @@ var style = (
56
58
  /*__reshadow_css_start__*/
57
59
  _core.sstyled.insert(
58
60
  /*__inner_css_start__*/
59
- ".___SButton_15cgj_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:Inter,sans-serif;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:500;color:#6c6e79}.___SButton_15cgj_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_15cgj_gg_:active,.___SButton_15cgj_gg_:focus,.___SButton_15cgj_gg_:hover{outline:0;text-decoration:none}.___SButton_15cgj_gg_.__disabled_15cgj_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_15cgj_gg_.__keyboardFocused_15cgj_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);z-index:1}.___SButton_15cgj_gg_._size_m_15cgj_gg_{height:28px;min-width:28px;border-radius:6px;font-size:14px}.___SButton_15cgj_gg_._size_l_15cgj_gg_{height:40px;min-width:40px;border-radius:6px;font-size:16px}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_{color:#ffffff;background-color:#008ff8}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_:hover{background-color:#006dca}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_.__active_15cgj_gg_{background-color:#044792}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_{color:#ffffff;background-color:#009f81}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_:hover{background-color:#007c65}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_.__active_15cgj_gg_{background-color:#055345}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_{background-color:#ff642d;color:#ffffff}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_:hover{background-color:#c33909}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_.__active_15cgj_gg_{background-color:#8b1500}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_{background-color:#ff4953;color:#ffffff}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_:hover{background-color:#d1002f}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_.__active_15cgj_gg_{background-color:#8e0016}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_{background-color:#fff;color:#191b23}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_:hover{background-color:#f4f5f9}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:#e0e1e9}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_{color:#6c6e79;border-color:#c4c7cf;background-color:rgba(138,142,155,.1)}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_{background-color:rgba(0,143,248,.05);color:#008ff8;border-color:#008ff8}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_:hover{background-color:rgba(0,109,202,.2)}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(0,109,202,.3)}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_{color:#006dca;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_:hover{background-color:rgba(0,143,248,.2)}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(0,143,248,.3)}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_{color:#6c6e79;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_{color:#fff;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15cgj_gg_._neighborLocation_right_15cgj_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_{border-radius:0;margin-left:-1px}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-danger_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-info_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-success_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-warning_15cgj_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-invert_15cgj_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-danger_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-info_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-success_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-warning_15cgj_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-invert_15cgj_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_15cgj_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_15cgj_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_15cgj_gg_.__loading_15cgj_gg_{visibility:hidden}.___SText_15cgj_gg_{display:inline-flex}.___SText_15cgj_gg_._size_m_15cgj_gg_{margin-left:8px;margin-right:8px;line-height:1.42}.___SText_15cgj_gg_._size_l_15cgj_gg_{margin-left:12px;margin-right:12px;line-height:1.5}.___SAddon_15cgj_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:only-child{margin-left:-4px;margin-right:-4px}"
61
+ ".___SButton_15f0y_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:Inter,sans-serif;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:500;color:#6c6e79}.___SButton_15f0y_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_15f0y_gg_:active,.___SButton_15f0y_gg_:focus,.___SButton_15f0y_gg_:hover{outline:0;text-decoration:none}.___SButton_15f0y_gg_.__disabled_15f0y_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_15f0y_gg_.__keyboardFocused_15f0y_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);z-index:1}.___SButton_15f0y_gg_._size_m_15f0y_gg_{height:28px;min-width:28px;border-radius:6px;font-size:14px}.___SButton_15f0y_gg_._size_l_15f0y_gg_{height:40px;min-width:40px;border-radius:6px;font-size:16px}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_{color:#ffffff;background-color:#008ff8}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_:hover{background-color:#006dca}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_.__active_15f0y_gg_{background-color:#044792}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_{color:#ffffff;background-color:#009f81}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_:hover{background-color:#007c65}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_.__active_15f0y_gg_{background-color:#055345}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_{background-color:#ff642d;color:#ffffff}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_:hover{background-color:#c33909}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_.__active_15f0y_gg_{background-color:#8b1500}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_{background-color:#ff4953;color:#ffffff}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_:hover{background-color:#d1002f}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_.__active_15f0y_gg_{background-color:#8e0016}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_{background-color:#fff;color:#191b23}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_:hover{background-color:#f4f5f9}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:#e0e1e9}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_{color:#6c6e79;border-color:#c4c7cf;background-color:rgba(138,142,155,.1)}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_{background-color:rgba(0,143,248,.05);color:#008ff8;border-color:#008ff8}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_:hover{background-color:rgba(0,109,202,.2)}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(0,109,202,.3)}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_{color:#006dca;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_:hover{background-color:rgba(0,143,248,.2)}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(0,143,248,.3)}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_{color:#6c6e79;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_{color:#fff;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15f0y_gg_._neighborLocation_right_15f0y_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_{border-radius:0;margin-left:-1px}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-danger_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-info_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-success_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-warning_15f0y_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-invert_15f0y_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-danger_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-info_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-success_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-warning_15f0y_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-invert_15f0y_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_15f0y_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_15f0y_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_15f0y_gg_.__loading_15f0y_gg_{visibility:hidden}.___SText_15f0y_gg_{display:inline-flex}.___SText_15f0y_gg_._size_m_15f0y_gg_{margin-left:8px;margin-right:8px;line-height:1.42}.___SText_15f0y_gg_._size_l_15f0y_gg_{margin-left:12px;margin-right:12px;line-height:1.5}.___SAddon_15f0y_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:only-child{margin-left:-4px;margin-right:-4px}"
60
62
  /*__inner_css_end__*/
61
- , "15cgj_gg_")
63
+ , "15f0y_gg_")
62
64
  /*__reshadow_css_end__*/
63
65
  , {
64
- "__SButton": "___SButton_15cgj_gg_",
65
- "_disabled": "__disabled_15cgj_gg_",
66
- "_keyboardFocused": "__keyboardFocused_15cgj_gg_",
67
- "_size_m": "_size_m_15cgj_gg_",
68
- "_size_l": "_size_l_15cgj_gg_",
69
- "_theme_primary-info": "_theme_primary-info_15cgj_gg_",
70
- "_active": "__active_15cgj_gg_",
71
- "_theme_primary-success": "_theme_primary-success_15cgj_gg_",
72
- "_theme_primary-warning": "_theme_primary-warning_15cgj_gg_",
73
- "_theme_primary-danger": "_theme_primary-danger_15cgj_gg_",
74
- "_theme_primary-invert": "_theme_primary-invert_15cgj_gg_",
75
- "_theme_secondary-muted": "_theme_secondary-muted_15cgj_gg_",
76
- "_theme_secondary-info": "_theme_secondary-info_15cgj_gg_",
77
- "_theme_secondary-invert": "_theme_secondary-invert_15cgj_gg_",
78
- "_theme_tertiary-info": "_theme_tertiary-info_15cgj_gg_",
79
- "_theme_tertiary-muted": "_theme_tertiary-muted_15cgj_gg_",
80
- "_theme_tertiary-invert": "_theme_tertiary-invert_15cgj_gg_",
81
- "_neighborLocation_right": "_neighborLocation_right_15cgj_gg_",
82
- "_neighborLocation_both": "_neighborLocation_both_15cgj_gg_",
83
- "_neighborLocation_left": "_neighborLocation_left_15cgj_gg_",
84
- "__SSpin": "___SSpin_15cgj_gg_",
85
- "__SInner": "___SInner_15cgj_gg_",
86
- "_loading": "__loading_15cgj_gg_",
87
- "__SText": "___SText_15cgj_gg_",
88
- "__SAddon": "___SAddon_15cgj_gg_"
66
+ "__SButton": "___SButton_15f0y_gg_",
67
+ "_disabled": "__disabled_15f0y_gg_",
68
+ "_keyboardFocused": "__keyboardFocused_15f0y_gg_",
69
+ "_size_m": "_size_m_15f0y_gg_",
70
+ "_size_l": "_size_l_15f0y_gg_",
71
+ "_theme_primary-info": "_theme_primary-info_15f0y_gg_",
72
+ "_active": "__active_15f0y_gg_",
73
+ "_theme_primary-success": "_theme_primary-success_15f0y_gg_",
74
+ "_theme_primary-warning": "_theme_primary-warning_15f0y_gg_",
75
+ "_theme_primary-danger": "_theme_primary-danger_15f0y_gg_",
76
+ "_theme_primary-invert": "_theme_primary-invert_15f0y_gg_",
77
+ "_theme_secondary-muted": "_theme_secondary-muted_15f0y_gg_",
78
+ "_theme_secondary-info": "_theme_secondary-info_15f0y_gg_",
79
+ "_theme_secondary-invert": "_theme_secondary-invert_15f0y_gg_",
80
+ "_theme_tertiary-info": "_theme_tertiary-info_15f0y_gg_",
81
+ "_theme_tertiary-muted": "_theme_tertiary-muted_15f0y_gg_",
82
+ "_theme_tertiary-invert": "_theme_tertiary-invert_15f0y_gg_",
83
+ "_neighborLocation_right": "_neighborLocation_right_15f0y_gg_",
84
+ "_neighborLocation_both": "_neighborLocation_both_15f0y_gg_",
85
+ "_neighborLocation_left": "_neighborLocation_left_15f0y_gg_",
86
+ "__SSpin": "___SSpin_15f0y_gg_",
87
+ "__SInner": "___SInner_15f0y_gg_",
88
+ "_loading": "__loading_15f0y_gg_",
89
+ "__SText": "___SText_15f0y_gg_",
90
+ "__SAddon": "___SAddon_15f0y_gg_"
89
91
  });
90
92
  var MAP_USE_DEFAULT_THEME = {
91
93
  primary: 'info',
@@ -143,7 +145,7 @@ var RootButton = /*#__PURE__*/function (_Component) {
143
145
  addonRight = _this$asProps.addonRight,
144
146
  ariaLabel = _this$asProps['aria-label'];
145
147
  var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
146
- var isTextInside = (0, _reactToText["default"])(Children);
148
+ var isTextInside = (0, _reactToText["default"])((0, _getOriginChildren["default"])(Children));
147
149
 
148
150
  _logger["default"].warn(!isTextInside && !ariaLabel, 'aria-label is required', this.asProps['data-ui-name'] || Button.displayName);
149
151
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","Box","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","ariaLabel","useTheme","isTextInside","reactToText","logger","warn","Button","displayName","sstyled","addonTextChildren","Text","Addon","Component","keyboardFocusEnhance","neighborLocationEnhance","style","props","SText","SAddon","createComponent"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport reactToText from '@semcore/utils/lib/reactToText';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n 'aria-label': ariaLabel,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n\n const isTextInside = reactToText(Children);\n\n logger.warn(\n !isTextInside && !ariaLabel,\n 'aria-label is required',\n this.asProps['data-ui-name'] || Button.displayName,\n );\n\n return sstyled(styles)(\n <SButton\n render={Box}\n type=\"button\"\n tag=\"button\"\n disabled={disabled}\n use:theme={useTheme}\n role=\"button\"\n >\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,qBAAqB,GAAG;EACnCC,OAAO,EAAE,MAD0B;EAEnCC,SAAS,EAAE,OAFwB;EAGnCC,QAAQ,EAAE;AAHyB,CAA9B;;;IAMDC,U;;;;;;;;;;;;WASJ,wBAAe;MACb,IAAQC,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,yBAAgB;MACd,IAAQA,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,k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AAM,CAACK,KAAhD,CAFH,EAGGZ,UAAU,gBAAG,gCAAC,MAAD,CAAQ,KAAR;QAAc,GAAG,EAAEA;MAAnB,EAAH,GAAuC,IAHpD,CARF,EAaGH,OAAO,iBACN,gCAAC,KAAD;QAAA,OAAW;MAAX,iBACE,gCAAC,sBAAD;QAAA;QAAA,QAA2BV,IAA3B;QAAA,SAAwCe;MAAxC,GADF,CAdJ,CADF;IAqBD;;;EAvEsBW,e;;iCAAnB3B,U,iBACiB,Q;iCADjBA,U,aAEa,CAAC,IAAA4B,gCAAA,GAAD,EAAyB,IAAAC,yCAAA,GAAzB,C;iCAFb7B,U,WAGW8B,K;iCAHX9B,U,kBAIkB;EACpBS,GAAG,EAAE,WADe;EAEpBR,IAAI,EAAE;AAFc,C;;AAsExB,SAASwB,IAAT,CAAcM,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMC,KAAK,GACiC5B,YAD5C;EACA,eAAO,IAAAmB,aAAA,EAAQQ,KAAK,CAACvB,MAAd,CAAP,eAA6B,gCAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASkB,KAAT,CAAeK,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAME,MAAM,GACiC7B,YAD7C;EACA,eAAO,IAAAmB,aAAA,EAAQQ,KAAK,CAACvB,MAAd,CAAP,eAA6B,gCAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMa,MAAM,GAAG,IAAAa,gBAAA,EAAgBlC,UAAhB,EAA4B;EACzCyB,IAAI,EAAJA,IADyC;EAEzCC,KAAK,EAALA;AAFyC,CAA5B,CAAf;eAKeL,M"}
1
+ {"version":3,"file":"Button.js","names":["MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","Box","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","ariaLabel","useTheme","isTextInside","reactToText","getOriginChildren","logger","warn","Button","displayName","sstyled","addonTextChildren","Text","Addon","Component","keyboardFocusEnhance","neighborLocationEnhance","style","props","SText","SAddon","createComponent"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport reactToText from '@semcore/utils/lib/reactToText';\nimport getOriginChildren from '@semcore/utils/lib/getOriginChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n 'aria-label': ariaLabel,\n } = this.asProps;\n const useTheme = use && theme ? `${use}-${theme}` : false;\n const isTextInside = reactToText(getOriginChildren(Children));\n\n logger.warn(\n !isTextInside && !ariaLabel,\n 'aria-label is required',\n this.asProps['data-ui-name'] || Button.displayName,\n );\n\n return sstyled(styles)(\n <SButton\n render={Box}\n type=\"button\"\n tag=\"button\"\n disabled={disabled}\n use:theme={useTheme}\n role=\"button\"\n >\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,qBAAqB,GAAG;EACnCC,OAAO,EAAE,MAD0B;EAEnCC,SAAS,EAAE,OAFwB;EAGnCC,QAAQ,EAAE;AAHyB,CAA9B;;;IAMDC,U;;;;;;;;;;;;WASJ,wBAAe;MACb,IAAQC,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,yBAAgB;MACd,IAAQA,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAME,OAAO,GA0BDC,YA1BZ;MACA,IAAMC,MAAM,GAAGD,YAAf;MACA,IAAME,KAAK,GAAGF,YAAd;MACA,oBAWI,KAAKF,OAXT;MAAA,IACEK,QADF,iBACEA,QADF;MAAA,IAEEC,MAFF,iBAEEA,MAFF;MAAA,IAGEC,GAHF,iBAGEA,GAHF;MAAA,wCAIEC,KAJF;MAAA,IAIEA,KAJF,oCAIU,OAAOD,GAAP,KAAe,QAAf,IAA2Bb,qBAAqB,CAACa,GAAD,CAJ1D;MAAA,IAKEE,OALF,iBAKEA,OALF;MAA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AAyB,IAAAC,yCAAA,GAAzB,C;iCAFb9B,U,WAGW+B,K;iCAHX/B,U,kBAIkB;EACpBS,GAAG,EAAE,WADe;EAEpBR,IAAI,EAAE;AAFc,C;;AAoExB,SAASyB,IAAT,CAAcM,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMC,KAAK,GACiC7B,YAD5C;EACA,eAAO,IAAAoB,aAAA,EAAQQ,KAAK,CAACxB,MAAd,CAAP,eAA6B,gCAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASmB,KAAT,CAAeK,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAME,MAAM,GACiC9B,YAD7C;EACA,eAAO,IAAAoB,aAAA,EAAQQ,KAAK,CAACxB,MAAd,CAAP,eAA6B,gCAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMc,MAAM,GAAG,IAAAa,gBAAA,EAAgBnC,UAAhB,EAA4B;EACzC0B,IAAI,EAAJA,IADyC;EAEzCC,KAAK,EAALA;AAFyC,CAA5B,CAAf;eAKeL,M"}
package/lib/es6/Button.js CHANGED
@@ -25,6 +25,7 @@ import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhan
25
25
  import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
26
26
  import logger from '@semcore/utils/lib/logger';
27
27
  import reactToText from '@semcore/utils/lib/reactToText';
28
+ import getOriginChildren from '@semcore/utils/lib/getOriginChildren';
28
29
  import SpinButton from './SpinButton';
29
30
 
30
31
  /*__reshadow-styles__:"./style/button.shadow.css"*/
@@ -32,36 +33,36 @@ var style = (
32
33
  /*__reshadow_css_start__*/
33
34
  _sstyled.insert(
34
35
  /*__inner_css_start__*/
35
- ".___SButton_15cgj_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:Inter,sans-serif;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:500;color:#6c6e79}.___SButton_15cgj_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_15cgj_gg_:active,.___SButton_15cgj_gg_:focus,.___SButton_15cgj_gg_:hover{outline:0;text-decoration:none}.___SButton_15cgj_gg_.__disabled_15cgj_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_15cgj_gg_.__keyboardFocused_15cgj_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);z-index:1}.___SButton_15cgj_gg_._size_m_15cgj_gg_{height:28px;min-width:28px;border-radius:6px;font-size:14px}.___SButton_15cgj_gg_._size_l_15cgj_gg_{height:40px;min-width:40px;border-radius:6px;font-size:16px}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_{color:#ffffff;background-color:#008ff8}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_:hover{background-color:#006dca}.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-info_15cgj_gg_.__active_15cgj_gg_{background-color:#044792}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_{color:#ffffff;background-color:#009f81}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_:hover{background-color:#007c65}.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-success_15cgj_gg_.__active_15cgj_gg_{background-color:#055345}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_{background-color:#ff642d;color:#ffffff}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_:hover{background-color:#c33909}.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-warning_15cgj_gg_.__active_15cgj_gg_{background-color:#8b1500}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_{background-color:#ff4953;color:#ffffff}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_:hover{background-color:#d1002f}.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-danger_15cgj_gg_.__active_15cgj_gg_{background-color:#8e0016}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_{background-color:#fff;color:#191b23}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_:hover{background-color:#f4f5f9}.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_primary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:#e0e1e9}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_{color:#6c6e79;border-color:#c4c7cf;background-color:rgba(138,142,155,.1)}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-muted_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_{background-color:rgba(0,143,248,.05);color:#008ff8;border-color:#008ff8}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_:hover{background-color:rgba(0,109,202,.2)}.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-info_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(0,109,202,.3)}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_secondary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_{color:#006dca;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_:hover{background-color:rgba(0,143,248,.2)}.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-info_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(0,143,248,.3)}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_{color:#6c6e79;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-muted_15cgj_gg_.__active_15cgj_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_{color:#fff;background-color:transparent}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_:active,.___SButton_15cgj_gg_._theme_tertiary-invert_15cgj_gg_.__active_15cgj_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15cgj_gg_._neighborLocation_right_15cgj_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_{border-radius:0;margin-left:-1px}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-danger_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-info_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-success_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-warning_15cgj_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15cgj_gg_._neighborLocation_both_15cgj_gg_._theme_primary-invert_15cgj_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-danger_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-info_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-success_15cgj_gg_,.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-warning_15cgj_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15cgj_gg_._neighborLocation_left_15cgj_gg_._theme_primary-invert_15cgj_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_15cgj_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_15cgj_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_15cgj_gg_.__loading_15cgj_gg_{visibility:hidden}.___SText_15cgj_gg_{display:inline-flex}.___SText_15cgj_gg_._size_m_15cgj_gg_{margin-left:8px;margin-right:8px;line-height:1.42}.___SText_15cgj_gg_._size_l_15cgj_gg_{margin-left:12px;margin-right:12px;line-height:1.5}.___SAddon_15cgj_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15cgj_gg_._size_m_15cgj_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15cgj_gg_._size_l_15cgj_gg_:only-child{margin-left:-4px;margin-right:-4px}"
36
+ ".___SButton_15f0y_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:Inter,sans-serif;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:500;color:#6c6e79}.___SButton_15f0y_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_15f0y_gg_:active,.___SButton_15f0y_gg_:focus,.___SButton_15f0y_gg_:hover{outline:0;text-decoration:none}.___SButton_15f0y_gg_.__disabled_15f0y_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_15f0y_gg_.__keyboardFocused_15f0y_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2);z-index:1}.___SButton_15f0y_gg_._size_m_15f0y_gg_{height:28px;min-width:28px;border-radius:6px;font-size:14px}.___SButton_15f0y_gg_._size_l_15f0y_gg_{height:40px;min-width:40px;border-radius:6px;font-size:16px}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_{color:#ffffff;background-color:#008ff8}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_:hover{background-color:#006dca}.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-info_15f0y_gg_.__active_15f0y_gg_{background-color:#044792}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_{color:#ffffff;background-color:#009f81}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_:hover{background-color:#007c65}.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-success_15f0y_gg_.__active_15f0y_gg_{background-color:#055345}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_{background-color:#ff642d;color:#ffffff}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_:hover{background-color:#c33909}.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-warning_15f0y_gg_.__active_15f0y_gg_{background-color:#8b1500}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_{background-color:#ff4953;color:#ffffff}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_:hover{background-color:#d1002f}.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-danger_15f0y_gg_.__active_15f0y_gg_{background-color:#8e0016}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_{background-color:#fff;color:#191b23}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_:hover{background-color:#f4f5f9}.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_primary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:#e0e1e9}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_{color:#6c6e79;border-color:#c4c7cf;background-color:rgba(138,142,155,.1)}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-muted_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_{background-color:rgba(0,143,248,.05);color:#008ff8;border-color:#008ff8}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_:hover{background-color:rgba(0,109,202,.2)}.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-info_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(0,109,202,.3)}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_secondary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_{color:#006dca;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_:hover{background-color:rgba(0,143,248,.2)}.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-info_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(0,143,248,.3)}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_{color:#6c6e79;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_:hover{background-color:rgba(138,142,155,.2);color:#191b23}.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-muted_15f0y_gg_.__active_15f0y_gg_{background-color:rgba(138,142,155,.3);color:#191b23}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_{color:#fff;background-color:transparent}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_:hover{background-color:hsla(0,0%,100%,.1)}.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_:active,.___SButton_15f0y_gg_._theme_tertiary-invert_15f0y_gg_.__active_15f0y_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_15f0y_gg_._neighborLocation_right_15f0y_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_{border-radius:0;margin-left:-1px}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-danger_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-info_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-success_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-warning_15f0y_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15f0y_gg_._neighborLocation_both_15f0y_gg_._theme_primary-invert_15f0y_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-danger_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-info_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-success_15f0y_gg_,.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-warning_15f0y_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_15f0y_gg_._neighborLocation_left_15f0y_gg_._theme_primary-invert_15f0y_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_15f0y_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_15f0y_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_15f0y_gg_.__loading_15f0y_gg_{visibility:hidden}.___SText_15f0y_gg_{display:inline-flex}.___SText_15f0y_gg_._size_m_15f0y_gg_{margin-left:8px;margin-right:8px;line-height:1.42}.___SText_15f0y_gg_._size_l_15f0y_gg_{margin-left:12px;margin-right:12px;line-height:1.5}.___SAddon_15f0y_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15f0y_gg_._size_m_15f0y_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_15f0y_gg_._size_l_15f0y_gg_:only-child{margin-left:-4px;margin-right:-4px}"
36
37
  /*__inner_css_end__*/
37
- , "15cgj_gg_")
38
+ , "15f0y_gg_")
38
39
  /*__reshadow_css_end__*/
39
40
  , {
40
- "__SButton": "___SButton_15cgj_gg_",
41
- "_disabled": "__disabled_15cgj_gg_",
42
- "_keyboardFocused": "__keyboardFocused_15cgj_gg_",
43
- "_size_m": "_size_m_15cgj_gg_",
44
- "_size_l": "_size_l_15cgj_gg_",
45
- "_theme_primary-info": "_theme_primary-info_15cgj_gg_",
46
- "_active": "__active_15cgj_gg_",
47
- "_theme_primary-success": "_theme_primary-success_15cgj_gg_",
48
- "_theme_primary-warning": "_theme_primary-warning_15cgj_gg_",
49
- "_theme_primary-danger": "_theme_primary-danger_15cgj_gg_",
50
- "_theme_primary-invert": "_theme_primary-invert_15cgj_gg_",
51
- "_theme_secondary-muted": "_theme_secondary-muted_15cgj_gg_",
52
- "_theme_secondary-info": "_theme_secondary-info_15cgj_gg_",
53
- "_theme_secondary-invert": "_theme_secondary-invert_15cgj_gg_",
54
- "_theme_tertiary-info": "_theme_tertiary-info_15cgj_gg_",
55
- "_theme_tertiary-muted": "_theme_tertiary-muted_15cgj_gg_",
56
- "_theme_tertiary-invert": "_theme_tertiary-invert_15cgj_gg_",
57
- "_neighborLocation_right": "_neighborLocation_right_15cgj_gg_",
58
- "_neighborLocation_both": "_neighborLocation_both_15cgj_gg_",
59
- "_neighborLocation_left": "_neighborLocation_left_15cgj_gg_",
60
- "__SSpin": "___SSpin_15cgj_gg_",
61
- "__SInner": "___SInner_15cgj_gg_",
62
- "_loading": "__loading_15cgj_gg_",
63
- "__SText": "___SText_15cgj_gg_",
64
- "__SAddon": "___SAddon_15cgj_gg_"
41
+ "__SButton": "___SButton_15f0y_gg_",
42
+ "_disabled": "__disabled_15f0y_gg_",
43
+ "_keyboardFocused": "__keyboardFocused_15f0y_gg_",
44
+ "_size_m": "_size_m_15f0y_gg_",
45
+ "_size_l": "_size_l_15f0y_gg_",
46
+ "_theme_primary-info": "_theme_primary-info_15f0y_gg_",
47
+ "_active": "__active_15f0y_gg_",
48
+ "_theme_primary-success": "_theme_primary-success_15f0y_gg_",
49
+ "_theme_primary-warning": "_theme_primary-warning_15f0y_gg_",
50
+ "_theme_primary-danger": "_theme_primary-danger_15f0y_gg_",
51
+ "_theme_primary-invert": "_theme_primary-invert_15f0y_gg_",
52
+ "_theme_secondary-muted": "_theme_secondary-muted_15f0y_gg_",
53
+ "_theme_secondary-info": "_theme_secondary-info_15f0y_gg_",
54
+ "_theme_secondary-invert": "_theme_secondary-invert_15f0y_gg_",
55
+ "_theme_tertiary-info": "_theme_tertiary-info_15f0y_gg_",
56
+ "_theme_tertiary-muted": "_theme_tertiary-muted_15f0y_gg_",
57
+ "_theme_tertiary-invert": "_theme_tertiary-invert_15f0y_gg_",
58
+ "_neighborLocation_right": "_neighborLocation_right_15f0y_gg_",
59
+ "_neighborLocation_both": "_neighborLocation_both_15f0y_gg_",
60
+ "_neighborLocation_left": "_neighborLocation_left_15f0y_gg_",
61
+ "__SSpin": "___SSpin_15f0y_gg_",
62
+ "__SInner": "___SInner_15f0y_gg_",
63
+ "_loading": "__loading_15f0y_gg_",
64
+ "__SText": "___SText_15f0y_gg_",
65
+ "__SAddon": "___SAddon_15f0y_gg_"
65
66
  });
66
67
  export var MAP_USE_DEFAULT_THEME = {
67
68
  primary: 'info',
@@ -119,7 +120,7 @@ var RootButton = /*#__PURE__*/function (_Component) {
119
120
  addonRight = _this$asProps.addonRight,
120
121
  ariaLabel = _this$asProps['aria-label'];
121
122
  var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
122
- var isTextInside = reactToText(Children);
123
+ var isTextInside = reactToText(getOriginChildren(Children));
123
124
  logger.warn(!isTextInside && !ariaLabel, 'aria-label is required', this.asProps['data-ui-name'] || Button.displayName);
124
125
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref4.cn("SButton", _objectSpread({}, _assignProps({
125
126
  "type": "button",
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["React","createComponent","Component","sstyled","Root","Box","neighborLocationEnhance","keyboardFocusEnhance","addonTextChildren","logger","reactToText","SpinButton","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","ariaLabel","useTheme","isTextInside","warn","Button","displayName","Text","Addon","style","props","SText","SAddon"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport reactToText from '@semcore/utils/lib/reactToText';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n 'aria-label': ariaLabel,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n\n const isTextInside = reactToText(Children);\n\n logger.warn(\n !isTextInside && !ariaLabel,\n 'aria-label is required',\n this.asProps['data-ui-name'] || Button.displayName,\n );\n\n return sstyled(styles)(\n <SButton\n render={Box}\n type=\"button\"\n tag=\"button\"\n disabled={disabled}\n use:theme={useTheme}\n role=\"button\"\n >\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,OAAOC,WAAP,MAAwB,gCAAxB;AACA,OAAOC,UAAP,MAAuB,cAAvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,IAAMC,qBAAqB,GAAG;EACnCC,OAAO,EAAE,MAD0B;EAEnCC,SAAS,EAAE,OAFwB;EAGnCC,QAAQ,EAAE;AAHyB,CAA9B;;IAMDC,U;;;;;;;;;;;;;WASJ,wBAAe;MACb,IAAQC,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,yBAAgB;MACd,IAAQA,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CA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AACG,KAA/B,CAFpB,EAGGR,UAAU,gBAAG,oBAAC,MAAD,CAAQ,KAAR;QAAc,GAAG,EAAEA;MAAnB,EAAH,GAAuC,IAHpD,CARF,EAaGH,OAAO,iBACN,oBAAC,KAAD;QAAA,OAAW;MAAX,iBACE,oBAAC,UAAD;QAAA;QAAA,QAA2BT,IAA3B;QAAA,SAAwCc;MAAxC,GADF,CAdJ,CADF;IAqBD;;;;EAvEsB7B,S;;gBAAnBc,U,iBACiB,Q;;gBADjBA,U,aAEa,CAACT,oBAAoB,EAArB,EAAyBD,uBAAuB,EAAhD,C;;gBAFbU,U,WAGWsB,K;;gBAHXtB,U,kBAIkB;EACpBQ,GAAG,EAAE,WADe;EAEpBP,IAAI,EAAE;AAFc,C;;AAsExB,SAASmB,IAAT,CAAcG,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMC,KAAK,GACiCnC,GAD5C;EACA,eAAOF,OAAO,CAACoC,KAAK,CAAChB,MAAP,CAAd,eAA6B,oBAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASc,KAAT,CAAeE,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAME,MAAM,GACiCpC,GAD7C;EACA,eAAOF,OAAO,CAACoC,KAAK,CAAChB,MAAP,CAAd,eAA6B,oBAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMW,MAAM,GAAGjC,eAAe,CAACe,UAAD,EAAa;EACzCoB,IAAI,EAAJA,IADyC;EAEzCC,KAAK,EAALA;AAFyC,CAAb,CAA9B;AAKA,eAAeH,MAAf"}
1
+ {"version":3,"file":"Button.js","names":["React","createComponent","Component","sstyled","Root","Box","neighborLocationEnhance","keyboardFocusEnhance","addonTextChildren","logger","reactToText","getOriginChildren","SpinButton","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","ariaLabel","useTheme","isTextInside","warn","Button","displayName","Text","Addon","style","props","SText","SAddon"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport reactToText from '@semcore/utils/lib/reactToText';\nimport getOriginChildren from '@semcore/utils/lib/getOriginChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n 'aria-label': ariaLabel,\n } = this.asProps;\n const useTheme = use && theme ? `${use}-${theme}` : false;\n const isTextInside = reactToText(getOriginChildren(Children));\n\n logger.warn(\n !isTextInside && !ariaLabel,\n 'aria-label is required',\n this.asProps['data-ui-name'] || Button.displayName,\n );\n\n return sstyled(styles)(\n <SButton\n render={Box}\n type=\"button\"\n tag=\"button\"\n disabled={disabled}\n use:theme={useTheme}\n role=\"button\"\n >\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,OAAOC,WAAP,MAAwB,gCAAxB;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,UAAP,MAAuB,cAAvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,IAAMC,qBAAqB,GAAG;EACnCC,OAAO,EAAE,MAD0B;EAEnCC,SAAS,EAAE,OAFwB;EAGnCC,QAAQ,EAAE;AAHyB,CAA9B;;IAMDC,U;;;;;;;;;;;;;WASJ,wBAAe;MACb,IAAQC,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,yBAAgB;MACd,IAAQA,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;MACA,OAAO;QACLA,IAAI,EAAJA;MADK,CAAP;IAGD;;;WAED,kBAAS;MAAA;MAAA;;MACP,IAAME,OAAO,GA0BDf,GA1BZ;MACA,IAAMgB,MAAM,GAAGhB,GAAf;MACA,IAA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B,EAAH,GAAuC,IAHpD,CARF,EAaGH,OAAO,iBACN,oBAAC,KAAD;QAAA,OAAW;MAAX,iBACE,oBAAC,UAAD;QAAA;QAAA,QAA2BT,IAA3B;QAAA,SAAwCc;MAAxC,GADF,CAdJ,CADF;IAqBD;;;;EArEsB9B,S;;gBAAnBe,U,iBACiB,Q;;gBADjBA,U,aAEa,CAACV,oBAAoB,EAArB,EAAyBD,uBAAuB,EAAhD,C;;gBAFbW,U,WAGWsB,K;;gBAHXtB,U,kBAIkB;EACpBQ,GAAG,EAAE,WADe;EAEpBP,IAAI,EAAE;AAFc,C;;AAoExB,SAASmB,IAAT,CAAcG,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMC,KAAK,GACiCpC,GAD5C;EACA,eAAOF,OAAO,CAACqC,KAAK,CAAChB,MAAP,CAAd,eAA6B,oBAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASc,KAAT,CAAeE,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAME,MAAM,GACiCrC,GAD7C;EACA,eAAOF,OAAO,CAACqC,KAAK,CAAChB,MAAP,CAAd,eAA6B,oBAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMW,MAAM,GAAGlC,eAAe,CAACgB,UAAD,EAAa;EACzCoB,IAAI,EAAJA,IADyC;EAEzCC,KAAK,EAALA;AAFyC,CAAb,CAA9B;AAKA,eAAeH,MAAf"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/button",
3
3
  "description": "Semrush Button Component",
4
- "version": "4.0.13",
4
+ "version": "4.0.16",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "test": "jest"
14
14
  },
15
15
  "dependencies": {
16
- "@semcore/utils": "^3.15",
16
+ "@semcore/utils": "^3.37",
17
17
  "@semcore/spin": "^4",
18
18
  "@semcore/neighbor-location": "^2",
19
19
  "@semcore/flex-box": "^4"
package/src/Button.jsx CHANGED
@@ -6,6 +6,7 @@ import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhan
6
6
  import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
7
7
  import logger from '@semcore/utils/lib/logger';
8
8
  import reactToText from '@semcore/utils/lib/reactToText';
9
+ import getOriginChildren from '@semcore/utils/lib/getOriginChildren';
9
10
  import SpinButton from './SpinButton';
10
11
 
11
12
  import style from './style/button.shadow.css';
@@ -55,10 +56,8 @@ class RootButton extends Component {
55
56
  addonRight,
56
57
  'aria-label': ariaLabel,
57
58
  } = this.asProps;
58
-
59
59
  const useTheme = use && theme ? `${use}-${theme}` : false;
60
-
61
- const isTextInside = reactToText(Children);
60
+ const isTextInside = reactToText(getOriginChildren(Children));
62
61
 
63
62
  logger.warn(
64
63
  !isTextInside && !ariaLabel,