@aws-amplify/ui 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/esm/helpers/authenticator/actor.js +2 -0
  2. package/dist/esm/helpers/authenticator/actor.js.map +1 -0
  3. package/dist/esm/helpers/authenticator/constants.js +2 -0
  4. package/dist/esm/helpers/authenticator/constants.js.map +1 -0
  5. package/dist/esm/helpers/authenticator/context.js +2 -0
  6. package/dist/esm/helpers/authenticator/context.js.map +1 -0
  7. package/dist/esm/helpers/authenticator/facade.js +2 -0
  8. package/dist/esm/helpers/authenticator/facade.js.map +1 -0
  9. package/dist/esm/helpers/authenticator/form.js +2 -0
  10. package/dist/esm/helpers/authenticator/form.js.map +1 -0
  11. package/dist/esm/helpers/authenticator/formFields/defaults.js +2 -0
  12. package/dist/esm/helpers/authenticator/formFields/defaults.js.map +1 -0
  13. package/dist/esm/helpers/authenticator/formFields/formFields.js +2 -0
  14. package/dist/esm/helpers/authenticator/formFields/formFields.js.map +1 -0
  15. package/dist/esm/helpers/authenticator/formFields/util.js +2 -0
  16. package/dist/esm/helpers/authenticator/formFields/util.js.map +1 -0
  17. package/dist/esm/helpers/authenticator/utils.js +2 -0
  18. package/dist/esm/helpers/authenticator/utils.js.map +1 -0
  19. package/dist/esm/i18n/country-dial-codes.js +2 -0
  20. package/dist/esm/i18n/country-dial-codes.js.map +1 -0
  21. package/dist/esm/i18n/dictionaries/authenticator/de.js +2 -0
  22. package/dist/esm/i18n/dictionaries/authenticator/de.js.map +1 -0
  23. package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.js +2 -0
  24. package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.js.map +1 -0
  25. package/dist/esm/i18n/dictionaries/authenticator/en.js +2 -0
  26. package/dist/esm/i18n/dictionaries/authenticator/en.js.map +1 -0
  27. package/dist/esm/i18n/dictionaries/authenticator/es.js +2 -0
  28. package/dist/esm/i18n/dictionaries/authenticator/es.js.map +1 -0
  29. package/dist/esm/i18n/dictionaries/authenticator/fr.js +2 -0
  30. package/dist/esm/i18n/dictionaries/authenticator/fr.js.map +1 -0
  31. package/dist/esm/i18n/dictionaries/authenticator/id.js +2 -0
  32. package/dist/esm/i18n/dictionaries/authenticator/id.js.map +1 -0
  33. package/dist/esm/i18n/dictionaries/authenticator/it.js +2 -0
  34. package/dist/esm/i18n/dictionaries/authenticator/it.js.map +1 -0
  35. package/dist/esm/i18n/dictionaries/authenticator/ja.js +2 -0
  36. package/dist/esm/i18n/dictionaries/authenticator/ja.js.map +1 -0
  37. package/dist/esm/i18n/dictionaries/authenticator/kr.js +2 -0
  38. package/dist/esm/i18n/dictionaries/authenticator/kr.js.map +1 -0
  39. package/dist/esm/i18n/dictionaries/authenticator/nl.js +2 -0
  40. package/dist/esm/i18n/dictionaries/authenticator/nl.js.map +1 -0
  41. package/dist/esm/i18n/dictionaries/authenticator/pl.js +2 -0
  42. package/dist/esm/i18n/dictionaries/authenticator/pl.js.map +1 -0
  43. package/dist/esm/i18n/dictionaries/authenticator/pt.js +2 -0
  44. package/dist/esm/i18n/dictionaries/authenticator/pt.js.map +1 -0
  45. package/dist/esm/i18n/dictionaries/authenticator/sv.js +2 -0
  46. package/dist/esm/i18n/dictionaries/authenticator/sv.js.map +1 -0
  47. package/dist/esm/i18n/dictionaries/authenticator/tr.js +2 -0
  48. package/dist/esm/i18n/dictionaries/authenticator/tr.js.map +1 -0
  49. package/dist/esm/i18n/dictionaries/authenticator/zh.js +2 -0
  50. package/dist/esm/i18n/dictionaries/authenticator/zh.js.map +1 -0
  51. package/dist/esm/i18n/dictionaries/index.js +2 -0
  52. package/dist/esm/i18n/dictionaries/index.js.map +1 -0
  53. package/dist/esm/i18n/translations.js +2 -0
  54. package/dist/esm/i18n/translations.js.map +1 -0
  55. package/dist/esm/index.js +2 -37
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/esm/machines/authenticator/actions.js +2 -0
  58. package/dist/esm/machines/authenticator/actions.js.map +1 -0
  59. package/dist/esm/machines/authenticator/actors/resetPassword.js +2 -0
  60. package/dist/esm/machines/authenticator/actors/resetPassword.js.map +1 -0
  61. package/dist/esm/machines/authenticator/actors/signIn.js +2 -0
  62. package/dist/esm/machines/authenticator/actors/signIn.js.map +1 -0
  63. package/dist/esm/machines/authenticator/actors/signOut.js +2 -0
  64. package/dist/esm/machines/authenticator/actors/signOut.js.map +1 -0
  65. package/dist/esm/machines/authenticator/defaultServices.js +2 -0
  66. package/dist/esm/machines/authenticator/defaultServices.js.map +1 -0
  67. package/dist/esm/machines/authenticator/index.js +2 -0
  68. package/dist/esm/machines/authenticator/index.js.map +1 -0
  69. package/dist/esm/machines/authenticator/signUp.js +2 -0
  70. package/dist/esm/machines/authenticator/signUp.js.map +1 -0
  71. package/dist/esm/node_modules/tslib/tslib.es6.js +16 -0
  72. package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -0
  73. package/dist/esm/theme/baseTheme.js +2 -0
  74. package/dist/esm/theme/baseTheme.js.map +1 -0
  75. package/dist/esm/theme/breakpoints.js +2 -0
  76. package/dist/esm/theme/breakpoints.js.map +1 -0
  77. package/dist/esm/theme/createTheme.js +2 -0
  78. package/dist/esm/theme/createTheme.js.map +1 -0
  79. package/dist/esm/theme/index.js +2 -0
  80. package/dist/esm/theme/index.js.map +1 -0
  81. package/dist/esm/theme/tokens/borderWidths.js +2 -0
  82. package/dist/esm/theme/tokens/borderWidths.js.map +1 -0
  83. package/dist/esm/theme/tokens/colors.js +2 -0
  84. package/dist/esm/theme/tokens/colors.js.map +1 -0
  85. package/dist/esm/theme/tokens/components/alert.js +2 -0
  86. package/dist/esm/theme/tokens/components/alert.js.map +1 -0
  87. package/dist/esm/theme/tokens/components/authenticator.js +2 -0
  88. package/dist/esm/theme/tokens/components/authenticator.js.map +1 -0
  89. package/dist/esm/theme/tokens/components/badge.js +2 -0
  90. package/dist/esm/theme/tokens/components/badge.js.map +1 -0
  91. package/dist/esm/theme/tokens/components/button.js +2 -0
  92. package/dist/esm/theme/tokens/components/button.js.map +1 -0
  93. package/dist/esm/theme/tokens/components/card.js +2 -0
  94. package/dist/esm/theme/tokens/components/card.js.map +1 -0
  95. package/dist/esm/theme/tokens/components/checkbox.js +2 -0
  96. package/dist/esm/theme/tokens/components/checkbox.js.map +1 -0
  97. package/dist/esm/theme/tokens/components/checkboxField.js +2 -0
  98. package/dist/esm/theme/tokens/components/checkboxField.js.map +1 -0
  99. package/dist/esm/theme/tokens/components/copy.js +2 -0
  100. package/dist/esm/theme/tokens/components/copy.js.map +1 -0
  101. package/dist/esm/theme/tokens/components/countryCodeSelect.js +2 -0
  102. package/dist/esm/theme/tokens/components/countryCodeSelect.js.map +1 -0
  103. package/dist/esm/theme/tokens/components/divider.js +2 -0
  104. package/dist/esm/theme/tokens/components/divider.js.map +1 -0
  105. package/dist/esm/theme/tokens/components/expander.js +2 -0
  106. package/dist/esm/theme/tokens/components/expander.js.map +1 -0
  107. package/dist/esm/theme/tokens/components/field.js +2 -0
  108. package/dist/esm/theme/tokens/components/field.js.map +1 -0
  109. package/dist/esm/theme/tokens/components/fieldControl.js +2 -0
  110. package/dist/esm/theme/tokens/components/fieldControl.js.map +1 -0
  111. package/dist/esm/theme/tokens/components/fieldGroup.js +2 -0
  112. package/dist/esm/theme/tokens/components/fieldGroup.js.map +1 -0
  113. package/dist/esm/theme/tokens/components/fieldMessages.js +2 -0
  114. package/dist/esm/theme/tokens/components/fieldMessages.js.map +1 -0
  115. package/dist/esm/theme/tokens/components/flex.js +2 -0
  116. package/dist/esm/theme/tokens/components/flex.js.map +1 -0
  117. package/dist/esm/theme/tokens/components/heading.js +2 -0
  118. package/dist/esm/theme/tokens/components/heading.js.map +1 -0
  119. package/dist/esm/theme/tokens/components/icon.js +2 -0
  120. package/dist/esm/theme/tokens/components/icon.js.map +1 -0
  121. package/dist/esm/theme/tokens/components/image.js +2 -0
  122. package/dist/esm/theme/tokens/components/image.js.map +1 -0
  123. package/dist/esm/theme/tokens/components/index.js +2 -0
  124. package/dist/esm/theme/tokens/components/index.js.map +1 -0
  125. package/dist/esm/theme/tokens/components/link.js +2 -0
  126. package/dist/esm/theme/tokens/components/link.js.map +1 -0
  127. package/dist/esm/theme/tokens/components/loader.js +2 -0
  128. package/dist/esm/theme/tokens/components/loader.js.map +1 -0
  129. package/dist/esm/theme/tokens/components/menu.js +2 -0
  130. package/dist/esm/theme/tokens/components/menu.js.map +1 -0
  131. package/dist/esm/theme/tokens/components/pagination.js +2 -0
  132. package/dist/esm/theme/tokens/components/pagination.js.map +1 -0
  133. package/dist/esm/theme/tokens/components/phoneNumberField.js +2 -0
  134. package/dist/esm/theme/tokens/components/phoneNumberField.js.map +1 -0
  135. package/dist/esm/theme/tokens/components/placeholder.js +2 -0
  136. package/dist/esm/theme/tokens/components/placeholder.js.map +1 -0
  137. package/dist/esm/theme/tokens/components/radio.js +2 -0
  138. package/dist/esm/theme/tokens/components/radio.js.map +1 -0
  139. package/dist/esm/theme/tokens/components/rating.js +2 -0
  140. package/dist/esm/theme/tokens/components/rating.js.map +1 -0
  141. package/dist/esm/theme/tokens/components/select.js +2 -0
  142. package/dist/esm/theme/tokens/components/select.js.map +1 -0
  143. package/dist/esm/theme/tokens/components/selectField.js +2 -0
  144. package/dist/esm/theme/tokens/components/selectField.js.map +1 -0
  145. package/dist/esm/theme/tokens/components/sliderField.js +2 -0
  146. package/dist/esm/theme/tokens/components/sliderField.js.map +1 -0
  147. package/dist/esm/theme/tokens/components/stepperField.js +2 -0
  148. package/dist/esm/theme/tokens/components/stepperField.js.map +1 -0
  149. package/dist/esm/theme/tokens/components/switchField.js +2 -0
  150. package/dist/esm/theme/tokens/components/switchField.js.map +1 -0
  151. package/dist/esm/theme/tokens/components/table.js +2 -0
  152. package/dist/esm/theme/tokens/components/table.js.map +1 -0
  153. package/dist/esm/theme/tokens/components/tabs.js +2 -0
  154. package/dist/esm/theme/tokens/components/tabs.js.map +1 -0
  155. package/dist/esm/theme/tokens/components/text.js +2 -0
  156. package/dist/esm/theme/tokens/components/text.js.map +1 -0
  157. package/dist/esm/theme/tokens/components/toggleButton.js +2 -0
  158. package/dist/esm/theme/tokens/components/toggleButton.js.map +1 -0
  159. package/dist/esm/theme/tokens/components/toggleButtonGroup.js +2 -0
  160. package/dist/esm/theme/tokens/components/toggleButtonGroup.js.map +1 -0
  161. package/dist/esm/theme/tokens/fontSizes.js +2 -0
  162. package/dist/esm/theme/tokens/fontSizes.js.map +1 -0
  163. package/dist/esm/theme/tokens/fontWeights.js +2 -0
  164. package/dist/esm/theme/tokens/fontWeights.js.map +1 -0
  165. package/dist/esm/theme/tokens/fonts.js +2 -0
  166. package/dist/esm/theme/tokens/fonts.js.map +1 -0
  167. package/dist/esm/theme/tokens/index.js +2 -0
  168. package/dist/esm/theme/tokens/index.js.map +1 -0
  169. package/dist/esm/theme/tokens/lineHeights.js +2 -0
  170. package/dist/esm/theme/tokens/lineHeights.js.map +1 -0
  171. package/dist/esm/theme/tokens/opacities.js +2 -0
  172. package/dist/esm/theme/tokens/opacities.js.map +1 -0
  173. package/dist/esm/theme/tokens/outlineOffsets.js +2 -0
  174. package/dist/esm/theme/tokens/outlineOffsets.js.map +1 -0
  175. package/dist/esm/theme/tokens/outlineWidths.js +2 -0
  176. package/dist/esm/theme/tokens/outlineWidths.js.map +1 -0
  177. package/dist/esm/theme/tokens/radii.js +2 -0
  178. package/dist/esm/theme/tokens/radii.js.map +1 -0
  179. package/dist/esm/theme/tokens/shadows.js +2 -0
  180. package/dist/esm/theme/tokens/shadows.js.map +1 -0
  181. package/dist/esm/theme/tokens/space.js +2 -0
  182. package/dist/esm/theme/tokens/space.js.map +1 -0
  183. package/dist/esm/theme/tokens/time.js +2 -0
  184. package/dist/esm/theme/tokens/time.js.map +1 -0
  185. package/dist/esm/theme/tokens/transforms.js +2 -0
  186. package/dist/esm/theme/tokens/transforms.js.map +1 -0
  187. package/dist/esm/theme/tokens/types/designToken.js +2 -0
  188. package/dist/esm/theme/tokens/types/designToken.js.map +1 -0
  189. package/dist/esm/theme/utils.js +2 -0
  190. package/dist/esm/theme/utils.js.map +1 -0
  191. package/dist/esm/types/authenticator/attributes.js +2 -0
  192. package/dist/esm/types/authenticator/attributes.js.map +1 -0
  193. package/dist/esm/types/authenticator/user.js +2 -0
  194. package/dist/esm/types/authenticator/user.js.map +1 -0
  195. package/dist/esm/validators/index.js +2 -0
  196. package/dist/esm/validators/index.js.map +1 -0
  197. package/dist/index.js +17 -37
  198. package/dist/index.js.map +1 -1
  199. package/dist/styles.css +1 -6
  200. package/dist/theme.css +1 -1
  201. package/dist/types/helpers/authenticator/actor.d.ts +15 -0
  202. package/dist/types/helpers/authenticator/constants.d.ts +5 -0
  203. package/dist/types/helpers/authenticator/context.d.ts +10 -0
  204. package/dist/types/helpers/authenticator/facade.d.ts +66 -0
  205. package/dist/types/helpers/authenticator/form.d.ts +7 -0
  206. package/dist/types/helpers/authenticator/formFields/defaults.d.ts +3 -0
  207. package/dist/types/helpers/authenticator/formFields/formFields.d.ts +11 -0
  208. package/dist/types/helpers/authenticator/formFields/index.d.ts +3 -0
  209. package/dist/types/helpers/authenticator/formFields/util.d.ts +7 -0
  210. package/dist/types/helpers/authenticator/index.d.ts +7 -0
  211. package/dist/types/helpers/authenticator/utils.d.ts +16 -0
  212. package/dist/types/helpers/index.d.ts +1 -0
  213. package/dist/types/i18n/country-dial-codes.d.ts +1 -0
  214. package/dist/types/i18n/dictionaries/authenticator/de.d.ts +56 -0
  215. package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +58 -0
  216. package/dist/types/i18n/dictionaries/authenticator/en.d.ts +50 -0
  217. package/dist/types/i18n/dictionaries/authenticator/es.d.ts +55 -0
  218. package/dist/types/i18n/dictionaries/authenticator/fr.d.ts +65 -0
  219. package/dist/types/i18n/dictionaries/authenticator/id.d.ts +78 -0
  220. package/dist/types/i18n/dictionaries/authenticator/index.d.ts +15 -0
  221. package/dist/types/i18n/dictionaries/authenticator/it.d.ts +49 -0
  222. package/dist/types/i18n/dictionaries/authenticator/ja.d.ts +52 -0
  223. package/dist/types/i18n/dictionaries/authenticator/kr.d.ts +56 -0
  224. package/dist/types/i18n/dictionaries/authenticator/nl.d.ts +50 -0
  225. package/dist/types/i18n/dictionaries/authenticator/pl.d.ts +57 -0
  226. package/dist/types/i18n/dictionaries/authenticator/pt.d.ts +50 -0
  227. package/dist/types/i18n/dictionaries/authenticator/sv.d.ts +51 -0
  228. package/dist/types/i18n/dictionaries/authenticator/tr.d.ts +65 -0
  229. package/dist/types/i18n/dictionaries/authenticator/zh.d.ts +32 -0
  230. package/dist/types/i18n/dictionaries/index.d.ts +824 -0
  231. package/dist/types/i18n/index.d.ts +2 -0
  232. package/dist/types/i18n/translations.d.ts +93 -0
  233. package/dist/types/index.d.ts +5 -0
  234. package/dist/types/machines/authenticator/actions.d.ts +60 -0
  235. package/dist/types/machines/authenticator/actors/index.d.ts +3 -0
  236. package/dist/types/machines/authenticator/actors/resetPassword.d.ts +29 -0
  237. package/dist/types/machines/authenticator/actors/signIn.d.ts +29 -0
  238. package/dist/types/machines/authenticator/actors/signOut.d.ts +25 -0
  239. package/dist/types/machines/authenticator/defaultServices.d.ts +29 -0
  240. package/dist/types/machines/authenticator/index.d.ts +28 -0
  241. package/dist/types/machines/authenticator/signUp.d.ts +29 -0
  242. package/dist/types/machines/index.d.ts +1 -0
  243. package/dist/types/theme/baseTheme.d.ts +2 -0
  244. package/dist/types/theme/breakpoints.d.ts +12 -0
  245. package/dist/types/theme/createTheme.d.ts +9 -0
  246. package/dist/types/theme/index.d.ts +4 -0
  247. package/dist/types/theme/tokens/borderWidths.d.ts +19 -0
  248. package/dist/types/theme/tokens/colors.d.ts +76 -0
  249. package/dist/types/theme/tokens/components/alert.d.ts +65 -0
  250. package/dist/types/theme/tokens/components/authenticator.d.ts +71 -0
  251. package/dist/types/theme/tokens/components/badge.d.ts +83 -0
  252. package/dist/types/theme/tokens/components/button.d.ts +328 -0
  253. package/dist/types/theme/tokens/components/card.d.ts +63 -0
  254. package/dist/types/theme/tokens/components/checkbox.d.ts +140 -0
  255. package/dist/types/theme/tokens/components/checkboxField.d.ts +14 -0
  256. package/dist/types/theme/tokens/components/copy.d.ts +26 -0
  257. package/dist/types/theme/tokens/components/countryCodeSelect.d.ts +5 -0
  258. package/dist/types/theme/tokens/components/divider.d.ts +38 -0
  259. package/dist/types/theme/tokens/components/expander.d.ts +135 -0
  260. package/dist/types/theme/tokens/components/field.d.ts +29 -0
  261. package/dist/types/theme/tokens/components/fieldControl.d.ts +174 -0
  262. package/dist/types/theme/tokens/components/fieldGroup.d.ts +15 -0
  263. package/dist/types/theme/tokens/components/fieldMessages.d.ts +21 -0
  264. package/dist/types/theme/tokens/components/flex.d.ts +17 -0
  265. package/dist/types/theme/tokens/components/heading.d.ts +56 -0
  266. package/dist/types/theme/tokens/components/icon.d.ts +8 -0
  267. package/dist/types/theme/tokens/components/image.d.ts +14 -0
  268. package/dist/types/theme/tokens/components/index.d.ts +2479 -0
  269. package/dist/types/theme/tokens/components/link.d.ts +35 -0
  270. package/dist/types/theme/tokens/components/loader.d.ts +78 -0
  271. package/dist/types/theme/tokens/components/menu.d.ts +59 -0
  272. package/dist/types/theme/tokens/components/pagination.d.ts +82 -0
  273. package/dist/types/theme/tokens/components/phoneNumberField.d.ts +1 -0
  274. package/dist/types/theme/tokens/components/placeholder.d.ts +29 -0
  275. package/dist/types/theme/tokens/components/radio.d.ts +131 -0
  276. package/dist/types/theme/tokens/components/rating.d.ts +27 -0
  277. package/dist/types/theme/tokens/components/select.d.ts +60 -0
  278. package/dist/types/theme/tokens/components/selectField.d.ts +5 -0
  279. package/dist/types/theme/tokens/components/sliderField.d.ts +118 -0
  280. package/dist/types/theme/tokens/components/stepperField.d.ts +10 -0
  281. package/dist/types/theme/tokens/components/switchField.d.ts +78 -0
  282. package/dist/types/theme/tokens/components/table.d.ts +197 -0
  283. package/dist/types/theme/tokens/components/tabs.d.ts +84 -0
  284. package/dist/types/theme/tokens/components/text.d.ts +40 -0
  285. package/dist/types/theme/tokens/components/toggleButton.d.ts +154 -0
  286. package/dist/types/theme/tokens/components/toggleButtonGroup.d.ts +11 -0
  287. package/dist/types/theme/tokens/fontSizes.d.ts +17 -0
  288. package/dist/types/theme/tokens/fontWeights.d.ts +16 -0
  289. package/dist/types/theme/tokens/fonts.d.ts +13 -0
  290. package/dist/types/theme/tokens/index.d.ts +52 -0
  291. package/dist/types/theme/tokens/lineHeights.d.ts +10 -0
  292. package/dist/types/theme/tokens/opacities.d.ts +18 -0
  293. package/dist/types/theme/tokens/outlineOffsets.d.ts +10 -0
  294. package/dist/types/theme/tokens/outlineWidths.d.ts +10 -0
  295. package/dist/types/theme/tokens/radii.d.ts +14 -0
  296. package/dist/types/theme/tokens/shadows.d.ts +10 -0
  297. package/dist/types/theme/tokens/space.d.ts +27 -0
  298. package/dist/types/theme/tokens/time.d.ts +10 -0
  299. package/dist/types/theme/tokens/transforms.d.ts +14 -0
  300. package/dist/types/theme/tokens/types/designToken.d.ts +56 -0
  301. package/dist/types/theme/tokens/types/scales.d.ts +12 -0
  302. package/dist/types/theme/types.d.ts +110 -0
  303. package/dist/types/theme/utils.d.ts +8 -0
  304. package/dist/types/types/authenticator/attributes.d.ts +21 -0
  305. package/dist/types/types/authenticator/form.d.ts +61 -0
  306. package/dist/types/types/authenticator/index.d.ts +5 -0
  307. package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +15 -0
  308. package/dist/types/types/authenticator/stateMachine/context.d.ts +101 -0
  309. package/dist/types/types/authenticator/stateMachine/event.d.ts +17 -0
  310. package/dist/types/types/authenticator/stateMachine/index.d.ts +4 -0
  311. package/dist/types/types/authenticator/stateMachine/state.d.ts +10 -0
  312. package/dist/types/types/authenticator/user.d.ts +29 -0
  313. package/dist/types/types/authenticator/validator.d.ts +17 -0
  314. package/dist/types/types/index.d.ts +2 -0
  315. package/dist/types/types/util.d.ts +1 -0
  316. package/dist/types/validators/index.d.ts +2 -0
  317. package/package.json +17 -6
  318. package/dist/index.d.ts +0 -1006
package/dist/index.d.ts DELETED
@@ -1,1006 +0,0 @@
1
- import * as amazon_cognito_identity_js from 'amazon-cognito-identity-js';
2
- import { CognitoUser, CodeDeliveryDetails } from 'amazon-cognito-identity-js';
3
- import * as xstate from 'xstate';
4
- import { Interpreter, State, Sender } from 'xstate';
5
- import { PartialDeep } from 'type-fest';
6
-
7
- /**
8
- * Map of each input name to its value
9
- */
10
- declare type AuthFormData = Record<string, string>;
11
- /**
12
- * List of routes that support custom formFields
13
- */
14
- declare type FormFieldComponents = 'signIn' | 'signUp' | 'forceNewPassword' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'resetPassword' | 'setupTOTP';
15
- /**
16
- * Used to customize form field attributes for each authenticator screen.
17
- */
18
- declare type FormFields = {
19
- [key in FormFieldComponents]?: FormField;
20
- };
21
- /**
22
- * Override option for each screen. Maps each input to override options.
23
- */
24
- interface FormField {
25
- [key: string]: FormFieldOptions;
26
- }
27
- /**
28
- * Override options for each field
29
- */
30
- interface FormFieldOptions {
31
- /** Will hide the label above the input if set to true */
32
- labelHidden?: boolean;
33
- /** Label text */
34
- label?: string;
35
- /** Placeholder text */
36
- placeholder?: string;
37
- /**
38
- * @deprecated For internal use only, please use `isRequired` instead.
39
- */
40
- required?: boolean;
41
- /** Whether this field is required for submission */
42
- isRequired?: boolean;
43
- /** Default dial code value */
44
- dialCode?: string;
45
- /** TOTP issuer to be used in the QR setup */
46
- totpIssuer?: string;
47
- /** TOTP username to be used in the QR */
48
- totpUsername?: string;
49
- /** List of dial codes you want to show in phone number field */
50
- dialCodeList?: Array<string>;
51
- /** Integer that denotes where this field should be positioned in. */
52
- order?: number;
53
- }
54
- declare type PasswordPolicyRules = 'REQUIRES_LOWERCASE' | 'REQUIRES_NUMBERS' | 'REQUIRES_SYMBOLS' | 'REQUIRES_UPPERCASE';
55
- interface PasswordSettings {
56
- passwordPolicyMinLength: number;
57
- passwordPolicyCharacters: Array<PasswordPolicyRules>;
58
- }
59
-
60
- /** Enum of known challenge names */
61
- declare enum AuthChallengeNames {
62
- SMS_MFA = "SMS_MFA",
63
- SOFTWARE_TOKEN_MFA = "SOFTWARE_TOKEN_MFA",
64
- NEW_PASSWORD_REQUIRED = "NEW_PASSWORD_REQUIRED",
65
- RESET_REQUIRED = "RESET_REQUIRED",
66
- MFA_SETUP = "MFA_SETUP"
67
- }
68
- /** Contact destinations that we can send user confirmation code to */
69
- declare type ContactMethod = 'Email' | 'Phone Number';
70
- /** Federated IDPs that Authenticator supports */
71
- declare enum FederatedIdentityProviders {
72
- Apple = "SignInWithApple",
73
- Amazon = "LoginWithAmazon",
74
- Facebook = "Facebook",
75
- Google = "Google"
76
- }
77
- /** Known cognito user attributes */
78
- interface CognitoAttributes {
79
- email: string;
80
- phone_number: string;
81
- [key: string]: string;
82
- }
83
- /** Cognito User Interface */
84
- interface CognitoUserAmplify extends CognitoUser {
85
- username?: string;
86
- attributes?: CognitoAttributes;
87
- }
88
-
89
- /**
90
- * Maps each input to its validation error, if any
91
- */
92
- declare type ValidationError = Record<string, string | string[]>;
93
- /**
94
- * Return type of validator. This is `null` if there are no error, and `ValidationError` otherwise.
95
- */
96
- declare type ValidatorResult = void | null | ValidationError;
97
- declare type SignInResult = string;
98
- /**
99
- * Validates the given formData. This can be synchronous or asynchronous.
100
- */
101
- declare type Validator = (formData: AuthFormData, touchData?: AuthFormData, passwordSettings?: PasswordSettings) => ValidatorResult | Promise<ValidatorResult>;
102
- declare type SignInTypes = (user: string, code: string, mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA) => SignInResult | Promise<SignInResult>;
103
-
104
- /** Array of auth fields that we supply defaults with */
105
- declare const signUpFieldsWithDefault: readonly ["birthdate", "email", "family_name", "given_name", "middle_name", "name", "nickname", "phone_number", "preferred_username", "profile", "website"];
106
- /** Auth fields that we supply defaults with */
107
- declare type SignUpFieldsWithDefaults = typeof signUpFieldsWithDefault[number];
108
- /** Array of auth fields that we do not supply defaults with */
109
- declare const signUpFieldsWithoutDefault: readonly ["address", "gender", "locale", "picture", "updated_at", "zoneinfo"];
110
- /** Auth fields that we do not supply defaults with */
111
- declare type SignUpFieldsWithoutDefaults = typeof signUpFieldsWithoutDefault[number];
112
- /** All known auth fields */
113
- declare type SignUpAttribute = SignUpFieldsWithDefaults | SignUpFieldsWithoutDefaults;
114
- /** Fields that are common in all routes */
115
- declare type CommonFields = 'username' | 'password' | 'confirm_password';
116
- /** Array of known login mechanisms */
117
- declare const LoginMechanismArray: readonly ["username", "email", "phone_number"];
118
- /** Login mechanisms that can be used to sign in */
119
- declare type LoginMechanism = typeof LoginMechanismArray[number];
120
- /** List of social provider Authenticator supports */
121
- declare type SocialProvider = 'amazon' | 'apple' | 'facebook' | 'google';
122
- /** Input fields that we provide default fields with */
123
- declare type AuthFieldsWithDefaults = LoginMechanism | SignUpFieldsWithDefaults | 'confirmation_code' | 'password';
124
- /** Maps default attributes values for an input */
125
- interface InputAttributeDefaults {
126
- label: string;
127
- type: string;
128
- placeholder: string;
129
- autocomplete?: string;
130
- }
131
- /** Maps default attribute values for each Auth Field */
132
- declare type AuthInputAttributes = Record<AuthFieldsWithDefaults, InputAttributeDefaults>;
133
-
134
- declare const defaultServices: {
135
- getAmplifyConfig(): Promise<{}>;
136
- getCurrentUser(): Promise<any>;
137
- handleSignUp(formData: any): Promise<any>;
138
- handleSignIn({ username, password, }: {
139
- username: string;
140
- password: string;
141
- }): Promise<any>;
142
- handleConfirmSignIn({ user, code, mfaType, }: {
143
- user: any;
144
- code: string;
145
- mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
146
- }): Promise<any>;
147
- handleConfirmSignUp({ username, code, }: {
148
- username: string;
149
- code: string;
150
- }): Promise<any>;
151
- handleForgotPasswordSubmit({ username, code, password, }: {
152
- username: string;
153
- code: string;
154
- password: string;
155
- }): Promise<SignInResult>;
156
- handleForgotPassword(formData: any): Promise<any>;
157
- validateCustomSignUp(formData: any, touchData: any): Promise<ValidatorResult>;
158
- validateFormPassword<Validator>(formData: any, touchData: any, passwordSettings: PasswordSettings): Promise<ValidatorResult>;
159
- validateConfirmPassword<Validator_1>(formData: any, touchData: any): Promise<ValidatorResult>;
160
- validatePreferredUsername(formData: any, touchData: any): Promise<ValidatorResult>;
161
- };
162
-
163
- /**
164
- * Data that actor returns when they are done and reach the final state
165
- */
166
- interface ActorDoneData {
167
- /** Any auth form values that needs to be persisted between the actors */
168
- authAttributes?: AuthFormData;
169
- /** String that indicates where authMachine should next transition to */
170
- intent?: string;
171
- /** User returned by the actor it's done */
172
- user?: CognitoUserAmplify;
173
- }
174
- /**
175
- * Context interface for the top-level machine
176
- */
177
- interface AuthContext {
178
- /** Reference to the spawned actor */
179
- actorRef?: any;
180
- config?: {
181
- loginMechanisms?: LoginMechanism[];
182
- signUpAttributes?: SignUpAttribute[];
183
- socialProviders?: SocialProvider[];
184
- formFields?: FormFields;
185
- initialState?: 'signIn' | 'signUp' | 'resetPassword';
186
- passwordSettings?: PasswordSettings;
187
- };
188
- services?: Partial<typeof defaultServices>;
189
- user?: CognitoUserAmplify;
190
- username?: string;
191
- password?: string;
192
- code?: string;
193
- mfaType?: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
194
- actorDoneData?: Omit<ActorDoneData, 'user'>;
195
- }
196
- /**
197
- * Base context for all actors that have auth forms associated
198
- */
199
- interface BaseFormContext {
200
- /** Any user attributes set that needs to persist between states */
201
- authAttributes?: Record<string, any>;
202
- /** Current challengeName issued by Cognnito */
203
- challengeName?: string;
204
- /** Required attributes for form submission */
205
- requiredAttributes?: Array<string>;
206
- /** Maps each input name to tis value */
207
- formValues?: AuthFormData;
208
- /** Input (names) that has been blurred at least ones */
209
- touched?: AuthFormData;
210
- /** String that indicates where authMachine should next transition to */
211
- intent?: string;
212
- /** Error returned from remote service / API */
213
- remoteError?: string;
214
- /** Current user inteface the actor is working with */
215
- user?: CognitoUserAmplify;
216
- /** Maps each input to its validation error, if any */
217
- validationError?: ValidationError;
218
- /** Maps each password validation rule */
219
- passwordSettings?: PasswordSettings;
220
- /** Denotes where a confirmation code has been sent to */
221
- codeDeliveryDetails?: CodeDeliveryDetails;
222
- /** Default country code for all phone number fields. */
223
- country_code?: string;
224
- }
225
- interface SignInContext extends BaseFormContext {
226
- loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
227
- socialProviders: Required<AuthContext>['config']['socialProviders'];
228
- formFields?: FormFields;
229
- attributeToVerify?: string;
230
- redirectIntent?: string;
231
- unverifiedAttributes?: Record<string, string>;
232
- }
233
- interface SignUpContext extends BaseFormContext {
234
- loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
235
- socialProviders: Required<AuthContext>['config']['socialProviders'];
236
- formFields: FormFields;
237
- unverifiedAttributes?: Record<string, string>;
238
- }
239
- interface ResetPasswordContext extends BaseFormContext {
240
- username?: string;
241
- unverifiedAttributes?: Record<string, string>;
242
- formFields?: FormFields;
243
- }
244
- interface SignOutContext {
245
- authAttributes?: Record<string, any>;
246
- challengeName?: string;
247
- unverifiedAttributes?: Record<string, string>;
248
- user?: CognitoUserAmplify;
249
- formFields?: FormFields;
250
- }
251
- /**
252
- * Context for actors that have forms
253
- */
254
- declare type ActorContextWithForms = SignInContext | SignUpContext | ResetPasswordContext;
255
- declare type AuthActorContext = ActorContextWithForms | SignOutContext;
256
-
257
- /**
258
- * Events that occur when actors are done
259
- */
260
- declare type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.invoke.signUpActor' | 'done.invoke.signOutActor' | 'done.invoke.resetPasswordActor';
261
- /**
262
- * All known explicit events for xstate
263
- */
264
- declare type AuthEventTypes = 'CHANGE' | 'BLUR' | 'FEDERATED_SIGN_IN' | 'RESEND' | 'RESET_PASSWORD' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | InvokeActorEventTypes;
265
- /**
266
- * Data payload for auth events
267
- */
268
- declare type AuthEventData = Record<PropertyKey, any>;
269
- /** Top-level auth machine event interface */
270
- interface AuthEvent {
271
- type: AuthEventTypes;
272
- data?: AuthEventData;
273
- }
274
-
275
- /**
276
- * This files provides types that describe general shape of
277
- * authenticator machine and its intepreter.
278
- */
279
-
280
- /**
281
- * Intefrace for `authMachine` machine interpreter
282
- */
283
- declare type AuthInterpreter = Interpreter<AuthContext, any, AuthEvent>;
284
- /**
285
- * Function type for `send` in `authMachine`
286
- */
287
- declare type AuthMachineSend = AuthInterpreter['send'];
288
-
289
- declare type SignInState = State<SignInContext, AuthEvent>;
290
- declare type SignUpState = State<SignUpContext, AuthEvent>;
291
- declare type SignOutState = State<SignOutContext, AuthEvent>;
292
- declare type ResetPasswordState = State<ResetPasswordContext, AuthEvent>;
293
- declare type AuthActorState = State<AuthActorContext, AuthEvent>;
294
- declare type AuthMachineState = State<AuthContext, AuthEvent>;
295
-
296
- declare type NoInfer<T> = [T][T extends any ? 0 : never];
297
-
298
- /**
299
- * This file contains helpers that lets you easily access current actor's state
300
- * and context.
301
- */
302
-
303
- /**
304
- * Get the state of current actor. This is useful for checking which screen
305
- * to render: e.g. `getActorState(state).matches('confirmSignUp.edit').
306
- */
307
- declare const getActorState: (state: AuthMachineState) => AuthActorState;
308
- /**
309
- * Get the context of current actor. Useful for getting any nested context
310
- * like remoteError.
311
- */
312
- declare const getActorContext: (state: AuthMachineState) => AuthActorContext;
313
-
314
- /**
315
- * Given xstate context from AuthMachine, this returns the input label, type,
316
- * and error attributes of the configured login_mechanisms. An optional "alias"
317
- * may be passed in to get info from context for that specific alias.
318
- */
319
- declare const getAliasInfoFromContext: (context: AuthContext, alias?: LoginMechanism) => {
320
- label: string;
321
- type: string;
322
- error: any;
323
- };
324
- /**
325
- * Given xstate context from AuthMachine, returns the primaryAlias and
326
- * secondaryAliases.
327
- */
328
- declare const getConfiguredAliases: (context: AuthContext) => {
329
- primaryAlias: "email" | "phone_number" | "username";
330
- secondaryAliases: ("email" | "phone_number" | "username")[];
331
- };
332
-
333
- /**
334
- * Creates public facing auth helpers that abstracts out xstate implementation
335
- * detail. Each framework implementation can export these helpers so that
336
- * developers can send events without having to learn internals.
337
- *
338
- * ```
339
- * const [state, send] = useActor(...);
340
- * const { submit } = getSendEventAliases(send);
341
- * submit({ username, password})
342
- * ```
343
- */
344
- declare const getSendEventAliases: (send: Sender<AuthEvent>) => {
345
- readonly resendCode: (data?: AuthEventData) => void;
346
- readonly signOut: (data?: AuthEventData) => void;
347
- readonly submitForm: (data?: AuthEventData) => void;
348
- readonly updateForm: (data?: AuthEventData) => void;
349
- readonly updateBlur: (data?: AuthEventData) => void;
350
- readonly toFederatedSignIn: (data?: AuthEventData) => void;
351
- readonly toResetPassword: (data?: AuthEventData) => void;
352
- readonly toSignIn: (data?: AuthEventData) => void;
353
- readonly toSignUp: (data?: AuthEventData) => void;
354
- readonly skipVerification: (data?: AuthEventData) => void;
355
- };
356
- declare const getServiceContextFacade: (state: AuthMachineState) => {
357
- error: string;
358
- hasValidationErrors: boolean;
359
- isPending: boolean;
360
- route: string;
361
- user: CognitoUserAmplify;
362
- validationErrors: {
363
- [x: string]: string | string[];
364
- };
365
- codeDeliveryDetails: amazon_cognito_identity_js.CodeDeliveryDetails;
366
- };
367
- declare const getServiceFacade: ({ send, state }: {
368
- send: any;
369
- state: any;
370
- }) => {
371
- error: string;
372
- hasValidationErrors: boolean;
373
- isPending: boolean;
374
- route: string;
375
- user: CognitoUserAmplify;
376
- validationErrors: {
377
- [x: string]: string | string[];
378
- };
379
- codeDeliveryDetails: amazon_cognito_identity_js.CodeDeliveryDetails;
380
- resendCode: (data?: AuthEventData) => void;
381
- signOut: (data?: AuthEventData) => void;
382
- submitForm: (data?: AuthEventData) => void;
383
- updateForm: (data?: AuthEventData) => void;
384
- updateBlur: (data?: AuthEventData) => void;
385
- toFederatedSignIn: (data?: AuthEventData) => void;
386
- toResetPassword: (data?: AuthEventData) => void;
387
- toSignIn: (data?: AuthEventData) => void;
388
- toSignUp: (data?: AuthEventData) => void;
389
- skipVerification: (data?: AuthEventData) => void;
390
- };
391
-
392
- /**
393
- * This file contains helpers related to forms and input attributes.
394
- */
395
-
396
- declare const authInputAttributes: AuthInputAttributes;
397
- declare const getFormDataFromEvent: (event: Event) => {
398
- [k: string]: FormDataEntryValue;
399
- };
400
- declare const setFormOrder: (formOverrides: FormField, fieldNames: Array<SignUpAttribute | CommonFields>) => Array<string | number>;
401
-
402
- /**
403
- * This file contains general helpers that state machine or authenticator
404
- * implementations can use.
405
- */
406
-
407
- declare const censorAllButFirstAndLast: (value: string) => string;
408
- declare const censorPhoneNumber: (val: string) => string;
409
- /**
410
- * Listens to external auth Hub events and sends corresponding event to
411
- * the `authService` of interest
412
- *
413
- * @param send - `send` function associated with the `authService` of interest
414
- *
415
- * @returns function that unsubscribes to the hub evenmt
416
- */
417
- declare const listenToAuthHub: (send: AuthMachineSend) => () => void;
418
-
419
- declare const countryDialCodes: string[];
420
-
421
- /**
422
- * Contains translatable strings that authenticator provides by default. Customers
423
- * can use this to add custom vocabularies:
424
- *
425
- * ```
426
- * I18n.putVocabulariesForLanguage("en", {
427
- * [DefaultTexts.SIGN_IN]: "Custom Sign In Text",
428
- * [DefaultTexts.SIGN_IN_BUTTON]: "Custom Click Here to Sign In"
429
- * });
430
- * ```
431
- */
432
- declare const DefaultTexts: {
433
- readonly BACK_SIGN_IN: string;
434
- readonly BIRTHDATE: string;
435
- readonly CHANGE_PASSWORD: string;
436
- readonly CHANGING_PASSWORD: string;
437
- readonly CODE: string;
438
- readonly CONFIRM_PASSWORD: string;
439
- readonly CONFIRM_RESET_PASSWORD_HEADING: string;
440
- readonly CONFIRM_SIGNUP_HEADING: string;
441
- readonly CONFIRM_SMS: string;
442
- readonly CONFIRM_TOTP: string;
443
- readonly CONFIRM: string;
444
- readonly CONFIRMATION_CODE: string;
445
- readonly CONFIRMING: string;
446
- readonly CREATE_ACCOUNT: string;
447
- readonly CREATING_ACCOUNT: string;
448
- readonly EMAIL_ADDRESS: string;
449
- readonly ENTER_CODE: string;
450
- readonly ENTER_USERNAME: string;
451
- readonly FAMILY_NAME: string;
452
- readonly GIVEN_NAME: string;
453
- readonly FORGOT_YOUR_PASSWORD: string;
454
- readonly FORGOT_YOUR_PASSWORD_LEGACY: string;
455
- readonly HIDE_PASSWORD: string;
456
- readonly LOADING: string;
457
- readonly LOGIN_NAME: string;
458
- readonly MIDDLE_NAME: string;
459
- readonly NAME: string;
460
- readonly NICKNAME: string;
461
- readonly NEW_PASSWORD: string;
462
- readonly PASSWORD: string;
463
- readonly PHONE_NUMBER: string;
464
- readonly PREFERRED_USERNAME: string;
465
- readonly PROFILE: string;
466
- readonly RESEND_CODE: string;
467
- readonly RESET_PASSWORD_HEADING: string;
468
- readonly RESET_PASSWORD: string;
469
- readonly SEND_CODE: string;
470
- readonly SENDING: string;
471
- readonly SETUP_TOTP: string;
472
- readonly SHOW_PASSWORD: string;
473
- readonly SIGN_IN_BUTTON: string;
474
- readonly SIGN_IN_TAB: string;
475
- readonly SIGN_IN_WITH_AMAZON: string;
476
- readonly SIGN_IN_WITH_APPLE: string;
477
- readonly SIGN_IN_WITH_FACEBOOK: string;
478
- readonly SIGN_IN_WITH_GOOGLE: string;
479
- readonly SIGN_IN: string;
480
- readonly SIGN_UP_BUTTON: string;
481
- readonly SIGNING_IN_BUTTON: string;
482
- readonly SKIP: string;
483
- readonly SUBMIT: string;
484
- readonly SUBMITTING: string;
485
- readonly VERIFY_CONTACT: string;
486
- readonly VERIFY_HEADING: string;
487
- readonly VERIFY: string;
488
- readonly WEBSITE: string;
489
- };
490
- declare type Phrase = typeof DefaultTexts[keyof typeof DefaultTexts];
491
- /**
492
- * TODO: Translation keys for dictionaries can be inferred from DefaultTexts
493
- * by typing it to Partial<Record<Phrase, string>>.
494
- *
495
- * But this requires error string keys to be standarized as well, and can be a
496
- * limiting factor for custom translation keys. Marking it as TODO until we see
497
- * a reason to strongly type this.
498
- */
499
- declare type Dict = Record<string, string>;
500
- /**
501
- * This helper type checks that given phrase is one of the texts @aws-amplify/ui
502
- * provides by default. This enables vscode autocompletion to help catch typos
503
- * during development.
504
- *
505
- * You can also use translate<string> to handle custom strings or dynamic content.
506
- */
507
- declare function translate<T = Phrase>(phrase: NoInfer<T>): string;
508
- /**
509
- * Whether I18n has a translation entry for given phrase
510
- */
511
- declare function hasTranslation(phrase: string): boolean;
512
- declare const translations: Record<string, Dict>;
513
-
514
- declare type AuthenticatorMachineOptions = AuthContext['config'] & {
515
- services?: AuthContext['services'];
516
- };
517
- declare function createAuthenticatorMachine(): xstate.StateMachine<AuthContext, any, AuthEvent, {
518
- value: any;
519
- context: AuthContext;
520
- }, xstate.ActionObject<AuthContext, AuthEvent>>;
521
-
522
- /**
523
- * Helper function to test if something is a design token or not.
524
- * Used in the React component style props.
525
- *
526
- * @param arg - thing to test if it is a design token or not
527
- * @returns boolean
528
- */
529
- declare function isDesignToken(arg: unknown): arg is WebDesignToken;
530
- /**
531
- *
532
- */
533
- declare type DesignToken<ValueType = any> = {
534
- value: ValueType;
535
- };
536
- /**
537
- * A fully setup design token ready to be used in web platform.
538
- */
539
- declare type WebDesignToken<ValueType = any> = {
540
- /**
541
- * Name of the design token
542
- */
543
- name: string;
544
- /**
545
- * Object path of the design token. Used for constructing the name
546
- */
547
- path: Array<string>;
548
- /**
549
- * Original (unresolved, untransformed) value of the design token
550
- */
551
- original: ValueType;
552
- /**
553
- * The wrapped CSS variable name of this design token, for example
554
- * `var(--amplify-colors-font-primary)`
555
- */
556
- toString(): string;
557
- } & DesignToken<ValueType>;
558
- declare type ColorValue = string;
559
- declare type BorderWidthValue = string;
560
- declare type FontValue = string;
561
- declare type FontSizeValue = string;
562
- declare type FontWeightValue = number;
563
- declare type LineHeightValue = string;
564
- declare type OpacityValue = string;
565
- declare type OutlineOffsetValue = string;
566
- declare type OutlineWidthValue = string;
567
- declare type RadiusValue = string;
568
- declare type ShadowValue = {
569
- offsetX: string;
570
- offsetY: string;
571
- blurRadius: string;
572
- spreadRadius?: string;
573
- color: string;
574
- };
575
- declare type SpaceValue = string;
576
- declare type TimeValue = string;
577
- declare type TransformValue = string;
578
-
579
- declare type BorderWidths = {
580
- /**
581
- * Small border, used for inputs and such
582
- */
583
- small: DesignToken<BorderWidthValue>;
584
- /**
585
- * Medium border, used for
586
- */
587
- medium: DesignToken<BorderWidthValue>;
588
- /**
589
- * Large border
590
- */
591
- large: DesignToken<BorderWidthValue>;
592
- };
593
- declare type WebBorderWidths = {
594
- [Property in keyof BorderWidths]: WebDesignToken<BorderWidthValue>;
595
- };
596
-
597
- interface OrdinalScale<DesignTokenType = DesignToken<ColorValue>> {
598
- primary: DesignTokenType;
599
- secondary: DesignTokenType;
600
- tertiary: DesignTokenType;
601
- }
602
- interface OrdinalVariation<DesignTokenType = DesignToken<ColorValue>> {
603
- info: DesignTokenType;
604
- warning: DesignTokenType;
605
- error: DesignTokenType;
606
- success: DesignTokenType;
607
- }
608
-
609
- declare type ScaleKeys = 10 | 20 | 40 | 60 | 80 | 90 | 100;
610
- declare type OverlayKeys = 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90;
611
- declare type ColorScale<DesignTokenType = DesignToken<ColorValue>> = {
612
- [key in ScaleKeys]: DesignTokenType;
613
- };
614
- declare type OverlayColors<DesignTokenType = DesignToken<ColorValue>> = {
615
- [key in OverlayKeys]: DesignTokenType;
616
- };
617
- declare type FontColors<DesignTokenType = DesignToken<ColorValue>> = {
618
- inverse: DesignTokenType;
619
- interactive: DesignTokenType;
620
- hover: DesignTokenType;
621
- focus: DesignTokenType;
622
- active: DesignTokenType;
623
- disabled: DesignTokenType;
624
- } & OrdinalScale<DesignTokenType> & OrdinalVariation<DesignTokenType>;
625
- declare type BackgroundColors<DesignTokenType = DesignToken<ColorValue>> = {
626
- disabled: DesignTokenType;
627
- } & OrdinalScale<DesignTokenType> & OrdinalVariation<DesignTokenType>;
628
- declare type BorderColors<DesignTokenType = DesignToken<ColorValue>> = {
629
- disabled: DesignTokenType;
630
- focus: DesignTokenType;
631
- error: DesignTokenType;
632
- } & OrdinalScale<DesignTokenType>;
633
- declare type ColorTypes<DesignTokenType = DesignToken<ColorValue>> = {
634
- [key in ScaleKeys]: DesignTokenType;
635
- } | FontColors | BackgroundColors | DesignTokenType | BorderColors;
636
- declare type WebColorTypes = ColorTypes<WebDesignToken<ColorValue>>;
637
- declare type Colors = {
638
- red: ColorScale;
639
- orange: ColorScale;
640
- yellow: ColorScale;
641
- green: ColorScale;
642
- teal: ColorScale;
643
- blue: ColorScale;
644
- purple: ColorScale;
645
- pink: ColorScale;
646
- neutral: ColorScale;
647
- white: DesignToken<ColorValue>;
648
- black: DesignToken<ColorValue>;
649
- font: FontColors;
650
- background: BackgroundColors;
651
- border: BorderColors;
652
- brand: {
653
- primary: ColorScale;
654
- secondary: ColorScale;
655
- };
656
- overlay: OverlayColors;
657
- [key: string]: ColorTypes | Record<string, ColorTypes>;
658
- };
659
- declare type WebColors = {
660
- red: ColorScale<WebDesignToken<ColorValue>>;
661
- orange: ColorScale<WebDesignToken<ColorValue>>;
662
- yellow: ColorScale<WebDesignToken<ColorValue>>;
663
- green: ColorScale<WebDesignToken<ColorValue>>;
664
- teal: ColorScale<WebDesignToken<ColorValue>>;
665
- blue: ColorScale<WebDesignToken<ColorValue>>;
666
- purple: ColorScale<WebDesignToken<ColorValue>>;
667
- pink: ColorScale<WebDesignToken<ColorValue>>;
668
- neutral: ColorScale<WebDesignToken<ColorValue>>;
669
- white: WebDesignToken<ColorValue>;
670
- black: WebDesignToken<ColorValue>;
671
- font: FontColors<WebDesignToken<ColorValue>>;
672
- background: BackgroundColors<WebDesignToken<ColorValue>>;
673
- border: BorderColors<WebDesignToken<ColorValue>>;
674
- brand: {
675
- primary: ColorScale<WebDesignToken<ColorValue>>;
676
- secondary: ColorScale<WebDesignToken<ColorValue>>;
677
- };
678
- overlay: OverlayColors<WebDesignToken<ColorValue>>;
679
- [key: string]: WebColorTypes | Record<string, WebColorTypes>;
680
- };
681
-
682
- declare type Fonts = {
683
- default: {
684
- variable: DesignToken<FontValue>;
685
- static: DesignToken<FontValue>;
686
- };
687
- };
688
- interface WebFonts {
689
- default: {
690
- [Property in keyof Fonts['default']]: WebDesignToken<FontValue>;
691
- };
692
- }
693
-
694
- declare type FontSizes = {
695
- xxxs: DesignToken<FontSizeValue>;
696
- xxs: DesignToken<FontSizeValue>;
697
- xs: DesignToken<FontSizeValue>;
698
- small: DesignToken<FontSizeValue>;
699
- medium: DesignToken<FontSizeValue>;
700
- large: DesignToken<FontSizeValue>;
701
- xl: DesignToken<FontSizeValue>;
702
- xxl: DesignToken<FontSizeValue>;
703
- xxxl: DesignToken<FontSizeValue>;
704
- xxxxl: DesignToken<FontSizeValue>;
705
- };
706
- declare type WebFontSizes = {
707
- [Property in keyof FontSizes]: WebDesignToken<FontSizeValue>;
708
- };
709
-
710
- declare type FontWeights = {
711
- hairline: DesignToken<FontWeightValue>;
712
- thin: DesignToken<FontWeightValue>;
713
- light: DesignToken<FontWeightValue>;
714
- normal: DesignToken<FontWeightValue>;
715
- medium: DesignToken<FontWeightValue>;
716
- semibold: DesignToken<FontWeightValue>;
717
- bold: DesignToken<FontWeightValue>;
718
- extrabold: DesignToken<FontWeightValue>;
719
- black: DesignToken<FontWeightValue>;
720
- };
721
- declare type WebFontWeights = {
722
- [Property in keyof FontWeights]: WebDesignToken<FontWeightValue>;
723
- };
724
-
725
- declare type LineHeights = {
726
- small: DesignToken<LineHeightValue>;
727
- medium: DesignToken<LineHeightValue>;
728
- large: DesignToken<LineHeightValue>;
729
- };
730
- declare type WebLineHeights = {
731
- [Property in keyof LineHeights]: WebDesignToken<LineHeightValue>;
732
- };
733
-
734
- declare type Opacities = {
735
- 0: DesignToken<OpacityValue>;
736
- 10: DesignToken<OpacityValue>;
737
- 20: DesignToken<OpacityValue>;
738
- 30: DesignToken<OpacityValue>;
739
- 40: DesignToken<OpacityValue>;
740
- 50: DesignToken<OpacityValue>;
741
- 60: DesignToken<OpacityValue>;
742
- 70: DesignToken<OpacityValue>;
743
- 80: DesignToken<OpacityValue>;
744
- 90: DesignToken<OpacityValue>;
745
- 100: DesignToken<OpacityValue>;
746
- };
747
- declare type WebOpacities = {
748
- [Property in keyof Opacities]: WebDesignToken<OpacityValue>;
749
- };
750
-
751
- declare type OutlineOffsets = {
752
- small: DesignToken<OutlineOffsetValue>;
753
- medium: DesignToken<OutlineOffsetValue>;
754
- large: DesignToken<OutlineOffsetValue>;
755
- };
756
- declare type WebOutlineOffsets = {
757
- [Property in keyof OutlineOffsets]: WebDesignToken<OutlineOffsetValue>;
758
- };
759
-
760
- declare type OutlineWidths = {
761
- small: DesignToken<OutlineWidthValue>;
762
- medium: DesignToken<OutlineWidthValue>;
763
- large: DesignToken<OutlineWidthValue>;
764
- };
765
- declare type WebOutlineWidths = {
766
- [Property in keyof OutlineWidths]: WebDesignToken<OutlineWidthValue>;
767
- };
768
-
769
- declare type Radii = {
770
- xs: DesignToken<RadiusValue>;
771
- small: DesignToken<RadiusValue>;
772
- medium: DesignToken<RadiusValue>;
773
- large: DesignToken<RadiusValue>;
774
- xl: DesignToken<RadiusValue>;
775
- xxl: DesignToken<RadiusValue>;
776
- xxxl: DesignToken<RadiusValue>;
777
- };
778
- declare type WebRadii = {
779
- [Property in keyof Radii]: WebDesignToken<RadiusValue>;
780
- };
781
-
782
- declare type Shadows = {
783
- small: DesignToken<ShadowValue>;
784
- medium: DesignToken<ShadowValue>;
785
- large: DesignToken<ShadowValue>;
786
- };
787
- declare type WebShadows = {
788
- [Property in keyof Shadows]: WebDesignToken<ShadowValue>;
789
- };
790
-
791
- declare type SpaceSizes = {
792
- xxxs: DesignToken<SpaceValue>;
793
- xxs: DesignToken<SpaceValue>;
794
- xs: DesignToken<SpaceValue>;
795
- small: DesignToken<SpaceValue>;
796
- medium: DesignToken<SpaceValue>;
797
- large: DesignToken<SpaceValue>;
798
- xl: DesignToken<SpaceValue>;
799
- xxl: DesignToken<SpaceValue>;
800
- xxxl: DesignToken<SpaceValue>;
801
- };
802
- declare type Space = SpaceSizes & {
803
- zero: DesignToken<SpaceValue>;
804
- relative: SpaceSizes & {
805
- full: DesignToken<SpaceValue>;
806
- };
807
- };
808
- declare type WebSpace = {
809
- [Property in keyof Omit<Space, 'relative'>]: WebDesignToken<SpaceValue>;
810
- } & {
811
- relative: {
812
- [Property in keyof Space['relative']]: WebDesignToken<SpaceValue>;
813
- };
814
- };
815
-
816
- declare type Time = {
817
- short: DesignToken<TimeValue>;
818
- medium: DesignToken<TimeValue>;
819
- long: DesignToken<TimeValue>;
820
- };
821
- declare type WebTime = {
822
- [Property in keyof Time]: WebDesignToken<TimeValue>;
823
- };
824
-
825
- declare type Transforms = {
826
- slideX: {
827
- small: DesignToken<TransformValue>;
828
- medium: DesignToken<TransformValue>;
829
- large: DesignToken<TransformValue>;
830
- };
831
- };
832
- declare type WebTransforms = {
833
- slideX: {
834
- [Property in keyof Transforms['slideX']]: WebDesignToken<TransformValue>;
835
- };
836
- };
837
-
838
- interface Tokens {
839
- components: any;
840
- borderWidths: BorderWidths;
841
- colors: Colors;
842
- fonts: Fonts;
843
- fontSizes: FontSizes;
844
- fontWeights: FontWeights;
845
- lineHeights: LineHeights;
846
- opacities: Opacities;
847
- outlineOffsets: OutlineOffsets;
848
- outlineWidths: OutlineWidths;
849
- radii: Radii;
850
- shadows: Shadows;
851
- space: Space;
852
- time: Time;
853
- transforms: Transforms;
854
- }
855
- /**
856
- * The fully setup theme tokens. It has the same shape as Tokens
857
- * but each token has added fields.
858
- */
859
- interface WebTokens extends Tokens {
860
- borderWidths: WebBorderWidths;
861
- colors: WebColors;
862
- fonts: WebFonts;
863
- fontSizes: WebFontSizes;
864
- fontWeights: WebFontWeights;
865
- lineHeights: WebLineHeights;
866
- opacities: WebOpacities;
867
- outlineOffsets: WebOutlineOffsets;
868
- outlineWidths: WebOutlineWidths;
869
- radii: WebRadii;
870
- shadows: WebShadows;
871
- space: WebSpace;
872
- time: WebTime;
873
- transform: WebTransforms;
874
- }
875
-
876
- interface Breakpoints {
877
- values: {
878
- base: number;
879
- small: number;
880
- medium: number;
881
- large: number;
882
- xl: number;
883
- xxl: number;
884
- };
885
- defaultBreakpoint: string;
886
- }
887
-
888
- /**
889
- * An override is a set of tokens that override others
890
- * in certain contexts. On Android, these are like resource
891
- * qualifiers. On the web, these are like media queries with
892
- * a set of CSS variables in it. A theme should contain
893
- * everything it needs to render
894
- */
895
- declare type Override = SelectorOverride | MediaQueryOverride | BreakpointOverride | ColorModeOverride;
896
- interface BaseOverride {
897
- tokens?: PartialDeep<Tokens>;
898
- }
899
- /**
900
- * This override takes a breakpoint name and creates a media-query for that
901
- * breakpoint
902
- * ```css
903
- * @media (min-width: 20em) {
904
- * [data-amplify-theme] {
905
- * --amplify-font-size-large: 2rem;
906
- * }
907
- * }
908
- * ```
909
- */
910
- interface BreakpointOverride extends BaseOverride {
911
- breakpoint: keyof Breakpoints['values'];
912
- }
913
- /**
914
- * ```css
915
- * @media (prefers-color-scheme: dark) {
916
- * --amplify-colors-background-primary: black;
917
- * --amplify-colors-font-primary: white;
918
- * }
919
- * ```
920
- */
921
- interface MediaQueryOverride extends BaseOverride {
922
- mediaQuery: string;
923
- }
924
- /**
925
- * ```css
926
- * .disco-theme {
927
- * --amplify-colors-background-primary: pink;
928
- * }
929
- * [data-my-cool-theme] {
930
- * --amplify-colors-font-primary: purple;
931
- * }
932
- * ```
933
- */
934
- interface SelectorOverride extends BaseOverride {
935
- selector: string;
936
- }
937
- declare type ColorMode = 'light' | 'dark';
938
- /**
939
- * This creates a color mode override, where the color mode is 'light' or 'dark'.
940
- * Note: there is no 'system' here.
941
- *
942
- * ```css
943
- * @media(prefers-color-scheme: dark) {
944
- * [data-amplify-color-mode="system"] {
945
- * }
946
- * }
947
- *
948
- * [data-amplify-color-mode="dark"] {
949
- *
950
- * }
951
- * ```
952
- */
953
- interface ColorModeOverride extends BaseOverride {
954
- colorMode: ColorMode;
955
- }
956
- /**
957
- * A Theme just needs a name. This is what a user would generally deal with.
958
- * They can define any tokens or breakpoints they need, but they don't need a
959
- * complete theme with all tokens.
960
- */
961
- interface Theme {
962
- /**
963
- * The name of the theme. This is used to create scoped CSS to allow for
964
- * multiple themes on a page.
965
- */
966
- name: string;
967
- tokens?: PartialDeep<Tokens>;
968
- breakpoints?: PartialDeep<Breakpoints>;
969
- /**
970
- * Overrides allow you to change design tokens in different contexts, like
971
- * light and dark mode. You can also have other media query overrides as well
972
- * as breakpoint overrides which correspond to the Breakpoints on a theme,
973
- * and a generic selector override.
974
- */
975
- overrides?: Array<Override>;
976
- }
977
- /**
978
- * A BaseTheme has all tokens and breakpoints required
979
- */
980
- interface BaseTheme extends Theme {
981
- tokens: Tokens;
982
- breakpoints: Breakpoints;
983
- overrides?: Array<Override>;
984
- }
985
- /**
986
- * WebTheme is a fully built theme that has cssText based
987
- * on the design tokens and all design tokens have added fields
988
- * to be used in Javascript/Typescript.
989
- */
990
- interface WebTheme extends BaseTheme {
991
- tokens: WebTokens;
992
- cssText: string;
993
- }
994
-
995
- /**
996
- * This will be used like `const myTheme = createTheme({})`
997
- * `myTheme` can then be passed to a Provider or the generated CSS
998
- * can be passed to a stylesheet at build-time or run-time.
999
- * const myTheme = createTheme({})
1000
- * const myOtherTheme = createTheme({}, myTheme);
1001
- */
1002
- declare function createTheme(theme?: Theme, baseTheme?: BaseTheme): WebTheme;
1003
-
1004
- declare const defaultTheme: WebTheme;
1005
-
1006
- export { ActorContextWithForms, ActorDoneData, AuthActorContext, AuthActorState, AuthChallengeNames, AuthContext, AuthEvent, AuthEventData, AuthEventTypes, AuthFieldsWithDefaults, AuthFormData, AuthInputAttributes, AuthInterpreter, AuthMachineSend, AuthMachineState, AuthenticatorMachineOptions, BaseTheme, BorderWidthValue, CognitoAttributes, CognitoUserAmplify, ColorModeOverride, ColorValue, CommonFields, ContactMethod, DefaultTexts, DesignToken, Dict, FederatedIdentityProviders, FontSizeValue, FontValue, FontWeightValue, FormField, FormFieldComponents, FormFieldOptions, FormFields, InputAttributeDefaults, InvokeActorEventTypes, LineHeightValue, LoginMechanism, LoginMechanismArray, MediaQueryOverride, NoInfer, OpacityValue, OutlineOffsetValue, OutlineWidthValue, Override, PasswordPolicyRules, PasswordSettings, Phrase, RadiusValue, ResetPasswordContext, ResetPasswordState, SelectorOverride, ShadowValue, SignInContext, SignInResult, SignInState, SignInTypes, SignOutContext, SignOutState, SignUpAttribute, SignUpContext, SignUpFieldsWithDefaults, SignUpFieldsWithoutDefaults, SignUpState, SocialProvider, SpaceValue, Theme, TimeValue, TransformValue, ValidationError, Validator, ValidatorResult, WebDesignToken, WebTheme, authInputAttributes, censorAllButFirstAndLast, censorPhoneNumber, countryDialCodes, createAuthenticatorMachine, createTheme, defaultTheme, getActorContext, getActorState, getAliasInfoFromContext, getConfiguredAliases, getFormDataFromEvent, getSendEventAliases, getServiceContextFacade, getServiceFacade, hasTranslation, isDesignToken, listenToAuthHub, setFormOrder, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };