@mycause/ui 0.0.0-c7de8cef → 0.0.0-c7f1270a

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 (258) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +9 -0
  3. package/dist/components/campaign-card/campaign-card.d.ts +9 -0
  4. package/dist/components/campaign-card/campaign-card.stories.d.ts +14 -0
  5. package/dist/components/campaign-card/index.d.ts +1 -0
  6. package/dist/components/campaign-of-month/campaign-of-month.d.ts +14 -0
  7. package/dist/components/campaign-of-month/campaign-of-month.stories.d.ts +14 -0
  8. package/dist/components/campaign-of-month/index.d.ts +1 -0
  9. package/dist/components/charity-card/charity-card.d.ts +7 -0
  10. package/dist/components/charity-card/charity-card.stories.d.ts +14 -0
  11. package/dist/components/charity-card/index.d.ts +1 -0
  12. package/dist/components/combo-field/combo-field.d.ts +4 -1
  13. package/dist/components/comment-section/comment-section-v2/comment-section-v2.d.ts +31 -0
  14. package/dist/components/comment-section/comment-section-v2/sub-comments-v2.d.ts +11 -0
  15. package/dist/components/comment-section/comment-section.d.ts +1 -0
  16. package/dist/components/comment-section/comment-section.stories.d.ts +6 -0
  17. package/dist/components/comment-section/index.d.ts +1 -0
  18. package/dist/components/date-picker/single-date-picker.d.ts +3 -2
  19. package/dist/components/donate-card/donate-card.d.ts +8 -0
  20. package/dist/components/donate-card/donate-card.stories.d.ts +14 -0
  21. package/dist/components/donate-card/index.d.ts +1 -0
  22. package/dist/components/donation-form/donation-details.d.ts +12 -0
  23. package/dist/components/donation-form/donation-form-v2/donation-form-v2.d.ts +13 -0
  24. package/dist/components/donation-form/donation-form.d.ts +64 -0
  25. package/dist/components/donation-form/donation-form.stories.d.ts +18 -0
  26. package/dist/components/donation-form/donation-payment.d.ts +13 -0
  27. package/dist/components/donation-form/donation-select.d.ts +13 -0
  28. package/dist/components/donation-form/index.d.ts +2 -0
  29. package/dist/components/featured-campaign-card/featured-campaign-card.d.ts +17 -0
  30. package/dist/components/featured-campaign-card/featured-campaign-card.stories.d.ts +14 -0
  31. package/dist/components/featured-campaign-card/index.d.ts +1 -0
  32. package/dist/components/footerV2/footerV2.d.ts +35 -0
  33. package/dist/components/footerV2/footerV2.stories.d.ts +15 -0
  34. package/dist/components/footerV2/index.d.ts +1 -0
  35. package/dist/components/fundraising-section/fundraising-section.d.ts +9 -0
  36. package/dist/components/fundraising-section/fundraising-section.stories.d.ts +14 -0
  37. package/dist/components/fundraising-section/index.d.ts +1 -0
  38. package/dist/components/hero-banner/hero-banner.d.ts +9 -0
  39. package/dist/components/hero-banner/hero-banner.stories.d.ts +14 -0
  40. package/dist/components/hero-banner/index.d.ts +1 -0
  41. package/dist/components/horizontalbar/horizontalbar.d.ts +11 -0
  42. package/dist/components/horizontalbar/horizontalbar.stories.d.ts +26 -0
  43. package/dist/components/horizontalbar/index.d.ts +1 -0
  44. package/dist/components/icon/{toggle-button.d.ts → heart-toggle.d.ts} +3 -3
  45. package/dist/components/icon/{toggle-button.stories.d.ts → heart-toggle.stories.d.ts} +1 -1
  46. package/dist/components/icon/index.d.ts +1 -1
  47. package/dist/components/index.d.ts +14 -0
  48. package/dist/components/info-represent-campaign/index.d.ts +1 -0
  49. package/dist/components/info-represent-campaign/info-represent-campaign.d.ts +11 -0
  50. package/dist/components/{phone-number-field/phone-number-field.stories.d.ts → info-represent-campaign/info-represent-campaign.stories.d.ts} +1 -1
  51. package/dist/components/list/list.d.ts +7 -2
  52. package/dist/components/list/list.stories.d.ts +2 -2
  53. package/dist/components/logo/logo-type.d.ts +2 -1
  54. package/dist/components/modal/modal.d.ts +1 -1
  55. package/dist/components/nav/icons/IconBigger.d.ts +5 -0
  56. package/dist/components/nav/icons/IconSmaller.d.ts +5 -0
  57. package/dist/components/nav/index.d.ts +1 -0
  58. package/dist/components/nav/nav-actions.d.ts +5 -0
  59. package/dist/components/nav/nav-bar.d.ts +7 -0
  60. package/dist/components/nav/nav-call-to-action.d.ts +5 -0
  61. package/dist/components/nav/nav-expanded-charity.d.ts +13 -0
  62. package/dist/components/nav/nav-expanded.d.ts +14 -0
  63. package/dist/components/nav/nav-list.d.ts +29 -0
  64. package/dist/components/nav/nav-menu-control.d.ts +8 -0
  65. package/dist/components/nav/nav-menu.d.ts +12 -0
  66. package/dist/components/nav/nav-search-control.d.ts +8 -0
  67. package/dist/components/nav/nav-search.d.ts +10 -0
  68. package/dist/components/nav/nav-sign-in-control.d.ts +12 -0
  69. package/dist/components/nav/nav-user-menu-items.d.ts +20 -0
  70. package/dist/components/nav/nav-user-menu.d.ts +18 -0
  71. package/dist/components/nav/nav.d.ts +56 -0
  72. package/dist/components/nav/nav.stories.d.ts +11 -0
  73. package/dist/components/navigation/navigation-list.d.ts +3 -1
  74. package/dist/components/navigation/navigation-sign-in-control.d.ts +3 -2
  75. package/dist/components/navigation/navigation.d.ts +2 -0
  76. package/dist/components/navigation/navigation.stories.d.ts +6 -0
  77. package/dist/components/partner-dashboard-chart/chart.d.ts +3 -0
  78. package/dist/components/{phone-number-input/phone-number-field.stories.d.ts → partner-dashboard-chart/chart.stories.d.ts} +2 -1
  79. package/dist/components/partner-dashboard-chart/index.d.ts +1 -0
  80. package/dist/components/phone-number-input/phone-number-input.d.ts +2 -1
  81. package/dist/components/popup/index.d.ts +1 -0
  82. package/dist/components/popup/popup.d.ts +8 -0
  83. package/dist/components/popup/popup.stories.d.ts +14 -0
  84. package/dist/components/progressbar/index.d.ts +1 -0
  85. package/dist/components/progressbar/progressbar.d.ts +8 -0
  86. package/dist/components/progressbar/progressbar.stories.d.ts +14 -0
  87. package/dist/components/select/select.d.ts +2 -1
  88. package/dist/components/start-campaign-card/index.d.ts +1 -0
  89. package/dist/components/start-campaign-card/start-campaign-card.d.ts +8 -0
  90. package/dist/components/start-campaign-card/start-campaign-card.stories.d.ts +14 -0
  91. package/dist/components/statistics/statistics.d.ts +2 -1
  92. package/dist/components/tabs/nav-tabs.d.ts +18 -0
  93. package/dist/components/text-field/index.d.ts +1 -0
  94. package/dist/components/text-field/text-field-search.d.ts +9 -0
  95. package/dist/components/text-field/text-field.d.ts +1 -0
  96. package/dist/components/text-field/text-field.stories.d.ts +6 -0
  97. package/dist/index.esm.js +21647 -1735
  98. package/dist/index.js +21664 -1735
  99. package/dist/theme/theme.d.ts +4 -0
  100. package/package.json +1 -1
  101. package/styles/index.css +4 -0
  102. package/dist/components/anchor/anchor.jsx +0 -35
  103. package/dist/components/anchor/anchor.stories.jsx +0 -12
  104. package/dist/components/anchor/bold-anchor.jsx +0 -33
  105. package/dist/components/anchor/bold-anchor.stories.jsx +0 -11
  106. package/dist/components/anchor/index.js +0 -2
  107. package/dist/components/avatar/avatar.jsx +0 -14
  108. package/dist/components/avatar/avatar.stories.jsx +0 -17
  109. package/dist/components/avatar/image-avatar.jsx +0 -29
  110. package/dist/components/avatar/index.js +0 -1
  111. package/dist/components/avatar/text-avatar.jsx +0 -47
  112. package/dist/components/button/button.jsx +0 -85
  113. package/dist/components/button/button.stories.jsx +0 -118
  114. package/dist/components/button/index.js +0 -1
  115. package/dist/components/button-select/button-select.jsx +0 -34
  116. package/dist/components/button-select/button-select.stories.jsx +0 -39
  117. package/dist/components/button-select/index.js +0 -1
  118. package/dist/components/checkbox/checkbox.jsx +0 -39
  119. package/dist/components/checkbox/checkbox.stories.jsx +0 -42
  120. package/dist/components/checkbox/index.js +0 -1
  121. package/dist/components/chips/chip.jsx +0 -30
  122. package/dist/components/chips/chips.jsx +0 -16
  123. package/dist/components/chips/chips.stories.jsx +0 -35
  124. package/dist/components/chips/index.js +0 -3
  125. package/dist/components/chips/input-chips.jsx +0 -16
  126. package/dist/components/chips/input-chips.stories.jsx +0 -39
  127. package/dist/components/combo-field/combo-field-expander.jsx +0 -23
  128. package/dist/components/combo-field/combo-field.jsx +0 -93
  129. package/dist/components/combo-field/combo-field.stories.jsx +0 -62
  130. package/dist/components/combo-field/index.js +0 -2
  131. package/dist/components/comment-section/comment-section.jsx +0 -95
  132. package/dist/components/comment-section/comment-section.stories.jsx +0 -97
  133. package/dist/components/comment-section/index.js +0 -1
  134. package/dist/components/cropper/cropper.jsx +0 -10
  135. package/dist/components/cropper/cropper.stories.jsx +0 -18
  136. package/dist/components/cropper/index.js +0 -1
  137. package/dist/components/date-picker/date-picker.jsx +0 -74
  138. package/dist/components/date-picker/date-picker.stories.jsx +0 -46
  139. package/dist/components/date-picker/index.js +0 -2
  140. package/dist/components/date-picker/single-date-picker.jsx +0 -81
  141. package/dist/components/elevation/elevation.jsx +0 -24
  142. package/dist/components/elevation/elevation.stories.jsx +0 -31
  143. package/dist/components/elevation/index.js +0 -1
  144. package/dist/components/field-helpers/field-helper-text.jsx +0 -42
  145. package/dist/components/field-helpers/field-label.jsx +0 -29
  146. package/dist/components/field-helpers/index.js +0 -2
  147. package/dist/components/icon/btn_google_light_normal_ios.svg.jsx +0 -22
  148. package/dist/components/icon/facebook_6.svg.jsx +0 -14
  149. package/dist/components/icon/icon-button-group.jsx +0 -51
  150. package/dist/components/icon/icon-button-group.stories.jsx +0 -26
  151. package/dist/components/icon/icon-button.jsx +0 -48
  152. package/dist/components/icon/icon-button.stories.jsx +0 -33
  153. package/dist/components/icon/icon.jsx +0 -49
  154. package/dist/components/icon/icon.stories.jsx +0 -78
  155. package/dist/components/icon/index.js +0 -4
  156. package/dist/components/icon/material-icon.jsx +0 -18
  157. package/dist/components/icon/toggle-button.jsx +0 -29
  158. package/dist/components/icon/toggle-button.stories.jsx +0 -16
  159. package/dist/components/index.js +0 -28
  160. package/dist/components/layout/box.jsx +0 -58
  161. package/dist/components/layout/flex.jsx +0 -55
  162. package/dist/components/layout/flex.stories.jsx +0 -44
  163. package/dist/components/layout/grid.jsx +0 -19
  164. package/dist/components/layout/grid.stories.jsx +0 -29
  165. package/dist/components/layout/index.js +0 -4
  166. package/dist/components/layout/stack.jsx +0 -33
  167. package/dist/components/layout/stack.stories.jsx +0 -40
  168. package/dist/components/list/index.js +0 -1
  169. package/dist/components/list/list.jsx +0 -55
  170. package/dist/components/list/list.stories.jsx +0 -135
  171. package/dist/components/logo/index.js +0 -1
  172. package/dist/components/logo/logo-type.jsx +0 -65
  173. package/dist/components/menu/index.js +0 -8
  174. package/dist/components/menu/menu-list-divider.jsx +0 -2
  175. package/dist/components/menu/menu-list-item-graphic.jsx +0 -2
  176. package/dist/components/menu/menu-list-item-meta.jsx +0 -2
  177. package/dist/components/menu/menu-list-item-text.jsx +0 -2
  178. package/dist/components/menu/menu-list-item.jsx +0 -11
  179. package/dist/components/menu/menu-list.jsx +0 -18
  180. package/dist/components/menu/menu-surface.jsx +0 -4
  181. package/dist/components/menu/menu.jsx +0 -2
  182. package/dist/components/menu/menu.stories.jsx +0 -42
  183. package/dist/components/modal/index.js +0 -1
  184. package/dist/components/modal/modal.jsx +0 -49
  185. package/dist/components/modal/modal.stories.jsx +0 -59
  186. package/dist/components/navigation/index.js +0 -1
  187. package/dist/components/navigation/navigation-actions.jsx +0 -8
  188. package/dist/components/navigation/navigation-bar.jsx +0 -42
  189. package/dist/components/navigation/navigation-call-to-action.jsx +0 -6
  190. package/dist/components/navigation/navigation-expanded.jsx +0 -165
  191. package/dist/components/navigation/navigation-list.jsx +0 -126
  192. package/dist/components/navigation/navigation-menu-control.jsx +0 -25
  193. package/dist/components/navigation/navigation-menu.jsx +0 -126
  194. package/dist/components/navigation/navigation-search-control.jsx +0 -8
  195. package/dist/components/navigation/navigation-search.jsx +0 -63
  196. package/dist/components/navigation/navigation-sign-in-control.jsx +0 -14
  197. package/dist/components/navigation/navigation-user-menu-items.jsx +0 -36
  198. package/dist/components/navigation/navigation-user-menu.jsx +0 -121
  199. package/dist/components/navigation/navigation.jsx +0 -137
  200. package/dist/components/navigation/navigation.stories.jsx +0 -270
  201. package/dist/components/phone-number-field/index.d.ts +0 -2
  202. package/dist/components/phone-number-field/index.js +0 -2
  203. package/dist/components/phone-number-field/phone-number-field.d.ts +0 -23
  204. package/dist/components/phone-number-field/phone-number-field.jsx +0 -50
  205. package/dist/components/phone-number-field/phone-number-field.stories.jsx +0 -23
  206. package/dist/components/phone-number-field/util.d.ts +0 -2
  207. package/dist/components/phone-number-field/util.js +0 -19
  208. package/dist/components/phone-number-input/index.js +0 -2
  209. package/dist/components/phone-number-input/phone-number-field.d.ts +0 -23
  210. package/dist/components/phone-number-input/phone-number-field.jsx +0 -50
  211. package/dist/components/phone-number-input/phone-number-field.stories.jsx +0 -16
  212. package/dist/components/phone-number-input/phone-number-input.jsx +0 -75
  213. package/dist/components/phone-number-input/phone-number-input.stories.jsx +0 -23
  214. package/dist/components/phone-number-input/util.js +0 -19
  215. package/dist/components/radio/index.js +0 -2
  216. package/dist/components/radio/radio-group.jsx +0 -9
  217. package/dist/components/radio/radio-group.stories.jsx +0 -21
  218. package/dist/components/radio/radio.jsx +0 -31
  219. package/dist/components/radio/radio.stories.jsx +0 -44
  220. package/dist/components/select/index.js +0 -2
  221. package/dist/components/select/select-helper-text.jsx +0 -6
  222. package/dist/components/select/select.jsx +0 -150
  223. package/dist/components/select/select.stories.jsx +0 -40
  224. package/dist/components/statistics/index.js +0 -1
  225. package/dist/components/statistics/statistics.jsx +0 -61
  226. package/dist/components/statistics/statistics.stories.jsx +0 -34
  227. package/dist/components/switch/index.js +0 -1
  228. package/dist/components/switch/switch.jsx +0 -32
  229. package/dist/components/switch/switch.stories.jsx +0 -41
  230. package/dist/components/tabs/index.js +0 -1
  231. package/dist/components/tabs/tab-bar.jsx +0 -35
  232. package/dist/components/tabs/tab-text-label.jsx +0 -5
  233. package/dist/components/tabs/tab.jsx +0 -50
  234. package/dist/components/tabs/tabs.jsx +0 -65
  235. package/dist/components/tabs/tabs.stories.jsx +0 -27
  236. package/dist/components/text/index.js +0 -1
  237. package/dist/components/text/text.jsx +0 -138
  238. package/dist/components/text/text.stories.jsx +0 -262
  239. package/dist/components/text-field/index.js +0 -2
  240. package/dist/components/text-field/text-field-helper-text.jsx +0 -8
  241. package/dist/components/text-field/text-field.jsx +0 -124
  242. package/dist/components/text-field/text-field.stories.jsx +0 -32
  243. package/dist/components/uploader/index.js +0 -1
  244. package/dist/components/uploader/uploader.jsx +0 -96
  245. package/dist/input.d.ts +0 -1
  246. package/dist/input.js +0 -4
  247. package/dist/input.jsx +0 -4
  248. package/dist/theme/colors.js +0 -9
  249. package/dist/theme/index.js +0 -2
  250. package/dist/theme/mycause-theme.js +0 -33
  251. package/dist/theme/theme.jsx +0 -36
  252. package/dist/utils/browser.js +0 -19
  253. package/dist/utils/center-decorator.jsx +0 -15
  254. package/dist/utils/component-matrix.jsx +0 -39
  255. package/dist/utils/flags.js +0 -18
  256. package/dist/utils/grid-decorator.jsx +0 -27
  257. package/dist/utils/tap-event.js +0 -11
  258. package/dist/utils/wrap.js +0 -8
@@ -1,49 +0,0 @@
1
- import React, { Fragment } from "react";
2
- import Dialog, { DialogContent, DialogFooter } from "@material/react-dialog";
3
- import classnames from "classnames";
4
- import css from "styled-jsx/css";
5
- import { useTheme, getColorToken } from "../../theme/theme";
6
- import { IconButton, Icon } from "../icon";
7
- import { Button } from "../button";
8
- import { Stack } from "../layout";
9
- const Modal = ({ id, isOpen, toggleModal, modalContent, modalTitle, onAccept, setWidth, buttonAlign = "right", buttonColor = "primary", noCancelButton, noCloseButton, acceptText = "Accept", cancelText = "Cancel", minimal, }) => {
10
- const theme = useTheme();
11
- const setColorButton = getColorToken(theme, "foreground", buttonColor);
12
- const scope = css.resolve `
13
- :global(.${id} > .mdc-dialog__container) {
14
- width: ${setWidth && "100% !important"};
15
- }
16
- :global(.${id} > .mdc-dialog__container > .mdc-dialog__surface) {
17
- width: ${setWidth && "100% !important"};
18
- max-width: ${setWidth} !important;
19
- }
20
- .modal-footer {
21
- justify-content: ${buttonAlign} !important;
22
- }
23
- `;
24
- return (<Fragment>
25
- <Dialog open={isOpen} className={id} onClose={() => toggleModal(false)}>
26
- {!minimal ? (<Stack>
27
- {modalTitle && (<div style={{ flexGrow: 1, padding: "20px 0px 24px 24px" }}>
28
- {modalTitle}
29
- </div>)}
30
- <div>
31
- {!noCancelButton && (<IconButton onClick={() => toggleModal(false)}>
32
- <Icon icon="close"/>
33
- </IconButton>)}
34
- </div>
35
- </Stack>) : (<></>)}
36
- <DialogContent>{modalContent}</DialogContent>
37
- {!minimal ? (<DialogFooter className={classnames("modal-footer ", scope.className)}>
38
- {!noCloseButton && (<Button color={{ foreground: setColorButton, background: "#ffffff" }} onClick={() => toggleModal(false)} outlined={true}>
39
- {cancelText}
40
- </Button>)}
41
- {onAccept && (<Button onClick={onAccept} color={{ foreground: setColorButton, background: "#ffffff" }} outlined={true} style={{ marginLeft: "10px" }}>
42
- {acceptText}
43
- </Button>)}
44
- </DialogFooter>) : (<></>)}
45
- </Dialog>
46
- {scope.styles}
47
- </Fragment>);
48
- };
49
- export default Modal;
@@ -1,59 +0,0 @@
1
- import React, { useState, Fragment } from "react";
2
- import Modal from "./modal";
3
- import CenterDecorator from "../../utils/center-decorator";
4
- import { Button } from "../button";
5
- export default {
6
- title: "Modal",
7
- decorators: [CenterDecorator],
8
- };
9
- export const ModalStoriesDefault = () => {
10
- const [isOpen, setIsOpen] = useState(false);
11
- return (<Fragment>
12
- <Button onClick={() => setIsOpen(true)} outlined={true}>
13
- Toggle Default Modal
14
- </Button>
15
- <Modal isOpen={isOpen} toggleModal={setIsOpen} modalContent="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " modalTitle="My Modal" id="mainModal"/>
16
- </Fragment>);
17
- };
18
- ModalStoriesDefault.story = {
19
- name: "default",
20
- };
21
- export const ModalStoriesWithActoin = () => {
22
- const [isOpen, setIsOpen] = useState(false);
23
- return (<Fragment>
24
- <Button onClick={() => setIsOpen(true)} outlined={true}>
25
- Toggle With Action Modal
26
- </Button>
27
- <Modal isOpen={isOpen} toggleModal={setIsOpen} modalContent="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " modalTitle="My Modal" id="mainModal" onAccept={() => {
28
- console.log("function was triggered");
29
- setIsOpen(false);
30
- }}/>
31
- </Fragment>);
32
- };
33
- ModalStoriesWithActoin.story = {
34
- name: "with action",
35
- };
36
- export const ModalStoriesNoButtons = () => {
37
- const [isOpen, setIsOpen] = useState(false);
38
- return (<Fragment>
39
- <Button onClick={() => setIsOpen(true)} outlined={true}>
40
- Toggle No Buttons Modal
41
- </Button>
42
- <Modal isOpen={isOpen} toggleModal={setIsOpen} modalContent="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " modalTitle="My Modal" id="mainModal" noCloseButton={true}/>
43
- </Fragment>);
44
- };
45
- ModalStoriesNoButtons.story = {
46
- name: "no buttons",
47
- };
48
- export const ModalStoriesMinimal = () => {
49
- const [isOpen, setIsOpen] = useState(false);
50
- return (<Fragment>
51
- <Button onClick={() => setIsOpen(true)} outlined={true}>
52
- Toggle Minimal Modal
53
- </Button>
54
- <Modal minimal={true} isOpen={isOpen} toggleModal={setIsOpen} modalContent="Lorem ipsum dolor sit amet." id="mainModal"/>
55
- </Fragment>);
56
- };
57
- ModalStoriesMinimal.story = {
58
- name: "minimal",
59
- };
@@ -1 +0,0 @@
1
- export { default as Navigation } from "./navigation";
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { Stack } from "../layout";
3
- function NavigationActions({ children }) {
4
- return (<Stack gap="0.5rem" justify="end" align="center">
5
- {children}
6
- </Stack>);
7
- }
8
- export default NavigationActions;
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- function NavigationBar({ isCompactHeight, children }) {
3
- return (<div className="navigation-bar">
4
- <div className="container">{children}</div>
5
- <style jsx>{`
6
- .navigation-bar {
7
- width: 100%;
8
- }
9
-
10
- .container {
11
- display: flex;
12
- align-items: stretch;
13
- max-width: 1024px;
14
- padding: 0 1rem;
15
- margin: 0 auto;
16
- height: 4rem;
17
- }
18
-
19
- .container > :global(*:not(:last-child)) {
20
- margin-right: 0.5rem;
21
- }
22
-
23
- .container > :global(*:last-child) {
24
- flex-grow: 1;
25
- }
26
-
27
- @media (min-width: 720px) {
28
- .container {
29
- padding: 0 1rem;
30
- margin: 0 auto;
31
- }
32
- }
33
-
34
- @media (min-width: 960px) {
35
- .container {
36
- height: ${isCompactHeight ? "64px" : "6rem"};
37
- }
38
- }
39
- `}</style>
40
- </div>);
41
- }
42
- export default NavigationBar;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import Button from "../button/button";
3
- function NavigationCallToAction(props) {
4
- return <Button raised display {...props}/>;
5
- }
6
- export default NavigationCallToAction;
@@ -1,165 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import { Icon } from "../icon";
4
- import IconButton from "../icon/icon-button";
5
- import { BACKGROUND_GREY, ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
6
- import NavigationList from "./navigation-list";
7
- function NavigationExpanded({ links, children, onRequestClose, className, banner, }) {
8
- return (<div className={classnames("navigation-menu", className)}>
9
- <div className="content">
10
- {children}
11
- <div>
12
- <hr />
13
- </div>
14
- <div className="columns">
15
- <div className="navigation-list-container">
16
- {links ? <NavigationList items={links}/> : null}
17
- </div>
18
- {banner ? <div className="banner">{banner}</div> : null}
19
- </div>
20
- <div className="close">
21
- <IconButton className="close-button" onClick={onRequestClose}>
22
- <Icon icon="close" size="100%" title="Close"/>
23
- </IconButton>
24
- </div>
25
- </div>
26
- <style jsx>{`
27
- .navigation-menu {
28
- background-color: ${BACKGROUND_GREY};
29
- }
30
-
31
- .navigation-list-container {
32
- flex-grow: 1;
33
- }
34
-
35
- .content {
36
- position: relative;
37
- max-width: 1024px;
38
- margin: 0 auto;
39
- padding: 0rem 1rem 2rem 1rem;
40
- }
41
-
42
- .content > :global(*:not(:last-child)) {
43
- margin-bottom: 1rem;
44
- }
45
-
46
- .content {
47
- display: grid;
48
- grid-gap: 1rem;
49
- }
50
-
51
- .content > :global(*:not(:last-child)) {
52
- margin-bottom: initial;
53
- }
54
-
55
- .main-navigation {
56
- display: flex;
57
- flex-direction: column;
58
- }
59
-
60
- .main-navigation > :global(*:not(:last-child)) {
61
- margin-bottom: 2rem;
62
- }
63
-
64
- .main-navigation-menus {
65
- display: flex;
66
- }
67
-
68
- .main-navigation-menus > :global(*:not(:last-child)) {
69
- margin-right: 4rem;
70
- }
71
-
72
- .columns {
73
- display: flex;
74
- padding: 0;
75
- }
76
-
77
- .columns > :global(*:not(:last-child)) {
78
- margin-right: 8rem;
79
- }
80
-
81
- .span-2 {
82
- flex-grow: 1;
83
- }
84
-
85
- .columns > :global(:not:(:last-child)) {
86
- margin-right: initial;
87
- }
88
-
89
- .span-2 {
90
- grid-column-end: span 2;
91
- }
92
-
93
- .close {
94
- display: none;
95
- }
96
-
97
- .navigation-menu :global(.close-button) {
98
- padding: 6px !important;
99
- font-size: 36px;
100
- }
101
-
102
- .banner {
103
- display: none;
104
- }
105
-
106
- hr {
107
- border: none;
108
- border-top-style: solid;
109
- border-top-width: 1px;
110
- border-color: ${ON_BACKGROUND_GREY_GREY};
111
- color: ${ON_BACKGROUND_GREY_GREY};
112
- background-color: ${ON_BACKGROUND_GREY_GREY};
113
- margin: 0;
114
- }
115
-
116
- @media (min-width: 720px) {
117
- .content {
118
- padding: 2rem;
119
- }
120
-
121
- .content > :global(*:not(:last-child)) {
122
- margin-bottom: 1.5rem;
123
- }
124
-
125
- .content {
126
- grid-gap: 1.5rem;
127
- }
128
-
129
- .columns {
130
- display: flex;
131
- }
132
-
133
- .banner {
134
- display: block;
135
- }
136
- }
137
-
138
- @media (min-width: 960px) {
139
- .content {
140
- padding: 4rem;
141
- }
142
-
143
- .content > :global(*:not(:last-child)) {
144
- margin-bottom: 3rem;
145
- }
146
-
147
- .content > :global(*:not(:last-child)) {
148
- margin-bottom: 0;
149
- }
150
-
151
- .content {
152
- grid-gap: 3rem;
153
- }
154
-
155
- .close {
156
- display: block;
157
- position: absolute;
158
- top: 4rem;
159
- right: 4rem;
160
- }
161
- }
162
- `}</style>
163
- </div>);
164
- }
165
- export default NavigationExpanded;
@@ -1,126 +0,0 @@
1
- import React, { Fragment } from "react";
2
- import { BRAND_DARK_GREY, INACTIVE_GREY } from "../../theme/colors";
3
- import { BoldAnchor } from "../anchor/index";
4
- import { Icon } from "../icon/index";
5
- import { useTheme } from "../../theme/theme";
6
- function NavigationList({ items, onClickItem, active, size = "normal", }) {
7
- const theme = useTheme();
8
- return (<ul className={`size-${size}`}>
9
- {items.map(item => {
10
- const onClick = (e) => {
11
- // href
12
- if ("href" in item)
13
- return;
14
- e.preventDefault();
15
- // combined handler
16
- if (onClickItem)
17
- onClickItem(item.id);
18
- // individual handler
19
- else if (item.onClick)
20
- item.onClick();
21
- };
22
- const href = "href" in item ? item.href : "#";
23
- const id = "id" in item ? item.id : null;
24
- return (<Fragment key={"href" in item ? item.href : item.id}>
25
- <li className="item">
26
- <BoldAnchor analyticsId={item.analyticsId} href={href} onClick={onClick} active={id === active}>
27
- {item.label}{" "}
28
- {"id" in item && item.more ? (<span className="chevron">
29
- <span className="chevron-right">
30
- <Icon icon="chevron_right" size={size === "normal" ? "24px" : "36px"}/>
31
- </span>
32
- <span className="chevron-down">
33
- <Icon icon="expand_more" size={size === "normal" ? "16px" : "24px"}/>
34
- </span>
35
- </span>) : null}
36
- </BoldAnchor>
37
- </li>
38
- {"children" in item ? item.children : null}
39
- </Fragment>);
40
- })}
41
- <style jsx>{`
42
- ul {
43
- margin: 0;
44
- padding: 0;
45
- list-style: none;
46
- }
47
-
48
- .item {
49
- display: flex;
50
- flex-direction: column;
51
- justify-content: center;
52
- font-family: ${theme.typography.fontFamily.brand};
53
- color: ${BRAND_DARK_GREY};
54
- font-weight: 500;
55
- }
56
-
57
- .size-large .item {
58
- font-size: 1rem;
59
- height: 2.5rem;
60
- }
61
-
62
- .size-normal .item {
63
- font-size: 0.875rem;
64
- height: 1.75rem;
65
- }
66
-
67
- .item :global(a:focus) {
68
- outline: none;
69
- }
70
-
71
- .item:focus-within {
72
- outline: -webkit-focus-ring-color auto 5px;
73
- }
74
-
75
- .chevron {
76
- position: relative;
77
- display: inline-block;
78
- width: 1em;
79
- height: 1em;
80
- margin-left: 1rem;
81
- vertical-align: middle;
82
- line-height: 1;
83
- transform: translateY(-5%);
84
- color: ${INACTIVE_GREY};
85
- }
86
-
87
- .chevron-right {
88
- display: none;
89
- }
90
-
91
- .item :global(a:hover) .chevron,
92
- .item :global(a:focus) .chevron,
93
- .item :global(a.active) .chevron {
94
- color: inherit;
95
- }
96
-
97
- .chevron > :global(*) {
98
- position: absolute;
99
- top: 50%;
100
- left: 50%;
101
- transform: translate(-50%, -50%);
102
- }
103
-
104
- @media (min-width: 720px) {
105
- .size-large .item {
106
- font-size: 1.375rem;
107
- min-height: 3rem;
108
- }
109
-
110
- .size-normal .item {
111
- font-size: 1.125rem;
112
- min-height: 2.5rem;
113
- }
114
-
115
- .chevron-right {
116
- display: initial;
117
- }
118
-
119
- .chevron-down {
120
- display: none;
121
- }
122
- }
123
- `}</style>
124
- </ul>);
125
- }
126
- export default NavigationList;
@@ -1,25 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import { ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
4
- import { ToggleButton, Icon } from "../icon";
5
- function NavigationMenuControl({ isMenuOpen, onChangeMenuOpen, className, ...rest }) {
6
- return (<div className={classnames("menu-control", className)} {...rest}>
7
- <ToggleButton active={<Icon icon="menu"/>} inactive={<Icon icon="close"></Icon>} value={isMenuOpen} onChange={onChangeMenuOpen}/>
8
- <style jsx>{`
9
- .menu-control {
10
- display: flex;
11
- align-items: center;
12
- }
13
-
14
- .menu-control::before {
15
- content: "";
16
- display: inline-block;
17
- width: 1px;
18
- height: 2rem;
19
- border-left: 1px solid ${ON_BACKGROUND_GREY_GREY};
20
- margin-right: calc(0.5rem - 1px);
21
- }
22
- `}</style>
23
- </div>);
24
- }
25
- export default NavigationMenuControl;
@@ -1,126 +0,0 @@
1
- import React from "react";
2
- import Button from "../button/button";
3
- import { BACKGROUND_GREY, ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
4
- import NavigationList from "./navigation-list";
5
- export function NavigationMenu({ links, sublinks, action, actionRaised, active, onClickItem, }) {
6
- return (<div className="navigation-menu">
7
- <div className="main-navigation">
8
- <div className="main-navigation-menus">
9
- <NavigationList items={links.map(link => ({
10
- ...link,
11
- children: sublinks && "id" in link && link.id === active ? (<div className="inline-submenu">
12
- <NavigationList items={sublinks} active={null}/>
13
- </div>) : null,
14
- }))} onClickItem={onClickItem} active={active} size="large"/>
15
- {sublinks ? (<div className="side-submenu">
16
- <NavigationList items={sublinks} active={null}/>
17
- </div>) : null}
18
- </div>
19
- <div>
20
- {action ? (<Button display outlined color="primary" analyticsId={action.analyticsId} onClick={(e) => {
21
- /**
22
- * Prevent nav action button to turn into a hyperlink.
23
- * This is so that google analytics will always be triggered.
24
- * If we use a hyperlink instead of button clicks on the label
25
- * wont be considered as a click on the hyperlink.
26
- */
27
- if ("href" in action)
28
- window.location.href = action.href;
29
- e.preventDefault();
30
- if ("onClick" in action && action.onClick)
31
- action.onClick();
32
- }}>
33
- {action.label}
34
- </Button>) : null}
35
- {actionRaised ? (<Button className="actionRaised-button" display outlined raised color="primary" analyticsId={actionRaised.analyticsId} onClick={(e) => {
36
- /**
37
- * Prevent nav actionRaised button to turn into a hyperlink.
38
- * This is so that google analytics will always be triggered.
39
- * If we use a hyperlink instead of button clicks on the label
40
- * wont be considered as a click on the hyperlink.
41
- */
42
- if ("href" in actionRaised)
43
- window.location.href = actionRaised.href;
44
- e.preventDefault();
45
- if ("onClick" in actionRaised && actionRaised.onClick)
46
- actionRaised.onClick();
47
- }}>
48
- {actionRaised.label}
49
- </Button>) : null}
50
- </div>
51
- </div>
52
- <style jsx>{`
53
- .navigation-menu {
54
- background-color: ${BACKGROUND_GREY};
55
- }
56
-
57
- .side-submenu {
58
- display: none;
59
- padding-left: 3rem;
60
- border-left: 1px solid ${ON_BACKGROUND_GREY_GREY};
61
- }
62
-
63
- .inline-submenu {
64
- padding: 0 1rem 1rem 1rem;
65
- }
66
-
67
- .content {
68
- position: relative;
69
- max-width: 1024px;
70
- margin: 0 auto;
71
- padding: 4rem;
72
- }
73
-
74
- .content > :global(*:not(:last-child)) {
75
- margin-bottom: 3rem;
76
- }
77
-
78
- @supports (display: grid) {
79
- .content {
80
- display: grid;
81
- grid-gap: 3rem;
82
- }
83
-
84
- .content > :global(*:not(:last-child)) {
85
- margin-bottom: initial;
86
- }
87
- }
88
-
89
- .main-navigation {
90
- display: flex;
91
- flex-direction: column;
92
- }
93
-
94
- .main-navigation > :global(*:not(:last-child)) {
95
- margin-bottom: 2rem;
96
- }
97
-
98
- .main-navigation-menus {
99
- display: flex;
100
- }
101
-
102
- .main-navigation-menus > :global(*:not(:last-child)) {
103
- margin-right: 3rem;
104
- }
105
- :global(.actionRaised-button) {
106
- float: right;
107
- }
108
- @media (min-width: 720px) {
109
- .side-submenu {
110
- display: initial;
111
- }
112
-
113
- .inline-submenu {
114
- display: none;
115
- }
116
- }
117
- @media (max-width: 579px) {
118
- :global(.actionRaised-button) {
119
- float: left !important;
120
- margin-top: 15px;
121
- }
122
- }
123
- `}</style>
124
- </div>);
125
- }
126
- export default NavigationMenu;
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { IconButton, Icon } from "../icon";
3
- function NavigationSearchControl({ onChangeSearchOpen, analyticsId, }) {
4
- return (<IconButton id={analyticsId} onClick={() => onChangeSearchOpen(true)}>
5
- <Icon icon="search"/>
6
- </IconButton>);
7
- }
8
- export default NavigationSearchControl;
@@ -1,63 +0,0 @@
1
- import React, { useRef, useEffect } from "react";
2
- import { TextField } from "../text-field";
3
- import { Icon } from "../icon";
4
- import { Button } from "../button";
5
- import useMedia from "use-media";
6
- function NavigationSearch({ value, onChange, onSubmit, onCancel, }) {
7
- // Focus the search bar when opened
8
- const input = useRef(null);
9
- useEffect(() => {
10
- if (input.current) {
11
- input.current.focus();
12
- }
13
- }, [input]);
14
- const handleKeyDown = (e) => {
15
- if (e.key === "Enter") {
16
- e.preventDefault();
17
- onSubmit();
18
- }
19
- };
20
- const handleChange = (e) => {
21
- onChange(e.currentTarget.value);
22
- };
23
- const placeholder = "Try searching for a friend, campaign, or event";
24
- const isMobile = useMedia("screen and (max-width: 719px)");
25
- const isCompact = useMedia("screen and (max-width: 959px)");
26
- return (<>
27
- <div className="navigation-search">
28
- {!isCompact ? (<TextField leadingIcon={<Icon icon="search"/>} trailingIcon={<Icon icon="close" title="close"/>} onTrailingIconSelect={() => onCancel()} onChange={handleChange} onKeyDown={handleKeyDown} value={value} placeholder={placeholder} ref={input} large/>) : (<>
29
- <TextField leadingIcon={<Icon icon="search"/>} trailingIcon={value ? <Icon icon="cancel" title="clear"/> : undefined} onTrailingIconSelect={() => onChange("")} onChange={(e) => onChange(e.currentTarget.value)} onKeyDown={handleKeyDown} value={value} placeholder={!isMobile ? placeholder : "Search"} ref={input}/>
30
- <div className="cancel">
31
- <Button onClick={() => onCancel()}>Cancel</Button>
32
- </div>
33
- </>)}
34
- </div>
35
- <style jsx>{`
36
- .navigation-search {
37
- height: 100%;
38
- width: 100%;
39
- display: flex;
40
- align-items: center;
41
- }
42
-
43
- .navigation-search > :global(*:first-child) {
44
- flex-grow: 1;
45
- }
46
-
47
- .cancel {
48
- margin-left: 0.5rem;
49
- }
50
-
51
- .cancel :global(.button) {
52
- height: 3.5rem;
53
- }
54
-
55
- @media (min-width: 720px) {
56
- .navigation-search {
57
- padding: 0 1rem;
58
- }
59
- }
60
- `}</style>
61
- </>);
62
- }
63
- export default NavigationSearch;