@aws-amplify/ui 5.8.0 → 6.0.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 (344) hide show
  1. package/dist/esm/helpers/accountSettings/utils.mjs +33 -1
  2. package/dist/esm/helpers/accountSettings/validator.mjs +120 -1
  3. package/dist/esm/helpers/authenticator/actor.mjs +20 -1
  4. package/dist/esm/helpers/authenticator/constants.mjs +144 -1
  5. package/dist/esm/helpers/authenticator/defaultAuthHubHandler.mjs +52 -0
  6. package/dist/esm/helpers/authenticator/facade.mjs +137 -1
  7. package/dist/esm/helpers/authenticator/form.mjs +43 -1
  8. package/dist/esm/helpers/authenticator/formFields/defaults.mjs +132 -1
  9. package/dist/esm/helpers/authenticator/formFields/formFields.mjs +62 -1
  10. package/dist/esm/helpers/authenticator/formFields/utils.mjs +35 -0
  11. package/dist/esm/helpers/authenticator/getRoute.mjs +47 -0
  12. package/dist/esm/helpers/authenticator/textUtil.mjs +112 -1
  13. package/dist/esm/helpers/authenticator/utils.mjs +38 -1
  14. package/dist/esm/helpers/utils.mjs +5 -1
  15. package/dist/esm/i18n/country-dial-codes.mjs +210 -1
  16. package/dist/esm/i18n/dictionaries/authenticator/de.mjs +87 -1
  17. package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.mjs +83 -1
  18. package/dist/esm/i18n/dictionaries/authenticator/en.mjs +74 -1
  19. package/dist/esm/i18n/dictionaries/authenticator/es.mjs +83 -1
  20. package/dist/esm/i18n/dictionaries/authenticator/fr.mjs +92 -1
  21. package/dist/esm/i18n/dictionaries/authenticator/he.mjs +54 -1
  22. package/dist/esm/i18n/dictionaries/authenticator/id.mjs +96 -1
  23. package/dist/esm/i18n/dictionaries/authenticator/it.mjs +82 -1
  24. package/dist/esm/i18n/dictionaries/authenticator/ja.mjs +86 -1
  25. package/dist/esm/i18n/dictionaries/authenticator/kr.mjs +71 -1
  26. package/dist/esm/i18n/dictionaries/authenticator/nb.mjs +95 -1
  27. package/dist/esm/i18n/dictionaries/authenticator/nl.mjs +67 -1
  28. package/dist/esm/i18n/dictionaries/authenticator/pl.mjs +71 -1
  29. package/dist/esm/i18n/dictionaries/authenticator/pt.mjs +61 -1
  30. package/dist/esm/i18n/dictionaries/authenticator/ru.mjs +61 -1
  31. package/dist/esm/i18n/dictionaries/authenticator/sv.mjs +82 -1
  32. package/dist/esm/i18n/dictionaries/authenticator/tr.mjs +76 -1
  33. package/dist/esm/i18n/dictionaries/authenticator/ua.mjs +84 -1
  34. package/dist/esm/i18n/dictionaries/authenticator/zh.mjs +74 -1
  35. package/dist/esm/i18n/dictionaries/index.mjs +47 -1
  36. package/dist/esm/i18n/translations.mjs +67 -1
  37. package/dist/esm/index.mjs +28 -1
  38. package/dist/esm/machines/authenticator/actions.mjs +188 -1
  39. package/dist/esm/machines/authenticator/actors/forgotPassword.mjs +184 -0
  40. package/dist/esm/machines/authenticator/actors/signIn.mjs +328 -1
  41. package/dist/esm/machines/authenticator/actors/signOut.mjs +28 -1
  42. package/dist/esm/machines/authenticator/actors/signUp.mjs +295 -0
  43. package/dist/esm/machines/authenticator/actors/verifyUserAttributes.mjs +106 -0
  44. package/dist/esm/machines/authenticator/defaultServices.mjs +102 -1
  45. package/dist/esm/machines/authenticator/guards.mjs +70 -0
  46. package/dist/esm/machines/authenticator/index.mjs +368 -1
  47. package/dist/esm/machines/authenticator/utils.mjs +71 -0
  48. package/dist/esm/theme/breakpoints.mjs +14 -1
  49. package/dist/esm/theme/createTheme.mjs +156 -1
  50. package/dist/esm/theme/defaultDarkModeOverride.mjs +128 -1
  51. package/dist/esm/theme/defaultTheme.mjs +10 -1
  52. package/dist/esm/theme/tokens/borderWidths.mjs +7 -1
  53. package/dist/esm/theme/tokens/colors.mjs +166 -1
  54. package/dist/esm/theme/tokens/components/accordion.mjs +47 -0
  55. package/dist/esm/theme/tokens/components/alert.mjs +35 -1
  56. package/dist/esm/theme/tokens/components/authenticator.mjs +39 -1
  57. package/dist/esm/theme/tokens/components/autocomplete.mjs +42 -1
  58. package/dist/esm/theme/tokens/components/badge.mjs +44 -1
  59. package/dist/esm/theme/tokens/components/breadcrumbs.mjs +34 -1
  60. package/dist/esm/theme/tokens/components/button.mjs +685 -1
  61. package/dist/esm/theme/tokens/components/card.mjs +27 -1
  62. package/dist/esm/theme/tokens/components/checkbox.mjs +87 -1
  63. package/dist/esm/theme/tokens/components/checkboxField.mjs +8 -1
  64. package/dist/esm/theme/tokens/components/collection.mjs +72 -1
  65. package/dist/esm/theme/tokens/components/copy.mjs +18 -1
  66. package/dist/esm/theme/tokens/components/dialCodeSelect.mjs +7 -1
  67. package/dist/esm/theme/tokens/components/divider.mjs +22 -1
  68. package/dist/esm/theme/tokens/components/dropZone.mjs +46 -1
  69. package/dist/esm/theme/tokens/components/field.mjs +20 -1
  70. package/dist/esm/theme/tokens/components/fieldControl.mjs +131 -1
  71. package/dist/esm/theme/tokens/components/fieldGroup.mjs +11 -1
  72. package/dist/esm/theme/tokens/components/fieldMessages.mjs +13 -1
  73. package/dist/esm/theme/tokens/components/fieldset.mjs +40 -1
  74. package/dist/esm/theme/tokens/components/flex.mjs +9 -1
  75. package/dist/esm/theme/tokens/components/heading.mjs +30 -1
  76. package/dist/esm/theme/tokens/components/highlightMatch.mjs +7 -1
  77. package/dist/esm/theme/tokens/components/icon.mjs +6 -1
  78. package/dist/esm/theme/tokens/components/image.mjs +8 -1
  79. package/dist/esm/theme/tokens/components/inAppMessaging.mjs +23 -1
  80. package/dist/esm/theme/tokens/components/index.mjs +111 -1
  81. package/dist/esm/theme/tokens/components/input.mjs +12 -1
  82. package/dist/esm/theme/tokens/components/link.mjs +9 -1
  83. package/dist/esm/theme/tokens/components/liveness.mjs +7 -1
  84. package/dist/esm/theme/tokens/components/loader.mjs +42 -1
  85. package/dist/esm/theme/tokens/components/menu.mjs +27 -1
  86. package/dist/esm/theme/tokens/components/message.mjs +102 -1
  87. package/dist/esm/theme/tokens/components/pagination.mjs +40 -1
  88. package/dist/esm/theme/tokens/components/passwordField.mjs +38 -1
  89. package/dist/esm/theme/tokens/components/phoneNumberField.mjs +10 -1
  90. package/dist/esm/theme/tokens/components/placeholder.mjs +18 -1
  91. package/dist/esm/theme/tokens/components/radio.mjs +67 -1
  92. package/dist/esm/theme/tokens/components/radioGroup.mjs +19 -1
  93. package/dist/esm/theme/tokens/components/rating.mjs +9 -1
  94. package/dist/esm/theme/tokens/components/searchField.mjs +39 -1
  95. package/dist/esm/theme/tokens/components/select.mjs +63 -1
  96. package/dist/esm/theme/tokens/components/selectField.mjs +16 -1
  97. package/dist/esm/theme/tokens/components/sliderField.mjs +70 -1
  98. package/dist/esm/theme/tokens/components/stepperField.mjs +33 -1
  99. package/dist/esm/theme/tokens/components/storagemanager.mjs +97 -1
  100. package/dist/esm/theme/tokens/components/switchField.mjs +61 -1
  101. package/dist/esm/theme/tokens/components/table.mjs +105 -1
  102. package/dist/esm/theme/tokens/components/tabs.mjs +59 -1
  103. package/dist/esm/theme/tokens/components/text.mjs +28 -1
  104. package/dist/esm/theme/tokens/components/textAreaField.mjs +11 -1
  105. package/dist/esm/theme/tokens/components/textField.mjs +12 -1
  106. package/dist/esm/theme/tokens/components/toggleButton.mjs +96 -1
  107. package/dist/esm/theme/tokens/components/toggleButtonGroup.mjs +7 -1
  108. package/dist/esm/theme/tokens/fontSizes.mjs +14 -1
  109. package/dist/esm/theme/tokens/fontWeights.mjs +13 -1
  110. package/dist/esm/theme/tokens/fonts.mjs +19 -1
  111. package/dist/esm/theme/tokens/index.mjs +65 -1
  112. package/dist/esm/theme/tokens/lineHeights.mjs +7 -1
  113. package/dist/esm/theme/tokens/opacities.mjs +15 -1
  114. package/dist/esm/theme/tokens/outlineOffsets.mjs +7 -1
  115. package/dist/esm/theme/tokens/outlineWidths.mjs +7 -1
  116. package/dist/esm/theme/tokens/radii.mjs +11 -1
  117. package/dist/esm/theme/tokens/shadows.mjs +28 -1
  118. package/dist/esm/theme/tokens/space.mjs +29 -1
  119. package/dist/esm/theme/tokens/time.mjs +7 -1
  120. package/dist/esm/theme/tokens/transforms.mjs +10 -1
  121. package/dist/esm/theme/utils.mjs +81 -1
  122. package/dist/esm/types/authenticator/attributes.mjs +41 -1
  123. package/dist/esm/types/authenticator/user.mjs +18 -1
  124. package/dist/esm/types/authenticator/utils.mjs +5 -1
  125. package/dist/esm/types/primitives/componentClassName.mjs +164 -1
  126. package/dist/esm/utils/classNames.mjs +39 -0
  127. package/dist/esm/utils/setUserAgent/constants.mjs +43 -0
  128. package/dist/esm/utils/setUserAgent/setUserAgent.mjs +65 -0
  129. package/dist/esm/utils/utils.mjs +227 -0
  130. package/dist/esm/validators/index.mjs +19 -1
  131. package/dist/index.js +8396 -1
  132. package/dist/styles/StorageManager.css +138 -0
  133. package/dist/styles/StorageManager.layer.css +140 -0
  134. package/dist/styles/_fieldControl.css +0 -0
  135. package/dist/styles/_fieldControl.layer.css +3 -0
  136. package/dist/styles/accordion.css +64 -0
  137. package/dist/styles/accordion.layer.css +66 -0
  138. package/dist/styles/alert.css +44 -0
  139. package/dist/styles/alert.layer.css +46 -0
  140. package/dist/styles/authenticator.css +72 -0
  141. package/dist/styles/authenticator.layer.css +74 -0
  142. package/dist/styles/autocomplete.css +48 -0
  143. package/dist/styles/autocomplete.layer.css +50 -0
  144. package/dist/styles/badge.css +35 -0
  145. package/dist/styles/badge.layer.css +37 -0
  146. package/dist/styles/base.css +1491 -0
  147. package/dist/styles/base.layer.css +1493 -0
  148. package/dist/styles/breadcrumbs.css +40 -0
  149. package/dist/styles/breadcrumbs.layer.css +42 -0
  150. package/dist/styles/button.css +1122 -0
  151. package/dist/styles/button.layer.css +1124 -0
  152. package/dist/styles/card.css +26 -0
  153. package/dist/styles/card.layer.css +28 -0
  154. package/dist/styles/checkbox.css +95 -0
  155. package/dist/styles/checkbox.layer.css +97 -0
  156. package/dist/styles/checkboxField.css +6 -0
  157. package/dist/styles/checkboxField.layer.css +8 -0
  158. package/dist/styles/collection.css +70 -0
  159. package/dist/styles/collection.layer.css +72 -0
  160. package/dist/styles/copy.css +27 -0
  161. package/dist/styles/copy.layer.css +29 -0
  162. package/dist/styles/dialCodeSelect.css +3 -0
  163. package/dist/styles/dialCodeSelect.layer.css +5 -0
  164. package/dist/styles/divider.css +47 -0
  165. package/dist/styles/divider.layer.css +49 -0
  166. package/dist/styles/dropZone.css +45 -0
  167. package/dist/styles/dropZone.layer.css +47 -0
  168. package/dist/styles/field.css +17 -0
  169. package/dist/styles/field.layer.css +19 -0
  170. package/dist/styles/fieldGroup.css +130 -0
  171. package/dist/styles/fieldGroup.layer.css +132 -0
  172. package/dist/styles/fieldMessages.css +10 -0
  173. package/dist/styles/fieldMessages.layer.css +12 -0
  174. package/dist/styles/fieldModifiers.css +15 -0
  175. package/dist/styles/fieldModifiers.layer.css +17 -0
  176. package/dist/styles/fieldset.css +37 -0
  177. package/dist/styles/fieldset.layer.css +39 -0
  178. package/dist/styles/flex.css +8 -0
  179. package/dist/styles/flex.layer.css +10 -0
  180. package/dist/styles/grid.css +3 -0
  181. package/dist/styles/grid.layer.css +5 -0
  182. package/dist/styles/heading.css +40 -0
  183. package/dist/styles/heading.layer.css +42 -0
  184. package/dist/styles/highlightMatch.css +3 -0
  185. package/dist/styles/highlightMatch.layer.css +5 -0
  186. package/dist/styles/icon.css +14 -0
  187. package/dist/styles/icon.layer.css +16 -0
  188. package/dist/styles/image.css +9 -0
  189. package/dist/styles/image.layer.css +11 -0
  190. package/dist/styles/inAppMessaging.css +179 -0
  191. package/dist/styles/inAppMessaging.layer.css +181 -0
  192. package/dist/styles/input.css +83 -0
  193. package/dist/styles/input.layer.css +85 -0
  194. package/dist/styles/link.css +26 -0
  195. package/dist/styles/link.layer.css +28 -0
  196. package/dist/styles/liveness.css +374 -0
  197. package/dist/styles/liveness.layer.css +376 -0
  198. package/dist/styles/loader.css +108 -0
  199. package/dist/styles/loader.layer.css +110 -0
  200. package/dist/styles/menu.css +54 -0
  201. package/dist/styles/menu.layer.css +56 -0
  202. package/dist/styles/message.css +111 -0
  203. package/dist/styles/message.layer.css +113 -0
  204. package/dist/styles/pagination.css +41 -0
  205. package/dist/styles/pagination.layer.css +43 -0
  206. package/dist/styles/passwordField.css +49 -0
  207. package/dist/styles/passwordField.layer.css +51 -0
  208. package/dist/styles/phoneNumberField.css +30 -0
  209. package/dist/styles/phoneNumberField.layer.css +32 -0
  210. package/dist/styles/placeholder.css +31 -0
  211. package/dist/styles/placeholder.layer.css +33 -0
  212. package/dist/styles/radio.css +82 -0
  213. package/dist/styles/radio.layer.css +84 -0
  214. package/dist/styles/radioGroupField.css +25 -0
  215. package/dist/styles/radioGroupField.layer.css +27 -0
  216. package/dist/styles/radiogroup.css +5 -0
  217. package/dist/styles/radiogroup.layer.css +7 -0
  218. package/dist/styles/rating.css +33 -0
  219. package/dist/styles/rating.layer.css +35 -0
  220. package/dist/styles/reset.css +76 -0
  221. package/dist/styles/reset.layer.css +78 -0
  222. package/dist/styles/scrollView.css +4 -0
  223. package/dist/styles/scrollView.layer.css +6 -0
  224. package/dist/styles/searchField.css +29 -0
  225. package/dist/styles/searchField.layer.css +31 -0
  226. package/dist/styles/select.css +128 -0
  227. package/dist/styles/select.layer.css +130 -0
  228. package/dist/styles/selectField.css +18 -0
  229. package/dist/styles/selectField.layer.css +20 -0
  230. package/dist/styles/sliderField.css +143 -0
  231. package/dist/styles/sliderField.layer.css +145 -0
  232. package/dist/styles/stepperField.css +77 -0
  233. package/dist/styles/stepperField.layer.css +79 -0
  234. package/dist/styles/switchField.css +76 -0
  235. package/dist/styles/switchField.layer.css +78 -0
  236. package/dist/styles/table.css +146 -0
  237. package/dist/styles/table.layer.css +148 -0
  238. package/dist/styles/tabs.css +87 -0
  239. package/dist/styles/tabs.layer.css +89 -0
  240. package/dist/styles/text.css +40 -0
  241. package/dist/styles/text.layer.css +42 -0
  242. package/dist/styles/textArea.css +71 -0
  243. package/dist/styles/textArea.layer.css +73 -0
  244. package/dist/styles/textAreaField.css +12 -0
  245. package/dist/styles/textAreaField.layer.css +14 -0
  246. package/dist/styles/textField.css +14 -0
  247. package/dist/styles/textField.layer.css +16 -0
  248. package/dist/styles/toggleButton.css +280 -0
  249. package/dist/styles/toggleButton.layer.css +282 -0
  250. package/dist/styles/toggleButtonGroup.css +31 -0
  251. package/dist/styles/toggleButtonGroup.layer.css +33 -0
  252. package/dist/styles/visuallyHidden.css +12 -0
  253. package/dist/styles/visuallyHidden.layer.css +14 -0
  254. package/dist/styles.css +423 -869
  255. package/dist/styles.layer.css +6115 -0
  256. package/dist/theme.css +103 -157
  257. package/dist/types/helpers/accountSettings/utils.d.ts +1 -3
  258. package/dist/types/helpers/authenticator/actor.d.ts +1 -1
  259. package/dist/types/helpers/authenticator/constants.d.ts +5 -0
  260. package/dist/types/helpers/authenticator/defaultAuthHubHandler.d.ts +15 -0
  261. package/dist/types/helpers/authenticator/facade.d.ts +35 -6
  262. package/dist/types/helpers/authenticator/formFields/defaults.d.ts +3 -1
  263. package/dist/types/helpers/authenticator/formFields/formFields.d.ts +2 -1
  264. package/dist/types/helpers/authenticator/formFields/index.d.ts +1 -1
  265. package/dist/types/helpers/authenticator/formFields/{util.d.ts → utils.d.ts} +2 -0
  266. package/dist/types/helpers/authenticator/getRoute.d.ts +2 -0
  267. package/dist/types/helpers/authenticator/index.d.ts +2 -1
  268. package/dist/types/helpers/authenticator/textUtil.d.ts +8 -7
  269. package/dist/types/{types/authenticator/stateMachine/authMachine.d.ts → helpers/authenticator/types.d.ts} +5 -5
  270. package/dist/types/helpers/authenticator/utils.d.ts +0 -25
  271. package/dist/types/helpers/index.d.ts +0 -1
  272. package/dist/types/helpers/utils.d.ts +2 -2
  273. package/dist/types/i18n/translations.d.ts +2 -3
  274. package/dist/types/machines/authenticator/actions.d.ts +4 -62
  275. package/dist/types/machines/authenticator/actors/{resetPassword.d.ts → forgotPassword.d.ts} +3 -3
  276. package/dist/types/machines/authenticator/actors/index.d.ts +3 -1
  277. package/dist/types/machines/authenticator/actors/signIn.d.ts +3 -3
  278. package/dist/types/machines/authenticator/actors/signOut.d.ts +2 -2
  279. package/dist/types/machines/authenticator/{signUp.d.ts → actors/signUp.d.ts} +3 -3
  280. package/dist/types/machines/authenticator/actors/verifyUserAttributes.d.ts +5 -0
  281. package/dist/types/machines/authenticator/defaultServices.d.ts +208 -28
  282. package/dist/types/machines/authenticator/getAuthenticatorConfig.d.ts +14 -0
  283. package/dist/types/machines/authenticator/guards.d.ts +4 -0
  284. package/dist/types/machines/authenticator/index.d.ts +4 -2
  285. package/dist/types/machines/authenticator/types.d.ts +125 -0
  286. package/dist/types/machines/authenticator/utils.d.ts +7 -0
  287. package/dist/types/machines/index.d.ts +1 -0
  288. package/dist/types/theme/tokens/borderWidths.d.ts +2 -2
  289. package/dist/types/theme/tokens/colors.d.ts +7 -9
  290. package/dist/types/theme/tokens/components/accordion.d.ts +12 -0
  291. package/dist/types/theme/tokens/components/index.d.ts +2 -4
  292. package/dist/types/theme/tokens/components/radioGroup.d.ts +1 -1
  293. package/dist/types/theme/tokens/components/select.d.ts +6 -2
  294. package/dist/types/theme/tokens/components/storagemanager.d.ts +18 -3
  295. package/dist/types/theme/tokens/components/tabs.d.ts +4 -3
  296. package/dist/types/theme/tokens/fontSizes.d.ts +2 -2
  297. package/dist/types/theme/tokens/fontWeights.d.ts +2 -2
  298. package/dist/types/theme/tokens/fonts.d.ts +2 -2
  299. package/dist/types/theme/tokens/lineHeights.d.ts +2 -2
  300. package/dist/types/theme/tokens/opacities.d.ts +2 -2
  301. package/dist/types/theme/tokens/outlineOffsets.d.ts +2 -2
  302. package/dist/types/theme/tokens/outlineWidths.d.ts +2 -2
  303. package/dist/types/theme/tokens/radii.d.ts +2 -2
  304. package/dist/types/theme/tokens/shadows.d.ts +2 -2
  305. package/dist/types/theme/tokens/space.d.ts +2 -2
  306. package/dist/types/theme/tokens/time.d.ts +2 -2
  307. package/dist/types/theme/tokens/types/designToken.d.ts +12 -6
  308. package/dist/types/theme/types.d.ts +5 -1
  309. package/dist/types/types/authenticator/attributes.d.ts +10 -4
  310. package/dist/types/types/authenticator/form.d.ts +7 -6
  311. package/dist/types/types/authenticator/index.d.ts +0 -1
  312. package/dist/types/types/authenticator/user.d.ts +3 -29
  313. package/dist/types/types/authenticator/validator.d.ts +2 -2
  314. package/dist/types/types/displayText.d.ts +84 -0
  315. package/dist/types/types/index.d.ts +1 -0
  316. package/dist/types/types/primitives/componentClassName.d.ts +162 -180
  317. package/dist/types/types/util.d.ts +0 -5
  318. package/dist/types/utils/classNames.d.ts +4 -0
  319. package/dist/types/utils/index.d.ts +3 -135
  320. package/dist/types/utils/setUserAgent/constants.d.ts +7 -0
  321. package/dist/types/utils/setUserAgent/index.d.ts +1 -0
  322. package/dist/types/utils/setUserAgent/setUserAgent.d.ts +19 -0
  323. package/dist/types/utils/utils.d.ts +147 -0
  324. package/dist/types/validators/index.d.ts +2 -2
  325. package/package.json +5 -19
  326. package/dist/esm/helpers/authenticator/context.mjs +0 -1
  327. package/dist/esm/helpers/authenticator/formFields/util.mjs +0 -1
  328. package/dist/esm/helpers/storage/fileUploader/utils/uploader.mjs +0 -1
  329. package/dist/esm/machines/authenticator/actors/resetPassword.mjs +0 -1
  330. package/dist/esm/machines/authenticator/signUp.mjs +0 -1
  331. package/dist/esm/theme/tokens/components/expander.mjs +0 -1
  332. package/dist/esm/theme/tokens/components/fileUploader.mjs +0 -1
  333. package/dist/esm/utils/index.mjs +0 -1
  334. package/dist/types/helpers/authenticator/context.d.ts +0 -13
  335. package/dist/types/helpers/storage/fileUploader/index.d.ts +0 -1
  336. package/dist/types/helpers/storage/fileUploader/utils/index.d.ts +0 -1
  337. package/dist/types/helpers/storage/fileUploader/utils/uploader.d.ts +0 -28
  338. package/dist/types/helpers/storage/index.d.ts +0 -1
  339. package/dist/types/theme/tokens/components/expander.d.ts +0 -22
  340. package/dist/types/theme/tokens/components/fileUploader.d.ts +0 -23
  341. package/dist/types/types/authenticator/stateMachine/context.d.ts +0 -109
  342. package/dist/types/types/authenticator/stateMachine/event.d.ts +0 -17
  343. package/dist/types/types/authenticator/stateMachine/index.d.ts +0 -4
  344. package/dist/types/types/authenticator/stateMachine/state.d.ts +0 -10
@@ -0,0 +1,71 @@
1
+ import pickBy from 'lodash/pickBy.js';
2
+ import '@aws-amplify/core/internals/utils';
3
+ import '../../utils/setUserAgent/constants.mjs';
4
+ import { isString } from '../../utils/utils.mjs';
5
+
6
+ // default `autoSignIn` flag is `true`
7
+ const DEFAULT_AUTO_SIGN_IN = true;
8
+ const sanitizePhoneNumber = (dialCode, phoneNumber) => `${dialCode}${phoneNumber}`.replace(/[^A-Z0-9+]/gi, '');
9
+ const selectUserAttributes = (_, key) => {
10
+ // Allowlist of Cognito User Pool Attributes (from OpenID Connect specification)
11
+ // See: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html
12
+ switch (key) {
13
+ case 'address':
14
+ case 'birthdate':
15
+ case 'email':
16
+ case 'family_name':
17
+ case 'gender':
18
+ case 'given_name':
19
+ case 'locale':
20
+ case 'middle_name':
21
+ case 'name':
22
+ case 'nickname':
23
+ case 'phone_number':
24
+ case 'picture':
25
+ case 'preferred_username':
26
+ case 'profile':
27
+ case 'updated_at':
28
+ case 'website':
29
+ case 'zoneinfo':
30
+ return true;
31
+ // Otherwise, it's a custom attribute
32
+ default:
33
+ return key.startsWith('custom:');
34
+ }
35
+ };
36
+ const getUserAttributes = (formValues) => {
37
+ const { phone_number, ...userAttributes } = pickBy(formValues, selectUserAttributes);
38
+ // only include `phone_number` attribute in `userAttributes` if it has a value
39
+ if (isString(phone_number)) {
40
+ const { country_code } = formValues;
41
+ return {
42
+ ...userAttributes,
43
+ phone_number: sanitizePhoneNumber(country_code, phone_number),
44
+ };
45
+ }
46
+ return userAttributes;
47
+ };
48
+ const getSignUpInput = (username, formValues, loginMechanism) => {
49
+ const { password, ...values } = formValues;
50
+ const attributes = getUserAttributes(values);
51
+ const options = {
52
+ autoSignIn: DEFAULT_AUTO_SIGN_IN,
53
+ userAttributes: {
54
+ // use `username` value for `phone_number`
55
+ ...(loginMechanism === 'phone_number'
56
+ ? { ...attributes, phone_number: username }
57
+ : attributes),
58
+ },
59
+ };
60
+ return { username, password, options };
61
+ };
62
+ const getUsernameSignUp = ({ formValues, loginMechanisms, }) => {
63
+ const loginMechanism = loginMechanisms[0];
64
+ if (loginMechanism === 'phone_number') {
65
+ const { country_code, phone_number } = formValues;
66
+ return sanitizePhoneNumber(country_code, phone_number);
67
+ }
68
+ return formValues[loginMechanism];
69
+ };
70
+
71
+ export { getSignUpInput, getUserAttributes, getUsernameSignUp, sanitizePhoneNumber };
@@ -1 +1,14 @@
1
- const e={values:{base:0,small:480,medium:768,large:992,xl:1280,xxl:1536},defaultBreakpoint:"base"};export{e as breakpoints};
1
+ // Breakpoint unit is in pixels
2
+ const breakpoints = {
3
+ values: {
4
+ base: 0,
5
+ small: 480,
6
+ medium: 768,
7
+ large: 992,
8
+ xl: 1280,
9
+ xxl: 1536,
10
+ },
11
+ defaultBreakpoint: 'base',
12
+ };
13
+
14
+ export { breakpoints };
@@ -1 +1,156 @@
1
- import e from"style-dictionary/lib/utils/deepExtend.js";import n from"style-dictionary/lib/utils/flattenProperties.js";import{defaultTheme as o}from"./defaultTheme.mjs";import{setupTokens as t,cssNameTransform as a,cssValue as i}from"./utils.mjs";const r=({token:e,path:n})=>{const o=`--${a({path:n})}`,{value:t}=e,r=i(e);return{name:o,original:t,path:n,value:r,toString:()=>`var(${o})`}};function s(a,i=o){const s=e([{},i,a]),m=t({tokens:s.tokens,setupToken:r}),{breakpoints:l,name:p}=s;let d=`[data-amplify-theme="${p}"] {\n`+n(m).map((e=>`${e.name}: ${e.value};`)).join("\n")+"\n}\n",c=[];return s.overrides&&(c=s.overrides.map((e=>{const o=t({tokens:e.tokens,setupToken:r}),a=n(o).map((e=>`${e.name}: ${e.value};`)).join("\n");if("selector"in e&&(d+=`\n${e.selector} {\n${a}\n}\n`),"mediaQuery"in e&&(d+=`\n@media (${e.mediaQuery}) {\n [data-amplify-theme="${p}"] {\n ${a}\n }\n}\n`),"breakpoint"in e){const n=s.breakpoints.values[e.breakpoint];d+=`\n@media (min-width: ${n}px) {\n [data-amplify-theme="${p}"] {\n ${a}\n }\n}\n`}return"colorMode"in e&&(d+=`\n@media (prefers-color-scheme: ${e.colorMode}) {\n [data-amplify-theme="${p}"][data-amplify-color-mode="system"] {\n ${a}\n color-scheme: ${e.colorMode};\n }\n }\n`,d+=`\n[data-amplify-theme="${p}"][data-amplify-color-mode="${e.colorMode}"] {\n ${a}\n color-scheme: ${e.colorMode};\n }\n`),Object.assign(Object.assign({},e),{tokens:o})}))),{tokens:m,breakpoints:l,name:p,cssText:d,overrides:c}}export{s as createTheme};
1
+ import deepExtend from 'style-dictionary/lib/utils/deepExtend.js';
2
+ import flattenProperties from 'style-dictionary/lib/utils/flattenProperties.js';
3
+ import { defaultTheme } from './defaultTheme.mjs';
4
+ import { setupTokens, cssNameTransform, cssValue } from './utils.mjs';
5
+ import '@aws-amplify/core/internals/utils';
6
+ import '../utils/setUserAgent/constants.mjs';
7
+ import { isString } from '../utils/utils.mjs';
8
+
9
+ // Internal Style Dictionary methods
10
+ /**
11
+ * This will take a design token and add some data to it for it
12
+ * to be used in JS/CSS. It will create its CSS var name and update
13
+ * the value to use a CSS var if it is a reference. It will also
14
+ * add a `.toString()` method to make it easier to use in JS.
15
+ *
16
+ * We should see if there is a way to share this logic with style dictionary...
17
+ */
18
+ const setupToken = ({ token, path }) => {
19
+ const name = `--${cssNameTransform({ path })}`;
20
+ const { value: original } = token;
21
+ const value = cssValue(token);
22
+ return { name, original, path, value, toString: () => `var(${name})` };
23
+ };
24
+ /**
25
+ * Takes a set of keys and a color name and returns an object of design tokens,
26
+ * used for applying a primary color at the theme level to our tokens.
27
+ *
28
+ * createColorPalette({keys: ['10','20',...], value: 'red'})
29
+ * returns {
30
+ * 10: { value: '{colors.red.10.value}' },
31
+ * 20: { value: '{colors.red.20.value}' },
32
+ * ...
33
+ * }
34
+ */
35
+ function createColorPalette({ keys, value }) {
36
+ return keys.reduce((acc, key) => {
37
+ return {
38
+ ...acc,
39
+ [key]: { value: `{colors.${value}.${key}.value}` },
40
+ };
41
+ }, {});
42
+ }
43
+ /**
44
+ * This will be used like `const myTheme = createTheme({})`
45
+ * `myTheme` can then be passed to a Provider or the generated CSS
46
+ * can be passed to a stylesheet at build-time or run-time.
47
+ * const myTheme = createTheme({})
48
+ * const myOtherTheme = createTheme({}, myTheme);
49
+ */
50
+ function createTheme(theme, DefaultTheme = defaultTheme) {
51
+ // merge theme and DefaultTheme to get a complete theme
52
+ // deepExtend is an internal Style Dictionary method
53
+ // that performs a deep merge on n objects. We could change
54
+ // this to another 3p deep merge solution too.
55
+ const mergedTheme = deepExtend([{}, DefaultTheme, theme]);
56
+ const { primaryColor, secondaryColor } = mergedTheme;
57
+ // apply primaryColor and secondaryColor if present
58
+ if (isString(primaryColor)) {
59
+ mergedTheme.tokens.colors.primary = createColorPalette({
60
+ keys: Object.keys(mergedTheme.tokens.colors[primaryColor]),
61
+ value: primaryColor,
62
+ });
63
+ }
64
+ if (isString(secondaryColor)) {
65
+ mergedTheme.tokens.colors.secondary = createColorPalette({
66
+ keys: Object.keys(mergedTheme.tokens.colors[secondaryColor]),
67
+ value: secondaryColor,
68
+ });
69
+ }
70
+ // Setting up the tokens. This is similar to what Style Dictionary
71
+ // does. At the end of this, each token should have:
72
+ // - CSS variable name of itself
73
+ // - its value (reference to another CSS variable or raw value)
74
+ const tokens = setupTokens({
75
+ tokens: mergedTheme.tokens,
76
+ setupToken,
77
+ }); // Setting the type here because setupTokens is recursive
78
+ const { breakpoints, name } = mergedTheme;
79
+ // flattenProperties is another internal Style Dictionary function
80
+ // that creates an array of all tokens.
81
+ let cssText = `[data-amplify-theme="${name}"] {\n` +
82
+ flattenProperties(tokens)
83
+ .map((token) => `${token.name}: ${token.value};`)
84
+ .join('\n') +
85
+ `\n}\n`;
86
+ let overrides = [];
87
+ /**
88
+ * For each override, we setup the tokens and then generate the CSS.
89
+ * This allows us to have one single CSS string for all possible overrides
90
+ * and avoid re-renders in React, but also support other frameworks as well.
91
+ */
92
+ if (mergedTheme.overrides) {
93
+ overrides = mergedTheme.overrides.map((override) => {
94
+ const tokens = setupTokens({
95
+ tokens: override.tokens,
96
+ setupToken,
97
+ });
98
+ const customProperties = flattenProperties(tokens)
99
+ .map((token) => `${token.name}: ${token.value};`)
100
+ .join('\n');
101
+ // Overrides can have a selector, media query, breakpoint, or color mode
102
+ // for creating the selector
103
+ if ('selector' in override) {
104
+ cssText += `\n${override.selector} {\n${customProperties}\n}\n`;
105
+ }
106
+ if ('mediaQuery' in override) {
107
+ cssText += `\n@media (${override.mediaQuery}) {
108
+ [data-amplify-theme="${name}"] {
109
+ ${customProperties}
110
+ }
111
+ }\n`;
112
+ }
113
+ if ('breakpoint' in override) {
114
+ const breakpoint = mergedTheme.breakpoints.values[override.breakpoint];
115
+ cssText += `\n@media (min-width: ${breakpoint}px) {
116
+ [data-amplify-theme="${name}"] {
117
+ ${customProperties}
118
+ }
119
+ }\n`;
120
+ }
121
+ if ('colorMode' in override) {
122
+ cssText += `\n@media (prefers-color-scheme: ${override.colorMode}) {
123
+ [data-amplify-theme="${name}"][data-amplify-color-mode="system"] {
124
+ ${customProperties}
125
+ color-scheme: ${override.colorMode};
126
+ }
127
+ }\n`;
128
+ cssText += `\n[data-amplify-theme="${name}"][data-amplify-color-mode="${override.colorMode}"] {
129
+ ${customProperties}
130
+ color-scheme: ${override.colorMode};
131
+ }\n`;
132
+ }
133
+ return {
134
+ ...override,
135
+ tokens,
136
+ };
137
+ });
138
+ }
139
+ return {
140
+ tokens,
141
+ breakpoints,
142
+ name,
143
+ cssText,
144
+ // keep overrides separate from base theme
145
+ // this allows web platforms to use plain CSS scoped to a
146
+ // selector and only override the CSS vars needed. This
147
+ // means we could generate CSS at build-time in a postcss
148
+ // plugin, or do it at runtime and inject the CSS into a
149
+ // style tag.
150
+ // This also allows RN to dynamically switch themes in a
151
+ // provider.
152
+ overrides,
153
+ };
154
+ }
155
+
156
+ export { createTheme };
@@ -1 +1,128 @@
1
- import{tokens as o}from"./tokens/index.mjs";const r={colors:{red:{10:o.colors.red[100],20:o.colors.red[90],40:o.colors.red[80],80:o.colors.red[40],90:o.colors.red[20],100:o.colors.red[10]},orange:{10:o.colors.orange[100],20:o.colors.orange[90],40:o.colors.orange[80],80:o.colors.orange[40],90:o.colors.orange[20],100:o.colors.orange[10]},yellow:{10:o.colors.yellow[100],20:o.colors.yellow[90],40:o.colors.yellow[80],80:o.colors.yellow[40],90:o.colors.yellow[20],100:o.colors.yellow[10]},green:{10:o.colors.green[100],20:o.colors.green[90],40:o.colors.green[80],80:o.colors.green[40],90:o.colors.green[20],100:o.colors.green[10]},teal:{10:o.colors.teal[100],20:o.colors.teal[90],40:o.colors.teal[80],80:o.colors.teal[40],90:o.colors.teal[20],100:o.colors.teal[10]},blue:{10:o.colors.blue[100],20:o.colors.blue[90],40:o.colors.blue[80],80:o.colors.blue[40],90:o.colors.blue[20],100:o.colors.blue[10]},purple:{10:o.colors.purple[100],20:o.colors.purple[90],40:o.colors.purple[80],80:o.colors.purple[40],90:o.colors.purple[20],100:o.colors.purple[10]},pink:{10:o.colors.pink[100],20:o.colors.pink[90],40:o.colors.pink[80],80:o.colors.pink[40],90:o.colors.pink[20],100:o.colors.pink[10]},neutral:{10:o.colors.neutral[100],20:o.colors.neutral[90],40:o.colors.neutral[80],80:o.colors.neutral[40],90:o.colors.neutral[20],100:o.colors.neutral[10]},font:{primary:"{colors.white}",secondary:"{colors.neutral.100}",tertiary:"{colors.neutral.90}",inverse:"{colors.neutral.10}"},background:{primary:"{colors.neutral.10}",secondary:"{colors.neutral.20}",tertiary:"{colors.neutral.40}"},border:{primary:"{colors.neutral.60}",secondary:"{colors.neutral.40}",tertiary:"{colors.neutral.20}"},overlay:{5:"hsla(0, 0%, 100%, 0.05)",10:"hsla(0, 0%, 100%, 0.1)",20:"hsla(0, 0%, 100%, 0.2)",30:"hsla(0, 0%, 100%, 0.3)",40:"hsla(0, 0%, 100%, 0.4)",50:"hsla(0, 0%, 100%, 0.5)",60:"hsla(0, 0%, 100%, 0.6)",70:"hsla(0, 0%, 100%, 0.7)",80:"hsla(0, 0%, 100%, 0.8)",90:"hsla(0, 0%, 100%, 0.9)"}}},l={colorMode:"dark",tokens:r},e=Object.assign({},r);export{l as defaultDarkModeOverride,e as reactNativeDarkTokens};
1
+ import { tokens } from './tokens/index.mjs';
2
+
3
+ const darkModeTokens = {
4
+ colors: {
5
+ red: {
6
+ 10: tokens.colors.red[100],
7
+ 20: tokens.colors.red[90],
8
+ 40: tokens.colors.red[80],
9
+ // 60 doesn't change
10
+ 80: tokens.colors.red[40],
11
+ 90: tokens.colors.red[20],
12
+ 100: tokens.colors.red[10],
13
+ },
14
+ orange: {
15
+ 10: tokens.colors.orange[100],
16
+ 20: tokens.colors.orange[90],
17
+ 40: tokens.colors.orange[80],
18
+ // 60 doesn't change
19
+ 80: tokens.colors.orange[40],
20
+ 90: tokens.colors.orange[20],
21
+ 100: tokens.colors.orange[10],
22
+ },
23
+ yellow: {
24
+ 10: tokens.colors.yellow[100],
25
+ 20: tokens.colors.yellow[90],
26
+ 40: tokens.colors.yellow[80],
27
+ // 60 doesn't change
28
+ 80: tokens.colors.yellow[40],
29
+ 90: tokens.colors.yellow[20],
30
+ 100: tokens.colors.yellow[10],
31
+ },
32
+ green: {
33
+ 10: tokens.colors.green[100],
34
+ 20: tokens.colors.green[90],
35
+ 40: tokens.colors.green[80],
36
+ // 60 doesn't change
37
+ 80: tokens.colors.green[40],
38
+ 90: tokens.colors.green[20],
39
+ 100: tokens.colors.green[10],
40
+ },
41
+ teal: {
42
+ 10: tokens.colors.teal[100],
43
+ 20: tokens.colors.teal[90],
44
+ 40: tokens.colors.teal[80],
45
+ // 60 doesn't change
46
+ 80: tokens.colors.teal[40],
47
+ 90: tokens.colors.teal[20],
48
+ 100: tokens.colors.teal[10],
49
+ },
50
+ blue: {
51
+ 10: tokens.colors.blue[100],
52
+ 20: tokens.colors.blue[90],
53
+ 40: tokens.colors.blue[80],
54
+ // 60 doesn't change
55
+ 80: tokens.colors.blue[40],
56
+ 90: tokens.colors.blue[20],
57
+ 100: tokens.colors.blue[10],
58
+ },
59
+ purple: {
60
+ 10: tokens.colors.purple[100],
61
+ 20: tokens.colors.purple[90],
62
+ 40: tokens.colors.purple[80],
63
+ // 60 doesn't change
64
+ 80: tokens.colors.purple[40],
65
+ 90: tokens.colors.purple[20],
66
+ 100: tokens.colors.purple[10],
67
+ },
68
+ pink: {
69
+ 10: tokens.colors.pink[100],
70
+ 20: tokens.colors.pink[90],
71
+ 40: tokens.colors.pink[80],
72
+ // 60 doesn't change
73
+ 80: tokens.colors.pink[40],
74
+ 90: tokens.colors.pink[20],
75
+ 100: tokens.colors.pink[10],
76
+ },
77
+ neutral: {
78
+ 10: tokens.colors.neutral[100],
79
+ 20: tokens.colors.neutral[90],
80
+ 40: tokens.colors.neutral[80],
81
+ // 60 doesn't change
82
+ 80: tokens.colors.neutral[40],
83
+ 90: tokens.colors.neutral[20],
84
+ 100: tokens.colors.neutral[10],
85
+ },
86
+ font: {
87
+ primary: '{colors.white}',
88
+ secondary: '{colors.neutral.100}',
89
+ tertiary: '{colors.neutral.90}',
90
+ inverse: '{colors.neutral.10}',
91
+ },
92
+ background: {
93
+ primary: '{colors.neutral.10}',
94
+ secondary: '{colors.neutral.20}',
95
+ tertiary: '{colors.neutral.40}',
96
+ },
97
+ border: {
98
+ primary: '{colors.neutral.60}',
99
+ secondary: '{colors.neutral.40}',
100
+ tertiary: '{colors.neutral.20}',
101
+ },
102
+ overlay: {
103
+ 5: 'hsla(0, 0%, 100%, 0.05)',
104
+ 10: 'hsla(0, 0%, 100%, 0.1)',
105
+ 20: 'hsla(0, 0%, 100%, 0.2)',
106
+ 30: 'hsla(0, 0%, 100%, 0.3)',
107
+ 40: 'hsla(0, 0%, 100%, 0.4)',
108
+ 50: 'hsla(0, 0%, 100%, 0.5)',
109
+ 60: 'hsla(0, 0%, 100%, 0.6)',
110
+ 70: 'hsla(0, 0%, 100%, 0.7)',
111
+ 80: 'hsla(0, 0%, 100%, 0.8)',
112
+ 90: 'hsla(0, 0%, 100%, 0.9)',
113
+ },
114
+ },
115
+ };
116
+ /**
117
+ * A basic dark mode that just flips the base color
118
+ * palette.
119
+ */
120
+ const defaultDarkModeOverride = {
121
+ colorMode: 'dark',
122
+ tokens: darkModeTokens,
123
+ };
124
+ const reactNativeDarkTokens = {
125
+ ...darkModeTokens,
126
+ };
127
+
128
+ export { defaultDarkModeOverride, reactNativeDarkTokens };
@@ -1 +1,10 @@
1
- import{tokens as e}from"./tokens/index.mjs";import{breakpoints as o}from"./breakpoints.mjs";const t={tokens:e,breakpoints:o,name:"default-theme"};export{t as defaultTheme};
1
+ import { tokens } from './tokens/index.mjs';
2
+ import { breakpoints } from './breakpoints.mjs';
3
+
4
+ const defaultTheme = {
5
+ tokens,
6
+ breakpoints,
7
+ name: 'default-theme',
8
+ };
9
+
10
+ export { defaultTheme };
@@ -1 +1,7 @@
1
- const e={small:{value:"1px"},medium:{value:"2px"},large:{value:"3px"}};export{e as borderWidths};
1
+ const borderWidths = {
2
+ small: { value: '1px' },
3
+ medium: { value: '2px' },
4
+ large: { value: '3px' },
5
+ };
6
+
7
+ export { borderWidths };
@@ -1 +1,166 @@
1
- const l={red:{10:{value:"hsl(0, 75%, 95%)"},20:{value:"hsl(0, 75%, 85%)"},40:{value:"hsl(0, 75%, 75%)"},60:{value:"hsl(0, 50%, 50%)"},80:{value:"hsl(0, 95%, 30%)"},90:{value:"hsl(0, 100%, 20%)"},100:{value:"hsl(0, 100%, 15%)"}},orange:{10:{value:"hsl(30, 75%, 95%)"},20:{value:"hsl(30, 75%, 85%)"},40:{value:"hsl(30, 75%, 75%)"},60:{value:"hsl(30, 50%, 50%)"},80:{value:"hsl(30, 95%, 30%)"},90:{value:"hsl(30, 100%, 20%)"},100:{value:"hsl(30, 100%, 15%)"}},yellow:{10:{value:"hsl(60, 75%, 95%)"},20:{value:"hsl(60, 75%, 85%)"},40:{value:"hsl(60, 75%, 75%)"},60:{value:"hsl(60, 50%, 50%)"},80:{value:"hsl(60, 95%, 30%)"},90:{value:"hsl(60, 100%, 20%)"},100:{value:"hsl(60, 100%, 15%)"}},green:{10:{value:"hsl(130, 60%, 95%)"},20:{value:"hsl(130, 60%, 90%)"},40:{value:"hsl(130, 44%, 63%)"},60:{value:"hsl(130, 43%, 46%)"},80:{value:"hsl(130, 33%, 37%)"},90:{value:"hsl(130, 27%, 29%)"},100:{value:"hsl(130, 22%, 23%)"}},teal:{10:{value:"hsl(190, 75%, 95%)"},20:{value:"hsl(190, 75%, 85%)"},40:{value:"hsl(190, 70%, 70%)"},60:{value:"hsl(190, 50%, 50%)"},80:{value:"hsl(190, 95%, 30%)"},90:{value:"hsl(190, 100%, 20%)"},100:{value:"hsl(190, 100%, 15%)"}},blue:{10:{value:"hsl(220, 95%, 95%)"},20:{value:"hsl(220, 85%, 85%)"},40:{value:"hsl(220, 70%, 70%)"},60:{value:"hsl(220, 50%, 50%)"},80:{value:"hsl(220, 95%, 30%)"},90:{value:"hsl(220, 100%, 20%)"},100:{value:"hsl(220, 100%, 15%)"}},purple:{10:{value:"hsl(300, 95%, 95%)"},20:{value:"hsl(300, 85%, 85%)"},40:{value:"hsl(300, 70%, 70%)"},60:{value:"hsl(300, 50%, 50%)"},80:{value:"hsl(300, 95%, 30%)"},90:{value:"hsl(300, 100%, 20%)"},100:{value:"hsl(300, 100%, 15%)"}},pink:{10:{value:"hsl(340, 95%, 95%)"},20:{value:"hsl(340, 90%, 85%)"},40:{value:"hsl(340, 70%, 70%)"},60:{value:"hsl(340, 50%, 50%)"},80:{value:"hsl(340, 95%, 30%)"},90:{value:"hsl(340, 100%, 20%)"},100:{value:"hsl(340, 100%, 15%)"}},neutral:{10:{value:"hsl(210, 5%, 98%)"},20:{value:"hsl(210, 5%, 94%)"},40:{value:"hsl(210, 5%, 87%)"},60:{value:"hsl(210, 10%, 58%)"},80:{value:"hsl(210, 10%, 40%)"},90:{value:"hsl(210, 25%, 25%)"},100:{value:"hsl(210, 50%, 10%)"}},brand:{primary:{10:{value:"{colors.teal.10.value}"},20:{value:"{colors.teal.20.value}"},40:{value:"{colors.teal.40.value}"},60:{value:"{colors.teal.60.value}"},80:{value:"{colors.teal.80.value}"},90:{value:"{colors.teal.90.value}"},100:{value:"{colors.teal.100.value}"}},secondary:{10:{value:"{colors.purple.10.value}"},20:{value:"{colors.purple.20.value}"},40:{value:"{colors.purple.40.value}"},60:{value:"{colors.purple.60.value}"},80:{value:"{colors.purple.80.value}"},90:{value:"{colors.purple.90.value}"},100:{value:"{colors.purple.100.value}"}}},font:{primary:{value:"{colors.neutral.100.value}"},secondary:{value:"{colors.neutral.90.value}"},tertiary:{value:"{colors.neutral.80.value}"},disabled:{value:"{colors.neutral.60.value}"},inverse:{value:"{colors.white.value}"},interactive:{value:"{colors.brand.primary.80.value}"},hover:{value:"{colors.brand.primary.90.value}"},focus:{value:"{colors.brand.primary.100.value}"},active:{value:"{colors.brand.primary.100.value}"},info:{value:"{colors.blue.90.value}"},warning:{value:"{colors.orange.90.value}"},error:{value:"{colors.red.90.value}"},success:{value:"{colors.green.90.value}"}},background:{primary:{value:"{colors.white.value}"},secondary:{value:"{colors.neutral.10.value}"},tertiary:{value:"{colors.neutral.20.value}"},quaternary:{value:"{colors.neutral.60.value}"},disabled:{value:"{colors.background.tertiary.value}"},info:{value:"{colors.blue.10.value}"},warning:{value:"{colors.orange.10.value}"},error:{value:"{colors.red.10.value}"},success:{value:"{colors.green.10.value}"}},border:{primary:{value:"{colors.neutral.60.value}"},secondary:{value:"{colors.neutral.40.value}"},tertiary:{value:"{colors.neutral.20.value}"},disabled:{value:"{colors.border.tertiary.value}"},pressed:{value:"{colors.brand.primary.100.value}"},focus:{value:"{colors.brand.primary.100.value}"},error:{value:"{colors.red.80.value}"},info:{value:"{colors.blue.80.value}"},success:{value:"{colors.green.80.value}"},warning:{value:"{colors.orange.80.value}"}},shadow:{primary:{value:"hsla(210, 50%, 10%, 0.25)"},secondary:{value:"hsla(210, 50%, 10%, 0.15)"},tertiary:{value:"hsla(210, 50%, 10%, 0.05)"}},overlay:{5:{value:"hsla(0, 0%, 0%, 0.05)"},10:{value:"hsla(0, 0%, 0%, 0.1)"},20:{value:"hsla(0, 0%, 0%, 0.2)"},30:{value:"hsla(0, 0%, 0%, 0.3)"},40:{value:"hsla(0, 0%, 0%, 0.4)"},50:{value:"hsla(0, 0%, 0%, 0.5)"},60:{value:"hsla(0, 0%, 0%, 0.6)"},70:{value:"hsla(0, 0%, 0%, 0.7)"},80:{value:"hsla(0, 0%, 0%, 0.8)"},90:{value:"hsla(0, 0%, 0%, 0.9)"}},black:{value:"hsl(0, 0%, 0%)"},white:{value:"hsl(0, 0%, 100%)"},transparent:{value:"transparent"}};export{l as colors};
1
+ const colors = {
2
+ red: {
3
+ 10: { value: 'hsl(0, 75%, 95%)' },
4
+ 20: { value: 'hsl(0, 75%, 85%)' },
5
+ 40: { value: 'hsl(0, 75%, 75%)' },
6
+ 60: { value: 'hsl(0, 50%, 50%)' },
7
+ 80: { value: 'hsl(0, 95%, 30%)' },
8
+ 90: { value: 'hsl(0, 100%, 20%)' },
9
+ 100: { value: 'hsl(0, 100%, 15%)' },
10
+ },
11
+ orange: {
12
+ 10: { value: 'hsl(30, 75%, 95%)' },
13
+ 20: { value: 'hsl(30, 75%, 85%)' },
14
+ 40: { value: 'hsl(30, 75%, 75%)' },
15
+ 60: { value: 'hsl(30, 50%, 50%)' },
16
+ 80: { value: 'hsl(30, 95%, 30%)' },
17
+ 90: { value: 'hsl(30, 100%, 20%)' },
18
+ 100: { value: 'hsl(30, 100%, 15%)' },
19
+ },
20
+ yellow: {
21
+ 10: { value: 'hsl(60, 75%, 95%)' },
22
+ 20: { value: 'hsl(60, 75%, 85%)' },
23
+ 40: { value: 'hsl(60, 75%, 75%)' },
24
+ 60: { value: 'hsl(60, 50%, 50%)' },
25
+ 80: { value: 'hsl(60, 95%, 30%)' },
26
+ 90: { value: 'hsl(60, 100%, 20%)' },
27
+ 100: { value: 'hsl(60, 100%, 15%)' },
28
+ },
29
+ green: {
30
+ 10: { value: 'hsl(130, 60%, 95%)' },
31
+ 20: { value: 'hsl(130, 60%, 90%)' },
32
+ 40: { value: 'hsl(130, 44%, 63%)' },
33
+ 60: { value: 'hsl(130, 43%, 46%)' },
34
+ 80: { value: 'hsl(130, 33%, 37%)' },
35
+ 90: { value: 'hsl(130, 27%, 29%)' },
36
+ 100: { value: 'hsl(130, 22%, 23%)' },
37
+ },
38
+ teal: {
39
+ 10: { value: 'hsl(190, 75%, 95%)' },
40
+ 20: { value: 'hsl(190, 75%, 85%)' },
41
+ 40: { value: 'hsl(190, 70%, 70%)' },
42
+ 60: { value: 'hsl(190, 50%, 50%)' },
43
+ 80: { value: 'hsl(190, 95%, 30%)' },
44
+ 90: { value: 'hsl(190, 100%, 20%)' },
45
+ 100: { value: 'hsl(190, 100%, 15%)' },
46
+ },
47
+ blue: {
48
+ 10: { value: 'hsl(220, 95%, 95%)' },
49
+ 20: { value: 'hsl(220, 85%, 85%)' },
50
+ 40: { value: 'hsl(220, 70%, 70%)' },
51
+ 60: { value: 'hsl(220, 50%, 50%)' },
52
+ 80: { value: 'hsl(220, 95%, 30%)' },
53
+ 90: { value: 'hsl(220, 100%, 20%)' },
54
+ 100: { value: 'hsl(220, 100%, 15%)' },
55
+ },
56
+ purple: {
57
+ 10: { value: 'hsl(300, 95%, 95%)' },
58
+ 20: { value: 'hsl(300, 85%, 85%)' },
59
+ 40: { value: 'hsl(300, 70%, 70%)' },
60
+ 60: { value: 'hsl(300, 50%, 50%)' },
61
+ 80: { value: 'hsl(300, 95%, 30%)' },
62
+ 90: { value: 'hsl(300, 100%, 20%)' },
63
+ 100: { value: 'hsl(300, 100%, 15%)' },
64
+ },
65
+ pink: {
66
+ 10: { value: 'hsl(340, 95%, 95%)' },
67
+ 20: { value: 'hsl(340, 90%, 85%)' },
68
+ 40: { value: 'hsl(340, 70%, 70%)' },
69
+ 60: { value: 'hsl(340, 50%, 50%)' },
70
+ 80: { value: 'hsl(340, 95%, 30%)' },
71
+ 90: { value: 'hsl(340, 100%, 20%)' },
72
+ 100: { value: 'hsl(340, 100%, 15%)' },
73
+ },
74
+ neutral: {
75
+ 10: { value: 'hsl(210, 5%, 98%)' },
76
+ 20: { value: 'hsl(210, 5%, 94%)' },
77
+ 40: { value: 'hsl(210, 5%, 87%)' },
78
+ 60: { value: 'hsl(210, 10%, 58%)' },
79
+ 80: { value: 'hsl(210, 10%, 40%)' },
80
+ 90: { value: 'hsl(210, 25%, 25%)' },
81
+ 100: { value: 'hsl(210, 50%, 10%)' },
82
+ },
83
+ primary: {
84
+ 10: { value: '{colors.teal.10.value}' },
85
+ 20: { value: '{colors.teal.20.value}' },
86
+ 40: { value: '{colors.teal.40.value}' },
87
+ 60: { value: '{colors.teal.60.value}' },
88
+ 80: { value: '{colors.teal.80.value}' },
89
+ 90: { value: '{colors.teal.90.value}' },
90
+ 100: { value: '{colors.teal.100.value}' },
91
+ },
92
+ secondary: {
93
+ 10: { value: '{colors.purple.10.value}' },
94
+ 20: { value: '{colors.purple.20.value}' },
95
+ 40: { value: '{colors.purple.40.value}' },
96
+ 60: { value: '{colors.purple.60.value}' },
97
+ 80: { value: '{colors.purple.80.value}' },
98
+ 90: { value: '{colors.purple.90.value}' },
99
+ 100: { value: '{colors.purple.100.value}' },
100
+ },
101
+ font: {
102
+ primary: { value: '{colors.neutral.100.value}' },
103
+ secondary: { value: '{colors.neutral.90.value}' },
104
+ tertiary: { value: '{colors.neutral.80.value}' },
105
+ disabled: { value: '{colors.neutral.60.value}' },
106
+ inverse: { value: '{colors.white.value}' },
107
+ interactive: { value: '{colors.primary.80.value}' },
108
+ // Hover and Focus colors are intentionally different colors.
109
+ // This allows users to distinguish between the current keyboard focus
110
+ // and the location of their pointer
111
+ hover: { value: '{colors.primary.90.value}' },
112
+ // Focus color is set to 100 to ensure enough contrast for accessibility
113
+ focus: { value: '{colors.primary.100.value}' },
114
+ active: { value: '{colors.primary.100.value}' },
115
+ info: { value: '{colors.blue.90.value}' },
116
+ warning: { value: '{colors.orange.90.value}' },
117
+ error: { value: '{colors.red.90.value}' },
118
+ success: { value: '{colors.green.90.value}' },
119
+ },
120
+ background: {
121
+ primary: { value: '{colors.white.value}' },
122
+ secondary: { value: '{colors.neutral.10.value}' },
123
+ tertiary: { value: '{colors.neutral.20.value}' },
124
+ quaternary: { value: '{colors.neutral.60.value}' },
125
+ disabled: { value: '{colors.background.tertiary.value}' },
126
+ info: { value: '{colors.blue.10.value}' },
127
+ warning: { value: '{colors.orange.10.value}' },
128
+ error: { value: '{colors.red.10.value}' },
129
+ success: { value: '{colors.green.10.value}' },
130
+ },
131
+ border: {
132
+ primary: { value: '{colors.neutral.60.value}' },
133
+ secondary: { value: '{colors.neutral.40.value}' },
134
+ tertiary: { value: '{colors.neutral.20.value}' },
135
+ disabled: { value: '{colors.border.tertiary.value}' },
136
+ pressed: { value: '{colors.primary.100.value}' },
137
+ // Focus color is set to 100 to ensure enough contrast for accessibility
138
+ focus: { value: '{colors.primary.100.value}' },
139
+ error: { value: '{colors.red.80.value}' },
140
+ info: { value: '{colors.blue.80.value}' },
141
+ success: { value: '{colors.green.80.value}' },
142
+ warning: { value: '{colors.orange.80.value}' },
143
+ },
144
+ shadow: {
145
+ primary: { value: 'hsla(210, 50%, 10%, 0.25)' },
146
+ secondary: { value: 'hsla(210, 50%, 10%, 0.15)' },
147
+ tertiary: { value: 'hsla(210, 50%, 10%, 0.05)' },
148
+ },
149
+ overlay: {
150
+ 5: { value: 'hsla(0, 0%, 0%, 0.05)' },
151
+ 10: { value: 'hsla(0, 0%, 0%, 0.1)' },
152
+ 20: { value: 'hsla(0, 0%, 0%, 0.2)' },
153
+ 30: { value: 'hsla(0, 0%, 0%, 0.3)' },
154
+ 40: { value: 'hsla(0, 0%, 0%, 0.4)' },
155
+ 50: { value: 'hsla(0, 0%, 0%, 0.5)' },
156
+ 60: { value: 'hsla(0, 0%, 0%, 0.6)' },
157
+ 70: { value: 'hsla(0, 0%, 0%, 0.7)' },
158
+ 80: { value: 'hsla(0, 0%, 0%, 0.8)' },
159
+ 90: { value: 'hsla(0, 0%, 0%, 0.9)' },
160
+ },
161
+ black: { value: 'hsl(0, 0%, 0%)' },
162
+ white: { value: 'hsl(0, 0%, 100%)' },
163
+ transparent: { value: 'transparent' },
164
+ };
165
+
166
+ export { colors };
@@ -0,0 +1,47 @@
1
+ const accordion = {
2
+ backgroundColor: { value: '{colors.background.primary.value}' },
3
+ item: {
4
+ borderColor: { value: '{colors.border.secondary.value}' },
5
+ borderWidth: { value: '{borderWidths.small.value}' },
6
+ borderStyle: { value: 'solid' },
7
+ borderRadius: { value: '{radii.small.value}' },
8
+ trigger: {
9
+ alignItems: { value: 'center' },
10
+ backgroundColor: { value: '{colors.background.primary.value}' },
11
+ color: { value: 'inherit' },
12
+ gap: { value: '{space.small.value}' },
13
+ justifyContent: { value: 'space-between' },
14
+ paddingBlock: { value: '{space.xs.value}' },
15
+ paddingInline: { value: '{space.small.value}' },
16
+ _hover: {
17
+ color: { value: 'inherit' },
18
+ backgroundColor: { value: '{colors.overlay.5.value}' },
19
+ },
20
+ _focus: {
21
+ borderColor: { value: '{colors.border.focus.value}' },
22
+ boxShadow: {
23
+ value: {
24
+ offsetX: '0',
25
+ offsetY: '0',
26
+ blurRadius: '0',
27
+ spreadRadius: '2px',
28
+ color: '{colors.border.focus.value}',
29
+ },
30
+ },
31
+ },
32
+ },
33
+ content: {
34
+ color: { value: 'inherit' },
35
+ paddingInline: { value: '{space.small.value}' },
36
+ paddingBlockEnd: { value: '{space.small.value}' },
37
+ paddingBlockStart: { value: '{space.xxxs.value}' },
38
+ },
39
+ icon: {
40
+ color: { value: '{colors.font.tertiary.value}' },
41
+ transitionDuration: { value: '{time.medium.value}' },
42
+ transitionTimingFunction: { value: 'cubic-bezier(0.87, 0, 0.13, 1)' },
43
+ },
44
+ },
45
+ };
46
+
47
+ export { accordion };
@@ -1 +1,35 @@
1
- const o={alignItems:{value:"center"},justifyContent:{value:"space-between"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.tertiary.value}"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.medium.value}"},icon:{size:{value:"{fontSizes.xl.value}"}},heading:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"}}};export{o as alert};
1
+ const alert = {
2
+ // Default styles
3
+ alignItems: { value: 'center' },
4
+ justifyContent: { value: 'space-between' },
5
+ color: { value: '{colors.font.primary.value}' },
6
+ backgroundColor: { value: '{colors.background.tertiary.value}' },
7
+ paddingBlock: { value: '{space.small.value}' },
8
+ paddingInline: { value: '{space.medium.value}' },
9
+ icon: {
10
+ size: { value: '{fontSizes.xl.value}' },
11
+ },
12
+ heading: {
13
+ fontSize: { value: '{fontSizes.medium.value}' },
14
+ fontWeight: { value: '{fontWeights.bold.value}' },
15
+ },
16
+ // Variations
17
+ info: {
18
+ color: { value: '{colors.font.info.value}' },
19
+ backgroundColor: { value: '{colors.background.info.value}' },
20
+ },
21
+ error: {
22
+ color: { value: '{colors.font.error.value}' },
23
+ backgroundColor: { value: '{colors.background.error.value}' },
24
+ },
25
+ warning: {
26
+ color: { value: '{colors.font.warning.value}' },
27
+ backgroundColor: { value: '{colors.background.warning.value}' },
28
+ },
29
+ success: {
30
+ color: { value: '{colors.font.success.value}' },
31
+ backgroundColor: { value: '{colors.background.success.value}' },
32
+ },
33
+ };
34
+
35
+ export { alert };