@conveyorhq/arrow-ds 1.23.1 → 1.25.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 (42) hide show
  1. package/package.json +11 -11
  2. package/public/components/Icon/Icon.d.ts +1 -0
  3. package/public/components/Icon/Icon.js +3 -1
  4. package/public/components/Snackbar/Snackbar.d.ts +14 -22
  5. package/public/components/Snackbar/Snackbar.js +28 -85
  6. package/public/components/Snackbar/SnackbarProvider.d.ts +2 -0
  7. package/public/components/Snackbar/SnackbarProvider.js +21 -0
  8. package/public/components/Snackbar/constants.d.ts +2 -0
  9. package/public/components/Snackbar/constants.js +5 -0
  10. package/public/components/Snackbar/context.d.ts +4 -0
  11. package/public/components/Snackbar/context.js +17 -0
  12. package/public/components/Snackbar/helpers.d.ts +3 -0
  13. package/public/components/Snackbar/helpers.js +31 -0
  14. package/public/components/Snackbar/hooks.d.ts +2 -0
  15. package/public/components/Snackbar/hooks.js +47 -0
  16. package/public/components/Snackbar/index.d.ts +6 -0
  17. package/public/components/Snackbar/index.js +6 -0
  18. package/public/components/Snackbar/types.d.ts +43 -0
  19. package/public/components/Snackbar/types.js +2 -0
  20. package/public/components/Table/TableCell.js +1 -1
  21. package/public/css/styles.css +22 -12
  22. package/public/css/styles.min.css +1 -1
  23. package/public/css/styles.min.css.map +1 -1
  24. package/public/storybook-components/ComponentHeading.js +1 -1
  25. package/public/tokens/font-family.js +1 -1
  26. package/public/types/index.d.ts +5 -0
  27. package/src/components/Icon/Icon.tsx +3 -0
  28. package/src/components/Snackbar/Snackbar.story.mdx +96 -9
  29. package/src/components/Snackbar/Snackbar.tsx +56 -148
  30. package/src/components/Snackbar/SnackbarProvider.tsx +31 -0
  31. package/src/components/Snackbar/constants.ts +2 -0
  32. package/src/components/Snackbar/context.ts +20 -0
  33. package/src/components/Snackbar/helpers.tsx +52 -0
  34. package/src/components/Snackbar/hooks.ts +57 -0
  35. package/src/components/Snackbar/index.ts +6 -0
  36. package/src/components/Snackbar/types.ts +180 -0
  37. package/src/components/Table/TableCell.tsx +4 -1
  38. package/src/css/fonts.css +13 -10
  39. package/src/docs/Typography.story.mdx +11 -8
  40. package/src/storybook-components/ComponentHeading.tsx +2 -2
  41. package/src/tokens/font-family.ts +1 -1
  42. 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.23.1",
5
+ "version": "1.25.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "release": {
74
74
  "branches": [
75
- "master",
75
+ "main",
76
76
  {
77
77
  "name": "alpha",
78
78
  "prerelease": true
@@ -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",
@@ -25,6 +25,7 @@ export declare enum ICON_TYPE {
25
25
  CALCULATOR = "calculator",
26
26
  CARET_DOWN = "caret-down",
27
27
  CARET_UP = "caret-up",
28
+ CHART_LINE = "chart-line",
28
29
  CHECK = "check",
29
30
  CHECK_CIRCLE = "check-circle",
30
31
  CHEVRON_DOWN = "chevron-down",
@@ -53,6 +53,7 @@ const faCalculator_1 = require("@fortawesome/free-solid-svg-icons/faCalculator")
53
53
  const faCalendar_1 = require("@fortawesome/free-solid-svg-icons/faCalendar");
54
54
  const faCaretDown_1 = require("@fortawesome/free-solid-svg-icons/faCaretDown");
55
55
  const faCaretUp_1 = require("@fortawesome/free-solid-svg-icons/faCaretUp");
56
+ const faChartLine_1 = require("@fortawesome/free-solid-svg-icons/faChartLine");
56
57
  const faCheck_1 = require("@fortawesome/free-solid-svg-icons/faCheck");
57
58
  const faCheckCircle_2 = require("@fortawesome/free-solid-svg-icons/faCheckCircle");
58
59
  const faChevronDown_1 = require("@fortawesome/free-solid-svg-icons/faChevronDown");
@@ -141,7 +142,7 @@ const status_1 = require("../../contexts/status");
141
142
  const types_1 = require("../../types");
142
143
  const utilities_1 = require("../../utilities");
143
144
  const cn = utilities_1.bemHOF("Icon");
144
- fontawesome_svg_core_1.library.add(faArchive_1.faArchive, faArrowDown_1.faArrowDown, faArrowLeft_1.faArrowLeft, faArrowRight_1.faArrowRight, faArrowUp_1.faArrowUp, faBackward_1.faBackward, faBan_1.faBan, faBatteryHalf_1.faBatteryHalf, faBed_1.faBed, faBell_1.faBell, faBolt_1.faBolt, faCalculator_1.faCalculator, faCalendar_1.faCalendar, faCaretDown_1.faCaretDown, faCaretUp_1.faCaretUp, faCheck_1.faCheck, faCheckCircle_2.faCheckCircle, faCheckCircle_1.faCheckCircle, faChevronDown_1.faChevronDown, faChevronLeft_1.faChevronLeft, faChevronRight_1.faChevronRight, faChevronUp_1.faChevronUp, faCircle_2.faCircle, faCircleNotch_1.faCircleNotch, faCircle_1.faCircle, faClipboard_1.faClipboard, faClock_1.faClock, faClock_2.faClock, faCog_1.faCog, faColumns_1.faColumns, faCommentAlt_1.faCommentAlt, faCompress_1.faCompress, faCrown_1.faCrown, faEllipsisH_1.faEllipsisH, faEllipsisV_1.faEllipsisV, faEnvelope_1.faEnvelope, faExclamationCircle_1.faExclamationCircle, faExclamationTriangle_1.faExclamationTriangle, faExpand_1.faExpand, faExternalLinkAlt_1.faExternalLinkAlt, faExternalLinkSquareAlt_1.faExternalLinkSquareAlt, faEye_1.faEye, faEyeSlash_1.faEyeSlash, faFastBackward_1.faFastBackward, faFastForward_1.faFastForward, faFileAlt_1.faFileAlt, faFileAlt_2.faFileAlt, faFileImport_1.faFileImport, faFileSignature_1.faFileSignature, faFilter_1.faFilter, faFlag_1.faFlag, faFolder_1.faFolder, faForward_1.faForward, faGripLines_1.faGripLines, faGripLinesVertical_1.faGripLinesVertical, faHashtag_1.faHashtag, faInfoCircle_1.faInfoCircle, faKey_1.faKey, faKeyboard_1.faKeyboard, faLayerGroup_1.faLayerGroup, faLevelUpAlt_1.faLevelUpAlt, faListUl_1.faListUl, faLock_1.faLock, faLongArrowAltRight_1.faLongArrowAltRight, faMagic_1.faMagic, faMapSigns_1.faMapSigns, faMinus_1.faMinus, faMousePointer_1.faMousePointer, faPaperclip_1.faPaperclip, faPause_1.faPause, faPen_1.faPen, faPlay_1.faPlay, faPlus_1.faPlus, faPlusCircle_1.faPlusCircle, faPooStorm_1.faPooStorm, faQuestion_1.faQuestion, faQuestionCircle_2.faQuestionCircle, faQuestionCircle_1.faQuestionCircle, faScroll_1.faScroll, faSearch_1.faSearch, faShareAlt_1.faShareAlt, faShieldAlt_1.faShieldAlt, faSignOutAlt_1.faSignOutAlt, faSignature_1.faSignature, faSlidersH_1.faSlidersH, faSort_1.faSort, faSortDown_1.faSortDown, faSortUp_1.faSortUp, faSpinner_1.faSpinner, faSquare_1.faSquare, faStar_1.faStar, faStar_2.faStar, faSync_1.faSync, faTasks_1.faTasks, faThLarge_1.faThLarge, faThumbsDown_1.faThumbsDown, faThumbsDown_2.faThumbsDown, faThumbsUp_1.faThumbsUp, faThumbsUp_2.faThumbsUp, faTicketAlt_1.faTicketAlt, faTimes_1.faTimes, faTimesCircle_1.faTimesCircle, faTrash_1.faTrash, faUser_2.faUser, faUserAstronaut_1.faUserAstronaut, faUserPlus_1.faUserPlus, faUser_1.faUser, faUsers_1.faUsers, faUserFriends_1.faUserFriends);
145
+ fontawesome_svg_core_1.library.add(faArchive_1.faArchive, faArrowDown_1.faArrowDown, faArrowLeft_1.faArrowLeft, faArrowRight_1.faArrowRight, faArrowUp_1.faArrowUp, faBackward_1.faBackward, faBan_1.faBan, faBatteryHalf_1.faBatteryHalf, faBed_1.faBed, faBell_1.faBell, faBolt_1.faBolt, faCalculator_1.faCalculator, faCalendar_1.faCalendar, faCaretDown_1.faCaretDown, faCaretUp_1.faCaretUp, faChartLine_1.faChartLine, faCheck_1.faCheck, faCheckCircle_2.faCheckCircle, faCheckCircle_1.faCheckCircle, faChevronDown_1.faChevronDown, faChevronLeft_1.faChevronLeft, faChevronRight_1.faChevronRight, faChevronUp_1.faChevronUp, faCircle_2.faCircle, faCircleNotch_1.faCircleNotch, faCircle_1.faCircle, faClipboard_1.faClipboard, faClock_1.faClock, faClock_2.faClock, faCog_1.faCog, faColumns_1.faColumns, faCommentAlt_1.faCommentAlt, faCompress_1.faCompress, faCrown_1.faCrown, faEllipsisH_1.faEllipsisH, faEllipsisV_1.faEllipsisV, faEnvelope_1.faEnvelope, faExclamationCircle_1.faExclamationCircle, faExclamationTriangle_1.faExclamationTriangle, faExpand_1.faExpand, faExternalLinkAlt_1.faExternalLinkAlt, faExternalLinkSquareAlt_1.faExternalLinkSquareAlt, faEye_1.faEye, faEyeSlash_1.faEyeSlash, faFastBackward_1.faFastBackward, faFastForward_1.faFastForward, faFileAlt_1.faFileAlt, faFileAlt_2.faFileAlt, faFileImport_1.faFileImport, faFileSignature_1.faFileSignature, faFilter_1.faFilter, faFlag_1.faFlag, faFolder_1.faFolder, faForward_1.faForward, faGripLines_1.faGripLines, faGripLinesVertical_1.faGripLinesVertical, faHashtag_1.faHashtag, faInfoCircle_1.faInfoCircle, faKey_1.faKey, faKeyboard_1.faKeyboard, faLayerGroup_1.faLayerGroup, faLevelUpAlt_1.faLevelUpAlt, faListUl_1.faListUl, faLock_1.faLock, faLongArrowAltRight_1.faLongArrowAltRight, faMagic_1.faMagic, faMapSigns_1.faMapSigns, faMinus_1.faMinus, faMousePointer_1.faMousePointer, faPaperclip_1.faPaperclip, faPause_1.faPause, faPen_1.faPen, faPlay_1.faPlay, faPlus_1.faPlus, faPlusCircle_1.faPlusCircle, faPooStorm_1.faPooStorm, faQuestion_1.faQuestion, faQuestionCircle_2.faQuestionCircle, faQuestionCircle_1.faQuestionCircle, faScroll_1.faScroll, faSearch_1.faSearch, faShareAlt_1.faShareAlt, faShieldAlt_1.faShieldAlt, faSignOutAlt_1.faSignOutAlt, faSignature_1.faSignature, faSlidersH_1.faSlidersH, faSort_1.faSort, faSortDown_1.faSortDown, faSortUp_1.faSortUp, faSpinner_1.faSpinner, faSquare_1.faSquare, faStar_1.faStar, faStar_2.faStar, faSync_1.faSync, faTasks_1.faTasks, faThLarge_1.faThLarge, faThumbsDown_1.faThumbsDown, faThumbsDown_2.faThumbsDown, faThumbsUp_1.faThumbsUp, faThumbsUp_2.faThumbsUp, faTicketAlt_1.faTicketAlt, faTimes_1.faTimes, faTimesCircle_1.faTimesCircle, faTrash_1.faTrash, faUser_2.faUser, faUserAstronaut_1.faUserAstronaut, faUserPlus_1.faUserPlus, faUser_1.faUser, faUsers_1.faUsers, faUserFriends_1.faUserFriends);
145
146
  var CUSTOM_ICON_TYPE;
146
147
  (function (CUSTOM_ICON_TYPE) {
147
148
  CUSTOM_ICON_TYPE["ARROW_TO_BOTTOM"] = "arrow-to-bottom";
@@ -176,6 +177,7 @@ var ICON_TYPE;
176
177
  ICON_TYPE["CALCULATOR"] = "calculator";
177
178
  ICON_TYPE["CARET_DOWN"] = "caret-down";
178
179
  ICON_TYPE["CARET_UP"] = "caret-up";
180
+ ICON_TYPE["CHART_LINE"] = "chart-line";
179
181
  ICON_TYPE["CHECK"] = "check";
180
182
  ICON_TYPE["CHECK_CIRCLE"] = "check-circle";
181
183
  ICON_TYPE["CHEVRON_DOWN"] = "chevron-down";
@@ -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 });
@@ -33,7 +33,7 @@ const TableCell = react_1.forwardRef(({ className, removePadding = false, isLoad
33
33
  if (columnWidth) {
34
34
  computedStyle.width = columnWidth;
35
35
  }
36
- return (react_1.default.createElement("td", Object.assign({ style: computedStyle, className: classnames_1.default(bem_1.bem(cn), removePadding && bem_1.bem(cn, { m: "removePadding" }), align && `text-${align}`, className), ref: ref }, rest), isLoading ? (react_1.default.createElement(Flex_1.Flex, { className: "h-full items-center" },
36
+ return (react_1.default.createElement("td", Object.assign({ style: computedStyle, className: classnames_1.default(bem_1.bem(cn), removePadding && bem_1.bem(cn, { m: "removePadding" }), align && `text-${align}`, className), ref: ref }, rest), isLoading ? (react_1.default.createElement(Flex_1.Flex, { className: "h-full items-center", "data-testid": "loading-cell-skeleton" },
37
37
  react_1.default.createElement(Skeleton_1.Skeleton, { className: "w-full" }))) : (children)));
38
38
  });
39
39
  exports.default = TableCell;
@@ -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
 
@@ -6671,6 +6676,7 @@ override built-in Image component classes */
6671
6676
  --tw-border-opacity: 1;
6672
6677
  border-color: rgba(222, 231, 238, var(--tw-border-opacity));
6673
6678
  border-style: solid;
6679
+ position: -webkit-sticky;
6674
6680
  position: sticky;
6675
6681
  top: 0px;
6676
6682
  z-index: 19;
@@ -6921,6 +6927,7 @@ override built-in Image component classes */
6921
6927
  }
6922
6928
 
6923
6929
  .ads-Table.ads-Table--sticky-column .ads-TableCell:first-of-type, .ads-Table.ads-Table--sticky-column .ads-TableHeaderCell:first-of-type {
6930
+ position: -webkit-sticky;
6924
6931
  position: sticky;
6925
6932
  left: 0px;
6926
6933
  z-index: 10;
@@ -6929,6 +6936,7 @@ override built-in Image component classes */
6929
6936
  .ads-Table.ads-Table--sticky-column.ads-Table--batch-actions
6930
6937
  .ads-TableCell:nth-of-type(2), .ads-Table.ads-Table--sticky-column.ads-Table--batch-actions
6931
6938
  .ads-TableHeaderCell:nth-of-type(2) {
6939
+ position: -webkit-sticky;
6932
6940
  position: sticky;
6933
6941
  z-index: 10;
6934
6942
  }
@@ -7095,6 +7103,7 @@ override built-in Image component classes */
7095
7103
  padding-left: 6px;
7096
7104
  padding-right: 6px;
7097
7105
  width: -webkit-fit-content;
7106
+ width: -moz-fit-content;
7098
7107
  width: fit-content;
7099
7108
  }
7100
7109
 
@@ -17778,7 +17787,7 @@ override built-in Image component classes */
17778
17787
  }
17779
17788
 
17780
17789
  .font-serif {
17781
- font-family: IBM Plex Serif, serif;
17790
+ font-family: Copernicus, serif;
17782
17791
  }
17783
17792
 
17784
17793
  .font-mono {
@@ -28207,6 +28216,7 @@ override built-in Image component classes */
28207
28216
  }
28208
28217
 
28209
28218
  .sticky {
28219
+ position: -webkit-sticky;
28210
28220
  position: sticky;
28211
28221
  }
28212
28222