gogoclient 1.2.2

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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/components/AuthWrapper.js +61 -0
  4. package/dist/components/PageLayout.js +53 -0
  5. package/dist/components/RequireAuth.js +86 -0
  6. package/dist/components/index.js +27 -0
  7. package/dist/helpers/Root.js +206 -0
  8. package/dist/helpers/SubscriptionManager.js +61 -0
  9. package/dist/helpers/currentUserContext.js +12 -0
  10. package/dist/helpers/currentUserQuery.js +11 -0
  11. package/dist/helpers/getUrl.js +18 -0
  12. package/dist/helpers/sentry.js +25 -0
  13. package/dist/helpers/startClient.js +25 -0
  14. package/dist/helpers/subscriptionManagerContext.js +22 -0
  15. package/dist/index.js +109 -0
  16. package/dist/pages/ProviderConnection.page.js +99 -0
  17. package/dist/pages/ProviderConnection.queries.js +12 -0
  18. package/dist/pages/index.js +28 -0
  19. package/dist/theme/elements/Action.js +29 -0
  20. package/dist/theme/elements/ActionGroup.js +14 -0
  21. package/dist/theme/elements/AppBar.js +17 -0
  22. package/dist/theme/elements/Button.js +31 -0
  23. package/dist/theme/elements/Checkbox.js +38 -0
  24. package/dist/theme/elements/GlobalStyle.js +10 -0
  25. package/dist/theme/elements/Logo.js +10 -0
  26. package/dist/theme/elements/Menu.js +15 -0
  27. package/dist/theme/elements/Radio.js +27 -0
  28. package/dist/theme/elements/TextField.js +39 -0
  29. package/dist/theme/elements/index.js +76 -0
  30. package/dist/theme/index.js +93 -0
  31. package/dist/toolkit/darkenLighten.js +57 -0
  32. package/dist/toolkit/headingScale.js +29 -0
  33. package/dist/toolkit/index.js +79 -0
  34. package/dist/toolkit/media.js +23 -0
  35. package/dist/toolkit/override.js +74 -0
  36. package/dist/toolkit/styles/fadeInOut.js +11 -0
  37. package/dist/toolkit/styles/rotate360.js +11 -0
  38. package/dist/toolkit/themeHelper.js +53 -0
  39. package/dist/ui/_helpers/_helpers.js +69 -0
  40. package/dist/ui/_helpers/cssSnippets.js +11 -0
  41. package/dist/ui/_helpers/index.js +40 -0
  42. package/dist/ui/_helpers/useBreakpoint.js +35 -0
  43. package/dist/ui/assignReviewers/AssignReviewers.js +174 -0
  44. package/dist/ui/assignReviewers/InviteRowProp.js +130 -0
  45. package/dist/ui/assignReviewers/ReviewerTable.js +268 -0
  46. package/dist/ui/assignReviewers/SearchBox.js +160 -0
  47. package/dist/ui/assignReviewers/SuggestedReviewer.js +28 -0
  48. package/dist/ui/assignReviewers/index.js +13 -0
  49. package/dist/ui/authentication/AuthenticationForm.js +87 -0
  50. package/dist/ui/authentication/AuthenticationHeader.js +13 -0
  51. package/dist/ui/authentication/AuthenticationWrapper.js +13 -0
  52. package/dist/ui/authentication/ChangePassword.js +128 -0
  53. package/dist/ui/authentication/DeactivatedUser.js +17 -0
  54. package/dist/ui/authentication/Login.js +74 -0
  55. package/dist/ui/authentication/ProfileForm.js +79 -0
  56. package/dist/ui/authentication/ProviderConnection.js +69 -0
  57. package/dist/ui/authentication/RequestPasswordReset.js +89 -0
  58. package/dist/ui/authentication/ResetPassword.js +96 -0
  59. package/dist/ui/authentication/Signup.js +180 -0
  60. package/dist/ui/authentication/SuccessSubTitle.js +20 -0
  61. package/dist/ui/authentication/VerifyCheck.js +55 -0
  62. package/dist/ui/authentication/VerifyEmail.js +119 -0
  63. package/dist/ui/authentication/index.js +104 -0
  64. package/dist/ui/chat/ChatInput.js +63 -0
  65. package/dist/ui/chat/ChatMessage.js +67 -0
  66. package/dist/ui/chat/ChatMessageList.js +45 -0
  67. package/dist/ui/chat/ChatThread.js +41 -0
  68. package/dist/ui/chat/index.js +34 -0
  69. package/dist/ui/common/AutoComplete.js +56 -0
  70. package/dist/ui/common/Button.js +83 -0
  71. package/dist/ui/common/ButtonGroup.js +58 -0
  72. package/dist/ui/common/Checkbox.js +30 -0
  73. package/dist/ui/common/CheckboxGroup.js +42 -0
  74. package/dist/ui/common/CokoLink.js +24 -0
  75. package/dist/ui/common/Collapse.js +14 -0
  76. package/dist/ui/common/DateParser.js +49 -0
  77. package/dist/ui/common/Divider.js +8 -0
  78. package/dist/ui/common/Empty.js +14 -0
  79. package/dist/ui/common/Form.js +216 -0
  80. package/dist/ui/common/FormSection.js +35 -0
  81. package/dist/ui/common/Headings.js +74 -0
  82. package/dist/ui/common/Input.js +72 -0
  83. package/dist/ui/common/InputNumber.js +54 -0
  84. package/dist/ui/common/InviteStatus.js +63 -0
  85. package/dist/ui/common/Layout.js +17 -0
  86. package/dist/ui/common/LinkWithoutStyles.js +12 -0
  87. package/dist/ui/common/List.js +390 -0
  88. package/dist/ui/common/Modal.js +17 -0
  89. package/dist/ui/common/Note.js +23 -0
  90. package/dist/ui/common/Page.js +33 -0
  91. package/dist/ui/common/Pagination.js +126 -0
  92. package/dist/ui/common/Popup.js +146 -0
  93. package/dist/ui/common/Radio.js +54 -0
  94. package/dist/ui/common/Result.js +8 -0
  95. package/dist/ui/common/Ribbon.js +54 -0
  96. package/dist/ui/common/Search.js +30 -0
  97. package/dist/ui/common/Select.js +148 -0
  98. package/dist/ui/common/Spin.js +87 -0
  99. package/dist/ui/common/Split.js +49 -0
  100. package/dist/ui/common/Status.js +53 -0
  101. package/dist/ui/common/Switch.js +47 -0
  102. package/dist/ui/common/Table.js +111 -0
  103. package/dist/ui/common/Tabs.js +8 -0
  104. package/dist/ui/common/TabsStyled.js +65 -0
  105. package/dist/ui/common/TextArea.js +29 -0
  106. package/dist/ui/common/Typography.js +9 -0
  107. package/dist/ui/common/VisuallyHiddenElement.js +17 -0
  108. package/dist/ui/common/_reusableStyles.js +14 -0
  109. package/dist/ui/common/index.js +341 -0
  110. package/dist/ui/index.js +49 -0
  111. package/package.json +114 -0
  112. package/scripts/coko-client-build.js +42 -0
  113. package/scripts/coko-client-build.sh +28 -0
  114. package/scripts/coko-client-dev.js +16 -0
  115. package/scripts/coko-client-dev.sh +28 -0
  116. package/scripts/env.sh +41 -0
  117. package/webpack/changes.md +20 -0
  118. package/webpack/index.ejs +15 -0
  119. package/webpack/noop.js +11 -0
  120. package/webpack/webpack.config.js +483 -0
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _elements = require("./elements");
8
+ var defaultFont = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
9
+ var cokoTheme = {
10
+ /* Colors */
11
+ colorBackground: 'white',
12
+ colorBackgroundHue: '#F1F1F1',
13
+ // deprecate
14
+ colorFurniture: '#CCC',
15
+ // deprecate
16
+
17
+ colorPrimary: '#0B65CB',
18
+ colorSecondary: '#E7E7E7',
19
+ colorDisabled: '#595959',
20
+ colorBorder: '#AAA',
21
+ colorSuccess: '#008800',
22
+ colorError: '#FF2D1A',
23
+ colorWarning: '#ffc107',
24
+ colorText: '#111',
25
+ colorTextReverse: '#FFF',
26
+ colorTextPlaceholder: '#595959',
27
+ /* Text variables */
28
+
29
+ // fonts
30
+ fontInterface: defaultFont,
31
+ fontHeading: defaultFont,
32
+ fontReading: defaultFont,
33
+ fontWriting: defaultFont,
34
+ // deprecate
35
+
36
+ // font sizes
37
+ fontSizeBase: '16px',
38
+ fontSizeBaseSmall: '14px',
39
+ // rename to fontSizeSmall
40
+ fontSizeHeading1: '40px',
41
+ fontSizeHeading2: '36px',
42
+ fontSizeHeading3: '28px',
43
+ fontSizeHeading4: '24px',
44
+ fontSizeHeading5: '20px',
45
+ fontSizeHeading6: '16px',
46
+ // line heights
47
+ lineHeightBase: '24px',
48
+ lineHeightBaseSmall: '16px',
49
+ // rename to lineHeightSmall
50
+ lineHeightHeading1: '48px',
51
+ lineHeightHeading2: '40px',
52
+ lineHeightHeading3: '32px',
53
+ lineHeightHeading4: '32px',
54
+ lineHeightHeading5: '24px',
55
+ lineHeightHeading6: '24px',
56
+ /* Spacing */
57
+ gridUnit: '8px',
58
+ /* Border */
59
+ borderRadius: '0',
60
+ borderWidth: '1px',
61
+ // julien: not 0
62
+ borderStyle: 'solid',
63
+ // Does not exist
64
+ // $borderColor: var($colorFurniture);
65
+
66
+ /* Shadow (for tooltip) */
67
+ boxShadow: '0 2px 4px 0 rgba(51, 51, 51, 0.3)',
68
+ /* Transition */
69
+ transitionDuration: 0.2,
70
+ transitionTimingFunction: 'ease',
71
+ transitionDelay: '0',
72
+ /* Breakpoints */
73
+ // breakpoints: [480, 768, 1000, 1272],
74
+
75
+ // TO DO: Revisit the need for any of these
76
+ cssOverrides: {
77
+ Login: {
78
+ Logo: _elements.Logo
79
+ },
80
+ ui: {
81
+ Action: _elements.Action,
82
+ ActionGroup: _elements.ActionGroup,
83
+ AppBar: _elements.AppBar,
84
+ Button: _elements.Button,
85
+ Checkbox: _elements.Checkbox,
86
+ GlobalStyle: _elements.GlobalStyle,
87
+ Radio: _elements.Radio,
88
+ TextField: _elements.TextField,
89
+ Menu: _elements.Menu
90
+ }
91
+ }
92
+ };
93
+ var _default = exports["default"] = cokoTheme;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.lighten = exports.darken = void 0;
7
+ var _lodash = require("lodash");
8
+ var _color = _interopRequireDefault(require("color"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ /*
11
+ Functions to change the shade of a color.
12
+
13
+ Valid input for the Color function is defined at https://github.com/Qix-/color.
14
+
15
+ eg.
16
+ darken('#AAAAAA', 0.3)
17
+ lighten('#AAA', 0.7)
18
+ darken('rgb(255, 255, 255)', 0.2)
19
+
20
+ It will also accept a valid variable defined in your theme instead.
21
+
22
+ eg.
23
+ darken('colorPrimary', 0.3)
24
+ lighten('someProperty.customColor', 0.5)
25
+
26
+ Percent can be either a decimal point or an integer.
27
+
28
+ eg. these two functions will evaluate to the same thing
29
+ darken('colorPrimary', 0.5)
30
+ darken('colorPrimary', 50)
31
+ */
32
+
33
+ var normalizePercent = function normalizePercent(num) {
34
+ return num >= 1 && num <= 100 ? num / 100 : num;
35
+ };
36
+ var darkenLighten = function darkenLighten(original, percent, props, dark) {
37
+ var color = (0, _lodash.get)(props.theme, original) || original;
38
+ var thisMuch = normalizePercent(percent);
39
+ var converted;
40
+ try {
41
+ converted = (0, _color["default"])(color);
42
+ } catch (_) {
43
+ converted = (0, _color["default"])('black');
44
+ }
45
+ if (dark) return converted.darken(thisMuch).string();
46
+ return converted.lighten(thisMuch).string();
47
+ };
48
+ var darken = exports.darken = function darken(original, percent) {
49
+ return function (props) {
50
+ return darkenLighten(original, percent, props, true);
51
+ };
52
+ };
53
+ var lighten = exports.lighten = function lighten(original, percent) {
54
+ return function (props) {
55
+ return darkenLighten(original, percent, props);
56
+ };
57
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ /*
8
+ The scaling function is designed to apply a scale in order to derive the font
9
+ sizes for all headings, given a base font size.
10
+
11
+ eg.
12
+ Given a base font size of 12 and a scale of 1.2, your heading font sizes are
13
+ as follows:
14
+
15
+ heading 1: 29.85984
16
+ heading 2: 24.8832
17
+ heading 3: 20.736
18
+ heading 4: 17.28
19
+ heading 5: 14.399999999999999
20
+ heading 6: 12
21
+
22
+ ** usage **
23
+ scale(12, 1.2, 4) // evaluates to 17.28
24
+ */
25
+
26
+ var headingScale = function headingScale(base, scale, heading) {
27
+ return base * Math.pow(scale, Math.abs(heading - 6));
28
+ };
29
+ var _default = exports["default"] = headingScale;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "darken", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _darkenLighten.darken;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "fadeIn", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _fadeInOut.fadeIn;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "fadeOut", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _fadeInOut.fadeOut;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "grid", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _themeHelper.grid;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "headingScale", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _headingScale["default"];
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "lighten", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _darkenLighten.lighten;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "media", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _media["default"];
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "override", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _override["default"];
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "rotate360", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _rotate["default"];
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "th", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _themeHelper.th;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "validationColor", {
67
+ enumerable: true,
68
+ get: function get() {
69
+ return _themeHelper.validationColor;
70
+ }
71
+ });
72
+ var _darkenLighten = require("./darkenLighten");
73
+ var _fadeInOut = require("./styles/fadeInOut");
74
+ var _headingScale = _interopRequireDefault(require("./headingScale"));
75
+ var _override = _interopRequireDefault(require("./override"));
76
+ var _themeHelper = require("./themeHelper");
77
+ var _rotate = _interopRequireDefault(require("./styles/rotate360"));
78
+ var _media = _interopRequireDefault(require("./media"));
79
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ var _themeHelper = require("./themeHelper");
9
+ var _templateObject;
10
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
+ var sizes = {
12
+ mobileUp: (0, _themeHelper.th)('breakpoints.0'),
13
+ tabletPortraitUp: (0, _themeHelper.th)('breakpoints.1'),
14
+ tabletLandscapeUp: (0, _themeHelper.th)('breakpoints.2'),
15
+ desktopUp: (0, _themeHelper.th)('breakpoints.3')
16
+ };
17
+ var media = Object.keys(sizes).reduce(function (acc, label) {
18
+ acc[label] = function () {
19
+ return (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n @media (min-width: ", "px) {\n ", ";\n }\n "])), sizes[label], _styledComponents.css.apply(void 0, arguments));
20
+ };
21
+ return acc;
22
+ }, {});
23
+ var _default = exports["default"] = (0, _styledComponents.withTheme)(media);
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ var _lodash = require("lodash");
9
+ var _themeHelper = require("./themeHelper");
10
+ var _templateObject, _templateObject2;
11
+ /*
12
+ Helper to write overrides for your styled components.
13
+
14
+ This is here so that you don't have to think about compatibility between this:
15
+
16
+ cssOverrides.ui.Button = css``
17
+
18
+ and this:
19
+
20
+ cssOverrides.ui.Button = {
21
+ Root: css``,
22
+ Input: css``
23
+ }
24
+
25
+ in your theme.
26
+
27
+ -------------------
28
+
29
+ Usage:
30
+
31
+ const Button = styled.div`
32
+ YOUR CSS HERE
33
+
34
+ ${override('ui.Button')};
35
+ `
36
+
37
+ Now both of the above scenarios will work.
38
+ */
39
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
40
+ /*
41
+ Will be using ui.Button as an example component override to explain the code.
42
+ */
43
+ var override = function override(name) {
44
+ var overrideKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'cssOverrides';
45
+ return function (props) {
46
+ // Find (props.theme.cssOverrides.) ui.Button
47
+ var target = (0, _lodash.get)(props.theme[overrideKey], name);
48
+
49
+ // ui.Button is not there.
50
+ if (!target) return null;
51
+
52
+ // css`` functions from styled components come in as arrays
53
+ var isStyledCss = Array.isArray(target);
54
+ var hasRoot = (0, _lodash.has)(target, 'Root');
55
+
56
+ /*
57
+ ui.Button is there, but there is no ui.Button.Root or ui.Button: css``.
58
+ This also covers the case where you only target children of the component,
59
+ eg. if your override looks like ui.Button = { Icon: css`` }.
60
+ In this case, there would be no overrides for ui.Button, but only for
61
+ ui.Button.Icon, which would have its own override.
62
+ */
63
+ if (!isStyledCss && !hasRoot) return null;
64
+
65
+ // ui.Button.Root exists
66
+ if (hasRoot) {
67
+ return (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n "])), (0, _themeHelper.th)("".concat(overrideKey, ".").concat(name, ".Root")));
68
+ }
69
+
70
+ // ui.Button: css`` exists
71
+ return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n "])), (0, _themeHelper.th)("".concat(overrideKey, ".").concat(name)));
72
+ };
73
+ };
74
+ var _default = exports["default"] = override;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fadeOut = exports.fadeIn = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ var _templateObject, _templateObject2;
9
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
+ var fadeIn = exports.fadeIn = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n"])));
11
+ var fadeOut = exports.fadeOut = (0, _styledComponents.keyframes)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n"])));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ var _templateObject;
9
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
+ var rotate360 = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
11
+ var _default = exports["default"] = rotate360;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validationColor = exports.th = exports.grid = void 0;
7
+ var _lodash = require("lodash");
8
+ /**
9
+ * Returns multiples of gridUnit.
10
+ *
11
+ * It lets you replace statements like this:
12
+ * calc(${th('gridUnit')} * 4)
13
+ * to this:
14
+ * ${grid(4)}
15
+ *
16
+ */
17
+ var grid = exports.grid = function grid(value) {
18
+ return function (props) {
19
+ return "calc(".concat(props.theme.gridUnit, " * ").concat(value, ")");
20
+ };
21
+ };
22
+
23
+ /**
24
+ * A bit of syntactic sugar for styled-components. Lets you replace this:
25
+ *
26
+ * ${props => props.theme.colorPrimary}
27
+ *
28
+ * with this:
29
+ *
30
+ * ${th('colorPrimary')}
31
+ *
32
+ * This is called 'th' (theme helper) for historic reasons
33
+ */
34
+ var th = exports.th = function th(name) {
35
+ return function (props) {
36
+ return (0, _lodash.get)(props.theme, name);
37
+ };
38
+ };
39
+
40
+ /**
41
+ * returns color from theme object, based on validation status
42
+ */
43
+ var validationColor = exports.validationColor = function validationColor(_ref) {
44
+ var theme = _ref.theme,
45
+ _ref$validationStatus = _ref.validationStatus,
46
+ validationStatus = _ref$validationStatus === void 0 ? 'default' : _ref$validationStatus;
47
+ return {
48
+ error: theme.colorError,
49
+ success: theme.colorSuccess,
50
+ "default": theme.colorBorder,
51
+ warning: theme.colorWarning
52
+ }[validationStatus];
53
+ };
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.randomPick = exports.randomBool = exports.randomArray = exports.noop = exports.createData = exports.Filler = exports.Background = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ var _faker = require("@faker-js/faker");
10
+ var _lodash = require("lodash");
11
+ var _templateObject, _templateObject2; // eslint-disable-next-line import/no-extraneous-dependencies
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
14
+ /**
15
+ * Wrap components around this to show what they will look like
16
+ * with the grey body background
17
+ */
18
+ var Background = exports.Background = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n padding: 40px;\n"])), function (props) {
19
+ return props.theme.colorBody;
20
+ });
21
+ var StyledFiller = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n align-items: center;\n background: ", ";\n display: flex;\n flex-direction: column;\n height: 200px;\n justify-content: center;\n margin-bottom: 16px;\n padding: 48px;\n text-align: justify;\n\n > div {\n font-weight: bold;\n text-align: center;\n }\n"])), function (props) {
22
+ return props.theme.colorSecondary;
23
+ });
24
+
25
+ /**
26
+ * Just a block with some text in it
27
+ */
28
+ var Filler = exports.Filler = function Filler() {
29
+ return /*#__PURE__*/_react["default"].createElement(StyledFiller, null, /*#__PURE__*/_react["default"].createElement("div", null, "Filler"), /*#__PURE__*/_react["default"].createElement("span", null, _faker.faker.lorem.sentences(10)));
30
+ };
31
+
32
+ /**
33
+ * Picks a random item from any given array
34
+ */
35
+ var randomPick = exports.randomPick = function randomPick(array) {
36
+ return array[Math.floor(Math.random() * array.length)];
37
+ };
38
+
39
+ /**
40
+ * Picks n values randomly from given array
41
+ */
42
+ var randomArray = exports.randomArray = function randomArray(array, n) {
43
+ var res = [];
44
+ while (res.length < n) {
45
+ var v = randomPick(array);
46
+ if (!res.includes(v)) res.push(v);
47
+ }
48
+ return res;
49
+ };
50
+
51
+ /**
52
+ * Randomly picks true or false
53
+ */
54
+ var randomBool = exports.randomBool = function randomBool() {
55
+ return randomPick([true, false]);
56
+ };
57
+
58
+ /**
59
+ * Creates an array of length n of whatever the callback returns
60
+ */
61
+ var createData = exports.createData = function createData(n, callback) {
62
+ return (0, _lodash.range)(n).map(callback);
63
+ };
64
+
65
+ /**
66
+ * Just an empty function to use as a placeholder for required functions
67
+ */
68
+
69
+ var noop = exports.noop = function noop() {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.vertical = void 0;
7
+ var _styledComponents = require("styled-components");
8
+ var _templateObject;
9
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
+ // eslint-disable-next-line import/prefer-default-export
11
+ var vertical = exports.vertical = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ useBreakpoint: true
8
+ };
9
+ Object.defineProperty(exports, "useBreakpoint", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _useBreakpoint["default"];
13
+ }
14
+ });
15
+ var _helpers = require("./_helpers");
16
+ Object.keys(_helpers).forEach(function (key) {
17
+ if (key === "default" || key === "__esModule") return;
18
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
+ if (key in exports && exports[key] === _helpers[key]) return;
20
+ Object.defineProperty(exports, key, {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _helpers[key];
24
+ }
25
+ });
26
+ });
27
+ var _cssSnippets = require("./cssSnippets");
28
+ Object.keys(_cssSnippets).forEach(function (key) {
29
+ if (key === "default" || key === "__esModule") return;
30
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
+ if (key in exports && exports[key] === _cssSnippets[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _cssSnippets[key];
36
+ }
37
+ });
38
+ });
39
+ var _useBreakpoint = _interopRequireDefault(require("./useBreakpoint"));
40
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = require("react");
8
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
+ var useBreakpoint = function useBreakpoint(mediaQuery) {
15
+ var mediaQueryList = window.matchMedia(mediaQuery);
16
+ var _useState = (0, _react.useState)(mediaQueryList.matches),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ isMobile = _useState2[0],
19
+ setIsMobile = _useState2[1];
20
+ var matches = function matches(e) {
21
+ if (e.matches) {
22
+ setIsMobile(true);
23
+ } else {
24
+ setIsMobile(false);
25
+ }
26
+ };
27
+ (0, _react.useEffect)(function () {
28
+ mediaQueryList.addEventListener('change', matches);
29
+ return function () {
30
+ return mediaQueryList.removeEventListener('change', matches);
31
+ };
32
+ }, []);
33
+ return isMobile;
34
+ };
35
+ var _default = exports["default"] = useBreakpoint;