@conveyorhq/arrow-ds 1.24.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/package.json +10 -10
  2. package/public/components/Icon/Icon.d.ts +1 -0
  3. package/public/components/Icon/Icon.js +2 -0
  4. package/public/components/Icon/svg/CommentAltCheck.d.ts +2 -0
  5. package/public/components/Icon/svg/CommentAltCheck.js +13 -0
  6. package/public/components/Icon/svg/index.d.ts +1 -0
  7. package/public/components/Icon/svg/index.js +1 -0
  8. package/public/components/Snackbar/Snackbar.d.ts +14 -22
  9. package/public/components/Snackbar/Snackbar.js +28 -85
  10. package/public/components/Snackbar/SnackbarProvider.d.ts +2 -0
  11. package/public/components/Snackbar/SnackbarProvider.js +21 -0
  12. package/public/components/Snackbar/constants.d.ts +2 -0
  13. package/public/components/Snackbar/constants.js +5 -0
  14. package/public/components/Snackbar/context.d.ts +4 -0
  15. package/public/components/Snackbar/context.js +17 -0
  16. package/public/components/Snackbar/helpers.d.ts +3 -0
  17. package/public/components/Snackbar/helpers.js +31 -0
  18. package/public/components/Snackbar/hooks.d.ts +2 -0
  19. package/public/components/Snackbar/hooks.js +47 -0
  20. package/public/components/Snackbar/index.d.ts +6 -0
  21. package/public/components/Snackbar/index.js +6 -0
  22. package/public/components/Snackbar/types.d.ts +43 -0
  23. package/public/components/Snackbar/types.js +2 -0
  24. package/public/css/styles.css +28 -13
  25. package/public/css/styles.min.css +1 -1
  26. package/public/css/styles.min.css.map +1 -1
  27. package/public/tokens/font-family.js +1 -1
  28. package/public/types/index.d.ts +5 -0
  29. package/src/components/Icon/Icon.tsx +3 -0
  30. package/src/components/Icon/svg/CommentAltCheck.tsx +13 -0
  31. package/src/components/Icon/svg/index.ts +1 -0
  32. package/src/components/Snackbar/Snackbar.story.mdx +96 -9
  33. package/src/components/Snackbar/Snackbar.tsx +56 -148
  34. package/src/components/Snackbar/SnackbarProvider.tsx +31 -0
  35. package/src/components/Snackbar/constants.ts +2 -0
  36. package/src/components/Snackbar/context.ts +20 -0
  37. package/src/components/Snackbar/helpers.tsx +52 -0
  38. package/src/components/Snackbar/hooks.ts +57 -0
  39. package/src/components/Snackbar/index.ts +6 -0
  40. package/src/components/Snackbar/types.ts +180 -0
  41. package/src/components/StatusLabel/index.css +4 -1
  42. package/src/css/fonts.css +13 -10
  43. package/src/docs/Typography.story.mdx +11 -8
  44. package/src/tokens/font-family.ts +1 -1
  45. package/src/types/index.ts +19 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@conveyorhq/arrow-ds",
3
3
  "author": "Conveyor",
4
4
  "license": "MIT",
5
- "version": "1.24.0",
5
+ "version": "1.27.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -99,11 +99,11 @@
99
99
  "@babel/preset-typescript": "^7.7.2",
100
100
  "@commitlint/cli": "^13.0.0",
101
101
  "@commitlint/config-conventional": "^13.0.0",
102
- "@storybook/addon-actions": "^6.3.0",
103
- "@storybook/addon-docs": "^6.3.0",
102
+ "@storybook/addon-actions": "^6.4.8",
103
+ "@storybook/addon-docs": "^6.4.8",
104
104
  "@storybook/addon-postcss": "^2.0.0",
105
- "@storybook/react": "^6.3.0",
106
- "@storybook/theming": "^6.3.0",
105
+ "@storybook/react": "^6.4.8",
106
+ "@storybook/theming": "^6.4.8",
107
107
  "@types/classnames": "^2.2.9",
108
108
  "@types/codemirror": "^0.0.91",
109
109
  "@types/d3-ease": "^1.0.9",
@@ -120,7 +120,7 @@
120
120
  "@types/webpack": "^5.0.0",
121
121
  "@typescript-eslint/eslint-plugin": "^4.18.0",
122
122
  "@typescript-eslint/parser": "^4.18.0",
123
- "autoprefixer": "^10.2.5",
123
+ "autoprefixer": "^10.4.0",
124
124
  "babel-loader": "^8.0.6",
125
125
  "babel-plugin-inline-react-svg": "^2.0.0",
126
126
  "copyfiles": "^2.4.1",
@@ -139,16 +139,16 @@
139
139
  "fs-extra": "^8.1.0",
140
140
  "husky": "^3.1.0",
141
141
  "plop": "^2.5.3",
142
- "postcss": "^8.2.8",
143
- "postcss-cli": "^8.3.1",
144
- "postcss-import": "^12.0.1",
142
+ "postcss": "^8.4.4",
143
+ "postcss-cli": "^9.0.2",
144
+ "postcss-import": "^14.0.2",
145
145
  "prettier": "^2.2.1",
146
146
  "react": "^16.11.0",
147
147
  "react-docgen-typescript-loader": "^3.6.0",
148
148
  "react-dom": "^16.11.0",
149
149
  "react-is": "^16.12.0",
150
150
  "regenerator-runtime": "^0.13.3",
151
- "semantic-release": "^17.0.8",
151
+ "semantic-release": "^18.0.1",
152
152
  "tailwindcss": "^2.0.3",
153
153
  "ts-loader": "^6.2.1",
154
154
  "typescript": "^4.2.3",
@@ -3,6 +3,7 @@ import { FlipProp } from "@fortawesome/fontawesome-svg-core";
3
3
  import { STATUS_VARIANT } from "../../types";
4
4
  export declare enum CUSTOM_ICON_TYPE {
5
5
  ARROW_TO_BOTTOM = "arrow-to-bottom",
6
+ COMMENT_ALT_CHECK = "comment-alt-check",
6
7
  DIALOG_CHECK = "dialog-check",
7
8
  SCROLL = "scroll",
8
9
  SPARKLE = "sparkle",
@@ -146,6 +146,7 @@ fontawesome_svg_core_1.library.add(faArchive_1.faArchive, faArrowDown_1.faArrowD
146
146
  var CUSTOM_ICON_TYPE;
147
147
  (function (CUSTOM_ICON_TYPE) {
148
148
  CUSTOM_ICON_TYPE["ARROW_TO_BOTTOM"] = "arrow-to-bottom";
149
+ CUSTOM_ICON_TYPE["COMMENT_ALT_CHECK"] = "comment-alt-check";
149
150
  CUSTOM_ICON_TYPE["DIALOG_CHECK"] = "dialog-check";
150
151
  CUSTOM_ICON_TYPE["SCROLL"] = "scroll";
151
152
  CUSTOM_ICON_TYPE["SPARKLE"] = "sparkle";
@@ -154,6 +155,7 @@ var CUSTOM_ICON_TYPE;
154
155
  })(CUSTOM_ICON_TYPE = exports.CUSTOM_ICON_TYPE || (exports.CUSTOM_ICON_TYPE = {}));
155
156
  const CustomIcons = {
156
157
  [CUSTOM_ICON_TYPE.ARROW_TO_BOTTOM]: svg_1.ArrowToBottom,
158
+ [CUSTOM_ICON_TYPE.COMMENT_ALT_CHECK]: svg_1.CommentAltCheck,
157
159
  [CUSTOM_ICON_TYPE.DIALOG_CHECK]: svg_1.DialogCheck,
158
160
  [CUSTOM_ICON_TYPE.SCROLL]: svg_1.Scroll,
159
161
  [CUSTOM_ICON_TYPE.SPARKLE]: svg_1.Sparkle,
@@ -0,0 +1,2 @@
1
+ import { SvgProps } from "../../Svg";
2
+ export declare const CommentAltCheck: (props: SvgProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CommentAltCheck = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Svg_1 = require("../../Svg");
9
+ const CommentAltCheck = (props) => {
10
+ return (react_1.default.createElement(Svg_1.Svg, Object.assign({ width: "30", height: "32", viewBox: "0 0 30 32", fill: "none" }, props),
11
+ react_1.default.createElement("path", { d: "M26.133 1.067h-22.4c-2.1 0-3.733 1.692-3.733 3.733v16.8c0 2.1 1.633 3.733 3.733 3.733h5.6v4.9c0 0.583 0.642 0.933 1.108 0.583l7.292-5.483h8.4c2.042 0 3.733-1.633 3.733-3.733v-16.8c0-2.042-1.692-3.733-3.733-3.733zM21.583 10.633l-7.642 7.583c-0.292 0.292-0.7 0.292-0.933 0l-4.433-4.433c-0.233-0.233-0.233-0.642 0-0.933l1.517-1.517c0.292-0.233 0.7-0.233 0.933 0.058l2.45 2.45 5.658-5.6c0.292-0.292 0.7-0.292 0.933 0l1.517 1.517c0.233 0.233 0.233 0.642 0 0.875z", fill: "currentColor" })));
12
+ };
13
+ exports.CommentAltCheck = CommentAltCheck;
@@ -1,4 +1,5 @@
1
1
  export * from "./ArrowToBottom";
2
+ export * from "./CommentAltCheck";
2
3
  export * from "./DialogCheck";
3
4
  export * from "./Scroll";
4
5
  export * from "./Sparkle";
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./ArrowToBottom"), exports);
14
+ __exportStar(require("./CommentAltCheck"), exports);
14
15
  __exportStar(require("./DialogCheck"), exports);
15
16
  __exportStar(require("./Scroll"), exports);
16
17
  __exportStar(require("./Sparkle"), exports);
@@ -1,23 +1,15 @@
1
1
  import { Action } from "../../types";
2
- import { IconType } from "../Icon";
3
- interface SharedProps {
4
- message: string;
5
- action?: Action;
6
- icon?: IconType;
7
- duration?: number | null;
8
- disableClose?: boolean;
9
- }
10
- interface ShowSnackbarProps extends SharedProps {
11
- className?: string;
12
- }
13
- interface SnackbarProps extends ShowSnackbarProps {
14
- onClose: () => void;
15
- id?: string;
16
- }
17
- interface SnackbarHookProps extends SharedProps {
18
- isVisible: boolean;
19
- }
20
- export declare const Snackbar: ({ message, action, icon, id, className, onClose, disableClose, }: SnackbarProps) => JSX.Element;
21
- export declare const showSnackbar: ({ message, action, icon, duration, className, disableClose, }: ShowSnackbarProps) => any;
22
- export declare const useSnackbar: ({ message, action, isVisible, icon, duration, disableClose, }: SnackbarHookProps) => void;
23
- export {};
2
+ import { SnackbarProps, SnackbarRootProps, SnackbarIconProps, SnackbarTextProps } from "./types";
3
+ export declare const SnackbarRoot: ({ children, className, ...rest }: SnackbarRootProps) => JSX.Element;
4
+ export declare const SnackbarIcon: ({ icon }: SnackbarIconProps) => JSX.Element;
5
+ export declare const SnackbarText: ({ children }: SnackbarTextProps) => JSX.Element;
6
+ export declare const SnackbarAction: ({ label, onClick, href, external }: Action) => JSX.Element;
7
+ export declare const SnackbarCloseButton: () => JSX.Element;
8
+ export declare const Snackbar: {
9
+ ({ message, action, icon, className, disableClose, ...rest }: SnackbarProps): JSX.Element;
10
+ Provider: ({ component, id, onClose, duration, position, ...rest }: import("./types").SnackbarProviderProps) => JSX.Element;
11
+ Root: ({ children, className, ...rest }: SnackbarRootProps) => JSX.Element;
12
+ Text: ({ children }: SnackbarTextProps) => JSX.Element;
13
+ Action: ({ label, onClick, href, external }: Action) => JSX.Element;
14
+ CloseButton: () => JSX.Element;
15
+ };
@@ -1,30 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
22
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
4
  };
24
5
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.useSnackbar = exports.showSnackbar = exports.Snackbar = void 0;
26
- const react_1 = __importStar(require("react"));
27
- const toasted_notes_1 = __importDefault(require("toasted-notes"));
6
+ exports.Snackbar = exports.SnackbarCloseButton = exports.SnackbarAction = exports.SnackbarText = exports.SnackbarIcon = exports.SnackbarRoot = void 0;
7
+ const react_1 = __importDefault(require("react"));
28
8
  const classnames_1 = __importDefault(require("classnames"));
29
9
  const bem_1 = require("../../utilities/bem");
30
10
  const Box_1 = require("../Box");
@@ -32,79 +12,42 @@ const CloseButton_1 = require("../CloseButton");
32
12
  const Icon_1 = require("../Icon");
33
13
  const Link_1 = require("../Link");
34
14
  const Text_1 = require("../Text");
15
+ const context_1 = require("./context");
16
+ const SnackbarProvider_1 = require("./SnackbarProvider");
35
17
  const cn = bem_1.bemHOF("Snackbar");
36
- const POSITION = "bottom-left";
37
- const hideSnackbar = (id) => toasted_notes_1.default.close(id, POSITION);
18
+ const SnackbarRoot = ({ children, className, ...rest }) => (react_1.default.createElement(Box_1.Box, Object.assign({ className: classnames_1.default(cn(), className) }, rest), children));
19
+ exports.SnackbarRoot = SnackbarRoot;
20
+ const SnackbarIcon = ({ icon }) => (react_1.default.createElement(Icon_1.Icon, { icon: icon, spin: icon === Icon_1.ICON_TYPE.SPINNER || icon === Icon_1.ICON_TYPE.CIRCLE_NOTCH, className: cn({ e: "icon" }) }));
21
+ exports.SnackbarIcon = SnackbarIcon;
22
+ const SnackbarText = ({ children }) => (react_1.default.createElement(Text_1.Text, null, children));
23
+ exports.SnackbarText = SnackbarText;
38
24
  const SnackbarAction = ({ label, onClick, href, external }) => {
39
25
  const Component = typeof onClick === "function" ? "button" : "a";
40
26
  const type = Component === "button" ? "button" : undefined;
41
27
  return (react_1.default.createElement(Link_1.Link, { as: Component, type: type, className: cn({ e: "action" }), onClick: onClick, href: href, target: external ? "_blank" : undefined }, label));
42
28
  };
43
- const Snackbar = ({ message, action, icon, id, className, onClose, disableClose, }) => {
44
- const spin = icon === Icon_1.ICON_TYPE.SPINNER || icon === Icon_1.ICON_TYPE.CIRCLE_NOTCH;
45
- const iconProps = icon
46
- ? {
47
- icon,
48
- spin,
49
- }
50
- : undefined;
51
- return (react_1.default.createElement(Box_1.Box, { className: classnames_1.default(cn(), className), id: id },
52
- iconProps && react_1.default.createElement(Icon_1.Icon, Object.assign({}, iconProps, { className: cn({ e: "icon" }) })),
53
- react_1.default.createElement(Text_1.Text, null, message),
54
- action && action.label && (react_1.default.createElement(SnackbarAction, Object.assign({}, action, { onClick: () => {
29
+ exports.SnackbarAction = SnackbarAction;
30
+ const SnackbarCloseButton = () => {
31
+ const { onClose } = context_1.useSnackbarContext();
32
+ return (react_1.default.createElement(CloseButton_1.CloseButton, { className: classnames_1.default(cn({ e: "dismiss" })), onClick: onClose }));
33
+ };
34
+ exports.SnackbarCloseButton = SnackbarCloseButton;
35
+ const Snackbar = ({ message, action, icon, className, disableClose, ...rest }) => {
36
+ const { onClose } = context_1.useSnackbarContext();
37
+ return (react_1.default.createElement(exports.SnackbarRoot, Object.assign({ className: className }, rest),
38
+ icon && react_1.default.createElement(exports.SnackbarIcon, { icon: icon }),
39
+ message && react_1.default.createElement(exports.SnackbarText, null, message),
40
+ action && action.label && (react_1.default.createElement(exports.SnackbarAction, Object.assign({}, action, { onClick: () => {
55
41
  if (action.onClick) {
56
42
  action.onClick();
57
43
  }
58
44
  onClose();
59
45
  } }))),
60
- !disableClose && (react_1.default.createElement(CloseButton_1.CloseButton, { className: classnames_1.default(cn({ e: "dismiss" })), onClick: onClose }))));
46
+ !disableClose && react_1.default.createElement(exports.SnackbarCloseButton, null)));
61
47
  };
62
48
  exports.Snackbar = Snackbar;
63
- const showSnackbar = ({ message, action, icon, duration = null, className, disableClose, }) => toasted_notes_1.default.notify(({ onClose, id }) => {
64
- return (react_1.default.createElement(exports.Snackbar, Object.assign({}, {
65
- message,
66
- onClose,
67
- action,
68
- icon,
69
- className,
70
- disableClose,
71
- id: `snackbar-component-${id}`,
72
- })));
73
- }, {
74
- position: POSITION,
75
- duration,
76
- });
77
- exports.showSnackbar = showSnackbar;
78
- const useSnackbar = ({ message, action, isVisible, icon, duration, disableClose, }) => {
79
- const [snackbar, setSnackbar] = react_1.useState({
80
- id: 0,
81
- position: POSITION,
82
- });
83
- const [wasViewed, setWasViewed] = react_1.useState(false);
84
- react_1.useEffect(() => {
85
- if (isVisible && !wasViewed) {
86
- setSnackbar(exports.showSnackbar({
87
- message,
88
- action,
89
- icon,
90
- duration,
91
- disableClose,
92
- }));
93
- setWasViewed(true);
94
- }
95
- if (!isVisible && wasViewed) {
96
- hideSnackbar(snackbar.id);
97
- setWasViewed(false);
98
- }
99
- }, [
100
- message,
101
- action,
102
- isVisible,
103
- icon,
104
- duration,
105
- disableClose,
106
- snackbar,
107
- wasViewed,
108
- ]);
109
- };
110
- exports.useSnackbar = useSnackbar;
49
+ exports.Snackbar.Provider = SnackbarProvider_1.SnackbarProvider;
50
+ exports.Snackbar.Root = exports.SnackbarRoot;
51
+ exports.Snackbar.Text = exports.SnackbarText;
52
+ exports.Snackbar.Action = exports.SnackbarAction;
53
+ exports.Snackbar.CloseButton = exports.SnackbarCloseButton;
@@ -0,0 +1,2 @@
1
+ import { SnackbarProviderProps } from "./types";
2
+ export declare const SnackbarProvider: ({ component, id, onClose, duration, position, ...rest }: SnackbarProviderProps) => JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SnackbarProvider = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Box_1 = require("../Box");
9
+ const constants_1 = require("./constants");
10
+ const context_1 = require("./context");
11
+ const SnackbarProvider = ({ component, id = constants_1.DEFAULT_SNACKBAR_ID, onClose, duration, position, ...rest }) => {
12
+ const componentId = "snackbar-provider";
13
+ return (react_1.default.createElement(context_1.SnackbarContext.Provider, { value: {
14
+ id,
15
+ onClose,
16
+ duration,
17
+ position,
18
+ } },
19
+ react_1.default.createElement(Box_1.Box, Object.assign({ id: `${componentId}-${id}`, "data-component": componentId }, rest), component)));
20
+ };
21
+ exports.SnackbarProvider = SnackbarProvider;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_SNACKBAR_ID = 0;
2
+ export declare const DEFAULT_SNACKBAR_POSITION = "bottom-left";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_SNACKBAR_POSITION = exports.DEFAULT_SNACKBAR_ID = void 0;
4
+ exports.DEFAULT_SNACKBAR_ID = 0;
5
+ exports.DEFAULT_SNACKBAR_POSITION = "bottom-left";
@@ -0,0 +1,4 @@
1
+ import { Context } from "react";
2
+ import { SnackbarContextProps } from "./types";
3
+ export declare const SnackbarContext: Context<SnackbarContextProps>;
4
+ export declare function useSnackbarContext(): SnackbarContextProps;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSnackbarContext = exports.SnackbarContext = void 0;
4
+ const react_1 = require("react");
5
+ const constants_1 = require("./constants");
6
+ const defaultContext = {
7
+ id: constants_1.DEFAULT_SNACKBAR_ID,
8
+ onClose: () => { },
9
+ };
10
+ exports.SnackbarContext = react_1.createContext(defaultContext);
11
+ function useSnackbarContext() {
12
+ const context = react_1.useContext(exports.SnackbarContext) || {
13
+ ...defaultContext,
14
+ };
15
+ return context;
16
+ }
17
+ exports.useSnackbarContext = useSnackbarContext;
@@ -0,0 +1,3 @@
1
+ import { HideSnackbarProps, ShowSnackbarProps } from "./types";
2
+ export declare const hideSnackbar: ({ id, position, }: HideSnackbarProps) => void;
3
+ export declare const showSnackbar: ({ component, message, duration, position, ...rest }: ShowSnackbarProps) => any;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.showSnackbar = exports.hideSnackbar = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const toasted_notes_1 = __importDefault(require("toasted-notes"));
9
+ const constants_1 = require("./constants");
10
+ const Snackbar_1 = require("./Snackbar");
11
+ const SnackbarProvider_1 = require("./SnackbarProvider");
12
+ const hideSnackbar = ({ id, position = constants_1.DEFAULT_SNACKBAR_POSITION, }) => toasted_notes_1.default.close(id, position);
13
+ exports.hideSnackbar = hideSnackbar;
14
+ const showSnackbar = ({ component, message, duration = null, position = constants_1.DEFAULT_SNACKBAR_POSITION, ...rest }) => {
15
+ return toasted_notes_1.default.notify(({ onClose, id }) => {
16
+ return (react_1.default.createElement(SnackbarProvider_1.SnackbarProvider, Object.assign({}, {
17
+ id,
18
+ onClose,
19
+ duration,
20
+ position,
21
+ component: message ? (react_1.default.createElement(Snackbar_1.Snackbar, Object.assign({}, {
22
+ message,
23
+ ...rest,
24
+ }))) : (component),
25
+ })));
26
+ }, {
27
+ position,
28
+ duration,
29
+ });
30
+ };
31
+ exports.showSnackbar = showSnackbar;
@@ -0,0 +1,2 @@
1
+ import { SnackbarHookProps } from "./types";
2
+ export declare const useSnackbar: ({ component, message, position, duration, isVisible, ...rest }: SnackbarHookProps) => void;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSnackbar = void 0;
4
+ const react_1 = require("react");
5
+ const constants_1 = require("./constants");
6
+ const helpers_1 = require("./helpers");
7
+ const useSnackbar = ({ component, message, position, duration, isVisible, ...rest }) => {
8
+ const [snackbar, setSnackbar] = react_1.useState({
9
+ id: constants_1.DEFAULT_SNACKBAR_ID,
10
+ position: constants_1.DEFAULT_SNACKBAR_POSITION,
11
+ });
12
+ const [wasViewed, setWasViewed] = react_1.useState(false);
13
+ react_1.useEffect(() => {
14
+ if (isVisible && !wasViewed) {
15
+ if (message) {
16
+ setSnackbar(helpers_1.showSnackbar({
17
+ message,
18
+ position,
19
+ duration,
20
+ ...rest,
21
+ }));
22
+ }
23
+ else {
24
+ setSnackbar(helpers_1.showSnackbar({
25
+ component,
26
+ position,
27
+ duration,
28
+ }));
29
+ }
30
+ setWasViewed(true);
31
+ }
32
+ if (!isVisible && wasViewed) {
33
+ helpers_1.hideSnackbar({ id: snackbar.id, position });
34
+ setWasViewed(false);
35
+ }
36
+ }, [
37
+ component,
38
+ message,
39
+ position,
40
+ duration,
41
+ isVisible,
42
+ snackbar.id,
43
+ wasViewed,
44
+ rest,
45
+ ]);
46
+ };
47
+ exports.useSnackbar = useSnackbar;
@@ -1 +1,7 @@
1
+ export * from "./constants";
2
+ export * from "./context";
3
+ export * from "./helpers";
4
+ export * from "./hooks";
1
5
  export * from "./Snackbar";
6
+ export * from "./SnackbarProvider";
7
+ export * from "./types";
@@ -10,4 +10,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./constants"), exports);
14
+ __exportStar(require("./context"), exports);
15
+ __exportStar(require("./helpers"), exports);
16
+ __exportStar(require("./hooks"), exports);
13
17
  __exportStar(require("./Snackbar"), exports);
18
+ __exportStar(require("./SnackbarProvider"), exports);
19
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { Action, RequiredToasterProps, ToasterPositionOptions } from "../../types";
3
+ import { BoxProps } from "../Box";
4
+ import { IconType } from "../Icon";
5
+ export declare type SnackbarToasterProps = RequiredToasterProps;
6
+ declare type SnackbarPosition = Extract<ToasterPositionOptions, "bottom-left" | "bottom-right">;
7
+ declare type SnackbarSharedProps = {
8
+ position?: SnackbarPosition;
9
+ duration?: number | null;
10
+ };
11
+ declare type SnackbarWithComponentProps = {
12
+ component: React.ReactNode;
13
+ message?: never;
14
+ };
15
+ declare type SnackbarWithMessageProps = {
16
+ message: React.ReactNode;
17
+ component?: never;
18
+ };
19
+ declare type SnackbarIsVisibleProp = {
20
+ isVisible: boolean;
21
+ };
22
+ declare type SnackbarOtherProps = {
23
+ action?: Action;
24
+ icon?: IconType;
25
+ disableClose?: boolean;
26
+ };
27
+ export declare type SnackbarProps = Omit<SnackbarWithMessageProps, "component"> & SnackbarOtherProps & SnackbarSharedProps & BoxProps;
28
+ export declare type SnackbarRootProps = BoxProps;
29
+ export declare type SnackbarIconProps = Pick<SnackbarOtherProps, "icon">;
30
+ export declare type SnackbarTextProps = {
31
+ children: React.ReactNode;
32
+ };
33
+ export declare type SnackbarStateProps = Pick<SnackbarToasterProps, "id"> & Pick<SnackbarSharedProps, "position">;
34
+ export declare type SnackbarContextProps = SnackbarToasterProps & SnackbarSharedProps;
35
+ export declare type SnackbarProviderProps = SnackbarToasterProps & SnackbarSharedProps & Omit<SnackbarWithComponentProps, "message">;
36
+ declare type ShowSnackbarWithMessageProps = SnackbarWithMessageProps & SnackbarOtherProps & SnackbarSharedProps & BoxProps;
37
+ declare type ShowSnackbarWithComponentProps = SnackbarWithComponentProps & SnackbarSharedProps;
38
+ export declare type ShowSnackbarProps = ShowSnackbarWithMessageProps | ShowSnackbarWithComponentProps;
39
+ export declare type HideSnackbarProps = SnackbarStateProps;
40
+ declare type SnackbarWithMessageHookProps = SnackbarWithMessageProps & SnackbarOtherProps & SnackbarSharedProps & SnackbarIsVisibleProp & BoxProps;
41
+ declare type SnackbarWithComponentHookProps = SnackbarWithComponentProps & SnackbarSharedProps & SnackbarIsVisibleProp;
42
+ export declare type SnackbarHookProps = SnackbarWithMessageHookProps | SnackbarWithComponentHookProps;
43
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,8 +7,9 @@
7
7
 
8
8
  font-display: swap;
9
9
 
10
- src: url("https://d365biun6qawhk.cloudfront.net/fonts/neue-montreal/400-NeueMontreal-Regular.otf")
11
- format("opentype");
10
+ src: local("NeueMontreal-Regular"),
11
+ url("https://static.conveyor.com/fonts/neue-montreal/400-NeueMontreal-Regular.otf")
12
+ format("opentype");
12
13
  }
13
14
 
14
15
  @font-face {
@@ -20,8 +21,9 @@
20
21
 
21
22
  font-display: swap;
22
23
 
23
- src: url("https://d365biun6qawhk.cloudfront.net/fonts/neue-montreal/500-NeueMontreal-Medium.otf")
24
- format("opentype");
24
+ src: local("NeueMontreal-Medium"),
25
+ url("https://static.conveyor.com/fonts/neue-montreal/500-NeueMontreal-Medium.otf")
26
+ format("opentype");
25
27
  }
26
28
 
27
29
  @font-face {
@@ -33,21 +35,21 @@
33
35
 
34
36
  font-display: swap;
35
37
 
36
- src: url("https://d365biun6qawhk.cloudfront.net/fonts/neue-montreal/600-NeueMontreal-Bold.otf")
37
- format("opentype");
38
+ src: local("NeueMontreal-Bold"),
39
+ url("https://static.conveyor.com/fonts/neue-montreal/600-NeueMontreal-Bold.otf")
40
+ format("opentype");
38
41
  }
39
42
 
40
43
  @font-face {
41
- font-family: "IBM Plex Serif";
44
+ font-family: "Copernicus";
42
45
 
43
46
  font-style: normal;
44
47
 
45
- font-weight: 600;
46
-
47
48
  font-display: swap;
48
49
 
49
- src: url("https://d365biun6qawhk.cloudfront.net/fonts/ibm-plex-serif/600-IBMPlexSerif-SemiBold.woff2")
50
- format("woff2");
50
+ src: local("Copernicus-Bold"),
51
+ url("https://static.conveyor.com/fonts/galaxie-copernicus/GalaxieCopernicus-Bold.otf")
52
+ format("opentype");
51
53
  }
52
54
 
53
55
  /*! tailwindcss v2.0.3 | MIT License | https://tailwindcss.com */
@@ -74,6 +76,7 @@ Use a more readable tab size (opinionated).
74
76
  */
75
77
 
76
78
  :root {
79
+ -moz-tab-size: 4;
77
80
  tab-size: 4;
78
81
  }
79
82
 
@@ -3807,6 +3810,7 @@ override built-in Image component classes */
3807
3810
  position: relative;
3808
3811
  z-index: 10;
3809
3812
  width: -webkit-fit-content;
3813
+ width: -moz-fit-content;
3810
3814
  width: fit-content;
3811
3815
  }
3812
3816
 
@@ -5312,6 +5316,7 @@ override built-in Image component classes */
5312
5316
  transition-duration: 200ms;
5313
5317
  height: 22px;
5314
5318
  width: -webkit-fit-content;
5319
+ width: -moz-fit-content;
5315
5320
  width: fit-content;
5316
5321
  }
5317
5322
 
@@ -6494,7 +6499,12 @@ override built-in Image component classes */
6494
6499
  align-items: center;
6495
6500
  }
6496
6501
 
6497
- .ads-StatusLabel-icon--default, .ads-StatusLabel-label--default {
6502
+ .ads-StatusLabel-icon--default {
6503
+ --tw-text-opacity: 1;
6504
+ color: rgba(222, 231, 238, var(--tw-text-opacity));
6505
+ }
6506
+
6507
+ .ads-StatusLabel-label--default {
6498
6508
  --tw-text-opacity: 1;
6499
6509
  color: rgba(71, 104, 125, var(--tw-text-opacity));
6500
6510
  }
@@ -6671,6 +6681,7 @@ override built-in Image component classes */
6671
6681
  --tw-border-opacity: 1;
6672
6682
  border-color: rgba(222, 231, 238, var(--tw-border-opacity));
6673
6683
  border-style: solid;
6684
+ position: -webkit-sticky;
6674
6685
  position: sticky;
6675
6686
  top: 0px;
6676
6687
  z-index: 19;
@@ -6921,6 +6932,7 @@ override built-in Image component classes */
6921
6932
  }
6922
6933
 
6923
6934
  .ads-Table.ads-Table--sticky-column .ads-TableCell:first-of-type, .ads-Table.ads-Table--sticky-column .ads-TableHeaderCell:first-of-type {
6935
+ position: -webkit-sticky;
6924
6936
  position: sticky;
6925
6937
  left: 0px;
6926
6938
  z-index: 10;
@@ -6929,6 +6941,7 @@ override built-in Image component classes */
6929
6941
  .ads-Table.ads-Table--sticky-column.ads-Table--batch-actions
6930
6942
  .ads-TableCell:nth-of-type(2), .ads-Table.ads-Table--sticky-column.ads-Table--batch-actions
6931
6943
  .ads-TableHeaderCell:nth-of-type(2) {
6944
+ position: -webkit-sticky;
6932
6945
  position: sticky;
6933
6946
  z-index: 10;
6934
6947
  }
@@ -7095,6 +7108,7 @@ override built-in Image component classes */
7095
7108
  padding-left: 6px;
7096
7109
  padding-right: 6px;
7097
7110
  width: -webkit-fit-content;
7111
+ width: -moz-fit-content;
7098
7112
  width: fit-content;
7099
7113
  }
7100
7114
 
@@ -17778,7 +17792,7 @@ override built-in Image component classes */
17778
17792
  }
17779
17793
 
17780
17794
  .font-serif {
17781
- font-family: IBM Plex Serif, serif;
17795
+ font-family: Copernicus, serif;
17782
17796
  }
17783
17797
 
17784
17798
  .font-mono {
@@ -28207,6 +28221,7 @@ override built-in Image component classes */
28207
28221
  }
28208
28222
 
28209
28223
  .sticky {
28224
+ position: -webkit-sticky;
28210
28225
  position: sticky;
28211
28226
  }
28212
28227