@dfds-ui/modal 2.2.0-alpha.e74a6756 → 2.2.0-alpha.e82e41de

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 (41) hide show
  1. package/cjs/modal/Modal.d.ts +7 -3
  2. package/cjs/modal/Modal.js +24 -21
  3. package/cjs/modal/ModalAction.js +7 -7
  4. package/cjs/modal/ModalActionsContainer.js +13 -8
  5. package/cjs/modal/ModalBody.d.ts +2 -3
  6. package/cjs/modal/ModalBody.js +3 -5
  7. package/cjs/modal/ModalCloseButton.d.ts +1 -1
  8. package/cjs/modal/ModalCloseButton.js +7 -7
  9. package/cjs/modal/ModalDialog.d.ts +2 -2
  10. package/cjs/modal/ModalDialog.js +37 -37
  11. package/cjs/modal/ModalFooter.d.ts +2 -2
  12. package/cjs/modal/ModalFooter.js +8 -7
  13. package/cjs/modal/ModalHeader.d.ts +2 -2
  14. package/cjs/modal/ModalHeader.js +11 -9
  15. package/cjs/modal/ModalHeadline.d.ts +2 -2
  16. package/cjs/modal/ModalHeadline.js +7 -6
  17. package/cjs/modal/ModalPanel.d.ts +5 -5
  18. package/cjs/modal/ModalPanel.js +33 -29
  19. package/cjs/modal/ReactModalWrapper.d.ts +1 -1
  20. package/cjs/modal/ReactModalWrapper.js +6 -6
  21. package/cjs/modal/index.js +2 -3
  22. package/modal/Modal.d.ts +7 -3
  23. package/modal/Modal.js +27 -16
  24. package/modal/ModalAction.js +10 -5
  25. package/modal/ModalActionsContainer.js +16 -7
  26. package/modal/ModalBody.d.ts +2 -3
  27. package/modal/ModalCloseButton.d.ts +1 -1
  28. package/modal/ModalCloseButton.js +10 -5
  29. package/modal/ModalDialog.d.ts +2 -2
  30. package/modal/ModalDialog.js +38 -37
  31. package/modal/ModalFooter.d.ts +2 -2
  32. package/modal/ModalFooter.js +13 -6
  33. package/modal/ModalHeader.d.ts +2 -2
  34. package/modal/ModalHeader.js +17 -8
  35. package/modal/ModalHeadline.d.ts +2 -2
  36. package/modal/ModalHeadline.js +5 -4
  37. package/modal/ModalPanel.d.ts +5 -5
  38. package/modal/ModalPanel.js +32 -29
  39. package/modal/ReactModalWrapper.d.ts +1 -1
  40. package/modal/ReactModalWrapper.js +10 -5
  41. package/package.json +12 -12
@@ -1,19 +1,28 @@
1
1
  var _excluded = ["actions"];
2
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
10
  import React from 'react';
6
11
  import { theme } from '@dfds-ui/theme';
7
12
  import { css } from '@emotion/react';
8
- import { jsx as ___EmotionJSX } from "@emotion/react";
13
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
9
14
  var ModalAction = function ModalAction(props) {
10
- return ___EmotionJSX("div", _extends({
11
- css: /*#__PURE__*/css("display:flex;flex-wrap:nowrap;justify-content:flex-end;flex-grow:1;padding-top:", theme.spacing.s, ";padding-bottom:", theme.spacing.s, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:ModalAction;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json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5lcjogUmVhY3QuRnVuY3Rpb25Db21wb25lbnQ8TW9kYWxBY3Rpb25zUHJvcHM+ID0gKHsgYWN0aW9ucywgLi4ucmVzdCB9KSA9PiB7XG4gIHJldHVybiA8ZGl2IHsuLi5yZXN0fT57YWN0aW9ucyAmJiA8TW9kYWxBY3Rpb24+e2FjdGlvbnN9PC9Nb2RhbEFjdGlvbj59PC9kaXY+XG59XG5cbmV4cG9ydCBkZWZhdWx0IE1vZGFsQWN0aW9uc0NvbnRhaW5lclxuIl19 */")
15
+ return _jsx("div", _objectSpread({
16
+ css: /*#__PURE__*/css("display:flex;flex-wrap:nowrap;justify-content:flex-end;flex-grow:1;padding-top:", theme.spacing.s, ";padding-bottom:", theme.spacing.s, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:ModalAction;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tb2RhbC9Nb2RhbEFjdGlvbnNDb250YWluZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNjIiwiZmlsZSI6Ii4uLy4uL3NyYy9tb2RhbC9Nb2RhbEFjdGlvbnNDb250YWluZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgdGhlbWUgfSBmcm9tICdAZGZkcy11aS90aGVtZSdcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuXG5leHBvcnQgdHlwZSBNb2RhbEFjdGlvbnNQcm9wcyA9IHtcbiAgLyoqXG4gICAqIEFjdGlvbnMgdG8gYmUgZGlzcGxheWVkIGF0IHRoZSBib3R0b20gb2YgdGhlIG1vZGFsXG4gICAqL1xuICBhY3Rpb25zPzogUmVhY3QuUmVhY3ROb2RlXG59XG5cbmNvbnN0IE1vZGFsQWN0aW9uOiBSZWFjdC5GdW5jdGlvbkNvbXBvbmVudDx7IGNoaWxkcmVuPzogUmVhY3QuUmVhY3ROb2RlOyBjbGFzc05hbWU/OiBzdHJpbmcgfT4gPSAocHJvcHMpID0+IHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC13cmFwOiBub3dyYXA7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1lbmQ7XG4gICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgcGFkZGluZy10b3A6ICR7dGhlbWUuc3BhY2luZy5zfTtcbiAgICAgICAgcGFkZGluZy1ib3R0b206ICR7dGhlbWUuc3BhY2luZy5zfTtcbiAgICAgIGB9XG4gICAgICB7Li4ucHJvcHN9XG4gICAgLz5cbiAgKVxufVxuXG5jb25zdCBNb2RhbEFjdGlvbnNDb250YWluZXI6IFJlYWN0LkZ1bmN0aW9uQ29tcG9uZW50PE1vZGFsQWN0aW9uc1Byb3BzPiA9ICh7IGFjdGlvbnMsIC4uLnJlc3QgfSkgPT4ge1xuICByZXR1cm4gPGRpdiB7Li4ucmVzdH0+e2FjdGlvbnMgJiYgPE1vZGFsQWN0aW9uPnthY3Rpb25zfTwvTW9kYWxBY3Rpb24+fTwvZGl2PlxufVxuXG5leHBvcnQgZGVmYXVsdCBNb2RhbEFjdGlvbnNDb250YWluZXJcbiJdfQ== */")
12
17
  }, props));
13
18
  };
14
19
  var ModalActionsContainer = function ModalActionsContainer(_ref) {
15
20
  var actions = _ref.actions,
16
21
  rest = _objectWithoutProperties(_ref, _excluded);
17
- return ___EmotionJSX("div", rest, actions && ___EmotionJSX(ModalAction, null, actions));
22
+ return _jsx("div", _objectSpread(_objectSpread({}, rest), {}, {
23
+ children: actions && _jsx(ModalAction, {
24
+ children: actions
25
+ })
26
+ }));
18
27
  };
19
28
  export default ModalActionsContainer;
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  export type ModalBodyProps = {
3
2
  hasPadding?: boolean;
4
3
  column?: boolean;
5
4
  };
6
5
  export declare const ModalBody: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: import("react").ElementType<any> | undefined;
6
+ theme?: import("@emotion/react").Theme;
7
+ as?: React.ElementType;
9
8
  } & ModalBodyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
9
  export default ModalBody;
@@ -9,5 +9,5 @@ export type ModalCloseButtonProps = {
9
9
  closeLabel?: string;
10
10
  children?: React.ReactNode;
11
11
  };
12
- export declare const ModalCloseButton: ({ onRequestClose, className, icon, size, closeLabel, ...rest }: ModalCloseButtonProps) => JSX.Element;
12
+ export declare const ModalCloseButton: ({ onRequestClose, className, icon, size, closeLabel, ...rest }: ModalCloseButtonProps) => React.JSX.Element;
13
13
  export default ModalCloseButton;
@@ -1,13 +1,18 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  var _excluded = ["onRequestClose", "className", "icon", "size", "closeLabel"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
10
  import React from 'react';
6
11
  import { IconButton } from '@dfds-ui/react-components';
7
12
  import { Close } from '@dfds-ui/icons/system';
8
13
  import { css } from '@emotion/react';
9
14
  import { theme } from '@dfds-ui/theme';
10
- import { jsx as ___EmotionJSX } from "@emotion/react";
15
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
11
16
  export var ModalCloseButton = function ModalCloseButton(_ref) {
12
17
  var onRequestClose = _ref.onRequestClose,
13
18
  className = _ref.className,
@@ -18,7 +23,7 @@ export var ModalCloseButton = function ModalCloseButton(_ref) {
18
23
  _ref$closeLabel = _ref.closeLabel,
19
24
  closeLabel = _ref$closeLabel === void 0 ? 'Close' : _ref$closeLabel,
20
25
  rest = _objectWithoutProperties(_ref, _excluded);
21
- return ___EmotionJSX(IconButton, _extends({
26
+ return _jsx(IconButton, _objectSpread({
22
27
  disableOverlay: true,
23
28
  disableTooltip: true,
24
29
  hoverColor: theme.colors.secondary.main,
@@ -35,8 +35,8 @@ export declare const defaultProps: {
35
35
  };
36
36
  zIndex: number;
37
37
  renderWhenClosed: boolean;
38
- backdrop: "lowEmphasis" | "mediumEmphasis" | "highEmphasis";
38
+ backdrop: Backdrop;
39
39
  backdropVariant: BackdropVariant;
40
40
  };
41
- declare const ModalDialog: ({ isOpen, onRequestClose, shouldCloseOnOverlayClick, shouldCloseOnEsc, variation, zIndex, className, sizes, fixedTopPosition, renderWhenClosed, backdrop, backdropVariant, children, ...rest }: ModalDialogProps) => JSX.Element | null;
41
+ declare const ModalDialog: ({ isOpen, onRequestClose, shouldCloseOnOverlayClick, shouldCloseOnEsc, variation, zIndex, className, sizes, fixedTopPosition, renderWhenClosed, backdrop, backdropVariant, children, ...rest }: ModalDialogProps) => React.JSX.Element | null;
42
42
  export default ModalDialog;