@salutejs/plasma-core 1.226.1-next-sbcom.0 → 1.227.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/__helpers/IconPlaceholder.js +6 -9
  2. package/__helpers/index.js +1 -1
  3. package/collectPackageInfo.js +4 -4
  4. package/components/Badge/Badge.js +30 -103
  5. package/components/Badge/index.js +1 -1
  6. package/components/Basebox/Basebox.js +33 -42
  7. package/components/Basebox/index.js +1 -1
  8. package/components/Button/Button.js +28 -67
  9. package/components/Button/Button.mixins.js +22 -76
  10. package/components/Button/Button.props.js +5 -5
  11. package/components/Button/createButton.js +14 -145
  12. package/components/Button/index.js +4 -4
  13. package/components/Card/Card.js +34 -162
  14. package/components/Card/CardBody.js +4 -4
  15. package/components/Card/CardContent.js +14 -23
  16. package/components/Card/CardMedia.js +20 -91
  17. package/components/Card/CardPrice.js +18 -60
  18. package/components/Card/CardTypography.js +43 -52
  19. package/components/Card/index.js +5 -5
  20. package/components/Carousel/Carousel.js +46 -64
  21. package/components/Carousel/CarouselItem.js +21 -93
  22. package/components/Carousel/hooks.js +62 -121
  23. package/components/Carousel/index.js +3 -3
  24. package/components/Carousel/utils.js +59 -73
  25. package/components/Fade/Fade.js +6 -9
  26. package/components/Fade/index.js +1 -1
  27. package/components/Field/Field.js +48 -63
  28. package/components/Field/Field.statuses.js +3 -3
  29. package/components/Field/index.js +2 -2
  30. package/components/Image/Image.js +34 -115
  31. package/components/Image/index.js +1 -1
  32. package/components/Input/Input.js +7 -7
  33. package/components/Input/Input.mixins.js +9 -12
  34. package/components/Input/index.js +1 -1
  35. package/components/ModalBase/ModalBase.js +22 -100
  36. package/components/ModalBase/ModalBaseContext.js +6 -9
  37. package/components/ModalBase/ModalOverlay.js +28 -111
  38. package/components/ModalBase/hooks.js +15 -43
  39. package/components/ModalBase/index.js +2 -2
  40. package/components/PaginationDots/PaginationDot.js +11 -17
  41. package/components/PaginationDots/PaginationDots.js +4 -7
  42. package/components/PaginationDots/index.js +3 -3
  43. package/components/PaginationDots/usePaginationDots.js +10 -11
  44. package/components/Popup/Popup.js +52 -205
  45. package/components/Popup/index.js +1 -1
  46. package/components/PopupBase/PopupBase.js +35 -169
  47. package/components/PopupBase/PopupBaseContext.js +26 -86
  48. package/components/PopupBase/PopupBaseRoot.js +31 -169
  49. package/components/PopupBase/hooks.js +23 -97
  50. package/components/PopupBase/index.js +3 -3
  51. package/components/PopupBase/utils.js +32 -78
  52. package/components/Price/Price.js +15 -90
  53. package/components/Price/index.js +1 -1
  54. package/components/RadioGroup/RadioGroup.js +6 -127
  55. package/components/RadioGroup/index.js +1 -1
  56. package/components/SSRProvider/SSRProvider.js +4 -5
  57. package/components/SSRProvider/index.js +1 -1
  58. package/components/Skeleton/LineSkeleton.js +23 -95
  59. package/components/Skeleton/RectSkeleton.js +20 -93
  60. package/components/Skeleton/Skeleton.js +2 -2
  61. package/components/Skeleton/TextSkeleton.js +11 -55
  62. package/components/Skeleton/index.js +3 -3
  63. package/components/Slider/Double.js +52 -203
  64. package/components/Slider/Handle.js +28 -158
  65. package/components/Slider/Single.js +29 -177
  66. package/components/Slider/Slider.js +5 -7
  67. package/components/Slider/SliderBase.js +39 -48
  68. package/components/Slider/ThumbBase.js +19 -95
  69. package/components/Slider/index.js +3 -3
  70. package/components/Slider/utils.js +2 -2
  71. package/components/Spinner/Spinner.js +28 -100
  72. package/components/Spinner/SpinnerSvg.js +9 -78
  73. package/components/Spinner/index.js +1 -1
  74. package/components/Switch/Switch.js +49 -220
  75. package/components/Switch/index.js +1 -1
  76. package/components/Tabs/TabItem.js +33 -168
  77. package/components/Tabs/Tabs.js +32 -170
  78. package/components/Tabs/TabsContext.js +12 -42
  79. package/components/Tabs/createTabsController.js +33 -168
  80. package/components/Tabs/index.js +4 -4
  81. package/components/TextArea/TextArea.js +20 -30
  82. package/components/TextArea/index.js +1 -1
  83. package/components/TextField/index.js +3 -3
  84. package/components/Toast/Toast.js +15 -16
  85. package/components/Toast/ToastContext.js +4 -8
  86. package/components/Toast/ToastController.js +44 -101
  87. package/components/Toast/ToastProvider.js +37 -142
  88. package/components/Toast/index.js +3 -3
  89. package/components/Toast/useToast.js +6 -6
  90. package/components/Typography/Body.js +18 -18
  91. package/components/Typography/Button.js +13 -13
  92. package/components/Typography/Caption.js +8 -8
  93. package/components/Typography/Display.js +18 -18
  94. package/components/Typography/Footnote.js +13 -13
  95. package/components/Typography/Headline.js +43 -43
  96. package/components/Typography/Paragraph.js +24 -24
  97. package/components/Typography/Underline.js +8 -8
  98. package/es/__helpers/IconPlaceholder.js +5 -8
  99. package/es/collectPackageInfo.js +3 -3
  100. package/es/components/Badge/Badge.js +27 -100
  101. package/es/components/Basebox/Basebox.js +28 -37
  102. package/es/components/Button/Button.js +24 -63
  103. package/es/components/Button/Button.mixins.js +19 -73
  104. package/es/components/Button/Button.props.js +3 -3
  105. package/es/components/Button/createButton.js +12 -143
  106. package/es/components/Card/Card.js +29 -157
  107. package/es/components/Card/CardBody.js +2 -2
  108. package/es/components/Card/CardContent.js +12 -21
  109. package/es/components/Card/CardMedia.js +17 -88
  110. package/es/components/Card/CardPrice.js +13 -55
  111. package/es/components/Card/CardTypography.js +43 -52
  112. package/es/components/Carousel/Carousel.js +45 -63
  113. package/es/components/Carousel/CarouselItem.js +18 -90
  114. package/es/components/Carousel/hooks.js +58 -117
  115. package/es/components/Carousel/utils.js +58 -72
  116. package/es/components/Fade/Fade.js +5 -8
  117. package/es/components/Field/Field.js +44 -59
  118. package/es/components/Field/Field.statuses.js +4 -4
  119. package/es/components/Image/Image.js +31 -112
  120. package/es/components/Input/Input.js +4 -4
  121. package/es/components/Input/Input.mixins.js +6 -9
  122. package/es/components/ModalBase/ModalBase.js +16 -94
  123. package/es/components/ModalBase/ModalBaseContext.js +6 -9
  124. package/es/components/ModalBase/ModalOverlay.js +23 -106
  125. package/es/components/ModalBase/hooks.js +12 -40
  126. package/es/components/PaginationDots/PaginationDot.js +9 -15
  127. package/es/components/PaginationDots/PaginationDots.js +3 -6
  128. package/es/components/PaginationDots/usePaginationDots.js +9 -10
  129. package/es/components/Popup/Popup.js +48 -201
  130. package/es/components/PopupBase/PopupBase.js +27 -161
  131. package/es/components/PopupBase/PopupBaseContext.js +25 -85
  132. package/es/components/PopupBase/PopupBaseRoot.js +26 -164
  133. package/es/components/PopupBase/hooks.js +21 -95
  134. package/es/components/PopupBase/utils.js +31 -77
  135. package/es/components/Price/Price.js +12 -87
  136. package/es/components/RadioGroup/RadioGroup.js +5 -126
  137. package/es/components/SSRProvider/SSRProvider.js +3 -4
  138. package/es/components/Skeleton/LineSkeleton.js +18 -90
  139. package/es/components/Skeleton/RectSkeleton.js +16 -89
  140. package/es/components/Skeleton/Skeleton.js +2 -2
  141. package/es/components/Skeleton/TextSkeleton.js +7 -51
  142. package/es/components/Slider/Double.js +49 -200
  143. package/es/components/Slider/Handle.js +23 -153
  144. package/es/components/Slider/Single.js +26 -174
  145. package/es/components/Slider/Slider.js +2 -4
  146. package/es/components/Slider/SliderBase.js +36 -45
  147. package/es/components/Slider/ThumbBase.js +16 -92
  148. package/es/components/Slider/index.js +1 -1
  149. package/es/components/Slider/utils.js +2 -2
  150. package/es/components/Spinner/Spinner.js +23 -95
  151. package/es/components/Spinner/SpinnerSvg.js +8 -77
  152. package/es/components/Switch/Switch.js +45 -216
  153. package/es/components/Tabs/TabItem.js +28 -163
  154. package/es/components/Tabs/Tabs.js +28 -166
  155. package/es/components/Tabs/TabsContext.js +11 -41
  156. package/es/components/Tabs/createTabsController.js +28 -163
  157. package/es/components/TextArea/TextArea.js +18 -28
  158. package/es/components/Toast/Toast.js +10 -11
  159. package/es/components/Toast/ToastContext.js +3 -7
  160. package/es/components/Toast/ToastController.js +38 -95
  161. package/es/components/Toast/ToastProvider.js +34 -139
  162. package/es/components/Toast/useToast.js +4 -4
  163. package/es/components/Typography/Body.js +15 -15
  164. package/es/components/Typography/Button.js +10 -10
  165. package/es/components/Typography/Caption.js +5 -5
  166. package/es/components/Typography/Display.js +15 -15
  167. package/es/components/Typography/Footnote.js +10 -10
  168. package/es/components/Typography/Headline.js +40 -40
  169. package/es/components/Typography/Paragraph.js +21 -21
  170. package/es/components/Typography/Underline.js +5 -5
  171. package/es/hocs/withAutoFocus.js +8 -78
  172. package/es/hocs/withSkeleton.js +5 -10
  173. package/es/hooks/useDebouncedFunction.js +4 -36
  174. package/es/hooks/useFocusTrap.js +18 -21
  175. package/es/hooks/useForkRef.js +3 -3
  176. package/es/hooks/useIsomorphicLayoutEffect.js +1 -1
  177. package/es/hooks/useResizeObserver.js +8 -8
  178. package/es/hooks/useUniqId.js +6 -52
  179. package/es/mixins/addFocus.js +17 -22
  180. package/es/mixins/applyDisabled.js +6 -9
  181. package/es/mixins/applyEllipsis.js +2 -4
  182. package/es/mixins/applyMaxLines.js +3 -6
  183. package/es/mixins/applyNoSelect.js +2 -4
  184. package/es/mixins/applyOutline.js +2 -4
  185. package/es/mixins/applyRoundness.js +4 -7
  186. package/es/mixins/applyScrollSnap.js +4 -7
  187. package/es/mixins/applySkeletonGradient.js +6 -9
  188. package/es/mixins/applyView.js +2 -5
  189. package/es/mixins/blur.js +2 -5
  190. package/es/mixins/shadows.js +1 -1
  191. package/es/tokens/colors.js +48 -48
  192. package/es/tokens/typography.js +18 -18
  193. package/es/utils/__tests__/formatters.test.js +2 -2
  194. package/es/utils/animatedScrollTo.js +24 -34
  195. package/es/utils/canUseDOM.js +1 -1
  196. package/es/utils/extractTextFrom.js +3 -7
  197. package/es/utils/focusManager.js +40 -47
  198. package/es/utils/formatCurrency.js +4 -4
  199. package/es/utils/formatters.js +6 -14
  200. package/es/utils/react.js +4 -4
  201. package/es/utils/roundness.js +2 -4
  202. package/es/utils/scopeTab.js +5 -5
  203. package/es/utils/setRef.js +1 -1
  204. package/es/utils/tabbable.js +16 -25
  205. package/es/utils/toCssSize.js +1 -3
  206. package/es/utils/transformStyles.js +5 -60
  207. package/hocs/index.js +2 -2
  208. package/hocs/withAutoFocus.js +9 -79
  209. package/hocs/withSkeleton.js +8 -13
  210. package/hooks/index.js +6 -6
  211. package/hooks/useDebouncedFunction.js +5 -37
  212. package/hooks/useFocusTrap.js +22 -25
  213. package/hooks/useForkRef.js +5 -5
  214. package/hooks/useIsomorphicLayoutEffect.js +3 -3
  215. package/hooks/useResizeObserver.js +9 -9
  216. package/hooks/useUniqId.js +8 -54
  217. package/mixins/addFocus.js +19 -24
  218. package/mixins/applyDisabled.js +7 -10
  219. package/mixins/applyEllipsis.js +3 -5
  220. package/mixins/applyMaxLines.js +4 -7
  221. package/mixins/applyNoSelect.js +3 -5
  222. package/mixins/applyOutline.js +3 -5
  223. package/mixins/applyRoundness.js +5 -8
  224. package/mixins/applyScrollSnap.js +5 -8
  225. package/mixins/applySkeletonGradient.js +8 -11
  226. package/mixins/applyView.js +3 -6
  227. package/mixins/blur.js +2 -5
  228. package/mixins/index.js +11 -11
  229. package/mixins/shadows.js +1 -1
  230. package/package.json +13 -18
  231. package/tokens/colors.js +48 -48
  232. package/tokens/typography.js +18 -18
  233. package/utils/__tests__/formatters.test.js +3 -3
  234. package/utils/animatedScrollTo.js +24 -34
  235. package/utils/canUseDOM.js +1 -1
  236. package/utils/extractTextFrom.js +4 -8
  237. package/utils/focusManager.js +41 -48
  238. package/utils/formatCurrency.js +4 -4
  239. package/utils/formatters.js +6 -14
  240. package/utils/index.js +10 -10
  241. package/utils/react.js +7 -7
  242. package/utils/roundness.js +2 -4
  243. package/utils/scopeTab.js +6 -6
  244. package/utils/setRef.js +1 -1
  245. package/utils/tabbable.js +16 -25
  246. package/utils/toCssSize.js +1 -3
  247. package/utils/transformStyles.js +5 -60
@@ -8,26 +8,23 @@ Object.defineProperty(exports, "IconPlaceholder", {
8
8
  return IconPlaceholder;
9
9
  }
10
10
  });
11
- var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
11
+ const _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
12
12
  function _interop_require_default(obj) {
13
13
  return obj && obj.__esModule ? obj : {
14
14
  default: obj
15
15
  };
16
16
  }
17
- var sizes = {
17
+ const sizes = {
18
18
  xs: 'width: 1rem;height: 1rem;',
19
19
  s: 'width: 1.5rem;height: 1.5rem;',
20
20
  m: 'width: 2.25rem;height: 2.25rem;',
21
21
  l: 'width: 3rem;height: 3rem;',
22
22
  xl: 'width: 3.5rem;height: 3.5rem;'
23
23
  };
24
- var IconPlaceholder = _styledcomponents.default.div.withConfig({
24
+ const IconPlaceholder = _styledcomponents.default.div.withConfig({
25
25
  displayName: "IconPlaceholder",
26
26
  componentId: "sc-c34b6bd1-0"
27
27
  })([
28
- "",
29
- ";border-radius:50%;background:rgba(0,0,0,0.32);"
30
- ], function(param) {
31
- var size = param.size;
32
- return sizes[size || 's'];
33
- });
28
+ ``,
29
+ `;border-radius:50%;background:rgba(0,0,0,0.32);`
30
+ ], ({ size })=>sizes[size || 's']);
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "IconPlaceholder", {
8
8
  return _IconPlaceholder.IconPlaceholder;
9
9
  }
10
10
  });
11
- var _IconPlaceholder = require("./IconPlaceholder");
11
+ const _IconPlaceholder = require("./IconPlaceholder");
@@ -9,23 +9,23 @@ Object.defineProperty(exports, "collectPackageInfo", {
9
9
  return collectPackageInfo;
10
10
  }
11
11
  });
12
- var _pkg = /*#__PURE__*/ _interop_require_default(require("@pkg"));
12
+ const _pkg = /*#__PURE__*/ _interop_require_default(require("@pkg"));
13
13
  function _interop_require_default(obj) {
14
14
  return obj && obj.__esModule ? obj : {
15
15
  default: obj
16
16
  };
17
17
  }
18
- var collectPackageInfo = function collectPackageInfo(entityName) {
18
+ const collectPackageInfo = (entityName)=>{
19
19
  if (typeof window === 'undefined') {
20
20
  return;
21
21
  }
22
- var name = _pkg.default.name, version = _pkg.default.version;
22
+ const { name, version } = _pkg.default;
23
23
  if (!window.__PLASMA_INFO__) {
24
24
  window.__PLASMA_INFO__ = {};
25
25
  }
26
26
  if (!window.__PLASMA_INFO__[name]) {
27
27
  window.__PLASMA_INFO__[name] = {
28
- version: version,
28
+ version,
29
29
  entities: [
30
30
  entityName
31
31
  ]
@@ -19,22 +19,9 @@ _export(exports, {
19
19
  return badgeSizes;
20
20
  }
21
21
  });
22
- var _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
- var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
24
- var _tokens = require("../../tokens");
25
- function _define_property(obj, key, value) {
26
- if (key in obj) {
27
- Object.defineProperty(obj, key, {
28
- value: value,
29
- enumerable: true,
30
- configurable: true,
31
- writable: true
32
- });
33
- } else {
34
- obj[key] = value;
35
- }
36
- return obj;
37
- }
22
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
+ const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
24
+ const _tokens = require("../../tokens");
38
25
  function _interop_require_default(obj) {
39
26
  return obj && obj.__esModule ? obj : {
40
27
  default: obj
@@ -81,58 +68,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
81
68
  }
82
69
  return newObj;
83
70
  }
84
- function _object_spread(target) {
85
- for(var i = 1; i < arguments.length; i++){
86
- var source = arguments[i] != null ? arguments[i] : {};
87
- var ownKeys = Object.keys(source);
88
- if (typeof Object.getOwnPropertySymbols === "function") {
89
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
90
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
91
- }));
92
- }
93
- ownKeys.forEach(function(key) {
94
- _define_property(target, key, source[key]);
95
- });
96
- }
97
- return target;
98
- }
99
- function _object_without_properties(source, excluded) {
100
- if (source == null) return {};
101
- var target = {}, sourceKeys, key, i;
102
- if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
103
- sourceKeys = Reflect.ownKeys(source);
104
- for(i = 0; i < sourceKeys.length; i++){
105
- key = sourceKeys[i];
106
- if (excluded.indexOf(key) >= 0) continue;
107
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
108
- target[key] = source[key];
109
- }
110
- return target;
111
- }
112
- target = _object_without_properties_loose(source, excluded);
113
- if (Object.getOwnPropertySymbols) {
114
- sourceKeys = Object.getOwnPropertySymbols(source);
115
- for(i = 0; i < sourceKeys.length; i++){
116
- key = sourceKeys[i];
117
- if (excluded.indexOf(key) >= 0) continue;
118
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
119
- target[key] = source[key];
120
- }
121
- }
122
- return target;
123
- }
124
- function _object_without_properties_loose(source, excluded) {
125
- if (source == null) return {};
126
- var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
127
- for(i = 0; i < sourceKeys.length; i++){
128
- key = sourceKeys[i];
129
- if (excluded.indexOf(key) >= 0) continue;
130
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
131
- target[key] = source[key];
132
- }
133
- return target;
134
- }
135
- var badgeSizes = {
71
+ const badgeSizes = {
136
72
  l: {
137
73
  textMarginX: '0.25rem',
138
74
  textMarginLeftAfterContent: '0.25rem'
@@ -142,7 +78,7 @@ var badgeSizes = {
142
78
  textMarginLeftAfterContent: '0.125rem'
143
79
  }
144
80
  };
145
- var badgeRootSizes = {
81
+ const badgeRootSizes = {
146
82
  l: {
147
83
  height: '1.5rem',
148
84
  padding: '0.25rem',
@@ -158,49 +94,40 @@ var badgeRootSizes = {
158
94
  fontSize: '0.625rem'
159
95
  }
160
96
  };
161
- var StyledText = _styledcomponents.default.span.withConfig({
97
+ const StyledText = _styledcomponents.default.span.withConfig({
162
98
  displayName: "Badge__StyledText",
163
99
  componentId: "sc-4f989aef-0"
164
100
  })([
165
- ""
101
+ ``
166
102
  ]);
167
- var StyledContent = _styledcomponents.default.div.withConfig({
103
+ const StyledContent = _styledcomponents.default.div.withConfig({
168
104
  displayName: "Badge__StyledContent",
169
105
  componentId: "sc-4f989aef-1"
170
106
  })([
171
- "display:flex;"
107
+ `display:flex;`
172
108
  ]);
173
- var StyledBadge = _styledcomponents.default.div.withConfig({
109
+ const StyledBadge = _styledcomponents.default.div.withConfig({
174
110
  displayName: "Badge__StyledBadge",
175
111
  componentId: "sc-4f989aef-2"
176
112
  })([
177
- "",
178
- ";display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;width:max-content;",
179
- ";"
180
- ], _tokens.caption, function(param) {
181
- var size = param.size, circled = param.circled;
182
- return (0, _styledcomponents.css)([
183
- "",
184
- ";",
185
- " ",
186
- "{margin-left:",
187
- ";margin-right:",
188
- ";}",
189
- " ~ ",
190
- "{margin-left:",
191
- ";}"
113
+ ``,
114
+ `;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;width:max-content;`,
115
+ `;`
116
+ ], _tokens.caption, ({ size, circled })=>(0, _styledcomponents.css)([
117
+ ``,
118
+ `;`,
119
+ ` `,
120
+ `{margin-left:`,
121
+ `;margin-right:`,
122
+ `;}`,
123
+ ` ~ `,
124
+ `{margin-left:`,
125
+ `;}`
192
126
  ], badgeRootSizes[size], circled && (0, _styledcomponents.css)([
193
- "width:",
194
- ";padding-left:0;padding-right:0;"
195
- ], badgeRootSizes[size].minWidth), StyledText, badgeSizes[size].textMarginX, badgeSizes[size].textMarginX, StyledContent, StyledText, badgeSizes[size].textMarginLeftAfterContent);
196
- });
197
- var Badge = function Badge(_0) {
198
- var _0_size = _0.size, size = _0_size === void 0 ? 'l' : _0_size, text = _0.text, contentLeft = _0.contentLeft, rest = _object_without_properties(_0, [
199
- "size",
200
- "text",
201
- "contentLeft"
202
- ]);
203
- return /*#__PURE__*/ _react.default.createElement(StyledBadge, _object_spread({
204
- size: size
205
- }, rest), contentLeft && /*#__PURE__*/ _react.default.createElement(StyledContent, null, contentLeft), text && /*#__PURE__*/ _react.default.createElement(StyledText, null, text));
206
- };
127
+ `width:`,
128
+ `;padding-left:0;padding-right:0;`
129
+ ], badgeRootSizes[size].minWidth), StyledText, badgeSizes[size].textMarginX, badgeSizes[size].textMarginX, StyledContent, StyledText, badgeSizes[size].textMarginLeftAfterContent));
130
+ const Badge = ({ size = 'l', text, contentLeft, ...rest })=>/*#__PURE__*/ _react.default.createElement(StyledBadge, {
131
+ size: size,
132
+ ...rest
133
+ }, contentLeft && /*#__PURE__*/ _react.default.createElement(StyledContent, null, contentLeft), text && /*#__PURE__*/ _react.default.createElement(StyledText, null, text));
@@ -16,4 +16,4 @@ _export(exports, {
16
16
  return _Badge.badgeSizes;
17
17
  }
18
18
  });
19
- var _Badge = require("./Badge");
19
+ const _Badge = require("./Badge");
@@ -31,11 +31,11 @@ _export(exports, {
31
31
  return StyledTrigger;
32
32
  }
33
33
  });
34
- var _react = /*#__PURE__*/ _interop_require_default(require("react"));
35
- var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
36
- var _Typography = require("../Typography");
37
- var _mixins = require("../../mixins");
38
- var _tokens = require("../../tokens");
34
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
35
+ const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
36
+ const _Typography = require("../Typography");
37
+ const _mixins = require("../../mixins");
38
+ const _tokens = require("../../tokens");
39
39
  function _interop_require_default(obj) {
40
40
  return obj && obj.__esModule ? obj : {
41
41
  default: obj
@@ -82,65 +82,56 @@ function _interop_require_wildcard(obj, nodeInterop) {
82
82
  }
83
83
  return newObj;
84
84
  }
85
- var StyledRoot = _styledcomponents.default.div.withConfig({
85
+ const StyledRoot = _styledcomponents.default.div.withConfig({
86
86
  displayName: "Basebox__StyledRoot",
87
87
  componentId: "sc-a5c1d526-0"
88
88
  })([
89
- "",
90
- " position:relative;align-items:flex-start;display:flex;cursor:pointer;"
89
+ ``,
90
+ ` position:relative;align-items:flex-start;display:flex;cursor:pointer;`
91
91
  ], _mixins.applyNoSelect);
92
- var StyledContentWrapper = _styledcomponents.default.label.withConfig({
92
+ const StyledContentWrapper = _styledcomponents.default.label.withConfig({
93
93
  displayName: "Basebox__StyledContentWrapper",
94
94
  componentId: "sc-a5c1d526-1"
95
95
  })([
96
- "position:relative;align-items:flex-start;display:flex;width:100%;cursor:inherit;"
96
+ `position:relative;align-items:flex-start;display:flex;width:100%;cursor:inherit;`
97
97
  ]);
98
- var StyledInput = _styledcomponents.default.input.withConfig({
98
+ const StyledInput = _styledcomponents.default.input.withConfig({
99
99
  displayName: "Basebox__StyledInput",
100
100
  componentId: "sc-a5c1d526-2"
101
101
  })([
102
- "position:absolute;&:focus{outline:0 none;}"
102
+ `position:absolute;&:focus{outline:0 none;}`
103
103
  ]);
104
- var StyledTrigger = _styledcomponents.default.div.withConfig({
104
+ const StyledTrigger = _styledcomponents.default.div.withConfig({
105
105
  displayName: "Basebox__StyledTrigger",
106
106
  componentId: "sc-a5c1d526-3"
107
107
  })([
108
- "box-sizing:border-box;position:relative;transition:",
109
- ";"
110
- ], function(param) {
111
- var theme = param.theme;
112
- return theme.lowPerformance ? 'unset' : 'all 0.1s ease-in-out';
113
- });
114
- var StyledContent = _styledcomponents.default.div.withConfig({
108
+ `box-sizing:border-box;position:relative;transition:`,
109
+ `;`
110
+ ], ({ theme })=>theme.lowPerformance ? 'unset' : 'all 0.1s ease-in-out');
111
+ const StyledContent = _styledcomponents.default.div.withConfig({
115
112
  displayName: "Basebox__StyledContent",
116
113
  componentId: "sc-a5c1d526-4"
117
114
  })([
118
- "display:flex;flex-direction:column;margin-left:0.75rem;"
115
+ `display:flex;flex-direction:column;margin-left:0.75rem;`
119
116
  ]);
120
- var StyledLabel = (0, _styledcomponents.default)(_Typography.Body1).withConfig({
117
+ const StyledLabel = (0, _styledcomponents.default)(_Typography.Body1).withConfig({
121
118
  displayName: "Basebox__StyledLabel",
122
119
  componentId: "sc-a5c1d526-5"
123
120
  })([
124
- "",
125
- ""
126
- ], function(param) {
127
- var singleLine = param.singleLine;
128
- return singleLine && (0, _styledcomponents.css)([
129
- "",
130
- ""
131
- ], _mixins.applyEllipsis);
132
- });
133
- var StyledDescription = (0, _styledcomponents.default)(_Typography.Footnote1).withConfig({
121
+ ``,
122
+ ``
123
+ ], ({ singleLine })=>singleLine && (0, _styledcomponents.css)([
124
+ ``,
125
+ ``
126
+ ], _mixins.applyEllipsis));
127
+ const StyledDescription = (0, _styledcomponents.default)(_Typography.Footnote1).withConfig({
134
128
  displayName: "Basebox__StyledDescription",
135
129
  componentId: "sc-a5c1d526-6"
136
130
  })([
137
- "color:",
138
- ";",
139
- ""
140
- ], _tokens.secondary, function(param) {
141
- var singleLine = param.singleLine;
142
- return singleLine && (0, _styledcomponents.css)([
143
- "",
144
- ""
145
- ], _mixins.applyEllipsis);
146
- });
131
+ `color:`,
132
+ `;`,
133
+ ``
134
+ ], _tokens.secondary, ({ singleLine })=>singleLine && (0, _styledcomponents.css)([
135
+ ``,
136
+ ``
137
+ ], _mixins.applyEllipsis));
@@ -31,4 +31,4 @@ _export(exports, {
31
31
  return _Basebox.StyledTrigger;
32
32
  }
33
33
  });
34
- var _Basebox = require("./Basebox");
34
+ const _Basebox = require("./Basebox");
@@ -28,96 +28,57 @@ _export(exports, {
28
28
  return StyledSpinner;
29
29
  }
30
30
  });
31
- var _react = /*#__PURE__*/ _interop_require_default(require("react"));
32
- var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
33
- var _mixins = require("../../mixins");
34
- var _Spinner = require("../Spinner");
35
- function _define_property(obj, key, value) {
36
- if (key in obj) {
37
- Object.defineProperty(obj, key, {
38
- value: value,
39
- enumerable: true,
40
- configurable: true,
41
- writable: true
42
- });
43
- } else {
44
- obj[key] = value;
45
- }
46
- return obj;
47
- }
31
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
32
+ const _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
33
+ const _mixins = require("../../mixins");
34
+ const _Spinner = require("../Spinner");
48
35
  function _interop_require_default(obj) {
49
36
  return obj && obj.__esModule ? obj : {
50
37
  default: obj
51
38
  };
52
39
  }
53
- function _object_spread(target) {
54
- for(var i = 1; i < arguments.length; i++){
55
- var source = arguments[i] != null ? arguments[i] : {};
56
- var ownKeys = Object.keys(source);
57
- if (typeof Object.getOwnPropertySymbols === "function") {
58
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
59
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
60
- }));
61
- }
62
- ownKeys.forEach(function(key) {
63
- _define_property(target, key, source[key]);
64
- });
65
- }
66
- return target;
67
- }
68
- var ButtonRoot = _styledcomponents.default.button.withConfig({
40
+ const ButtonRoot = _styledcomponents.default.button.withConfig({
69
41
  displayName: "Button__ButtonRoot",
70
42
  componentId: "sc-b39b3537-0"
71
43
  })([
72
- "position:relative;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);a&{text-decoration:none;}&:focus{outline:none;}",
73
- " ",
74
- ""
75
- ], function(param) {
76
- var isLoading = param.$isLoading;
77
- return !isLoading && _mixins.applyDisabled;
78
- }, _mixins.applyBlur);
79
- var ButtonLoader = _styledcomponents.default.div.withConfig({
44
+ `position:relative;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);a&{text-decoration:none;}&:focus{outline:none;}`,
45
+ ` `,
46
+ ``
47
+ ], ({ $isLoading: isLoading })=>!isLoading && _mixins.applyDisabled, _mixins.applyBlur);
48
+ const ButtonLoader = _styledcomponents.default.div.withConfig({
80
49
  displayName: "Button__ButtonLoader",
81
50
  componentId: "sc-b39b3537-1"
82
51
  })([
83
- "position:absolute;"
52
+ `position:absolute;`
84
53
  ]);
85
- var StyledSpinner = (0, _styledcomponents.default)(_Spinner.Spinner).withConfig({
54
+ const StyledSpinner = (0, _styledcomponents.default)(_Spinner.Spinner).withConfig({
86
55
  displayName: "Button__StyledSpinner",
87
56
  componentId: "sc-b39b3537-2"
88
57
  })([
89
- "width:1.375rem;"
58
+ `width:1.375rem;`
90
59
  ]);
91
- var ButtonContentWrapper = _styledcomponents.default.span.withConfig({
60
+ const ButtonContentWrapper = _styledcomponents.default.span.withConfig({
92
61
  displayName: "Button__ButtonContentWrapper",
93
62
  componentId: "sc-b39b3537-3"
94
63
  })([
95
- "display:flex;align-items:inherit;justify-content:inherit;width:100%;",
96
- ""
97
- ], function(param) {
98
- var isLoading = param.$isLoading;
99
- return isLoading && 'opacity: 0;';
100
- });
101
- var ButtonText = _styledcomponents.default.span.withConfig({
64
+ `display:flex;align-items:inherit;justify-content:inherit;width:100%;`,
65
+ ``
66
+ ], ({ $isLoading: isLoading })=>isLoading && 'opacity: 0;');
67
+ const ButtonText = _styledcomponents.default.span.withConfig({
102
68
  displayName: "Button__ButtonText",
103
69
  componentId: "sc-b39b3537-4"
104
70
  })([
105
- "box-sizing:border-box;",
106
- " ",
107
- " ",
108
- ""
109
- ], _mixins.applyEllipsis, function(param) {
110
- var isContentLeft = param.$isContentLeft;
111
- return isContentLeft && 'margin-left: 0.375rem;';
112
- }, function(param) {
113
- var isContentRight = param.$isContentRight;
114
- return isContentRight && 'margin-right: 0.375rem;';
115
- });
116
- var Button = /*#__PURE__*/ _react.default.forwardRef(// eslint-disable-next-line prefer-arrow-callback
71
+ `box-sizing:border-box;`,
72
+ ` `,
73
+ ` `,
74
+ ``
75
+ ], _mixins.applyEllipsis, ({ $isContentLeft: isContentLeft })=>isContentLeft && 'margin-left: 0.375rem;', ({ $isContentRight: isContentRight })=>isContentRight && 'margin-right: 0.375rem;');
76
+ const Button = /*#__PURE__*/ _react.default.forwardRef(// eslint-disable-next-line prefer-arrow-callback
117
77
  function Button(props, ref) {
118
- return /*#__PURE__*/ _react.default.createElement(ButtonRoot, _object_spread({
119
- ref: ref
120
- }, props));
78
+ return /*#__PURE__*/ _react.default.createElement(ButtonRoot, {
79
+ ref: ref,
80
+ ...props
81
+ });
121
82
  });
122
83
  Button.defaultProps = {
123
84
  pin: 'square-square',
@@ -8,65 +8,11 @@ Object.defineProperty(exports, "getButtonSizesMixin", {
8
8
  return getButtonSizesMixin;
9
9
  }
10
10
  });
11
- var _styledcomponents = require("styled-components");
12
- var _mixins = require("../../mixins");
13
- var _utils = require("../../utils");
14
- function _define_property(obj, key, value) {
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
26
- }
27
- function _object_spread(target) {
28
- for(var i = 1; i < arguments.length; i++){
29
- var source = arguments[i] != null ? arguments[i] : {};
30
- var ownKeys = Object.keys(source);
31
- if (typeof Object.getOwnPropertySymbols === "function") {
32
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
33
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
34
- }));
35
- }
36
- ownKeys.forEach(function(key) {
37
- _define_property(target, key, source[key]);
38
- });
39
- }
40
- return target;
41
- }
42
- function ownKeys(object, enumerableOnly) {
43
- var keys = Object.keys(object);
44
- if (Object.getOwnPropertySymbols) {
45
- var symbols = Object.getOwnPropertySymbols(object);
46
- if (enumerableOnly) {
47
- symbols = symbols.filter(function(sym) {
48
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
49
- });
50
- }
51
- keys.push.apply(keys, symbols);
52
- }
53
- return keys;
54
- }
55
- function _object_spread_props(target, source) {
56
- source = source != null ? source : {};
57
- if (Object.getOwnPropertyDescriptors) {
58
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
59
- } else {
60
- ownKeys(Object(source)).forEach(function(key) {
61
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
62
- });
63
- }
64
- return target;
65
- }
66
- var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
67
- return function(param) {
68
- var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
69
- var paddingX = sizes[size].paddingX;
11
+ const _styledcomponents = require("styled-components");
12
+ const _mixins = require("../../mixins");
13
+ const _utils = require("../../utils");
14
+ const getButtonSizesMixin = (sizes, typos)=>({ size, pin, outlined, focused, $isContentLeft: isContentLeft, $isContentRight: isContentRight, shiftLeft, shiftRight, square, stretch, theme })=>{
15
+ let { paddingX } = sizes[size];
70
16
  if (square) {
71
17
  paddingX = sizes[size].paddingY;
72
18
  } else if (stretch) {
@@ -75,21 +21,21 @@ var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
75
21
  paddingX = sizes[size].paddingContentX;
76
22
  }
77
23
  return (0, _styledcomponents.css)([
78
- "height:",
79
- ";padding:",
80
- " ",
81
- ";border-radius:",
82
- ";",
83
- " ",
84
- " ",
85
- " ",
86
- " ",
87
- " ",
88
- ""
89
- ], sizes[size].height, sizes[size].paddingY, paddingX, (0, _utils.convertRoundnessMatrix)(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && " width: ".concat(sizes[size].height, ";"), shiftLeft && "margin-left: calc(-1 * ".concat(paddingX, ");"), shiftRight && "margin-right: calc(-1 * ".concat(paddingX, ");"), typos[size], (0, _mixins.addFocus)(_object_spread_props(_object_spread({}, theme), {
90
- focused: focused,
91
- outlined: outlined,
92
- outlineRadius: (0, _utils.convertRoundnessMatrix)(pin, "calc(".concat(sizes[size].radius, " + var(--plasma-outline-size))"), "calc(".concat(sizes[size].radiusCircle, " + var(--plasma-outline-size))"))
93
- })));
24
+ `height:`,
25
+ `;padding:`,
26
+ ` `,
27
+ `;border-radius:`,
28
+ `;`,
29
+ ` `,
30
+ ` `,
31
+ ` `,
32
+ ` `,
33
+ ` `,
34
+ ``
35
+ ], sizes[size].height, sizes[size].paddingY, paddingX, (0, _utils.convertRoundnessMatrix)(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && ` width: ${sizes[size].height};`, shiftLeft && `margin-left: calc(-1 * ${paddingX});`, shiftRight && `margin-right: calc(-1 * ${paddingX});`, typos[size], (0, _mixins.addFocus)({
36
+ ...theme,
37
+ focused,
38
+ outlined,
39
+ outlineRadius: (0, _utils.convertRoundnessMatrix)(pin, `calc(${sizes[size].radius} + var(--plasma-outline-size))`, `calc(${sizes[size].radiusCircle} + var(--plasma-outline-size))`)
40
+ }));
94
41
  };
95
- };
@@ -19,9 +19,9 @@ _export(exports, {
19
19
  return buttonViews;
20
20
  }
21
21
  });
22
- var _mixins = require("../../mixins");
23
- var _tokens = require("../../tokens");
24
- var buttonViews = {
22
+ const _mixins = require("../../mixins");
23
+ const _tokens = require("../../tokens");
24
+ const buttonViews = {
25
25
  primary: _mixins.views.primary,
26
26
  secondary: _mixins.views.secondary,
27
27
  success: _mixins.views.success,
@@ -31,7 +31,7 @@ var buttonViews = {
31
31
  overlay: _mixins.views.overlay,
32
32
  clear: _mixins.views.clear
33
33
  };
34
- var buttonSizes = {
34
+ const buttonSizes = {
35
35
  l: {
36
36
  height: 'var(--plasma-button-l-height)',
37
37
  paddingY: 'var(--plasma-button-l-padding-y)',
@@ -60,7 +60,7 @@ var buttonSizes = {
60
60
  radiusCircle: 'var(--plasma-button-s-radius-circle)'
61
61
  }
62
62
  };
63
- var buttonTypography = {
63
+ const buttonTypography = {
64
64
  l: _tokens.button1,
65
65
  m: _tokens.button1,
66
66
  s: _tokens.button2