@deque/cauldron-react 5.8.1-canary.faf22037 → 5.9.0-canary.07ef06bd

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.
@@ -5,19 +5,21 @@ interface AlertProps extends Omit<DialogProps, 'forceAction' | 'closeButtonText'
5
5
  }
6
6
  declare const Alert: ({ children, className, variant, heading, ...other }: AlertProps) => React.JSX.Element;
7
7
  declare const AlertContent: {
8
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
8
+ ({ children, className, align, ...other }: import("../Dialog").DialogContentProps): React.JSX.Element;
9
9
  displayName: string;
10
10
  propTypes: {
11
11
  className: import("prop-types").Requireable<string>;
12
12
  children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
13
+ align: import("prop-types").Requireable<string>;
13
14
  };
14
15
  };
15
16
  declare const AlertActions: {
16
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
17
+ ({ children, className, align, ...other }: import("../Dialog").DialogFooterProps): React.JSX.Element;
17
18
  displayName: string;
18
19
  propTypes: {
19
20
  className: import("prop-types").Requireable<string>;
20
21
  children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
22
+ align: import("prop-types").Requireable<string>;
21
23
  };
22
24
  };
23
25
  export default Alert;
@@ -48,20 +48,27 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
48
48
  handleClickOutside(): void;
49
49
  focusHeading(): void;
50
50
  }
51
+ interface DialogAlignmentProps {
52
+ align?: 'left' | 'center' | 'right';
53
+ }
54
+ export type DialogContentProps = React.HTMLAttributes<HTMLDivElement> & DialogAlignmentProps;
51
55
  declare const DialogContent: {
52
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
56
+ ({ children, className, align, ...other }: DialogContentProps): React.JSX.Element;
53
57
  displayName: string;
54
58
  propTypes: {
55
59
  className: PropTypes.Requireable<string>;
56
60
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
61
+ align: PropTypes.Requireable<string>;
57
62
  };
58
63
  };
64
+ export type DialogFooterProps = React.HTMLAttributes<HTMLDivElement> & DialogAlignmentProps;
59
65
  declare const DialogFooter: {
60
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
66
+ ({ children, className, align, ...other }: DialogFooterProps): React.JSX.Element;
61
67
  displayName: string;
62
68
  propTypes: {
63
69
  className: PropTypes.Requireable<string>;
64
70
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
71
+ align: PropTypes.Requireable<string>;
65
72
  };
66
73
  };
67
74
  export { Dialog, DialogContent, DialogFooter };
@@ -5,19 +5,21 @@ interface ModalProps extends Omit<DialogProps, 'forceAction'> {
5
5
  }
6
6
  declare const Modal: ({ children, className, variant, ...other }: ModalProps) => React.JSX.Element;
7
7
  declare const ModalContent: {
8
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
8
+ ({ children, className, align, ...other }: import("../Dialog").DialogContentProps): React.JSX.Element;
9
9
  displayName: string;
10
10
  propTypes: {
11
11
  className: import("prop-types").Requireable<string>;
12
12
  children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
13
+ align: import("prop-types").Requireable<string>;
13
14
  };
14
15
  };
15
16
  declare const ModalFooter: {
16
- ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
17
+ ({ children, className, align, ...other }: import("../Dialog").DialogFooterProps): React.JSX.Element;
17
18
  displayName: string;
18
19
  propTypes: {
19
20
  className: import("prop-types").Requireable<string>;
20
21
  children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
22
+ align: import("prop-types").Requireable<string>;
21
23
  };
22
24
  };
23
25
  export default Modal;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { IconType } from '../Icon';
3
+ import { ContentNode } from '../../types';
4
+ interface TagButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
5
+ label: ContentNode;
6
+ value: ContentNode;
7
+ icon: IconType;
8
+ onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
9
+ }
10
+ declare const TagButton: React.ForwardRefExoticComponent<TagButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export default TagButton;
package/lib/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export { default as Code } from './components/Code';
39
39
  export { default as LoaderOverlay } from './components/LoaderOverlay';
40
40
  export { default as Line } from './components/Line';
41
41
  export { default as Tag, TagLabel } from './components/Tag';
42
+ export { default as TagButton } from './components/TagButton';
42
43
  export { default as Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableFooter } from './components/Table';
43
44
  export { default as Tabs, Tab, TabPanel } from './components/Tabs';
44
45
  export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails } from './components/DescriptionList';
package/lib/index.js CHANGED
@@ -1664,22 +1664,32 @@ var Dialog = /** @class */ (function (_super) {
1664
1664
  return Dialog;
1665
1665
  }(React__default["default"].Component));
1666
1666
  var DialogContent = function (_a) {
1667
- var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
1668
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Dialog__content', className) }, other), children));
1667
+ var children = _a.children, className = _a.className, align = _a.align, other = tslib.__rest(_a, ["children", "className", "align"]);
1668
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Dialog__content', className, {
1669
+ 'text--align-left': align === 'left',
1670
+ 'text--align-center': align === 'center',
1671
+ 'text--align-right': align === 'right'
1672
+ }) }, other), children));
1669
1673
  };
1670
1674
  DialogContent.displayName = 'DialogContent';
1671
1675
  DialogContent.propTypes = {
1672
1676
  className: PropTypes__default["default"].string,
1673
- children: PropTypes__default["default"].node
1677
+ children: PropTypes__default["default"].node,
1678
+ align: PropTypes__default["default"].string
1674
1679
  };
1675
1680
  var DialogFooter = function (_a) {
1676
- var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
1677
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Dialog__footer', className) }, other), children));
1681
+ var children = _a.children, className = _a.className, align = _a.align, other = tslib.__rest(_a, ["children", "className", "align"]);
1682
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Dialog__footer', className, {
1683
+ 'text--align-left': align === 'left',
1684
+ 'text--align-center': align === 'center',
1685
+ 'text--align-right': align === 'right'
1686
+ }) }, other), children));
1678
1687
  };
1679
1688
  DialogFooter.displayName = 'DialogFooter';
1680
1689
  DialogFooter.propTypes = {
1681
1690
  className: PropTypes__default["default"].string,
1682
- children: PropTypes__default["default"].node
1691
+ children: PropTypes__default["default"].node,
1692
+ align: PropTypes__default["default"].string
1683
1693
  };
1684
1694
 
1685
1695
  var Alert = function (_a) {
@@ -1813,7 +1823,10 @@ function Tooltip(_a) {
1813
1823
  placement: initialPlacement,
1814
1824
  modifiers: [
1815
1825
  { name: 'preventOverflow', options: { padding: 8 } },
1816
- { name: 'flip' },
1826
+ {
1827
+ name: 'flip',
1828
+ options: { fallbackPlacements: ['left', 'right', 'top', 'bottom'] }
1829
+ },
1817
1830
  { name: 'offset', options: { offset: [0, 8] } },
1818
1831
  { name: 'arrow', options: { padding: 5, element: arrowElement } }
1819
1832
  ]
@@ -3157,6 +3170,15 @@ Tag.propTypes = {
3157
3170
  className: PropTypes__default["default"].string
3158
3171
  };
3159
3172
 
3173
+ var TagButton = React__default["default"].forwardRef(function (_a, ref) {
3174
+ var label = _a.label, value = _a.value, icon = _a.icon, className = _a.className, rest = tslib.__rest(_a, ["label", "value", "icon", "className"]);
3175
+ return (React__default["default"].createElement(Button, tslib.__assign({ variant: "tag", className: classNames__default["default"]('TagButton', className), ref: ref }, rest),
3176
+ React__default["default"].createElement(TagLabel, null, label),
3177
+ value,
3178
+ React__default["default"].createElement(Icon, { className: "TagButton__icon", type: icon })));
3179
+ });
3180
+ TagButton.displayName = 'TagButton';
3181
+
3160
3182
  var Table = function (_a) {
3161
3183
  var children = _a.children, className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["children", "className", "variant"]);
3162
3184
  return (React__default["default"].createElement("table", tslib.__assign({ className: classNames__default["default"]('Table', variant === 'border' && 'Table--border', className) }, other), children));
@@ -4842,6 +4864,7 @@ exports.TableHeader = TableHeader;
4842
4864
  exports.TableRow = TableRow;
4843
4865
  exports.Tabs = Tabs;
4844
4866
  exports.Tag = Tag;
4867
+ exports.TagButton = TagButton;
4845
4868
  exports.TagLabel = TagLabel;
4846
4869
  exports.TextField = TextField;
4847
4870
  exports.ThemeContext = ThemeContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.8.1-canary.faf22037",
3
+ "version": "5.9.0-canary.07ef06bd",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",