@mycause/ui 0.0.0-cb5efc7a → 0.0.0-cb8edf5f

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 (439) hide show
  1. package/README.md +26 -0
  2. package/dist/components/anchor/anchor.d.ts +1 -1
  3. package/dist/components/anchor/anchor.stories.d.ts +2 -2
  4. package/dist/components/anchor/bold-anchor.d.ts +1 -1
  5. package/dist/components/anchor/bold-anchor.stories.d.ts +2 -2
  6. package/dist/components/avatar/avatar.d.ts +3 -3
  7. package/dist/components/avatar/avatar.stories.d.ts +3 -3
  8. package/dist/components/avatar/image-avatar.d.ts +1 -1
  9. package/dist/components/avatar/text-avatar.d.ts +1 -1
  10. package/dist/components/button/button.d.ts +2 -2
  11. package/dist/components/button/button.stories.d.ts +10 -10
  12. package/dist/components/button-select/button-select-exhanced.d.ts +23 -0
  13. package/dist/components/button-select/button-select.d.ts +12 -0
  14. package/dist/components/button-select/button-select.stories.d.ts +19 -0
  15. package/dist/components/button-select/index.d.ts +2 -0
  16. package/dist/components/campaign-card/campaign-card.d.ts +9 -0
  17. package/dist/components/campaign-card/campaign-card.stories.d.ts +14 -0
  18. package/dist/components/campaign-card/index.d.ts +1 -0
  19. package/dist/components/campaign-of-month/campaign-of-month.d.ts +15 -0
  20. package/dist/components/campaign-of-month/campaign-of-month.stories.d.ts +14 -0
  21. package/dist/components/campaign-of-month/index.d.ts +1 -0
  22. package/dist/components/charity-card/charity-card.d.ts +7 -0
  23. package/dist/components/charity-card/charity-card.stories.d.ts +14 -0
  24. package/dist/components/charity-card/index.d.ts +1 -0
  25. package/dist/components/charity-tags-filter-button/FilterIcon.d.ts +6 -0
  26. package/dist/components/charity-tags-filter-button/charity-tags-filter-button.d.ts +36 -0
  27. package/dist/components/charity-tags-filter-button/charity-tags-filter-button.stories.d.ts +12 -0
  28. package/dist/components/charity-tags-filter-button/index.d.ts +1 -0
  29. package/dist/components/checkbox/checkbox.d.ts +1 -1
  30. package/dist/components/checkbox/checkbox.stories.d.ts +4 -4
  31. package/dist/components/chips/chip.d.ts +2 -2
  32. package/dist/components/chips/chips.d.ts +2 -2
  33. package/dist/components/chips/chips.stories.d.ts +4 -4
  34. package/dist/components/chips/input-chips.d.ts +1 -1
  35. package/dist/components/chips/input-chips.stories.d.ts +2 -2
  36. package/dist/components/collapse/collapse.d.ts +21 -0
  37. package/dist/components/collapse/collapse.stories.d.ts +19 -0
  38. package/dist/components/collapse/icons.d.ts +4 -0
  39. package/dist/components/collapse/index.d.ts +1 -0
  40. package/dist/components/combo-field/combo-field-expander.d.ts +1 -1
  41. package/dist/components/combo-field/combo-field.d.ts +4 -1
  42. package/dist/components/combo-field/combo-field.stories.d.ts +3 -3
  43. package/dist/components/comment-section/comment-section-v2/comment-section-v2.d.ts +31 -0
  44. package/dist/components/comment-section/comment-section-v2/sub-comments-v2.d.ts +11 -0
  45. package/dist/components/comment-section/comment-section.d.ts +15 -0
  46. package/dist/components/comment-section/comment-section.stories.d.ts +19 -0
  47. package/dist/components/comment-section/comment-type.d.ts +10 -0
  48. package/dist/components/comment-section/index.d.ts +2 -0
  49. package/dist/components/comment-section/sub-comments.d.ts +6 -0
  50. package/dist/components/cropper/cropper.d.ts +4 -4
  51. package/dist/components/cropper/cropper.stories.d.ts +3 -4
  52. package/dist/components/date-picker/date-picker.d.ts +1 -1
  53. package/dist/components/date-picker/date-picker.stories.d.ts +11 -5
  54. package/dist/components/date-picker/index.d.ts +1 -0
  55. package/dist/components/date-picker/single-date-picker-custom-header.d.ts +32 -0
  56. package/dist/components/date-picker/single-date-picker.d.ts +5 -3
  57. package/dist/components/donate-card/donate-card.d.ts +8 -0
  58. package/dist/components/donate-card/donate-card.stories.d.ts +14 -0
  59. package/dist/components/donate-card/index.d.ts +1 -0
  60. package/dist/components/donation-form/donation-details.d.ts +12 -0
  61. package/dist/components/donation-form/donation-form-v2/donation-form-v2.d.ts +13 -0
  62. package/dist/components/donation-form/donation-form.d.ts +64 -0
  63. package/dist/components/donation-form/donation-form.stories.d.ts +18 -0
  64. package/dist/components/donation-form/donation-payment.d.ts +13 -0
  65. package/dist/components/donation-form/donation-select.d.ts +13 -0
  66. package/dist/components/donation-form/index.d.ts +2 -0
  67. package/dist/components/{index.js → donation.d.ts} +3 -12
  68. package/dist/components/elevation/elevation.d.ts +2 -1
  69. package/dist/components/elevation/elevation.stories.d.ts +2 -2
  70. package/dist/components/favorite-charity-item/favorite-charity-item.d.ts +15 -0
  71. package/dist/components/favorite-charity-item/favorite-charity-item.stories.d.ts +15 -0
  72. package/dist/components/favorite-charity-item/index.d.ts +1 -0
  73. package/dist/components/featured-campaign-card/featured-campaign-card.d.ts +17 -0
  74. package/dist/components/featured-campaign-card/featured-campaign-card.stories.d.ts +14 -0
  75. package/dist/components/featured-campaign-card/index.d.ts +1 -0
  76. package/dist/components/field-helpers/field-helper-text.d.ts +2 -2
  77. package/dist/components/field-helpers/field-label.d.ts +2 -1
  78. package/dist/components/footerV2/footerV2.d.ts +35 -0
  79. package/dist/components/{phone-number-input/phone-number-field.stories.d.ts → footerV2/footerV2.stories.d.ts} +5 -3
  80. package/dist/components/footerV2/index.d.ts +1 -0
  81. package/dist/components/fundraising-section/fundraising-section.d.ts +9 -0
  82. package/dist/components/fundraising-section/fundraising-section.stories.d.ts +14 -0
  83. package/dist/components/fundraising-section/index.d.ts +1 -0
  84. package/dist/components/hero-banner/hero-banner.d.ts +9 -0
  85. package/dist/components/hero-banner/hero-banner.stories.d.ts +14 -0
  86. package/dist/components/hero-banner/index.d.ts +1 -0
  87. package/dist/components/horizontalbar/horizontalbar.d.ts +11 -0
  88. package/dist/components/horizontalbar/horizontalbar.stories.d.ts +26 -0
  89. package/dist/components/horizontalbar/index.d.ts +1 -0
  90. package/dist/components/icon/btn_google_light_normal_ios.svg.d.ts +1 -1
  91. package/dist/components/icon/facebook_6.svg.d.ts +1 -1
  92. package/dist/components/icon/heart-toggle.d.ts +11 -0
  93. package/dist/components/icon/{toggle-button.stories.d.ts → heart-toggle.stories.d.ts} +3 -3
  94. package/dist/components/icon/icon-button-group.d.ts +1 -1
  95. package/dist/components/icon/icon-button-group.stories.d.ts +2 -2
  96. package/dist/components/icon/icon-button.d.ts +1 -1
  97. package/dist/components/icon/icon-button.stories.d.ts +3 -3
  98. package/dist/components/icon/icon.d.ts +1 -1
  99. package/dist/components/icon/icon.stories.d.ts +4 -4
  100. package/dist/components/icon/index.d.ts +1 -1
  101. package/dist/components/icon/material-icon.d.ts +2 -2
  102. package/dist/components/index.d.ts +37 -0
  103. package/dist/components/info-represent-campaign/index.d.ts +1 -0
  104. package/dist/components/info-represent-campaign/info-represent-campaign.d.ts +11 -0
  105. package/dist/components/info-represent-campaign/info-represent-campaign.stories.d.ts +12 -0
  106. package/dist/components/input/InputDefault.d.ts +13 -0
  107. package/dist/components/input/index.d.ts +1 -0
  108. package/dist/components/input/input.stories.d.ts +24 -0
  109. package/dist/components/input-social/Icons.d.ts +8 -0
  110. package/dist/components/input-social/InputSocial.d.ts +12 -0
  111. package/dist/components/input-social/index.d.ts +1 -0
  112. package/dist/components/{phone-number-field/phone-number-field.stories.d.ts → input-social/input-social.stories.d.ts} +3 -3
  113. package/dist/components/layout/box.d.ts +232 -224
  114. package/dist/components/layout/flex.d.ts +4 -4
  115. package/dist/components/layout/flex.stories.d.ts +2 -2
  116. package/dist/components/layout/grid.d.ts +2 -2
  117. package/dist/components/layout/grid.stories.d.ts +2 -2
  118. package/dist/components/layout/stack.d.ts +2 -2
  119. package/dist/components/layout/stack.stories.d.ts +4 -4
  120. package/dist/components/list/list.d.ts +30 -15
  121. package/dist/components/list/list.stories.d.ts +14 -8
  122. package/dist/components/login/index.d.ts +1 -0
  123. package/dist/components/login/login.d.ts +18 -0
  124. package/dist/components/login/login.stories.d.ts +19 -0
  125. package/dist/components/logo/logo-type.d.ts +4 -3
  126. package/dist/components/menu/menu-list-item.d.ts +2 -2
  127. package/dist/components/menu/menu-list.d.ts +2 -2
  128. package/dist/components/menu/menu.stories.d.ts +2 -2
  129. package/dist/components/modal/index.d.ts +1 -0
  130. package/dist/components/modal/modal-image.d.ts +8 -0
  131. package/dist/components/modal/modal.d.ts +7 -3
  132. package/dist/components/modal/modal.stories.d.ts +22 -4
  133. package/dist/components/my-account-choose-charity-card/index.d.ts +1 -0
  134. package/dist/components/my-account-choose-charity-card/my-account-choose-charity-card.d.ts +11 -0
  135. package/dist/components/my-account-choose-charity-card/my-account-choose-charity-card.stories.d.ts +14 -0
  136. package/dist/components/my-account-frp-closed/Icon.d.ts +5 -0
  137. package/dist/components/my-account-frp-closed/frp-closed-img.d.ts +8 -0
  138. package/dist/components/my-account-frp-closed/frp-information.d.ts +16 -0
  139. package/dist/components/my-account-frp-closed/index.d.ts +1 -0
  140. package/dist/components/my-account-frp-closed/my-account-frp-closed.d.ts +20 -0
  141. package/dist/components/my-account-frp-closed/my-account-frp-closed.stories.d.ts +24 -0
  142. package/dist/components/my-account-frp-preview/Icon.d.ts +5 -0
  143. package/dist/components/my-account-frp-preview/frp-information.d.ts +13 -0
  144. package/dist/components/my-account-frp-preview/frp-preview-img.d.ts +9 -0
  145. package/dist/components/my-account-frp-preview/index.d.ts +1 -0
  146. package/dist/components/my-account-frp-preview/my-account-frp-preview.d.ts +17 -0
  147. package/dist/components/my-account-frp-preview/my-account-frp-preview.stories.d.ts +24 -0
  148. package/dist/components/my-account-sidebar/Icon.d.ts +15 -0
  149. package/dist/components/my-account-sidebar/index.d.ts +1 -0
  150. package/dist/components/my-account-sidebar/my-account-sidebar.d.ts +19 -0
  151. package/dist/components/my-account-sidebar/my-account-sidebar.stories.d.ts +12 -0
  152. package/dist/components/my-account-start-fundraise-card/index.d.ts +1 -0
  153. package/dist/components/my-account-start-fundraise-card/my-account-start-fundraise-card.d.ts +13 -0
  154. package/dist/components/my-account-start-fundraise-card/my-account-start-fundraise-card.stories.d.ts +20 -0
  155. package/dist/components/my-account-stats-donated/index.d.ts +1 -0
  156. package/dist/components/my-account-stats-donated/my-account-stats-donated.d.ts +8 -0
  157. package/dist/components/my-account-stats-donated/my-account-stats-donated.stories.d.ts +12 -0
  158. package/dist/components/my-account-stats-raised/index.d.ts +1 -0
  159. package/dist/components/my-account-stats-raised/my-account-stats-raised.d.ts +7 -0
  160. package/dist/components/my-account-stats-raised/my-account-stats-raised.stories.d.ts +12 -0
  161. package/dist/components/nav/charity.d.ts +3 -0
  162. package/dist/components/nav/icons/IconBigger.d.ts +5 -0
  163. package/dist/components/nav/icons/IconSmaller.d.ts +5 -0
  164. package/dist/components/nav/index.d.ts +2 -0
  165. package/dist/components/nav/nav-actions.d.ts +5 -0
  166. package/dist/components/nav/nav-bar.d.ts +7 -0
  167. package/dist/components/nav/nav-call-to-action.d.ts +5 -0
  168. package/dist/components/nav/nav-charity.d.ts +7 -0
  169. package/dist/components/nav/nav-expanded-charity-new.d.ts +12 -0
  170. package/dist/components/nav/nav-expanded-charity.d.ts +14 -0
  171. package/dist/components/nav/nav-expanded.d.ts +14 -0
  172. package/dist/components/nav/nav-list.d.ts +29 -0
  173. package/dist/components/nav/nav-menu-control.d.ts +8 -0
  174. package/dist/components/nav/nav-menu.d.ts +12 -0
  175. package/dist/components/nav/nav-myaccount.d.ts +23 -0
  176. package/dist/components/nav/nav-search-control.d.ts +8 -0
  177. package/dist/components/nav/nav-search.d.ts +10 -0
  178. package/dist/components/nav/nav-sign-in-control.d.ts +12 -0
  179. package/dist/components/nav/nav-user-menu-items.d.ts +20 -0
  180. package/dist/components/nav/nav-user-menu.d.ts +18 -0
  181. package/dist/components/nav/nav.d.ts +62 -0
  182. package/dist/components/nav/nav.stories.d.ts +17 -0
  183. package/dist/components/navigation/navigation-actions.d.ts +1 -1
  184. package/dist/components/navigation/navigation-bar.d.ts +2 -2
  185. package/dist/components/navigation/navigation-call-to-action.d.ts +3 -3
  186. package/dist/components/navigation/navigation-expanded.d.ts +2 -2
  187. package/dist/components/navigation/navigation-list.d.ts +9 -7
  188. package/dist/components/navigation/navigation-menu-control.d.ts +1 -1
  189. package/dist/components/navigation/navigation-menu.d.ts +4 -3
  190. package/dist/components/navigation/navigation-search-control.d.ts +2 -2
  191. package/dist/components/navigation/navigation-search.d.ts +2 -2
  192. package/dist/components/navigation/navigation-sign-in-control.d.ts +6 -3
  193. package/dist/components/navigation/navigation-user-menu-items.d.ts +6 -6
  194. package/dist/components/navigation/navigation-user-menu.d.ts +4 -4
  195. package/dist/components/navigation/navigation.d.ts +17 -6
  196. package/dist/components/navigation/navigation.stories.d.ts +7 -25
  197. package/dist/components/partner-chart-stats/index.d.ts +1 -0
  198. package/dist/components/partner-chart-stats/partner-chart-stats.d.ts +11 -0
  199. package/dist/components/partner-chart-stats/partner-chart-stats.stories.d.ts +18 -0
  200. package/dist/components/partner-monthly-donations/index.d.ts +1 -0
  201. package/dist/components/partner-monthly-donations/partner-monthly-donations.d.ts +8 -0
  202. package/dist/components/partner-monthly-donations/partner-monthly-donations.stories.d.ts +12 -0
  203. package/dist/components/partner-monthly-stats/index.d.ts +1 -0
  204. package/dist/components/partner-monthly-stats/partner-monthly-stats.d.ts +7 -0
  205. package/dist/components/partner-monthly-stats/partner-monthly-stats.stories.d.ts +12 -0
  206. package/dist/components/partner-toggle-button/index.d.ts +2 -0
  207. package/dist/components/partner-toggle-button/partner-toggle-button-block.d.ts +11 -0
  208. package/dist/components/partner-toggle-button/partner-toggle-button-block.stories.d.ts +12 -0
  209. package/dist/components/partner-toggle-button/partner-toggle-button.d.ts +8 -0
  210. package/dist/components/phone-number-input/index.d.ts +2 -1
  211. package/dist/components/{phone-number-field/phone-number-field.d.ts → phone-number-input/phone-number-input-v1.d.ts} +8 -4
  212. package/dist/components/phone-number-input/phone-number-input-v2.d.ts +19 -0
  213. package/dist/components/phone-number-input/phone-number-input.d.ts +22 -11
  214. package/dist/components/phone-number-input/phone-number-input.stories.d.ts +43 -0
  215. package/dist/components/popup/index.d.ts +1 -0
  216. package/dist/components/popup/popup.d.ts +8 -0
  217. package/dist/components/popup/popup.stories.d.ts +14 -0
  218. package/dist/components/progressbar/index.d.ts +1 -0
  219. package/dist/components/progressbar/progress-bar-circle.d.ts +10 -0
  220. package/dist/components/progressbar/progressbar.d.ts +8 -0
  221. package/dist/components/progressbar/progressbar.stories.d.ts +20 -0
  222. package/dist/components/radio/radio-group.d.ts +1 -1
  223. package/dist/components/radio/radio-group.stories.d.ts +2 -2
  224. package/dist/components/radio/radio.d.ts +1 -1
  225. package/dist/components/radio/radio.stories.d.ts +4 -4
  226. package/dist/components/select/index.d.ts +2 -0
  227. package/dist/components/select/select-enhanced.d.ts +24 -0
  228. package/dist/components/select/select-helper-text.d.ts +1 -1
  229. package/dist/components/select/select-v2.d.ts +27 -0
  230. package/dist/components/select/select.d.ts +6 -3
  231. package/dist/components/select/select.stories.d.ts +14 -2
  232. package/dist/components/spinner/index.d.ts +1 -0
  233. package/dist/components/spinner/spinner.d.ts +9 -0
  234. package/dist/components/spinner/spinner.stories.d.ts +19 -0
  235. package/dist/components/statistics/statistics.d.ts +2 -1
  236. package/dist/components/statistics/statistics.stories.d.ts +2 -2
  237. package/dist/components/switch/index.d.ts +1 -0
  238. package/dist/components/switch/switch-v2.d.ts +8 -0
  239. package/dist/components/switch/switch.d.ts +1 -1
  240. package/dist/components/switch/switch.stories.d.ts +10 -4
  241. package/dist/components/table/index.d.ts +1 -0
  242. package/dist/components/table/partner-monthly-table.d.ts +19 -0
  243. package/dist/components/table/partner-monthly-table.stories.d.ts +18 -0
  244. package/dist/components/tabs/nav-tabs.d.ts +18 -0
  245. package/dist/components/tabs/tab-text-label.d.ts +1 -1
  246. package/dist/components/tabs/tabs.d.ts +4 -2
  247. package/dist/components/tabs/tabs.stories.d.ts +2 -2
  248. package/dist/components/text/text.d.ts +4 -5
  249. package/dist/components/text/text.stories.d.ts +7 -7
  250. package/dist/components/text-field/index.d.ts +1 -0
  251. package/dist/components/text-field/text-field-helper-text.d.ts +1 -1
  252. package/dist/components/text-field/text-field-search.d.ts +10 -0
  253. package/dist/components/text-field/text-field.d.ts +2 -0
  254. package/dist/components/text-field/text-field.stories.d.ts +8 -2
  255. package/dist/components/this-month-card/index.d.ts +1 -0
  256. package/dist/components/this-month-card/this-month-card.d.ts +15 -0
  257. package/dist/components/this-month-card/this-month-card.stories.d.ts +12 -0
  258. package/dist/components/toast/Icons.d.ts +7 -0
  259. package/dist/components/toast/index.d.ts +1 -0
  260. package/dist/components/toast/toast.d.ts +8 -0
  261. package/dist/components/toast/toast.stories.d.ts +12 -0
  262. package/dist/components/transaction-card/Dot.d.ts +6 -0
  263. package/dist/components/transaction-card/index.d.ts +1 -0
  264. package/dist/components/transaction-card/transaction-card.d.ts +16 -0
  265. package/dist/components/transaction-card/transaction-card.stories.d.ts +20 -0
  266. package/dist/components/uploader/uploader.d.ts +1 -1
  267. package/dist/donation.css +2 -0
  268. package/dist/donation.css.map +1 -0
  269. package/dist/donation.d.ts +3 -0
  270. package/dist/donation.esm.css +2 -0
  271. package/dist/donation.esm.css.map +1 -0
  272. package/dist/donation.esm.js +25306 -0
  273. package/dist/donation.js +25361 -0
  274. package/dist/index.css +2 -0
  275. package/dist/index.css.map +1 -0
  276. package/dist/index.esm.css +2 -0
  277. package/dist/index.esm.css.map +1 -0
  278. package/dist/index.esm.js +28997 -7215
  279. package/dist/index.js +29030 -7199
  280. package/dist/theme/theme.d.ts +9 -5
  281. package/dist/utils/center-decorator.d.ts +1 -1
  282. package/dist/utils/component-matrix.d.ts +1 -1
  283. package/dist/utils/grid-decorator.d.ts +1 -1
  284. package/dist/utils/parse-numbers.d.ts +2 -0
  285. package/package.json +34 -20
  286. package/styles/index.css +5 -6883
  287. package/styles/index.css.map +1 -0
  288. package/styles/reset.css +2 -315
  289. package/styles/reset.css.map +1 -0
  290. package/CHANGELOG.md +0 -340
  291. package/dist/components/anchor/anchor.jsx +0 -35
  292. package/dist/components/anchor/anchor.stories.jsx +0 -12
  293. package/dist/components/anchor/bold-anchor.jsx +0 -33
  294. package/dist/components/anchor/bold-anchor.stories.jsx +0 -11
  295. package/dist/components/anchor/index.js +0 -2
  296. package/dist/components/avatar/avatar.jsx +0 -14
  297. package/dist/components/avatar/avatar.stories.jsx +0 -17
  298. package/dist/components/avatar/image-avatar.jsx +0 -29
  299. package/dist/components/avatar/index.js +0 -1
  300. package/dist/components/avatar/text-avatar.jsx +0 -47
  301. package/dist/components/button/button.jsx +0 -85
  302. package/dist/components/button/button.stories.jsx +0 -118
  303. package/dist/components/button/index.js +0 -1
  304. package/dist/components/checkbox/checkbox.jsx +0 -39
  305. package/dist/components/checkbox/checkbox.stories.jsx +0 -42
  306. package/dist/components/checkbox/index.js +0 -1
  307. package/dist/components/chips/chip.jsx +0 -30
  308. package/dist/components/chips/chips.jsx +0 -16
  309. package/dist/components/chips/chips.stories.jsx +0 -35
  310. package/dist/components/chips/index.js +0 -3
  311. package/dist/components/chips/input-chips.jsx +0 -16
  312. package/dist/components/chips/input-chips.stories.jsx +0 -39
  313. package/dist/components/combo-field/combo-field-expander.jsx +0 -23
  314. package/dist/components/combo-field/combo-field.jsx +0 -93
  315. package/dist/components/combo-field/combo-field.stories.jsx +0 -62
  316. package/dist/components/combo-field/index.js +0 -2
  317. package/dist/components/cropper/cropper.jsx +0 -15
  318. package/dist/components/cropper/cropper.stories.jsx +0 -18
  319. package/dist/components/cropper/index.js +0 -1
  320. package/dist/components/date-picker/date-picker.jsx +0 -74
  321. package/dist/components/date-picker/date-picker.stories.jsx +0 -46
  322. package/dist/components/date-picker/index.js +0 -2
  323. package/dist/components/date-picker/single-date-picker.jsx +0 -81
  324. package/dist/components/elevation/elevation.jsx +0 -19
  325. package/dist/components/elevation/elevation.stories.jsx +0 -31
  326. package/dist/components/elevation/index.js +0 -1
  327. package/dist/components/field-helpers/field-helper-text.jsx +0 -42
  328. package/dist/components/field-helpers/field-label.jsx +0 -29
  329. package/dist/components/field-helpers/index.js +0 -2
  330. package/dist/components/icon/btn_google_light_normal_ios.svg.jsx +0 -21
  331. package/dist/components/icon/facebook_6.svg.jsx +0 -13
  332. package/dist/components/icon/icon-button-group.jsx +0 -51
  333. package/dist/components/icon/icon-button-group.stories.jsx +0 -26
  334. package/dist/components/icon/icon-button.jsx +0 -48
  335. package/dist/components/icon/icon-button.stories.jsx +0 -33
  336. package/dist/components/icon/icon.jsx +0 -49
  337. package/dist/components/icon/icon.stories.jsx +0 -78
  338. package/dist/components/icon/index.js +0 -4
  339. package/dist/components/icon/material-icon.jsx +0 -18
  340. package/dist/components/icon/toggle-button.d.ts +0 -11
  341. package/dist/components/icon/toggle-button.jsx +0 -29
  342. package/dist/components/icon/toggle-button.stories.jsx +0 -16
  343. package/dist/components/layout/box.jsx +0 -58
  344. package/dist/components/layout/flex.jsx +0 -55
  345. package/dist/components/layout/flex.stories.jsx +0 -44
  346. package/dist/components/layout/grid.jsx +0 -19
  347. package/dist/components/layout/grid.stories.jsx +0 -29
  348. package/dist/components/layout/index.js +0 -4
  349. package/dist/components/layout/stack.jsx +0 -33
  350. package/dist/components/layout/stack.stories.jsx +0 -40
  351. package/dist/components/list/index.js +0 -1
  352. package/dist/components/list/list.jsx +0 -52
  353. package/dist/components/list/list.stories.jsx +0 -135
  354. package/dist/components/logo/index.js +0 -1
  355. package/dist/components/logo/logo-type.jsx +0 -65
  356. package/dist/components/menu/index.js +0 -8
  357. package/dist/components/menu/menu-list-divider.jsx +0 -2
  358. package/dist/components/menu/menu-list-item-graphic.jsx +0 -2
  359. package/dist/components/menu/menu-list-item-meta.jsx +0 -2
  360. package/dist/components/menu/menu-list-item-text.jsx +0 -2
  361. package/dist/components/menu/menu-list-item.jsx +0 -11
  362. package/dist/components/menu/menu-list.jsx +0 -18
  363. package/dist/components/menu/menu-surface.jsx +0 -4
  364. package/dist/components/menu/menu.jsx +0 -2
  365. package/dist/components/menu/menu.stories.jsx +0 -42
  366. package/dist/components/modal/index.js +0 -1
  367. package/dist/components/modal/modal.jsx +0 -49
  368. package/dist/components/modal/modal.stories.jsx +0 -47
  369. package/dist/components/navigation/index.js +0 -1
  370. package/dist/components/navigation/navigation-actions.jsx +0 -8
  371. package/dist/components/navigation/navigation-bar.jsx +0 -42
  372. package/dist/components/navigation/navigation-call-to-action.jsx +0 -6
  373. package/dist/components/navigation/navigation-expanded.jsx +0 -165
  374. package/dist/components/navigation/navigation-list.jsx +0 -126
  375. package/dist/components/navigation/navigation-menu-control.jsx +0 -25
  376. package/dist/components/navigation/navigation-menu.jsx +0 -103
  377. package/dist/components/navigation/navigation-search-control.jsx +0 -8
  378. package/dist/components/navigation/navigation-search.jsx +0 -63
  379. package/dist/components/navigation/navigation-sign-in-control.jsx +0 -14
  380. package/dist/components/navigation/navigation-user-menu-items.jsx +0 -36
  381. package/dist/components/navigation/navigation-user-menu.jsx +0 -121
  382. package/dist/components/navigation/navigation.jsx +0 -137
  383. package/dist/components/navigation/navigation.stories.jsx +0 -260
  384. package/dist/components/phone-number-field/index.d.ts +0 -2
  385. package/dist/components/phone-number-field/index.js +0 -2
  386. package/dist/components/phone-number-field/phone-number-field.jsx +0 -50
  387. package/dist/components/phone-number-field/phone-number-field.stories.jsx +0 -23
  388. package/dist/components/phone-number-field/util.d.ts +0 -2
  389. package/dist/components/phone-number-field/util.js +0 -19
  390. package/dist/components/phone-number-input/index.js +0 -3
  391. package/dist/components/phone-number-input/phone-number-field.d.ts +0 -23
  392. package/dist/components/phone-number-input/phone-number-field.jsx +0 -50
  393. package/dist/components/phone-number-input/phone-number-field.stories.jsx +0 -16
  394. package/dist/components/phone-number-input/phone-number-input.jsx +0 -48
  395. package/dist/components/phone-number-input/util.js +0 -19
  396. package/dist/components/radio/index.js +0 -2
  397. package/dist/components/radio/radio-group.jsx +0 -9
  398. package/dist/components/radio/radio-group.stories.jsx +0 -21
  399. package/dist/components/radio/radio.jsx +0 -31
  400. package/dist/components/radio/radio.stories.jsx +0 -44
  401. package/dist/components/select/index.js +0 -2
  402. package/dist/components/select/select-helper-text.jsx +0 -6
  403. package/dist/components/select/select.jsx +0 -152
  404. package/dist/components/select/select.stories.jsx +0 -40
  405. package/dist/components/statistics/index.js +0 -1
  406. package/dist/components/statistics/statistics.jsx +0 -61
  407. package/dist/components/statistics/statistics.stories.jsx +0 -34
  408. package/dist/components/switch/index.js +0 -1
  409. package/dist/components/switch/switch.jsx +0 -32
  410. package/dist/components/switch/switch.stories.jsx +0 -41
  411. package/dist/components/tabs/index.js +0 -1
  412. package/dist/components/tabs/tab-bar.jsx +0 -35
  413. package/dist/components/tabs/tab-text-label.jsx +0 -5
  414. package/dist/components/tabs/tab.jsx +0 -50
  415. package/dist/components/tabs/tabs.jsx +0 -65
  416. package/dist/components/tabs/tabs.stories.jsx +0 -27
  417. package/dist/components/text/index.js +0 -1
  418. package/dist/components/text/text.jsx +0 -138
  419. package/dist/components/text/text.stories.jsx +0 -262
  420. package/dist/components/text-field/index.js +0 -2
  421. package/dist/components/text-field/text-field-helper-text.jsx +0 -8
  422. package/dist/components/text-field/text-field.jsx +0 -124
  423. package/dist/components/text-field/text-field.stories.jsx +0 -32
  424. package/dist/components/uploader/index.js +0 -1
  425. package/dist/components/uploader/uploader.jsx +0 -96
  426. package/dist/input.d.ts +0 -1
  427. package/dist/input.js +0 -4
  428. package/dist/input.jsx +0 -4
  429. package/dist/theme/colors.js +0 -9
  430. package/dist/theme/index.js +0 -2
  431. package/dist/theme/mycause-theme.js +0 -33
  432. package/dist/theme/theme.jsx +0 -36
  433. package/dist/utils/browser.js +0 -19
  434. package/dist/utils/center-decorator.jsx +0 -15
  435. package/dist/utils/component-matrix.jsx +0 -39
  436. package/dist/utils/flags.js +0 -18
  437. package/dist/utils/grid-decorator.jsx +0 -27
  438. package/dist/utils/tap-event.js +0 -11
  439. package/dist/utils/wrap.js +0 -8
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import { Anchor } from "./index";
4
- export default {
5
- title: "Anchor",
6
- decorators: [CenterDecorator],
7
- component: Anchor,
8
- };
9
- export const anchor = () => <Anchor href="#">Start fundraising</Anchor>;
10
- anchor.story = {
11
- name: "default",
12
- };
@@ -1,33 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import cn from "classnames";
3
- import { useTheme, getColorToken } from "../../theme/theme";
4
- import css from "styled-jsx/css";
5
- /* A bold anchor that turns green when active/focused */
6
- const BoldAnchor = forwardRef(function EmboldenAnchor({ className, href, children, active, color = "primary", invert, analyticsId, id, ...rest }, ref) {
7
- const theme = useTheme();
8
- if (process.env.NODE_ENV !== "production") {
9
- if (id && analyticsId) {
10
- console.warn("[BoldAnchor] only one of the `id` and `analyticsId` props can be passed. Please remove one as `analyticsId` will override the id.");
11
- }
12
- }
13
- const scope = css.resolve `
14
- a {
15
- position: relative;
16
- text-decoration: none;
17
- color: inherit;
18
- font-weight: 500;
19
- }
20
-
21
- a:hover,
22
- a:focus,
23
- a:active,
24
- a.active {
25
- color: ${getColorToken(theme, "foreground", color, { invert })};
26
- }
27
- `;
28
- return (<a ref={ref} href={href || "#"} className={cn("bold-anchor", className, scope.className, { active })} id={analyticsId || id} {...rest}>
29
- {children}
30
- {scope.styles}
31
- </a>);
32
- });
33
- export default BoldAnchor;
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import { BoldAnchor } from "./index";
4
- export default {
5
- title: "BoldAnchor",
6
- decorators: [CenterDecorator],
7
- };
8
- export const boldAnchor = () => (<BoldAnchor href="#">Start fundraising</BoldAnchor>);
9
- boldAnchor.story = {
10
- name: "default",
11
- };
@@ -1,2 +0,0 @@
1
- export { default as Anchor } from "./anchor";
2
- export { default as BoldAnchor } from "./bold-anchor";
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import ImageAvatar from "./image-avatar";
3
- import TextAvatar from "./text-avatar";
4
- /* Used to represent a user */
5
- function Avatar(props) {
6
- if (isImageAvatar(props)) {
7
- return <ImageAvatar {...props}/>;
8
- }
9
- return <TextAvatar {...props}/>;
10
- }
11
- function isImageAvatar(props) {
12
- return "src" in props && typeof props.src !== "undefined";
13
- }
14
- export default Avatar;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import ImageAvatar from "./image-avatar";
4
- import TextAvatar from "./text-avatar";
5
- import src from "./ipet-photo-CfDAo3C3bvQ-unsplash.jpg";
6
- export default {
7
- title: "Avatar",
8
- decorators: [CenterDecorator],
9
- };
10
- export const imageAvatar = () => (<ImageAvatar name="Adorable Puppy" src={src}/>);
11
- imageAvatar.story = {
12
- name: "image avatar",
13
- };
14
- export const textAvatar = () => <TextAvatar name="Adorable Puppy"/>;
15
- textAvatar.story = {
16
- name: "text avatar",
17
- };
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import css from "styled-jsx/css";
3
- import cn from "classnames";
4
- import { ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
5
- /* An avatar with an image */
6
- function ImageAvatar({ name, src, size = "2.5rem", ...rest }) {
7
- const scope = css.resolve `
8
- .avatar {
9
- border-radius: 100%;
10
- display: inline-block;
11
- overflow: hidden;
12
- border: 1px solid ${ON_BACKGROUND_GREY_GREY};
13
- line-height: 0;
14
- vertical-align: top;
15
- width: ${size};
16
- height: ${size};
17
- }
18
-
19
- img {
20
- width: 100%;
21
- height: 100%;
22
- }
23
- `;
24
- return (<span className={cn("avatar", scope.className)} title={name} {...rest}>
25
- <img className={scope.className} alt={name} src={src}/>
26
- {scope.styles}
27
- </span>);
28
- }
29
- export default ImageAvatar;
@@ -1 +0,0 @@
1
- export { default as Avatar } from "./avatar";
@@ -1,47 +0,0 @@
1
- import React from "react";
2
- import css from "styled-jsx/css";
3
- import cn from "classnames";
4
- import { useTheme, getColorToken } from "../../theme/theme";
5
- /* An avatar that shows initials, usually for when there is no photo available */
6
- function TextAvatar({ name, initials, color = "primary", invert, size = "2.5rem", ...rest }) {
7
- const theme = useTheme();
8
- if (!initials) {
9
- initials = name
10
- .split(/\s+/)
11
- .filter(str => str.length)
12
- .map(str => str[0].toUpperCase())
13
- .join("");
14
- }
15
- const foreground = getColorToken(theme, "foreground", color, { invert });
16
- const background = getColorToken(theme, "background", color, { invert });
17
- const scope = css.resolve `
18
- .text-avatar {
19
- width: ${size};
20
- height: ${size};
21
- background-color: ${foreground};
22
- color: ${background};
23
- }
24
- `;
25
- return (<span className={cn("text-avatar", scope.className)} title={name} {...rest}>
26
- <span className="name">{initials}</span>
27
- <style jsx>{`
28
- .text-avatar {
29
- border-radius: 100%;
30
- display: inline-flex;
31
- overflow: hidden;
32
- line-height: 0;
33
- vertical-align: top;
34
-
35
- justify-content: center;
36
- align-items: center;
37
- }
38
-
39
- .name {
40
- font-size: 1rem;
41
- user-select: none;
42
- }
43
- `}</style>
44
- {scope.styles}
45
- </span>);
46
- }
47
- export default TextAvatar;
@@ -1,85 +0,0 @@
1
- import React, { useState } from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- import MDCButton from "@material/react-button";
5
- import { useTheme, getColorToken } from "../../theme/theme";
6
- import { tapEvent } from "../../utils/tap-event";
7
- /**
8
- * Button
9
- *
10
- * Customised version of @material/react-button
11
- * see: https://github.com/material-components/material-components-web-react/tree/master/packages/button
12
- *
13
- * When using this button you must also include the accompanying `button.scss`.
14
- */
15
- function Button({ control, display, large, color = "primary", invert, raised, unelevated, outlined, className, icon, trailingIcon, onMouseOver, onMouseOut, analyticsId, id, ...rest }) {
16
- const theme = useTheme();
17
- if (process.env.NODE_ENV !== "production") {
18
- if (id && analyticsId) {
19
- console.warn("[Button] only one of the `id` and `analyticsId` props can be passed. Please remove one as `analyticsId` will override the id.");
20
- }
21
- }
22
- const [hovered, setHovered] = useState();
23
- const handleMouseOver = tapEvent(() => setHovered(true), onMouseOver);
24
- const handleMouseOut = tapEvent(() => setHovered(false), onMouseOut);
25
- // Handle icon colors
26
- const foreground = getColorToken(theme, "foreground", color, {
27
- invert,
28
- });
29
- const background = getColorToken(theme, "background", color, {
30
- invert,
31
- });
32
- icon = setIconColor(icon, {
33
- color,
34
- invert,
35
- unelevated,
36
- raised,
37
- outlined,
38
- hovered,
39
- });
40
- trailingIcon = setIconColor(trailingIcon, {
41
- color,
42
- invert,
43
- unelevated,
44
- raised,
45
- outlined,
46
- hovered,
47
- });
48
- const scope = css.resolve `
49
- .button {
50
- --mdc-theme-primary: ${foreground};
51
- --mdc-theme-on-primary: ${background};
52
- }
53
- `;
54
- const props = {
55
- className: classnames("button", {
56
- "mdc-button--display": display,
57
- "mdc-button--large": large,
58
- "mdc-button--control": control,
59
- }, className, scope.className),
60
- id: analyticsId || id,
61
- raised,
62
- unelevated,
63
- outlined: outlined,
64
- icon: icon,
65
- trailingIcon: trailingIcon,
66
- onMouseOver: handleMouseOver,
67
- onMouseOut: handleMouseOut,
68
- ...rest,
69
- };
70
- return (<>
71
- <MDCButton {...props}/>
72
- {scope.styles}
73
- </>);
74
- }
75
- export default Button;
76
- function setIconColor(icon, { color, invert, unelevated, raised, outlined, hovered, }) {
77
- if (!icon) {
78
- return icon;
79
- }
80
- icon = React.cloneElement(icon, { color: icon.props.color || color });
81
- if (unelevated || raised || (hovered && outlined)) {
82
- icon = React.cloneElement(icon, { invert: !invert });
83
- }
84
- return icon;
85
- }
@@ -1,118 +0,0 @@
1
- import React from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import Matrix from "../../utils/component-matrix";
4
- import Button from "./button";
5
- import Icon from "../icon/icon";
6
- export default {
7
- title: "Button",
8
- decorators: [CenterDecorator],
9
- };
10
- export const types = () => {
11
- let props = {
12
- primary: [
13
- { children: "Text button" },
14
- { children: "Outlined button", outlined: true },
15
- { children: "Unelevated button", unelevated: true },
16
- { children: "Raised button", raised: true },
17
- ],
18
- secondary: [{}],
19
- };
20
- return (<Matrix {...props}>
21
- {props => <Button {...props}/>}
22
- </Matrix>);
23
- };
24
- types.story = {
25
- name: "types",
26
- };
27
- export const disabled = () => {
28
- let props = {
29
- primary: [
30
- { children: "Text button" },
31
- { children: "Outlined button", outlined: true },
32
- { children: "Unelevated button", unelevated: true },
33
- { children: "Raised button", raised: true },
34
- ],
35
- secondary: [{ disabled: true }],
36
- };
37
- return (<Matrix {...props}>
38
- {props => <Button {...props}/>}
39
- </Matrix>);
40
- };
41
- disabled.story = {
42
- name: "disabled",
43
- };
44
- export const sizes = () => {
45
- let props = {
46
- primary: [
47
- { children: "Dense", dense: true },
48
- { children: "Normal" },
49
- { children: "Display", display: true },
50
- { children: "Large", large: true },
51
- ],
52
- secondary: [{}, { outlined: true }, { unelevated: true }, { raised: true }],
53
- };
54
- return (<Matrix {...props}>
55
- {props => <Button {...props}/>}
56
- </Matrix>);
57
- };
58
- sizes.story = {
59
- name: "sizes",
60
- };
61
- export const colors = () => {
62
- let props = {
63
- primary: [
64
- { children: "Neutral", color: "neutral" },
65
- { children: "Primary", color: "primary" },
66
- { children: "Secondary", color: "secondary" },
67
- { children: "Accent", color: "accent" },
68
- {
69
- children: "Custom",
70
- color: { foreground: "#3C5A99", background: "#ffffff" },
71
- },
72
- ],
73
- secondary: [{}, { outlined: true }, { unelevated: true }, { raised: true }],
74
- };
75
- return (<Matrix {...props}>
76
- {props => <Button {...props}/>}
77
- </Matrix>);
78
- };
79
- colors.story = {
80
- name: "colors",
81
- };
82
- export const icon = () => {
83
- let props = {
84
- primary: [
85
- { icon: <Icon icon="card_giftcard"/>, children: "Voucher" },
86
- { trailingIcon: <Icon icon="favorite_border"/>, children: "Thanks" },
87
- ],
88
- secondary: [{}, { outlined: true }, { unelevated: true }, { raised: true }],
89
- };
90
- return (<Matrix {...props}>
91
- {props => <Button {...props}/>}
92
- </Matrix>);
93
- };
94
- icon.story = {
95
- name: "with icon",
96
- };
97
- export const controlButton = () => <Button control>Control</Button>;
98
- controlButton.story = {
99
- name: "control button",
100
- };
101
- export const controlButtonDense = () => (<Button control dense>
102
- Control
103
- </Button>);
104
- controlButtonDense.story = {
105
- name: "control button dense",
106
- };
107
- export const example1 = () => (<Button raised display color="secondary">
108
- Start fundraising
109
- </Button>);
110
- example1.story = {
111
- name: "start fundraising",
112
- };
113
- export const example2 = () => (<Button outlined display color="primary">
114
- Become a partner (free)
115
- </Button>);
116
- example2.story = {
117
- name: "become a partner",
118
- };
@@ -1 +0,0 @@
1
- export { default as Button } from "./button";
@@ -1,39 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- import nanoid from "nanoid";
5
- import { useTheme, getColorToken } from "../../theme/theme";
6
- import { Flex } from "../layout";
7
- import { Text } from "../text";
8
- import MDCCheckbox from "@material/react-checkbox";
9
- const Checkbox = ({ id, label, color = "primary", checked, className, ...rest }) => {
10
- const theme = useTheme();
11
- const [mainId, setmainId] = useState("");
12
- const setColor = getColorToken(theme, "foreground", color);
13
- useEffect(() => {
14
- setmainId(id ? id : nanoid());
15
- }, [id, setmainId]);
16
- const scope = css.resolve `
17
- .checkbox {
18
- --mdc-theme-primary: ${setColor};
19
- --mdc-theme-secondary: ${setColor};
20
- }
21
-
22
- .checkbox-label {
23
- flex-grow: 1;
24
- flex-shrink: 1;
25
- margin-left: 0.25rem;
26
- cursor: pointer;
27
- }
28
- `;
29
- return (<Flex align="center">
30
- <MDCCheckbox className={classnames(className, "checkbox", scope.className)} checked={checked} nativeControlId={mainId} {...rest}/>
31
- {label && (<label className={classnames(scope.className, "checkbox-label")} htmlFor={mainId}>
32
- <Text font="brand" kind="sub" span>
33
- {label}
34
- </Text>
35
- </label>)}
36
- {scope.styles}
37
- </Flex>);
38
- };
39
- export default Checkbox;
@@ -1,42 +0,0 @@
1
- import React, { useState, Fragment } from "react";
2
- import CheckBox from "./checkbox";
3
- import CenterDecorator from "../../utils/center-decorator";
4
- export default {
5
- title: "CheckBox",
6
- decorators: [CenterDecorator],
7
- };
8
- export const CheckBoxStoriesDefault = () => {
9
- const [isChecked, setChecked] = useState(true);
10
- const handleClick = (event) => {
11
- setChecked(event.target.checked);
12
- };
13
- return (<Fragment>
14
- <CheckBox onChange={handleClick} checked={isChecked} color="primary"/>
15
- <CheckBox onChange={handleClick} checked={isChecked} color="secondary"/>
16
- <CheckBox onChange={handleClick} checked={isChecked} color="muted"/>
17
- </Fragment>);
18
- };
19
- CheckBoxStoriesDefault.story = {
20
- name: "default",
21
- };
22
- export const CheckBoxStoriesLabel = () => {
23
- const [isChecked, setChecked] = useState(true);
24
- const handleClick = (event) => {
25
- setChecked(event.target.checked);
26
- };
27
- return (<Fragment>
28
- <CheckBox label="Checkbox Story" onChange={handleClick} checked={isChecked}/>
29
- </Fragment>);
30
- };
31
- CheckBoxStoriesLabel.story = {
32
- name: "with label",
33
- };
34
- export const CheckBoxStoriesDisabled = () => {
35
- return (<Fragment>
36
- <CheckBox disabled={true} checked={false}/>
37
- <CheckBox disabled={true} checked={true}/>
38
- </Fragment>);
39
- };
40
- CheckBoxStoriesDisabled.story = {
41
- name: "disabled",
42
- };
@@ -1 +0,0 @@
1
- export { default as Checkbox } from "./checkbox";
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- import { Chip as MDCChip, } from "@material/react-chips";
5
- import { useTheme } from "../../theme/theme";
6
- function Chip({ className, leadingIcon, trailingIcon, ...props }) {
7
- const theme = useTheme();
8
- const scope = css.resolve `
9
- .mdc-chip {
10
- font-family: ${theme.typography.fontFamily.brand};
11
- }
12
- `;
13
- // default icon sizes to 18px
14
- if (leadingIcon) {
15
- leadingIcon = React.cloneElement(leadingIcon, {
16
- size: leadingIcon.props.size || "18px",
17
- });
18
- }
19
- if (trailingIcon) {
20
- trailingIcon = React.cloneElement(trailingIcon, {
21
- size: trailingIcon.props.size || "18px",
22
- });
23
- }
24
- return (<>
25
- <MDCChip className={classnames(scope.className, className)} leadingIcon={leadingIcon} trailingIcon={trailingIcon} {...props}/>
26
- {scope.styles}
27
- </>);
28
- }
29
- Chip.defaultProps = MDCChip.defaultProps;
30
- export default Chip;
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { ChipSet } from "@material/react-chips";
3
- import Chip from "./chip";
4
- function Chips({ value, onChange, options, children, ...rest }) {
5
- if (options) {
6
- children = options.map(option => <Chip key={option.id} {...option}/>);
7
- }
8
- const props = {
9
- selectedChipIds: value,
10
- handleSelect: onChange,
11
- children: children,
12
- ...rest,
13
- };
14
- return <ChipSet {...props}/>;
15
- }
16
- export default Chips;
@@ -1,35 +0,0 @@
1
- import React, { useState } from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import Chips from "./chips";
4
- import Chip from "./chip";
5
- export default {
6
- title: "Chips",
7
- decorators: [CenterDecorator],
8
- };
9
- export const chips = () => (<Chips>
10
- <Chip id="summer" label="Summer"/>
11
- <Chip id="winter" label="Winter"/>
12
- </Chips>);
13
- chips.story = {
14
- name: "default",
15
- };
16
- export const ChoiceChips = () => {
17
- const [selected, setSelected] = useState(["summer"]);
18
- return (<Chips choice value={selected} onChange={setSelected} options={[
19
- { id: "summer", label: "Summer" },
20
- { id: "winter", label: "Winter" },
21
- ]}></Chips>);
22
- };
23
- ChoiceChips.story = {
24
- name: "choice",
25
- };
26
- export const FilterChips = () => {
27
- const [selected, setSelected] = useState(["summer"]);
28
- return (<Chips filter value={selected} onChange={setSelected}>
29
- <Chip id="summer" label="Summer"/>
30
- <Chip id="winter" label="Winter"/>
31
- </Chips>);
32
- };
33
- FilterChips.story = {
34
- name: "filter",
35
- };
@@ -1,3 +0,0 @@
1
- export { default as Chips } from "./chips";
2
- export { default as InputChips } from "./input-chips";
3
- export { default as Chip } from "./chip";
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { ChipSet } from "@material/react-chips";
3
- /**
4
- * A form control for adding and removing items to a set.
5
- */
6
- function InputChips({ onChange, ...rest }) {
7
- const handleUpdateChips = (chips) => {
8
- onChange(chips.map((chip) => chip.id));
9
- };
10
- const props = {
11
- updateChips: handleUpdateChips,
12
- ...rest,
13
- };
14
- return <ChipSet {...props}/>;
15
- }
16
- export default InputChips;
@@ -1,39 +0,0 @@
1
- import React, { useState } from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import { TextField } from "../text-field";
4
- import { Icon } from "../icon";
5
- import InputChips from "./input-chips";
6
- import Chip from "./chip";
7
- export default {
8
- title: "InputChips",
9
- decorators: [CenterDecorator],
10
- };
11
- export function InputChipsStory() {
12
- const [text, setText] = useState("");
13
- const [values, setValues] = useState([]);
14
- const handleKeyDown = (e) => {
15
- if (e.key === "Enter" && text.trim()) {
16
- if (!values.includes(text.trim())) {
17
- setValues(values => [...values, text.trim()]);
18
- setText("");
19
- }
20
- }
21
- };
22
- return (<div>
23
- <div>
24
- <TextField placeholder="Add an item" value={text} onChange={e => setText(e.target.value)} onKeyDown={handleKeyDown}/>
25
- </div>
26
- <InputChips onChange={chips => setValues(chips)}>
27
- {values.map((value) => (<Chip id={value} key={value} label={value} trailingIcon={<Icon icon="cancel"/>}/>))}
28
- </InputChips>
29
- <style jsx>{`
30
- div {
31
- max-width: 360px;
32
- width: 100%;
33
- }
34
- `}</style>
35
- </div>);
36
- }
37
- InputChipsStory.story = {
38
- name: "default",
39
- };
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- const scope = css.resolve `
5
- .combo-field-expand {
6
- flex-grow: 1;
7
- }
8
- `;
9
- /**
10
- * Makes a field in a combo-field expand to fill as
11
- * much size as it can.
12
- */
13
- function ComboFieldExpander({ children, className, ...props }) {
14
- const child = React.Children.only(children);
15
- return (<>
16
- {React.cloneElement(child, {
17
- className: classnames(child.props.className, scope.className, className, "combo-field-expand"),
18
- ...props,
19
- })}
20
- {scope.styles}
21
- </>);
22
- }
23
- export default ComboFieldExpander;