@a-little-world/little-world-design-system 2.10.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 (488) hide show
  1. package/.babelrc +7 -0
  2. package/.storybook/main.ts +36 -0
  3. package/.storybook/preview-head.html +6 -0
  4. package/.storybook/preview.ts +15 -0
  5. package/.turbo/turbo-build.log +14 -0
  6. package/CHANGELOG.md +398 -0
  7. package/LICENSE +21 -0
  8. package/README.md +180 -0
  9. package/__mocks__/focus-trap-react.tsx +1 -0
  10. package/__mocks__/svg.tsx +6 -0
  11. package/dist/cjs/components/Accordion/Accordion.d.ts +15 -0
  12. package/dist/cjs/components/Accordion/Accordion.js +20 -0
  13. package/dist/cjs/components/Accordion/styles.d.ts +18 -0
  14. package/dist/cjs/components/Accordion/styles.js +100 -0
  15. package/dist/cjs/components/Button/Button.d.ts +9 -0
  16. package/dist/cjs/components/Button/Button.js +17 -0
  17. package/dist/cjs/components/Button/styles.d.ts +16 -0
  18. package/dist/cjs/components/Button/styles.js +313 -0
  19. package/dist/cjs/components/Card/Card.d.ts +11 -0
  20. package/dist/cjs/components/Card/Card.js +108 -0
  21. package/dist/cjs/components/Checkbox/Checkbox.d.ts +15 -0
  22. package/dist/cjs/components/Checkbox/Checkbox.js +24 -0
  23. package/dist/cjs/components/Checkbox/styles.d.ts +27 -0
  24. package/dist/cjs/components/Checkbox/styles.js +108 -0
  25. package/dist/cjs/components/CheckboxGrid/CheckboxGrid.d.ts +22 -0
  26. package/dist/cjs/components/CheckboxGrid/CheckboxGrid.js +73 -0
  27. package/dist/cjs/components/CheckboxGrid/styles.d.ts +64 -0
  28. package/dist/cjs/components/CheckboxGrid/styles.js +137 -0
  29. package/dist/cjs/components/Dropdown/Dropdown.d.ts +25 -0
  30. package/dist/cjs/components/Dropdown/Dropdown.js +70 -0
  31. package/dist/cjs/components/Dropdown/styles.d.ts +15 -0
  32. package/dist/cjs/components/Dropdown/styles.js +145 -0
  33. package/dist/cjs/components/Icon/Icon.d.ts +10 -0
  34. package/dist/cjs/components/Icon/Icon.js +82 -0
  35. package/dist/cjs/components/Icon/IconGradient.d.ts +4 -0
  36. package/dist/cjs/components/Icon/IconGradient.js +29 -0
  37. package/dist/cjs/components/Icon/createIconComponent.d.ts +10 -0
  38. package/dist/cjs/components/Icon/createIconComponent.js +31 -0
  39. package/dist/cjs/components/Icon/getDefaultIconProps.d.ts +2 -0
  40. package/dist/cjs/components/Icon/getDefaultIconProps.js +15 -0
  41. package/dist/cjs/components/Icon/index.d.ts +553 -0
  42. package/dist/cjs/components/Icon/index.js +342 -0
  43. package/dist/cjs/components/Illustrations/Illustration.d.ts +3 -0
  44. package/dist/cjs/components/Illustrations/Illustration.js +12 -0
  45. package/dist/cjs/components/Illustrations/createIllustrationComponent.d.ts +10 -0
  46. package/dist/cjs/components/Illustrations/createIllustrationComponent.js +23 -0
  47. package/dist/cjs/components/Illustrations/index.d.ts +152 -0
  48. package/dist/cjs/components/Illustrations/index.js +81 -0
  49. package/dist/cjs/components/InputError/InputError.d.ts +15 -0
  50. package/dist/cjs/components/InputError/InputError.js +79 -0
  51. package/dist/cjs/components/Label/Label.d.ts +10 -0
  52. package/dist/cjs/components/Label/Label.js +68 -0
  53. package/dist/cjs/components/Link/Link.d.ts +6 -0
  54. package/dist/cjs/components/Link/Link.js +48 -0
  55. package/dist/cjs/components/Link/styles.d.ts +22 -0
  56. package/dist/cjs/components/Link/styles.js +99 -0
  57. package/dist/cjs/components/Loading/Loading.d.ts +10 -0
  58. package/dist/cjs/components/Loading/Loading.js +27 -0
  59. package/dist/cjs/components/Loading/LoadingLogo.d.ts +8 -0
  60. package/dist/cjs/components/Loading/LoadingLogo.js +31 -0
  61. package/dist/cjs/components/Loading/styles.d.ts +15 -0
  62. package/dist/cjs/components/Loading/styles.js +107 -0
  63. package/dist/cjs/components/Modal/Modal.d.ts +20 -0
  64. package/dist/cjs/components/Modal/Modal.js +95 -0
  65. package/dist/cjs/components/Modal/styles.d.ts +4 -0
  66. package/dist/cjs/components/Modal/styles.js +102 -0
  67. package/dist/cjs/components/MultiCheckbox/MultiCheckbox.d.ts +15 -0
  68. package/dist/cjs/components/MultiCheckbox/MultiCheckbox.js +61 -0
  69. package/dist/cjs/components/MultiCheckbox/styles.d.ts +1 -0
  70. package/dist/cjs/components/MultiCheckbox/styles.js +15 -0
  71. package/dist/cjs/components/MultiDropdown/MultiDropdown.d.ts +28 -0
  72. package/dist/cjs/components/MultiDropdown/MultiDropdown.js +124 -0
  73. package/dist/cjs/components/MultiDropdown/styles.d.ts +7 -0
  74. package/dist/cjs/components/MultiDropdown/styles.js +44 -0
  75. package/dist/cjs/components/MultiSelection/MultiSelection.d.ts +16 -0
  76. package/dist/cjs/components/MultiSelection/MultiSelection.js +62 -0
  77. package/dist/cjs/components/MultiSelection/styles.d.ts +9 -0
  78. package/dist/cjs/components/MultiSelection/styles.js +99 -0
  79. package/dist/cjs/components/NavigationMenu/NavigationMenu.d.ts +35 -0
  80. package/dist/cjs/components/NavigationMenu/NavigationMenu.js +85 -0
  81. package/dist/cjs/components/NavigationMenu/styles.d.ts +81 -0
  82. package/dist/cjs/components/NavigationMenu/styles.js +296 -0
  83. package/dist/cjs/components/Popover/InfoPopover.d.ts +8 -0
  84. package/dist/cjs/components/Popover/InfoPopover.js +46 -0
  85. package/dist/cjs/components/Popover/Popover.d.ts +16 -0
  86. package/dist/cjs/components/Popover/Popover.js +61 -0
  87. package/dist/cjs/components/Popover/styles.d.ts +14 -0
  88. package/dist/cjs/components/Popover/styles.js +116 -0
  89. package/dist/cjs/components/ProgressBar/ProgressBar.d.ts +8 -0
  90. package/dist/cjs/components/ProgressBar/ProgressBar.js +85 -0
  91. package/dist/cjs/components/RadioGroup/RadioGroup.d.ts +16 -0
  92. package/dist/cjs/components/RadioGroup/RadioGroup.js +24 -0
  93. package/dist/cjs/components/RadioGroup/styles.d.ts +12 -0
  94. package/dist/cjs/components/RadioGroup/styles.js +126 -0
  95. package/dist/cjs/components/Separator/Separator.d.ts +11 -0
  96. package/dist/cjs/components/Separator/Separator.js +61 -0
  97. package/dist/cjs/components/Separator/styles.d.ts +6 -0
  98. package/dist/cjs/components/Separator/styles.js +57 -0
  99. package/dist/cjs/components/Slider/Slider.d.ts +12 -0
  100. package/dist/cjs/components/Slider/Slider.js +17 -0
  101. package/dist/cjs/components/Slider/styles.d.ts +6 -0
  102. package/dist/cjs/components/Slider/styles.js +57 -0
  103. package/dist/cjs/components/StarRating/StarRating.d.ts +22 -0
  104. package/dist/cjs/components/StarRating/StarRating.js +143 -0
  105. package/dist/cjs/components/StarRating/styles.d.ts +35 -0
  106. package/dist/cjs/components/StarRating/styles.js +104 -0
  107. package/dist/cjs/components/StatusMessage/StatusMessage.d.ts +4 -0
  108. package/dist/cjs/components/StatusMessage/StatusMessage.js +112 -0
  109. package/dist/cjs/components/Switch/Switch.d.ts +15 -0
  110. package/dist/cjs/components/Switch/Switch.js +19 -0
  111. package/dist/cjs/components/Switch/styles.d.ts +14 -0
  112. package/dist/cjs/components/Switch/styles.js +99 -0
  113. package/dist/cjs/components/Tags/Tags.d.ts +15 -0
  114. package/dist/cjs/components/Tags/Tags.js +17 -0
  115. package/dist/cjs/components/Tags/styles.d.ts +19 -0
  116. package/dist/cjs/components/Tags/styles.js +119 -0
  117. package/dist/cjs/components/Text/Text.d.ts +11 -0
  118. package/dist/cjs/components/Text/Text.js +13 -0
  119. package/dist/cjs/components/Text/styles.d.ts +8 -0
  120. package/dist/cjs/components/Text/styles.js +98 -0
  121. package/dist/cjs/components/Text/types.d.ts +8 -0
  122. package/dist/cjs/components/Text/types.js +2 -0
  123. package/dist/cjs/components/TextArea/TextArea.d.ts +19 -0
  124. package/dist/cjs/components/TextArea/TextArea.js +84 -0
  125. package/dist/cjs/components/TextArea/styles.d.ts +22 -0
  126. package/dist/cjs/components/TextArea/styles.js +81 -0
  127. package/dist/cjs/components/TextContent/TextContent.d.ts +28 -0
  128. package/dist/cjs/components/TextContent/TextContent.js +46 -0
  129. package/dist/cjs/components/TextContent/styles.d.ts +24 -0
  130. package/dist/cjs/components/TextContent/styles.js +75 -0
  131. package/dist/cjs/components/TextInput/TextInput.d.ts +8 -0
  132. package/dist/cjs/components/TextInput/TextInput.js +49 -0
  133. package/dist/cjs/components/TextInput/styles.d.ts +18 -0
  134. package/dist/cjs/components/TextInput/styles.js +150 -0
  135. package/dist/cjs/components/Toast/Toast.d.ts +5 -0
  136. package/dist/cjs/components/Toast/Toast.js +90 -0
  137. package/dist/cjs/components/Toast/styles.d.ts +27 -0
  138. package/dist/cjs/components/Toast/styles.js +164 -0
  139. package/dist/cjs/components/Tooltip/Tooltip.d.ts +9 -0
  140. package/dist/cjs/components/Tooltip/Tooltip.js +55 -0
  141. package/dist/cjs/components/Tooltip/styles.d.ts +2 -0
  142. package/dist/cjs/components/Tooltip/styles.js +24 -0
  143. package/dist/cjs/components/Widget/AttachmentWidget.d.ts +18 -0
  144. package/dist/cjs/components/Widget/AttachmentWidget.js +124 -0
  145. package/dist/cjs/components/Widget/CallWidget.d.ts +11 -0
  146. package/dist/cjs/components/Widget/CallWidget.js +84 -0
  147. package/dist/cjs/components/Widget/Widget.d.ts +26 -0
  148. package/dist/cjs/components/Widget/Widget.js +87 -0
  149. package/dist/cjs/globalStyles.d.ts +5 -0
  150. package/dist/cjs/globalStyles.js +66 -0
  151. package/dist/cjs/hooks/useAutosizeTextArea.d.ts +2 -0
  152. package/dist/cjs/hooks/useAutosizeTextArea.js +14 -0
  153. package/dist/cjs/index.d.ts +51 -0
  154. package/dist/cjs/index.js +139 -0
  155. package/dist/cjs/storybook/BreakpointDocumentation.d.ts +3 -0
  156. package/dist/cjs/storybook/BreakpointDocumentation.js +139 -0
  157. package/dist/cjs/storybook/Components.d.ts +2 -0
  158. package/dist/cjs/storybook/Components.js +30 -0
  159. package/dist/cjs/storybook/Documentation.d.ts +5 -0
  160. package/dist/cjs/storybook/Documentation.js +67 -0
  161. package/dist/cjs/storybook/RadiusDocumentation.d.ts +3 -0
  162. package/dist/cjs/storybook/RadiusDocumentation.js +150 -0
  163. package/dist/cjs/storybook/SpacingDocumentation.d.ts +3 -0
  164. package/dist/cjs/storybook/SpacingDocumentation.js +146 -0
  165. package/dist/cjs/theme/index.d.ts +17 -0
  166. package/dist/cjs/theme/index.js +90 -0
  167. package/dist/cjs/utils/animations.d.ts +12 -0
  168. package/dist/cjs/utils/animations.js +120 -0
  169. package/dist/cjs/utils/createReactSvg.d.ts +3 -0
  170. package/dist/cjs/utils/createReactSvg.js +77 -0
  171. package/dist/cjs/utils/parser.d.ts +12 -0
  172. package/dist/cjs/utils/parser.js +200 -0
  173. package/dist/cjs/utils/replaceUrlsWithAnchors.d.ts +6 -0
  174. package/dist/cjs/utils/replaceUrlsWithAnchors.js +32 -0
  175. package/dist/cjs/utils/status.d.ts +6 -0
  176. package/dist/cjs/utils/status.js +54 -0
  177. package/dist/cjs/utils/styles.d.ts +1 -0
  178. package/dist/cjs/utils/styles.js +5 -0
  179. package/dist/cjs/utils/types.d.ts +1 -0
  180. package/dist/cjs/utils/types.js +2 -0
  181. package/dist/esm/components/Accordion/Accordion.d.ts +15 -0
  182. package/dist/esm/components/Accordion/Accordion.js +14 -0
  183. package/dist/esm/components/Accordion/styles.d.ts +18 -0
  184. package/dist/esm/components/Accordion/styles.js +61 -0
  185. package/dist/esm/components/Button/Button.d.ts +9 -0
  186. package/dist/esm/components/Button/Button.js +10 -0
  187. package/dist/esm/components/Button/styles.d.ts +16 -0
  188. package/dist/esm/components/Button/styles.js +277 -0
  189. package/dist/esm/components/Card/Card.d.ts +11 -0
  190. package/dist/esm/components/Card/Card.js +66 -0
  191. package/dist/esm/components/Checkbox/Checkbox.d.ts +15 -0
  192. package/dist/esm/components/Checkbox/Checkbox.js +17 -0
  193. package/dist/esm/components/Checkbox/styles.d.ts +27 -0
  194. package/dist/esm/components/Checkbox/styles.js +69 -0
  195. package/dist/esm/components/CheckboxGrid/CheckboxGrid.d.ts +22 -0
  196. package/dist/esm/components/CheckboxGrid/CheckboxGrid.js +35 -0
  197. package/dist/esm/components/CheckboxGrid/styles.d.ts +64 -0
  198. package/dist/esm/components/CheckboxGrid/styles.js +98 -0
  199. package/dist/esm/components/Dropdown/Dropdown.d.ts +25 -0
  200. package/dist/esm/components/Dropdown/Dropdown.js +32 -0
  201. package/dist/esm/components/Dropdown/styles.d.ts +15 -0
  202. package/dist/esm/components/Dropdown/styles.js +106 -0
  203. package/dist/esm/components/Icon/Icon.d.ts +10 -0
  204. package/dist/esm/components/Icon/Icon.js +42 -0
  205. package/dist/esm/components/Icon/IconGradient.d.ts +4 -0
  206. package/dist/esm/components/Icon/IconGradient.js +24 -0
  207. package/dist/esm/components/Icon/createIconComponent.d.ts +10 -0
  208. package/dist/esm/components/Icon/createIconComponent.js +24 -0
  209. package/dist/esm/components/Icon/getDefaultIconProps.d.ts +2 -0
  210. package/dist/esm/components/Icon/getDefaultIconProps.js +11 -0
  211. package/dist/esm/components/Icon/index.d.ts +553 -0
  212. package/dist/esm/components/Icon/index.js +338 -0
  213. package/dist/esm/components/Illustrations/Illustration.d.ts +3 -0
  214. package/dist/esm/components/Illustrations/Illustration.js +5 -0
  215. package/dist/esm/components/Illustrations/createIllustrationComponent.d.ts +10 -0
  216. package/dist/esm/components/Illustrations/createIllustrationComponent.js +16 -0
  217. package/dist/esm/components/Illustrations/index.d.ts +152 -0
  218. package/dist/esm/components/Illustrations/index.js +78 -0
  219. package/dist/esm/components/InputError/InputError.d.ts +15 -0
  220. package/dist/esm/components/InputError/InputError.js +40 -0
  221. package/dist/esm/components/Label/Label.d.ts +10 -0
  222. package/dist/esm/components/Label/Label.js +30 -0
  223. package/dist/esm/components/Link/Link.d.ts +6 -0
  224. package/dist/esm/components/Link/Link.js +13 -0
  225. package/dist/esm/components/Link/styles.d.ts +22 -0
  226. package/dist/esm/components/Link/styles.js +63 -0
  227. package/dist/esm/components/Loading/Loading.d.ts +10 -0
  228. package/dist/esm/components/Loading/Loading.js +21 -0
  229. package/dist/esm/components/Loading/LoadingLogo.d.ts +8 -0
  230. package/dist/esm/components/Loading/LoadingLogo.js +26 -0
  231. package/dist/esm/components/Loading/styles.d.ts +15 -0
  232. package/dist/esm/components/Loading/styles.js +71 -0
  233. package/dist/esm/components/Modal/Modal.d.ts +20 -0
  234. package/dist/esm/components/Modal/Modal.js +59 -0
  235. package/dist/esm/components/Modal/styles.d.ts +4 -0
  236. package/dist/esm/components/Modal/styles.js +63 -0
  237. package/dist/esm/components/MultiCheckbox/MultiCheckbox.d.ts +15 -0
  238. package/dist/esm/components/MultiCheckbox/MultiCheckbox.js +23 -0
  239. package/dist/esm/components/MultiCheckbox/styles.d.ts +1 -0
  240. package/dist/esm/components/MultiCheckbox/styles.js +9 -0
  241. package/dist/esm/components/MultiDropdown/MultiDropdown.d.ts +28 -0
  242. package/dist/esm/components/MultiDropdown/MultiDropdown.js +86 -0
  243. package/dist/esm/components/MultiDropdown/styles.d.ts +7 -0
  244. package/dist/esm/components/MultiDropdown/styles.js +38 -0
  245. package/dist/esm/components/MultiSelection/MultiSelection.d.ts +16 -0
  246. package/dist/esm/components/MultiSelection/MultiSelection.js +24 -0
  247. package/dist/esm/components/MultiSelection/styles.d.ts +9 -0
  248. package/dist/esm/components/MultiSelection/styles.js +63 -0
  249. package/dist/esm/components/NavigationMenu/NavigationMenu.d.ts +35 -0
  250. package/dist/esm/components/NavigationMenu/NavigationMenu.js +40 -0
  251. package/dist/esm/components/NavigationMenu/styles.d.ts +81 -0
  252. package/dist/esm/components/NavigationMenu/styles.js +257 -0
  253. package/dist/esm/components/Popover/InfoPopover.d.ts +8 -0
  254. package/dist/esm/components/Popover/InfoPopover.js +8 -0
  255. package/dist/esm/components/Popover/Popover.d.ts +16 -0
  256. package/dist/esm/components/Popover/Popover.js +22 -0
  257. package/dist/esm/components/Popover/styles.d.ts +14 -0
  258. package/dist/esm/components/Popover/styles.js +80 -0
  259. package/dist/esm/components/ProgressBar/ProgressBar.d.ts +8 -0
  260. package/dist/esm/components/ProgressBar/ProgressBar.js +47 -0
  261. package/dist/esm/components/RadioGroup/RadioGroup.d.ts +16 -0
  262. package/dist/esm/components/RadioGroup/RadioGroup.js +19 -0
  263. package/dist/esm/components/RadioGroup/styles.d.ts +12 -0
  264. package/dist/esm/components/RadioGroup/styles.js +90 -0
  265. package/dist/esm/components/Separator/Separator.d.ts +11 -0
  266. package/dist/esm/components/Separator/Separator.js +23 -0
  267. package/dist/esm/components/Separator/styles.d.ts +6 -0
  268. package/dist/esm/components/Separator/styles.js +51 -0
  269. package/dist/esm/components/Slider/Slider.d.ts +12 -0
  270. package/dist/esm/components/Slider/Slider.js +12 -0
  271. package/dist/esm/components/Slider/styles.d.ts +6 -0
  272. package/dist/esm/components/Slider/styles.js +51 -0
  273. package/dist/esm/components/StarRating/StarRating.d.ts +22 -0
  274. package/dist/esm/components/StarRating/StarRating.js +107 -0
  275. package/dist/esm/components/StarRating/styles.d.ts +35 -0
  276. package/dist/esm/components/StarRating/styles.js +65 -0
  277. package/dist/esm/components/StatusMessage/StatusMessage.d.ts +4 -0
  278. package/dist/esm/components/StatusMessage/StatusMessage.js +74 -0
  279. package/dist/esm/components/Switch/Switch.d.ts +15 -0
  280. package/dist/esm/components/Switch/Switch.js +14 -0
  281. package/dist/esm/components/Switch/styles.d.ts +14 -0
  282. package/dist/esm/components/Switch/styles.js +63 -0
  283. package/dist/esm/components/Tags/Tags.d.ts +15 -0
  284. package/dist/esm/components/Tags/Tags.js +10 -0
  285. package/dist/esm/components/Tags/styles.d.ts +19 -0
  286. package/dist/esm/components/Tags/styles.js +80 -0
  287. package/dist/esm/components/Text/Text.d.ts +11 -0
  288. package/dist/esm/components/Text/Text.js +8 -0
  289. package/dist/esm/components/Text/styles.d.ts +8 -0
  290. package/dist/esm/components/Text/styles.js +62 -0
  291. package/dist/esm/components/Text/types.d.ts +8 -0
  292. package/dist/esm/components/Text/types.js +1 -0
  293. package/dist/esm/components/TextArea/TextArea.d.ts +19 -0
  294. package/dist/esm/components/TextArea/TextArea.js +45 -0
  295. package/dist/esm/components/TextArea/styles.d.ts +22 -0
  296. package/dist/esm/components/TextArea/styles.js +42 -0
  297. package/dist/esm/components/TextContent/TextContent.d.ts +28 -0
  298. package/dist/esm/components/TextContent/TextContent.js +40 -0
  299. package/dist/esm/components/TextContent/styles.d.ts +24 -0
  300. package/dist/esm/components/TextContent/styles.js +36 -0
  301. package/dist/esm/components/TextInput/TextInput.d.ts +8 -0
  302. package/dist/esm/components/TextInput/TextInput.js +42 -0
  303. package/dist/esm/components/TextInput/styles.d.ts +18 -0
  304. package/dist/esm/components/TextInput/styles.js +111 -0
  305. package/dist/esm/components/Toast/Toast.d.ts +5 -0
  306. package/dist/esm/components/Toast/Toast.js +54 -0
  307. package/dist/esm/components/Toast/styles.d.ts +27 -0
  308. package/dist/esm/components/Toast/styles.js +125 -0
  309. package/dist/esm/components/Tooltip/Tooltip.d.ts +9 -0
  310. package/dist/esm/components/Tooltip/Tooltip.js +16 -0
  311. package/dist/esm/components/Tooltip/styles.d.ts +2 -0
  312. package/dist/esm/components/Tooltip/styles.js +18 -0
  313. package/dist/esm/components/Widget/AttachmentWidget.d.ts +18 -0
  314. package/dist/esm/components/Widget/AttachmentWidget.js +85 -0
  315. package/dist/esm/components/Widget/CallWidget.d.ts +11 -0
  316. package/dist/esm/components/Widget/CallWidget.js +46 -0
  317. package/dist/esm/components/Widget/Widget.d.ts +26 -0
  318. package/dist/esm/components/Widget/Widget.js +46 -0
  319. package/dist/esm/globalStyles.d.ts +5 -0
  320. package/dist/esm/globalStyles.js +64 -0
  321. package/dist/esm/hooks/useAutosizeTextArea.d.ts +2 -0
  322. package/dist/esm/hooks/useAutosizeTextArea.js +12 -0
  323. package/dist/esm/index.d.ts +51 -0
  324. package/dist/esm/index.js +45 -0
  325. package/dist/esm/storybook/BreakpointDocumentation.d.ts +3 -0
  326. package/dist/esm/storybook/BreakpointDocumentation.js +101 -0
  327. package/dist/esm/storybook/Components.d.ts +2 -0
  328. package/dist/esm/storybook/Components.js +23 -0
  329. package/dist/esm/storybook/Documentation.d.ts +5 -0
  330. package/dist/esm/storybook/Documentation.js +62 -0
  331. package/dist/esm/storybook/RadiusDocumentation.d.ts +3 -0
  332. package/dist/esm/storybook/RadiusDocumentation.js +112 -0
  333. package/dist/esm/storybook/SpacingDocumentation.d.ts +3 -0
  334. package/dist/esm/storybook/SpacingDocumentation.js +108 -0
  335. package/dist/esm/theme/index.d.ts +17 -0
  336. package/dist/esm/theme/index.js +53 -0
  337. package/dist/esm/utils/animations.d.ts +12 -0
  338. package/dist/esm/utils/animations.js +117 -0
  339. package/dist/esm/utils/createReactSvg.d.ts +3 -0
  340. package/dist/esm/utils/createReactSvg.js +70 -0
  341. package/dist/esm/utils/parser.d.ts +12 -0
  342. package/dist/esm/utils/parser.js +195 -0
  343. package/dist/esm/utils/replaceUrlsWithAnchors.d.ts +6 -0
  344. package/dist/esm/utils/replaceUrlsWithAnchors.js +29 -0
  345. package/dist/esm/utils/status.d.ts +6 -0
  346. package/dist/esm/utils/status.js +49 -0
  347. package/dist/esm/utils/styles.d.ts +1 -0
  348. package/dist/esm/utils/styles.js +1 -0
  349. package/dist/esm/utils/types.d.ts +1 -0
  350. package/dist/esm/utils/types.js +1 -0
  351. package/jest.config.ts +30 -0
  352. package/package.json +98 -0
  353. package/src/components/Accordion/Accordion.stories.tsx +66 -0
  354. package/src/components/Accordion/Accordion.tsx +59 -0
  355. package/src/components/Accordion/styles.tsx +68 -0
  356. package/src/components/Button/Button.stories.tsx +119 -0
  357. package/src/components/Button/Button.tsx +59 -0
  358. package/src/components/Button/styles.tsx +313 -0
  359. package/src/components/Card/Card.stories.tsx +22 -0
  360. package/src/components/Card/Card.tsx +125 -0
  361. package/src/components/Checkbox/Checkbox.stories.tsx +11 -0
  362. package/src/components/Checkbox/Checkbox.tsx +112 -0
  363. package/src/components/Checkbox/styles.tsx +96 -0
  364. package/src/components/CheckboxGrid/CheckboxGrid.stories.tsx +49 -0
  365. package/src/components/CheckboxGrid/CheckboxGrid.tsx +126 -0
  366. package/src/components/CheckboxGrid/styles.tsx +122 -0
  367. package/src/components/Dropdown/Dropdown.stories.tsx +59 -0
  368. package/src/components/Dropdown/Dropdown.tsx +128 -0
  369. package/src/components/Dropdown/styles.tsx +120 -0
  370. package/src/components/Icon/Icon.stories.tsx +44 -0
  371. package/src/components/Icon/Icon.test.tsx +20 -0
  372. package/src/components/Icon/Icon.tsx +88 -0
  373. package/src/components/Icon/IconDocs.mdx +22 -0
  374. package/src/components/Icon/IconGradient.tsx +70 -0
  375. package/src/components/Icon/createIconComponent.tsx +63 -0
  376. package/src/components/Icon/getDefaultIconProps.ts +23 -0
  377. package/src/components/Icon/index.ts +499 -0
  378. package/src/components/Illustrations/Illustration.tsx +18 -0
  379. package/src/components/Illustrations/Illustrations.stories.tsx +53 -0
  380. package/src/components/Illustrations/createIllustrationComponent.tsx +39 -0
  381. package/src/components/Illustrations/index.ts +118 -0
  382. package/src/components/InputError/InputError.tsx +86 -0
  383. package/src/components/Label/Label.stories.tsx +18 -0
  384. package/src/components/Label/Label.tsx +76 -0
  385. package/src/components/Link/Link.stories.tsx +14 -0
  386. package/src/components/Link/Link.test.tsx +27 -0
  387. package/src/components/Link/Link.tsx +68 -0
  388. package/src/components/Link/styles.tsx +86 -0
  389. package/src/components/Loading/Loading.stories.tsx +26 -0
  390. package/src/components/Loading/Loading.tsx +65 -0
  391. package/src/components/Loading/LoadingLogo.tsx +141 -0
  392. package/src/components/Loading/styles.ts +95 -0
  393. package/src/components/Modal/Modal.stories.tsx +52 -0
  394. package/src/components/Modal/Modal.test.tsx +98 -0
  395. package/src/components/Modal/Modal.tsx +115 -0
  396. package/src/components/Modal/ModalDocs.mdx +21 -0
  397. package/src/components/Modal/styles.tsx +67 -0
  398. package/src/components/MultiCheckbox/MultiCheckbox.stories.tsx +24 -0
  399. package/src/components/MultiCheckbox/MultiCheckbox.tsx +73 -0
  400. package/src/components/MultiCheckbox/styles.tsx +10 -0
  401. package/src/components/MultiDropdown/MultiDropdown.stories.tsx +105 -0
  402. package/src/components/MultiDropdown/MultiDropdown.tsx +247 -0
  403. package/src/components/MultiDropdown/styles.tsx +45 -0
  404. package/src/components/MultiSelection/MultiSelection.stories.tsx +19 -0
  405. package/src/components/MultiSelection/MultiSelection.tsx +74 -0
  406. package/src/components/MultiSelection/styles.tsx +78 -0
  407. package/src/components/NavigationMenu/NavigationMenu.stories.tsx +108 -0
  408. package/src/components/NavigationMenu/NavigationMenu.tsx +151 -0
  409. package/src/components/NavigationMenu/styles.tsx +293 -0
  410. package/src/components/Popover/InfoPopover.tsx +40 -0
  411. package/src/components/Popover/Popover.stories.tsx +85 -0
  412. package/src/components/Popover/Popover.tsx +68 -0
  413. package/src/components/Popover/styles.tsx +109 -0
  414. package/src/components/ProgressBar/ProgressBar.stories.tsx +15 -0
  415. package/src/components/ProgressBar/ProgressBar.tsx +76 -0
  416. package/src/components/RadioGroup/RadioGroup.stories.tsx +42 -0
  417. package/src/components/RadioGroup/RadioGroup.tsx +91 -0
  418. package/src/components/RadioGroup/styles.tsx +100 -0
  419. package/src/components/Separator/Separator.stories.tsx +27 -0
  420. package/src/components/Separator/Separator.tsx +52 -0
  421. package/src/components/Separator/styles.tsx +57 -0
  422. package/src/components/Slider/Slider.stories.tsx +27 -0
  423. package/src/components/Slider/Slider.tsx +61 -0
  424. package/src/components/Slider/styles.tsx +57 -0
  425. package/src/components/StarRating/StarRating.stories.tsx +20 -0
  426. package/src/components/StarRating/StarRating.tsx +212 -0
  427. package/src/components/StarRating/styles.ts +76 -0
  428. package/src/components/StatusMessage/StatusMessage.stories.tsx +44 -0
  429. package/src/components/StatusMessage/StatusMessage.tsx +110 -0
  430. package/src/components/Switch/Switch.stories.tsx +12 -0
  431. package/src/components/Switch/Switch.tsx +83 -0
  432. package/src/components/Switch/styles.tsx +75 -0
  433. package/src/components/Tags/Tags.stories.tsx +44 -0
  434. package/src/components/Tags/Tags.tsx +68 -0
  435. package/src/components/Tags/styles.tsx +89 -0
  436. package/src/components/Text/Text.stories.tsx +288 -0
  437. package/src/components/Text/Text.tsx +58 -0
  438. package/src/components/Text/styles.tsx +75 -0
  439. package/src/components/Text/types.ts +9 -0
  440. package/src/components/Text/typography.mdx +91 -0
  441. package/src/components/TextArea/TextArea.stories.tsx +26 -0
  442. package/src/components/TextArea/TextArea.tsx +117 -0
  443. package/src/components/TextArea/styles.tsx +58 -0
  444. package/src/components/TextContent/TextContent.stories.tsx +54 -0
  445. package/src/components/TextContent/TextContent.tsx +154 -0
  446. package/src/components/TextContent/styles.tsx +47 -0
  447. package/src/components/TextInput/TextInput.stories.tsx +43 -0
  448. package/src/components/TextInput/TextInput.tsx +146 -0
  449. package/src/components/TextInput/styles.tsx +129 -0
  450. package/src/components/Toast/Toast.stories.tsx +55 -0
  451. package/src/components/Toast/Toast.tsx +139 -0
  452. package/src/components/Toast/styles.tsx +142 -0
  453. package/src/components/Tooltip/Tooltip.stories.tsx +31 -0
  454. package/src/components/Tooltip/Tooltip.tsx +48 -0
  455. package/src/components/Tooltip/styles.tsx +20 -0
  456. package/src/components/Widget/AttachmentWidget.stories.tsx +14 -0
  457. package/src/components/Widget/AttachmentWidget.tsx +142 -0
  458. package/src/components/Widget/CallWidget.stories.tsx +38 -0
  459. package/src/components/Widget/CallWidget.tsx +114 -0
  460. package/src/components/Widget/Widget.stories.tsx +10 -0
  461. package/src/components/Widget/Widget.tsx +104 -0
  462. package/src/globalStyles.ts +68 -0
  463. package/src/hooks/useAutosizeTextArea.tsx +19 -0
  464. package/src/index.ts +107 -0
  465. package/src/setupTests.ts +8 -0
  466. package/src/storybook/BreakpointDocumentation.tsx +126 -0
  467. package/src/storybook/Components.tsx +29 -0
  468. package/src/storybook/Documentation.tsx +86 -0
  469. package/src/storybook/RadiusDocumentation.tsx +133 -0
  470. package/src/storybook/SpacingDocumentation.tsx +131 -0
  471. package/src/storybook/breakpoints.mdx +83 -0
  472. package/src/storybook/colors.mdx +118 -0
  473. package/src/storybook/radius.mdx +48 -0
  474. package/src/storybook/spacing.mdx +45 -0
  475. package/src/testUtils.tsx +49 -0
  476. package/src/theme/index.tsx +98 -0
  477. package/src/utils/animations.ts +129 -0
  478. package/src/utils/createReactSvg.tsx +140 -0
  479. package/src/utils/parser.mdx +41 -0
  480. package/src/utils/parser.test.tsx +542 -0
  481. package/src/utils/parser.tsx +333 -0
  482. package/src/utils/replaceUrlsWithAnchors.test.ts +42 -0
  483. package/src/utils/replaceUrlsWithAnchors.ts +32 -0
  484. package/src/utils/status.tsx +85 -0
  485. package/src/utils/styles.ts +1 -0
  486. package/src/utils/types.ts +1 -0
  487. package/tsconfig.json +34 -0
  488. package/tsconfig.test.json +16 -0
@@ -0,0 +1,65 @@
1
+ import styled, { css } from 'styled-components';
2
+ import Text from '../Text/Text';
3
+ export const RatingContainer = styled.div `
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ `;
8
+ export const Stars = styled.div `
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ `;
13
+ export const StarContainer = styled.button `
14
+ position: relative;
15
+ cursor: pointer;
16
+ background: none;
17
+ border: none;
18
+ outline: none;
19
+ border-radius: ${({ theme }) => theme.radius.xxxsmall};
20
+ f &:focus-visible {
21
+ box-shadow: 0 0 0 2px #4f46e5;
22
+ }
23
+ padding: ${({ theme }) => theme.spacing.xxsmall};
24
+ `;
25
+ export const StarOverlay = styled.div `
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ overflow: hidden;
30
+ width: ${props => props.$fillAmount * 100}%;
31
+ pointer-events: none;
32
+ padding: ${({ theme }) => theme.spacing.xxsmall};
33
+
34
+ transition: width 0.3s ease-in-out;
35
+ &:hover {
36
+ transition: width 1s ease-in-out;
37
+ }
38
+
39
+ > svg {
40
+ transition: width 0.3s ease-in-out;
41
+ ${({ $fillAmount }) => !$fillAmount &&
42
+ css `
43
+ transition: width 0.3s ease-in-out;
44
+ width: 0;
45
+ `}:
46
+ }
47
+ `;
48
+ export const Rating = styled(Text) `
49
+ margin-left: ${({ theme }) => theme.spacing.xxsmall};
50
+ width: 24px;
51
+ `;
52
+ export const TextRating = styled(Text) `
53
+ height: 16px;
54
+ `;
55
+ export const VisuallyHidden = styled.span `
56
+ position: absolute;
57
+ width: 1px;
58
+ height: 1px;
59
+ padding: 0;
60
+ margin: -1px;
61
+ overflow: hidden;
62
+ clip: rect(0, 0, 0, 0);
63
+ white-space: nowrap;
64
+ border: 0;
65
+ `;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { StatusBaseProps } from '@a-little-world/little-world-design-system-core';
3
+ declare const StatusMessage: ({ className, type, visible, children, withBorder, }: StatusBaseProps) => React.JSX.Element;
4
+ export default StatusMessage;
@@ -0,0 +1,74 @@
1
+ import React from 'react';
2
+ import styled, { css } from 'styled-components';
3
+ import { StatusTypes, } from '@a-little-world/little-world-design-system-core';
4
+ import Text from '../Text/Text';
5
+ import { ExclamationIcon } from '../Icon';
6
+ const StatusMessageWrapper = styled.div `
7
+ display: flex;
8
+ justify-content: center;
9
+ gap: ${({ theme }) => theme.spacing.xxsmall};
10
+ width: 100%;
11
+ min-height: ${({ theme }) => theme.spacing.xlarge};
12
+ padding: ${({ theme, $withBorder }) => $withBorder ? theme.spacing.small : theme.spacing.xxsmall};
13
+ opacity: ${({ $visible }) => ($visible ? 1 : 0)};
14
+ transition: ${({ $visible }) => ($visible ? 'opacity 1s' : 'none')};
15
+ text-align: ${({ $withIcon }) => ($withIcon ? 'left' : 'center')};
16
+ margin: ${({ theme, $withBorder }) => $withBorder ? 0 : theme.spacing.xxsmall}
17
+ 0;
18
+ border-radius: ${({ theme, $withBorder }) => $withBorder ? theme.radius.xxsmall : 0};
19
+
20
+ ${({ $type, theme, $withBorder }) => {
21
+ if ($type === StatusTypes.Error)
22
+ return css `
23
+ background: ${theme.color.surface.error};
24
+ color: ${theme.color.text.error};
25
+ border: ${$withBorder
26
+ ? `1px solid ${theme.color.border.error}`
27
+ : 'none'};
28
+ `;
29
+ if ($type === StatusTypes.Success)
30
+ return css `
31
+ background: ${theme.color.surface.success};
32
+ color: ${theme.color.text.success};
33
+ border: ${$withBorder
34
+ ? `1px solid ${theme.color.border.success}`
35
+ : 'none'};
36
+ `;
37
+ if ($type === StatusTypes.Warning)
38
+ return css `
39
+ background: ${theme.color.surface.warning};
40
+ color: ${theme.color.text.warning};
41
+ border: ${$withBorder
42
+ ? `1px solid ${theme.color.border.warning}`
43
+ : 'none'};
44
+ `;
45
+ // default is Info type
46
+ return css `
47
+ background: ${theme.color.surface.subtle};
48
+ color: ${theme.color.text.info};
49
+ border: ${$withBorder ? `1px solid ${theme.color.border.info}` : 'none'};
50
+ `;
51
+ }})
52
+ `;
53
+ const StyledIcon = styled.svg `
54
+ flex-shrink: 0;
55
+ margin-top: 3px;
56
+ `;
57
+ const STATUS_ICONS = {
58
+ [StatusTypes.Error]: {
59
+ Icon: ExclamationIcon,
60
+ label: 'error icon',
61
+ },
62
+ [StatusTypes.Warning]: {
63
+ Icon: ExclamationIcon,
64
+ label: 'warning icon',
65
+ },
66
+ };
67
+ const StatusMessage = ({ className, type, visible, children, withBorder, }) => {
68
+ const icon = STATUS_ICONS[type];
69
+ const Icon = withBorder && icon?.Icon;
70
+ return (React.createElement(StatusMessageWrapper, { className: className, "$type": type, "$visible": visible, "$withBorder": withBorder, "$withIcon": !!Icon },
71
+ Icon && (React.createElement(StyledIcon, { as: Icon, label: icon.label, width: 18, height: 18 })),
72
+ React.createElement(Text, null, children)));
73
+ };
74
+ export default StatusMessage;
@@ -0,0 +1,15 @@
1
+ import * as RadixSwitch from '@radix-ui/react-switch';
2
+ import React from 'react';
3
+ type Props = {
4
+ className?: string;
5
+ description?: string;
6
+ error?: string;
7
+ fullWidth?: boolean;
8
+ label?: string;
9
+ labelBold?: boolean;
10
+ labelInline?: boolean;
11
+ labelTooltip?: string;
12
+ inputRef: React.RefObject<HTMLButtonElement>;
13
+ } & RadixSwitch.SwitchProps;
14
+ declare const Switch: React.FC<Props>;
15
+ export default Switch;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import InputError from '../InputError/InputError';
3
+ import Label from '../Label/Label';
4
+ import Text from '../Text/Text';
5
+ import { LabelContainer, SwitchContainer, SwitchRoot, SwitchThumb, SwitchWrapper, } from './styles';
6
+ const Switch = ({ className, description, error, fullWidth, label, labelBold = true, labelInline, labelTooltip, inputRef, checked, onCheckedChange, value, ...rest }) => (React.createElement(SwitchWrapper, { className: className, "$fullWidth": fullWidth, "$labelInline": labelInline, "$labelAndDescription": Boolean(label && description) },
7
+ (label || description) && (React.createElement(LabelContainer, { "$inline": labelInline },
8
+ label && (React.createElement(Label, { bold: labelBold, htmlFor: label, tooltipText: labelTooltip, marginBottom: "0" }, label)),
9
+ description && React.createElement(Text, null, description))),
10
+ React.createElement(SwitchContainer, null,
11
+ React.createElement(SwitchRoot, { ref: inputRef, checked: checked, value: value, name: label, onCheckedChange: onCheckedChange, "$hasError": Boolean(error), ...rest },
12
+ React.createElement(SwitchThumb, null)),
13
+ React.createElement(InputError, { visible: Boolean(error), textAlign: "left" }, error))));
14
+ export default Switch;
@@ -0,0 +1,14 @@
1
+ import * as Switch from '@radix-ui/react-switch';
2
+ export declare const SwitchWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $fullWidth?: boolean;
4
+ $labelInline?: boolean;
5
+ $labelAndDescription: boolean;
6
+ }>> & string;
7
+ export declare const LabelContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
+ $inline?: boolean;
9
+ }>> & string;
10
+ export declare const SwitchRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Switch.SwitchProps & import("react").RefAttributes<HTMLButtonElement>, {
11
+ $hasError?: boolean;
12
+ }>> & string & Omit<import("react").ForwardRefExoticComponent<Switch.SwitchProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
13
+ export declare const SwitchContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
14
+ export declare const SwitchThumb: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Switch.SwitchThumbProps & import("react").RefAttributes<HTMLSpanElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Switch.SwitchThumbProps & import("react").RefAttributes<HTMLSpanElement>>, keyof import("react").Component<any, {}, any>>;
@@ -0,0 +1,63 @@
1
+ import * as Switch from '@radix-ui/react-switch';
2
+ import styled, { css } from 'styled-components';
3
+ export const SwitchWrapper = styled.div `
4
+ ${({ theme, $fullWidth, $labelInline, $labelAndDescription }) => $labelInline &&
5
+ css `
6
+ display: flex;
7
+ gap: ${theme.spacing.small};
8
+ align-items: ${$labelAndDescription ? 'flex-start' : 'center'};
9
+ ${$fullWidth &&
10
+ css `
11
+ width: 100%;
12
+ justify-content: space-between;
13
+ `}
14
+ `}
15
+ `;
16
+ export const LabelContainer = styled.div `
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: ${({ theme }) => theme.spacing.xxsmall};
20
+ margin-bottom: ${({ theme, $inline }) => $inline ? '20px' : theme.spacing.xxsmall};
21
+ `;
22
+ export const SwitchRoot = styled(Switch.Root) `
23
+ width: 56px;
24
+ height: 32px;
25
+ background-color: ${({ theme }) => theme.color.border.subtle};
26
+ border-radius: 9999px;
27
+ position: relative;
28
+ -webkit-tap-highlight-color: ${({ theme }) => theme.color.surface.on};
29
+
30
+ &:focus {
31
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.color.border.minimal};
32
+ }
33
+
34
+ ${({ $hasError }) => $hasError &&
35
+ css `
36
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.color.border.error};
37
+ background-color: ${({ theme }) => theme.color.surface.secondary};
38
+
39
+ &:focus {
40
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.color.border.error};
41
+ }
42
+ `}
43
+
44
+ &[data-state='checked'] {
45
+ background-color: ${({ theme }) => theme.color.surface.on};
46
+ }
47
+ `;
48
+ export const SwitchContainer = styled.div ``;
49
+ export const SwitchThumb = styled(Switch.Thumb) `
50
+ display: block;
51
+ width: 24px;
52
+ height: 24px;
53
+ background-color: ${({ theme }) => theme.color.surface.primary};
54
+ border-radius: 9999px;
55
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
56
+ transition: transform 100ms;
57
+ transform: translateX(4px);
58
+ will-change: transform;
59
+
60
+ &[data-state='checked'] {
61
+ transform: translateX(28px);
62
+ }
63
+ `;
@@ -0,0 +1,15 @@
1
+ import React, { FC, PropsWithChildren } from 'react';
2
+ import { TagAppearance, TagSizes } from '@a-little-world/little-world-design-system-core';
3
+ interface TagProps {
4
+ bold?: boolean;
5
+ className?: string;
6
+ appearance?: TagAppearance;
7
+ size?: TagSizes;
8
+ color?: string;
9
+ }
10
+ interface TagsProps extends TagProps {
11
+ content: string[];
12
+ }
13
+ export declare const Tag: FC<PropsWithChildren<TagProps>>;
14
+ declare function Tags({ appearance, bold, color, content, className, size, }: TagsProps): React.JSX.Element;
15
+ export default Tags;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { TagAppearance, TagSizes, TextTypes, } from '@a-little-world/little-world-design-system-core';
3
+ import { StyledTag, TagsContainer } from './styles';
4
+ export const Tag = ({ bold, children, className, size = TagSizes.large, appearance = TagAppearance.outline, color, }) => {
5
+ return (React.createElement(StyledTag, { className: className, bold: bold, type: size === TagSizes.small ? TextTypes.Body6 : TextTypes.Body5, "$appearance": appearance, "$color": color, "$size": size }, children));
6
+ };
7
+ function Tags({ appearance, bold, color, content, className, size, }) {
8
+ return (React.createElement(TagsContainer, { className: className }, content.map(tag => (React.createElement(Tag, { key: tag, bold: bold, size: size, color: color, appearance: appearance }, tag)))));
9
+ }
10
+ export default Tags;
@@ -0,0 +1,19 @@
1
+ import { TagAppearance, TagSizes } from '@a-little-world/little-world-design-system-core';
2
+ export declare const StyledTag: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
3
+ className?: string;
4
+ disableParser?: boolean;
5
+ id?: string;
6
+ style?: import("react").CSSProperties;
7
+ tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
8
+ }, {
9
+ $size: TagSizes;
10
+ $appearance?: TagAppearance;
11
+ $color?: string;
12
+ }>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
13
+ className?: string;
14
+ disableParser?: boolean;
15
+ id?: string;
16
+ style?: import("react").CSSProperties;
17
+ tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
18
+ }) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
19
+ export declare const TagsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,80 @@
1
+ import styled, { css } from 'styled-components';
2
+ import Text from '../Text/Text';
3
+ import { TagAppearance, TagSizes, } from '@a-little-world/little-world-design-system-core';
4
+ export const StyledTag = styled(Text) `
5
+ font-family: 'Signika Negative';
6
+ line-height: 1;
7
+ text-align: center;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ gap: ${({ theme }) => theme.spacing.xxxsmall};
12
+ background: ${({ theme }) => theme.color.surface.primary};
13
+ border: 2px solid currentColor;
14
+ border-radius: ${({ theme }) => theme.radius.large};
15
+ min-width: 60px;
16
+ width: fit-content;
17
+ text-wrap: nowrap;
18
+ filter: drop-shadow(0px 1px 3px rgb(0 0 0 / 22%));
19
+
20
+ ${({ theme, $size }) => {
21
+ if ($size === TagSizes.small) {
22
+ return css `
23
+ height: 30px;
24
+ padding: ${theme.spacing.xsmall};
25
+ `;
26
+ }
27
+ if ($size === TagSizes.large) {
28
+ return css `
29
+ height: 33px;
30
+ padding: ${theme.spacing.xxsmall} ${theme.spacing.xsmall};
31
+
32
+ @media (min-width: ${theme.breakpoints.small}) {
33
+ padding: ${theme.spacing.xxsmall} ${theme.spacing.small};
34
+ min-width: 80px;
35
+ height: 40px;
36
+ }
37
+ `;
38
+ }
39
+ return '';
40
+ }}
41
+
42
+ ${({ theme, $appearance, $color }) => {
43
+ if ($appearance === TagAppearance.outline) {
44
+ return css `
45
+ color: ${$color || theme.color.text.primary};
46
+ border: 2px solid ${$color || theme.color.border.selected};
47
+ `;
48
+ }
49
+ if ($appearance === TagAppearance.filled) {
50
+ return css `
51
+ color: ${theme.color.text.reversed};
52
+ background: ${$color || theme.color.text.bold};
53
+ border: 2px solid ${$color || theme.color.border.contrast};
54
+ `;
55
+ }
56
+ if ($appearance === TagAppearance.error) {
57
+ return css `
58
+ color: ${theme.color.text.error};
59
+ background: ${theme.color.surface.error};
60
+ border: 0px;
61
+ filter: none;
62
+ `;
63
+ }
64
+ if ($appearance === TagAppearance.success) {
65
+ return css `
66
+ color: ${theme.color.text.success};
67
+ background: ${theme.color.surface.success};
68
+ border: 0px;
69
+ filter: none;
70
+ `;
71
+ }
72
+ return '';
73
+ }}
74
+ `;
75
+ export const TagsContainer = styled.div `
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ gap: ${({ theme }) => theme.spacing.xsmall};
79
+ padding-top: ${({ theme }) => theme.spacing.xxxsmall};
80
+ `;
@@ -0,0 +1,11 @@
1
+ import { TextBaseProps } from '@a-little-world/little-world-design-system-core';
2
+ import React, { CSSProperties } from 'react';
3
+ type TextProps = TextBaseProps & {
4
+ className?: string;
5
+ disableParser?: boolean;
6
+ id?: string;
7
+ style?: CSSProperties;
8
+ tag?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'li' | 'label' | 'span' | 'strong' | 'div';
9
+ };
10
+ declare const Text: ({ bold, center, children, color, className, disableParser, id, style, tag, type, }: TextProps) => React.JSX.Element;
11
+ export default Text;
@@ -0,0 +1,8 @@
1
+ import { TextTypes, } from '@a-little-world/little-world-design-system-core';
2
+ import React from 'react';
3
+ import textParser from '../../utils/parser';
4
+ import { StyledElement } from './styles';
5
+ const Text = ({ bold = false, center = false, children, color, className, disableParser = false, id, style, tag = 'p', type = TextTypes.Body5, }) => (React.createElement(StyledElement, { className: className, style: style, id: id, "$bold": bold, "$center": center, "$color": color, "$type": type, as: tag }, typeof children === 'string' && !disableParser
6
+ ? textParser(children)
7
+ : children));
8
+ export default Text;
@@ -0,0 +1,8 @@
1
+ import { TextTypes } from '@a-little-world/little-world-design-system-core';
2
+ export declare const BODY_5_CSS: import("styled-components").RuleSet<object>;
3
+ export declare const StyledElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
+ $bold: boolean;
5
+ $center: boolean;
6
+ $color?: string;
7
+ $type: keyof typeof TextTypes;
8
+ }>> & string;
@@ -0,0 +1,62 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { TextTypes, getTextStyle, } from '@a-little-world/little-world-design-system-core';
3
+ const BODY_SHARED_STYLES = css `
4
+ font-family: 'Signika Negative', sans-serif;
5
+ -webkit-font-smoothing: antialiased;
6
+ -moz-osx-font-smoothing: grayscale;
7
+ margin: 0;
8
+ line-height: 1.5;
9
+ `;
10
+ const HEADING_SHARED_STYLES = css `
11
+ font-family: 'Work Sans', sans-serif;
12
+ font-weight: bold;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ line-height: 1.1;
16
+ `;
17
+ export const BODY_5_CSS = css `
18
+ ${BODY_SHARED_STYLES}
19
+ font-size: 1rem;
20
+
21
+ @media (min-width: ${({ theme }) => theme.breakpoints.small}) {
22
+ font-size: 1rem;
23
+ }
24
+ `;
25
+ const styles = {
26
+ [TextTypes.Heading1]: getTextStyle(TextTypes.Heading1),
27
+ [TextTypes.Heading2]: getTextStyle(TextTypes.Heading2),
28
+ [TextTypes.Heading3]: getTextStyle(TextTypes.Heading3),
29
+ [TextTypes.Heading4]: getTextStyle(TextTypes.Heading4),
30
+ [TextTypes.Heading5]: getTextStyle(TextTypes.Heading5),
31
+ [TextTypes.Heading6]: getTextStyle(TextTypes.Heading6),
32
+ [TextTypes.Body1]: getTextStyle(TextTypes.Body1),
33
+ [TextTypes.Body2]: getTextStyle(TextTypes.Body2),
34
+ [TextTypes.Body3]: getTextStyle(TextTypes.Body3),
35
+ [TextTypes.Body4]: getTextStyle(TextTypes.Body4),
36
+ [TextTypes.Body5]: getTextStyle(TextTypes.Body5),
37
+ [TextTypes.Body6]: getTextStyle(TextTypes.Body6),
38
+ [TextTypes.Body7]: getTextStyle(TextTypes.Body7),
39
+ };
40
+ export const StyledElement = styled.div `
41
+ ${({ $bold }) => $bold && 'font-weight: bold;'}
42
+ ${({ $center }) => $center && 'text-align: center;'}
43
+ ${({ $color }) => $color && `color: ${$color};`}
44
+ white-space: pre-line;
45
+
46
+ ${({ $type, theme }) => {
47
+ const style = styles[$type];
48
+ return css `
49
+ ${style.styleType === 'body' ? BODY_SHARED_STYLES : HEADING_SHARED_STYLES}
50
+ font-size: ${style.fontSize}rem;
51
+ ${style.fontWeight ? `font-weight: ${style.fontWeight};` : ''}
52
+ ${style.lineHeight ? `line-height: ${style.lineHeight};` : ''}
53
+
54
+ ${style.desktopFontSize &&
55
+ css `
56
+ @media (min-width: ${theme.breakpoints.small}) {
57
+ font-size: ${style.desktopFontSize}rem;
58
+ }
59
+ `}
60
+ `;
61
+ }}
62
+ `;
@@ -0,0 +1,8 @@
1
+ export type TextStyleType = 'body' | 'heading';
2
+ export interface TextStyle {
3
+ fontSize: number;
4
+ desktopFontSize?: number;
5
+ lineHeight?: number;
6
+ fontWeight?: 'normal' | 'bold';
7
+ styleType: TextStyleType;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import React, { Ref } from 'react';
2
+ import { TextAreaSize } from '@a-little-world/little-world-design-system-core';
3
+ export { TextAreaSize };
4
+ export interface TextAreaProps extends React.ComponentPropsWithoutRef<'textarea'> {
5
+ displayCount?: boolean;
6
+ error?: string;
7
+ expandable?: boolean;
8
+ id?: string;
9
+ inputRef?: Ref<HTMLFormElement>;
10
+ label?: string;
11
+ labelTooltip?: string;
12
+ maxLength?: number;
13
+ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
14
+ onSubmit?: () => boolean;
15
+ size?: TextAreaSize;
16
+ value?: string;
17
+ }
18
+ declare const TextArea: React.FC<TextAreaProps>;
19
+ export default TextArea;
@@ -0,0 +1,45 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import useAutosizeTextArea from '../../hooks/useAutosizeTextArea';
3
+ import InputError from '../InputError/InputError';
4
+ import Label from '../Label/Label';
5
+ import { TextAreaSize, TextTypes, } from '@a-little-world/little-world-design-system-core';
6
+ import { Area, AreaWrapper, Counter } from './styles';
7
+ export { TextAreaSize };
8
+ const TextArea = ({ displayCount = true, error, expandable, id, inputRef, label, labelTooltip, maxLength, onChange, onSubmit, readOnly, size = TextAreaSize.Small, value, ...areaProps }) => {
9
+ const [internalValue, setInternalValue] = useState(value ?? '');
10
+ const textAreaRef = useRef(null);
11
+ const isTouchDeviceRef = useRef(typeof window !== 'undefined' &&
12
+ ('ontouchstart' in window || navigator.maxTouchPoints > 0));
13
+ useAutosizeTextArea(textAreaRef.current, internalValue, expandable);
14
+ const [textAreaCount, setTextAreaCount] = useState(0);
15
+ useEffect(() => {
16
+ setTextAreaCount(value?.length || 0);
17
+ setInternalValue(value || '');
18
+ }, [value]);
19
+ const handleOnChange = (e) => {
20
+ onChange?.(e);
21
+ setTextAreaCount(e.target.value.length);
22
+ setInternalValue(e.target.value);
23
+ };
24
+ const handleKeyDown = async (e) => {
25
+ if (onSubmit &&
26
+ e.key === 'Enter' &&
27
+ !e.shiftKey &&
28
+ !isTouchDeviceRef.current) {
29
+ e.preventDefault();
30
+ const submitSuccessful = await onSubmit();
31
+ if (submitSuccessful)
32
+ setInternalValue('');
33
+ }
34
+ };
35
+ return (React.createElement(AreaWrapper, { "$size": size },
36
+ label && (React.createElement(Label, { bold: true, htmlFor: id, tooltipText: labelTooltip }, label)),
37
+ Boolean(displayCount && !readOnly && maxLength) && (React.createElement(Counter, { type: TextTypes.Body7 }, `${textAreaCount}/${maxLength}`)),
38
+ React.createElement(Area, { ref: e => {
39
+ // @ts-ignore
40
+ inputRef?.(e);
41
+ textAreaRef.current = e;
42
+ }, id: id, "$hasError": Boolean(error), "$size": size, "$expandable": Boolean(expandable), maxLength: maxLength, onChange: handleOnChange, onKeyDown: handleKeyDown, readOnly: readOnly, value: value, ...areaProps }),
43
+ !readOnly && (React.createElement(InputError, { visible: Boolean(error), textAlign: "left" }, error))));
44
+ };
45
+ export default TextArea;
@@ -0,0 +1,22 @@
1
+ import { TextAreaSize } from '@a-little-world/little-world-design-system-core';
2
+ export declare const AreaWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $size?: TextAreaSize;
4
+ }>> & string;
5
+ export declare const Area: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, {
6
+ $expandable: boolean;
7
+ $hasError: boolean;
8
+ $size: TextAreaSize;
9
+ }>> & string;
10
+ export declare const Counter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
11
+ className?: string;
12
+ disableParser?: boolean;
13
+ id?: string;
14
+ style?: import("react").CSSProperties;
15
+ tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
16
+ }, never>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
17
+ className?: string;
18
+ disableParser?: boolean;
19
+ id?: string;
20
+ style?: import("react").CSSProperties;
21
+ tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
22
+ }) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
@@ -0,0 +1,42 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { INPUT_ERROR_CSS } from '../InputError/InputError';
3
+ import Text from '../Text/Text';
4
+ import { TextAreaDimensions, TextAreaSize, } from '@a-little-world/little-world-design-system-core';
5
+ export const AreaWrapper = styled.div `
6
+ display: flex;
7
+ flex-direction: column;
8
+ width: 100%;
9
+ max-width: ${({ $size }) => $size === TextAreaSize.Small ? '500px' : '100%'};
10
+ position: relative;
11
+ `;
12
+ export const Area = styled.textarea `
13
+ width: 100%;
14
+ font-family: 'Signika Negative', sans-serif;
15
+ font-size: 1rem;
16
+ height: ${({ $size }) => TextAreaDimensions[$size]};
17
+ border: 1px solid ${({ theme }) => theme.color.border.moderate};
18
+ border-radius: ${({ $size, theme }) => $size === TextAreaSize.Xsmall ? theme.radius.large : theme.radius.xxsmall};
19
+ background: ${({ theme }) => theme.color.surface.primary};
20
+ color: ${({ theme }) => theme.color.text.primary};
21
+ padding: ${({ $size, theme }) => $size === TextAreaSize.Small
22
+ ? theme.spacing.xxsmall
23
+ : $size === TextAreaSize.Xsmall
24
+ ? '11px 14px'
25
+ : theme.spacing.small};
26
+ box-sizing: border-box;
27
+ margin-bottom: ${({ theme, readOnly }) => readOnly ? 0 : theme.spacing.xxxxsmall};
28
+ resize: none;
29
+
30
+ ${({ $expandable, $size }) => $expandable &&
31
+ css `
32
+ min-height: ${TextAreaDimensions[$size]};
33
+ max-height: 13rem;
34
+ max-height: 25dvh;
35
+ `}
36
+ ${({ $hasError }) => $hasError && INPUT_ERROR_CSS};
37
+ `;
38
+ export const Counter = styled(Text) `
39
+ position: absolute;
40
+ bottom: 0px;
41
+ right: ${({ theme }) => theme.spacing.xxxxsmall};
42
+ `;
@@ -0,0 +1,28 @@
1
+ import React, { CSSProperties } from 'react';
2
+ export declare enum ContentTypes {
3
+ Paragraph = "paragraph",
4
+ List = "list",
5
+ OrderedList = "orderedList",
6
+ Title = "title",
7
+ Subtitle = "subtitle",
8
+ Heading = "heading",
9
+ Emphasize = "emphasize",
10
+ Sentence = "sentence",
11
+ Image = "image"
12
+ }
13
+ type Props = {
14
+ content: {
15
+ center?: boolean;
16
+ type: ContentTypes;
17
+ text?: string;
18
+ listItems?: string[];
19
+ color?: string;
20
+ Image?: React.ElementType;
21
+ imageWidth?: string;
22
+ imageMaxWidth?: string;
23
+ style?: CSSProperties;
24
+ }[];
25
+ marginBottom?: string;
26
+ };
27
+ declare const TextPage: ({ content, marginBottom }: Props) => React.JSX.Element;
28
+ export default TextPage;