@elliemae/ds-dialog 2.2.1 → 2.3.0-alpha.4

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 (43) hide show
  1. package/cjs/DSDialog.js +82 -102
  2. package/cjs/DSDialog.js.map +7 -0
  3. package/cjs/DSDialogDatatestid.js +36 -8
  4. package/cjs/DSDialogDatatestid.js.map +7 -0
  5. package/cjs/DSDialogInternalTypes.js +27 -2
  6. package/cjs/DSDialogInternalTypes.js.map +7 -0
  7. package/cjs/DSDialogTypes.js +27 -2
  8. package/cjs/DSDialogTypes.js.map +7 -0
  9. package/cjs/defaultProps.js +38 -11
  10. package/cjs/defaultProps.js.map +7 -0
  11. package/cjs/index.js +94 -24
  12. package/cjs/index.js.map +7 -0
  13. package/cjs/propTypes.js +44 -16
  14. package/cjs/propTypes.js.map +7 -0
  15. package/cjs/styles.js +149 -143
  16. package/cjs/styles.js.map +7 -0
  17. package/cjs/utils.js +50 -30
  18. package/cjs/utils.js.map +7 -0
  19. package/esm/DSDialog.js +50 -82
  20. package/esm/DSDialog.js.map +7 -0
  21. package/esm/DSDialogDatatestid.js +7 -4
  22. package/esm/DSDialogDatatestid.js.map +7 -0
  23. package/esm/DSDialogInternalTypes.js +2 -1
  24. package/esm/DSDialogInternalTypes.js.map +7 -0
  25. package/esm/DSDialogTypes.js +2 -1
  26. package/esm/DSDialogTypes.js.map +7 -0
  27. package/esm/defaultProps.js +8 -6
  28. package/esm/defaultProps.js.map +7 -0
  29. package/esm/index.js +75 -4
  30. package/esm/index.js.map +7 -0
  31. package/esm/propTypes.js +15 -12
  32. package/esm/propTypes.js.map +7 -0
  33. package/esm/styles.js +120 -123
  34. package/esm/styles.js.map +7 -0
  35. package/esm/utils.js +21 -23
  36. package/esm/utils.js.map +7 -0
  37. package/package.json +3 -3
  38. package/types/DSDialog.d.ts +2 -27
  39. package/types/DSDialogInternalTypes.d.ts +4 -4
  40. package/types/index.d.ts +49 -1
  41. package/types/propTypes.d.ts +2 -19
  42. package/types/styles.d.ts +4 -4
  43. package/types/utils.d.ts +6 -6
package/cjs/propTypes.js CHANGED
@@ -1,18 +1,46 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
- var utils = require('./utils.js');
7
-
8
- /* eslint-disable max-len */
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var propTypes_exports = {};
29
+ __export(propTypes_exports, {
30
+ propTypes: () => propTypes
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
34
+ var import_utils = require("./utils");
9
35
  const propTypes = {
10
- isOpen: reactDesc.PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),
11
- children: reactDesc.PropTypes.node.description('Nested components.').isRequired,
12
- centered: reactDesc.PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
13
- size: reactDesc.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT),
14
- removeAutoFocus: reactDesc.PropTypes.bool.description('Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.').defaultValue(false),
15
- onClickOutside: reactDesc.PropTypes.func.description('Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.').defaultValue(() => {})
36
+ isOpen: import_ds_props_helpers.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
37
+ children: import_ds_props_helpers.PropTypes.node.description("Nested components.").isRequired,
38
+ centered: import_ds_props_helpers.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
39
+ removeAutoFocus: import_ds_props_helpers.PropTypes.bool.description("Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.").defaultValue(false),
40
+ onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.").defaultValue(() => {
41
+ }),
42
+ ...import_ds_props_helpers.globalAttributesPropTypes,
43
+ size: import_ds_props_helpers.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT)
16
44
  };
17
-
18
- exports.propTypes = propTypes;
45
+ module.exports = __toCommonJS(propTypes_exports);
46
+ //# sourceMappingURL=propTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { WeakValidationMap } from 'react';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n ...globalAttributesPropTypes,\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAqD;AAErD,mBAAwD;AAEjD,MAAM,YAAY;AAAA,EACvB,QAAQ,kCAAU,KAAK,YAAY,sCAAsC,aAAa;AAAA,EACtF,UAAU,kCAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,kCAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,iBAAiB,kCAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,kCAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA,KACnB;AAAA,EACH,MAAM,kCAAU,MAAM,uCACnB,YAAY,wBACZ,aAAa,2BAAc;AAAA;",
6
+ "names": []
7
+ }
package/cjs/styles.js CHANGED
@@ -1,145 +1,151 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
- var styled = require('styled-components');
7
- var dsSystem = require('@elliemae/ds-system');
8
- var styledComponents = require('@xstyled/styled-components');
9
- var utils = require('./utils.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
14
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
15
-
16
- var _templateObject;
17
- const FixedBody = dsSystem.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n body {\n overflow: hidden;\n \n ", "\n }\n"])), _ref => {
18
- let {
19
- bodyInfo
20
- } = _ref;
21
- return bodyInfo.overflow ? "padding-right: calc( ".concat(bodyInfo.padding, " + 15px ) !important;") : "";
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var styles_exports = {};
29
+ __export(styles_exports, {
30
+ DSDialogAddon: () => DSDialogAddon,
31
+ DSDialogBody: () => DSDialogBody,
32
+ DSDialogDefaultLayout: () => DSDialogDefaultLayout,
33
+ DSDialogFooter: () => DSDialogFooter,
34
+ DSDialogHeader: () => DSDialogHeader,
35
+ DSDialogPrimaryMessage: () => DSDialogPrimaryMessage,
36
+ DSDialogSecondaryMessage: () => DSDialogSecondaryMessage,
37
+ DSDialogSeparator: () => DSDialogSeparator,
38
+ DSDialogTitle: () => DSDialogTitle,
39
+ FixedBody: () => FixedBody,
40
+ StyledDialogBackground: () => StyledDialogBackground,
41
+ StyledDialogContainer: () => StyledDialogContainer
22
42
  });
23
- const StyledDialogBackground = /*#__PURE__*/styled__default["default"].div.withConfig({
24
- componentId: "sc-106vqwv-0"
25
- })(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;z-index:", ";"], _ref2 => {
26
- let {
27
- zIndex
28
- } = _ref2;
29
- return zIndex;
30
- });
31
- const StyledDialogContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
32
- componentId: "sc-106vqwv-1"
33
- })(["height:fit-content;position:absolute;top:0;bottom:0;left:0;right:0;margin:", ";width:", ";min-width:300px;box-shadow:0 10px 20px 0 ", ";background:", ";overflow-y:auto;", " &:focus{outline:none;}"], _ref3 => {
34
- let {
35
- centered
36
- } = _ref3;
37
- return centered ? 'auto' : '20vh auto auto auto';
38
- }, _ref4 => {
39
- let {
40
- size
41
- } = _ref4;
42
- return utils.allSizes[size];
43
- }, _ref5 => {
44
- let {
45
- theme
46
- } = _ref5;
47
- return theme.colors.neutral[500];
48
- }, _ref6 => {
49
- let {
50
- theme
51
- } = _ref6;
52
- return theme.colors.neutral['000'];
53
- }, styledComponents.space);
54
- const DSDialogTitle = /*#__PURE__*/styled__default["default"].h3.withConfig({
55
- componentId: "sc-106vqwv-2"
56
- })(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref7 => {
57
- let {
58
- theme
59
- } = _ref7;
60
- return theme.fontSizes.title[700];
61
- });
62
- const DSDialogAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
63
- componentId: "sc-106vqwv-3"
64
- })([""]);
65
- const DSDialogHeader = /*#__PURE__*/styled__default["default"].div.withConfig({
66
- componentId: "sc-106vqwv-4"
67
- })(["display:grid;align-items:center;grid-auto-flow:column;min-height:", ";padding:10px ", ";& ", " + ", "{align-self:flex-start;justify-self:flex-end;}& ", ":only-child{justify-self:flex-end;}", ""], _ref8 => {
68
- let {
69
- theme
70
- } = _ref8;
71
- return theme.space.m;
72
- }, _ref9 => {
73
- let {
74
- theme
75
- } = _ref9;
76
- return theme.space.xs;
77
- }, DSDialogTitle, DSDialogAddon, DSDialogAddon, styledComponents.space);
78
- const DSDialogSeparator = /*#__PURE__*/styled__default["default"].hr.attrs(() => ({
79
- 'aria-hidden': true
80
- })).withConfig({
81
- componentId: "sc-106vqwv-5"
82
- })(["margin:0;border-top:1px solid ", ";"], _ref10 => {
83
- let {
84
- theme
85
- } = _ref10;
86
- return theme.colors.neutral['080'];
87
- });
88
- const DSDialogBody = /*#__PURE__*/styled__default["default"].div.withConfig({
89
- componentId: "sc-106vqwv-6"
90
- })(["padding:", ";overflow-y:auto;", " ", " ", " ", ""], _ref11 => {
91
- let {
92
- theme
93
- } = _ref11;
94
- return theme.space.xs;
95
- }, styledComponents.layout, styledComponents.space, styledComponents.flexboxes, styledComponents.sizing);
96
- const DSDialogPrimaryMessage = /*#__PURE__*/styled__default["default"].h3.withConfig({
97
- componentId: "sc-106vqwv-7"
98
- })(["margin:0;"]);
99
- const DSDialogSecondaryMessage = /*#__PURE__*/styled__default["default"].p.withConfig({
100
- componentId: "sc-106vqwv-8"
101
- })(["margin:0;color:", ";"], _ref12 => {
102
- let {
103
- theme
104
- } = _ref12;
105
- return theme.colors.neutral[500];
106
- });
107
- const DSDialogDefaultLayout = /*#__PURE__*/styled__default["default"].div.withConfig({
108
- componentId: "sc-106vqwv-9"
109
- })(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref13 => {
110
- let {
111
- theme
112
- } = _ref13;
113
- return theme.space.xxs;
114
- }, DSDialogSecondaryMessage);
115
- const DSDialogFooter = /*#__PURE__*/styled__default["default"].div.withConfig({
116
- componentId: "sc-106vqwv-10"
117
- })(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", " ", ""], _ref14 => {
118
- let {
119
- theme
120
- } = _ref14;
121
- return theme.space.xxs;
122
- }, _ref15 => {
123
- let {
124
- theme
125
- } = _ref15;
126
- return theme.space.m;
127
- }, _ref16 => {
128
- let {
129
- theme
130
- } = _ref16;
131
- return theme.space.xs;
132
- }, styledComponents.space, styledComponents.flexboxes, styledComponents.sizing);
43
+ var React = __toESM(require("react"));
44
+ var import_styled_components = __toESM(require("styled-components"));
45
+ var import_ds_system = require("@elliemae/ds-system");
46
+ var import_styled_components2 = require("@xstyled/styled-components");
47
+ var import_utils = require("./utils");
48
+ const FixedBody = import_ds_system.createGlobalStyle`
49
+ body {
50
+ overflow: hidden;
51
+
52
+ ${({ bodyInfo }) => bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``}
53
+ }
54
+ `;
55
+ const StyledDialogBackground = import_styled_components.default.div`
56
+ position: fixed;
57
+ top: 0;
58
+ bottom: 0;
59
+ width: 100%;
60
+ height: 100%;
61
+ background: rgba(37, 41, 47, 50%);
62
+ overflow-y: auto;
63
+ z-index: ${({ zIndex }) => zIndex};
64
+ `;
65
+ const StyledDialogContainer = import_styled_components.default.div`
66
+ height: fit-content;
67
+ position: absolute;
68
+ top: 0;
69
+ bottom: 0;
70
+ left: 0;
71
+ right: 0;
72
+ margin: ${({ centered }) => centered ? "auto" : "20vh auto auto auto"};
73
+ width: ${({ size }) => import_utils.allSizes[size]};
74
+ min-width: 300px;
75
+ box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};
76
+ background: ${({ theme }) => theme.colors.neutral["000"]};
77
+ overflow-y: auto;
78
+ ${import_styled_components2.space}
79
+ &:focus {
80
+ outline: none;
81
+ }
82
+ `;
83
+ const DSDialogTitle = import_styled_components.default.h3`
84
+ font-size: ${({ theme }) => theme.fontSizes.title[700]};
85
+ display: -webkit-box;
86
+ -webkit-line-clamp: 2;
87
+ -webkit-box-orient: vertical;
88
+ overflow: hidden;
89
+ margin: 0;
90
+ `;
91
+ const DSDialogAddon = import_styled_components.default.div``;
92
+ const DSDialogHeader = import_styled_components.default.div`
93
+ display: grid;
94
+ align-items: center;
95
+ grid-auto-flow: column;
96
+ min-height: ${({ theme }) => theme.space.m};
97
+ padding: 10px ${({ theme }) => theme.space.xs};
98
+ & ${DSDialogTitle} + ${DSDialogAddon} {
99
+ align-self: flex-start;
100
+ justify-self: flex-end;
101
+ }
102
+ & ${DSDialogAddon}:only-child {
103
+ justify-self: flex-end;
104
+ }
105
+ ${import_styled_components2.space}
106
+ `;
107
+ const DSDialogSeparator = import_styled_components.default.hr.attrs(() => ({ "aria-hidden": true }))`
108
+ margin: 0;
109
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral["080"]};
110
+ `;
111
+ const DSDialogBody = import_styled_components.default.div`
112
+ padding: ${({ theme }) => theme.space.xs};
113
+ overflow-y: auto;
114
+
115
+ ${import_styled_components2.layout}
116
+ ${import_styled_components2.space}
117
+ ${import_styled_components2.flexboxes}
118
+ ${import_styled_components2.sizing}
119
+ `;
120
+ const DSDialogPrimaryMessage = import_styled_components.default.h3`
121
+ margin: 0;
122
+ `;
123
+ const DSDialogSecondaryMessage = import_styled_components.default.p`
124
+ margin: 0;
125
+ color: ${({ theme }) => theme.colors.neutral[500]};
126
+ `;
127
+ const DSDialogDefaultLayout = import_styled_components.default.div`
128
+ display: grid;
129
+ grid-auto-flow: row;
130
+ justify-items: center;
131
+ align-items: center;
132
+ grid-gap: ${({ theme }) => theme.space.xxs};
133
133
 
134
- exports.DSDialogAddon = DSDialogAddon;
135
- exports.DSDialogBody = DSDialogBody;
136
- exports.DSDialogDefaultLayout = DSDialogDefaultLayout;
137
- exports.DSDialogFooter = DSDialogFooter;
138
- exports.DSDialogHeader = DSDialogHeader;
139
- exports.DSDialogPrimaryMessage = DSDialogPrimaryMessage;
140
- exports.DSDialogSecondaryMessage = DSDialogSecondaryMessage;
141
- exports.DSDialogSeparator = DSDialogSeparator;
142
- exports.DSDialogTitle = DSDialogTitle;
143
- exports.FixedBody = FixedBody;
144
- exports.StyledDialogBackground = StyledDialogBackground;
145
- exports.StyledDialogContainer = StyledDialogContainer;
134
+ ${DSDialogSecondaryMessage} {
135
+ text-align: center;
136
+ }
137
+ `;
138
+ const DSDialogFooter = import_styled_components.default.div`
139
+ display: grid;
140
+ grid-auto-flow: column;
141
+ align-items: center;
142
+ justify-content: flex-end;
143
+ grid-gap: ${({ theme }) => theme.space.xxs};
144
+ min-height: ${({ theme }) => theme.space.m};
145
+ padding: 0 ${({ theme }) => theme.space.xs};
146
+ ${import_styled_components2.space}
147
+ ${import_styled_components2.flexboxes}
148
+ ${import_styled_components2.sizing}
149
+ `;
150
+ module.exports = __toCommonJS(styles_exports);
151
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport type { StyledDialogContainerT, StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<FixedBodyT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex }) => zIndex};\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerPropsT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: auto;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n\n ${layout}\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAGlB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,sBAAS;AAAA;AAAA,8BAEJ,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA,gBAClD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA,IAEhD;AAAA;AAAA;AAAA;AAAA;AAMG,MAAM,gBAAgB,iCAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ7C,MAAM,gBAAgB,iCAAO;AAE7B,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA;AAAA,gBAIrB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,iCAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,iCAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAKvB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA;",
6
+ "names": []
7
+ }
package/cjs/utils.js CHANGED
@@ -1,35 +1,55 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.filter.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.filter.js');
8
- require('core-js/modules/web.dom-collections.iterator.js');
9
-
10
- const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_ref => {
11
- let [key] = _ref;
12
- return /^[pm][xytblr]?$/.exec(key);
13
- }));
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var utils_exports = {};
29
+ __export(utils_exports, {
30
+ DSDialogSizes: () => DSDialogSizes,
31
+ DSDialogSizesArrayValues: () => DSDialogSizesArrayValues,
32
+ allSizes: () => allSizes,
33
+ getSpaceProps: () => getSpaceProps
34
+ });
35
+ var React = __toESM(require("react"));
36
+ const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
14
37
  const DSDialogSizes = {
15
- DEFAULT: 'default',
16
- SMALL: 'small',
17
- MEDIUM: 'medium',
18
- LARGE: 'large',
19
- XLARGE: 'x-large',
20
- XXLARGE: 'xx-large'
38
+ DEFAULT: "default",
39
+ SMALL: "small",
40
+ MEDIUM: "medium",
41
+ LARGE: "large",
42
+ XLARGE: "x-large",
43
+ XXLARGE: "xx-large"
21
44
  };
22
45
  const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
23
46
  const allSizes = {
24
- default: '576px',
25
- small: '320px',
26
- medium: '656px',
27
- large: '848px',
28
- 'x-large': '1042px',
29
- 'xx-large': '1440px'
47
+ default: "576px",
48
+ small: "320px",
49
+ medium: "656px",
50
+ large: "848px",
51
+ "x-large": "1042px",
52
+ "xx-large": "1440px"
30
53
  };
31
-
32
- exports.DSDialogSizes = DSDialogSizes;
33
- exports.DSDialogSizesArrayValues = DSDialogSizesArrayValues;
34
- exports.allSizes = allSizes;
35
- exports.getSpaceProps = getSpaceProps;
54
+ module.exports = __toCommonJS(utils_exports);
55
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n\nexport const DSDialogSizes = {\n DEFAULT: 'default' as const,\n SMALL: 'small' as const,\n MEDIUM: 'medium' as const,\n LARGE: 'large' as const,\n XLARGE: 'x-large' as const,\n XXLARGE: 'xx-large' as const,\n};\n\nexport const DSDialogSizesArrayValues = Object.values(DSDialogSizes);\n\nexport const allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,gBAAgB,CAAC,UAC5B,OAAO,YAAY,OAAO,QAAQ,OAAO,OAAO,CAAC,CAAC,SAAS,kBAAkB,KAAK;AAE7E,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA;AAGJ,MAAM,2BAA2B,OAAO,OAAO;AAE/C,MAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA;",
6
+ "names": []
7
+ }