@conveyorhq/arrow-ds 1.126.0 → 1.127.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.
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.126.0",
5
+ "version": "1.127.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -1 +1 @@
1
- export { Description } from "./Description";
1
+ export * from "./Description";
@@ -1,5 +1,13 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Description = void 0;
4
- var Description_1 = require("./Description");
5
- Object.defineProperty(exports, "Description", { enumerable: true, get: function () { return Description_1.Description; } });
13
+ __exportStar(require("./Description"), exports);
@@ -1,5 +1,5 @@
1
1
  import { HTMLProps } from "react";
2
- declare type HeadingProps = HTMLProps<HTMLHeadingElement>;
2
+ export declare type HeadingProps = HTMLProps<HTMLHeadingElement>;
3
3
  export declare const Heading: {
4
4
  (props: HeadingProps): JSX.Element;
5
5
  H1: (props: HeadingProps) => JSX.Element;
@@ -9,4 +9,3 @@ export declare const Heading: {
9
9
  H5: (props: HeadingProps) => JSX.Element;
10
10
  H6: (props: HeadingProps) => JSX.Element;
11
11
  };
12
- export {};
@@ -1 +1 @@
1
- export { Heading } from "./Heading";
1
+ export * from "./Heading";
@@ -1,5 +1,13 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Heading = void 0;
4
- var Heading_1 = require("./Heading");
5
- Object.defineProperty(exports, "Heading", { enumerable: true, get: function () { return Heading_1.Heading; } });
13
+ __exportStar(require("./Heading"), exports);
@@ -1,8 +1,10 @@
1
1
  import React, { HTMLAttributes, ReactNode } from "react";
2
2
  import { BoxProps } from "../Box";
3
3
  import { PortalProps, PortalRootElementType } from "../Portal";
4
+ import { DescriptionProps } from "../Description";
4
5
  import { CloseButtonProps } from "../CloseButton";
5
6
  import { StackProps } from "../Stack";
7
+ import { HeadingProps } from "../Heading";
6
8
  export declare enum MODAL_SIZE {
7
9
  DEFAULT = "default",
8
10
  LARGE = "large",
@@ -34,6 +36,9 @@ export interface ModalFooterMultiStepProps extends BoxProps {
34
36
  rightButtonLabel?: string;
35
37
  }
36
38
  export declare const ModalHeader: (props: BoxProps) => JSX.Element;
39
+ export declare const ModalTitle: (props: HeadingProps) => JSX.Element;
40
+ export declare const ModalSecondaryTitle: ({ className, ...rest }: HeadingProps) => JSX.Element;
41
+ export declare const ModalDescription: ({ className, ...rest }: DescriptionProps) => JSX.Element;
37
42
  export declare const ModalBody: (props: ModalBodyProps) => JSX.Element;
38
43
  export declare const ModalTabs: (props: StackProps) => JSX.Element;
39
44
  export declare const ModalFooter: (props: BoxProps) => JSX.Element;
@@ -81,6 +86,9 @@ export declare const Modal: {
81
86
  Screen: ({ className, style, ...rest }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
82
87
  Tabs: (props: StackProps) => JSX.Element;
83
88
  Header: (props: BoxProps) => JSX.Element;
89
+ Title: (props: HeadingProps) => JSX.Element;
90
+ SecondaryTitle: ({ className, ...rest }: HeadingProps) => JSX.Element;
91
+ Description: ({ className, ...rest }: DescriptionProps) => JSX.Element;
84
92
  Body: (props: ModalBodyProps) => JSX.Element;
85
93
  Footer: (props: BoxProps) => JSX.Element;
86
94
  FooterMultiStep: ({ steps, currentStep, leftButtonLabel, rightButtonLabel, children, className, ...rest }: ModalFooterMultiStepProps) => JSX.Element;
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.Modal = exports.ModalScreen = exports.ModalContent = exports.ModalContainer = exports.ModalOverlay = exports.ModalPortal = exports.ModalRoot = exports.ModalClose = exports.ModalCloseButton = exports.ModalFooterMultiStep = exports.ModalFooter = exports.ModalTabs = exports.ModalBody = exports.ModalHeader = exports.MODAL_SIZE = void 0;
25
+ exports.Modal = exports.ModalScreen = exports.ModalContent = exports.ModalContainer = exports.ModalOverlay = exports.ModalPortal = exports.ModalRoot = exports.ModalClose = exports.ModalCloseButton = exports.ModalFooterMultiStep = exports.ModalFooter = exports.ModalTabs = exports.ModalBody = exports.ModalDescription = exports.ModalSecondaryTitle = exports.ModalTitle = exports.ModalHeader = exports.MODAL_SIZE = void 0;
26
26
  const react_1 = __importStar(require("react"));
27
27
  const classnames_1 = __importDefault(require("classnames"));
28
28
  const react_focus_lock_1 = __importDefault(require("react-focus-lock"));
@@ -52,6 +52,18 @@ const ModalHeader = (props) => {
52
52
  return (react_1.default.createElement(Flex_1.Flex, Object.assign({ className: classnames_1.default([bem_1.bem(cn, { e: "header" }), className]) }, rest)));
53
53
  };
54
54
  exports.ModalHeader = ModalHeader;
55
+ const ModalTitle = (props) => {
56
+ return react_1.default.createElement(Heading_1.Heading.H2, Object.assign({}, props));
57
+ };
58
+ exports.ModalTitle = ModalTitle;
59
+ const ModalSecondaryTitle = ({ className, ...rest }) => {
60
+ return (react_1.default.createElement(Heading_1.Heading.H5, Object.assign({ className: classnames_1.default("text-gray-600", className) }, rest)));
61
+ };
62
+ exports.ModalSecondaryTitle = ModalSecondaryTitle;
63
+ const ModalDescription = ({ className, ...rest }) => {
64
+ return (react_1.default.createElement(Description_1.Description, Object.assign({ className: classnames_1.default(bem_1.bem(cn, { e: "description" }), className) }, rest)));
65
+ };
66
+ exports.ModalDescription = ModalDescription;
55
67
  const ModalBody = (props) => {
56
68
  const { padded = true, className, ...rest } = props;
57
69
  return (react_1.default.createElement(Box_1.Box, Object.assign({ className: classnames_1.default([
@@ -196,11 +208,11 @@ const Modal = (props) => {
196
208
  className,
197
209
  ]) }, rest),
198
210
  !noHeader && showHeader && (react_1.default.createElement(exports.ModalHeader, null,
199
- title && react_1.default.createElement(Heading_1.Heading.H2, null, title),
211
+ title && react_1.default.createElement(exports.ModalTitle, null, title),
200
212
  react_1.default.createElement(Stack_1.Stack, { className: "flex-shrink-0", spacing: 5 },
201
- secondaryTitle && (react_1.default.createElement(Heading_1.Heading.H5, { className: "text-gray-600" }, secondaryTitle)),
213
+ secondaryTitle && (react_1.default.createElement(exports.ModalSecondaryTitle, null, secondaryTitle)),
202
214
  !hideCloseButton && react_1.default.createElement(exports.ModalCloseButton, null)))),
203
- description && (react_1.default.createElement(Description_1.Description, { className: bem_1.bem(cn, { e: "description" }) }, description)),
215
+ description && (react_1.default.createElement(exports.ModalDescription, null, description)),
204
216
  children)),
205
217
  react_1.default.createElement(exports.ModalScreen, null)))));
206
218
  };
@@ -213,6 +225,9 @@ exports.Modal.Content = exports.ModalContent;
213
225
  exports.Modal.Screen = exports.ModalScreen;
214
226
  exports.Modal.Tabs = exports.ModalTabs;
215
227
  exports.Modal.Header = exports.ModalHeader;
228
+ exports.Modal.Title = exports.ModalTitle;
229
+ exports.Modal.SecondaryTitle = exports.ModalSecondaryTitle;
230
+ exports.Modal.Description = exports.ModalDescription;
216
231
  exports.Modal.Body = exports.ModalBody;
217
232
  exports.Modal.Footer = exports.ModalFooter;
218
233
  exports.Modal.FooterMultiStep = exports.ModalFooterMultiStep;
@@ -1 +1 @@
1
- export { Description } from "./Description";
1
+ export * from "./Description";
@@ -5,7 +5,7 @@ import { bem } from "../../utilities/bem";
5
5
 
6
6
  const cn = "Heading";
7
7
 
8
- type HeadingProps = HTMLProps<HTMLHeadingElement>;
8
+ export type HeadingProps = HTMLProps<HTMLHeadingElement>;
9
9
 
10
10
  export const Heading = (props: HeadingProps) => {
11
11
  const { children, className, ...rest } = props;
@@ -1 +1 @@
1
- export { Heading } from "./Heading";
1
+ export * from "./Heading";
@@ -16,14 +16,14 @@ import mergeRefs from "react-merge-refs";
16
16
  import { Box, BoxProps } from "../Box";
17
17
  import { Flex } from "../Flex";
18
18
  import { Portal, PortalProps, PortalRootElementType } from "../Portal";
19
- import { Description } from "../Description";
19
+ import { Description, DescriptionProps } from "../Description";
20
20
  import { CloseButton, CloseButtonProps } from "../CloseButton";
21
21
  import { Stack, StackProps } from "../Stack";
22
22
  import { KEY_CODE } from "../../types";
23
23
  import { useKeyPress, useOutsideClick } from "../../hooks";
24
24
  import { bem } from "../../utilities/bem";
25
25
  import { Tab } from "../Tab";
26
- import { Heading } from "../Heading";
26
+ import { Heading, HeadingProps } from "../Heading";
27
27
  import { ModalContext, useModalContext } from "./context";
28
28
 
29
29
  const cn = "Modal";
@@ -166,6 +166,25 @@ export const ModalHeader = (props: BoxProps) => {
166
166
  );
167
167
  };
168
168
 
169
+ export const ModalTitle = (props: HeadingProps) => {
170
+ return <Heading.H2 {...props} />;
171
+ };
172
+
173
+ export const ModalSecondaryTitle = ({ className, ...rest }: HeadingProps) => {
174
+ return (
175
+ <Heading.H5 className={classNames("text-gray-600", className)} {...rest} />
176
+ );
177
+ };
178
+
179
+ export const ModalDescription = ({ className, ...rest }: DescriptionProps) => {
180
+ return (
181
+ <Description
182
+ className={classNames(bem(cn, { e: "description" }), className)}
183
+ {...rest}
184
+ />
185
+ );
186
+ };
187
+
169
188
  export const ModalBody = (props: ModalBodyProps) => {
170
189
  const { padded = true, className, ...rest } = props;
171
190
  return (
@@ -510,13 +529,13 @@ export const Modal = (props: ModalProps) => {
510
529
  >
511
530
  {!noHeader && showHeader && (
512
531
  <ModalHeader>
513
- {title && <Heading.H2>{title}</Heading.H2>}
532
+ {title && <ModalTitle>{title}</ModalTitle>}
514
533
 
515
534
  <Stack className="flex-shrink-0" spacing={5}>
516
535
  {secondaryTitle && (
517
- <Heading.H5 className="text-gray-600">
536
+ <ModalSecondaryTitle>
518
537
  {secondaryTitle}
519
- </Heading.H5>
538
+ </ModalSecondaryTitle>
520
539
  )}
521
540
 
522
541
  {!hideCloseButton && <ModalCloseButton />}
@@ -525,9 +544,7 @@ export const Modal = (props: ModalProps) => {
525
544
  )}
526
545
 
527
546
  {description && (
528
- <Description className={bem(cn, { e: "description" })}>
529
- {description}
530
- </Description>
547
+ <ModalDescription>{description}</ModalDescription>
531
548
  )}
532
549
 
533
550
  {children}
@@ -549,6 +566,9 @@ Modal.Content = ModalContent;
549
566
  Modal.Screen = ModalScreen;
550
567
  Modal.Tabs = ModalTabs;
551
568
  Modal.Header = ModalHeader;
569
+ Modal.Title = ModalTitle;
570
+ Modal.SecondaryTitle = ModalSecondaryTitle;
571
+ Modal.Description = ModalDescription;
552
572
  Modal.Body = ModalBody;
553
573
  Modal.Footer = ModalFooter;
554
574
  Modal.FooterMultiStep = ModalFooterMultiStep;