@pedidopago/ui 1.7.26 → 1.8.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 (341) hide show
  1. package/dist/components/Alert/alert.test.js +1 -85
  2. package/dist/components/Alert/index.js +1 -63
  3. package/dist/components/Alert/styles.js +1 -32
  4. package/dist/components/Avatar/avatar.test.js +1 -67
  5. package/dist/components/Avatar/index.js +1 -94
  6. package/dist/components/Avatar/styles.js +1 -51
  7. package/dist/components/Badge/badge.test.js +1 -71
  8. package/dist/components/Badge/index.js +2 -43
  9. package/dist/components/Badge/styles.js +1 -33
  10. package/dist/components/Button/Button.test.js +1 -154
  11. package/dist/components/Button/index.js +1 -87
  12. package/dist/components/Button/styles.js +1 -112
  13. package/dist/components/Card/card.test.js +1 -30
  14. package/dist/components/Card/index.js +1 -44
  15. package/dist/components/Card/styles.js +1 -16
  16. package/dist/components/CheckboxInput/checkbox-input.test.js +1 -170
  17. package/dist/components/CheckboxInput/components/MultipleCheckbox.js +1 -205
  18. package/dist/components/CheckboxInput/index.js +1 -94
  19. package/dist/components/CheckboxInput/styles.js +1 -34
  20. package/dist/components/ChoiceList/index.d.ts +6 -0
  21. package/dist/components/ChoiceList/index.d.ts.map +1 -0
  22. package/dist/components/ChoiceList/index.js +1 -0
  23. package/dist/components/ChoiceList/styles.d.ts +22 -0
  24. package/dist/components/ChoiceList/styles.d.ts.map +1 -0
  25. package/dist/components/ChoiceList/styles.js +1 -0
  26. package/dist/components/ChoiceList/types.d.ts +24 -0
  27. package/dist/components/ChoiceList/types.d.ts.map +1 -0
  28. package/dist/components/ChoiceList/types.js +1 -0
  29. package/dist/components/CollapseCard/ExpandButton/index.js +1 -40
  30. package/dist/components/CollapseCard/ExpandButton/styles.js +1 -16
  31. package/dist/components/CollapseCard/expand-button.test.js +1 -161
  32. package/dist/components/CollapseCard/index.js +1 -98
  33. package/dist/components/CollapseCard/styles.js +1 -26
  34. package/dist/components/ColorPicker/colorpicker.test.js +1 -64
  35. package/dist/components/ColorPicker/components/ColorHue.js +1 -44
  36. package/dist/components/ColorPicker/components/ColorInput.js +1 -63
  37. package/dist/components/ColorPicker/components/ColorPickerBox.js +1 -52
  38. package/dist/components/ColorPicker/components/ColorPointer.js +1 -25
  39. package/dist/components/ColorPicker/components/ColorSelector.js +1 -107
  40. package/dist/components/ColorPicker/hooks/useCachedCallback.js +1 -16
  41. package/dist/components/ColorPicker/hooks/useHsva.js +1 -53
  42. package/dist/components/ColorPicker/index.js +1 -93
  43. package/dist/components/ColorPicker/styles.js +1 -46
  44. package/dist/components/ColorPicker/utils/checkers.js +1 -55
  45. package/dist/components/ColorPicker/utils/conversors.js +2 -243
  46. package/dist/components/ColorPicker/utils/parsers.js +10 -108
  47. package/dist/components/ComposeIcon/index.js +2 -48
  48. package/dist/components/ComposeIcon/styles.js +1 -53
  49. package/dist/components/DateInput/DateInput-example.js +7 -45
  50. package/dist/components/DateInput/components/ModalWrapper/index.js +1 -35
  51. package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -21
  52. package/dist/components/DateInput/dateInput.test.js +2 -43
  53. package/dist/components/DateInput/index.js +2 -104
  54. package/dist/components/DateInput/styles.js +1 -18
  55. package/dist/components/DatePicker/components/DatePickerContent.js +2 -222
  56. package/dist/components/DatePicker/components/DateYearPicker.js +1 -102
  57. package/dist/components/DatePicker/datepicker.test.js +1 -120
  58. package/dist/components/DatePicker/index.js +1 -236
  59. package/dist/components/DatePicker/styles.js +1 -88
  60. package/dist/components/DatePicker/utils/getMonthName.js +1 -11
  61. package/dist/components/Dialog/dialog-example.js +1 -46
  62. package/dist/components/Dialog/dialog.test.js +1 -68
  63. package/dist/components/Dialog/index.js +2 -100
  64. package/dist/components/Dialog/styles.js +1 -31
  65. package/dist/components/Dropzone/dropzone.test.js +1 -69
  66. package/dist/components/Dropzone/index.js +1 -289
  67. package/dist/components/Dropzone/styles.js +1 -75
  68. package/dist/components/Dropzone/utils/accepts.js +2 -27
  69. package/dist/components/EmojiPicker/Emote/index.js +2 -24
  70. package/dist/components/EmojiPicker/Emote/styles.js +1 -27
  71. package/dist/components/EmojiPicker/EmotePickerData/constants.js +1 -51
  72. package/dist/components/EmojiPicker/EmotePickerData/index.js +2 -159
  73. package/dist/components/EmojiPicker/EmotePickerData/styles.js +1 -57
  74. package/dist/components/EmojiPicker/EmotePickerData/utils.js +1 -41
  75. package/dist/components/EmojiPicker/Example/EmotePickerExample.js +1 -43
  76. package/dist/components/EmojiPicker/animation.js +1 -43
  77. package/dist/components/EmojiPicker/index.js +1 -169
  78. package/dist/components/EmojiPicker/styles.js +1 -21
  79. package/dist/components/Flex/flex.test.js +1 -336
  80. package/dist/components/Flex/index.js +1 -49
  81. package/dist/components/Flex/styles.js +1 -25
  82. package/dist/components/Grid/grid.test.js +1 -134
  83. package/dist/components/Grid/index.js +1 -51
  84. package/dist/components/Grid/styles.js +1 -48
  85. package/dist/components/Icon/data/beauty.js +2 -206
  86. package/dist/components/Icon/data/dash.js +2 -2
  87. package/dist/components/Icon/data/ecommerce.js +2 -94
  88. package/dist/components/Icon/data/form.js +2 -248
  89. package/dist/components/Icon/data/health.js +2 -255
  90. package/dist/components/Icon/data/illustrations.js +2 -318
  91. package/dist/components/Icon/data/men.js +2 -52
  92. package/dist/components/Icon/data/payment.js +2 -94
  93. package/dist/components/Icon/data/pedidoPago.js +2 -45
  94. package/dist/components/Icon/data/physicalPerfomance.js +2 -283
  95. package/dist/components/Icon/data/social.js +2 -24
  96. package/dist/components/Icon/data/status.js +2 -115
  97. package/dist/components/Icon/data/summer.js +2 -52
  98. package/dist/components/Icon/data/woman.js +2 -80
  99. package/dist/components/Icon/icon.test.js +1 -57
  100. package/dist/components/Icon/index.js +1 -53
  101. package/dist/components/Icon/scripts/build.js +9 -104
  102. package/dist/components/Icon/scripts/extractor.js +2 -33
  103. package/dist/components/Icon/scripts/run-build.js +2 -7
  104. package/dist/components/Icon/scripts/writers.js +3 -34
  105. package/dist/components/Icon/styles.js +1 -22
  106. package/dist/components/Icon/utils/allIcons.js +1 -28
  107. package/dist/components/Icon/utils/iconExists.js +1 -13
  108. package/dist/components/IconItem/IconItem.test.js +1 -58
  109. package/dist/components/IconItem/index.js +1 -52
  110. package/dist/components/IconItem/styles.js +1 -43
  111. package/dist/components/Illustration/illustration.test.js +4 -50
  112. package/dist/components/Illustration/index.js +2 -65
  113. package/dist/components/Illustration/styles.js +1 -65
  114. package/dist/components/ImageItem/imageFake.js +1 -25
  115. package/dist/components/ImageItem/index.js +2 -66
  116. package/dist/components/ImageItem/input.test.js +1 -85
  117. package/dist/components/ImageItem/styles.js +1 -61
  118. package/dist/components/Input/index.js +1 -163
  119. package/dist/components/Input/input.test.js +1 -120
  120. package/dist/components/Input/styles.js +1 -177
  121. package/dist/components/Label/index.js +1 -45
  122. package/dist/components/Label/label.test.js +1 -83
  123. package/dist/components/Label/styles.js +1 -21
  124. package/dist/components/List/index.js +1 -39
  125. package/dist/components/List/list.test.js +1 -64
  126. package/dist/components/List/styles.js +1 -23
  127. package/dist/components/Modal/ModalExample.js +1 -70
  128. package/dist/components/Modal/index.js +1 -145
  129. package/dist/components/Modal/modal.test.js +1 -179
  130. package/dist/components/Modal/styles.js +1 -33
  131. package/dist/components/MultipleSelect/MultipleSelect.test.js +1 -334
  132. package/dist/components/MultipleSelect/animations.js +1 -25
  133. package/dist/components/MultipleSelect/components/InputWrapper/index.js +1 -26
  134. package/dist/components/MultipleSelect/components/OptionsArea/index.js +1 -244
  135. package/dist/components/MultipleSelect/components/OptionsArea/styles.js +1 -68
  136. package/dist/components/MultipleSelect/components/SelectArea/ButtonsArea.js +1 -27
  137. package/dist/components/MultipleSelect/components/SelectArea/SelectAreaWrapper.js +1 -37
  138. package/dist/components/MultipleSelect/components/SelectArea/SelectedOptionsArea.js +1 -49
  139. package/dist/components/MultipleSelect/components/SelectArea/index.js +1 -100
  140. package/dist/components/MultipleSelect/components/SelectArea/styles.js +1 -36
  141. package/dist/components/MultipleSelect/components/index.js +1 -38
  142. package/dist/components/MultipleSelect/index.js +1 -209
  143. package/dist/components/NewSelect/Examples/constants.js +1 -56
  144. package/dist/components/NewSelect/Examples/index.js +1 -161
  145. package/dist/components/NewSelect/components/Chip/index.js +1 -36
  146. package/dist/components/NewSelect/components/Chip/styles.js +1 -24
  147. package/dist/components/NewSelect/components/OptionsSelect/styles.js +1 -21
  148. package/dist/components/NewSelect/components/SelectInputSearch/index.js +1 -24
  149. package/dist/components/NewSelect/components/SelectItem/index.js +1 -22
  150. package/dist/components/NewSelect/components/SelectItem/styles.js +1 -24
  151. package/dist/components/NewSelect/index.js +1 -18
  152. package/dist/components/NewSelect/multiple/index.js +1 -246
  153. package/dist/components/NewSelect/newSelect.test.js +1 -108
  154. package/dist/components/NewSelect/single/index.js +1 -183
  155. package/dist/components/NewSelect/styles.js +1 -44
  156. package/dist/components/Observer/index.js +1 -59
  157. package/dist/components/Observer/observer.test.js +2 -43
  158. package/dist/components/Pagination/hooks/usePagination.js +1 -57
  159. package/dist/components/Pagination/index.js +1 -174
  160. package/dist/components/Pagination/pagination.test.js +1 -118
  161. package/dist/components/Pagination/styles.js +1 -78
  162. package/dist/components/Progress/Circle/index.js +1 -102
  163. package/dist/components/Progress/Circle/styles.js +1 -69
  164. package/dist/components/Progress/Linear/index.js +1 -62
  165. package/dist/components/Progress/Linear/styles.js +1 -66
  166. package/dist/components/Progress/getSteps.js +1 -17
  167. package/dist/components/Progress/index.js +1 -39
  168. package/dist/components/Progress/progress.test.js +1 -109
  169. package/dist/components/Radio/components/RadioGroup/index.d.ts +5 -0
  170. package/dist/components/Radio/components/RadioGroup/index.d.ts.map +1 -0
  171. package/dist/components/Radio/components/RadioGroup/index.js +1 -0
  172. package/dist/components/Radio/components/RadioGroup/styles.d.ts +19 -0
  173. package/dist/components/Radio/components/RadioGroup/styles.d.ts.map +1 -0
  174. package/dist/components/Radio/components/RadioGroup/styles.js +1 -0
  175. package/dist/components/Radio/components/RadioGroup/types.d.ts +17 -0
  176. package/dist/components/Radio/components/RadioGroup/types.d.ts.map +1 -0
  177. package/dist/components/Radio/components/RadioGroup/types.js +1 -0
  178. package/dist/components/Radio/index.d.ts +5 -0
  179. package/dist/components/Radio/index.d.ts.map +1 -0
  180. package/dist/components/Radio/index.js +1 -0
  181. package/dist/components/Radio/styles.d.ts +10 -0
  182. package/dist/components/Radio/styles.d.ts.map +1 -0
  183. package/dist/components/Radio/styles.js +1 -0
  184. package/dist/components/Radio/types.d.ts +6 -0
  185. package/dist/components/Radio/types.d.ts.map +1 -0
  186. package/dist/components/Radio/types.js +1 -0
  187. package/dist/components/Rating/index.js +1 -133
  188. package/dist/components/Rating/rating.test.js +1 -63
  189. package/dist/components/Rating/styles.js +1 -27
  190. package/dist/components/ReactPortal/index.js +1 -43
  191. package/dist/components/ReactPortal/reactPortal.test.js +1 -21
  192. package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +1 -12
  193. package/dist/components/Select/components/OptionsSelect/index.js +1 -73
  194. package/dist/components/Select/components/OptionsSelect/styles.js +1 -21
  195. package/dist/components/Select/index.js +4 -247
  196. package/dist/components/Select/select.test.js +1 -58
  197. package/dist/components/Select/styles.js +1 -46
  198. package/dist/components/Skeleton/index.js +1 -28
  199. package/dist/components/Skeleton/skeleton.test.js +1 -90
  200. package/dist/components/Skeleton/styles.js +1 -27
  201. package/dist/components/Slider/SliderExample.js +1 -52
  202. package/dist/components/Slider/components/SliderPointer.js +1 -39
  203. package/dist/components/Slider/components/SliderRail.js +1 -116
  204. package/dist/components/Slider/components/SliderSelector.js +1 -173
  205. package/dist/components/Slider/hooks/useEventCallback.js +1 -16
  206. package/dist/components/Slider/index.js +1 -137
  207. package/dist/components/Slider/slider.test.js +1 -121
  208. package/dist/components/Slider/styles.js +1 -69
  209. package/dist/components/Spinner/index.js +1 -26
  210. package/dist/components/Spinner/spinner.test.js +1 -45
  211. package/dist/components/Spinner/styles.js +1 -23
  212. package/dist/components/Steps/components/StepIcon/index.js +1 -50
  213. package/dist/components/Steps/components/StepIcon/styles.js +1 -42
  214. package/dist/components/Steps/components/StepIcon/utils.js +1 -22
  215. package/dist/components/Steps/index.js +1 -116
  216. package/dist/components/Steps/steps.test.js +1 -53
  217. package/dist/components/Steps/styles.js +1 -96
  218. package/dist/components/Steps/utils.js +1 -15
  219. package/dist/components/Switch/index.js +1 -73
  220. package/dist/components/Switch/styles.js +1 -58
  221. package/dist/components/Switch/switch.test.js +2 -115
  222. package/dist/components/Table/components/MenuItem.js +1 -59
  223. package/dist/components/Table/components/TableSkeleton.js +1 -39
  224. package/dist/components/Table/components/animations.js +1 -24
  225. package/dist/components/Table/index.js +2 -253
  226. package/dist/components/Table/styles.js +1 -49
  227. package/dist/components/Table/table.test.js +1 -114
  228. package/dist/components/Tabs/TabsExample.js +1 -64
  229. package/dist/components/Tabs/components/Tab.js +1 -49
  230. package/dist/components/Tabs/components/TabPanel.js +1 -25
  231. package/dist/components/Tabs/components/Tabs.js +1 -107
  232. package/dist/components/Tabs/index.js +1 -26
  233. package/dist/components/Tabs/styles.js +1 -61
  234. package/dist/components/Tabs/tabs.test.js +1 -146
  235. package/dist/components/Tag/index.js +1 -53
  236. package/dist/components/Tag/styles.js +1 -34
  237. package/dist/components/Tag/tag.test.js +1 -64
  238. package/dist/components/TextAreaInput/index.js +1 -74
  239. package/dist/components/TextAreaInput/styles.js +1 -53
  240. package/dist/components/TextAreaInput/text-area-input.test.js +1 -81
  241. package/dist/components/Thumbnail/index.js +1 -125
  242. package/dist/components/Thumbnail/styles.js +1 -47
  243. package/dist/components/Thumbnail/thumbnail.test.js +1 -66
  244. package/dist/components/Thumbnail/utils/index.js +1 -27
  245. package/dist/components/Thumbnail/utils/validate-file-size.js +1 -10
  246. package/dist/components/Thumbnail/utils/validate-file-type.js +1 -9
  247. package/dist/components/TimeInput/constants.js +1 -29
  248. package/dist/components/TimeInput/index.js +1 -288
  249. package/dist/components/TimeInput/styles.js +1 -34
  250. package/dist/components/TimeInput/utils.js +1 -94
  251. package/dist/components/Timeline/components/Timeline.js +1 -17
  252. package/dist/components/Timeline/components/TimelineContent.js +1 -61
  253. package/dist/components/Timeline/components/TimelineItem.js +1 -25
  254. package/dist/components/Timeline/components/TimelineSeparator.js +1 -20
  255. package/dist/components/Timeline/index.js +1 -33
  256. package/dist/components/Timeline/styles.js +1 -37
  257. package/dist/components/Timeline/timeline.test.js +1 -138
  258. package/dist/components/Toast/button-example.js +1 -31
  259. package/dist/components/Toast/components/Toast.js +1 -79
  260. package/dist/components/Toast/contexts/ToastProvider.js +1 -72
  261. package/dist/components/Toast/hooks/useToast.js +1 -18
  262. package/dist/components/Toast/index.js +1 -111
  263. package/dist/components/Toast/styles.js +1 -36
  264. package/dist/components/Toast/toast.test.js +1 -129
  265. package/dist/components/Tooltip/components/TooltipLabel.js +1 -71
  266. package/dist/components/Tooltip/example.js +1 -27
  267. package/dist/components/Tooltip/index.js +1 -187
  268. package/dist/components/Tooltip/styles.js +1 -20
  269. package/dist/components/Typography/index.js +1 -37
  270. package/dist/components/Typography/styles.js +1 -15
  271. package/dist/components/Typography/typography.test.js +1 -288
  272. package/dist/index.d.ts +5 -2
  273. package/dist/index.d.ts.map +1 -1
  274. package/dist/index.js +1 -548
  275. package/dist/shared/animations/opacityAnimation.js +1 -21
  276. package/dist/shared/assets/emotes.js +1 -1
  277. package/dist/shared/components/FocusLock/index.js +5 -86
  278. package/dist/shared/formatters/format-number.js +5 -41
  279. package/dist/shared/global.js +1 -8
  280. package/dist/shared/hooks/devices.js +1 -14
  281. package/dist/shared/hooks/useBreakpoints.js +2 -95
  282. package/dist/shared/hooks/useDebounce.js +1 -35
  283. package/dist/shared/hooks/useDevices.js +2 -42
  284. package/dist/shared/hooks/useDisableBodyScroll.js +5 -52
  285. package/dist/shared/hooks/useDraggableScroll/index.js +5 -65
  286. package/dist/shared/hooks/useKeyPress.js +1 -18
  287. package/dist/shared/hooks/useObserver.js +2 -29
  288. package/dist/shared/hooks/useOnClickOutside.js +1 -30
  289. package/dist/shared/hooks/useReposition/index.js +2 -53
  290. package/dist/shared/hooks/useSystemTheme.js +1 -38
  291. package/dist/shared/hooks/useWindowSize.js +1 -36
  292. package/dist/shared/tests/test-utils.js +1 -31
  293. package/dist/shared/theme/button-example.js +1 -31
  294. package/dist/shared/theme/contexts/ThemeContext.js +1 -90
  295. package/dist/shared/theme/hooks/useColorMode.js +1 -18
  296. package/dist/shared/theme/hooks/useColorModeValue.js +1 -13
  297. package/dist/shared/theme/hooks/useTheme.js +1 -17
  298. package/dist/shared/theme/index.js +1 -67
  299. package/dist/shared/theme/objects/breakpoints.js +1 -15
  300. package/dist/shared/theme/objects/colors.js +1 -177
  301. package/dist/shared/theme/objects/shadows.js +1 -19
  302. package/dist/shared/theme/objects/sizes.js +6 -33
  303. package/dist/shared/theme/objects/spaces.js +1 -75
  304. package/dist/shared/theme/objects/transitions.js +1 -10
  305. package/dist/shared/theme/objects/typography.js +1 -20
  306. package/dist/shared/theme/objects/z-indexes.js +1 -20
  307. package/dist/shared/theme/theme.js +1 -36
  308. package/dist/shared/theme/theme.test.js +1 -94
  309. package/dist/shared/theme/utils/extendTheme.js +1 -25
  310. package/dist/shared/theme/utils/localStorageController.js +1 -21
  311. package/dist/styled.d.js +1 -3
  312. package/dist/utils/GenerateKey.js +3 -18
  313. package/dist/utils/brightnessColorChange.js +2 -17
  314. package/dist/utils/colorCheck.js +6 -64
  315. package/dist/utils/colorFunctions.js +1 -39
  316. package/dist/utils/colorToGray.js +2 -64
  317. package/dist/utils/customColorMode.js +1 -11
  318. package/dist/utils/file.js +5 -124
  319. package/dist/utils/formatters/bytes.js +2 -17
  320. package/dist/utils/formatters/capitalize.js +2 -11
  321. package/dist/utils/formatters/cep.js +3 -18
  322. package/dist/utils/formatters/cnpj.js +4 -38
  323. package/dist/utils/formatters/color.js +12 -101
  324. package/dist/utils/formatters/cpf.js +16 -85
  325. package/dist/utils/formatters/credit-card.js +5 -54
  326. package/dist/utils/formatters/email.js +1 -8
  327. package/dist/utils/formatters/index.js +1 -170
  328. package/dist/utils/formatters/name.js +4 -31
  329. package/dist/utils/formatters/number.js +5 -14
  330. package/dist/utils/formatters/passport.js +5 -33
  331. package/dist/utils/formatters/phone.js +17 -214
  332. package/dist/utils/formatters/price.js +3 -21
  333. package/dist/utils/formatters/rg.js +3 -18
  334. package/dist/utils/formatters/strings.js +4 -27
  335. package/dist/utils/fuctionsColors.js +1 -39
  336. package/dist/utils/generateUUID.js +1 -13
  337. package/dist/utils/getColorValue.js +2 -23
  338. package/dist/utils/getSvg.js +1 -17
  339. package/dist/utils/getValuesBySize.js +1 -9
  340. package/dist/utils/invertColor.js +4 -40
  341. package/package.json +2 -1
@@ -1,57 +1 @@
1
- "use strict";
2
-
3
- var _testUtils = require("../../shared/tests/test-utils");
4
- var _react = require("@testing-library/react");
5
- require("@testing-library/jest-dom");
6
- var _ = _interopRequireDefault(require("."));
7
- var _jsxRuntime = require("react/jsx-runtime");
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
- var setup = function setup(props) {
16
- var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({
17
- "data-testid": "icon"
18
- }, props)));
19
- var icon = _react.screen.getByTestId('icon');
20
- return _objectSpread(_objectSpread({}, utils), {}, {
21
- icon: icon
22
- });
23
- };
24
- describe('Icon', function () {
25
- it('should to render icon component', function () {
26
- var _setup = setup({
27
- name: 'check',
28
- color: 'primary.default'
29
- }),
30
- icon = _setup.icon;
31
- expect(icon).toBeInTheDocument();
32
- });
33
- it('should to render icon component with size', function () {
34
- var _setup2 = setup({
35
- name: 'check',
36
- size: '1rem',
37
- color: 'background.light'
38
- }),
39
- icon = _setup2.icon;
40
- expect(icon).toHaveAttribute('width', '1rem');
41
- expect(icon).toHaveAttribute('height', '1rem');
42
- });
43
- it('should to render payment icon component', function () {
44
- var _setup3 = setup({
45
- name: 'pmt-paypal'
46
- }),
47
- icon = _setup3.icon;
48
- expect(icon).toBeInTheDocument();
49
- });
50
- it('should to render illustration icon component', function () {
51
- var _setup4 = setup({
52
- name: 'illust-banking-billet'
53
- }),
54
- icon = _setup4.icon;
55
- expect(icon).toBeInTheDocument();
56
- });
57
- });
1
+ "use strict";var _testUtils=require("../../shared/tests/test-utils"),_react=require("@testing-library/react");require("@testing-library/jest-dom");var _=_interopRequireDefault(require(".")),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var setup=function(props){var utils=(0,_testUtils.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_.default,_objectSpread({"data-testid":"icon"},props))),icon=_react.screen.getByTestId("icon");return _objectSpread(_objectSpread({},utils),{},{icon:icon})};describe("Icon",function(){it("should to render icon component",function(){var _setup=setup({name:"check",color:"primary.default"}),icon=_setup.icon;expect(icon).toBeInTheDocument()}),it("should to render icon component with size",function(){var _setup2=setup({name:"check",size:"1rem",color:"background.light"}),icon=_setup2.icon;expect(icon).toHaveAttribute("width","1rem"),expect(icon).toHaveAttribute("height","1rem")}),it("should to render payment icon component",function(){var _setup3=setup({name:"pmt-paypal"}),icon=_setup3.icon;expect(icon).toBeInTheDocument()}),it("should to render illustration icon component",function(){var _setup4=setup({name:"illust-banking-billet"}),icon=_setup4.icon;expect(icon).toBeInTheDocument()})});
@@ -1,53 +1 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _theme = require("../../shared/theme");
9
- var _getSvg2 = require("../../utils/getSvg");
10
- var _getColorValue = require("../../utils/getColorValue");
11
- var _styles = require("./styles");
12
- var _allIcons = require("./utils/allIcons");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- var _excluded = ["name", "color", "secondColor", "size"];
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
- var Icon = function Icon(_ref) {
23
- var name = _ref.name,
24
- color = _ref.color,
25
- secondColor = _ref.secondColor,
26
- size = _ref.size,
27
- rest = _objectWithoutProperties(_ref, _excluded);
28
- var _getSvg = (0, _getSvg2.getSvg)(name, _allIcons.allIcons),
29
- viewBox = _getSvg.viewBox,
30
- html = _getSvg.html,
31
- xmlns = _getSvg.xmlns,
32
- width = _getSvg.width,
33
- height = _getSvg.height;
34
- var _useTheme = (0, _theme.useTheme)(),
35
- theme = _useTheme.theme;
36
- var havePrimaryColor = html.match(/#22E0A1/g);
37
- var haveErrorColor = html.match(/fill="#F64F77"/g);
38
- var parsedHtml = havePrimaryColor ? html.replace(/fill="#22E0A1"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(secondColor || 'primary.default', theme), "\"")).replace(/fill="#34423D"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(color || '', theme), "\"")) : haveErrorColor ? html.replace(/fill="#22E0A1"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(secondColor || 'errors.default', theme), "\"")).replace(/fill="#34423D"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(color || '', theme), "\"")) : html;
39
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconComponent, _objectSpread({
40
- colorText: color,
41
- havePrimaryColor: havePrimaryColor || haveErrorColor,
42
- xmlns: xmlns,
43
- name: name,
44
- viewBox: viewBox,
45
- width: size || width,
46
- height: size || height,
47
- dangerouslySetInnerHTML: {
48
- __html: parsedHtml
49
- }
50
- }, rest));
51
- };
52
- var _default = Icon;
53
- exports.default = _default;
1
+ "use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _theme=require("../../shared/theme"),_getSvg2=require("../../utils/getSvg"),_getColorValue=require("../../utils/getColorValue"),_styles=require("./styles"),_allIcons=require("./utils/allIcons"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["name","color","secondColor","size"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}var Icon=function(_ref){var name=_ref.name,color=_ref.color,secondColor=_ref.secondColor,size=_ref.size,rest=_objectWithoutProperties(_ref,_excluded),_getSvg=(0,_getSvg2.getSvg)(name,_allIcons.allIcons),viewBox=_getSvg.viewBox,html=_getSvg.html,xmlns=_getSvg.xmlns,width=_getSvg.width,height=_getSvg.height,_useTheme=(0,_theme.useTheme)(),theme=_useTheme.theme,havePrimaryColor=html.match(/#22E0A1/g),haveErrorColor=html.match(/fill="#F64F77"/g),parsedHtml=havePrimaryColor?html.replace(/fill="#22E0A1"/g,"fill=\"".concat((0,_getColorValue.getColorValue)(secondColor||"primary.default",theme),"\"")).replace(/fill="#34423D"/g,"fill=\"".concat((0,_getColorValue.getColorValue)(color||"",theme),"\"")):haveErrorColor?html.replace(/fill="#22E0A1"/g,"fill=\"".concat((0,_getColorValue.getColorValue)(secondColor||"errors.default",theme),"\"")).replace(/fill="#34423D"/g,"fill=\"".concat((0,_getColorValue.getColorValue)(color||"",theme),"\"")):html;return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconComponent,_objectSpread({colorText:color,havePrimaryColor:havePrimaryColor||haveErrorColor,xmlns:xmlns,name:name,viewBox:viewBox,width:size||width,height:size||height,dangerouslySetInnerHTML:{__html:parsedHtml}},rest))},_default=Icon;exports.default=_default;
@@ -1,105 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _path = _interopRequireDefault(require("path"));
8
- var _fs = _interopRequireDefault(require("fs"));
9
- var _extractor = _interopRequireDefault(require("./extractor"));
10
- var _writers = require("./writers");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } // server side
18
- var twirlTimer = function twirlTimer() {
19
- var P = ['\\', '|', '/', '-'];
20
- var x = 0;
21
- return setInterval(function () {
22
- process.stdout.write('\rBuilding icons... ' + P[x++]);
23
- x &= 3;
24
- }, 250);
25
- };
26
-
27
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _path=_interopRequireDefault(require("path")),_fs=_interopRequireDefault(require("fs")),_extractor=_interopRequireDefault(require("./extractor")),_writers=require("./writers");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}// server side
2
+ var twirlTimer=function(){var P=["\\","|","/","-"],x=0;return setInterval(function(){process.stdout.write("\rBuilding icons... "+P[x++]),x&=3},250)},builder=function(){var timer=twirlTimer(),dashIconsPath=_path.default.join(__dirname,"..","assets","icons","dash"),ecommerceIconsPath=_path.default.join(__dirname,"..","assets","icons","ecommerce"),socialIconsPath=_path.default.join(__dirname,"..","assets","icons","social"),paymentIconsPath=_path.default.join(__dirname,"..","assets","icons","payment"),illustrationsIconsPath=_path.default.join(__dirname,"..","assets","icons","illustrations"),formIconsPath=_path.default.join(__dirname,"..","assets","icons","form"),beautyCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","beauty"),healthCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","health"),menCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","men"),womanCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","woman"),summerCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","summer"),statusCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","status"),physicalCategoryPath=_path.default.join(__dirname,"..","assets","icons","categories","physical-perfomance"),pedidoPagoPath=_path.default.join(__dirname,"..","assets","icons","pedido-pago"),formIconsFiles=_fs.default.readdirSync(formIconsPath),dashIconsFiles=_fs.default.readdirSync(dashIconsPath),ecommerceIconsFiles=_fs.default.readdirSync(ecommerceIconsPath),socialIconsFiles=_fs.default.readdirSync(socialIconsPath),paymentIconsFiles=_fs.default.readdirSync(paymentIconsPath),illustrationsIconsFiles=_fs.default.readdirSync(illustrationsIconsPath),beautyCategoryFiles=_fs.default.readdirSync(beautyCategoryPath),healthCategoryFiles=_fs.default.readdirSync(healthCategoryPath),menCategoryFiles=_fs.default.readdirSync(menCategoryPath),womanCategoryFiles=_fs.default.readdirSync(womanCategoryPath),summerCategoryFiles=_fs.default.readdirSync(summerCategoryPath),statusCategoryFiles=_fs.default.readdirSync(statusCategoryPath),physicalCategoryFiles=_fs.default.readdirSync(physicalCategoryPath),pedidoPagoFiles=_fs.default.readdirSync(pedidoPagoPath),formIcons=(0,_extractor.default)(formIconsFiles,formIconsPath),dashIcons=(0,_extractor.default)(dashIconsFiles,dashIconsPath),ecommerceIcons=(0,_extractor.default)(ecommerceIconsFiles,ecommerceIconsPath),socialIcons=(0,_extractor.default)(socialIconsFiles,socialIconsPath),paymentIcons=(0,_extractor.default)(paymentIconsFiles,paymentIconsPath),illustrationsIcons=(0,_extractor.default)(illustrationsIconsFiles,illustrationsIconsPath),beautyIcons=(0,_extractor.default)(beautyCategoryFiles,beautyCategoryPath),healthIcons=(0,_extractor.default)(healthCategoryFiles,healthCategoryPath),menIcons=(0,_extractor.default)(menCategoryFiles,menCategoryPath),womanIcons=(0,_extractor.default)(womanCategoryFiles,womanCategoryPath),summerIcons=(0,_extractor.default)(summerCategoryFiles,summerCategoryPath),statusIcons=(0,_extractor.default)(statusCategoryFiles,statusCategoryPath),physicalIcons=(0,_extractor.default)(physicalCategoryFiles,physicalCategoryPath),pedidoPagoIcons=(0,_extractor.default)(pedidoPagoFiles,pedidoPagoPath),allIcons=[].concat(_toConsumableArray(dashIcons),_toConsumableArray(ecommerceIcons),_toConsumableArray(socialIcons),_toConsumableArray(paymentIcons),_toConsumableArray(illustrationsIcons),_toConsumableArray(beautyIcons),_toConsumableArray(healthIcons),_toConsumableArray(menIcons),_toConsumableArray(womanIcons),_toConsumableArray(summerIcons),_toConsumableArray(statusIcons),_toConsumableArray(physicalIcons),_toConsumableArray(formIcons),_toConsumableArray(pedidoPagoIcons));// icons by category
3
+ // list of all the icons
4
+ // extract icons from svg files and generate array of icons
5
+ // write icons to file
6
+ // write types file
7
+ // stop twirl timer
8
+ (0,_writers.writeIconsFile)(dashIcons,"dash",!0),(0,_writers.writeIconsFile)(ecommerceIcons,"ecommerce",!0),(0,_writers.writeIconsFile)(socialIcons,"social",!0),(0,_writers.writeIconsFile)(paymentIcons,"payment",!0),(0,_writers.writeIconsFile)(illustrationsIcons,"illustrations",!0),(0,_writers.writeIconsFile)(beautyIcons,"beauty",!0),(0,_writers.writeIconsFile)(healthIcons,"health",!0),(0,_writers.writeIconsFile)(menIcons,"men",!0),(0,_writers.writeIconsFile)(womanIcons,"woman",!0),(0,_writers.writeIconsFile)(summerIcons,"summer",!0),(0,_writers.writeIconsFile)(statusIcons,"status",!0),(0,_writers.writeIconsFile)(physicalIcons,"physicalPerfomance",!0),(0,_writers.writeIconsFile)(formIcons,"form",!0),(0,_writers.writeIconsFile)(pedidoPagoIcons,"pedidoPago",!0),(0,_writers.writeTypesFile)(allIcons,!0),clearInterval(timer)},_default=builder;/**
28
9
  * Builds the icons and types files.
29
- */
30
- var builder = function builder() {
31
- var timer = twirlTimer();
32
- var dashIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'dash');
33
- var ecommerceIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'ecommerce');
34
- var socialIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'social');
35
- var paymentIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'payment');
36
- var illustrationsIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'illustrations');
37
- var formIconsPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'form');
38
-
39
- // icons by category
40
- var beautyCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'beauty');
41
- var healthCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'health');
42
- var menCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'men');
43
- var womanCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'woman');
44
- var summerCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'summer');
45
- var statusCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'status');
46
- var physicalCategoryPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'categories', 'physical-perfomance');
47
- var pedidoPagoPath = _path.default.join(__dirname, '..', 'assets', 'icons', 'pedido-pago');
48
-
49
- // list of all the icons
50
- var formIconsFiles = _fs.default.readdirSync(formIconsPath);
51
- var dashIconsFiles = _fs.default.readdirSync(dashIconsPath);
52
- var ecommerceIconsFiles = _fs.default.readdirSync(ecommerceIconsPath);
53
- var socialIconsFiles = _fs.default.readdirSync(socialIconsPath);
54
- var paymentIconsFiles = _fs.default.readdirSync(paymentIconsPath);
55
- var illustrationsIconsFiles = _fs.default.readdirSync(illustrationsIconsPath);
56
- var beautyCategoryFiles = _fs.default.readdirSync(beautyCategoryPath);
57
- var healthCategoryFiles = _fs.default.readdirSync(healthCategoryPath);
58
- var menCategoryFiles = _fs.default.readdirSync(menCategoryPath);
59
- var womanCategoryFiles = _fs.default.readdirSync(womanCategoryPath);
60
- var summerCategoryFiles = _fs.default.readdirSync(summerCategoryPath);
61
- var statusCategoryFiles = _fs.default.readdirSync(statusCategoryPath);
62
- var physicalCategoryFiles = _fs.default.readdirSync(physicalCategoryPath);
63
- var pedidoPagoFiles = _fs.default.readdirSync(pedidoPagoPath);
64
-
65
- // extract icons from svg files and generate array of icons
66
- var formIcons = (0, _extractor.default)(formIconsFiles, formIconsPath);
67
- var dashIcons = (0, _extractor.default)(dashIconsFiles, dashIconsPath);
68
- var ecommerceIcons = (0, _extractor.default)(ecommerceIconsFiles, ecommerceIconsPath);
69
- var socialIcons = (0, _extractor.default)(socialIconsFiles, socialIconsPath);
70
- var paymentIcons = (0, _extractor.default)(paymentIconsFiles, paymentIconsPath);
71
- var illustrationsIcons = (0, _extractor.default)(illustrationsIconsFiles, illustrationsIconsPath);
72
- var beautyIcons = (0, _extractor.default)(beautyCategoryFiles, beautyCategoryPath);
73
- var healthIcons = (0, _extractor.default)(healthCategoryFiles, healthCategoryPath);
74
- var menIcons = (0, _extractor.default)(menCategoryFiles, menCategoryPath);
75
- var womanIcons = (0, _extractor.default)(womanCategoryFiles, womanCategoryPath);
76
- var summerIcons = (0, _extractor.default)(summerCategoryFiles, summerCategoryPath);
77
- var statusIcons = (0, _extractor.default)(statusCategoryFiles, statusCategoryPath);
78
- var physicalIcons = (0, _extractor.default)(physicalCategoryFiles, physicalCategoryPath);
79
- var pedidoPagoIcons = (0, _extractor.default)(pedidoPagoFiles, pedidoPagoPath);
80
- var allIcons = [].concat(_toConsumableArray(dashIcons), _toConsumableArray(ecommerceIcons), _toConsumableArray(socialIcons), _toConsumableArray(paymentIcons), _toConsumableArray(illustrationsIcons), _toConsumableArray(beautyIcons), _toConsumableArray(healthIcons), _toConsumableArray(menIcons), _toConsumableArray(womanIcons), _toConsumableArray(summerIcons), _toConsumableArray(statusIcons), _toConsumableArray(physicalIcons), _toConsumableArray(formIcons), _toConsumableArray(pedidoPagoIcons));
81
-
82
- // write icons to file
83
- (0, _writers.writeIconsFile)(dashIcons, 'dash', true);
84
- (0, _writers.writeIconsFile)(ecommerceIcons, 'ecommerce', true);
85
- (0, _writers.writeIconsFile)(socialIcons, 'social', true);
86
- (0, _writers.writeIconsFile)(paymentIcons, 'payment', true);
87
- (0, _writers.writeIconsFile)(illustrationsIcons, 'illustrations', true);
88
- (0, _writers.writeIconsFile)(beautyIcons, 'beauty', true);
89
- (0, _writers.writeIconsFile)(healthIcons, 'health', true);
90
- (0, _writers.writeIconsFile)(menIcons, 'men', true);
91
- (0, _writers.writeIconsFile)(womanIcons, 'woman', true);
92
- (0, _writers.writeIconsFile)(summerIcons, 'summer', true);
93
- (0, _writers.writeIconsFile)(statusIcons, 'status', true);
94
- (0, _writers.writeIconsFile)(physicalIcons, 'physicalPerfomance', true);
95
- (0, _writers.writeIconsFile)(formIcons, 'form', true);
96
- (0, _writers.writeIconsFile)(pedidoPagoIcons, 'pedidoPago', true);
97
-
98
- // write types file
99
- (0, _writers.writeTypesFile)(allIcons, true);
100
-
101
- // stop twirl timer
102
- clearInterval(timer);
103
- };
104
- var _default = builder;
105
- exports.default = _default;
10
+ */exports.default=_default;
@@ -1,37 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _path = _interopRequireDefault(require("path"));
8
- var _fs = require("fs");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _path=_interopRequireDefault(require("path")),_fs=require("fs");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}/**
11
2
  * Extractor is a function that extracts the svg content from the icon file.
12
3
  * @param files - The directory with the files to extract.
13
4
  * @param currentPath - The current path of the file
14
5
  * @returns Array of objects with the name and the content of the icon svg.
15
- */
16
- var extractor = function extractor(files, currentPath) {
17
- return files.map(function (file) {
18
- var iconPath = _path.default.join(currentPath, file);
19
- var iconName = file.split('.')[0];
20
- var iconSvgContent = (0, _fs.readFileSync)(iconPath, 'utf8');
21
- var iconSvgWidth = iconSvgContent.match(/^<svg[^>]*width\s*=\s*"?(\d+)"?[^>]*>/) || [];
22
- var iconSvgHeight = iconSvgContent.match(/^<svg[^>]*height\s*=\s*"?(\d+)"?[^>]*>/) || [];
23
- var iconSvgViewBox = iconSvgContent.match(/^<svg[^>]*viewBox\s*=\s*"?([^"]+)"?[^>]*>/) || [];
24
- var iconSvgXlmns = iconSvgContent.match(/^<svg[^>]*xmlns\s*=\s*"?([^"]+)"?[^>]*>/) || [];
25
- var iconSvgHtml = iconSvgContent.replace(/<svg[^>]*>/, '').replace(/<\/svg>/, '').replace(/(\r\n|\n|\r)/gm, '');
26
- return {
27
- name: iconName,
28
- width: iconSvgWidth[1],
29
- height: iconSvgHeight[1],
30
- viewBox: iconSvgViewBox[1],
31
- xmlns: iconSvgXlmns[1],
32
- html: iconSvgHtml
33
- };
34
- });
35
- };
36
- var _default = extractor;
37
- exports.default = _default;
6
+ */var extractor=function(files,currentPath){return files.map(function(file){var iconPath=_path.default.join(currentPath,file),iconName=file.split(".")[0],iconSvgContent=(0,_fs.readFileSync)(iconPath,"utf8"),iconSvgWidth=iconSvgContent.match(/^<svg[^>]*width\s*=\s*"?(\d+)"?[^>]*>/)||[],iconSvgHeight=iconSvgContent.match(/^<svg[^>]*height\s*=\s*"?(\d+)"?[^>]*>/)||[],iconSvgViewBox=iconSvgContent.match(/^<svg[^>]*viewBox\s*=\s*"?([^"]+)"?[^>]*>/)||[],iconSvgXlmns=iconSvgContent.match(/^<svg[^>]*xmlns\s*=\s*"?([^"]+)"?[^>]*>/)||[],iconSvgHtml=iconSvgContent.replace(/<svg[^>]*>/,"").replace(/<\/svg>/,"").replace(/(\r\n|\n|\r)/gm,"");return{name:iconName,width:iconSvgWidth[1],height:iconSvgHeight[1],viewBox:iconSvgViewBox[1],xmlns:iconSvgXlmns[1],html:iconSvgHtml}})},_default=extractor;exports.default=_default;
@@ -1,7 +1,2 @@
1
- "use strict";
2
-
3
- var _build = _interopRequireDefault(require("./build"));
4
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
- // eslint-disable-next-line no-console
6
- console.log('Running build...');
7
- (0, _build.default)();
1
+ "use strict";var _build=_interopRequireDefault(require("./build"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}// eslint-disable-next-line no-console
2
+ console.log("Running build..."),(0,_build.default)();
@@ -1,41 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.writeTypesFile = exports.writeIconsFile = void 0;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _path = _interopRequireDefault(require("path"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.writeTypesFile=exports.writeIconsFile=void 0;var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}/**
11
2
  * This function generates the types file for the Icon component
12
3
  * @param iconsList - The list of icons
13
4
  * @param overwrite - If true, the file will be overwritten
14
- */
15
- var writeTypesFile = function writeTypesFile(iconsList) {
16
- var overwrite = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
17
- var typesFile = _path.default.join(__dirname, '..', 'types.ts');
18
- if (overwrite || !_fs.default.existsSync(typesFile)) {
19
- _fs.default.writeFileSync(typesFile, "// This file is auto-generated.\n // Please do not modify it manually.\n import { GlobalColorsProps } from '../../shared/theme';\n\n export type IconName = ".concat(iconsList.map(function (icon) {
20
- return "'".concat(icon.name, "'");
21
- }).join(' | '), ";\n\n export type IIconComponentProps = {\n name: IconName;\n size?: number | string;\n color?: GlobalColorsProps | (string & {});\n secondColor?: GlobalColorsProps | (string & {});\n }\n "));
22
- }
23
- };
24
-
25
- /**
5
+ */var writeTypesFile=function(iconsList){var overwrite=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1],typesFile=_path.default.join(__dirname,"..","types.ts");(overwrite||!_fs.default.existsSync(typesFile))&&_fs.default.writeFileSync(typesFile,"// This file is auto-generated.\n // Please do not modify it manually.\n import { GlobalColorsProps } from '../../shared/theme';\n\n export type IconName = ".concat(iconsList.map(function(icon){return"'".concat(icon.name,"'")}).join(" | "),";\n\n export type IIconComponentProps = {\n name: IconName;\n size?: number | string;\n color?: GlobalColorsProps | (string & {});\n secondColor?: GlobalColorsProps | (string & {});\n }\n "))};/**
26
6
  * This function generates the icons json file for the Icon component
27
7
  * @param iconsList - The list of icons
28
8
  * @param jsonFileName - The name of the json file
29
9
  * @param overwrite - If true, the file will be overwritten
30
- */
31
- exports.writeTypesFile = writeTypesFile;
32
- var writeIconsFile = function writeIconsFile(iconsList, jsonFileName) {
33
- var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
34
- var iconsFile = _path.default.join(__dirname, '..', 'data', "".concat(jsonFileName, ".ts"));
35
- if (overwrite || !_fs.default.existsSync(iconsFile)) {
36
- _fs.default.writeFileSync(iconsFile, "// This file is auto-generated.\n // Please do not modify it manually.\n\n export const ".concat(jsonFileName, "Icons = [").concat(iconsList.map(function (icon) {
37
- return "{ name: '".concat(icon.name, "', width: ").concat(icon.width, ", height: ").concat(icon.height, ", viewBox: '").concat(icon.viewBox, "', html: '").concat(icon.html, "', xmlns: '").concat(icon.xmlns, "' }");
38
- }).join(',\n'), "];\n "));
39
- }
40
- };
41
- exports.writeIconsFile = writeIconsFile;
10
+ */exports.writeTypesFile=writeTypesFile;var writeIconsFile=function(iconsList,jsonFileName){var overwrite=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],iconsFile=_path.default.join(__dirname,"..","data","".concat(jsonFileName,".ts"));(overwrite||!_fs.default.existsSync(iconsFile))&&_fs.default.writeFileSync(iconsFile,"// This file is auto-generated.\n // Please do not modify it manually.\n\n export const ".concat(jsonFileName,"Icons = [").concat(iconsList.map(function(icon){return"{ name: '".concat(icon.name,"', width: ").concat(icon.width,", height: ").concat(icon.height,", viewBox: '").concat(icon.viewBox,"', html: '").concat(icon.html,"', xmlns: '").concat(icon.xmlns,"' }")}).join(",\n"),"];\n "))};exports.writeIconsFile=writeIconsFile;
@@ -1,22 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.IconComponent = void 0;
7
- var _styled = _interopRequireDefault(require("@emotion/styled"));
8
- var _react = require("@emotion/react");
9
- var _getColorValue = require("../../utils/getColorValue");
10
- var _templateObject, _templateObject2;
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var IconComponent = _styled.default.svg(function (props) {
14
- var theme = props.theme,
15
- colorText = props.colorText,
16
- name = props.name,
17
- havePrimaryColor = props.havePrimaryColor;
18
- var color = (0, _getColorValue.getColorValue)(colorText || '', theme, 'currentColor');
19
- var svgIsLogoOrIllustration = (name === null || name === void 0 ? void 0 : name.indexOf('pmt-')) !== -1 || (name === null || name === void 0 ? void 0 : name.indexOf('illust-')) !== -1 || (name === null || name === void 0 ? void 0 : name.indexOf('scl-')) !== -1 || havePrimaryColor;
20
- return svgIsLogoOrIllustration ? (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: middle;\n fill: initial;\n color: ", " !important;\n "])), color) : (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: middle;\n fill: ", " !important;\n\n & path {\n fill: ", " !important;\n }\n "])), color, color);
21
- });
22
- exports.IconComponent = IconComponent;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IconComponent=void 0;var _templateObject,_templateObject2,_styled=_interopRequireDefault(require("@emotion/styled")),_react=require("@emotion/react"),_getColorValue=require("../../utils/getColorValue");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}var IconComponent=_styled.default.svg(function(props){var theme=props.theme,colorText=props.colorText,name=props.name,havePrimaryColor=props.havePrimaryColor,color=(0,_getColorValue.getColorValue)(colorText||"",theme,"currentColor"),svgIsLogoOrIllustration=-1!==(null===name||void 0===name?void 0:name.indexOf("pmt-"))||-1!==(null===name||void 0===name?void 0:name.indexOf("illust-"))||-1!==(null===name||void 0===name?void 0:name.indexOf("scl-"))||havePrimaryColor;return svgIsLogoOrIllustration?(0,_react.css)(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: middle;\n fill: initial;\n color: "," !important;\n "])),color):(0,_react.css)(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: middle;\n fill: "," !important;\n\n & path {\n fill: "," !important;\n }\n "])),color,color)});exports.IconComponent=IconComponent;
@@ -1,28 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allIcons = void 0;
7
- var _dash = require("../data/dash");
8
- var _beauty = require("../data/beauty");
9
- var _ecommerce = require("../data/ecommerce");
10
- var _health = require("../data/health");
11
- var _illustrations = require("../data/illustrations");
12
- var _men = require("../data/men");
13
- var _form = require("../data/form");
14
- var _payment = require("../data/payment");
15
- var _physicalPerfomance = require("../data/physicalPerfomance");
16
- var _social = require("../data/social");
17
- var _status = require("../data/status");
18
- var _summer = require("../data/summer");
19
- var _woman = require("../data/woman");
20
- var _pedidoPago = require("../data/pedidoPago");
21
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
22
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
27
- var allIcons = [].concat(_toConsumableArray(_dash.dashIcons), _toConsumableArray(_beauty.beautyIcons), _toConsumableArray(_ecommerce.ecommerceIcons), _toConsumableArray(_health.healthIcons), _toConsumableArray(_illustrations.illustrationsIcons), _toConsumableArray(_men.menIcons), _toConsumableArray(_payment.paymentIcons), _toConsumableArray(_physicalPerfomance.physicalPerfomanceIcons), _toConsumableArray(_social.socialIcons), _toConsumableArray(_status.statusIcons), _toConsumableArray(_summer.summerIcons), _toConsumableArray(_woman.womanIcons), _toConsumableArray(_form.formIcons), _toConsumableArray(_pedidoPago.pedidoPagoIcons));
28
- exports.allIcons = allIcons;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.allIcons=void 0;var _dash=require("../data/dash"),_beauty=require("../data/beauty"),_ecommerce=require("../data/ecommerce"),_health=require("../data/health"),_illustrations=require("../data/illustrations"),_men=require("../data/men"),_form=require("../data/form"),_payment=require("../data/payment"),_physicalPerfomance=require("../data/physicalPerfomance"),_social=require("../data/social"),_status=require("../data/status"),_summer=require("../data/summer"),_woman=require("../data/woman"),_pedidoPago=require("../data/pedidoPago");function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var allIcons=[].concat(_toConsumableArray(_dash.dashIcons),_toConsumableArray(_beauty.beautyIcons),_toConsumableArray(_ecommerce.ecommerceIcons),_toConsumableArray(_health.healthIcons),_toConsumableArray(_illustrations.illustrationsIcons),_toConsumableArray(_men.menIcons),_toConsumableArray(_payment.paymentIcons),_toConsumableArray(_physicalPerfomance.physicalPerfomanceIcons),_toConsumableArray(_social.socialIcons),_toConsumableArray(_status.statusIcons),_toConsumableArray(_summer.summerIcons),_toConsumableArray(_woman.womanIcons),_toConsumableArray(_form.formIcons),_toConsumableArray(_pedidoPago.pedidoPagoIcons));exports.allIcons=allIcons;
@@ -1,13 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.iconExists = iconExists;
7
- var _allIcons = require("./allIcons");
8
- function iconExists(iconName) {
9
- var iconFound = _allIcons.allIcons.find(function (icon) {
10
- return icon.name === iconName;
11
- });
12
- return Boolean(iconFound);
13
- }
1
+ "use strict";var _allIcons=require("./allIcons");Object.defineProperty(exports,"__esModule",{value:!0}),exports.iconExists=iconExists;function iconExists(iconName){var iconFound=_allIcons.allIcons.find(function(icon){return icon.name===iconName});return!!iconFound}
@@ -1,58 +1 @@
1
- "use strict";
2
-
3
- var _testUtils = require("../../shared/tests/test-utils");
4
- require("@testing-library/jest-dom");
5
- var _ = _interopRequireDefault(require("."));
6
- var _jsxRuntime = require("react/jsx-runtime");
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- var setup = function setup(props) {
15
- var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
16
- return utils;
17
- };
18
- describe('IconItem', function () {
19
- it('should it render the icon item component', function () {
20
- var _setup = setup({
21
- icon: 'search',
22
- title: 'Search',
23
- description: 'Search component description'
24
- }),
25
- container = _setup.container;
26
- expect(container).toBeInTheDocument();
27
- });
28
- it('should it render the icon item component with sm size', function () {
29
- var _setup2 = setup({
30
- icon: 'search',
31
- title: 'Search',
32
- description: 'Search component description',
33
- size: 'sm'
34
- }),
35
- container = _setup2.container;
36
- expect(container).toBeInTheDocument();
37
- });
38
- it('should it render the icon item component with md size', function () {
39
- var _setup3 = setup({
40
- icon: 'search',
41
- title: 'Search',
42
- description: 'Search component description',
43
- size: 'md'
44
- }),
45
- container = _setup3.container;
46
- expect(container).toBeInTheDocument();
47
- });
48
- it('should it render the icon item component with lg size', function () {
49
- var _setup4 = setup({
50
- icon: 'search',
51
- title: 'Search',
52
- description: 'Search component description',
53
- size: 'lg'
54
- }),
55
- container = _setup4.container;
56
- expect(container).toBeInTheDocument();
57
- });
58
- });
1
+ "use strict";var _testUtils=require("../../shared/tests/test-utils");require("@testing-library/jest-dom");var _=_interopRequireDefault(require(".")),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var setup=function(props){var utils=(0,_testUtils.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_.default,_objectSpread({},props)));return utils};describe("IconItem",function(){it("should it render the icon item component",function(){var _setup=setup({icon:"search",title:"Search",description:"Search component description"}),container=_setup.container;expect(container).toBeInTheDocument()}),it("should it render the icon item component with sm size",function(){var _setup2=setup({icon:"search",title:"Search",description:"Search component description",size:"sm"}),container=_setup2.container;expect(container).toBeInTheDocument()}),it("should it render the icon item component with md size",function(){var _setup3=setup({icon:"search",title:"Search",description:"Search component description",size:"md"}),container=_setup3.container;expect(container).toBeInTheDocument()}),it("should it render the icon item component with lg size",function(){var _setup4=setup({icon:"search",title:"Search",description:"Search component description",size:"lg"}),container=_setup4.container;expect(container).toBeInTheDocument()})});
@@ -1,52 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _Typography = _interopRequireDefault(require("../Typography"));
8
- var _Icon = _interopRequireDefault(require("../Icon"));
9
- var _styles = require("./styles");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- var IconItem = function IconItem(_ref) {
13
- var icon = _ref.icon,
14
- title = _ref.title,
15
- color = _ref.color,
16
- description = _ref.description,
17
- size = _ref.size,
18
- isLoading = _ref.isLoading;
19
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemContainer, {
20
- children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
21
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {
22
- circle: true,
23
- haveText: Boolean(title || description)
24
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconItemTexts, {
25
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {
26
- description: true
27
- })]
28
- })]
29
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
30
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemIcon, {
31
- haveText: Boolean(title || description),
32
- colorText: color,
33
- boxSize: size,
34
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
35
- name: icon,
36
- size: 18
37
- })
38
- }), Boolean(title || description) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconItemTexts, {
39
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
40
- fontWeight: "600",
41
- fontSize: "xxs",
42
- children: title
43
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
44
- fontSize: "xxs",
45
- children: description
46
- })]
47
- })]
48
- })
49
- });
50
- };
51
- var _default = IconItem;
52
- exports.default = _default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _Typography=_interopRequireDefault(require("../Typography")),_Icon=_interopRequireDefault(require("../Icon")),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var IconItem=function(_ref){var icon=_ref.icon,title=_ref.title,color=_ref.color,description=_ref.description,size=_ref.size,isLoading=_ref.isLoading;return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconItemContainer,{children:isLoading?/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconItemSkeleton,{circle:!0,haveText:!!(title||description)}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.IconItemTexts,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconItemSkeleton,{}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconItemSkeleton,{description:!0})]})]}):/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.IconItemIcon,{haveText:!!(title||description),colorText:color,boxSize:size,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:icon,size:18})}),!!(title||description)&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.IconItemTexts,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontWeight:"600",fontSize:"xxs",children:title}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontSize:"xxs",children:description})]})]})})},_default=IconItem;exports.default=_default;