@ovotech/element-native 3.8.1 → 4.0.0-canary-a872093-246

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 (629) hide show
  1. package/components/package.json +6 -0
  2. package/dist/components/Accordion/Accordion.d.ts +2 -3
  3. package/dist/components/Accordion/Accordion.js +130 -97
  4. package/dist/components/Accordion/Group.js +21 -21
  5. package/dist/components/Accordion/Icon.js +60 -59
  6. package/dist/components/Accordion/index.d.ts +1 -1
  7. package/dist/components/Accordion/index.js +9 -19
  8. package/dist/components/Accordion/styles.d.ts +20 -2
  9. package/dist/components/Accordion/styles.js +59 -50
  10. package/dist/components/Accordion/types.d.ts +2 -2
  11. package/dist/components/Accordion/types.js +2 -1
  12. package/dist/components/ActionCard/ActionCard.d.ts +1 -1
  13. package/dist/components/ActionCard/ActionCard.js +104 -376
  14. package/dist/components/ActionCard/CloseIconShape.js +40 -14
  15. package/dist/components/ActionCard/IndicatorIconShape.js +40 -11
  16. package/dist/components/ActionCard/index.js +5 -185
  17. package/dist/components/ActionList/ActionList.d.ts +3 -4
  18. package/dist/components/ActionList/ActionList.js +56 -202
  19. package/dist/components/ActionList/index.js +6 -100
  20. package/dist/components/ActionList/styled.d.ts +523 -5
  21. package/dist/components/ActionList/styled.js +65 -152
  22. package/dist/components/Badge/Badge.d.ts +9 -3
  23. package/dist/components/Badge/Badge.js +96 -39
  24. package/dist/components/Badge/index.js +5 -8
  25. package/dist/components/CTAButton/CTAButton.d.ts +9 -8
  26. package/dist/components/CTAButton/CTAButton.js +118 -181
  27. package/dist/components/CTAButton/index.js +8 -100
  28. package/dist/components/CTALink/CTALink.d.ts +5 -5
  29. package/dist/components/CTALink/CTALink.js +22 -105
  30. package/dist/components/CTALink/index.js +7 -100
  31. package/dist/components/Card/Card.d.ts +7 -483
  32. package/dist/components/Card/Card.js +43 -17
  33. package/dist/components/Card/index.js +5 -7
  34. package/dist/components/Checkbox/Checkbox.js +78 -173
  35. package/dist/components/Checkbox/CheckboxField.d.ts +1 -1
  36. package/dist/components/Checkbox/CheckboxField.js +43 -39
  37. package/dist/components/Checkbox/index.js +7 -105
  38. package/dist/components/CurrencyField/CurrencyField.d.ts +1 -1
  39. package/dist/components/CurrencyField/CurrencyField.js +32 -109
  40. package/dist/components/CurrencyField/index.js +5 -108
  41. package/dist/components/CurrencyInput/CurrencyInput.d.ts +2 -2
  42. package/dist/components/CurrencyInput/CurrencyInput.js +36 -118
  43. package/dist/components/CurrencyInput/index.d.ts +1 -1
  44. package/dist/components/CurrencyInput/index.js +5 -100
  45. package/dist/components/DataTable/DataTable.js +45 -62
  46. package/dist/components/DataTable/TableRow.js +35 -44
  47. package/dist/components/DataTable/index.js +20 -25
  48. package/dist/components/DataTable/styles.d.ts +78 -0
  49. package/dist/components/DataTable/styles.js +86 -119
  50. package/dist/components/DataTable/types.d.ts +4 -4
  51. package/dist/components/DataTable/types.js +2 -1
  52. package/dist/components/DateField/DateField.d.ts +3 -4
  53. package/dist/components/DateField/DateField.js +87 -229
  54. package/dist/components/DateField/index.js +5 -107
  55. package/dist/components/DescriptionList/DescriptionList.d.ts +2 -2
  56. package/dist/components/DescriptionList/DescriptionList.js +43 -25
  57. package/dist/components/DescriptionList/index.js +6 -13
  58. package/dist/components/DescriptionList/styled.d.ts +6 -0
  59. package/dist/components/DescriptionList/styled.js +85 -42
  60. package/dist/components/Disclosure/Disclosure.js +79 -153
  61. package/dist/components/Disclosure/index.js +16 -96
  62. package/dist/components/Divider/Divider.d.ts +1 -1
  63. package/dist/components/Divider/Divider.js +43 -12
  64. package/dist/components/Divider/index.js +5 -7
  65. package/dist/components/Em/Em.d.ts +6 -0
  66. package/dist/components/Em/Em.js +12 -8
  67. package/dist/components/Em/index.js +5 -6
  68. package/dist/components/EmailField/EmailField.d.ts +1 -1
  69. package/dist/components/EmailField/EmailField.js +32 -108
  70. package/dist/components/EmailField/index.js +5 -107
  71. package/dist/components/EmailInput/EmailInput.d.ts +1 -1
  72. package/dist/components/EmailInput/EmailInput.js +18 -106
  73. package/dist/components/EmailInput/index.js +5 -98
  74. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +2 -2
  75. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +50 -115
  76. package/dist/components/ErrorSummaryNotification/index.js +5 -104
  77. package/dist/components/ErrorText/ErrorText.d.ts +6 -0
  78. package/dist/components/ErrorText/ErrorText.js +42 -22
  79. package/dist/components/ErrorText/index.js +5 -11
  80. package/dist/components/Field/Field.d.ts +2 -2
  81. package/dist/components/Field/Field.js +58 -62
  82. package/dist/components/Field/index.js +16 -16
  83. package/dist/components/FilterSelect/FilterSelect.d.ts +2 -2
  84. package/dist/components/FilterSelect/FilterSelect.js +77 -201
  85. package/dist/components/FilterSelect/index.js +5 -102
  86. package/dist/components/FormGroup/FormGroup.d.ts +1 -1
  87. package/dist/components/FormGroup/FormGroup.js +42 -9
  88. package/dist/components/FormGroup/index.js +5 -8
  89. package/dist/components/Grid/Col.d.ts +7 -1
  90. package/dist/components/Grid/Col.js +58 -32
  91. package/dist/components/Grid/Row.d.ts +6 -0
  92. package/dist/components/Grid/Row.js +72 -34
  93. package/dist/components/Grid/index.js +7 -13
  94. package/dist/components/Heading1/Heading1.js +70 -36
  95. package/dist/components/Heading1/index.js +5 -10
  96. package/dist/components/Heading2/Heading2.js +70 -36
  97. package/dist/components/Heading2/index.js +5 -10
  98. package/dist/components/Heading3/Heading3.js +70 -36
  99. package/dist/components/Heading3/index.js +5 -10
  100. package/dist/components/Heading4/Heading4.js +70 -36
  101. package/dist/components/Heading4/index.js +5 -10
  102. package/dist/components/HintText/HintText.d.ts +6 -0
  103. package/dist/components/HintText/HintText.js +42 -22
  104. package/dist/components/HintText/index.js +5 -11
  105. package/dist/components/Icon/Icon.d.ts +2 -2
  106. package/dist/components/Icon/Icon.js +38 -103
  107. package/dist/components/Icon/index.js +5 -93
  108. package/dist/components/Input/Input.d.ts +1 -1
  109. package/dist/components/Input/Input.js +97 -198
  110. package/dist/components/Label/Label.js +50 -18
  111. package/dist/components/Label/index.js +5 -8
  112. package/dist/components/LabelText/LabelText.d.ts +6 -0
  113. package/dist/components/LabelText/LabelText.js +42 -20
  114. package/dist/components/LabelText/index.js +5 -11
  115. package/dist/components/Lead/Lead.js +52 -18
  116. package/dist/components/Lead/index.js +5 -8
  117. package/dist/components/LineThrough/LineThrough.d.ts +6 -0
  118. package/dist/components/LineThrough/LineThrough.js +12 -7
  119. package/dist/components/LineThrough/index.js +5 -6
  120. package/dist/components/List/List.d.ts +1 -1
  121. package/dist/components/List/List.js +32 -38
  122. package/dist/components/List/index.js +7 -16
  123. package/dist/components/List/styled.d.ts +25 -0
  124. package/dist/components/List/styled.js +52 -37
  125. package/dist/components/Margin/Margin.d.ts +8 -2
  126. package/dist/components/Margin/Margin.js +50 -68
  127. package/dist/components/Margin/index.js +5 -11
  128. package/dist/components/NavHeader/IconButton.d.ts +2 -2
  129. package/dist/components/NavHeader/IconButton.js +18 -119
  130. package/dist/components/NavHeader/NavHeader.d.ts +11 -3
  131. package/dist/components/NavHeader/NavHeader.js +65 -181
  132. package/dist/components/NavHeader/NavHeader.styles.d.ts +543 -7
  133. package/dist/components/NavHeader/NavHeader.styles.js +72 -81
  134. package/dist/components/NavHeader/index.d.ts +1 -1
  135. package/dist/components/NavHeader/index.js +5 -104
  136. package/dist/components/Notification/Notification.d.ts +14 -2
  137. package/dist/components/Notification/Notification.js +103 -190
  138. package/dist/components/Notification/index.js +9 -100
  139. package/dist/components/NumberField/NumberField.d.ts +1 -1
  140. package/dist/components/NumberField/NumberField.js +32 -108
  141. package/dist/components/NumberField/index.js +5 -107
  142. package/dist/components/NumberInput/NumberInput.d.ts +1 -1
  143. package/dist/components/NumberInput/NumberInput.js +18 -106
  144. package/dist/components/NumberInput/index.js +5 -98
  145. package/dist/components/P/P.js +54 -23
  146. package/dist/components/P/index.js +5 -10
  147. package/dist/components/PasswordField/PasswordField.d.ts +1 -1
  148. package/dist/components/PasswordField/PasswordField.js +32 -110
  149. package/dist/components/PasswordField/index.js +5 -109
  150. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
  151. package/dist/components/PasswordInput/PasswordInput.js +33 -123
  152. package/dist/components/PasswordInput/PasswordInput.styled.d.ts +7 -1
  153. package/dist/components/PasswordInput/PasswordInput.styled.js +37 -18
  154. package/dist/components/PasswordInput/PasswordVisibilityToggle.d.ts +1 -1
  155. package/dist/components/PasswordInput/PasswordVisibilityToggle.js +26 -128
  156. package/dist/components/PasswordInput/index.js +5 -100
  157. package/dist/components/PhoneField/PhoneField.d.ts +1 -1
  158. package/dist/components/PhoneField/PhoneField.js +32 -108
  159. package/dist/components/PhoneField/index.js +5 -107
  160. package/dist/components/PhoneInput/PhoneInput.d.ts +1 -1
  161. package/dist/components/PhoneInput/PhoneInput.js +17 -106
  162. package/dist/components/PhoneInput/index.js +5 -98
  163. package/dist/components/ProductCarousel/NavigationDots.js +74 -57
  164. package/dist/components/ProductCarousel/ProductCarousel.js +126 -2174
  165. package/dist/components/ProductCarousel/anchor-point.js +51 -31
  166. package/dist/components/ProductCarousel/index.js +5 -101
  167. package/dist/components/Radio/Radio.js +67 -69
  168. package/dist/components/Radio/RadioField.d.ts +1 -1
  169. package/dist/components/Radio/RadioField.js +47 -46
  170. package/dist/components/Radio/index.js +7 -18
  171. package/dist/components/RadioCard/RadioCard.js +71 -68
  172. package/dist/components/RadioCard/index.js +5 -13
  173. package/dist/components/SelectField/Select.d.ts +8 -2
  174. package/dist/components/SelectField/Select.js +93 -852
  175. package/dist/components/SelectField/SelectField.d.ts +1 -1
  176. package/dist/components/SelectField/SelectField.js +32 -125
  177. package/dist/components/SelectField/index.js +5 -108
  178. package/dist/components/SkeletonAnimation/SkeletonAnimation.js +34 -47
  179. package/dist/components/SkeletonAnimation/index.js +5 -7
  180. package/dist/components/SkeletonCTA/SkeletonCTA.d.ts +1 -1
  181. package/dist/components/SkeletonCTA/SkeletonCTA.js +41 -17
  182. package/dist/components/SkeletonCTA/index.js +5 -12
  183. package/dist/components/SkeletonCircle/SkeletonCircle.d.ts +1 -1
  184. package/dist/components/SkeletonCircle/SkeletonCircle.js +44 -16
  185. package/dist/components/SkeletonCircle/index.js +5 -10
  186. package/dist/components/SkeletonHeading/SkeletonHeading.d.ts +1 -1
  187. package/dist/components/SkeletonHeading/SkeletonHeading.js +40 -29
  188. package/dist/components/SkeletonHeading/index.js +5 -12
  189. package/dist/components/SkeletonText/SkeletonText.d.ts +1 -1
  190. package/dist/components/SkeletonText/SkeletonText.js +50 -33
  191. package/dist/components/SkeletonText/index.js +5 -12
  192. package/dist/components/Small/Small.d.ts +6 -0
  193. package/dist/components/Small/Small.js +38 -17
  194. package/dist/components/Small/index.js +5 -11
  195. package/dist/components/Spinner/Spinner.d.ts +2 -2
  196. package/dist/components/Spinner/Spinner.js +68 -61
  197. package/dist/components/Spinner/index.js +5 -9
  198. package/dist/components/Stack/Stack.d.ts +1 -1
  199. package/dist/components/Stack/Stack.js +48 -30
  200. package/dist/components/Stack/index.js +5 -11
  201. package/dist/components/Stretch/Stretch.d.ts +1 -1
  202. package/dist/components/Stretch/Stretch.js +55 -11
  203. package/dist/components/Stretch/index.js +16 -8
  204. package/dist/components/Strong/Strong.d.ts +6 -0
  205. package/dist/components/Strong/Strong.js +10 -9
  206. package/dist/components/Strong/index.js +5 -6
  207. package/dist/components/SubLabelText/SubLabelText.d.ts +6 -0
  208. package/dist/components/SubLabelText/SubLabelText.js +42 -20
  209. package/dist/components/SubLabelText/index.js +5 -11
  210. package/dist/components/Tabs/Tab.d.ts +1 -2
  211. package/dist/components/Tabs/Tab.js +76 -60
  212. package/dist/components/Tabs/TabList.d.ts +2 -2
  213. package/dist/components/Tabs/TabList.js +77 -37
  214. package/dist/components/Tabs/TabPanel.js +64 -15
  215. package/dist/components/Tabs/Tabs.d.ts +2 -3
  216. package/dist/components/Tabs/Tabs.js +97 -46
  217. package/dist/components/Tabs/index.js +11 -19
  218. package/dist/components/TextField/TextField.d.ts +1 -1
  219. package/dist/components/TextField/TextField.js +32 -108
  220. package/dist/components/TextField/index.js +5 -107
  221. package/dist/components/TextGroup/TextGroup.js +40 -23
  222. package/dist/components/TextGroup/index.js +5 -7
  223. package/dist/components/TextInput/TextInput.d.ts +1 -1
  224. package/dist/components/TextInput/TextInput.js +18 -97
  225. package/dist/components/TextInput/index.js +5 -98
  226. package/dist/components/TextLink/TextLink.js +74 -118
  227. package/dist/components/TextLink/index.js +5 -97
  228. package/dist/components/TextareaField/TextareaField.d.ts +1 -1
  229. package/dist/components/TextareaField/TextareaField.js +32 -108
  230. package/dist/components/TextareaField/index.js +5 -107
  231. package/dist/components/TextareaInput/TextareaInput.d.ts +2 -2
  232. package/dist/components/TextareaInput/TextareaInput.js +65 -114
  233. package/dist/components/TextareaInput/index.d.ts +1 -1
  234. package/dist/components/TextareaInput/index.js +5 -98
  235. package/dist/components/Toast/Toast.d.ts +1 -1
  236. package/dist/components/Toast/Toast.js +159 -730
  237. package/dist/components/Toast/index.js +6 -105
  238. package/dist/components/Toggle/Toggle.d.ts +1 -1
  239. package/dist/components/Toggle/Toggle.js +55 -73
  240. package/dist/components/Toggle/index.js +5 -14
  241. package/dist/components/Toggle/styles.d.ts +25 -1
  242. package/dist/components/Toggle/styles.js +28 -38
  243. package/dist/components/index.d.ts +0 -3
  244. package/dist/components/index.js +77 -296
  245. package/dist/esm/components/Accordion/Accordion.js +106 -0
  246. package/dist/esm/components/Accordion/Group.js +18 -0
  247. package/dist/esm/components/Accordion/Icon.js +35 -0
  248. package/dist/esm/components/Accordion/index.js +3 -0
  249. package/dist/esm/components/Accordion/styles.js +31 -0
  250. package/dist/esm/components/ActionCard/ActionCard.js +77 -0
  251. package/dist/esm/components/ActionCard/CloseIconShape.js +11 -0
  252. package/dist/esm/components/ActionCard/IndicatorIconShape.js +11 -0
  253. package/dist/esm/components/ActionCard/index.js +1 -0
  254. package/dist/esm/components/ActionList/ActionList.js +54 -0
  255. package/dist/esm/components/ActionList/index.js +1 -0
  256. package/dist/esm/components/ActionList/styled.js +40 -0
  257. package/dist/esm/components/Badge/Badge.js +70 -0
  258. package/dist/esm/components/Badge/index.js +1 -0
  259. package/dist/esm/components/CTAButton/CTAButton.js +90 -0
  260. package/dist/esm/components/CTAButton/index.js +1 -0
  261. package/dist/esm/components/CTALink/CTALink.js +18 -0
  262. package/dist/esm/components/CTALink/index.js +1 -0
  263. package/dist/esm/components/Card/Card.js +37 -0
  264. package/dist/esm/components/Card/index.js +1 -0
  265. package/dist/esm/components/Checkbox/Checkbox.js +74 -0
  266. package/dist/esm/components/Checkbox/CheckboxField.js +42 -0
  267. package/dist/esm/components/Checkbox/index.js +2 -0
  268. package/dist/esm/components/CurrencyField/CurrencyField.js +30 -0
  269. package/dist/esm/components/CurrencyField/index.js +1 -0
  270. package/dist/esm/components/CurrencyInput/CurrencyInput.js +34 -0
  271. package/dist/esm/components/CurrencyInput/index.js +1 -0
  272. package/dist/esm/components/DataTable/DataTable.js +43 -0
  273. package/dist/esm/components/DataTable/TableRow.js +33 -0
  274. package/dist/esm/components/DataTable/index.js +3 -0
  275. package/dist/esm/components/DataTable/styles.js +61 -0
  276. package/dist/esm/components/DataTable/types.js +1 -0
  277. package/dist/esm/components/DateField/DateField.js +63 -0
  278. package/dist/esm/components/DateField/index.js +1 -0
  279. package/dist/esm/components/DescriptionList/DescriptionList.js +40 -0
  280. package/dist/esm/components/DescriptionList/index.js +1 -0
  281. package/dist/esm/components/DescriptionList/styled.js +58 -0
  282. package/dist/esm/components/Disclosure/Disclosure.js +55 -0
  283. package/dist/esm/components/Disclosure/index.js +1 -0
  284. package/dist/esm/components/Divider/Divider.js +17 -0
  285. package/dist/esm/components/Divider/index.js +1 -0
  286. package/dist/esm/components/Em/Em.js +7 -0
  287. package/dist/esm/components/Em/index.js +1 -0
  288. package/dist/esm/components/EmailField/EmailField.js +30 -0
  289. package/dist/esm/components/EmailField/index.js +1 -0
  290. package/dist/esm/components/EmailInput/EmailInput.js +16 -0
  291. package/dist/esm/components/EmailInput/index.js +1 -0
  292. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +49 -0
  293. package/dist/esm/components/ErrorSummaryNotification/index.js +1 -0
  294. package/dist/esm/components/ErrorText/ErrorText.js +17 -0
  295. package/dist/esm/components/ErrorText/index.js +1 -0
  296. package/dist/esm/components/Field/Field.js +58 -0
  297. package/dist/esm/components/Field/index.js +1 -0
  298. package/dist/esm/components/FilterSelect/FilterSelect.js +52 -0
  299. package/dist/esm/components/FilterSelect/index.js +1 -0
  300. package/dist/esm/components/FormGroup/FormGroup.js +37 -0
  301. package/dist/esm/components/FormGroup/index.js +1 -0
  302. package/dist/esm/components/Grid/Col.js +33 -0
  303. package/dist/esm/components/Grid/Row.js +47 -0
  304. package/dist/esm/components/Grid/index.js +2 -0
  305. package/dist/esm/components/Heading1/Heading1.js +46 -0
  306. package/dist/esm/components/Heading1/index.js +1 -0
  307. package/dist/esm/components/Heading2/Heading2.js +46 -0
  308. package/dist/esm/components/Heading2/index.js +1 -0
  309. package/dist/esm/components/Heading3/Heading3.js +46 -0
  310. package/dist/esm/components/Heading3/index.js +1 -0
  311. package/dist/esm/components/Heading4/Heading4.js +46 -0
  312. package/dist/esm/components/Heading4/index.js +1 -0
  313. package/dist/esm/components/HintText/HintText.js +17 -0
  314. package/dist/esm/components/HintText/index.js +1 -0
  315. package/dist/esm/components/Icon/Icon.js +36 -0
  316. package/dist/esm/components/Icon/index.js +1 -0
  317. package/dist/esm/components/Input/Input.js +74 -0
  318. package/dist/esm/components/Label/Label.js +25 -0
  319. package/dist/esm/components/Label/index.js +1 -0
  320. package/dist/esm/components/LabelText/LabelText.js +17 -0
  321. package/dist/esm/components/LabelText/index.js +1 -0
  322. package/dist/esm/components/Lead/Lead.js +27 -0
  323. package/dist/esm/components/Lead/index.js +1 -0
  324. package/dist/esm/components/LineThrough/LineThrough.js +7 -0
  325. package/dist/esm/components/LineThrough/index.js +1 -0
  326. package/dist/esm/components/List/List.js +29 -0
  327. package/dist/esm/components/List/index.js +1 -0
  328. package/dist/esm/components/List/styled.js +27 -0
  329. package/dist/esm/components/Margin/Margin.js +46 -0
  330. package/dist/esm/components/Margin/index.js +1 -0
  331. package/dist/esm/components/NavHeader/IconButton.js +16 -0
  332. package/dist/esm/components/NavHeader/NavHeader.js +42 -0
  333. package/dist/esm/components/NavHeader/NavHeader.styles.js +44 -0
  334. package/dist/esm/components/NavHeader/index.js +1 -0
  335. package/dist/esm/components/Notification/Notification.js +78 -0
  336. package/dist/esm/components/Notification/index.js +1 -0
  337. package/dist/esm/components/NumberField/NumberField.js +30 -0
  338. package/dist/esm/components/NumberField/index.js +1 -0
  339. package/dist/esm/components/NumberInput/NumberInput.js +16 -0
  340. package/dist/esm/components/NumberInput/index.js +1 -0
  341. package/dist/esm/components/P/P.js +29 -0
  342. package/dist/esm/components/P/index.js +1 -0
  343. package/dist/esm/components/PasswordField/PasswordField.js +30 -0
  344. package/dist/esm/components/PasswordField/index.js +1 -0
  345. package/dist/esm/components/PasswordInput/PasswordInput.js +32 -0
  346. package/dist/esm/components/PasswordInput/PasswordInput.styled.js +12 -0
  347. package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +23 -0
  348. package/dist/esm/components/PasswordInput/index.js +1 -0
  349. package/dist/esm/components/PhoneField/PhoneField.js +30 -0
  350. package/dist/esm/components/PhoneField/index.js +1 -0
  351. package/dist/esm/components/PhoneInput/PhoneInput.js +15 -0
  352. package/dist/esm/components/PhoneInput/index.js +1 -0
  353. package/dist/esm/components/ProductCarousel/NavigationDots.js +50 -0
  354. package/dist/esm/components/ProductCarousel/ProductCarousel.js +98 -0
  355. package/dist/esm/components/ProductCarousel/anchor-point.js +49 -0
  356. package/dist/esm/components/ProductCarousel/index.js +1 -0
  357. package/dist/esm/components/Radio/Radio.js +62 -0
  358. package/dist/esm/components/Radio/RadioField.js +46 -0
  359. package/dist/esm/components/Radio/index.js +2 -0
  360. package/dist/esm/components/RadioCard/RadioCard.js +66 -0
  361. package/dist/esm/components/RadioCard/index.js +1 -0
  362. package/dist/esm/components/SelectField/Select.js +66 -0
  363. package/dist/esm/components/SelectField/SelectField.js +29 -0
  364. package/dist/esm/components/SelectField/index.js +1 -0
  365. package/dist/esm/components/SkeletonAnimation/SkeletonAnimation.js +31 -0
  366. package/dist/esm/components/SkeletonAnimation/index.js +1 -0
  367. package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +35 -0
  368. package/dist/esm/components/SkeletonCTA/index.js +1 -0
  369. package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +38 -0
  370. package/dist/esm/components/SkeletonCircle/index.js +1 -0
  371. package/dist/esm/components/SkeletonHeading/SkeletonHeading.js +34 -0
  372. package/dist/esm/components/SkeletonHeading/index.js +1 -0
  373. package/dist/esm/components/SkeletonText/SkeletonText.js +45 -0
  374. package/dist/esm/components/SkeletonText/index.js +1 -0
  375. package/dist/esm/components/Small/Small.js +13 -0
  376. package/dist/esm/components/Small/index.js +1 -0
  377. package/dist/esm/components/Spinner/Spinner.js +44 -0
  378. package/dist/esm/components/Spinner/index.js +1 -0
  379. package/dist/esm/components/Stack/Stack.js +43 -0
  380. package/dist/esm/components/Stack/index.js +1 -0
  381. package/dist/esm/components/Stretch/Stretch.js +29 -0
  382. package/dist/esm/components/Stretch/index.js +1 -0
  383. package/dist/esm/components/Strong/Strong.js +5 -0
  384. package/dist/esm/components/Strong/index.js +1 -0
  385. package/dist/esm/components/SubLabelText/SubLabelText.js +17 -0
  386. package/dist/esm/components/SubLabelText/index.js +1 -0
  387. package/dist/esm/components/Tabs/Tab.js +53 -0
  388. package/dist/esm/components/Tabs/TabList.js +51 -0
  389. package/dist/esm/components/Tabs/TabPanel.js +38 -0
  390. package/dist/esm/components/Tabs/Tabs.js +72 -0
  391. package/dist/esm/components/Tabs/index.js +4 -0
  392. package/dist/esm/components/TextField/TextField.js +30 -0
  393. package/dist/esm/components/TextField/index.js +1 -0
  394. package/dist/esm/components/TextGroup/TextGroup.js +39 -0
  395. package/dist/esm/components/TextGroup/index.js +1 -0
  396. package/dist/esm/components/TextInput/TextInput.js +16 -0
  397. package/dist/esm/components/TextInput/index.js +1 -0
  398. package/dist/esm/components/TextLink/TextLink.js +49 -0
  399. package/dist/esm/components/TextLink/index.js +1 -0
  400. package/dist/esm/components/TextareaField/TextareaField.js +30 -0
  401. package/dist/esm/components/TextareaField/index.js +1 -0
  402. package/dist/esm/components/TextareaInput/TextareaInput.js +41 -0
  403. package/dist/esm/components/TextareaInput/index.js +1 -0
  404. package/dist/esm/components/Toast/Toast.js +141 -0
  405. package/dist/esm/components/Toast/index.js +1 -0
  406. package/dist/esm/components/Toggle/Toggle.js +53 -0
  407. package/dist/esm/components/Toggle/index.js +1 -0
  408. package/dist/esm/components/Toggle/styles.js +23 -0
  409. package/dist/esm/components/index.js +62 -0
  410. package/dist/esm/hooks/index.js +2 -0
  411. package/dist/esm/hooks/use-breakpoint.js +12 -0
  412. package/dist/esm/hooks/use-full-width.js +16 -0
  413. package/dist/esm/hooks/use-layout.js +16 -0
  414. package/dist/esm/index.js +3 -0
  415. package/dist/esm/providers/IconsProvider.js +115 -0
  416. package/dist/esm/providers/icons/Address.js +14 -0
  417. package/dist/esm/providers/icons/Advice.js +14 -0
  418. package/dist/esm/providers/icons/Archive.js +14 -0
  419. package/dist/esm/providers/icons/ArrowDown.js +14 -0
  420. package/dist/esm/providers/icons/ArrowLeft.js +14 -0
  421. package/dist/esm/providers/icons/ArrowRight.js +14 -0
  422. package/dist/esm/providers/icons/ArrowUp.js +14 -0
  423. package/dist/esm/providers/icons/Award.js +14 -0
  424. package/dist/esm/providers/icons/Battery.js +14 -0
  425. package/dist/esm/providers/icons/Cal.js +14 -0
  426. package/dist/esm/providers/icons/CalBook.js +14 -0
  427. package/dist/esm/providers/icons/CaretDown.js +14 -0
  428. package/dist/esm/providers/icons/CaretLeft.js +14 -0
  429. package/dist/esm/providers/icons/CaretRight.js +14 -0
  430. package/dist/esm/providers/icons/CaretUp.js +14 -0
  431. package/dist/esm/providers/icons/Chart.js +14 -0
  432. package/dist/esm/providers/icons/ChartFilled.js +14 -0
  433. package/dist/esm/providers/icons/Check.js +14 -0
  434. package/dist/esm/providers/icons/CheckCircle.js +14 -0
  435. package/dist/esm/providers/icons/ChevronDown.js +14 -0
  436. package/dist/esm/providers/icons/ChevronLeft.js +14 -0
  437. package/dist/esm/providers/icons/ChevronLeftSmall.js +14 -0
  438. package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +14 -0
  439. package/dist/esm/providers/icons/ChevronRight.js +14 -0
  440. package/dist/esm/providers/icons/ChevronRightSmall.js +14 -0
  441. package/dist/esm/providers/icons/ChevronRightSmallLast.js +14 -0
  442. package/dist/esm/providers/icons/ChevronUp.js +14 -0
  443. package/dist/esm/providers/icons/Circle.js +14 -0
  444. package/dist/esm/providers/icons/CloseCircle.js +14 -0
  445. package/dist/esm/providers/icons/Cross.js +14 -0
  446. package/dist/esm/providers/icons/Doc.js +14 -0
  447. package/dist/esm/providers/icons/Dollar.js +14 -0
  448. package/dist/esm/providers/icons/Download.js +14 -0
  449. package/dist/esm/providers/icons/Eco.js +14 -0
  450. package/dist/esm/providers/icons/EcoHome.js +14 -0
  451. package/dist/esm/providers/icons/Edit.js +14 -0
  452. package/dist/esm/providers/icons/ElectricCar.js +14 -0
  453. package/dist/esm/providers/icons/ElectricHome.js +14 -0
  454. package/dist/esm/providers/icons/Electricity.js +14 -0
  455. package/dist/esm/providers/icons/EnergyAdvice.js +14 -0
  456. package/dist/esm/providers/icons/Equals.js +14 -0
  457. package/dist/esm/providers/icons/Euro.js +14 -0
  458. package/dist/esm/providers/icons/Gas.js +14 -0
  459. package/dist/esm/providers/icons/GlobeAddress.js +14 -0
  460. package/dist/esm/providers/icons/Help.js +14 -0
  461. package/dist/esm/providers/icons/HelpFilled.js +14 -0
  462. package/dist/esm/providers/icons/Hide.js +14 -0
  463. package/dist/esm/providers/icons/Home.js +14 -0
  464. package/dist/esm/providers/icons/HomeFilled.js +14 -0
  465. package/dist/esm/providers/icons/HydroPower.js +14 -0
  466. package/dist/esm/providers/icons/Info.js +14 -0
  467. package/dist/esm/providers/icons/Link.js +14 -0
  468. package/dist/esm/providers/icons/Logo.js +14 -0
  469. package/dist/esm/providers/icons/Mail.js +14 -0
  470. package/dist/esm/providers/icons/MailOpen.js +14 -0
  471. package/dist/esm/providers/icons/Menu.js +14 -0
  472. package/dist/esm/providers/icons/Message.js +14 -0
  473. package/dist/esm/providers/icons/MessageFilled.js +14 -0
  474. package/dist/esm/providers/icons/Minus.js +14 -0
  475. package/dist/esm/providers/icons/Mobile.js +14 -0
  476. package/dist/esm/providers/icons/NewWindow.js +14 -0
  477. package/dist/esm/providers/icons/PaymentCard.js +14 -0
  478. package/dist/esm/providers/icons/PaymentCardFilled.js +14 -0
  479. package/dist/esm/providers/icons/Phone.js +14 -0
  480. package/dist/esm/providers/icons/Plus.js +14 -0
  481. package/dist/esm/providers/icons/Pound.js +14 -0
  482. package/dist/esm/providers/icons/Pricing.js +14 -0
  483. package/dist/esm/providers/icons/Search.js +14 -0
  484. package/dist/esm/providers/icons/Security.js +14 -0
  485. package/dist/esm/providers/icons/Show.js +14 -0
  486. package/dist/esm/providers/icons/SmartHome.js +14 -0
  487. package/dist/esm/providers/icons/SmartMeter.js +14 -0
  488. package/dist/esm/providers/icons/Solar.js +14 -0
  489. package/dist/esm/providers/icons/Star.js +14 -0
  490. package/dist/esm/providers/icons/StarFilled.js +14 -0
  491. package/dist/esm/providers/icons/Sun.js +14 -0
  492. package/dist/esm/providers/icons/Torch.js +14 -0
  493. package/dist/esm/providers/icons/Trees.js +14 -0
  494. package/dist/esm/providers/icons/Tune.js +14 -0
  495. package/dist/esm/providers/icons/User.js +14 -0
  496. package/dist/esm/providers/icons/UserFilled.js +14 -0
  497. package/dist/esm/providers/icons/Wallet.js +14 -0
  498. package/dist/esm/providers/icons/WalletFilled.js +14 -0
  499. package/dist/esm/providers/icons/WarmHome.js +14 -0
  500. package/dist/esm/providers/icons/Warning.js +14 -0
  501. package/dist/esm/providers/icons/WebAddress.js +14 -0
  502. package/dist/esm/providers/icons/WindPower.js +14 -0
  503. package/dist/esm/providers/icons/index.js +87 -0
  504. package/dist/esm/providers/index.js +2 -0
  505. package/dist/esm/providers/types.js +1 -0
  506. package/dist/esm/styled.native.js +4 -0
  507. package/dist/esm/theme/index.js +1 -0
  508. package/dist/esm/utils/index.js +1 -0
  509. package/dist/esm/utils/utils.js +95 -0
  510. package/dist/hooks/index.js +17 -8
  511. package/dist/hooks/use-breakpoint.d.ts +2 -2
  512. package/dist/hooks/use-breakpoint.js +15 -15
  513. package/dist/hooks/use-full-width.d.ts +1 -1
  514. package/dist/hooks/use-full-width.js +19 -16
  515. package/dist/hooks/use-layout.js +19 -17
  516. package/dist/index.d.ts +0 -2
  517. package/dist/index.js +18 -320
  518. package/dist/providers/IconsProvider.js +118 -189
  519. package/dist/providers/icons/Address.js +40 -13
  520. package/dist/providers/icons/Advice.js +40 -11
  521. package/dist/providers/icons/Archive.js +40 -13
  522. package/dist/providers/icons/ArrowDown.js +40 -11
  523. package/dist/providers/icons/ArrowLeft.js +40 -11
  524. package/dist/providers/icons/ArrowRight.js +40 -11
  525. package/dist/providers/icons/ArrowUp.js +40 -11
  526. package/dist/providers/icons/Award.js +40 -13
  527. package/dist/providers/icons/Battery.js +40 -13
  528. package/dist/providers/icons/Cal.js +40 -11
  529. package/dist/providers/icons/CalBook.js +40 -13
  530. package/dist/providers/icons/CaretDown.js +40 -5
  531. package/dist/providers/icons/CaretLeft.js +40 -5
  532. package/dist/providers/icons/CaretRight.js +40 -5
  533. package/dist/providers/icons/CaretUp.js +40 -5
  534. package/dist/providers/icons/Chart.js +40 -13
  535. package/dist/providers/icons/ChartFilled.js +40 -11
  536. package/dist/providers/icons/Check.js +40 -11
  537. package/dist/providers/icons/CheckCircle.js +40 -13
  538. package/dist/providers/icons/ChevronDown.js +40 -11
  539. package/dist/providers/icons/ChevronLeft.js +40 -11
  540. package/dist/providers/icons/ChevronLeftSmall.js +40 -11
  541. package/dist/providers/icons/ChevronLeftSmallFirst.js +40 -13
  542. package/dist/providers/icons/ChevronRight.js +40 -11
  543. package/dist/providers/icons/ChevronRightSmall.js +40 -11
  544. package/dist/providers/icons/ChevronRightSmallLast.js +40 -13
  545. package/dist/providers/icons/ChevronUp.js +40 -11
  546. package/dist/providers/icons/Circle.js +17 -5
  547. package/dist/providers/icons/CloseCircle.js +40 -13
  548. package/dist/providers/icons/Cross.js +40 -11
  549. package/dist/providers/icons/Doc.js +40 -11
  550. package/dist/providers/icons/Dollar.js +40 -13
  551. package/dist/providers/icons/Download.js +40 -13
  552. package/dist/providers/icons/Eco.js +40 -11
  553. package/dist/providers/icons/EcoHome.js +40 -13
  554. package/dist/providers/icons/Edit.js +40 -13
  555. package/dist/providers/icons/ElectricCar.js +40 -13
  556. package/dist/providers/icons/ElectricHome.js +40 -13
  557. package/dist/providers/icons/Electricity.js +40 -11
  558. package/dist/providers/icons/EnergyAdvice.js +40 -13
  559. package/dist/providers/icons/Equals.js +40 -13
  560. package/dist/providers/icons/Euro.js +40 -13
  561. package/dist/providers/icons/Gas.js +40 -11
  562. package/dist/providers/icons/GlobeAddress.js +40 -11
  563. package/dist/providers/icons/Help.js +40 -13
  564. package/dist/providers/icons/HelpFilled.d.ts +2 -0
  565. package/dist/providers/icons/HelpFilled.js +41 -0
  566. package/dist/providers/icons/Hide.js +40 -11
  567. package/dist/providers/icons/Home.js +40 -11
  568. package/dist/providers/icons/HomeFilled.js +40 -11
  569. package/dist/providers/icons/HydroPower.js +40 -13
  570. package/dist/providers/icons/Info.js +40 -13
  571. package/dist/providers/icons/Link.js +39 -40
  572. package/dist/providers/icons/Logo.js +17 -11
  573. package/dist/providers/icons/Mail.js +40 -11
  574. package/dist/providers/icons/MailOpen.js +40 -11
  575. package/dist/providers/icons/Menu.js +40 -13
  576. package/dist/providers/icons/Message.js +40 -11
  577. package/dist/providers/icons/MessageFilled.js +40 -11
  578. package/dist/providers/icons/Minus.js +40 -5
  579. package/dist/providers/icons/Mobile.js +40 -13
  580. package/dist/providers/icons/NewWindow.js +39 -22
  581. package/dist/providers/icons/PaymentCard.js +40 -13
  582. package/dist/providers/icons/PaymentCardFilled.d.ts +2 -0
  583. package/dist/providers/icons/PaymentCardFilled.js +41 -0
  584. package/dist/providers/icons/Phone.js +40 -11
  585. package/dist/providers/icons/Plus.js +40 -11
  586. package/dist/providers/icons/Pound.js +40 -13
  587. package/dist/providers/icons/Pricing.js +40 -11
  588. package/dist/providers/icons/Search.js +40 -11
  589. package/dist/providers/icons/Security.js +40 -13
  590. package/dist/providers/icons/Show.js +40 -13
  591. package/dist/providers/icons/SmartHome.js +40 -13
  592. package/dist/providers/icons/SmartMeter.js +40 -13
  593. package/dist/providers/icons/Solar.js +40 -11
  594. package/dist/providers/icons/Star.js +40 -11
  595. package/dist/providers/icons/StarFilled.d.ts +2 -0
  596. package/dist/providers/icons/StarFilled.js +41 -0
  597. package/dist/providers/icons/Sun.js +40 -13
  598. package/dist/providers/icons/Torch.js +39 -13
  599. package/dist/providers/icons/Trees.js +40 -13
  600. package/dist/providers/icons/Tune.js +40 -13
  601. package/dist/providers/icons/User.js +40 -13
  602. package/dist/providers/icons/UserFilled.js +40 -11
  603. package/dist/providers/icons/Wallet.js +40 -13
  604. package/dist/providers/icons/WalletFilled.js +40 -11
  605. package/dist/providers/icons/WarmHome.js +40 -13
  606. package/dist/providers/icons/Warning.js +40 -13
  607. package/dist/providers/icons/WebAddress.js +40 -11
  608. package/dist/providers/icons/WindPower.js +40 -11
  609. package/dist/providers/icons/index.d.ts +3 -0
  610. package/dist/providers/icons/index.js +102 -171
  611. package/dist/providers/index.js +17 -92
  612. package/dist/providers/types.d.ts +3 -3
  613. package/dist/providers/types.js +2 -1
  614. package/dist/styled.native.d.ts +36 -0
  615. package/dist/styled.native.js +32 -8
  616. package/dist/theme/index.js +15 -970
  617. package/dist/utils/index.js +16 -14
  618. package/dist/utils/utils.d.ts +2 -1
  619. package/dist/utils/utils.js +104 -57
  620. package/package.json +13 -21
  621. package/dist/components/components.spec.native.js +0 -199
  622. package/dist/index-zQHKJ0fC.js +0 -180
  623. package/dist/styled.native-KEscfVp7.js +0 -3872
  624. package/dist/test/utils.d.ts +0 -4
  625. package/dist/test/utils.js +0 -16127
  626. package/dist/theme-native--5aKgQLJ.js +0 -482
  627. package/dist/theme-web-MrdqV6Ln.js +0 -482
  628. package/dist/utils-HsZygzDh.js +0 -26
  629. /package/dist/{components/components.spec.native.d.ts → esm/components/Accordion/types.js} +0 -0
@@ -1,740 +1,169 @@
1
- import { jsx as T, jsxs as N } from "react/jsx-runtime";
2
- import b, { useState as v, useEffect as E, useMemo as q, useCallback as it, useRef as Z } from "react";
3
- import { Keyboard as B, Pressable as Et, useWindowDimensions as Ot, useColorScheme as Pt, Platform as At, View as H, Text as st, TouchableOpacity as Dt, Dimensions as _t } from "react-native";
4
- import ot, { useSharedValue as K, withTiming as U, withSpring as rt, runOnJS as nt, useAnimatedStyle as mt, Easing as kt } from "react-native-reanimated";
5
- import { useSafeAreaInsets as pt } from "react-native-safe-area-context";
6
- import { Gesture as X, Directions as dt, GestureDetector as xt } from "react-native-gesture-handler";
7
- import { n as w } from "../../utils-HsZygzDh.js";
8
- import { s as $, c as L } from "../../styled.native-KEscfVp7.js";
9
- import { Action as It } from "../ActionList/ActionList.js";
10
- import { Icon as Ht } from "../Icon/Icon.js";
11
- import { P as Rt } from "../P/P.js";
12
- import "../../hooks/use-breakpoint.js";
13
- import "../ActionList/styled.js";
14
- import "../../utils/utils.js";
15
- import "../../providers/IconsProvider.js";
16
- import "../../providers/icons/Address.js";
17
- import "react-native-svg";
18
- import "../../providers/icons/Advice.js";
19
- import "../../providers/icons/Archive.js";
20
- import "../../providers/icons/ArrowDown.js";
21
- import "../../providers/icons/ArrowLeft.js";
22
- import "../../providers/icons/ArrowRight.js";
23
- import "../../providers/icons/ArrowUp.js";
24
- import "../../providers/icons/Award.js";
25
- import "../../providers/icons/Battery.js";
26
- import "../../providers/icons/Cal.js";
27
- import "../../providers/icons/CalBook.js";
28
- import "../../providers/icons/CaretDown.js";
29
- import "../../providers/icons/CaretLeft.js";
30
- import "../../providers/icons/CaretRight.js";
31
- import "../../providers/icons/CaretUp.js";
32
- import "../../providers/icons/Chart.js";
33
- import "../../providers/icons/ChartFilled.js";
34
- import "../../providers/icons/Check.js";
35
- import "../../providers/icons/CheckCircle.js";
36
- import "../../providers/icons/ChevronDown.js";
37
- import "../../providers/icons/ChevronLeft.js";
38
- import "../../providers/icons/ChevronLeftSmall.js";
39
- import "../../providers/icons/ChevronLeftSmallFirst.js";
40
- import "../../providers/icons/ChevronRight.js";
41
- import "../../providers/icons/ChevronRightSmall.js";
42
- import "../../providers/icons/ChevronRightSmallLast.js";
43
- import "../../providers/icons/ChevronUp.js";
44
- import "../../providers/icons/Circle.js";
45
- import "../../providers/icons/CloseCircle.js";
46
- import "../../providers/icons/Cross.js";
47
- import "../../providers/icons/Doc.js";
48
- import "../../providers/icons/Dollar.js";
49
- import "../../providers/icons/Download.js";
50
- import "../../providers/icons/Eco.js";
51
- import "../../providers/icons/EcoHome.js";
52
- import "../../providers/icons/Edit.js";
53
- import "../../providers/icons/ElectricCar.js";
54
- import "../../providers/icons/ElectricHome.js";
55
- import "../../providers/icons/Electricity.js";
56
- import "../../providers/icons/EnergyAdvice.js";
57
- import "../../providers/icons/Equals.js";
58
- import "../../providers/icons/Euro.js";
59
- import "../../providers/icons/Gas.js";
60
- import "../../providers/icons/GlobeAddress.js";
61
- import "../../providers/icons/Help.js";
62
- import "../../providers/icons/Hide.js";
63
- import "../../providers/icons/Home.js";
64
- import "../../providers/icons/HomeFilled.js";
65
- import "../../providers/icons/HydroPower.js";
66
- import "../../providers/icons/Info.js";
67
- import "../../providers/icons/Link.js";
68
- import "../../providers/icons/Logo.js";
69
- import "../../providers/icons/Mail.js";
70
- import "../../providers/icons/MailOpen.js";
71
- import "../../providers/icons/Menu.js";
72
- import "../../providers/icons/Message.js";
73
- import "../../providers/icons/MessageFilled.js";
74
- import "../../providers/icons/Minus.js";
75
- import "../../providers/icons/Mobile.js";
76
- import "../../providers/icons/NewWindow.js";
77
- import "../../providers/icons/PaymentCard.js";
78
- import "../../providers/icons/Phone.js";
79
- import "../../providers/icons/Plus.js";
80
- import "../../providers/icons/Pound.js";
81
- import "../../providers/icons/Pricing.js";
82
- import "../../providers/icons/Search.js";
83
- import "../../providers/icons/Security.js";
84
- import "../../providers/icons/Show.js";
85
- import "../../providers/icons/SmartHome.js";
86
- import "../../providers/icons/SmartMeter.js";
87
- import "../../providers/icons/Solar.js";
88
- import "../../providers/icons/Star.js";
89
- import "../../providers/icons/Sun.js";
90
- import "../../providers/icons/Torch.js";
91
- import "../../providers/icons/Trees.js";
92
- import "../../providers/icons/Tune.js";
93
- import "../../providers/icons/User.js";
94
- import "../../providers/icons/UserFilled.js";
95
- import "../../providers/icons/Wallet.js";
96
- import "../../providers/icons/WalletFilled.js";
97
- import "../../providers/icons/WarmHome.js";
98
- import "../../providers/icons/Warning.js";
99
- import "../../providers/icons/WebAddress.js";
100
- import "../../providers/icons/WindPower.js";
101
- const Mt = 20;
102
- let l;
103
- (function(t) {
104
- t[t.ADD_TOAST = 0] = "ADD_TOAST", t[t.UPDATE_TOAST = 1] = "UPDATE_TOAST", t[t.UPSERT_TOAST = 2] = "UPSERT_TOAST", t[t.DISMISS_TOAST = 3] = "DISMISS_TOAST", t[t.REMOVE_TOAST = 4] = "REMOVE_TOAST", t[t.START_PAUSE = 5] = "START_PAUSE", t[t.END_PAUSE = 6] = "END_PAUSE";
105
- })(l || (l = {}));
106
- const F = /* @__PURE__ */ new Map(), at = (t) => {
107
- if (F.has(t))
108
- return;
109
- const o = setTimeout(() => {
110
- F.delete(t), x({
111
- type: l.REMOVE_TOAST,
112
- toastId: t
113
- });
114
- }, 1e3);
115
- F.set(t, o);
116
- }, Ct = (t) => {
117
- const o = F.get(t);
118
- o && clearTimeout(o);
119
- }, tt = (t, o) => {
120
- switch (o.type) {
121
- case l.ADD_TOAST:
122
- return {
123
- ...t,
124
- toasts: [o.toast, ...t.toasts].slice(0, Mt)
125
- };
126
- case l.UPDATE_TOAST:
127
- return o.toast.id && Ct(o.toast.id), {
128
- ...t,
129
- toasts: t.toasts.map((e) => e.id === o.toast.id ? {
130
- ...e,
131
- ...o.toast
132
- } : e)
133
- };
134
- case l.UPSERT_TOAST:
135
- const {
136
- toast: i
137
- } = o;
138
- return t.toasts.find((e) => e.id === i.id) ? tt(t, {
139
- type: l.UPDATE_TOAST,
140
- toast: i
141
- }) : tt(t, {
142
- type: l.ADD_TOAST,
143
- toast: i
144
- });
145
- case l.DISMISS_TOAST:
146
- const {
147
- toastId: r
148
- } = o;
149
- return r ? at(r) : t.toasts.forEach((e) => {
150
- at(e.id);
151
- }), {
152
- ...t,
153
- toasts: t.toasts.map((e) => e.id === r || r === void 0 ? {
154
- ...e,
155
- visible: !1
156
- } : e)
157
- };
158
- case l.REMOVE_TOAST:
159
- return o.toastId === void 0 ? {
160
- ...t,
161
- toasts: []
162
- } : {
163
- ...t,
164
- toasts: t.toasts.filter((e) => e.id !== o.toastId)
165
- };
166
- case l.START_PAUSE:
167
- return {
168
- ...t,
169
- pausedAt: o.time
170
- };
171
- case l.END_PAUSE:
172
- const s = o.time - (t.pausedAt || 0);
173
- return {
174
- ...t,
175
- pausedAt: void 0,
176
- toasts: t.toasts.map((e) => ({
177
- ...e,
178
- pauseDuration: e.pauseDuration + s
179
- }))
180
- };
181
- }
182
- }, j = [];
183
- let G = {
184
- toasts: [],
185
- pausedAt: void 0
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
186
5
  };
187
- const x = (t) => {
188
- G = tt(G, t), j.forEach((o) => {
189
- o(G);
190
- });
191
- }, Ut = {
192
- blank: 4e3,
193
- error: 4e3,
194
- success: 2e3,
195
- loading: 1 / 0
196
- }, $t = function() {
197
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
198
- const [o, i] = v(G);
199
- E(() => (j.push(i), () => {
200
- const s = j.indexOf(i);
201
- s > -1 && j.splice(s, 1);
202
- }), [o]);
203
- const r = o.toasts.filter((s) => (t == null ? void 0 : t.providerKey) === void 0 || s.providerKey === (t == null ? void 0 : t.providerKey) || s.providerKey === "PERSISTS").map((s) => {
204
- var e;
205
- return {
206
- ...t,
207
- ...t[s.type],
208
- ...s,
209
- duration: s.duration || ((e = t[s.type]) === null || e === void 0 ? void 0 : e.duration) || (t == null ? void 0 : t.duration) || Ut[s.type],
210
- styles: {
211
- ...(s == null ? void 0 : s.styles) ?? {}
212
- }
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
213
14
  };
214
- });
215
- return {
216
- ...o,
217
- toasts: r
218
- };
219
- };
220
- let A;
221
- (function(t) {
222
- t[t.TOP = 1] = "TOP", t[t.BOTTOM = 2] = "BOTTOM";
223
- })(A || (A = {}));
224
- const Lt = (t) => typeof t == "function", et = (t, o) => Lt(t) ? t(o) : t, Vt = /* @__PURE__ */ (() => {
225
- let t = 0;
226
- return () => (++t).toString();
227
- })(), Wt = function(t) {
228
- let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "blank", i = arguments.length > 2 ? arguments[2] : void 0;
229
- return {
230
- createdAt: Date.now(),
231
- visible: !0,
232
- type: o,
233
- message: t,
234
- pauseDuration: 0,
235
- position: A.TOP,
236
- providerKey: "DEFAULT",
237
- ...i,
238
- id: (i == null ? void 0 : i.id) || Vt()
239
- };
240
- }, Y = (t) => (o, i) => {
241
- const r = Wt(o, t, i);
242
- return x({
243
- type: l.UPSERT_TOAST,
244
- toast: r
245
- }), r.id;
246
- }, c = (t, o) => Y("blank")(t, o);
247
- c.error = Y("error");
248
- c.success = Y("success");
249
- c.loading = Y("loading");
250
- c.dismiss = (t) => {
251
- x({
252
- type: l.DISMISS_TOAST,
253
- toastId: t
254
- });
15
+ return __assign.apply(this, arguments);
255
16
  };
256
- c.remove = (t) => x({
257
- type: l.REMOVE_TOAST,
258
- toastId: t
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
259
32
  });
260
- c.promise = (t, o, i) => {
261
- const r = c.loading(o.loading, {
262
- ...i,
263
- ...i == null ? void 0 : i.loading
264
- });
265
- return t.then((s) => (c.success(et(o.success, s), {
266
- id: r,
267
- ...i,
268
- ...i == null ? void 0 : i.success
269
- }), s)).catch((s) => {
270
- c.error(et(o.error, s), {
271
- id: r,
272
- ...i,
273
- ...i == null ? void 0 : i.error
274
- });
275
- }), t;
33
+ var __importStar = (this && this.__importStar) || function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
276
39
  };
277
- const Bt = (t) => {
278
- const {
279
- toasts: o,
280
- pausedAt: i
281
- } = $t(t);
282
- E(() => {
283
- if (i)
284
- return;
285
- const s = Date.now(), e = o.map((n) => {
286
- if (n.duration === 1 / 0)
287
- return;
288
- const u = (n.duration || 0) + n.pauseDuration - (s - n.createdAt);
289
- if (u < 0) {
290
- n.visible && c.dismiss(n.id);
291
- return;
292
- }
293
- return setTimeout(() => c.dismiss(n.id), u);
294
- });
295
- return () => {
296
- e.forEach((n) => n && clearTimeout(n));
297
- };
298
- }, [o, i]);
299
- const r = q(() => ({
300
- startPause: () => {
301
- x({
302
- type: l.START_PAUSE,
303
- time: Date.now()
304
- });
305
- },
306
- endPause: () => {
307
- i && x({
308
- type: l.END_PAUSE,
309
- time: Date.now()
310
- });
311
- },
312
- updateHeight: (s, e) => x({
313
- type: l.UPDATE_TOAST,
314
- toast: {
315
- id: s,
316
- height: e
317
- }
318
- }),
319
- calculateOffset: (s, e) => {
320
- const {
321
- reverseOrder: n = !1,
322
- gutter: u = 8,
323
- defaultPosition: a
324
- } = e || {}, p = o.filter((d) => (d.position || a) === (s.position || a) && d.height), h = p.findIndex((d) => d.id === s.id), m = p.filter((d, f) => f < h && d.visible).length;
325
- return p.filter((d) => d.visible).slice(...n ? [m + 1] : [0, m]).reduce((d, f) => d + (f.height || 0) + u, 0);
326
- }
327
- }), [o, i]);
328
- return {
329
- toasts: o,
330
- handlers: r
331
- };
332
- }, lt = Object.freeze({
333
- screenX: 0,
334
- screenY: 0,
335
- width: 0,
336
- height: 0
337
- }), ut = {
338
- start: lt,
339
- end: lt
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.showToast = exports.ToastsContainer = void 0;
42
+ var jsx_runtime_1 = require("react/jsx-runtime");
43
+ var react_native_toast_1 = require("@backpackapp-io/react-native-toast");
44
+ var element_core_1 = require("@ovotech/element-core");
45
+ var react_1 = require("react");
46
+ var react_native_1 = require("react-native");
47
+ var react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
48
+ var styled_native_1 = __importStar(require("../../styled.native"));
49
+ var ActionList_1 = require("../ActionList");
50
+ var Icon_1 = require("../Icon");
51
+ var P_1 = require("../P");
52
+ var ToastsContainer = function (_a) {
53
+ var _b = _a.top, top = _b === void 0 ? -80 : _b;
54
+ return ((0, jsx_runtime_1.jsx)(react_native_toast_1.Toasts, { extraInsets: { top: top } }));
340
55
  };
341
- function Kt() {
342
- const [t, o] = v(!1), [i, r] = v(ut), [s, e] = v(0), n = (a) => {
343
- o(!0), r({
344
- start: a.startCoordinates,
345
- end: a.endCoordinates
346
- }), e(a.endCoordinates.height);
347
- }, u = (a) => {
348
- o(!1), a ? r({
349
- start: a.startCoordinates,
350
- end: a.endCoordinates
351
- }) : (r(ut), e(0));
352
- };
353
- return E(() => {
354
- const a = [B.addListener("keyboardWillShow", n), B.addListener("keyboardDidShow", n), B.addListener("keyboardWillHide", u), B.addListener("keyboardDidHide", u)];
355
- return () => {
356
- a.forEach((p) => p.remove());
357
- };
358
- }, []), {
359
- keyboardShown: t,
360
- coordinates: i,
361
- keyboardHeight: s
362
- };
363
- }
364
- const Ft = (t, o, i, r, s) => ({
365
- shadowColor: t ?? "#000",
366
- shadowOffset: {
367
- width: 0,
368
- height: (s ? -1 : 1) * (i ? 8 : 3)
369
- },
370
- shadowOpacity: o ?? 0.18,
371
- shadowRadius: i ? 6 : 4.65,
372
- elevation: r ? void 0 : 7
373
- }), P = {
374
- primary: "#1B71FC",
375
- backgroundLight: "#212331",
376
- backgroundDark: "#f7f7f7",
377
- success: "#0BAA83",
378
- error: "#fe352a",
379
- info: "#74B9FF",
380
- textLight: "#52616B",
381
- textDark: "#f2f2f2",
382
- label: "#9daec9"
383
- }, jt = (t, o, i) => {
384
- const [r, s] = v(!1);
385
- E(() => {
386
- !r && i && (s(!0), t()), r && !i && (s(!1), o());
387
- }, [i, r, t, o]);
388
- }, Gt = ot.createAnimatedComponent(Et), ct = 50, Nt = (t) => {
389
- var o, i, r, s;
390
- let {
391
- toast: e,
392
- updateHeight: n,
393
- offset: u,
394
- startPause: a,
395
- endPause: p,
396
- overrideDarkMode: h,
397
- onToastHide: m,
398
- onToastPress: d,
399
- onToastShow: f
400
- } = t;
401
- const D = pt(), {
402
- width: O,
403
- height: g
404
- } = Ot(), {
405
- keyboardShown: R,
406
- keyboardHeight: M
407
- } = Kt();
408
- jt(() => {
409
- f == null || f(e);
410
- }, () => {
411
- m == null || m(e);
412
- }, e.visible);
413
- const z = Pt() === "dark", _ = h !== void 0 ? h : z, [I, gt] = v(e != null && e.height ? e.height : ct), [Q, Tt] = v(e != null && e.width ? e.width : O - 32 > 360 ? 360 : O - 32), y = q(() => e.position === A.TOP ? -50 : g - D.bottom - At.select({
414
- ios: 0,
415
- default: 32
416
- }), [g, e.position, D.bottom]), J = K(0), C = K(y), k = K(y), vt = () => d == null ? void 0 : d(e), yt = it((S) => {
417
- c.dismiss(S);
418
- }, [c.dismiss]), V = it(() => {
419
- if (e.position === A.TOP)
420
- k.value = U(e.visible ? u : y), C.value = U(e.visible ? u : y);
421
- else {
422
- let S = R ? M : 0;
423
- const W = e.visible ? y - I - u - S - D.bottom - 24 : y;
424
- k.value = rt(W, {
425
- stiffness: 80
426
- }), C.value = rt(W, {
427
- stiffness: 80
428
- });
429
- }
430
- }, [u, e.visible, R, M, I, D.bottom, C, y, e.position, k]), St = q(() => {
431
- const S = X.Pan().onUpdate((wt) => {
432
- k.value = wt.translationY / 4 + C.value;
433
- }).onEnd(() => {
434
- nt(V)();
435
- }), W = X.Fling().direction(e.position === A.TOP ? dt.UP : dt.DOWN).onEnd(() => {
436
- k.value = U(y, {
437
- duration: 40
438
- }), nt(yt)(e.id);
439
- });
440
- return X.Simultaneous(W, S);
441
- }, [k, y, C, V, e.position, e.id]);
442
- E(() => {
443
- gt(e != null && e.height ? e.height : ct);
444
- }, [e.height]), E(() => {
445
- Tt(e != null && e.width ? e.width : O - 32);
446
- }, [e.width, O]), E(() => {
447
- J.value = U(e.visible ? 1 : 0, {
448
- duration: 300
56
+ exports.ToastsContainer = ToastsContainer;
57
+ var StyledView = styled_native_1.default.View(function (_a) {
58
+ var core = _a.theme.core, variant = _a.variant;
59
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n border-radius: ", ";\n flex-direction: row;\n "], ["\n background-color: ", ";\n overflow: hidden;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n border-radius: ", ";\n flex-direction: row;\n "])), variant === 'default'
60
+ ? core.color.brand.forest
61
+ : core.color.red.darkest, (0, element_core_1.numToPx)(core.space[2]), (0, element_core_1.numToPx)(core.space[3]), (0, element_core_1.numToPx)(core.space[2]), (0, element_core_1.numToPx)(core.space[4]), (0, element_core_1.numToPx)(core.radius.max));
62
+ });
63
+ var StyledP = (0, styled_native_1.default)(P_1.P)(function (_a) {
64
+ var semantic = _a.theme.semantic;
65
+ return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), semantic.inverted.message.base);
66
+ });
67
+ var StyledThinBorder = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
68
+ var core = _a.theme.core, variant = _a.variant;
69
+ return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n height: 1px;\n "], ["\n background-color: ", ";\n height: 1px;\n "])), variant === 'default'
70
+ ? core.color.brand.energised
71
+ : core.color.red.light);
72
+ });
73
+ var StyledThickBorder = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
74
+ var core = _a.theme.core, variant = _a.variant;
75
+ return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n height: 3px;\n "], ["\n background-color: ", ";\n height: 3px;\n "])), variant === 'default'
76
+ ? core.color.brand.leaf
77
+ : core.color.red.base);
78
+ });
79
+ var StyledCloseIcon = (0, styled_native_1.default)(react_native_1.TouchableOpacity)(function (_a) {
80
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
81
+ return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "])), semantic.inverted.surface, (0, element_core_1.numToPx)(core.radius.max), (0, element_core_1.numToPx)(core.space[7]), (0, element_core_1.numToPx)(core.space[7]), (0, element_core_1.numToPx)(core.space[2]));
82
+ });
83
+ var showToast = function (_a) {
84
+ var message = _a.message, _b = _a.dismissible, dismissible = _b === void 0 ? false : _b, action = _a.action, actionTitle = _a.actionTitle, _c = _a.variant, variant = _c === void 0 ? 'default' : _c, _d = _a.duration, duration = _d === void 0 ? 5000 : _d;
85
+ return action || dismissible
86
+ ? react_native_toast_1.toast.loading(message, {
87
+ id: 'clipboard',
88
+ position: react_native_toast_1.ToastPosition.BOTTOM,
89
+ disableShadow: true,
90
+ customToast: function (t) { return ((0, jsx_runtime_1.jsx)(CustomToast, __assign({}, t, { dismissible: dismissible, action: action, actionTitle: actionTitle, variant: variant }), message)); },
91
+ })
92
+ : (0, react_native_toast_1.toast)(message, {
93
+ id: 'clipboard',
94
+ position: react_native_toast_1.ToastPosition.BOTTOM,
95
+ duration: duration,
96
+ disableShadow: true,
97
+ customToast: function (t) { return ((0, jsx_runtime_1.jsx)(CustomToastWithTimeIndicator, __assign({}, t, { variant: variant }), message)); },
98
+ });
99
+ };
100
+ exports.showToast = showToast;
101
+ var CustomToastWithTimeIndicator = function (_a) {
102
+ var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 5000 : _b, variant = _a.variant;
103
+ var toastPadding = 20;
104
+ var textRef = (0, react_1.useRef)(null);
105
+ var _c = (0, react_1.useState)(0), textHeight = _c[0], setTextHeight = _c[1];
106
+ var windowWidth = react_native_1.Dimensions.get('window').width;
107
+ var screenPadding = 32;
108
+ var toastWidth = windowWidth - screenPadding;
109
+ var sharedWidth = (0, react_native_reanimated_1.useSharedValue)(toastWidth);
110
+ var style = (0, react_native_reanimated_1.useAnimatedStyle)(function () {
111
+ return {
112
+ width: (0, react_native_reanimated_1.withTiming)(sharedWidth.value, {
113
+ duration: duration,
114
+ easing: react_native_reanimated_1.Easing.linear,
115
+ }),
116
+ };
449
117
  });
450
- }, [e.visible, J]), E(() => {
451
- V();
452
- }, [u, e.visible, R, M, I, V]);
453
- const bt = mt(() => ({
454
- opacity: J.value,
455
- transform: [{
456
- translateY: k.value
457
- }]
458
- }));
459
- return /* @__PURE__ */ b.createElement(xt, {
460
- key: e.id,
461
- gesture: St
462
- }, /* @__PURE__ */ b.createElement(Gt, {
463
- onPressIn: a,
464
- onPressOut: () => {
465
- p();
466
- },
467
- onPress: vt,
468
- style: [{
469
- backgroundColor: e.customToast ? void 0 : _ ? P.backgroundDark : P.backgroundLight,
470
- borderRadius: 8,
471
- position: "absolute",
472
- maxHeight: I,
473
- left: (O - Q) / 2,
474
- zIndex: e.visible ? 9999 : void 0,
475
- alignItems: "center",
476
- justifyContent: "center"
477
- }, bt, !e.disableShadow && Ft("#181821", 0.15, !1), (o = e.styles) === null || o === void 0 ? void 0 : o.pressable]
478
- }, e.customToast ? /* @__PURE__ */ b.createElement(H, {
479
- onLayout: (S) => n(e.id, S.nativeEvent.layout.height),
480
- key: e.id
481
- }, e.customToast({
482
- ...e,
483
- height: I,
484
- width: Q
485
- })) : /* @__PURE__ */ b.createElement(H, {
486
- onLayout: (S) => n(e.id, S.nativeEvent.layout.height),
487
- style: [{
488
- height: I,
489
- width: Q,
490
- flexDirection: "row",
491
- alignItems: "center",
492
- paddingVertical: 12,
493
- paddingHorizontal: 16
494
- }, (i = e.styles) === null || i === void 0 ? void 0 : i.view],
495
- key: e.id
496
- }, (e.type === "error" || e.type === "success") && /* @__PURE__ */ b.createElement(H, {
497
- style: [{
498
- backgroundColor: e.type === "error" ? P.error : e.type === "success" ? P.success : _ ? P.backgroundDark : P.backgroundLight,
499
- width: 3,
500
- height: "100%",
501
- borderRadius: 12,
502
- marginRight: 12
503
- }, e == null || (r = e.styles) === null || r === void 0 ? void 0 : r.indicator]
504
- }), typeof e.icon == "string" ? /* @__PURE__ */ b.createElement(st, null, e.icon) : e.icon, /* @__PURE__ */ b.createElement(st, {
505
- numberOfLines: 1,
506
- style: [{
507
- color: _ ? P.textLight : P.textDark,
508
- padding: 4,
509
- flex: 1
510
- }, e == null || (s = e.styles) === null || s === void 0 ? void 0 : s.text]
511
- }, et(e.message, e)))));
512
- }, Yt = (t) => {
513
- let {
514
- overrideDarkMode: o,
515
- extraInsets: i,
516
- onToastHide: r,
517
- onToastPress: s,
518
- onToastShow: e,
519
- providerKey: n = "DEFAULT"
520
- } = t;
521
- const {
522
- toasts: u,
523
- handlers: a
524
- } = Bt({
525
- providerKey: n
526
- }), {
527
- startPause: p,
528
- endPause: h
529
- } = a, m = pt();
530
- return /* @__PURE__ */ b.createElement(H, {
531
- style: {
532
- position: "absolute",
533
- top: m.top + ((i == null ? void 0 : i.top) ?? 0) + 16,
534
- left: m.left + ((i == null ? void 0 : i.left) ?? 0),
535
- right: m.right + ((i == null ? void 0 : i.right) ?? 0),
536
- bottom: m.bottom + ((i == null ? void 0 : i.bottom) ?? 0) + 16
537
- },
538
- pointerEvents: "box-none"
539
- }, u.map((d) => /* @__PURE__ */ b.createElement(Nt, {
540
- key: d.id,
541
- toast: d,
542
- startPause: p,
543
- endPause: h,
544
- updateHeight: a.updateHeight,
545
- offset: a.calculateOffset(d, {
546
- reverseOrder: !0
547
- }),
548
- overrideDarkMode: o,
549
- onToastHide: r,
550
- onToastPress: s,
551
- onToastShow: e
552
- })));
553
- }, No = ({ top: t = -80 }) => /* @__PURE__ */ T(Yt, { extraInsets: { top: t } }), ht = $.View(
554
- ({ theme: { core: t }, variant: o }) => L`
555
- background-color: ${o === "default" ? t.color.brand.forest : t.color.red.darkest};
556
- overflow: hidden;
557
- padding-top: ${w(t.space[2])};
558
- padding-bottom: ${w(t.space[3])};
559
- padding-right: ${w(t.space[2])};
560
- padding-left: ${w(t.space[4])};
561
- border-radius: ${w(t.radius.max)};
562
- flex-direction: row;
563
- `
564
- ), ft = $(Rt)(
565
- ({ theme: { semantic: t } }) => L`
566
- color: ${t.inverted.message.base};
567
- `
568
- ), zt = $(ot.View)(
569
- ({ theme: { core: t }, variant: o }) => L`
570
- background-color: ${o === "default" ? t.color.brand.energised : t.color.red.light};
571
- height: 1px;
572
- `
573
- ), Qt = $(ot.View)(
574
- ({ theme: { core: t }, variant: o }) => L`
575
- background-color: ${o === "default" ? t.color.brand.leaf : t.color.red.base};
576
- height: 3px;
577
- `
578
- ), Jt = $(Dt)(
579
- ({ theme: { core: t, semantic: o } }) => L`
580
- background-color: ${o.inverted.surface};
581
- border-radius: ${w(t.radius.max)};
582
- width: ${w(t.space[7])};
583
- height: ${w(t.space[7])};
584
- padding: ${w(t.space[2])};
585
- align-items: center;
586
- justify-content: center;
587
- `
588
- ), Yo = ({
589
- message: t,
590
- dismissible: o = !1,
591
- action: i,
592
- actionTitle: r,
593
- variant: s = "default",
594
- duration: e = 5e3
595
- }) => i || o ? c.loading(t, {
596
- id: "clipboard",
597
- position: A.BOTTOM,
598
- disableShadow: !0,
599
- customToast: (n) => /* @__PURE__ */ T(
600
- qt,
601
- {
602
- ...n,
603
- dismissible: o,
604
- action: i,
605
- actionTitle: r,
606
- variant: s
607
- },
608
- t
609
- )
610
- }) : c(t, {
611
- id: "clipboard",
612
- position: A.BOTTOM,
613
- duration: e,
614
- disableShadow: !0,
615
- customToast: (n) => /* @__PURE__ */ T(
616
- Xt,
617
- {
618
- ...n,
619
- variant: s
620
- },
621
- t
622
- )
623
- }), Xt = ({
624
- message: t,
625
- duration: o = 5e3,
626
- variant: i
627
- }) => {
628
- const s = Z(null), [e, n] = v(0), p = _t.get("window").width - 32, h = K(p), m = mt(() => ({
629
- width: U(h.value, {
630
- duration: o,
631
- easing: kt.linear
632
- })
633
- }));
634
- return E(() => {
635
- h.value = 0;
636
- }, []), /* @__PURE__ */ N(
637
- ht,
638
- {
639
- variant: i,
640
- style: {
641
- width: p,
642
- height: e + 20,
643
- flexWrap: "wrap"
644
- },
645
- children: [
646
- /* @__PURE__ */ T(
647
- ft,
648
- {
649
- ref: s,
650
- onLayout: () => {
651
- var d;
652
- (d = s.current) == null || d.measureInWindow((f, D, O, g) => {
653
- n(g);
654
- });
655
- },
656
- children: t
657
- }
658
- ),
659
- /* @__PURE__ */ N(H, { style: { position: "absolute", bottom: 0 }, children: [
660
- /* @__PURE__ */ T(zt, { variant: i, style: m }),
661
- /* @__PURE__ */ T(Qt, { variant: i, style: m })
662
- ] })
663
- ]
664
- }
665
- );
666
- }, qt = ({
667
- id: t,
668
- message: o,
669
- dismissible: i,
670
- action: r,
671
- actionTitle: s,
672
- width: e,
673
- variant: n
674
- }) => {
675
- const a = Z(null), p = Z(null), [h, m] = v(0), [d, f] = v(0), D = Math.floor(h) === Math.floor(d) && !i ? h : h + d, O = () => {
676
- r && s && (r(), c.dismiss(t));
677
- };
678
- return /* @__PURE__ */ N(
679
- ht,
680
- {
681
- variant: n,
682
- style: {
683
- width: e,
684
- height: D + 20,
685
- alignItems: r ? "flex-start" : "center"
686
- },
687
- children: [
688
- /* @__PURE__ */ N(
689
- H,
690
- {
691
- style: {
692
- flexDirection: "row",
693
- flexWrap: "wrap",
694
- justifyContent: "space-between",
695
- flex: 1
696
- },
697
- children: [
698
- /* @__PURE__ */ T(
699
- ft,
700
- {
701
- ref: a,
702
- onLayout: () => {
703
- var g;
704
- (g = a.current) == null || g.measureInWindow((R, M, z, _) => {
705
- m(_);
706
- });
707
- },
708
- children: o
709
- }
710
- ),
711
- r && s ? /* @__PURE__ */ T(
712
- It,
713
- {
714
- ref: p,
715
- style: { width: "auto" },
716
- inverted: !0,
717
- inline: !0,
718
- iconRight: "chevron-right-small",
719
- onPress: O,
720
- onLayout: () => {
721
- var g;
722
- (g = p.current) == null || g.measureInWindow((R, M, z, _) => {
723
- f(_);
118
+ (0, react_1.useEffect)(function () {
119
+ sharedWidth.value = 0;
120
+ }, []);
121
+ return ((0, jsx_runtime_1.jsxs)(StyledView, { variant: variant, style: {
122
+ width: toastWidth,
123
+ height: textHeight + toastPadding,
124
+ flexWrap: 'wrap',
125
+ }, children: [(0, jsx_runtime_1.jsx)(StyledP, { ref: textRef, onLayout: function () {
126
+ var _a;
127
+ (_a = textRef.current) === null || _a === void 0 ? void 0 : _a.measureInWindow(function (_x, _y, _width, height) {
128
+ setTextHeight(height);
724
129
  });
725
- },
726
- children: s
727
- }
728
- ) : null
729
- ]
730
- }
731
- ),
732
- i ? /* @__PURE__ */ T(Jt, { onPress: () => c.dismiss(t), children: /* @__PURE__ */ T(Ht, { name: "cross", color: "#fff", size: 14 }) }) : null
733
- ]
734
- }
735
- );
130
+ }, children: message }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { position: 'absolute', bottom: 0 }, children: [(0, jsx_runtime_1.jsx)(StyledThinBorder, { variant: variant, style: style }), (0, jsx_runtime_1.jsx)(StyledThickBorder, { variant: variant, style: style })] })] }));
736
131
  };
737
- export {
738
- No as ToastsContainer,
739
- Yo as showToast
132
+ var CustomToast = function (_a) {
133
+ var id = _a.id, message = _a.message, dismissible = _a.dismissible, action = _a.action, actionTitle = _a.actionTitle, width = _a.width, variant = _a.variant;
134
+ var toastPadding = 20;
135
+ var textRef = (0, react_1.useRef)(null);
136
+ var actionRef = (0, react_1.useRef)(null);
137
+ var _b = (0, react_1.useState)(0), textHeight = _b[0], setTextHeight = _b[1];
138
+ var _c = (0, react_1.useState)(0), actionHeight = _c[0], setActionHeight = _c[1];
139
+ var toastHeight = Math.floor(textHeight) === Math.floor(actionHeight) && !dismissible // handling multiline
140
+ ? textHeight
141
+ : textHeight + actionHeight;
142
+ var handleAction = function () {
143
+ if (action && actionTitle) {
144
+ action();
145
+ react_native_toast_1.toast.dismiss(id);
146
+ }
147
+ };
148
+ return ((0, jsx_runtime_1.jsxs)(StyledView, { variant: variant, style: {
149
+ width: width,
150
+ height: toastHeight + toastPadding,
151
+ alignItems: action ? 'flex-start' : 'center',
152
+ }, children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
153
+ flexDirection: 'row',
154
+ flexWrap: 'wrap',
155
+ justifyContent: 'space-between',
156
+ flex: 1,
157
+ }, children: [(0, jsx_runtime_1.jsx)(StyledP, { ref: textRef, onLayout: function () {
158
+ var _a;
159
+ (_a = textRef.current) === null || _a === void 0 ? void 0 : _a.measureInWindow(function (_x, _y, _width, height) {
160
+ setTextHeight(height);
161
+ });
162
+ }, children: message }), action && actionTitle ? ((0, jsx_runtime_1.jsx)(ActionList_1.Action, { ref: actionRef, style: { width: 'auto' }, inverted: true, inline: true, iconRight: "chevron-right-small", onPress: handleAction, onLayout: function () {
163
+ var _a;
164
+ (_a = actionRef.current) === null || _a === void 0 ? void 0 : _a.measureInWindow(function (_x, _y, _width, height) {
165
+ setActionHeight(height);
166
+ });
167
+ }, children: actionTitle })) : null] }), dismissible ? ((0, jsx_runtime_1.jsx)(StyledCloseIcon, { onPress: function () { return react_native_toast_1.toast.dismiss(id); }, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "cross", color: "#fff", size: 14 }) })) : null] }));
740
168
  };
169
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;