@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,81 +0,0 @@
1
- import React from "react";
2
- import { SingleDatePicker } from "react-dates";
3
- import { useTheme, getColorToken } from "../../theme/theme";
4
- import { FieldLabel } from "../field-helpers";
5
- import { Stack } from "../layout";
6
- const CustomSingleDatePicker = ({ width, color = "primary", onDateChange, onFocusChange, numberOfMonths = 1, error, label, ...rest }) => {
7
- const theme = useTheme();
8
- const setColor = getColorToken(theme, "foreground", color);
9
- return (<div className="calendar-container">
10
- <Stack direction="column" gap="0.5rem 0">
11
- <div>{label && <FieldLabel required>{label}</FieldLabel>}</div>
12
- <SingleDatePicker numberOfMonths={numberOfMonths} onDateChange={onDateChange} onFocusChange={(e) => onFocusChange(e.focused)} {...rest}/>
13
- </Stack>
14
- <style jsx>{`
15
- :global(.SingleDatePicker) {
16
- width: ${width};
17
- }
18
- :global(.SingleDatePickerInput) {
19
- width: 100%;
20
- }
21
- :global(.DateInput) {
22
- width: 100%;
23
- }
24
- .calendar-container {
25
- font-family: ${theme.typography.fontFamily.brand};
26
- }
27
- :global(.SingleDatePickerInput__withBorder) {
28
- border-width: 2px !important;
29
- border-radius: 4px !important;
30
- border-color: ${error && "#b00020"};
31
- }
32
- :global(.SingleDatePickerInput__withBorder:hover) {
33
- border-width: 1px !important;
34
- border-color: #000000 !important;
35
- }
36
- :global(.SingleDatePickerInput__withBorder:focus-within) {
37
- border-width: 2px !important;
38
- border-color: ${setColor} !important;
39
- }
40
- :global(.DateInput_input) {
41
- font-weight: 500 !important;
42
- font-size: 15px;
43
- }
44
- :global(.DayPickerKeyboardShortcuts_show__bottomRight::before) {
45
- border-right: 33px solid ${setColor} !important;
46
- }
47
- :global(.DateInput_input__focused) {
48
- border: none;
49
- }
50
- :global(.CalendarDay__selected_span) {
51
- background: ${setColor};
52
- color: white;
53
- opacity: 0.7;
54
- border: 1px solid white;
55
- }
56
-
57
- :global(.CalendarDay__selected) {
58
- background: ${setColor};
59
- color: white;
60
- border: 1px double white;
61
- }
62
-
63
- :global(.CalendarDay__selected:hover) {
64
- background: ${setColor};
65
- color: white;
66
- border: 1px double white;
67
- }
68
-
69
- :global(.CalendarDay__selected_span:active, .CalendarDay__selected_span:hover) {
70
- background: ${setColor};
71
- opacity: 0.5;
72
- }
73
-
74
- :global(.CalendarDay__hovered_span:hover, .CalendarDay__hovered_span) {
75
- background: ${setColor};
76
- color: white;
77
- }
78
- `}</style>
79
- </div>);
80
- };
81
- export default CustomSingleDatePicker;
@@ -1,24 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- import Box from "../layout/box";
5
- import nanoid from "nanoid";
6
- const Elevation = ({ dp, id, radius = "4px", children, className, transition, ...res }) => {
7
- const [mainId, setmainId] = useState("");
8
- useEffect(() => {
9
- setmainId(id ? id : nanoid());
10
- }, [id, setmainId]);
11
- const scope = css.resolve `
12
- .elevation {
13
- border-radius: ${radius};
14
- overflow: hidden;
15
- }
16
- `;
17
- return (<Box id={mainId} key={mainId} className={classnames("elevation", {
18
- "mdc-elevation-transition": transition,
19
- }, `mdc-elevation--z${dp ? dp : 0}`, scope.className, className)} {...res}>
20
- {children}
21
- {scope.styles}
22
- </Box>);
23
- };
24
- export default Elevation;
@@ -1,31 +0,0 @@
1
- import React, { Fragment } from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import Elevation from "./elevation";
4
- export default {
5
- title: "Elevation",
6
- decorators: [CenterDecorator],
7
- };
8
- export const ElevationExample = () => {
9
- const elevationsArray = [];
10
- for (let i = 0; i <= 24; i++) {
11
- elevationsArray.push(<Elevation dp={i} key={i} transition={true} className="elevation-example">
12
- Example {i} dp
13
- </Elevation>);
14
- }
15
- return (<Fragment>
16
- <div className="elevate-container">{elevationsArray}</div>
17
- <style jsx>{`
18
- :global(.elevation-example) {
19
- padding: 20px;
20
- margin: 20px;
21
- }
22
- .elevate-container {
23
- display: grid;
24
- grid-template-columns: auto auto auto auto auto;
25
- }
26
- `}</style>
27
- </Fragment>);
28
- };
29
- ElevationExample.story = {
30
- name: "default",
31
- };
@@ -1 +0,0 @@
1
- export { default as Elevation } from "./elevation";
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import { useTheme } from "../../theme";
4
- function FieldHelperText({ hidden, children, error }) {
5
- const theme = useTheme();
6
- return (<div className={classnames("field-helper-text")}>
7
- <p className={classnames({ hidden, error })}>
8
- {error ? error : children}
9
- </p>
10
- <style jsx>{`
11
- .field-helper-text {
12
- margin-bottom: 4px;
13
- display: flex;
14
- justify-content: space-between;
15
- }
16
-
17
- p {
18
- color: rgba(0, 0, 0, 0.6);
19
- font-size: 0.75rem;
20
- letter-spacing: 0;
21
- margin: 0;
22
- line-height: 19px;
23
- transition: opacity 150ms ease;
24
- }
25
-
26
- .hidden {
27
- opacity: 0;
28
- }
29
-
30
- .error {
31
- color: #b00020;
32
- }
33
- `}</style>
34
- <style jsx>{`
35
- p {
36
- font-weight: 500;
37
- font-family: ${theme.typography.fontFamily.brand};
38
- }
39
- `}</style>
40
- </div>);
41
- }
42
- export default FieldHelperText;
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import { useTheme } from "../../theme";
4
- function FieldLabel({ large, className, children, required, ...rest }) {
5
- const theme = useTheme();
6
- return (<label className={classnames("field-label", {
7
- "field-label--dense": !large,
8
- }, className)} {...rest}>
9
- {children}
10
- {required ? "*" : null}
11
- <style jsx>{`
12
- .field-label {
13
- font-weight: 500;
14
- font-family: ${theme.typography.fontFamily.brand};
15
- font-size: 0.875rem;
16
- margin: 0.5rem 0;
17
- display: inline-block;
18
- letter-spacing: 0.00937rem;
19
- color: rgba(0, 0, 0, 0.6);
20
- line-height: 1rem;
21
- }
22
-
23
- .field-label--dense {
24
- font-size: 0.75rem;
25
- }
26
- `}</style>
27
- </label>);
28
- }
29
- export default FieldLabel;
@@ -1,2 +0,0 @@
1
- export { default as FieldLabel } from "./field-label";
2
- export { default as FieldHelperText } from "./field-helper-text";
@@ -1,22 +0,0 @@
1
- // @ts-nocheck
2
- import React from "react";
3
- /**
4
- * Google logo for Google sign in
5
- *
6
- * Based on the file btn_google_light_normal_ios.svg but with the button background removed
7
- * See: https://developers.google.com/identity/branding-guidelines
8
- */
9
- export default function GoogleIconSvg(props) {
10
- return (<svg height="24" width="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" {...props}>
11
- <title>btn_google_light_normal_ios</title>
12
- <g id="Google-Button" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
13
- <g id="logo_googleg_48dp" transform="translate(4.000000, 4.000000)">
14
- <path d="M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z" id="Shape" fill="#4285F4"></path>
15
- <path d="M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z" id="Shape" fill="#34A853"></path>
16
- <path d="M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z" id="Shape" fill="#FBBC05"></path>
17
- <path d="M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z" id="Shape" fill="#EA4335"></path>
18
- <path d="M0,0 L18,0 L18,18 L0,18 L0,0 Z" id="Shape"></path>
19
- </g>
20
- </g>
21
- </svg>);
22
- }
@@ -1,14 +0,0 @@
1
- // @ts-nocheck
2
- import React from "react";
3
- /**
4
- * Facebook icon for Facebook login
5
- *
6
- * See: https://iconmonstr.com/facebook-6-svg/
7
- *
8
- * Only use with the color #3C5A99
9
- */
10
- export default function FacebookIconSVG(props) {
11
- return (<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" {...props}>
12
- <path d="M22.675 0h-21.35c-.732 0-1.325.593-1.325 1.325v21.351c0 .731.593 1.324 1.325 1.324h11.495v-9.294h-3.128v-3.622h3.128v-2.671c0-3.1 1.893-4.788 4.659-4.788 1.325 0 2.463.099 2.795.143v3.24l-1.918.001c-1.504 0-1.795.715-1.795 1.763v2.313h3.587l-.467 3.622h-3.12v9.293h6.116c.73 0 1.323-.593 1.323-1.325v-21.35c0-.732-.593-1.325-1.325-1.325z"/>
13
- </svg>);
14
- }
@@ -1,51 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import { useTheme } from "../../theme/theme";
4
- import css from "styled-jsx/css";
5
- function IconButtonGroup({ children, size, isOutlinedOnFocus, }) {
6
- const theme = useTheme();
7
- children = React.Children.map(children, (child) => React.cloneElement(child, { size }));
8
- const scope = css.resolve `
9
- .icon-button-group.icon-button-group--outline-on-focus:focus-within::after {
10
- border-color: ${theme.color.foreground.primary};
11
- border-radius: 4px;
12
- }
13
- `;
14
- return (<div className={classnames("icon-button-group", {
15
- "icon-button-group--outline-on-focus": !!isOutlinedOnFocus,
16
- }, scope.className)}>
17
- {children}
18
- <style jsx>{`
19
- .icon-button-group {
20
- position: relative;
21
- display: flex;
22
- flex-direction: row;
23
- }
24
-
25
- .icon-button-group::after {
26
- content: "";
27
- position: absolute;
28
- display: block;
29
- top: 0;
30
- right: 0;
31
- bottom: 0;
32
- left: 0;
33
- border: 1px solid #9e9e9e;
34
- border-radius: 4px;
35
- pointer-events: none;
36
- }
37
-
38
- .icon-button-group:hover::after {
39
- border: 1px solid rgba(0, 0, 0, 0.87);
40
- }
41
-
42
- .icon-button-group.icon-button-group--outline-on-focus:focus-within::after {
43
- border-width: 2px;
44
- border-style: solid;
45
- border-radius: 4px;
46
- }
47
- `}</style>
48
- {scope.styles}
49
- </div>);
50
- }
51
- export default IconButtonGroup;
@@ -1,26 +0,0 @@
1
- import React, { useState } from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import IconButton from "./icon-button";
4
- import IconButtonGroup from "./icon-button-group";
5
- import Icon from "./icon";
6
- export default {
7
- title: "IconButtonGroup",
8
- decorators: [CenterDecorator],
9
- };
10
- const options = [
11
- { value: "left", icon: "format_align_left" },
12
- { value: "center", icon: "format_align_center" },
13
- { value: "right", icon: "format_align_right" },
14
- { value: "justify", icon: "format_align_justify" },
15
- ];
16
- export const IconButtonGroupStory = () => {
17
- const [alignment, setAlignment] = useState("center");
18
- return (<IconButtonGroup>
19
- {options.map(option => (<IconButton pressed={option.value === alignment} onClick={() => setAlignment(option.value)} key={option.value}>
20
- <Icon icon={option.icon}/>
21
- </IconButton>))}
22
- </IconButtonGroup>);
23
- };
24
- IconButtonGroupStory.story = {
25
- name: "default",
26
- };
@@ -1,48 +0,0 @@
1
- import React, { forwardRef, useState } from "react";
2
- import css from "styled-jsx/css";
3
- import classnames from "classnames";
4
- import MDCIconButton from "@material/react-icon-button";
5
- import { tapEvent } from "../../utils/tap-event";
6
- const IconButton = forwardRef(function IconButton({ children, size, className, pressed, onBlur, ...rest }, ref) {
7
- const [count, update] = useState(0);
8
- // MDCIconButton currently makes all icon buttons toggle buttons
9
- // by toggling aria-pressed, and there is no way to make them
10
- // normal single trigger buttons.
11
- // By forcing a remount when the component blurs (by changing the key),
12
- // we the button's aria-pressed will be reset to false upon leaving the button.
13
- const handleBlur = tapEvent(() => {
14
- if (typeof pressed === "undefined") {
15
- update(c => c + 1);
16
- }
17
- }, onBlur);
18
- const scope = css.resolve `
19
- .mdc-icon-button {
20
- display: inline-flex;
21
- align-items: center;
22
- justify-content: center;
23
- }
24
-
25
- .toggle {
26
- transition: background-color 200ms ease;
27
- }
28
-
29
- .toggle--active {
30
- background-color: rgba(0, 0, 0, 0.1);
31
- border-radius: 4px;
32
- }
33
-
34
- .size {
35
- width: ${size || ""};
36
- height: ${size || ""};
37
- }
38
- `;
39
- return (<MDCIconButton key={count} className={classnames(className, scope.className, {
40
- toggle: typeof pressed !== "undefined",
41
- "toggle--active": pressed === true,
42
- size,
43
- })} ref={ref} onBlur={handleBlur} {...rest}>
44
- {children}
45
- {scope.styles}
46
- </MDCIconButton>);
47
- });
48
- export default IconButton;
@@ -1,33 +0,0 @@
1
- import React, { useState } from "react";
2
- import Matrix from "../../utils/component-matrix";
3
- import CenterDecorator from "../../utils/center-decorator";
4
- import IconButton from "./icon-button";
5
- import Icon from "./icon";
6
- export default {
7
- title: "IconButton",
8
- decorators: [CenterDecorator],
9
- };
10
- export const iconButton = () => {
11
- const props = {
12
- primary: [{ icon: "close" }, { icon: "today" }, { icon: "delete" }],
13
- };
14
- return (<Matrix {...props}>
15
- {props => (<IconButton>
16
- <Icon {...props}/>
17
- </IconButton>)}
18
- </Matrix>);
19
- };
20
- iconButton.story = {
21
- name: "default",
22
- };
23
- export const Toggle = () => {
24
- const [isPressed, setIsPressed] = useState(false);
25
- return (<>
26
- <IconButton pressed={isPressed} onClick={() => setIsPressed(!isPressed)}>
27
- <Icon icon="format_align_left"/>
28
- </IconButton>
29
- </>);
30
- };
31
- Toggle.story = {
32
- name: "toggle",
33
- };
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- import { useTheme, getColorToken } from "../../theme/theme";
5
- import MaterialIcon from "./material-icon";
6
- function Icon({ icon, iconSet, color = "neutral", invert, className, size, ...rest }) {
7
- const theme = useTheme();
8
- const foreground = getColorToken(theme, "foreground", color, { invert });
9
- const scope = css.resolve `
10
- .icon,
11
- :global(.mdc-text-field):not(.mdc-text-field--disabled)
12
- .mdc-text-field__icon {
13
- color: ${foreground};
14
- }
15
-
16
- svg {
17
- width: 24px;
18
- height: 24px;
19
- fill: currentColor;
20
- }
21
-
22
- .icon--sized {
23
- width: ${size};
24
- height: ${size};
25
- font-size: ${size};
26
- }
27
- `;
28
- const props = {
29
- className: classnames("icon", className, scope.className, {
30
- sized: !!size,
31
- }),
32
- ...rest,
33
- };
34
- if (typeof icon === "string") {
35
- return (<>
36
- <MaterialIcon icon={icon} iconSet={iconSet} size={size} {...props}/>
37
- {scope.styles}
38
- </>);
39
- }
40
- let elem = icon;
41
- return (<>
42
- {React.cloneElement(elem, {
43
- ...props,
44
- className: classnames(elem.props.className, props.className, "svg-icon"),
45
- })}
46
- {scope.styles}
47
- </>);
48
- }
49
- export default Icon;
@@ -1,78 +0,0 @@
1
- import React from "react";
2
- import Matrix from "../../utils/component-matrix";
3
- import CenterDecorator from "../../utils/center-decorator";
4
- import Icon from "./icon";
5
- import Google from "./btn_google_light_normal_ios.svg";
6
- import Facebook from "./facebook_6.svg";
7
- export default {
8
- title: "Icon",
9
- decorators: [CenterDecorator],
10
- };
11
- export const material = () => {
12
- const props = {
13
- primary: [
14
- { icon: "card_giftcard" },
15
- { icon: "favorite" },
16
- { icon: "favorite_border" },
17
- { icon: "close" },
18
- { icon: "chevron_right" },
19
- ],
20
- };
21
- return (<Matrix {...props}>
22
- {props => <Icon {...props}/>}
23
- </Matrix>);
24
- };
25
- material.story = {
26
- name: "material icons",
27
- };
28
- export const colors = () => {
29
- const props = {
30
- primary: [
31
- { icon: "card_giftcard" },
32
- { icon: "favorite" },
33
- { icon: "favorite_outline" },
34
- { icon: "close" },
35
- { icon: "chevron_right" },
36
- ],
37
- secondary: [
38
- { color: "neutral" },
39
- { color: "primary" },
40
- { color: "secondary" },
41
- { color: "accent" },
42
- { color: "#e0e0e0" },
43
- ],
44
- };
45
- return (<Matrix {...props}>
46
- {props => <Icon {...props}/>}
47
- </Matrix>);
48
- };
49
- colors.story = {
50
- name: "colors",
51
- };
52
- export const svg = () => {
53
- const props = {
54
- primary: [
55
- {
56
- color: "accent",
57
- icon: (<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
58
- <path d="M0 0h24v24H0z" fill="none"/>
59
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
60
- </svg>),
61
- },
62
- {
63
- color: { foreground: "#3C5A99", background: "white" },
64
- icon: <Facebook />,
65
- },
66
- {
67
- color: "neutral",
68
- icon: <Google />,
69
- },
70
- ],
71
- };
72
- return (<Matrix {...props}>
73
- {props => <Icon {...props}/>}
74
- </Matrix>);
75
- };
76
- svg.story = {
77
- name: "svg icons",
78
- };
@@ -1,4 +0,0 @@
1
- export { default as Icon } from "./icon";
2
- export { default as IconButton } from "./icon-button";
3
- export { default as IconButtonGroup } from "./icon-button-group";
4
- export { default as ToggleButton } from "./toggle-button";
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import classnames from "classnames";
3
- import css from "styled-jsx/css";
4
- function MaterialIcon({ icon, iconSet, className, size = "24px", ...rest }) {
5
- const scope = css.resolve `
6
- i {
7
- font-size: ${size};
8
- }
9
- `;
10
- return (<i className={classnames(className, iconSet, scope.className)} {...rest}>
11
- {icon}
12
- {scope.styles}
13
- </i>);
14
- }
15
- MaterialIcon.defaultProps = {
16
- iconSet: "material-icons",
17
- };
18
- export default MaterialIcon;
@@ -1,29 +0,0 @@
1
- import React, { forwardRef, useState } from "react";
2
- import MDCIconButton, { IconToggle, } from "@material/react-icon-button";
3
- const ToggleButton = forwardRef(function ToggleButton({ active, inactive, value, onChange, onClick, ...rest }, ref) {
4
- const [initialValue] = useState(value);
5
- const handleClick = (e) => {
6
- if (onChange) {
7
- e.preventDefault();
8
- onChange(!value);
9
- }
10
- else {
11
- onClick(e);
12
- }
13
- };
14
- const props = {
15
- onClick: handleClick,
16
- ref,
17
- // aria-pressed controls whether or not the button is in the 'pressed' state
18
- // however the icon that shows does not respect this, the icon that is set to isOn will always show first,
19
- // regardless of the aria-pressed state
20
- // as a workaround the initial value is captured and used to decide which IconToggle represents the 'on' state
21
- "aria-pressed": value,
22
- ...rest,
23
- };
24
- return (<MDCIconButton {...props}>
25
- <IconToggle isOn={initialValue}>{active}</IconToggle>
26
- <IconToggle isOn={!initialValue}>{inactive}</IconToggle>
27
- </MDCIconButton>);
28
- });
29
- export default ToggleButton;
@@ -1,16 +0,0 @@
1
- import React, { useState } from "react";
2
- import CenterDecorator from "../../utils/center-decorator";
3
- import ToggleButton from "./toggle-button";
4
- import Icon from "./icon";
5
- function StatefulToggleButton(props) {
6
- const [state, setState] = useState(true);
7
- return <ToggleButton value={state} onChange={setState} {...props}/>;
8
- }
9
- export default {
10
- title: "ToggleButton",
11
- decorators: [CenterDecorator],
12
- };
13
- export const toggleButton = () => (<StatefulToggleButton active={<Icon icon="favorite_outline"/>} inactive={<Icon icon="favorite"/>}/>);
14
- toggleButton.story = {
15
- name: "default",
16
- };
@@ -1,28 +0,0 @@
1
- /* Public component exports */
2
- /* Please keep these sorted alphabetically */
3
- export * from "./anchor";
4
- export * from "./avatar";
5
- export * from "./button";
6
- export * from "./button-select";
7
- export * from "./chips";
8
- export * from "./checkbox";
9
- export * from "./cropper";
10
- export * from "./combo-field";
11
- export * from "./date-picker";
12
- export * from "./elevation";
13
- export * from "./field-helpers";
14
- export * from "./icon";
15
- export * from "./layout";
16
- export * from "./list";
17
- export * from "./menu";
18
- export * from "./modal";
19
- export * from "./navigation";
20
- export * from "./phone-number-input";
21
- export * from "./radio";
22
- export * from "./select";
23
- export * from "./statistics";
24
- export * from "./switch";
25
- export * from "./tabs";
26
- export * from "./text-field";
27
- export * from "./text";
28
- export * from "./uploader";