@conveyorhq/arrow-ds 1.181.0 → 1.183.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 (36) hide show
  1. package/package.json +5 -3
  2. package/public/components/Chip/Chip.d.ts +17 -0
  3. package/public/components/Chip/Chip.js +50 -0
  4. package/public/components/Chip/index.d.ts +1 -0
  5. package/public/components/Chip/index.js +17 -0
  6. package/public/components/Markdown/Markdown.d.ts +8 -2
  7. package/public/components/Markdown/Markdown.js +24 -10
  8. package/public/components/Markdown/directives/chip.d.ts +10 -0
  9. package/public/components/Markdown/directives/chip.js +30 -0
  10. package/public/components/Markdown/directives/index.d.ts +1 -0
  11. package/public/components/Markdown/directives/index.js +17 -0
  12. package/public/components/Markdown/index.d.ts +1 -0
  13. package/public/components/Markdown/index.js +15 -0
  14. package/public/css/styles.css +76 -0
  15. package/public/css/styles.min.css +1 -1
  16. package/public/css/styles.min.css.map +1 -1
  17. package/public/index.d.ts +1 -0
  18. package/public/index.js +1 -0
  19. package/public/src/style-dictionary/tailwind.config.js +8 -0
  20. package/public/style-dictionary/tailwind.config.d.ts +10 -1
  21. package/public/style-dictionary/tailwind.config.js +8 -0
  22. package/src/components/Chip/Chip.stories.mdx +43 -0
  23. package/src/components/Chip/Chip.tsx +60 -0
  24. package/src/components/Chip/index.css +15 -0
  25. package/src/components/Chip/index.ts +1 -0
  26. package/src/components/Markdown/Markdown.stories.mdx +76 -21
  27. package/src/components/Markdown/Markdown.tsx +43 -21
  28. package/src/components/Markdown/directives/chip.tsx +50 -0
  29. package/src/components/Markdown/directives/index.ts +1 -0
  30. package/src/components/Markdown/index.css +8 -0
  31. package/src/components/Markdown/index.ts +1 -0
  32. package/src/css/components.css +1 -0
  33. package/src/css/utilities/animations.css +24 -0
  34. package/src/index.ts +1 -0
  35. package/src/style-dictionary/tailwind.config.js +8 -0
  36. package/src/components/Markdown/Markdown.md +0 -23
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.181.0",
5
+ "version": "1.183.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -44,13 +44,15 @@
44
44
  "react-dnd-html5-backend": "^16.0.1",
45
45
  "react-focus-lock": "^2.2.1",
46
46
  "react-hot-toast": "^2.4.1",
47
- "react-markdown": "^4.3.1",
47
+ "react-markdown": "^9.0.3",
48
48
  "react-merge-refs": "^1.1.0",
49
49
  "react-popper": "^2.3.0",
50
50
  "react-remove-scroll": "^2.2.0",
51
51
  "react-select": "^4.0.2",
52
52
  "react-spring": "^8.0.27",
53
- "remark-breaks": "^2.0.2"
53
+ "remark-breaks": "^4.0.0",
54
+ "remark-directive": "^3.0.0",
55
+ "remark-directive-rehype": "^0.4.2"
54
56
  },
55
57
  "scripts": {
56
58
  "prepublishOnly": "yarn run build",
@@ -0,0 +1,17 @@
1
+ import React, { ReactNode } from "react";
2
+ export interface ChipProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ }
7
+ export declare const ChipDefault: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
8
+ declare const integrationNames: readonly ["salesforce"];
9
+ export declare const ChipIntegration: React.ForwardRefExoticComponent<ChipProps & {
10
+ integration: (typeof integrationNames)[number];
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>> & {
13
+ Integration: React.ForwardRefExoticComponent<ChipProps & {
14
+ integration: (typeof integrationNames)[number];
15
+ } & React.RefAttributes<HTMLDivElement>>;
16
+ };
17
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Chip = exports.ChipIntegration = exports.ChipDefault = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const classnames_1 = __importDefault(require("classnames"));
32
+ const utilities_1 = require("../../utilities");
33
+ const Flex_1 = require("../Flex");
34
+ const IntegrationLogo_1 = require("../IntegrationLogo");
35
+ const cn = (0, utilities_1.bemHOF)("Chip");
36
+ exports.ChipDefault = (0, react_1.forwardRef)(function Chip({ children, className, style }, ref) {
37
+ return (react_1.default.createElement(Flex_1.Flex, { ref: ref, style: style, className: (0, classnames_1.default)(cn(), cn({ m: "default" }), className) }, children));
38
+ });
39
+ const integrationNames = ["salesforce"];
40
+ exports.ChipIntegration = (0, react_1.forwardRef)(function ChipIntegration({ children, integration, className, style }, ref) {
41
+ const integrationClassNames = {
42
+ salesforce: "text-blue-400 bg-blue-300/15",
43
+ };
44
+ return (react_1.default.createElement(Flex_1.Flex, { ref: ref, style: style, className: (0, classnames_1.default)(cn(), integrationClassNames[integration], className) },
45
+ react_1.default.createElement(IntegrationLogo_1.IntegrationLogo, { logo: "salesforce", square: true, width: 13 }),
46
+ children));
47
+ });
48
+ exports.Chip = Object.assign({}, exports.ChipDefault, {
49
+ Integration: exports.ChipIntegration,
50
+ });
@@ -0,0 +1 @@
1
+ export * from "./Chip";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Chip"), exports);
@@ -1,10 +1,16 @@
1
1
  import React from "react";
2
- import { ReactMarkdownProps } from "react-markdown";
2
+ import { Options as ReactMarkdownProps, Components as ReactMarkdownComponents } from "react-markdown";
3
3
  export interface MarkdownProps extends ReactMarkdownProps {
4
4
  children: string;
5
5
  className?: string;
6
6
  escapeHtml?: boolean;
7
7
  skipHtml?: boolean;
8
8
  renderPlainText?: boolean;
9
+ directives?: {
10
+ [key: string]: (props: {
11
+ children: string;
12
+ }) => JSX.Element;
13
+ } | null;
14
+ renderers?: ReactMarkdownComponents | null;
9
15
  }
10
- export declare const Markdown: ({ children, className, escapeHtml, skipHtml, renderPlainText, renderers, ...rest }: MarkdownProps) => React.JSX.Element;
16
+ export declare const Markdown: ({ children, className, skipHtml, renderPlainText, components, directives: customDirectives, renderers, ...rest }: MarkdownProps) => React.JSX.Element;
@@ -8,16 +8,22 @@ const react_1 = __importDefault(require("react"));
8
8
  const classnames_1 = __importDefault(require("classnames"));
9
9
  const react_markdown_1 = __importDefault(require("react-markdown"));
10
10
  const remark_breaks_1 = __importDefault(require("remark-breaks"));
11
+ const remark_directive_1 = __importDefault(require("remark-directive"));
12
+ const remark_directive_rehype_1 = __importDefault(require("remark-directive-rehype"));
11
13
  const bem_1 = require("../../utilities/bem");
12
- const Text_1 = require("../Text");
14
+ const chip_1 = require("./directives/chip");
13
15
  const cn = "Markdown";
14
- const TextRenderer = (as = "p") => ({ children, }) => react_1.default.createElement(Text_1.Text, { as: as }, children);
15
- const Markdown = ({ children, className, escapeHtml = true, skipHtml = false, renderPlainText = false, renderers, ...rest }) => {
16
+ const Markdown = ({ children, className, skipHtml = false, renderPlainText = false, components, directives: customDirectives, renderers, ...rest }) => {
16
17
  const plainTextRenderers = renderPlainText
17
18
  ? {
18
- heading: TextRenderer(),
19
- strong: TextRenderer("span"),
20
- emphasis: TextRenderer("span"),
19
+ h1: ({ ...props }) => react_1.default.createElement("p", { ...props }),
20
+ h2: ({ ...props }) => react_1.default.createElement("p", { ...props }),
21
+ h3: ({ ...props }) => react_1.default.createElement("p", { ...props }),
22
+ h4: ({ ...props }) => react_1.default.createElement("p", { ...props }),
23
+ h5: ({ ...props }) => react_1.default.createElement("p", { ...props }),
24
+ h6: ({ ...props }) => react_1.default.createElement("p", { ...props }),
25
+ strong: ({ ...props }) => react_1.default.createElement("span", { ...props }),
26
+ em: ({ ...props }) => react_1.default.createElement("span", { ...props }),
21
27
  }
22
28
  : undefined;
23
29
  const linkRenderer = ({ href, children: text, }) => {
@@ -25,15 +31,23 @@ const Markdown = ({ children, className, escapeHtml = true, skipHtml = false, re
25
31
  target: "_blank",
26
32
  rel: "noopener noreferrer",
27
33
  };
28
- if (href.startsWith("http")) {
34
+ if (href === null || href === void 0 ? void 0 : href.startsWith("http")) {
29
35
  return (react_1.default.createElement("a", { href: href, ...externalLinkProps }, text));
30
36
  }
31
37
  return react_1.default.createElement("a", { href: href }, text);
32
38
  };
33
- return (react_1.default.createElement(react_markdown_1.default, { className: (0, classnames_1.default)((0, bem_1.bem)(cn), className), source: children, escapeHtml: escapeHtml, skipHtml: skipHtml, renderers: {
39
+ const directives = {
40
+ "salesforce-chip": chip_1.MarkdownDirectiveChipSalesforce,
41
+ "conveyor-chip": chip_1.MarkdownDirectiveChipConveyor,
42
+ "info-chip": chip_1.MarkdownDirectiveChipInfo,
43
+ ...customDirectives,
44
+ };
45
+ return (react_1.default.createElement(react_markdown_1.default, { className: (0, classnames_1.default)((0, bem_1.bem)(cn), className), skipHtml: skipHtml, components: {
34
46
  ...plainTextRenderers,
35
- link: linkRenderer,
47
+ ...directives,
48
+ a: linkRenderer,
49
+ ...components,
36
50
  ...renderers,
37
- }, plugins: [remark_breaks_1.default], ...rest }));
51
+ }, remarkPlugins: [remark_breaks_1.default, remark_directive_1.default, remark_directive_rehype_1.default], ...rest }, children));
38
52
  };
39
53
  exports.Markdown = Markdown;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export declare const MarkdownDirectiveChipSalesforce: ({ children, }: {
3
+ children: string;
4
+ }) => React.JSX.Element;
5
+ export declare const MarkdownDirectiveChipConveyor: ({ children, }: {
6
+ children?: string | undefined;
7
+ }) => React.JSX.Element;
8
+ export declare const MarkdownDirectiveChipInfo: ({ children, }: {
9
+ children: string;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,30 @@
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.MarkdownDirectiveChipInfo = exports.MarkdownDirectiveChipConveyor = exports.MarkdownDirectiveChipSalesforce = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const tokens_1 = require("../../../style-dictionary/dist/tokens");
9
+ const Chip_1 = require("../../Chip");
10
+ const IntegrationLogo_1 = require("../../IntegrationLogo");
11
+ const sharedProps = {
12
+ className: "inline-flex uppercase",
13
+ style: {
14
+ verticalAlign: "text-bottom",
15
+ },
16
+ };
17
+ const MarkdownDirectiveChipSalesforce = ({ children, }) => {
18
+ return (react_1.default.createElement(Chip_1.Chip.Integration, { integration: "salesforce", ...sharedProps }, children.replace("=>", "→")));
19
+ };
20
+ exports.MarkdownDirectiveChipSalesforce = MarkdownDirectiveChipSalesforce;
21
+ const MarkdownDirectiveChipConveyor = ({ children, }) => {
22
+ return (react_1.default.createElement(Chip_1.Chip, { ...sharedProps },
23
+ react_1.default.createElement(IntegrationLogo_1.IntegrationLogo, { logo: "conveyor", square: true, width: 13, color: tokens_1.tokens.color.gray[700], className: "flex-shrink-0" }),
24
+ children || "Conveyor"));
25
+ };
26
+ exports.MarkdownDirectiveChipConveyor = MarkdownDirectiveChipConveyor;
27
+ const MarkdownDirectiveChipInfo = ({ children, }) => {
28
+ return react_1.default.createElement(Chip_1.Chip, { ...sharedProps }, children);
29
+ };
30
+ exports.MarkdownDirectiveChipInfo = MarkdownDirectiveChipInfo;
@@ -0,0 +1 @@
1
+ export * from "./chip";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./chip"), exports);
@@ -1 +1,2 @@
1
1
  export { Markdown } from "./Markdown";
2
+ export * from "./directives";
@@ -1,5 +1,20 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.Markdown = void 0;
4
18
  var Markdown_1 = require("./Markdown");
5
19
  Object.defineProperty(exports, "Markdown", { enumerable: true, get: function () { return Markdown_1.Markdown; } });
20
+ __exportStar(require("./directives"), exports);
@@ -2387,6 +2387,28 @@ override built-in Image component classes */
2387
2387
  outline-offset: -1px;
2388
2388
  }
2389
2389
 
2390
+ .ads-Chip {
2391
+ width: -webkit-max-content;
2392
+ width: max-content;
2393
+ align-items: center;
2394
+ -webkit-column-gap: 4px;
2395
+ column-gap: 4px;
2396
+ border-radius: 9999px;
2397
+ padding-left: 8px;
2398
+ padding-right: 8px;
2399
+ font-size: 12px;
2400
+ font-weight: 500;
2401
+
2402
+ height: 18px;
2403
+ }
2404
+
2405
+ .ads-Chip--default {
2406
+ --tw-bg-opacity: 1;
2407
+ background-color: rgb(222 231 238 / var(--tw-bg-opacity));
2408
+ --tw-text-opacity: 1;
2409
+ color: rgb(71 104 125 / var(--tw-text-opacity));
2410
+ }
2411
+
2390
2412
  .ads-CloseButton {
2391
2413
  display: flex;
2392
2414
  height: 24px;
@@ -4528,6 +4550,10 @@ button.ads-DateRangePicker-preset--isSelected:hover {
4528
4550
  margin-bottom: 0;
4529
4551
  }
4530
4552
 
4553
+ .ads-Markdown ol + ul {
4554
+ padding-left: 64px;
4555
+ }
4556
+
4531
4557
  .ads-Markdown li input[type="checkbox"] {
4532
4558
  margin-left: -16px;
4533
4559
  margin-right: 8px;
@@ -4572,6 +4598,10 @@ button.ads-DateRangePicker-preset--isSelected:hover {
4572
4598
  padding: 0;
4573
4599
  }
4574
4600
 
4601
+ .ads-Markdown a {
4602
+ word-break: break-word;
4603
+ }
4604
+
4575
4605
  :root {
4576
4606
  --markdown-editor-max-height: calc(100vh - 40px);
4577
4607
  --markdown-editor-max-width: calc(100vw - 40px);
@@ -8619,6 +8649,10 @@ button.ads-DateRangePicker-preset--isSelected:hover {
8619
8649
  background-color: rgb(222 231 238 / var(--tw-bg-opacity));
8620
8650
  }
8621
8651
 
8652
+ .bg-blue-300\/15 {
8653
+ background-color: rgb(62 158 245 / 0.15);
8654
+ }
8655
+
8622
8656
  .bg-screen {
8623
8657
  background-color: rgba(0, 0, 0, 0.25);
8624
8658
  }
@@ -8784,6 +8818,11 @@ button.ads-DateRangePicker-preset--isSelected:hover {
8784
8818
  color: rgb(32 65 86 / var(--tw-text-opacity));
8785
8819
  }
8786
8820
 
8821
+ .text-blue-400 {
8822
+ --tw-text-opacity: 1;
8823
+ color: rgb(13 125 228 / var(--tw-text-opacity));
8824
+ }
8825
+
8787
8826
  .text-placeholder {
8788
8827
  --tw-text-opacity: 1;
8789
8828
  color: rgb(134 163 181 / var(--tw-text-opacity));
@@ -9155,6 +9194,30 @@ button.ads-DateRangePicker-preset--isSelected:hover {
9155
9194
  }
9156
9195
  }
9157
9196
 
9197
+ @-webkit-keyframes working-banner-gradient {
9198
+ 0% {
9199
+ background-position: 0% 50%;
9200
+ }
9201
+ 50% {
9202
+ background-position: 100% 50%;
9203
+ }
9204
+ 100% {
9205
+ background-position: 0% 50%;
9206
+ }
9207
+ }
9208
+
9209
+ @keyframes working-banner-gradient {
9210
+ 0% {
9211
+ background-position: 0% 50%;
9212
+ }
9213
+ 50% {
9214
+ background-position: 100% 50%;
9215
+ }
9216
+ 100% {
9217
+ background-position: 0% 50%;
9218
+ }
9219
+ }
9220
+
9158
9221
  .animated {
9159
9222
  -webkit-animation-duration: 500ms;
9160
9223
  animation-duration: 500ms;
@@ -9224,6 +9287,19 @@ button.ads-DateRangePicker-preset--isSelected:hover {
9224
9287
  animation: toast-leave 0.15s ease-in forwards;
9225
9288
  }
9226
9289
 
9290
+ .working-banner-gradient {
9291
+ background: linear-gradient(
9292
+ 89deg,
9293
+ rgba(51, 198, 159, 0.25) 0.27%,
9294
+ rgba(118, 186, 249, 0.25) 77.05%,
9295
+ rgba(200, 179, 232, 0.25) 99.79%
9296
+ ),
9297
+ #fff;
9298
+ background-size: 200% 200%;
9299
+ -webkit-animation: working-banner-gradient 2.5s ease infinite;
9300
+ animation: working-banner-gradient 2.5s ease infinite;
9301
+ }
9302
+
9227
9303
  .elevation-inset {
9228
9304
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.01);
9229
9305
  }