@ntbjs/react-components 2.0.0-rc.29 → 2.0.0-rc.30

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 (279) hide show
  1. package/build/{_rollupPluginBabelHelpers-c245b26a.js → _virtual/_rollupPluginBabelHelpers.js} +2 -1
  2. package/build/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/build/{Alert-e6847a22.js → data/Alert/Alert.js} +5 -55
  4. package/build/data/Alert/Alert.js.map +1 -0
  5. package/build/data/Alert/Alert.styled.js +56 -0
  6. package/build/data/Alert/Alert.styled.js.map +1 -0
  7. package/build/data/Alert/index.js +2 -6
  8. package/build/data/Alert/index.js.map +1 -0
  9. package/build/data/Badge/Badge.js +87 -0
  10. package/build/data/Badge/Badge.js.map +1 -0
  11. package/build/{Badge-d93586a9.js → data/Badge/Badge.styled.js} +4 -85
  12. package/build/data/Badge/Badge.styled.js.map +1 -0
  13. package/build/data/Badge/index.js +2 -5
  14. package/build/data/Badge/index.js.map +1 -0
  15. package/build/data/Popover/Popover.js +93 -0
  16. package/build/data/Popover/Popover.js.map +1 -0
  17. package/build/{Popover-20050b91.js → data/Popover/Popover.styled.js} +6 -92
  18. package/build/data/Popover/Popover.styled.js.map +1 -0
  19. package/build/data/Popover/index.js +2 -10
  20. package/build/data/Popover/index.js.map +1 -0
  21. package/build/{Tab-04d435c3.js → data/Tab/Tab.js} +5 -12
  22. package/build/data/Tab/Tab.js.map +1 -0
  23. package/build/data/Tab/Tab.styled.js +13 -0
  24. package/build/data/Tab/Tab.styled.js.map +1 -0
  25. package/build/data/Tab/index.js +2 -5
  26. package/build/data/Tab/index.js.map +1 -0
  27. package/build/{Tabs-74d1ea8a.js → data/Tabs/Tabs.js} +6 -74
  28. package/build/data/Tabs/Tabs.js.map +1 -0
  29. package/build/data/Tabs/Tabs.styled.js +74 -0
  30. package/build/data/Tabs/Tabs.styled.js.map +1 -0
  31. package/build/data/Tabs/index.js +2 -7
  32. package/build/data/Tabs/index.js.map +1 -0
  33. package/build/{Tooltip-c1d1199e.js → data/Tooltip/Tooltip.js} +5 -26
  34. package/build/data/Tooltip/Tooltip.js.map +1 -0
  35. package/build/data/Tooltip/Tooltip.styled.js +28 -0
  36. package/build/data/Tooltip/Tooltip.styled.js.map +1 -0
  37. package/build/data/Tooltip/index.js +2 -7
  38. package/build/data/Tooltip/index.js.map +1 -0
  39. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +36 -0
  40. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -0
  41. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +53 -0
  42. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -0
  43. package/build/data/index.js +8 -16
  44. package/build/data/index.js.map +1 -0
  45. package/build/hooks/useEventListner.js +21 -0
  46. package/build/hooks/useEventListner.js.map +1 -0
  47. package/build/hooks/useIsomorphicLayoutEffect.js +6 -0
  48. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -0
  49. package/build/hooks/useOnClickOutside.js +14 -0
  50. package/build/hooks/useOnClickOutside.js.map +1 -0
  51. package/build/icons/arrow-back.svg.js +16 -0
  52. package/build/icons/arrow-back.svg.js.map +1 -0
  53. package/build/{arrow-forward-ad12c5f3.js → icons/arrow-forward.svg.js} +2 -1
  54. package/build/icons/arrow-forward.svg.js.map +1 -0
  55. package/build/icons/check-rectangle-filled.svg.js +16 -0
  56. package/build/icons/check-rectangle-filled.svg.js.map +1 -0
  57. package/build/{close-a5d37608.js → icons/close.svg.js} +2 -1
  58. package/build/icons/close.svg.js.map +1 -0
  59. package/build/{edit-note-283a0e15.js → icons/edit-note.svg.js} +2 -1
  60. package/build/icons/edit-note.svg.js.map +1 -0
  61. package/build/{expand-more-c5523c46.js → icons/expand-more.svg.js} +2 -1
  62. package/build/icons/expand-more.svg.js.map +1 -0
  63. package/build/icons/headset.svg.js +16 -0
  64. package/build/icons/headset.svg.js.map +1 -0
  65. package/build/icons/layers.svg.js +16 -0
  66. package/build/icons/layers.svg.js.map +1 -0
  67. package/build/icons/link.svg.js +16 -0
  68. package/build/icons/link.svg.js.map +1 -0
  69. package/build/icons/play.svg.js +16 -0
  70. package/build/icons/play.svg.js.map +1 -0
  71. package/build/icons/search.svg.js +16 -0
  72. package/build/icons/search.svg.js.map +1 -0
  73. package/build/icons/star-filled.svg.js +16 -0
  74. package/build/icons/star-filled.svg.js.map +1 -0
  75. package/build/icons/star.svg.js +16 -0
  76. package/build/icons/star.svg.js.map +1 -0
  77. package/build/icons/triangle-right.svg.js +16 -0
  78. package/build/icons/triangle-right.svg.js.map +1 -0
  79. package/build/icons/verification.svg.js +16 -0
  80. package/build/icons/verification.svg.js.map +1 -0
  81. package/build/{warning-circle-24f3efcd.js → icons/warning-circle.svg.js} +2 -1
  82. package/build/icons/warning-circle.svg.js.map +1 -0
  83. package/build/index.js +5 -0
  84. package/build/index.js.map +1 -0
  85. package/build/inputs/ActionButton/ActionButton.js +36 -0
  86. package/build/inputs/ActionButton/ActionButton.js.map +1 -0
  87. package/build/{ActionButton-4db754c3.js → inputs/ActionButton/ActionButton.styled.js} +4 -34
  88. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -0
  89. package/build/inputs/ActionButton/index.js +2 -6
  90. package/build/inputs/ActionButton/index.js.map +1 -0
  91. package/build/inputs/Button/Button.js +188 -0
  92. package/build/inputs/Button/Button.js.map +1 -0
  93. package/build/{Button-73eb8516.js → inputs/Button/Button.styled.js} +4 -186
  94. package/build/inputs/Button/Button.styled.js.map +1 -0
  95. package/build/inputs/Button/index.js +2 -13
  96. package/build/inputs/Button/index.js.map +1 -0
  97. package/build/inputs/Checkbox/Checkbox.js +97 -0
  98. package/build/inputs/Checkbox/Checkbox.js.map +1 -0
  99. package/build/inputs/Checkbox/Checkbox.styled.js +122 -0
  100. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -0
  101. package/build/inputs/Checkbox/index.js +2 -6
  102. package/build/inputs/Checkbox/index.js.map +1 -0
  103. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +267 -0
  104. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -0
  105. package/build/{CompactAutocompleteSelect-52c49513.js → inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js} +6 -267
  106. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -0
  107. package/build/inputs/CompactAutocompleteSelect/index.js +2 -23
  108. package/build/inputs/CompactAutocompleteSelect/index.js.map +1 -0
  109. package/build/inputs/CompactStarRating/CompactStarRating.js +177 -0
  110. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -0
  111. package/build/inputs/CompactStarRating/CompactStarRating.styled.js +217 -0
  112. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -0
  113. package/build/inputs/CompactStarRating/index.js +2 -17
  114. package/build/inputs/CompactStarRating/index.js.map +1 -0
  115. package/build/inputs/CompactTextInput/CompactTextInput.js +184 -0
  116. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -0
  117. package/build/{CompactTextInput-42ca5d42.js → inputs/CompactTextInput/CompactTextInput.styled.js} +4 -194
  118. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -0
  119. package/build/inputs/CompactTextInput/index.js +2 -19
  120. package/build/inputs/CompactTextInput/index.js.map +1 -0
  121. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +207 -0
  122. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -0
  123. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +66 -0
  124. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -0
  125. package/build/inputs/MultiLevelCheckbox/index.js +3 -0
  126. package/build/inputs/MultiLevelCheckbox/index.js.map +1 -0
  127. package/build/inputs/MultiLevelCheckbox/types.js +27 -0
  128. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -0
  129. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +184 -26
  130. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -0
  131. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +93 -0
  132. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -0
  133. package/build/inputs/MultiLevelCheckboxSelect/index.js +2 -0
  134. package/build/inputs/MultiLevelCheckboxSelect/index.js.map +1 -0
  135. package/build/{MultiSelect-9f497e62.js → inputs/MultiSelect/MultiSelect.js} +6 -223
  136. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -0
  137. package/build/inputs/MultiSelect/MultiSelect.styled.js +224 -0
  138. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -0
  139. package/build/inputs/MultiSelect/index.js +2 -10
  140. package/build/inputs/MultiSelect/index.js.map +1 -0
  141. package/build/inputs/Radio/Radio.js +60 -0
  142. package/build/inputs/Radio/Radio.js.map +1 -0
  143. package/build/{Radio-73ca3ae2.js → inputs/Radio/Radio.styled.js} +4 -58
  144. package/build/inputs/Radio/Radio.styled.js.map +1 -0
  145. package/build/inputs/Radio/index.js +2 -7
  146. package/build/inputs/Radio/index.js.map +1 -0
  147. package/build/inputs/Switch/Switch.js +64 -0
  148. package/build/inputs/Switch/Switch.js.map +1 -0
  149. package/build/{Switch-ecf3122b.js → inputs/Switch/Switch.styled.js} +4 -62
  150. package/build/inputs/Switch/Switch.styled.js.map +1 -0
  151. package/build/inputs/Switch/index.js +2 -6
  152. package/build/inputs/Switch/index.js.map +1 -0
  153. package/build/inputs/TextArea/TextArea.js +178 -0
  154. package/build/inputs/TextArea/TextArea.js.map +1 -0
  155. package/build/{TextArea-1e5b9201.js → inputs/TextArea/TextArea.styled.js} +3 -175
  156. package/build/inputs/TextArea/TextArea.styled.js.map +1 -0
  157. package/build/inputs/TextArea/index.js +2 -20
  158. package/build/inputs/TextArea/index.js.map +1 -0
  159. package/build/inputs/TextInput/TextInput.js +139 -0
  160. package/build/inputs/TextInput/TextInput.js.map +1 -0
  161. package/build/{TextInput-fab35842.js → inputs/TextInput/TextInput.styled.js} +4 -137
  162. package/build/inputs/TextInput/TextInput.styled.js.map +1 -0
  163. package/build/inputs/TextInput/index.js +2 -9
  164. package/build/inputs/TextInput/index.js.map +1 -0
  165. package/build/inputs/index.js +15 -40
  166. package/build/inputs/index.js.map +1 -0
  167. package/build/{InputGroup-1294d190.js → layout/InputGroup/InputGroup.js} +5 -8
  168. package/build/layout/InputGroup/InputGroup.js.map +1 -0
  169. package/build/layout/InputGroup/InputGroup.styled.js +9 -0
  170. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -0
  171. package/build/layout/SectionSeparator/SectionSeparator.js +23 -0
  172. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -0
  173. package/build/layout/SectionSeparator/SectionSeparator.styled.js +14 -0
  174. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -0
  175. package/build/layout/SectionSeparator/index.js +2 -5
  176. package/build/layout/SectionSeparator/index.js.map +1 -0
  177. package/build/layout/index.js +3 -6
  178. package/build/layout/index.js.map +1 -0
  179. package/build/ssr/index.js +1 -0
  180. package/build/ssr/index.js.map +1 -0
  181. package/build/styles/utils/colors.scss.js +4 -0
  182. package/build/styles/utils/colors.scss.js.map +1 -0
  183. package/build/utils/dateTime.js +17 -0
  184. package/build/utils/dateTime.js.map +1 -0
  185. package/build/utils/defaultTheme.js +44 -0
  186. package/build/utils/defaultTheme.js.map +1 -0
  187. package/build/{AssetAction-98d76ce0.js → widgets/AssetAction/AssetAction.js} +6 -40
  188. package/build/widgets/AssetAction/AssetAction.js.map +1 -0
  189. package/build/widgets/AssetAction/AssetAction.styled.js +41 -0
  190. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -0
  191. package/build/widgets/AssetAction/index.js +2 -7
  192. package/build/widgets/AssetAction/index.js.map +1 -0
  193. package/build/{AssetActionsBase-9e4c0735.js → widgets/AssetActionsBase/AssetActionsBase.js} +6 -15
  194. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -0
  195. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +15 -0
  196. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -0
  197. package/build/widgets/AssetActionsBase/index.js +2 -8
  198. package/build/widgets/AssetActionsBase/index.js.map +1 -0
  199. package/build/widgets/AssetGallery/AssetGallery.js +99 -0
  200. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -0
  201. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +385 -0
  202. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -0
  203. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +30 -0
  204. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -0
  205. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +401 -0
  206. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -0
  207. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +329 -0
  208. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -0
  209. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +409 -0
  210. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -0
  211. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +280 -0
  212. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -0
  213. package/build/widgets/AssetGallery/asset.propType.js +54 -0
  214. package/build/widgets/AssetGallery/asset.propType.js.map +1 -0
  215. package/build/widgets/AssetGallery/index.js +2 -48
  216. package/build/widgets/AssetGallery/index.js.map +1 -0
  217. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +44 -0
  218. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -0
  219. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +77 -0
  220. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -0
  221. package/build/widgets/AssetPreview/AssetPreviewTopBar/index.js +2 -6
  222. package/build/widgets/AssetPreview/AssetPreviewTopBar/index.js.map +1 -0
  223. package/build/{ContextMenu-0f7134e4.js → widgets/ContextMenu/ContextMenu.js} +5 -9
  224. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -0
  225. package/build/widgets/ContextMenu/ContextMenu.styled.js +10 -0
  226. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -0
  227. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +44 -0
  228. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -0
  229. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +77 -0
  230. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -0
  231. package/build/widgets/ContextMenu/ContextMenuItem/index.js +2 -5
  232. package/build/widgets/ContextMenu/ContextMenuItem/index.js.map +1 -0
  233. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +22 -0
  234. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -0
  235. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +21 -0
  236. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -0
  237. package/build/widgets/ContextMenu/ContextMenuItemsGroup/index.js +2 -37
  238. package/build/widgets/ContextMenu/ContextMenuItemsGroup/index.js.map +1 -0
  239. package/build/widgets/ContextMenu/index.js +2 -5
  240. package/build/widgets/ContextMenu/index.js.map +1 -0
  241. package/build/widgets/InfoCard/InfoCard.js +40 -0
  242. package/build/widgets/InfoCard/InfoCard.js.map +1 -0
  243. package/build/{InfoCard-c98b6f5a.js → widgets/InfoCard/InfoCard.styled.js} +5 -38
  244. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -0
  245. package/build/widgets/InfoCard/index.js +2 -6
  246. package/build/widgets/InfoCard/index.js.map +1 -0
  247. package/build/{Instructions-bfd28cea.js → widgets/Instructions/Instructions.js} +8 -34
  248. package/build/widgets/Instructions/Instructions.js.map +1 -0
  249. package/build/widgets/Instructions/Instructions.styled.js +32 -0
  250. package/build/widgets/Instructions/Instructions.styled.js.map +1 -0
  251. package/build/widgets/Instructions/index.js +2 -28
  252. package/build/widgets/Instructions/index.js.map +1 -0
  253. package/build/widgets/ProgressBar/ProgressBar.js +72 -0
  254. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -0
  255. package/build/{ProgressBar-bc4a4a7e.js → widgets/ProgressBar/ProgressBar.styled.js} +5 -70
  256. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -0
  257. package/build/widgets/ProgressBar/index.js +2 -6
  258. package/build/widgets/ProgressBar/index.js.map +1 -0
  259. package/build/widgets/SummaryCard/SummaryCard.js +92 -0
  260. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -0
  261. package/build/widgets/SummaryCard/SummaryCard.styled.js +137 -0
  262. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -0
  263. package/build/widgets/SummaryCard/index.js +2 -19
  264. package/build/widgets/SummaryCard/index.js.map +1 -0
  265. package/build/widgets/index.js +12 -53
  266. package/build/widgets/index.js.map +1 -0
  267. package/package.json +5 -2
  268. package/build/AssetGallery-63f721ec.js +0 -1981
  269. package/build/AssetPreviewTopBar-acd6353d.js +0 -127
  270. package/build/Checkbox-4a5fd716.js +0 -213
  271. package/build/CompactStarRating-9af2f427.js +0 -411
  272. package/build/ContextMenuItem-ea411141.js +0 -127
  273. package/build/MultiLevelCheckboxSelect-d8044c88.js +0 -604
  274. package/build/SectionSeparator-f47760a2.js +0 -31
  275. package/build/SummaryCard-24040650.js +0 -223
  276. package/build/VerificationStatusIcon-49cb1c1b.js +0 -95
  277. package/build/defaultTheme-1bcc2541.js +0 -1178
  278. package/build/layout/InputGroup/index.js +0 -5
  279. package/build/shift-away-subtle-0dd94a03.js +0 -7
@@ -0,0 +1,139 @@
1
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React__default, { useRef, useState, useMemo } from 'react';
3
+ import { nanoid } from 'nanoid';
4
+ import PropTypes from 'prop-types';
5
+ import useMergedRefs from '@restart/hooks/useMergedRefs';
6
+ import { isBoolean, isEmpty } from 'lodash';
7
+ import { ReactComponent as SvgEditNote } from '../../icons/edit-note.svg.js';
8
+ import { TextInput as TextInput$1, TextInputFieldIcon, TextInputWrapper, Adornment, TextInputField, InputIconContainer, TextInputLabel, Description } from './TextInput.styled.js';
9
+
10
+ const TextInput = React__default.forwardRef(function TextInput({
11
+ value,
12
+ defaultValue,
13
+ name,
14
+ label,
15
+ placeholder,
16
+ type,
17
+ required,
18
+ disabled,
19
+ readOnly,
20
+ autoComplete,
21
+ description,
22
+ error,
23
+ warning,
24
+ icon,
25
+ adornments,
26
+ className,
27
+ style,
28
+ onChange,
29
+ onBlur,
30
+ noBorder,
31
+ ...rest
32
+ }, forwardedRef) {
33
+ const textInputDomNode = useRef(null);
34
+ const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);
35
+ const [uniqueId] = useState(nanoid());
36
+ const hasError = useMemo(() => {
37
+ if (isBoolean(error)) {
38
+ return error;
39
+ }
40
+ return !isEmpty(error);
41
+ }, [error]);
42
+ const hasWarning = useMemo(() => {
43
+ if (isBoolean(warning)) {
44
+ return warning;
45
+ }
46
+ return !isEmpty(warning);
47
+ }, [warning]);
48
+ const descriptionText = useMemo(() => {
49
+ if (!isEmpty(error)) {
50
+ return error;
51
+ }
52
+ if (!isEmpty(warning)) {
53
+ return warning;
54
+ }
55
+ if (!isEmpty(description)) {
56
+ return description;
57
+ }
58
+ return null;
59
+ }, [description, error, warning]);
60
+ return React__default.createElement(TextInput$1, {
61
+ error: hasError,
62
+ disabled: disabled,
63
+ warning: hasWarning,
64
+ className: className,
65
+ style: style
66
+ }, typeof icon !== 'undefined' && React__default.createElement(TextInputFieldIcon, null, icon), React__default.createElement(TextInputWrapper, null, typeof adornments?.prefix === 'string' && adornments.prefix.length > 0 && React__default.createElement(Adornment, {
67
+ htmlFor: `text-input-${uniqueId}`,
68
+ error: hasError,
69
+ warning: hasWarning,
70
+ isPrefix: true,
71
+ onClick: () => textInputDomNode.current.focus()
72
+ }, adornments.prefix), React__default.createElement(TextInputField, _extends({
73
+ ref: textInputRef,
74
+ value: value,
75
+ defaultValue: defaultValue,
76
+ name: name,
77
+ placeholder: placeholder || ' ',
78
+ type: type,
79
+ required: required,
80
+ autoComplete: autoComplete,
81
+ hasIcon: Boolean(icon),
82
+ error: hasError,
83
+ warning: hasWarning,
84
+ id: `text-input-${uniqueId}`,
85
+ onChange: onChange,
86
+ onBlur: onBlur,
87
+ readOnly: readOnly,
88
+ noBorder: noBorder
89
+ }, rest)), !readOnly && noBorder && React__default.createElement(InputIconContainer, {
90
+ error: error,
91
+ warning: warning
92
+ }, React__default.createElement(SvgEditNote, null)), label && React__default.createElement(TextInputLabel, {
93
+ htmlFor: `text-input-${uniqueId}`,
94
+ hasPlaceholder: Boolean(placeholder),
95
+ hasAdornments: Boolean(typeof adornments?.prefix === 'string' && adornments.prefix.length > 0 || typeof adornments?.suffix === 'string' && adornments.suffix.length > 0),
96
+ hasIcon: Boolean(icon),
97
+ error: hasError
98
+ }, label, required && ' *'), typeof adornments?.suffix === 'string' && adornments.suffix.length > 0 && React__default.createElement(Adornment, {
99
+ error: hasError,
100
+ warning: hasWarning,
101
+ isPrefix: false,
102
+ onClick: () => textInputDomNode.current.focus()
103
+ }, adornments.suffix)), typeof descriptionText === 'string' && descriptionText.length > 0 && React__default.createElement(Description, {
104
+ error: hasError,
105
+ warning: hasWarning
106
+ }, descriptionText));
107
+ });
108
+ TextInput.defaultProps = {
109
+ type: 'text',
110
+ noBorder: false
111
+ };
112
+ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
113
+ value: PropTypes.string,
114
+ defaultValue: PropTypes.string,
115
+ name: PropTypes.string,
116
+ label: PropTypes.string,
117
+ placeholder: PropTypes.string,
118
+ type: PropTypes.string,
119
+ required: PropTypes.bool,
120
+ disabled: PropTypes.bool,
121
+ readOnly: PropTypes.bool,
122
+ autoComplete: PropTypes.string,
123
+ description: PropTypes.string,
124
+ error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
125
+ warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
126
+ icon: PropTypes.element,
127
+ adornments: PropTypes.shape({
128
+ prefix: PropTypes.string,
129
+ suffix: PropTypes.string
130
+ }),
131
+ className: PropTypes.string,
132
+ style: PropTypes.object,
133
+ onChange: PropTypes.func,
134
+ onBlur: PropTypes.func,
135
+ noBorder: PropTypes.bool
136
+ } : {};
137
+
138
+ export { TextInput as default };
139
+ //# sourceMappingURL=TextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.js","sources":["../../../src/components/inputs/TextInput/TextInput.js"],"sourcesContent":["import React, { useMemo, useRef, useState } from 'react';\n\nimport { nanoid } from 'nanoid';\nimport PropTypes from 'prop-types';\n\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { isBoolean, isEmpty } from 'lodash';\nimport { ReactComponent as EditNoteIcon } from '../../../icons/edit-note.svg';\nimport * as S from './TextInput.styled';\n\n/**\n * Text inputs let users enter and edit text in the UI. They typically appear in forms and dialogs.\n *\n * ### Import\n *\n * ``` js\n * import { TextInput } from '@ntbjs/react-components/inputs'\n * // or\n * import TextInput from '@ntbjs/react-components/inputs/TextInput'\n * ```\n */\nconst TextInput = React.forwardRef(function TextInput(\n {\n value,\n defaultValue,\n name,\n label,\n placeholder,\n type,\n required,\n disabled,\n readOnly,\n autoComplete,\n description,\n error,\n warning,\n icon,\n adornments,\n className,\n style,\n onChange,\n onBlur,\n noBorder,\n ...rest\n },\n forwardedRef\n) {\n const textInputDomNode = useRef(null);\n const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);\n const [uniqueId] = useState(nanoid());\n\n const hasError = useMemo(() => {\n if (isBoolean(error)) {\n return error;\n }\n\n return !isEmpty(error);\n }, [error]);\n\n const hasWarning = useMemo(() => {\n if (isBoolean(warning)) {\n return warning;\n }\n\n return !isEmpty(warning);\n }, [warning]);\n\n const descriptionText = useMemo(() => {\n if (!isEmpty(error)) {\n return error;\n }\n\n if (!isEmpty(warning)) {\n return warning;\n }\n\n if (!isEmpty(description)) {\n return description;\n }\n\n return null;\n }, [description, error, warning]);\n\n return (\n <S.TextInput\n error={hasError}\n disabled={disabled}\n warning={hasWarning}\n className={className}\n style={style}\n >\n {typeof icon !== 'undefined' && <S.TextInputFieldIcon>{icon}</S.TextInputFieldIcon>}\n <S.TextInputWrapper>\n {typeof adornments?.prefix === 'string' && adornments.prefix.length > 0 && (\n <S.Adornment\n htmlFor={`text-input-${uniqueId}`}\n error={hasError}\n warning={hasWarning}\n isPrefix={true}\n onClick={() => textInputDomNode.current.focus()}\n >\n {adornments.prefix}\n </S.Adornment>\n )}\n <S.TextInputField\n ref={textInputRef}\n value={value}\n defaultValue={defaultValue}\n name={name}\n placeholder={placeholder || ' '} // Should default to an empty string with one space\n type={type}\n required={required}\n autoComplete={autoComplete}\n hasIcon={Boolean(icon)}\n error={hasError}\n warning={hasWarning}\n id={`text-input-${uniqueId}`}\n onChange={onChange}\n onBlur={onBlur}\n readOnly={readOnly}\n noBorder={noBorder}\n {...rest}\n />\n {!readOnly && noBorder && (\n <S.InputIconContainer error={error} warning={warning}>\n <EditNoteIcon />\n </S.InputIconContainer>\n )}\n {label && (\n <S.TextInputLabel\n htmlFor={`text-input-${uniqueId}`}\n hasPlaceholder={Boolean(placeholder)}\n hasAdornments={Boolean(\n (typeof adornments?.prefix === 'string' && adornments.prefix.length > 0) ||\n (typeof adornments?.suffix === 'string' && adornments.suffix.length > 0)\n )}\n hasIcon={Boolean(icon)}\n error={hasError}\n >\n {label}\n {required && ' *'}\n </S.TextInputLabel>\n )}\n {typeof adornments?.suffix === 'string' && adornments.suffix.length > 0 && (\n <S.Adornment\n error={hasError}\n warning={hasWarning}\n isPrefix={false}\n onClick={() => textInputDomNode.current.focus()}\n >\n {adornments.suffix}\n </S.Adornment>\n )}\n </S.TextInputWrapper>\n {typeof descriptionText === 'string' && descriptionText.length > 0 && (\n <S.Description error={hasError} warning={hasWarning}>\n {descriptionText}\n </S.Description>\n )}\n </S.TextInput>\n );\n});\n\nTextInput.defaultProps = {\n type: 'text',\n noBorder: false\n};\n\nTextInput.propTypes = {\n /**\n * Content of the text input field\n */\n value: PropTypes.string,\n\n /**\n * Default content of the text input field\n */\n defaultValue: PropTypes.string,\n\n /**\n * Name of the text input field (used when sending form data)\n */\n name: PropTypes.string,\n\n /**\n * Label text for the text input field. If the text input field is empty (no input and no placeholder)\n * and isn't in focus, the label text will be displayed grayed out in the field itself.\n * Otherwise, the label text will be displayed in the top left corner.\n */\n label: PropTypes.string,\n\n /**\n * Placeholder text to be displayed if the text area is empty (no input)\n */\n placeholder: PropTypes.string,\n\n /**\n * Type of input – e.g. `text`, `email`, `password`, etc.\n */\n type: PropTypes.string,\n\n /**\n * Whether the field is required\n */\n required: PropTypes.bool,\n\n /**\n * Whether the field is disabled\n */\n disabled: PropTypes.bool,\n\n /**\n * Whether the field is read-only\n */\n readOnly: PropTypes.bool,\n\n /**\n * ?\n */\n autoComplete: PropTypes.string,\n\n /**\n * Descriptive text displayed below the text input field\n */\n description: PropTypes.string,\n\n /**\n * Set to `true` to display the text input field with a red border. Set to a string to\n * aslo display the given string as an error message below the field.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Set to `true` to display the text input field with a yellow/orange border. Set to a string to\n * aslo display the given string as a warning message below the field.\n */\n warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Optional icon to be displayed left of the text inside the text area\n */\n icon: PropTypes.element,\n\n /**\n * Text to be displayed before/after the user input. Takes an object with two values:\n * `prefix` and `suffix`, where prefix will be displayed before and suffix will be\n * displayed after the user input.\n */\n adornments: PropTypes.shape({ prefix: PropTypes.string, suffix: PropTypes.string }),\n\n /**\n * Add custom class names to the HTML element\n */\n className: PropTypes.string,\n\n /**\n * Add custom CSS styling\n */\n style: PropTypes.object,\n\n /**\n * Optional callback function for the `onChange` event\n */\n onChange: PropTypes.func,\n\n /**\n * Optional callback function for the `onBlur` event\n */\n onBlur: PropTypes.func,\n\n /**\n * Whether to display the text input field without borders when it's not in focus\n */\n noBorder: PropTypes.bool\n};\n\nexport default TextInput;\n"],"names":["TextInput","React","forwardRef","value","defaultValue","name","label","placeholder","type","required","disabled","readOnly","autoComplete","description","error","warning","icon","adornments","className","style","onChange","onBlur","noBorder","rest","forwardedRef","textInputDomNode","useRef","textInputRef","useMergedRefs","uniqueId","useState","nanoid","hasError","useMemo","isBoolean","isEmpty","hasWarning","descriptionText","createElement","S","prefix","length","htmlFor","isPrefix","onClick","current","focus","_extends","ref","hasIcon","Boolean","id","EditNoteIcon","hasPlaceholder","hasAdornments","suffix","defaultProps","propTypes","process","env","NODE_ENV","PropTypes","string","bool","oneOfType","element","shape","object","func"],"mappings":";;;;;;;;;AAqBMA,MAAAA,SAAS,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,SAASA,CACnD;EACEG,KAAK;EACLC,YAAY;EACZC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,WAAW;EACXC,KAAK;EACLC,O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AAS,CAAC,CAACH,SAAS,CAACE,IAAI,EAAEF,SAAS,CAACC,MAAM,CAAC,CAAC;AAM9D/C,EAAAA,OAAO,EAAE8C,SAAS,CAACG,SAAS,CAAC,CAACH,SAAS,CAACE,IAAI,EAAEF,SAAS,CAACC,MAAM,CAAC,CAAC;EAKhE9C,IAAI,EAAE6C,SAAS,CAACI,OAAO;AAOvBhD,EAAAA,UAAU,EAAE4C,SAAS,CAACK,KAAK,CAAC;IAAE1B,MAAM,EAAEqB,SAAS,CAACC,MAAM;IAAEP,MAAM,EAAEM,SAAS,CAACC,MAAAA;AAAO,GAAC,CAAC;EAKnF5C,SAAS,EAAE2C,SAAS,CAACC,MAAM;EAK3B3C,KAAK,EAAE0C,SAAS,CAACM,MAAM;EAKvB/C,QAAQ,EAAEyC,SAAS,CAACO,IAAI;EAKxB/C,MAAM,EAAEwC,SAAS,CAACO,IAAI;EAKtB9C,QAAQ,EAAEuC,SAAS,CAACE,IAAAA;AACtB,CAAC,GAAA,EAAA;;;;"}
@@ -1,11 +1,5 @@
1
- import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
2
- import React__default, { useRef, useState, useMemo } from 'react';
3
- import { nanoid } from 'nanoid';
4
- import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
5
- import useMergedRefs from '@restart/hooks/useMergedRefs';
6
- import { isBoolean, isEmpty } from 'lodash';
7
- import { S as SvgEditNote } from './edit-note-283a0e15.js';
8
1
  import styled, { css } from 'styled-components';
2
+ import { applyDefaultTheme } from '../../utils/defaultTheme.js';
9
3
 
10
4
  const activeLabel = css`
11
5
  font-size: 0.75rem;
@@ -178,7 +172,7 @@ const TextInputFieldIcon = styled.div.attrs(applyDefaultTheme)`
178
172
  transition: opacity 250ms;
179
173
  }
180
174
  `;
181
- const TextInput$1 = styled.div.attrs(applyDefaultTheme)`
175
+ const TextInput = styled.div.attrs(applyDefaultTheme)`
182
176
  position: relative;
183
177
 
184
178
  ${props => props.disabled && css`
@@ -233,132 +227,5 @@ const Description = styled.p.attrs(applyDefaultTheme)`
233
227
  `}
234
228
  `;
235
229
 
236
- const TextInput = React__default.forwardRef(function TextInput({
237
- value,
238
- defaultValue,
239
- name,
240
- label,
241
- placeholder,
242
- type,
243
- required,
244
- disabled,
245
- readOnly,
246
- autoComplete,
247
- description,
248
- error,
249
- warning,
250
- icon,
251
- adornments,
252
- className,
253
- style,
254
- onChange,
255
- onBlur,
256
- noBorder,
257
- ...rest
258
- }, forwardedRef) {
259
- const textInputDomNode = useRef(null);
260
- const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);
261
- const [uniqueId] = useState(nanoid());
262
- const hasError = useMemo(() => {
263
- if (isBoolean(error)) {
264
- return error;
265
- }
266
- return !isEmpty(error);
267
- }, [error]);
268
- const hasWarning = useMemo(() => {
269
- if (isBoolean(warning)) {
270
- return warning;
271
- }
272
- return !isEmpty(warning);
273
- }, [warning]);
274
- const descriptionText = useMemo(() => {
275
- if (!isEmpty(error)) {
276
- return error;
277
- }
278
- if (!isEmpty(warning)) {
279
- return warning;
280
- }
281
- if (!isEmpty(description)) {
282
- return description;
283
- }
284
- return null;
285
- }, [description, error, warning]);
286
- return React__default.createElement(TextInput$1, {
287
- error: hasError,
288
- disabled: disabled,
289
- warning: hasWarning,
290
- className: className,
291
- style: style
292
- }, typeof icon !== 'undefined' && React__default.createElement(TextInputFieldIcon, null, icon), React__default.createElement(TextInputWrapper, null, typeof adornments?.prefix === 'string' && adornments.prefix.length > 0 && React__default.createElement(Adornment, {
293
- htmlFor: `text-input-${uniqueId}`,
294
- error: hasError,
295
- warning: hasWarning,
296
- isPrefix: true,
297
- onClick: () => textInputDomNode.current.focus()
298
- }, adornments.prefix), React__default.createElement(TextInputField, _extends({
299
- ref: textInputRef,
300
- value: value,
301
- defaultValue: defaultValue,
302
- name: name,
303
- placeholder: placeholder || ' ',
304
- type: type,
305
- required: required,
306
- autoComplete: autoComplete,
307
- hasIcon: Boolean(icon),
308
- error: hasError,
309
- warning: hasWarning,
310
- id: `text-input-${uniqueId}`,
311
- onChange: onChange,
312
- onBlur: onBlur,
313
- readOnly: readOnly,
314
- noBorder: noBorder
315
- }, rest)), !readOnly && noBorder && React__default.createElement(InputIconContainer, {
316
- error: error,
317
- warning: warning
318
- }, React__default.createElement(SvgEditNote, null)), label && React__default.createElement(TextInputLabel, {
319
- htmlFor: `text-input-${uniqueId}`,
320
- hasPlaceholder: Boolean(placeholder),
321
- hasAdornments: Boolean(typeof adornments?.prefix === 'string' && adornments.prefix.length > 0 || typeof adornments?.suffix === 'string' && adornments.suffix.length > 0),
322
- hasIcon: Boolean(icon),
323
- error: hasError
324
- }, label, required && ' *'), typeof adornments?.suffix === 'string' && adornments.suffix.length > 0 && React__default.createElement(Adornment, {
325
- error: hasError,
326
- warning: hasWarning,
327
- isPrefix: false,
328
- onClick: () => textInputDomNode.current.focus()
329
- }, adornments.suffix)), typeof descriptionText === 'string' && descriptionText.length > 0 && React__default.createElement(Description, {
330
- error: hasError,
331
- warning: hasWarning
332
- }, descriptionText));
333
- });
334
- TextInput.defaultProps = {
335
- type: 'text',
336
- noBorder: false
337
- };
338
- TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
339
- value: PropTypes.string,
340
- defaultValue: PropTypes.string,
341
- name: PropTypes.string,
342
- label: PropTypes.string,
343
- placeholder: PropTypes.string,
344
- type: PropTypes.string,
345
- required: PropTypes.bool,
346
- disabled: PropTypes.bool,
347
- readOnly: PropTypes.bool,
348
- autoComplete: PropTypes.string,
349
- description: PropTypes.string,
350
- error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
351
- warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
352
- icon: PropTypes.element,
353
- adornments: PropTypes.shape({
354
- prefix: PropTypes.string,
355
- suffix: PropTypes.string
356
- }),
357
- className: PropTypes.string,
358
- style: PropTypes.object,
359
- onChange: PropTypes.func,
360
- onBlur: PropTypes.func,
361
- noBorder: PropTypes.bool
362
- } : {};
363
-
364
- export { TextInput as T };
230
+ export { Adornment, Description, InputIconContainer, TextInput, TextInputField, TextInputFieldIcon, TextInputLabel, TextInputWrapper };
231
+ //# sourceMappingURL=TextInput.styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.styled.js","sources":["../../../src/components/inputs/TextInput/TextInput.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst activeLabel = css`\n font-size: 0.75rem;\n padding: 0 3px;\n top: -7px;\n letter-spacing: 0.03em;\n left: 8px !important;\n opacity: 1 !important;\n`;\n\nexport const Adornment = styled.div.attrs(applyDefaultTheme)`\n flex-shrink: 0;\n font-family: inherit;\n font-size: 0.875rem;\n line-height: initial;\n padding: 13px 10px;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )}\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n border: 1px solid;\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )}\n border-radius: 3px;\n ${props =>\n props.isPrefix\n ? css`\n padding-right: 10px;\n border-right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n `\n : css`\n padding-left: 0;\n margin-left: -3px;\n border-left: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n `}\n box-sizing: border-box;\n appearance: none;\n transition: border-color 350ms;\n height: 2.75rem;\n\n ${props =>\n props.warning &&\n css`\n border-color: ${props.theme.getColor('orange-500')} !important;\n `}\n ${props =>\n props.error &&\n css`\n border-color: ${props.theme.getColor('red-500')} !important;\n `}\n`;\n\nexport const TextInputWrapper = styled.div.attrs(applyDefaultTheme)`\n display: flex;\n align-content: center;\n\n &:focus-within {\n ${Adornment} {\n outline: none;\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-600'),\n 1\n )}\n }\n }\n`;\n\nexport const InputIconContainer = styled.div.attrs(applyDefaultTheme)`\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n padding-right: 4px;\n padding-left: 30px;\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n color: ${props => props.theme.getColor('gray-400')};\n\n ${props => props.warning && props.theme.themeProp('color', '#C3AF43', '#C3AF43')}\n\n ${props => props.error && props.theme.themeProp('color', '#CB968F', '#CB968F')}\n\n > svg {\n width: 12px;\n }\n`;\n\nexport const TextInputField = styled.input.attrs(applyDefaultTheme)`\n display: block;\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n line-height: 1;\n padding: 13px 10px;\n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n transition: border-color 350ms;\n height: 2.75rem !important; // important is needed to override the default Foundation styling used in the Mediebank;\n margin-bottom: 0; // needed to override the default Foundation styling used in the Mediebank;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('white')\n )}\n border: 1px solid;\n ${props =>\n props.noBorder || props.readOnly\n ? 'border-color: transparent !important'\n : props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )};\n\n ${props =>\n props.readOnly &&\n css`\n user-select: text;\n cursor: default;\n `}\n\n ${props =>\n props.warning &&\n css`\n border-color: ${props.theme.getColor('orange-500')} !important;\n `}\n ${props =>\n props.error &&\n css`\n border-color: ${props.theme.getColor('red-500')} !important;\n `}\n ${props =>\n props.hasIcon &&\n css`\n padding-left: 35px;\n `}\n\n &::placeholder {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-600'),\n 1\n )}\n\n ${props => props.theme.themeProp('opacity', 0.6, 0.5, 1)}\n }\n\n\n &&:hover:not(:focus) {\n ${props =>\n props.noBorder\n ? props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-200')\n )\n : 'background: transparent'};\n transition: background 350ms;\n & + ${InputIconContainer} {\n opacity: 1;\n transition: opacity 350ms;\n }\n }\n\n :focus {\n outline: none;\n border-color: ${props => props.theme.getColor('gray-600')} !important\n ${props =>\n props.readOnly &&\n css`\n outline: none;\n `}\n`;\n\nexport const TextInputLabel = styled.label.attrs(applyDefaultTheme)`\n position: absolute;\n top: 15px;\n left: 11px;\n line-height: 1.2;\n font-size: 0.875rem;\n transition: all 150ms;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-600')\n )}\n\n ${props => props.theme.themeProp('opacity', 0.6, 0.5)}\n\n ${props =>\n props.theme.themeProp(\n 'background',\n `linear-gradient(0deg, ${props.theme.getColor('gray-900')} calc(50% + 1px), transparent 50%)`,\n `linear-gradient(0deg, ${props.theme.getColor('white')} calc(50% + 1px), transparent 50%)`\n )}\n\n ${props =>\n (props.hasPlaceholder || props.hasAdornments) &&\n css`\n ${activeLabel};\n `}\n\n\n ${props =>\n props.hasIcon &&\n css`\n left: 35px;\n `}\n`;\n\nexport const TextInputFieldIcon = styled.div.attrs(applyDefaultTheme)`\n position: absolute;\n top: 0;\n left: 0;\n height: 2.625rem;\n display: flex;\n padding: 0 10px;\n\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n }\n`;\n\nexport const TextInput = styled.div.attrs(applyDefaultTheme)`\n position: relative;\n\n ${props =>\n props.disabled &&\n css`\n user-select: none;\n opacity: 0.5;\n cursor: not-allowed;\n > * {\n pointer-events: none;\n }\n `}\n\n &:focus-within {\n ${TextInputLabel} {\n ${activeLabel};\n }\n\n ${TextInputFieldIcon} {\n svg {\n opacity: 1;\n }\n }\n }\n\n ${TextInputField}:not(:placeholder-shown) + ${TextInputLabel} {\n ${activeLabel};\n ${props =>\n props.error &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('red-200'),\n props.theme.getColor('red-500')\n )}\n\n ${props =>\n props.error &&\n css`\n color: ${props.theme.getColor('red-500')};\n `}\n ${props =>\n props.warning &&\n css`\n color: ${props.theme.getColor('orange-500')};\n `} \n } \n \n}\n`;\n\nexport const Description = styled.p.attrs(applyDefaultTheme)`\n margin: 8px 0 0 0;\n padding: 0 0.6875rem;\n font-size: 0.75rem;\n line-height: 1.333;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n\n ${props =>\n props.error &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('red-200'),\n props.theme.getColor('red-500')\n )}\n `}\n\n ${props =>\n props.warning &&\n css`\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('red-200'),\n props.theme.getColor('orange-500')\n )}\n `}\n`;\n"],"names":["activeLabel","css","Adornment","styled","div","attrs","applyDefaultTheme","props","theme","themeProp","getColor","isPrefix","warning","error","TextInputWrapper","InputIconContainer","TextInputField","input","noBorder","readOnly","hasIcon","TextInputLabel","label","hasPlaceholder","hasAdornments","TextInputFieldIcon","TextInput","disabled","Description","p"],"mappings":";;;AAGA,MAAMA,WAAW,GAAGC,GAAG,CAAA;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAA;AAEM,MAAMC,SAAS,GAAGC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,EAAIC,EAAAA,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL,EAAIH,EAAAA,KAAK,IACLA,KAAK,CAACC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MAAO,CAAA,CAAA;AACP;AACA;AACA;AACA,EAAC;AAEM,MAAMkB,WAAW,GAAGzB,MAAM,CAAC0B,CAAC,CAACxB,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC5D;AACA;AACA;AACA;AACA;AACA,EAAIC,EAAAA,KAAK,IACLA,KAAK,CAACC,KAAK,CAACC,SAAS,CACnB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL;AACA,EAAA,EAAIH,KAAK,IACLA,KAAK,CAACM,KAAK,IACXZ,GAAG,CAAA;AACP,MAAQM,EAAAA,KAAK,CAACC,KAAK,CAACC,SAAS,CACrB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC,EAC/BH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,SAAS,CAChC,CAAC,CAAA;AACP,IAAK,CAAA,CAAA;AACL;AACA,EAAA,EAAIH,KAAK,IACLA,KAAK,CAACK,OAAO,IACbX,GAAG,CAAA;AACP,MAAQM,EAAAA,KAAK,CAACC,KAAK,CAACC,SAAS,CACrB,OAAO,EACPF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,SAAS,CAAC,EAC/BH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,YAAY,CACnC,CAAC,CAAA;AACP,IAAK,CAAA,CAAA;AACL;;;;"}
@@ -1,9 +1,2 @@
1
- export { T as default } from '../../TextInput-fab35842.js';
2
- import '../../_rollupPluginBabelHelpers-c245b26a.js';
3
- import 'react';
4
- import 'nanoid';
5
- import '../../defaultTheme-1bcc2541.js';
6
- import 'styled-components';
7
- import '@restart/hooks/useMergedRefs';
8
- import 'lodash';
9
- import '../../edit-note-283a0e15.js';
1
+ export { default } from './TextInput.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,40 +1,15 @@
1
- export { A as ActionButton } from '../ActionButton-4db754c3.js';
2
- export { B as Button } from '../Button-73eb8516.js';
3
- export { C as Checkbox } from '../Checkbox-4a5fd716.js';
4
- export { C as CompactAutocompleteSelect } from '../CompactAutocompleteSelect-52c49513.js';
5
- export { C as CompactStarRating } from '../CompactStarRating-9af2f427.js';
6
- export { C as CompactTextInput } from '../CompactTextInput-42ca5d42.js';
7
- export { M as MultiSelect } from '../MultiSelect-9f497e62.js';
8
- export { R as Radio } from '../Radio-73ca3ae2.js';
9
- export { T as TextArea } from '../TextArea-1e5b9201.js';
10
- export { T as TextInput } from '../TextInput-fab35842.js';
11
- export { S as Switch } from '../Switch-ecf3122b.js';
12
- export { M as MultiLevelCheckbox, a as MultiLevelCheckboxSelect } from '../MultiLevelCheckboxSelect-d8044c88.js';
13
- import '../_rollupPluginBabelHelpers-c245b26a.js';
14
- import 'react';
15
- import '../defaultTheme-1bcc2541.js';
16
- import 'styled-components';
17
- import 'polished';
18
- import '../Popover-20050b91.js';
19
- import 'lodash';
20
- import '@tippyjs/react';
21
- import '../shift-away-subtle-0dd94a03.js';
22
- import 'popper-max-size-modifier';
23
- import '../ContextMenu-0f7134e4.js';
24
- import '../expand-more-c5523c46.js';
25
- import 'nanoid';
26
- import '../Alert-e6847a22.js';
27
- import '../Badge-d93586a9.js';
28
- import '../Tab-04d435c3.js';
29
- import '../Tabs-74d1ea8a.js';
30
- import '../Tooltip-c1d1199e.js';
31
- import '../VerificationStatusIcon-49cb1c1b.js';
32
- import 'react-select';
33
- import 'react-select-async-paginate';
34
- import 'react-select/creatable';
35
- import '../close-a5d37608.js';
36
- import '../edit-note-283a0e15.js';
37
- import '@restart/hooks/useMergedRefs';
38
- import '../InputGroup-1294d190.js';
39
- import '../SectionSeparator-f47760a2.js';
40
- import '@restart/hooks/useUpdateEffect';
1
+ export { default as ActionButton } from './ActionButton/ActionButton.js';
2
+ export { default as Button } from './Button/Button.js';
3
+ export { default as Checkbox } from './Checkbox/Checkbox.js';
4
+ export { default as CompactAutocompleteSelect } from './CompactAutocompleteSelect/CompactAutocompleteSelect.js';
5
+ export { default as CompactStarRating } from './CompactStarRating/CompactStarRating.js';
6
+ export { default as CompactTextInput } from './CompactTextInput/CompactTextInput.js';
7
+ export { default as MultiSelect } from './MultiSelect/MultiSelect.js';
8
+ export { default as Radio } from './Radio/Radio.js';
9
+ export { default as TextArea } from './TextArea/TextArea.js';
10
+ export { default as TextInput } from './TextInput/TextInput.js';
11
+ export { default as Switch } from './Switch/Switch.js';
12
+ export { default as MultiLevelCheckbox } from './MultiLevelCheckbox/MultiLevelCheckbox.js';
13
+ import './MultiLevelCheckbox/types.js';
14
+ export { default as MultiLevelCheckboxSelect } from './MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -1,11 +1,7 @@
1
- import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
1
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React__default from 'react';
3
- import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
4
- import styled from 'styled-components';
5
-
6
- const InputGroup$1 = styled.div.attrs(applyDefaultTheme)`
7
- margin: 8px 0;
8
- `;
3
+ import PropTypes from 'prop-types';
4
+ import { InputGroup as InputGroup$1 } from './InputGroup.styled.js';
9
5
 
10
6
  const InputGroup = React__default.forwardRef(function InputGroup({
11
7
  children,
@@ -20,4 +16,5 @@ InputGroup.propTypes = process.env.NODE_ENV !== "production" ? {
20
16
  } : {};
21
17
  InputGroup.defaultProps = {};
22
18
 
23
- export { InputGroup as I };
19
+ export { InputGroup as default };
20
+ //# sourceMappingURL=InputGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputGroup.js","sources":["../../../src/components/layout/InputGroup/InputGroup.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './InputGroup.styled';\n\n/**\n * Wrapper component to visually group related inputs by adding space above/below the group.\n *\n * ### Import\n *\n * ``` js\n * import { InputGroup } from '@ntbjs/react-components/layout'\n * // or\n * import InputGroup from '@ntbjs/react-components/layout/InputGroup'\n * ```\n *\n * ### Usage example\n * Pass an array of input elements to the `InputGroup` as its children:\n *\n * ``` js\nconst item1 = <CompactTextInput label=\"Size\" type=\"text\" value=\"4369 x 2913 px\" />;\nconst item2 = <CompactTextInput label=\"Resolution\" type=\"text\" value=\"300 dpi 37.0 x 24.7 cm px\" />;\nconst item3 = <CompactTextInput label=\"File size\" type=\"text\" value=\"7.22 MB\" />;\n\nconst inputGroup = <InputGroup>{[item1, item2, item3, item4]}</InputGroup>;\n * ```\n */\nconst InputGroup = React.forwardRef(function InputGroup({ children, ...props }, forwardedRef) {\n return (\n <S.InputGroup ref={forwardedRef} {...props}>\n {children}\n </S.InputGroup>\n );\n});\n\nInputGroup.propTypes = {\n /**\n * An array of inputs – e.g. `<CompactTextInput>`\n */\n children: PropTypes.node\n};\n\nInputGroup.defaultProps = {};\n\nexport default InputGroup;\n"],"names":["InputGroup","React","forwardRef","children","props","forwardedRef","createElement","S","_extends","ref","propTypes","process","env","NODE_ENV","PropTypes","node","defaultProps"],"mappings":";;;;;AA0BMA,MAAAA,UAAU,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,UAAUA,CAAC;EAAEG,QAAQ;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAAEC,YAAY,EAAE;EAC5F,OACEJ,cAAA,CAAAK,aAAA,CAACC,YAAY,EAAAC,QAAA,CAAA;AAACC,IAAAA,GAAG,EAAEJ,YAAAA;GAAkBD,EAAAA,KAAK,CACvCD,EAAAA,QACW,CAAC,CAAA;AAEnB,CAAC,EAAC;AAEFH,UAAU,CAACU,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;EAIrBV,QAAQ,EAAEW,SAAS,CAACC,IAAAA;AACtB,CAAC,GAAA,EAAA,CAAA;AAEDf,UAAU,CAACgB,YAAY,GAAG,EAAE;;;;"}
@@ -0,0 +1,9 @@
1
+ import styled from 'styled-components';
2
+ import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
+
4
+ const InputGroup = styled.div.attrs(applyDefaultTheme)`
5
+ margin: 8px 0;
6
+ `;
7
+
8
+ export { InputGroup };
9
+ //# sourceMappingURL=InputGroup.styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputGroup.styled.js","sources":["../../../src/components/layout/InputGroup/InputGroup.styled.js"],"sourcesContent":["import styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nexport const InputGroup = styled.div.attrs(applyDefaultTheme)`\n margin: 8px 0;\n`;\n"],"names":["InputGroup","styled","div","attrs","applyDefaultTheme"],"mappings":";;;AAGO,MAAMA,UAAU,GAAGC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC7D;AACA;;;;"}
@@ -0,0 +1,23 @@
1
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React__default from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { SectionSeparator as SectionSeparator$1 } from './SectionSeparator.styled.js';
5
+
6
+ const SectionSeparator = React__default.forwardRef(function SectionSeparator({
7
+ vertical = false,
8
+ margin = 0,
9
+ ...props
10
+ }, forwardedRef) {
11
+ return React__default.createElement(SectionSeparator$1, _extends({
12
+ vertical: vertical,
13
+ margin: margin,
14
+ ref: forwardedRef
15
+ }, props));
16
+ });
17
+ SectionSeparator.propTypes = process.env.NODE_ENV !== "production" ? {
18
+ vertical: PropTypes.bool,
19
+ margin: PropTypes.number
20
+ } : {};
21
+
22
+ export { SectionSeparator as default };
23
+ //# sourceMappingURL=SectionSeparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionSeparator.js","sources":["../../../src/components/layout/SectionSeparator/SectionSeparator.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './SectionSeparator.styled';\n\n/**\n * Section separators are used to separate sections in the UI.\n * It will fill 100% of the width or height of its parent container by default.\n *\n *\n * ### Import\n *\n * ``` js\n * import { SectionSeparator } from '@ntbjs/react-components/layout'\n * // or\n * import SectionSeparator from '@ntbjs/react-components/layout/SectionSeparator'\n * ```\n *\n */\nconst SectionSeparator = React.forwardRef(function SectionSeparator(\n { vertical = false, margin = 0, ...props },\n forwardedRef\n) {\n return <S.SectionSeparator vertical={vertical} margin={margin} ref={forwardedRef} {...props} />;\n});\n\nSectionSeparator.propTypes = {\n /**\n * Whether the section separator should be displayed vertically.\n */\n vertical: PropTypes.bool,\n /**\n * Padding in pixels to apply to the separator.\n */\n margin: PropTypes.number\n};\n\nexport default SectionSeparator;\n"],"names":["SectionSeparator","React","forwardRef","vertical","margin","props","forwardedRef","createElement","S","_extends","ref","propTypes","process","env","NODE_ENV","PropTypes","bool","number"],"mappings":";;;;;AAkBMA,MAAAA,gBAAgB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,gBAAgBA,CACjE;AAAEG,EAAAA,QAAQ,GAAG,KAAK;AAAEC,EAAAA,MAAM,GAAG,CAAC;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAC1CC,YAAY,EACZ;EACA,OAAOL,cAAA,CAAAM,aAAA,CAACC,kBAAkB,EAAAC,QAAA,CAAA;AAACN,IAAAA,QAAQ,EAAEA,QAAS;AAACC,IAAAA,MAAM,EAAEA,MAAO;AAACM,IAAAA,GAAG,EAAEJ,YAAAA;GAAkBD,EAAAA,KAAK,CAAG,CAAC,CAAA;AACjG,CAAC,EAAC;AAEFL,gBAAgB,CAACW,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;EAI3BX,QAAQ,EAAEY,SAAS,CAACC,IAAI;EAIxBZ,MAAM,EAAEW,SAAS,CAACE,MAAAA;AACpB,CAAC,GAAA,EAAA;;;;"}
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components';
2
+ import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
+
4
+ const SectionSeparator = styled.div.attrs(applyDefaultTheme)`
5
+ height: ${props => props.vertical ? '100%' : '1px'};
6
+ width: ${props => props.vertical ? '1px' : '100%'};
7
+
8
+ ${props => props.vertical ? `margin-left: ${props.margin}px; margin-right: ${props.margin}px;` : `margin-top: ${props.margin}px; margin-bottom: ${props.margin}px;`}
9
+
10
+ ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
11
+ `;
12
+
13
+ export { SectionSeparator };
14
+ //# sourceMappingURL=SectionSeparator.styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionSeparator.styled.js","sources":["../../../src/components/layout/SectionSeparator/SectionSeparator.styled.js"],"sourcesContent":["import styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nexport const SectionSeparator = styled.div.attrs(applyDefaultTheme)`\n height: ${props => (props.vertical ? '100%' : '1px')};\n width: ${props => (props.vertical ? '1px' : '100%')};\n\n ${props =>\n props.vertical\n ? `margin-left: ${props.margin}px; margin-right: ${props.margin}px;`\n : `margin-top: ${props.margin}px; margin-bottom: ${props.margin}px;`}\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n`;\n"],"names":["SectionSeparator","styled","div","attrs","applyDefaultTheme","props","vertical","margin","theme","themeProp","getColor"],"mappings":";;;AAGO,MAAMA,gBAAgB,GAAGC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AACnE,UAAYC,EAAAA,KAAK,IAAKA,KAAK,CAACC,QAAQ,GAAG,MAAM,GAAG,KAAM,CAAA;AACtD,SAAWD,EAAAA,KAAK,IAAKA,KAAK,CAACC,QAAQ,GAAG,KAAK,GAAG,MAAO,CAAA;AACrD;AACA,EAAID,EAAAA,KAAK,IACLA,KAAK,CAACC,QAAQ,GACV,CAAgBD,aAAAA,EAAAA,KAAK,CAACE,MAAM,CAAqBF,kBAAAA,EAAAA,KAAK,CAACE,MAAM,CAAA,GAAA,CAAK,GAClE,CAAA,YAAA,EAAeF,KAAK,CAACE,MAAM,CAAsBF,mBAAAA,EAAAA,KAAK,CAACE,MAAM,CAAK,GAAA,CAAA,CAAA;AAC1E;AACA,EAAIF,EAAAA,KAAK,IACLA,KAAK,CAACG,KAAK,CAACC,SAAS,CACnB,kBAAkB,EAClBJ,KAAK,CAACG,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACG,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL;;;;"}
@@ -1,5 +1,2 @@
1
- export { S as default } from '../../SectionSeparator-f47760a2.js';
2
- import '../../_rollupPluginBabelHelpers-c245b26a.js';
3
- import 'react';
4
- import '../../defaultTheme-1bcc2541.js';
5
- import 'styled-components';
1
+ export { default } from './SectionSeparator.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +1,3 @@
1
- export { I as InputGroup } from '../InputGroup-1294d190.js';
2
- export { S as SectionSeparator } from '../SectionSeparator-f47760a2.js';
3
- import '../_rollupPluginBabelHelpers-c245b26a.js';
4
- import 'react';
5
- import '../defaultTheme-1bcc2541.js';
6
- import 'styled-components';
1
+ export { default as InputGroup } from './InputGroup/InputGroup.js';
2
+ export { default as SectionSeparator } from './SectionSeparator/SectionSeparator.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +1,2 @@
1
1
  export { ServerStyleSheet } from 'styled-components';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ var importedColors = {"orange-600":"#634e01","orange-500":"#ff9900","orange-400":"#ffcb7e","emerald-600":"#296c58","emerald-500":"#30826a","emerald-400":"#64b49d","emerald-300":"#bfe0d5","emerald-200":"#f3f9f7","gray-900":"#141313","gray-800":"#272727","gray-700":"#323232","gray-600":"#505050","gray-500":"#767676","gray-400":"#b0b6b9","gray-300":"#d9dce0","gray-200":"#eff1f4","gray-100":"#f7f8f9","gray-50":"#f4f4f5","cercise-500":"#5f1031","cercise-400":"#854962","cercise-300":"#d099b0","cercise-200":"#fecaca","cercise-100":"#f9f3f5","red-600":"#7f1b1b","red-500":"#d83000","red-200":"#fbeae6","brown-500":"#634e01","signal-yellow-500":"#f4e21e","signal-yellow-400":"#fff36c","signal-green-500":"#00bd98","signal-green-400":"#a3ffe0","black":"#202435","white":"#ffffff"};
2
+
3
+ export { importedColors as default };
4
+ //# sourceMappingURL=colors.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,17 @@
1
+ const convertMsToHMS = ms => {
2
+ const seconds = Math.floor(ms / 1000);
3
+ const minutes = Math.floor(seconds / 60);
4
+ const hours = Math.floor(minutes / 60);
5
+ const secondsLeft = seconds % 60;
6
+ const minutesLeft = minutes % 60;
7
+ let hmsString = '';
8
+ if (hours) {
9
+ hmsString += hours < 10 ? `0${hours}:` : `${hours}:`;
10
+ }
11
+ hmsString += `${minutesLeft < 10 ? `0${minutesLeft}` : `${minutesLeft}`}:`;
12
+ hmsString += secondsLeft < 10 ? `0${secondsLeft}` : `${secondsLeft}`;
13
+ return hmsString;
14
+ };
15
+
16
+ export { convertMsToHMS };
17
+ //# sourceMappingURL=dateTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTime.js","sources":["../../src/utils/dateTime.js"],"sourcesContent":["/**\n * Convert time given in miliseconds to a string representation of hours, minutes and seconds\n * in the format HH:MM:SS\n *\n * @param {integer} ms\n */\nexport const convertMsToHMS = ms => {\n const seconds = Math.floor(ms / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n\n const secondsLeft = seconds % 60;\n const minutesLeft = minutes % 60;\n\n let hmsString = '';\n if (hours) {\n hmsString += hours < 10 ? `0${hours}:` : `${hours}:`;\n }\n\n hmsString += `${minutesLeft < 10 ? `0${minutesLeft}` : `${minutesLeft}`}:`;\n hmsString += secondsLeft < 10 ? `0${secondsLeft}` : `${secondsLeft}`;\n\n return hmsString;\n};\n"],"names":["convertMsToHMS","ms","seconds","Math","floor","minutes","hours","secondsLeft","minutesLeft","hmsString"],"mappings":"AAMaA,MAAAA,cAAc,GAAGC,EAAE,IAAI;EAClC,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,EAAE,GAAG,IAAI,CAAC,CAAA;EACrC,MAAMI,OAAO,GAAGF,IAAI,CAACC,KAAK,CAACF,OAAO,GAAG,EAAE,CAAC,CAAA;EACxC,MAAMI,KAAK,GAAGH,IAAI,CAACC,KAAK,CAACC,OAAO,GAAG,EAAE,CAAC,CAAA;AAEtC,EAAA,MAAME,WAAW,GAAGL,OAAO,GAAG,EAAE,CAAA;AAChC,EAAA,MAAMM,WAAW,GAAGH,OAAO,GAAG,EAAE,CAAA;EAEhC,IAAII,SAAS,GAAG,EAAE,CAAA;AAClB,EAAA,IAAIH,KAAK,EAAE;IACTG,SAAS,IAAIH,KAAK,GAAG,EAAE,GAAG,CAAIA,CAAAA,EAAAA,KAAK,CAAG,CAAA,CAAA,GAAG,CAAGA,EAAAA,KAAK,CAAG,CAAA,CAAA,CAAA;AACtD,GAAA;AAEAG,EAAAA,SAAS,IAAI,CAAA,EAAGD,WAAW,GAAG,EAAE,GAAG,CAAIA,CAAAA,EAAAA,WAAW,CAAE,CAAA,GAAG,CAAGA,EAAAA,WAAW,EAAE,CAAG,CAAA,CAAA,CAAA;EAC1EC,SAAS,IAAIF,WAAW,GAAG,EAAE,GAAG,CAAIA,CAAAA,EAAAA,WAAW,CAAE,CAAA,GAAG,CAAGA,EAAAA,WAAW,CAAE,CAAA,CAAA;AAEpE,EAAA,OAAOE,SAAS,CAAA;AAClB;;;;"}