flipper-ui 0.29.3 → 0.29.5

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.
@@ -22,7 +22,8 @@ export interface DialogProps extends DefaultProps, Omit<MuiDialogProps, 'scroll'
22
22
  snippetContentStyle?: CSSProperties;
23
23
  contentTextStyle?: CSSProperties;
24
24
  scroll?: 'body' | 'paper' | 'unset-paper' | 'unset-body';
25
+ 'aria-title'?: string;
25
26
  onClose?: (event: Event) => void;
26
27
  }
27
- export declare const Dialog: ({ snippet, style, padding, margin, scroll, PaperProps, open, fullScreen, fullWidth, maxWidth, onClose, titleAction, titleWrapperStyle, titleStyle, titleActionStyle, contentStyle, contentTextStyle, actionsStyle, actions, content, text, title, snippetStyle, snippetContentStyle, ...otherProps }: DialogProps) => JSX.Element;
28
+ export declare const Dialog: ({ snippet, style, padding, margin, scroll, PaperProps, open, fullScreen, fullWidth, maxWidth, onClose, titleAction, titleWrapperStyle, titleStyle, titleActionStyle, contentStyle, contentTextStyle, actionsStyle, actions, content, text, title, snippetStyle, snippetContentStyle, "aria-title": ariaTitle, ...otherProps }: DialogProps) => JSX.Element;
28
29
  export default Dialog;
@@ -17,7 +17,7 @@ var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle
17
17
  var _react = _interopRequireDefault(require("react"));
18
18
  var _styles = require("@material-ui/core/styles");
19
19
  var _styledComponents = _interopRequireDefault(require("styled-components"));
20
- var _excluded = ["snippet", "style", "padding", "margin", "scroll", "PaperProps", "open", "fullScreen", "fullWidth", "maxWidth", "onClose", "titleAction", "titleWrapperStyle", "titleStyle", "titleActionStyle", "contentStyle", "contentTextStyle", "actionsStyle", "actions", "content", "text", "title", "snippetStyle", "snippetContentStyle"];
20
+ var _excluded = ["snippet", "style", "padding", "margin", "scroll", "PaperProps", "open", "fullScreen", "fullWidth", "maxWidth", "onClose", "titleAction", "titleWrapperStyle", "titleStyle", "titleActionStyle", "contentStyle", "contentTextStyle", "actionsStyle", "actions", "content", "text", "title", "snippetStyle", "snippetContentStyle", "aria-title"];
21
21
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
22
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
23
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -55,6 +55,7 @@ var Dialog = function Dialog(_ref) {
55
55
  title = _ref.title,
56
56
  snippetStyle = _ref.snippetStyle,
57
57
  snippetContentStyle = _ref.snippetContentStyle,
58
+ ariaTitle = _ref['aria-title'],
58
59
  otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
59
60
  var classes = useStyles();
60
61
  var renderTitle = function renderTitle(title) {
@@ -106,8 +107,9 @@ var Dialog = function Dialog(_ref) {
106
107
  fullWidth: fullWidth,
107
108
  maxWidth: maxWidth,
108
109
  scroll: scrollMode,
109
- PaperProps: _objectSpread({
110
- title: 'dialog-paper',
110
+ PaperProps: _objectSpread(_objectSpread({}, ariaTitle ? {
111
+ title: ariaTitle
112
+ } : {}), {}, {
111
113
  classes: scroll === 'unset-body' || scroll === 'unset-paper' ? {
112
114
  root: classes.root
113
115
  } : undefined
@@ -3,3 +3,4 @@ export default _default;
3
3
  export declare const Default: any;
4
4
  export declare const WithOnToggleEdit: any;
5
5
  export declare const Editing: any;
6
+ export declare const WithOnClickAdd: any;
@@ -17,6 +17,11 @@ export interface IProps {
17
17
  */
18
18
  title?: string;
19
19
  name: string;
20
+ /**
21
+ * Label to be displayed on the add button.
22
+ * @default undefined
23
+ */
24
+ onAddBtnLabel?: string;
20
25
  id?: string;
21
26
  editing?: boolean;
22
27
  action?: JSX.Element | null;
@@ -12,7 +12,7 @@ var _icons = require("../../icons");
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
  var _ = require("../..");
14
14
  var _styledComponents = _interopRequireDefault(require("styled-components"));
15
- var _excluded = ["id", "name", "nested", "title", "action", "onToggleEdit", "editing", "children", "onClickAdd", "onAddProps", "onEditProps"];
15
+ var _excluded = ["id", "name", "onAddBtnLabel", "nested", "title", "action", "onToggleEdit", "editing", "children", "onClickAdd", "onAddProps", "onEditProps"];
16
16
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
17
17
  var Content = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n justify-content: center;\n display: flex;\n flex-direction: column;\n padding: 12px;\n"])));
18
18
  exports.Content = Content;
@@ -29,6 +29,7 @@ var paperStyle = {
29
29
  var Card = function Card(props) {
30
30
  var id = props.id,
31
31
  name = props.name,
32
+ onAddBtnLabel = props.onAddBtnLabel,
32
33
  nested = props.nested,
33
34
  title = props.title,
34
35
  action = props.action,
@@ -58,7 +59,7 @@ var Card = function Card(props) {
58
59
  onClick: onToggleEdit
59
60
  }), editing ? /*#__PURE__*/_react["default"].createElement(_icons.Close, null) : /*#__PURE__*/_react["default"].createElement(_icons.Edit, null))), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_.Line, null))), onClickAdd && /*#__PURE__*/_react["default"].createElement(_.Button, (0, _extends2["default"])({}, onAddProps, {
60
61
  onClick: onClickAdd
61
- })), /*#__PURE__*/_react["default"].createElement("div", null, children));
62
+ }), onAddBtnLabel), /*#__PURE__*/_react["default"].createElement("div", null, children));
62
63
  };
63
64
  exports.Card = Card;
64
65
  var _default = Card;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flipper-ui",
3
- "version": "0.29.3",
3
+ "version": "0.29.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://flipper-ui.ngi.com.br/",