@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
package/tokens/colors.js CHANGED
@@ -154,51 +154,51 @@ _export(exports, {
154
154
  return whiteTertiary;
155
155
  }
156
156
  });
157
- var white = 'var(--plasma-colors-white)';
158
- var whitePrimary = 'var(--plasma-colors-white-primary)';
159
- var whiteSecondary = 'var(--plasma-colors-white-secondary)';
160
- var whiteTertiary = 'var(--plasma-colors-white-tertiary)';
161
- var black = 'var(--plasma-colors-black)';
162
- var blackPrimary = 'var(--plasma-colors-black-primary)';
163
- var blackSecondary = 'var(--plasma-colors-black-secondary)';
164
- var blackTertiary = 'var(--plasma-colors-black-tertiary)';
165
- var dark01 = 'var(--plasma-colors-dark01)';
166
- var dark02 = 'var(--plasma-colors-dark02)';
167
- var dark03 = 'var(--plasma-colors-dark03)';
168
- var transparent = 'var(--plasma-colors-transparent)';
169
- var text = 'var(--plasma-colors-text)';
170
- var primary = 'var(--plasma-colors-primary)';
171
- var secondary = 'var(--plasma-colors-secondary)';
172
- var tertiary = 'var(--plasma-colors-tertiary)';
173
- var inverse = 'var(--plasma-colors-inverse)';
174
- var paragraph = 'var(--plasma-colors-paragraph)';
175
- var background = 'var(--plasma-colors-background)';
176
- var backgroundPrimary = 'var(--plasma-colors-background-primary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
177
- var backgroundSecondary = 'var(--plasma-colors-background-secondary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
178
- var backgroundTertiary = 'var(--plasma-colors-background-tertiary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
179
- var success = 'var(--plasma-colors-success)';
180
- var warning = 'var(--plasma-colors-warning)';
181
- var critical = 'var(--plasma-colors-critical)';
182
- var overlay = 'var(--plasma-colors-overlay)';
183
- var surfaceLiquid01 = 'var(--plasma-colors-surface-liquid01)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
184
- var surfaceLiquid02 = 'var(--plasma-colors-surface-liquid02)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
185
- var surfaceLiquid03 = 'var(--plasma-colors-surface-liquid03)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
186
- var surfaceSolid01 = 'var(--plasma-colors-surface-solid01)';
187
- var surfaceSolid02 = 'var(--plasma-colors-surface-solid02)';
188
- var surfaceSolid03 = 'var(--plasma-colors-surface-solid03)';
189
- var surfaceCard = 'var(--plasma-colors-surface-card)';
190
- var buttonPrimary = 'var(--plasma-colors-button-primary)';
191
- var buttonSecondary = 'var(--plasma-colors-button-secondary)';
192
- var buttonSuccess = 'var(--plasma-colors-button-success)';
193
- var buttonWarning = 'var(--plasma-colors-button-warning)';
194
- var buttonCritical = 'var(--plasma-colors-button-critical)';
195
- var buttonChecked = 'var(--plasma-colors-button-checked)';
196
- var speechBubbleSent = 'var(--plasma-colors-speech-bubble-sent)';
197
- var speechBubbleReceived = 'var(--plasma-colors-speech-bubble-received)';
198
- var accent = 'var(--plasma-colors-accent)';
199
- var buttonAccent = 'var(--plasma-colors-button-accent)';
200
- var buttonFocused = 'var(--plasma-colors-button-focused)';
201
- var gradient = 'var(--plasma-colors-gradient)';
202
- var voicePhraseGradient = 'var(--plasma-colors-voice-phrase-gradient)';
203
- var skeletonGradient = 'var(--plasma-colors-skeleton-gradient)';
204
- var skeletonGradientLighter = 'var(--plasma-colors-skeleton-gradient-lighter)';
157
+ const white = 'var(--plasma-colors-white)';
158
+ const whitePrimary = 'var(--plasma-colors-white-primary)';
159
+ const whiteSecondary = 'var(--plasma-colors-white-secondary)';
160
+ const whiteTertiary = 'var(--plasma-colors-white-tertiary)';
161
+ const black = 'var(--plasma-colors-black)';
162
+ const blackPrimary = 'var(--plasma-colors-black-primary)';
163
+ const blackSecondary = 'var(--plasma-colors-black-secondary)';
164
+ const blackTertiary = 'var(--plasma-colors-black-tertiary)';
165
+ const dark01 = 'var(--plasma-colors-dark01)';
166
+ const dark02 = 'var(--plasma-colors-dark02)';
167
+ const dark03 = 'var(--plasma-colors-dark03)';
168
+ const transparent = 'var(--plasma-colors-transparent)';
169
+ const text = 'var(--plasma-colors-text)';
170
+ const primary = 'var(--plasma-colors-primary)';
171
+ const secondary = 'var(--plasma-colors-secondary)';
172
+ const tertiary = 'var(--plasma-colors-tertiary)';
173
+ const inverse = 'var(--plasma-colors-inverse)';
174
+ const paragraph = 'var(--plasma-colors-paragraph)';
175
+ const background = 'var(--plasma-colors-background)';
176
+ const backgroundPrimary = 'var(--plasma-colors-background-primary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
177
+ const backgroundSecondary = 'var(--plasma-colors-background-secondary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
178
+ const backgroundTertiary = 'var(--plasma-colors-background-tertiary)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
179
+ const success = 'var(--plasma-colors-success)';
180
+ const warning = 'var(--plasma-colors-warning)';
181
+ const critical = 'var(--plasma-colors-critical)';
182
+ const overlay = 'var(--plasma-colors-overlay)';
183
+ const surfaceLiquid01 = 'var(--plasma-colors-surface-liquid01)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
184
+ const surfaceLiquid02 = 'var(--plasma-colors-surface-liquid02)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
185
+ const surfaceLiquid03 = 'var(--plasma-colors-surface-liquid03)'; // ToDo: https://github.com/salute-developers/plasma/issues/1107
186
+ const surfaceSolid01 = 'var(--plasma-colors-surface-solid01)';
187
+ const surfaceSolid02 = 'var(--plasma-colors-surface-solid02)';
188
+ const surfaceSolid03 = 'var(--plasma-colors-surface-solid03)';
189
+ const surfaceCard = 'var(--plasma-colors-surface-card)';
190
+ const buttonPrimary = 'var(--plasma-colors-button-primary)';
191
+ const buttonSecondary = 'var(--plasma-colors-button-secondary)';
192
+ const buttonSuccess = 'var(--plasma-colors-button-success)';
193
+ const buttonWarning = 'var(--plasma-colors-button-warning)';
194
+ const buttonCritical = 'var(--plasma-colors-button-critical)';
195
+ const buttonChecked = 'var(--plasma-colors-button-checked)';
196
+ const speechBubbleSent = 'var(--plasma-colors-speech-bubble-sent)';
197
+ const speechBubbleReceived = 'var(--plasma-colors-speech-bubble-received)';
198
+ const accent = 'var(--plasma-colors-accent)';
199
+ const buttonAccent = 'var(--plasma-colors-button-accent)';
200
+ const buttonFocused = 'var(--plasma-colors-button-focused)';
201
+ const gradient = 'var(--plasma-colors-gradient)';
202
+ const voicePhraseGradient = 'var(--plasma-colors-voice-phrase-gradient)';
203
+ const skeletonGradient = 'var(--plasma-colors-skeleton-gradient)';
204
+ const skeletonGradientLighter = 'var(--plasma-colors-skeleton-gradient-lighter)';
@@ -64,7 +64,7 @@ _export(exports, {
64
64
  return underline;
65
65
  }
66
66
  });
67
- var body1 = {
67
+ const body1 = {
68
68
  fontFamily: 'var(--plasma-typo-body1-font-family)',
69
69
  fontWeight: 'var(--plasma-typo-body1-font-weight)',
70
70
  fontStyle: 'var(--plasma-typo-body1-font-style)',
@@ -72,7 +72,7 @@ var body1 = {
72
72
  letterSpacing: 'var(--plasma-typo-body1-letter-spacing)',
73
73
  lineHeight: 'var(--plasma-typo-body1-line-height)'
74
74
  };
75
- var body2 = {
75
+ const body2 = {
76
76
  fontFamily: 'var(--plasma-typo-body2-font-family)',
77
77
  fontWeight: 'var(--plasma-typo-body2-font-weight)',
78
78
  fontStyle: 'var(--plasma-typo-body2-font-style)',
@@ -80,7 +80,7 @@ var body2 = {
80
80
  letterSpacing: 'var(--plasma-typo-body2-letter-spacing)',
81
81
  lineHeight: 'var(--plasma-typo-body2-line-height)'
82
82
  };
83
- var body3 = {
83
+ const body3 = {
84
84
  fontFamily: 'var(--plasma-typo-body3-font-family)',
85
85
  fontWeight: 'var(--plasma-typo-body3-font-weight)',
86
86
  fontStyle: 'var(--plasma-typo-body3-font-style)',
@@ -88,7 +88,7 @@ var body3 = {
88
88
  letterSpacing: 'var(--plasma-typo-body3-letter-spacing)',
89
89
  lineHeight: 'var(--plasma-typo-body3-line-height)'
90
90
  };
91
- var button1 = {
91
+ const button1 = {
92
92
  fontFamily: 'var(--plasma-typo-button1-font-family)',
93
93
  fontWeight: 'var(--plasma-typo-button1-font-weight)',
94
94
  fontStyle: 'var(--plasma-typo-button1-font-style)',
@@ -96,7 +96,7 @@ var button1 = {
96
96
  letterSpacing: 'var(--plasma-typo-button1-letter-spacing)',
97
97
  lineHeight: 'var(--plasma-typo-button1-line-height)'
98
98
  };
99
- var button2 = {
99
+ const button2 = {
100
100
  fontFamily: 'var(--plasma-typo-button2-font-family)',
101
101
  fontWeight: 'var(--plasma-typo-button2-font-weight)',
102
102
  fontStyle: 'var(--plasma-typo-button2-font-style)',
@@ -104,7 +104,7 @@ var button2 = {
104
104
  letterSpacing: 'var(--plasma-typo-button2-letter-spacing)',
105
105
  lineHeight: 'var(--plasma-typo-button2-line-height)'
106
106
  };
107
- var caption = {
107
+ const caption = {
108
108
  fontFamily: 'var(--plasma-typo-caption-font-family)',
109
109
  fontWeight: 'var(--plasma-typo-caption-font-weight)',
110
110
  fontStyle: 'var(--plasma-typo-caption-font-style)',
@@ -112,7 +112,7 @@ var caption = {
112
112
  letterSpacing: 'var(--plasma-typo-caption-letter-spacing)',
113
113
  lineHeight: 'var(--plasma-typo-caption-line-height)'
114
114
  };
115
- var display1 = {
115
+ const display1 = {
116
116
  fontFamily: 'var(--plasma-typo-display1-font-family)',
117
117
  fontWeight: 'var(--plasma-typo-display1-font-weight)',
118
118
  fontStyle: 'var(--plasma-typo-display1-font-style)',
@@ -120,7 +120,7 @@ var display1 = {
120
120
  letterSpacing: 'var(--plasma-typo-display1-letter-spacing)',
121
121
  lineHeight: 'var(--plasma-typo-display1-line-height)'
122
122
  };
123
- var display2 = {
123
+ const display2 = {
124
124
  fontFamily: 'var(--plasma-typo-display2-font-family)',
125
125
  fontWeight: 'var(--plasma-typo-display2-font-weight)',
126
126
  fontStyle: 'var(--plasma-typo-display2-font-style)',
@@ -128,7 +128,7 @@ var display2 = {
128
128
  letterSpacing: 'var(--plasma-typo-display2-letter-spacing)',
129
129
  lineHeight: 'var(--plasma-typo-display2-line-height)'
130
130
  };
131
- var display3 = {
131
+ const display3 = {
132
132
  fontFamily: 'var(--plasma-typo-display3-font-family)',
133
133
  fontWeight: 'var(--plasma-typo-display3-font-weight)',
134
134
  fontStyle: 'var(--plasma-typo-display3-font-style)',
@@ -136,7 +136,7 @@ var display3 = {
136
136
  letterSpacing: 'var(--plasma-typo-display3-letter-spacing)',
137
137
  lineHeight: 'var(--plasma-typo-display3-line-height)'
138
138
  };
139
- var footnote1 = {
139
+ const footnote1 = {
140
140
  fontFamily: 'var(--plasma-typo-footnote1-font-family)',
141
141
  fontWeight: 'var(--plasma-typo-footnote1-font-weight)',
142
142
  fontStyle: 'var(--plasma-typo-footnote1-font-style)',
@@ -144,7 +144,7 @@ var footnote1 = {
144
144
  letterSpacing: 'var(--plasma-typo-footnote1-letter-spacing)',
145
145
  lineHeight: 'var(--plasma-typo-footnote1-line-height)'
146
146
  };
147
- var footnote2 = {
147
+ const footnote2 = {
148
148
  fontFamily: 'var(--plasma-typo-footnote2-font-family)',
149
149
  fontWeight: 'var(--plasma-typo-footnote2-font-weight)',
150
150
  fontStyle: 'var(--plasma-typo-footnote2-font-style)',
@@ -152,7 +152,7 @@ var footnote2 = {
152
152
  letterSpacing: 'var(--plasma-typo-footnote2-letter-spacing)',
153
153
  lineHeight: 'var(--plasma-typo-footnote2-line-height)'
154
154
  };
155
- var headline1 = {
155
+ const headline1 = {
156
156
  fontFamily: 'var(--plasma-typo-headline1-font-family)',
157
157
  fontWeight: 'var(--plasma-typo-headline1-font-weight)',
158
158
  fontStyle: 'var(--plasma-typo-headline1-font-style)',
@@ -160,7 +160,7 @@ var headline1 = {
160
160
  letterSpacing: 'var(--plasma-typo-headline1-letter-spacing)',
161
161
  lineHeight: 'var(--plasma-typo-headline1-line-height)'
162
162
  };
163
- var headline2 = {
163
+ const headline2 = {
164
164
  fontFamily: 'var(--plasma-typo-headline2-font-family)',
165
165
  fontWeight: 'var(--plasma-typo-headline2-font-weight)',
166
166
  fontStyle: 'var(--plasma-typo-headline2-font-style)',
@@ -168,7 +168,7 @@ var headline2 = {
168
168
  letterSpacing: 'var(--plasma-typo-headline2-letter-spacing)',
169
169
  lineHeight: 'var(--plasma-typo-headline2-line-height)'
170
170
  };
171
- var headline3 = {
171
+ const headline3 = {
172
172
  fontFamily: 'var(--plasma-typo-headline3-font-family)',
173
173
  fontWeight: 'var(--plasma-typo-headline3-font-weight)',
174
174
  fontStyle: 'var(--plasma-typo-headline3-font-style)',
@@ -176,7 +176,7 @@ var headline3 = {
176
176
  letterSpacing: 'var(--plasma-typo-headline3-letter-spacing)',
177
177
  lineHeight: 'var(--plasma-typo-headline3-line-height)'
178
178
  };
179
- var headline4 = {
179
+ const headline4 = {
180
180
  fontFamily: 'var(--plasma-typo-headline4-font-family)',
181
181
  fontWeight: 'var(--plasma-typo-headline4-font-weight)',
182
182
  fontStyle: 'var(--plasma-typo-headline4-font-style)',
@@ -184,7 +184,7 @@ var headline4 = {
184
184
  letterSpacing: 'var(--plasma-typo-headline4-letter-spacing)',
185
185
  lineHeight: 'var(--plasma-typo-headline4-line-height)'
186
186
  };
187
- var paragraph1 = {
187
+ const paragraph1 = {
188
188
  fontFamily: 'var(--plasma-typo-paragraph1-font-family)',
189
189
  fontWeight: 'var(--plasma-typo-paragraph1-font-weight)',
190
190
  fontStyle: 'var(--plasma-typo-paragraph1-font-style)',
@@ -192,7 +192,7 @@ var paragraph1 = {
192
192
  letterSpacing: 'var(--plasma-typo-paragraph1-letter-spacing)',
193
193
  lineHeight: 'var(--plasma-typo-paragraph1-line-height)'
194
194
  };
195
- var paragraph2 = {
195
+ const paragraph2 = {
196
196
  fontFamily: 'var(--plasma-typo-paragraph2-font-family)',
197
197
  fontWeight: 'var(--plasma-typo-paragraph2-font-weight)',
198
198
  fontStyle: 'var(--plasma-typo-paragraph2-font-style)',
@@ -200,7 +200,7 @@ var paragraph2 = {
200
200
  letterSpacing: 'var(--plasma-typo-paragraph2-letter-spacing)',
201
201
  lineHeight: 'var(--plasma-typo-paragraph2-line-height)'
202
202
  };
203
- var underline = {
203
+ const underline = {
204
204
  fontFamily: 'var(--plasma-typo-underline-font-family)',
205
205
  fontWeight: 'var(--plasma-typo-underline-font-weight)',
206
206
  fontStyle: 'var(--plasma-typo-underline-font-style)',
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _formatters = require("../formatters");
5
+ const _formatters = require("../formatters");
6
6
  test.each([
7
7
  [
8
8
  0,
@@ -52,7 +52,7 @@ test.each([
52
52
  11,
53
53
  'декабря'
54
54
  ]
55
- ])("monthLongName(%s) return '%s'", function(index, monthName) {
55
+ ])("monthLongName(%s) return '%s'", (index, monthName)=>{
56
56
  expect((0, _formatters.monthLongName)(index)).toBe(monthName);
57
57
  });
58
58
  test.each([
@@ -104,6 +104,6 @@ test.each([
104
104
  11,
105
105
  'дек'
106
106
  ]
107
- ])("monthShortName(%s) return '%s'", function(index, monthName) {
107
+ ])("monthShortName(%s) return '%s'", (index, monthName)=>{
108
108
  expect((0, _formatters.monthShortName)(index)).toBe(monthName);
109
109
  });
@@ -16,53 +16,43 @@ _export(exports, {
16
16
  return animatedScrollToY;
17
17
  }
18
18
  });
19
- var DEFAULT_DURATION = 300;
19
+ const DEFAULT_DURATION = 300;
20
20
  // https://css-tricks.com/emulating-css-timing-functions-javascript/
21
- var tfs = {
22
- linear: function linear(t) {
23
- return t;
24
- },
21
+ const tfs = {
22
+ linear: (t)=>t,
25
23
  // eslint-disable-next-line
26
- easeIn: function easeIn(t) {
27
- return Math.pow(t, 1.675);
28
- },
24
+ easeIn: (t)=>Math.pow(t, 1.675),
29
25
  // eslint-disable-next-line
30
- easeOut: function easeOut(t) {
31
- return 1 - Math.pow(1 - t, 1.675);
32
- },
33
- easeInOut: function easeInOut(t) {
34
- return 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1);
35
- }
26
+ easeOut: (t)=>1 - Math.pow(1 - t, 1.675),
27
+ easeInOut: (t)=>0.5 * (Math.sin((t - 0.5) * Math.PI) + 1)
36
28
  };
37
- var animatedScrollToX = function animatedScrollToX(elem, pos) {
38
- var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
39
- var startTime;
40
- var startX = elem.scrollLeft;
41
- var endX = Math.max(0, Math.min(elem.scrollWidth - elem.clientWidth, pos));
42
- var handleNewAnimationFrame = function handleNewAnimationFrame1() {
29
+ const animatedScrollToX = (elem, pos, duration = DEFAULT_DURATION, timingFunction = 'easeInOut')=>{
30
+ let startTime;
31
+ const startX = elem.scrollLeft;
32
+ const endX = Math.max(0, Math.min(elem.scrollWidth - elem.clientWidth, pos));
33
+ const handleNewAnimationFrame = ()=>{
43
34
  startTime = startTime || Date.now();
44
- var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
45
- var scrollPos = tfs[timingFunction](timePos);
46
- var left = startX + (endX - startX) * scrollPos;
35
+ const timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
36
+ const scrollPos = tfs[timingFunction](timePos);
37
+ const left = startX + (endX - startX) * scrollPos;
47
38
  elem.scrollTo({
48
- left: left
39
+ left
49
40
  });
50
41
  if (timePos !== 1) window.requestAnimationFrame(handleNewAnimationFrame);
51
42
  };
52
43
  window.requestAnimationFrame(handleNewAnimationFrame);
53
44
  };
54
- var animatedScrollToY = function animatedScrollToY(elem, pos) {
55
- var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, timingFunction = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 'easeInOut';
56
- var startTime;
57
- var startY = elem.scrollTop;
58
- var endY = Math.max(0, Math.min(elem.scrollHeight - elem.clientHeight, pos));
59
- var handleNewAnimationFrame = function handleNewAnimationFrame1() {
45
+ const animatedScrollToY = (elem, pos, duration = DEFAULT_DURATION, timingFunction = 'easeInOut')=>{
46
+ let startTime;
47
+ const startY = elem.scrollTop;
48
+ const endY = Math.max(0, Math.min(elem.scrollHeight - elem.clientHeight, pos));
49
+ const handleNewAnimationFrame = ()=>{
60
50
  startTime = startTime || Date.now();
61
- var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
62
- var scrollPos = tfs[timingFunction](timePos);
63
- var top = startY + (endY - startY) * scrollPos;
51
+ const timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
52
+ const scrollPos = tfs[timingFunction](timePos);
53
+ const top = startY + (endY - startY) * scrollPos;
64
54
  elem.scrollTo({
65
- top: top
55
+ top
66
56
  });
67
57
  if (timePos !== 1) window.requestAnimationFrame(handleNewAnimationFrame);
68
58
  };
@@ -11,4 +11,4 @@ Object.defineProperty(exports, "canUseDOM", {
11
11
  return canUseDOM;
12
12
  }
13
13
  });
14
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
14
+ const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
@@ -8,13 +8,9 @@ Object.defineProperty(exports, "extractTextFrom", {
8
8
  return extractTextFrom;
9
9
  }
10
10
  });
11
- var _react = require("react");
12
- function _type_of(obj) {
13
- "@swc/helpers - typeof";
14
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
15
- }
16
- var extractTextFrom = function extractTextFrom1(textSource) {
17
- switch(typeof textSource === "undefined" ? "undefined" : _type_of(textSource)){
11
+ const _react = require("react");
12
+ const extractTextFrom = (textSource)=>{
13
+ switch(typeof textSource){
18
14
  case 'string':
19
15
  return textSource;
20
16
  case 'number':
@@ -24,7 +20,7 @@ var extractTextFrom = function extractTextFrom1(textSource) {
24
20
  if (!(0, _react.isValidElement)(textSource) || !textSource.props || !textSource.props.children) {
25
21
  return '';
26
22
  }
27
- return _react.Children.map(textSource.props.children, function(child) {
23
+ return _react.Children.map(textSource.props.children, (child)=>{
28
24
  return extractTextFrom(child);
29
25
  }).join('');
30
26
  }
@@ -8,12 +8,7 @@ Object.defineProperty(exports, "FocusManager", {
8
8
  return FocusManager;
9
9
  }
10
10
  });
11
- var _tabbable = require("./tabbable");
12
- function _class_call_check(instance, Constructor) {
13
- if (!(instance instanceof Constructor)) {
14
- throw new TypeError("Cannot call a class as a function");
15
- }
16
- }
11
+ const _tabbable = require("./tabbable");
17
12
  function _define_property(obj, key, value) {
18
13
  if (key in obj) {
19
14
  Object.defineProperty(obj, key, {
@@ -27,45 +22,43 @@ function _define_property(obj, key, value) {
27
22
  }
28
23
  return obj;
29
24
  }
30
- var FocusManager = function FocusManager() {
31
- "use strict";
32
- var _this = this;
33
- _class_call_check(this, FocusManager);
34
- // массив с элементами, которые нужно зафокусить после анмаунта
35
- _define_property(this, "focusAfterElements", []);
36
- // массив с trap нодами
37
- _define_property(this, "focusNodes", []);
38
- _define_property(this, "handleFocus", function() {
39
- // Фокус всегда должен находиться внутри необходимой ноды
40
- var focusNode = _this.focusNodes[_this.focusNodes.length - 1];
41
- if (!focusNode || focusNode.contains(document.activeElement)) {
42
- return;
43
- }
44
- // Выделяем первый tabbable элемент
45
- var el = (0, _tabbable.findTabbableDescendants)(focusNode)[0] || focusNode;
46
- el.focus();
47
- });
48
- // добавление на фокус после анмаунта
49
- _define_property(this, "markForFocusAfter", function(focusAfterNode) {
50
- var node = focusAfterNode && focusAfterNode.current ? focusAfterNode.current : document.activeElement;
51
- _this.focusAfterElements.push(node);
52
- });
53
- // фокус на необходимый элемент
54
- _define_property(this, "returnFocus", function() {
55
- var _this_focusAfterElements_pop;
56
- var toFocus = (_this_focusAfterElements_pop = _this.focusAfterElements.pop()) !== null && _this_focusAfterElements_pop !== void 0 ? _this_focusAfterElements_pop : null;
57
- if (toFocus) {
58
- toFocus.focus();
59
- }
60
- });
61
- // при маунте ноды
62
- _define_property(this, "setupScopedFocus", function(element) {
63
- _this.focusNodes.push(element);
64
- document.addEventListener('focusin', _this.handleFocus, true);
65
- });
66
- // при анмаунте
67
- _define_property(this, "teardownScopedFocus", function() {
68
- _this.focusNodes.pop();
69
- document.removeEventListener('focusin', _this.handleFocus);
70
- });
71
- };
25
+ class FocusManager {
26
+ constructor(){
27
+ // массив с элементами, которые нужно зафокусить после анмаунта
28
+ _define_property(this, "focusAfterElements", []);
29
+ // массив с trap нодами
30
+ _define_property(this, "focusNodes", []);
31
+ _define_property(this, "handleFocus", ()=>{
32
+ // Фокус всегда должен находиться внутри необходимой ноды
33
+ const focusNode = this.focusNodes[this.focusNodes.length - 1];
34
+ if (!focusNode || focusNode.contains(document.activeElement)) {
35
+ return;
36
+ }
37
+ // Выделяем первый tabbable элемент
38
+ const el = (0, _tabbable.findTabbableDescendants)(focusNode)[0] || focusNode;
39
+ el.focus();
40
+ });
41
+ // добавление на фокус после анмаунта
42
+ _define_property(this, "markForFocusAfter", (focusAfterNode)=>{
43
+ const node = focusAfterNode && focusAfterNode.current ? focusAfterNode.current : document.activeElement;
44
+ this.focusAfterElements.push(node);
45
+ });
46
+ // фокус на необходимый элемент
47
+ _define_property(this, "returnFocus", ()=>{
48
+ const toFocus = this.focusAfterElements.pop() ?? null;
49
+ if (toFocus) {
50
+ toFocus.focus();
51
+ }
52
+ });
53
+ // при маунте ноды
54
+ _define_property(this, "setupScopedFocus", (element)=>{
55
+ this.focusNodes.push(element);
56
+ document.addEventListener('focusin', this.handleFocus, true);
57
+ });
58
+ // при анмаунте
59
+ _define_property(this, "teardownScopedFocus", ()=>{
60
+ this.focusNodes.pop();
61
+ document.removeEventListener('focusin', this.handleFocus);
62
+ });
63
+ }
64
+ }
@@ -14,11 +14,11 @@ Object.defineProperty(exports, "formatCurrency", {
14
14
  return formatCurrency;
15
15
  }
16
16
  });
17
- var formatCurrency = function formatCurrency(value, currency, minimumFractionDigits) {
18
- var formatter = new Intl.NumberFormat('ru', {
17
+ const formatCurrency = (value, currency, minimumFractionDigits)=>{
18
+ const formatter = new Intl.NumberFormat('ru', {
19
19
  style: 'currency',
20
- currency: currency,
21
- minimumFractionDigits: minimumFractionDigits
20
+ currency,
21
+ minimumFractionDigits
22
22
  });
23
23
  return formatter.format(value);
24
24
  };
@@ -25,22 +25,14 @@ _export(exports, {
25
25
  return padZeroNumber;
26
26
  }
27
27
  });
28
- var last = function last(array) {
29
- return array[array.length - 1];
30
- };
31
- var padZeroNumber = function padZeroNumber(value) {
32
- return "".concat(value).padStart(2, '0');
33
- };
34
- var monthName = function monthName(val, monthFormat) {
35
- var targetMonth = new Date(2000, val, 1);
28
+ const last = (array)=>array[array.length - 1];
29
+ const padZeroNumber = (value)=>`${value}`.padStart(2, '0');
30
+ const monthName = (val, monthFormat)=>{
31
+ const targetMonth = new Date(2000, val, 1);
36
32
  return last(new Intl.DateTimeFormat('ru-RU', {
37
33
  day: 'numeric',
38
34
  month: monthFormat
39
35
  }).formatToParts(targetMonth)).value;
40
36
  };
41
- var monthLongName = function monthLongName(val) {
42
- return monthName(val, 'long');
43
- };
44
- var monthShortName = function monthShortName(val) {
45
- return monthName(val, 'short').replace('.', '');
46
- };
37
+ const monthLongName = (val)=>monthName(val, 'long');
38
+ const monthShortName = (val)=>monthName(val, 'short').replace('.', '');
package/utils/index.js CHANGED
@@ -55,13 +55,13 @@ _export(exports, {
55
55
  return _transformStyles.transformStyles;
56
56
  }
57
57
  });
58
- var _animatedScrollTo = require("./animatedScrollTo");
59
- var _canUseDOM = require("./canUseDOM");
60
- var _roundness = require("./roundness");
61
- var _extractTextFrom = require("./extractTextFrom");
62
- var _formatters = require("./formatters");
63
- var _formatCurrency = require("./formatCurrency");
64
- var _setRef = require("./setRef");
65
- var _toCssSize = require("./toCssSize");
66
- var _transformStyles = require("./transformStyles");
67
- var _react = require("./react");
58
+ const _animatedScrollTo = require("./animatedScrollTo");
59
+ const _canUseDOM = require("./canUseDOM");
60
+ const _roundness = require("./roundness");
61
+ const _extractTextFrom = require("./extractTextFrom");
62
+ const _formatters = require("./formatters");
63
+ const _formatCurrency = require("./formatCurrency");
64
+ const _setRef = require("./setRef");
65
+ const _toCssSize = require("./toCssSize");
66
+ const _transformStyles = require("./transformStyles");
67
+ const _react = require("./react");
package/utils/react.js CHANGED
@@ -19,9 +19,9 @@ _export(exports, {
19
19
  return safeUseId;
20
20
  }
21
21
  });
22
- var _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
- var _reactdom = /*#__PURE__*/ _interop_require_default(require("react-dom"));
24
- var _useUniqId = require("../hooks/useUniqId");
22
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
+ const _reactdom = /*#__PURE__*/ _interop_require_default(require("react-dom"));
24
+ const _useUniqId = require("../hooks/useUniqId");
25
25
  function _interop_require_default(obj) {
26
26
  return obj && obj.__esModule ? obj : {
27
27
  default: obj
@@ -29,14 +29,14 @@ function _interop_require_default(obj) {
29
29
  }
30
30
  // TODO: https://github.com/salute-developers/plasma/issues/233
31
31
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- var flushSync = _reactdom.default.flushSync;
32
+ const { flushSync } = _reactdom.default;
33
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
- var useId = _react.default.useId;
35
- var IS_REACT_18 = _reactdom.default.version.split('.')[0] === '18';
34
+ const { useId } = _react.default;
35
+ const IS_REACT_18 = _reactdom.default.version.split('.')[0] === '18';
36
36
  function safeFlushSync(fn) {
37
37
  if (!IS_REACT_18) {
38
38
  return fn();
39
39
  }
40
40
  return flushSync(fn);
41
41
  }
42
- var safeUseId = !IS_REACT_18 ? _useUniqId.useUniqId : useId;
42
+ const safeUseId = !IS_REACT_18 ? _useUniqId.useUniqId : useId;
@@ -21,7 +21,7 @@ _export(exports, {
21
21
  return pins;
22
22
  }
23
23
  });
24
- var pins = {
24
+ const pins = {
25
25
  'square-square': 'r',
26
26
  'square-clear': 'r 0 0 r',
27
27
  'clear-square': '0 r r 0',
@@ -30,8 +30,7 @@ var pins = {
30
30
  'circle-clear': 'h 0 0 h',
31
31
  'circle-circle': 'h'
32
32
  };
33
- var convertRoundnessMatrix = function convertRoundnessMatrix(matrixKey, r, h) {
34
- return matrixKey && pins[matrixKey].split(' ').map(function(char) {
33
+ const convertRoundnessMatrix = (matrixKey, r, h)=>matrixKey && pins[matrixKey].split(' ').map((char)=>{
35
34
  switch(char){
36
35
  case 'r':
37
36
  return r;
@@ -41,4 +40,3 @@ var convertRoundnessMatrix = function convertRoundnessMatrix(matrixKey, r, h) {
41
40
  return char;
42
41
  }
43
42
  }).join(' ');
44
- };