@stenajs-webui/modal 19.0.0-next.13 → 19.0.0-next.15

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.
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { ReactNode } from "react";
3
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
4
+ export interface DrawerHeaderProps {
5
+ onRequestClose: () => void;
6
+ header?: string;
7
+ contentRight?: ReactNode;
8
+ icon?: IconDefinition;
9
+ }
10
+ export declare const DrawerHeader: React.FC<DrawerHeaderProps>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./components/modal/BaseModal";
2
2
  export * from "./components/drawer/Drawer";
3
+ export * from "./components/drawer/DrawerHeader";
3
4
  export * from "./components/center-modal/CenterModal";
4
5
  export * from "./components/loading-modal/LoadingModal";
5
6
  export * from "./components/modal/Modal";
package/dist/index.es.js CHANGED
@@ -1,38 +1,39 @@
1
1
  (function(){"use strict";try{var t=document.createElement("style");t.appendChild(document.createTextNode("._overlay_5x3op_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;-webkit-animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both;animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1{background-color:#fff}}._overlay_5x3op_1 ._modal_5x3op_31{max-width:100%;outline:none;pointer-events:none}@media (max-width: 768px){._overlay_5x3op_1 ._modal_5x3op_31{width:100%}}._overlay_5x3op_1 ._content_5x3op_41{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);pointer-events:all;top:calc(var(--swui-metrics-space) * 2);width:var(--swui-modal-width);max-width:var(--swui-modal-max-width)}@media (max-width: 768px){._overlay_5x3op_1 ._content_5x3op_41{top:0;width:100%;max-width:100%}}._overlay_5x3op_1 ._content_5x3op_41{-webkit-animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both;animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1 ._content_5x3op_41{box-shadow:none;top:0}}._overlay_5x3op_1 ._content_5x3op_41 :focus{outline:0}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle{cursor:move}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle .draggable-modal-cancel,._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle [role=tooltip]{cursor:initial}@-webkit-keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@-webkit-keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}@keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}._footer_5x3op_101{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_5x3op_105{position:-webkit-sticky;position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_5x3op_105{position:static;box-shadow:none}}._portal_9t5bd_1{--drawer-width: 370px}._portal_9t5bd_1 ._overlay_9t5bd_4{position:fixed;inset:0}._portal_9t5bd_1 ._content_9t5bd_9{box-shadow:var(--swui-shadow-modal);background:white;position:absolute;transition:-webkit-transform var(--swui-animation-time-medium) ease-in-out;transition:transform var(--swui-animation-time-medium) ease-in-out;transition:transform var(--swui-animation-time-medium) ease-in-out,-webkit-transform var(--swui-animation-time-medium) ease-in-out}._portal_9t5bd_1 ._content_9t5bd_9._floating_9t5bd_15{margin:var(--swui-metrics-space);border-radius:var(--swui-border-radius)}._portal_9t5bd_1 ._content_9t5bd_9:focus-visible{outline:unset}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25{-webkit-transform:translateX(var(--translate-x-outside-screen, 0));transform:translate(var(--translate-x-outside-screen, 0));overflow-y:auto;top:0;bottom:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24._afterOpen_9t5bd_31,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25._afterOpen_9t5bd_31{-webkit-transform:translateX(0);transform:translate(0)}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24._beforeClose_9t5bd_35,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25._beforeClose_9t5bd_35{-webkit-transform:translateX(var(--translate-x-outside-screen));transform:translate(var(--translate-x-outside-screen))}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41{-webkit-transform:translateY(var(--translate-y-outside-screen, 0));transform:translateY(var(--translate-y-outside-screen, 0));overflow-x:auto;left:0;right:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40._afterOpen_9t5bd_31,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41._afterOpen_9t5bd_31{-webkit-transform:translateY(0);transform:translateY(0)}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40._beforeClose_9t5bd_35,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41._beforeClose_9t5bd_35{-webkit-transform:translateY(var(--translate-y-outside-screen));transform:translateY(var(--translate-y-outside-screen))}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24{--translate-x-outside-screen: -100%;width:var(--drawer-width);left:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25{--translate-x-outside-screen: 100%;width:var(--drawer-width);right:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40{--translate-y-outside-screen: -100%;height:var(--drawer-width);top:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41{--translate-y-outside-screen: 100%;height:var(--drawer-width);bottom:0}._modal_4fwgb_1{display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;right:0;bottom:0;background-color:transparent}._overlay_4fwgb_13{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--swui-overlay-bg-color)}")),document.head.appendChild(t)}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { jsx as e, jsxs as c, Fragment as h } from "react/jsx-runtime";
3
- import _ from "react-modal";
4
- import w from "react-draggable";
5
- import b from "classnames";
6
- import { exhaustSwitchCase as x, Column as u, Box as m, Spacing as S, Row as g, Indent as A, Heading as B, Txt as L } from "@stenajs-webui/core";
7
- import { Spinner as M, Icon as D, FlatButton as I, stenaTimes as O } from "@stenajs-webui/elements";
8
- const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E = "_content_5x3op_41", j = "_appear_5x3op_1", G = "_isDraggable_5x3op_70", z = "_footer_5x3op_101", H = "_stickyFooter_5x3op_105", n = {
9
- overlay: R,
10
- fadeIn: $,
11
- modal: k,
12
- content: E,
13
- appear: j,
14
- isDraggable: G,
15
- footer: z,
16
- stickyFooter: H
17
- }, v = "draggable-modal-handle", F = "draggable-modal-cancel", T = ({
2
+ import { jsx as e, jsxs as l, Fragment as b } from "react/jsx-runtime";
3
+ import p from "react-modal";
4
+ import D from "react-draggable";
5
+ import h from "classnames";
6
+ import { exhaustSwitchCase as L, Spacing as v, Row as c, Space as y, Heading as C, Column as F, Box as _, Indent as M, Txt as k } from "@stenajs-webui/core";
7
+ import { Icon as w, FlatButton as x, stenaTimes as N, Spinner as O } from "@stenajs-webui/elements";
8
+ import { cssColor as R } from "@stenajs-webui/theme";
9
+ const $ = "_overlay_5x3op_1", E = "_fadeIn_5x3op_1", j = "_modal_5x3op_31", z = "_content_5x3op_41", G = "_appear_5x3op_1", H = "_isDraggable_5x3op_70", T = "_footer_5x3op_101", J = "_stickyFooter_5x3op_105", s = {
10
+ overlay: $,
11
+ fadeIn: E,
12
+ modal: j,
13
+ content: z,
14
+ appear: G,
15
+ isDraggable: H,
16
+ footer: T,
17
+ stickyFooter: J
18
+ }, S = "draggable-modal-handle", I = "draggable-modal-cancel", K = ({
18
19
  width: o,
19
20
  maxWidth: t,
20
- draggable: l = !1,
21
+ draggable: n = !1,
21
22
  children: r,
22
- ...s
23
+ ...i
23
24
  }) => /* @__PURE__ */ e(
24
- _,
25
+ p,
25
26
  {
26
- overlayClassName: n.overlay,
27
- className: n.modal,
28
- ...s,
27
+ overlayClassName: s.overlay,
28
+ className: s.modal,
29
+ ...i,
29
30
  children: /* @__PURE__ */ e(
30
- w,
31
+ D,
31
32
  {
32
- handle: `.${v}`,
33
- cancel: `.${F}, button, [role="tooltip"]`,
33
+ handle: `.${S}`,
34
+ cancel: `.${I}, button, [role="tooltip"]`,
34
35
  bounds: ".ReactModal__Overlay",
35
- disabled: !l,
36
+ disabled: !n,
36
37
  children: /* @__PURE__ */ e(
37
38
  "div",
38
39
  {
@@ -40,8 +41,8 @@ const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E =
40
41
  ["--swui-modal-width"]: o,
41
42
  ["--swui-modal-max-width"]: t
42
43
  },
43
- className: b(n.content, {
44
- [n.isDraggable]: l
44
+ className: h(s.content, {
45
+ [s.isDraggable]: n
45
46
  }),
46
47
  children: r
47
48
  }
@@ -49,29 +50,29 @@ const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E =
49
50
  }
50
51
  )
51
52
  }
52
- ), J = "_portal_9t5bd_1", K = "_overlay_9t5bd_4", Q = "_content_9t5bd_9", U = "_floating_9t5bd_15", V = "_slideFromLeft_9t5bd_24", W = "_slideFromRight_9t5bd_25", X = "_afterOpen_9t5bd_31", Y = "_beforeClose_9t5bd_35", Z = "_slideFromTop_9t5bd_40", q = "_slideFromBottom_9t5bd_41", a = {
53
- portal: J,
54
- overlay: K,
55
- content: Q,
56
- floating: U,
57
- slideFromLeft: V,
58
- slideFromRight: W,
59
- afterOpen: X,
60
- beforeClose: Y,
61
- slideFromTop: Z,
62
- slideFromBottom: q
63
- }, _e = ({
53
+ ), Q = "_portal_9t5bd_1", U = "_overlay_9t5bd_4", V = "_content_9t5bd_9", W = "_floating_9t5bd_15", X = "_slideFromLeft_9t5bd_24", Y = "_slideFromRight_9t5bd_25", Z = "_afterOpen_9t5bd_31", q = "_beforeClose_9t5bd_35", P = "_slideFromTop_9t5bd_40", ee = "_slideFromBottom_9t5bd_41", a = {
54
+ portal: Q,
55
+ overlay: U,
56
+ content: V,
57
+ floating: W,
58
+ slideFromLeft: X,
59
+ slideFromRight: Y,
60
+ afterOpen: Z,
61
+ beforeClose: q,
62
+ slideFromTop: P,
63
+ slideFromBottom: ee
64
+ }, ge = ({
64
65
  background: o,
65
66
  zIndex: t,
66
- children: l,
67
+ children: n,
67
68
  slideFrom: r = "left",
68
- portalTarget: s,
69
- floating: p,
70
- ...i
69
+ portalTarget: i,
70
+ floating: f,
71
+ ...d
71
72
  }) => {
72
- const { height: f, width: d } = i;
73
+ const { height: g, width: m } = d;
73
74
  return /* @__PURE__ */ e(
74
- _,
75
+ p,
75
76
  {
76
77
  closeTimeoutMS: 250,
77
78
  portalClassName: a.portal,
@@ -81,21 +82,21 @@ const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E =
81
82
  beforeClose: a.beforeClose
82
83
  },
83
84
  className: {
84
- base: b(
85
+ base: h(
85
86
  a.content,
86
- P(r),
87
- p && a.floating
87
+ oe(r),
88
+ f && a.floating
88
89
  ),
89
90
  afterOpen: a.afterOpen,
90
91
  beforeClose: a.beforeClose
91
92
  },
92
- style: { content: { width: d, height: f, background: o }, overlay: { zIndex: t } },
93
- parentSelector: s ? () => s : void 0,
94
- ...i,
95
- children: l
93
+ style: { content: { width: m, height: g, background: o }, overlay: { zIndex: t } },
94
+ parentSelector: i ? () => i : void 0,
95
+ ...d,
96
+ children: n
96
97
  }
97
98
  );
98
- }, P = (o) => {
99
+ }, oe = (o) => {
99
100
  switch (o) {
100
101
  case "left":
101
102
  return a.slideFromLeft;
@@ -106,44 +107,84 @@ const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E =
106
107
  case "bottom":
107
108
  return a.slideFromBottom;
108
109
  default:
109
- return x(o, a.slideFromLeft);
110
+ return L(o, a.slideFromLeft);
111
+ }
112
+ }, he = ({
113
+ header: o,
114
+ contentRight: t,
115
+ onRequestClose: n,
116
+ icon: r
117
+ }) => /* @__PURE__ */ e(
118
+ v,
119
+ {
120
+ position: "sticky",
121
+ top: 0,
122
+ zIndex: 100,
123
+ background: R("--lhds-color-ui-50"),
124
+ children: /* @__PURE__ */ l(
125
+ c,
126
+ {
127
+ justifyContent: "space-between",
128
+ alignItems: "center",
129
+ height: "48px",
130
+ children: [
131
+ /* @__PURE__ */ l(c, { alignItems: "center", gap: 2, children: [
132
+ /* @__PURE__ */ e(y, { num: 1 }),
133
+ r && /* @__PURE__ */ e(w, { icon: r, size: 24 }),
134
+ /* @__PURE__ */ e(C, { variant: "h4", children: o })
135
+ ] }),
136
+ /* @__PURE__ */ l(c, { gap: 1, children: [
137
+ t,
138
+ /* @__PURE__ */ e(
139
+ x,
140
+ {
141
+ leftIcon: N,
142
+ onClick: n,
143
+ variant: "danger"
144
+ }
145
+ ),
146
+ /* @__PURE__ */ e(y, { num: 0.5 })
147
+ ] })
148
+ ]
149
+ }
150
+ )
110
151
  }
111
- }, ee = { overlay: { justifyContent: "center" } }, pe = ({
152
+ ), te = { overlay: { justifyContent: "center" } }, be = ({
112
153
  children: o,
113
154
  ...t
114
155
  }) => /* @__PURE__ */ e(
115
- _,
156
+ p,
116
157
  {
117
- overlayClassName: n.overlay,
118
- className: n.modal,
119
- style: ee,
158
+ overlayClassName: s.overlay,
159
+ className: s.modal,
160
+ style: te,
120
161
  ...t,
121
162
  children: /* @__PURE__ */ e(
122
163
  "div",
123
164
  {
124
- className: n.content,
165
+ className: s.content,
125
166
  style: { ["--swui-modal-width"]: "fit-content" },
126
167
  children: o
127
168
  }
128
169
  )
129
170
  }
130
- ), oe = "_modal_4fwgb_1", te = "_overlay_4fwgb_13", y = {
131
- modal: oe,
132
- overlay: te
133
- }, fe = ({
171
+ ), ne = "_modal_4fwgb_1", ae = "_overlay_4fwgb_13", u = {
172
+ modal: ne,
173
+ overlay: ae
174
+ }, ye = ({
134
175
  headerIconLeft: o,
135
176
  headerText: t,
136
- ...l
177
+ ...n
137
178
  }) => /* @__PURE__ */ e(
138
- _,
179
+ p,
139
180
  {
140
- ...l,
181
+ ...n,
141
182
  isOpen: !0,
142
- className: y.modal,
143
- overlayClassName: y.overlay,
144
- children: /* @__PURE__ */ c(u, { spacing: 2, alignItems: "center", children: [
183
+ className: u.modal,
184
+ overlayClassName: u.overlay,
185
+ children: /* @__PURE__ */ l(F, { spacing: 2, alignItems: "center", children: [
145
186
  /* @__PURE__ */ e(
146
- m,
187
+ _,
147
188
  {
148
189
  alignItems: "center",
149
190
  justifyContent: "center",
@@ -152,91 +193,92 @@ const R = "_overlay_5x3op_1", $ = "_fadeIn_5x3op_1", k = "_modal_5x3op_31", E =
152
193
  borderRadius: "50%",
153
194
  background: "white",
154
195
  shadow: "modal",
155
- children: /* @__PURE__ */ e(M, { size: "small" })
196
+ children: /* @__PURE__ */ e(O, { size: "small" })
156
197
  }
157
198
  ),
158
- (o || t) && /* @__PURE__ */ c(h, { children: [
159
- /* @__PURE__ */ e(S, {}),
160
- /* @__PURE__ */ c(g, { indent: 2, children: [
161
- o && /* @__PURE__ */ c(h, { children: [
162
- /* @__PURE__ */ e(D, { size: 14, icon: o, color: "white" }),
163
- /* @__PURE__ */ e(A, {})
199
+ (o || t) && /* @__PURE__ */ l(b, { children: [
200
+ /* @__PURE__ */ e(v, {}),
201
+ /* @__PURE__ */ l(c, { indent: 2, children: [
202
+ o && /* @__PURE__ */ l(b, { children: [
203
+ /* @__PURE__ */ e(w, { size: 14, icon: o, color: "white" }),
204
+ /* @__PURE__ */ e(M, {})
164
205
  ] }),
165
- t && /* @__PURE__ */ e(B, { variant: "h4", color: "white", children: t })
206
+ t && /* @__PURE__ */ e(C, { variant: "h4", color: "white", children: t })
166
207
  ] })
167
208
  ] })
168
209
  ] })
169
210
  }
170
- ), ae = ({
211
+ ), re = ({
171
212
  onRequestClose: o,
172
213
  header: t,
173
- headerText: l,
214
+ headerText: n,
174
215
  closeButtonClassName: r
175
- }) => /* @__PURE__ */ c(
176
- g,
216
+ }) => /* @__PURE__ */ l(
217
+ c,
177
218
  {
178
219
  spacing: 2,
179
220
  indent: 2,
180
221
  borderBottom: "1px solid var(--swui-modal-header-border-color)",
181
- className: v,
222
+ className: S,
182
223
  children: [
183
- /* @__PURE__ */ c(g, { flex: 1, indent: !0, alignItems: "center", children: [
184
- l && /* @__PURE__ */ e(L, { className: F, size: "large", children: l }),
224
+ /* @__PURE__ */ l(c, { flex: 1, indent: !0, alignItems: "center", children: [
225
+ n && /* @__PURE__ */ e(k, { className: I, size: "large", children: n }),
185
226
  t
186
227
  ] }),
187
- /* @__PURE__ */ e(m, { alignSelf: "flex-start", children: /* @__PURE__ */ e(
188
- I,
228
+ /* @__PURE__ */ e(_, { alignSelf: "flex-start", children: /* @__PURE__ */ e(
229
+ x,
189
230
  {
190
231
  className: r,
191
232
  onClick: o,
192
233
  "aria-label": "Close",
193
- leftIcon: O
234
+ leftIcon: N
194
235
  }
195
236
  ) })
196
237
  ]
197
238
  }
198
- ), ge = ({
239
+ ), ue = ({
199
240
  header: o,
200
241
  headerText: t,
201
- children: l,
242
+ children: n,
202
243
  spacing: r,
203
- indent: s,
204
- draggable: p = !1,
205
- onRequestClose: i,
206
- closeButtonClassName: f,
207
- footer: d,
208
- disableStickyFooter: C = !1,
209
- ...N
210
- }) => /* @__PURE__ */ c(T, { ...N, onRequestClose: i, draggable: p, children: [
244
+ indent: i,
245
+ draggable: f = !1,
246
+ onRequestClose: d,
247
+ closeButtonClassName: g,
248
+ footer: m,
249
+ disableStickyFooter: A = !1,
250
+ ...B
251
+ }) => /* @__PURE__ */ l(K, { ...B, onRequestClose: d, draggable: f, children: [
211
252
  /* @__PURE__ */ e(
212
- ae,
253
+ re,
213
254
  {
214
- onRequestClose: i,
255
+ onRequestClose: d,
215
256
  header: o,
216
257
  headerText: t,
217
- closeButtonClassName: f
258
+ closeButtonClassName: g
218
259
  }
219
260
  ),
220
- /* @__PURE__ */ e(m, { spacing: typeof r == "number" ? r : 1, indent: typeof s == "number" ? s : 1, children: l }),
221
- d && /* @__PURE__ */ e(
222
- m,
261
+ /* @__PURE__ */ e(_, { spacing: typeof r == "number" ? r : 1, indent: typeof i == "number" ? i : 1, children: n }),
262
+ m && /* @__PURE__ */ e(
263
+ _,
223
264
  {
224
- className: b(n.footer, {
225
- [n.stickyFooter]: !C
265
+ className: h(s.footer, {
266
+ [s.stickyFooter]: !A
226
267
  }),
227
- children: d
268
+ children: m
228
269
  }
229
270
  )
230
- ] }), be = ({ children: o }) => /* @__PURE__ */ e(u, { indent: 2, spacing: 2, children: o });
271
+ ] }), ve = ({ children: o }) => /* @__PURE__ */ e(F, { indent: 2, spacing: 2, children: o });
231
272
  export {
232
- T as BaseModal,
233
- pe as CenterModal,
234
- F as DRAGGABLE_CANCEL_CLASSNAME,
235
- v as DRAGGABLE_HANDLE_CLASSNAME,
236
- _e as Drawer,
237
- fe as LoadingModal,
238
- ge as Modal,
239
- be as ModalFooter,
240
- ae as ModalHeader
273
+ K as BaseModal,
274
+ be as CenterModal,
275
+ I as DRAGGABLE_CANCEL_CLASSNAME,
276
+ S as DRAGGABLE_HANDLE_CLASSNAME,
277
+ ge as Drawer,
278
+ he as DrawerHeader,
279
+ ye as LoadingModal,
280
+ ue as Modal,
281
+ ve as ModalFooter,
282
+ re as ModalHeader
241
283
  };
242
284
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/components/modal/BaseModal.tsx","../src/components/drawer/Drawer.tsx","../src/components/center-modal/CenterModal.tsx","../src/components/loading-modal/LoadingModal.tsx","../src/components/modal/ModalHeader.tsx","../src/components/modal/Modal.tsx","../src/components/modal/ModalFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport Draggable from \"react-draggable\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface BaseModalProps extends ReactModal.Props {\n width?: string;\n maxWidth?: string;\n onRequestClose?: () => void;\n draggable?: boolean;\n}\n\nexport const DRAGGABLE_HANDLE_CLASSNAME = \"draggable-modal-handle\";\nexport const DRAGGABLE_CANCEL_CLASSNAME = \"draggable-modal-cancel\";\n\nexport const BaseModal: React.FC<BaseModalProps> = ({\n width,\n maxWidth,\n draggable = false,\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n {...reactModalProps}\n >\n <Draggable\n handle={`.${DRAGGABLE_HANDLE_CLASSNAME}`}\n cancel={`.${DRAGGABLE_CANCEL_CLASSNAME}, button, [role=\"tooltip\"]`}\n bounds=\".ReactModal__Overlay\"\n disabled={!draggable}\n >\n <div\n style={{\n [\"--swui-modal-width\" as string]: width,\n [\"--swui-modal-max-width\" as string]: maxWidth,\n }}\n className={cx(styles.content, {\n [styles.isDraggable]: draggable,\n })}\n >\n {children}\n </div>\n </Draggable>\n </ReactModal>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport cx from \"classnames\";\nimport styles from \"./Drawer.module.css\";\nimport { exhaustSwitchCase, FlattenUnion } from \"@stenajs-webui/core\";\n\nexport type SlideFrom = SlideFromLeftRight | SlideFromTopBottom;\nexport type SlideFromLeftRight = \"left\" | \"right\";\nexport type SlideFromTopBottom = \"top\" | \"bottom\";\n\nexport type DrawerProps = DrawerBaseLeftRight | DrawerBaseTopBottom;\n\ninterface DrawerBaseLeftRight extends DrawerBaseProps {\n width?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('left'|'right')}\n */\n slideFrom?: SlideFromLeftRight;\n}\n\ninterface DrawerBaseTopBottom extends DrawerBaseProps {\n height?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('top'|'bottom')}\n */\n slideFrom?: SlideFromTopBottom;\n}\n\ninterface DrawerBaseProps\n extends Omit<\n ReactModal.Props,\n | \"closeTimeoutMS\"\n | \"portalClassName\"\n | \"overlayClassName\"\n | \"className\"\n | \"style\"\n | \"parentSelector\"\n > {\n background?: string;\n\n /**\n * When true, there will be a gap between the drawer and the viewport.\n */\n floating?: boolean;\n\n zIndex?: number;\n onRequestClose?: () => void;\n /**\n * Portal target, HTML element. If not set, portal is not used.\n */\n portalTarget?: HTMLElement | null;\n}\n\nexport const Drawer: React.FC<DrawerProps> = ({\n background,\n zIndex,\n children,\n slideFrom = \"left\",\n portalTarget,\n floating,\n ...reactModalProps\n}) => {\n const { height, width } = reactModalProps as FlattenUnion<DrawerProps>;\n\n return (\n <ReactModal\n closeTimeoutMS={250}\n portalClassName={styles.portal}\n overlayClassName={{\n base: styles.overlay,\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n className={{\n base: cx(\n styles.content,\n getClassNameForSlide(slideFrom),\n floating && styles.floating\n ),\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n style={{ content: { width, height, background }, overlay: { zIndex } }}\n parentSelector={portalTarget ? () => portalTarget : undefined}\n {...reactModalProps}\n >\n {children}\n </ReactModal>\n );\n};\n\nconst getClassNameForSlide = (slideFrom: SlideFrom): string => {\n switch (slideFrom) {\n case \"left\":\n return styles.slideFromLeft;\n case \"right\":\n return styles.slideFromRight;\n case \"top\":\n return styles.slideFromTop;\n case \"bottom\":\n return styles.slideFromBottom;\n default:\n return exhaustSwitchCase(slideFrom, styles.slideFromLeft);\n }\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\n\nimport styles from \"../modal/Modal.module.css\";\n\nexport interface CenterModalProps extends ReactModal.Props {\n onRequestClose?: () => void;\n}\n\nconst style = { overlay: { justifyContent: \"center\" } };\n\nexport const CenterModal: React.FC<CenterModalProps> = ({\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n style={style}\n {...reactModalProps}\n >\n <div\n className={styles.content}\n style={{ [\"--swui-modal-width\" as string]: \"fit-content\" }}\n >\n {children}\n </div>\n </ReactModal>\n );\n};\n","import { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n Box,\n Column,\n Heading,\n Indent,\n Row,\n Spacing,\n} from \"@stenajs-webui/core\";\nimport { Icon, Spinner } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport styles from \"./LoadingModal.module.css\";\n\nexport interface LoadingModalProps extends Omit<ReactModal.Props, \"isOpen\"> {\n headerText?: string;\n headerIconLeft?: IconDefinition;\n}\n\nexport const LoadingModal: React.FC<LoadingModalProps> = ({\n headerIconLeft,\n headerText,\n ...modalProps\n}) => {\n return (\n <ReactModal\n {...modalProps}\n isOpen\n className={styles.modal}\n overlayClassName={styles.overlay}\n >\n <Column spacing={2} alignItems={\"center\"}>\n <Box\n alignItems={\"center\"}\n justifyContent={\"center\"}\n width={\"64px\"}\n height={\"64px\"}\n borderRadius={\"50%\"}\n background={\"white\"}\n shadow={\"modal\"}\n >\n <Spinner size={\"small\"} />\n </Box>\n {(headerIconLeft || headerText) && (\n <>\n <Spacing />\n <Row indent={2}>\n {headerIconLeft && (\n <>\n <Icon size={14} icon={headerIconLeft} color={\"white\"} />\n <Indent />\n </>\n )}\n {headerText && (\n <Heading variant={\"h4\"} color={\"white\"}>\n {headerText}\n </Heading>\n )}\n </Row>\n </>\n )}\n </Column>\n </ReactModal>\n );\n};\n","import { FlatButton, stenaTimes } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport {\n DRAGGABLE_CANCEL_CLASSNAME,\n DRAGGABLE_HANDLE_CLASSNAME,\n} from \"./BaseModal\";\nimport { Box, Row, Txt } from \"@stenajs-webui/core\";\n\nexport interface ModalHeaderProps {\n onRequestClose?: () => void;\n header?: ReactNode;\n headerText?: string;\n closeButtonClassName?: string;\n}\n\nexport const ModalHeader: React.FC<ModalHeaderProps> = ({\n onRequestClose,\n header,\n headerText,\n closeButtonClassName,\n}) => {\n return (\n <Row\n spacing={2}\n indent={2}\n borderBottom={\"1px solid var(--swui-modal-header-border-color)\"}\n className={DRAGGABLE_HANDLE_CLASSNAME}\n >\n <Row flex={1} indent alignItems={\"center\"}>\n {headerText && (\n <Txt className={DRAGGABLE_CANCEL_CLASSNAME} size={\"large\"}>\n {headerText}\n </Txt>\n )}\n {header}\n </Row>\n <Box alignSelf={\"flex-start\"}>\n <FlatButton\n className={closeButtonClassName}\n onClick={onRequestClose}\n aria-label={\"Close\"}\n leftIcon={stenaTimes}\n />\n </Box>\n </Row>\n );\n};\n","import { Box } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { BaseModal, BaseModalProps } from \"./BaseModal\";\nimport { ModalHeader, ModalHeaderProps } from \"./ModalHeader\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface ModalProps extends BaseModalProps, ModalHeaderProps {\n spacing?: number;\n indent?: number;\n draggable?: boolean;\n footer?: React.ReactNode;\n disableStickyFooter?: boolean;\n}\n\nexport const Modal: React.FC<ModalProps> = ({\n header,\n headerText,\n children,\n spacing,\n indent,\n draggable = false,\n onRequestClose,\n closeButtonClassName,\n footer,\n disableStickyFooter = false,\n ...props\n}) => {\n const activeSpacing = typeof spacing === \"number\" ? spacing : 1;\n const activeIndent = typeof indent === \"number\" ? indent : 1;\n\n return (\n <BaseModal {...props} onRequestClose={onRequestClose} draggable={draggable}>\n <ModalHeader\n onRequestClose={onRequestClose}\n header={header}\n headerText={headerText}\n closeButtonClassName={closeButtonClassName}\n />\n <Box spacing={activeSpacing} indent={activeIndent}>\n {children}\n </Box>\n {footer && (\n <Box\n className={cx(styles.footer, {\n [styles.stickyFooter]: !disableStickyFooter,\n })}\n >\n {footer}\n </Box>\n )}\n </BaseModal>\n );\n};\n","import { Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface ModalFooterProps {\n children?: ReactNode;\n}\n\nexport const ModalFooter: React.FC<ModalFooterProps> = ({ children }) => (\n <Column indent={2} spacing={2}>\n {children}\n </Column>\n);\n"],"names":["DRAGGABLE_HANDLE_CLASSNAME","DRAGGABLE_CANCEL_CLASSNAME","BaseModal","width","maxWidth","draggable","children","reactModalProps","jsx","ReactModal","styles","Draggable","cx","Drawer","background","zIndex","slideFrom","portalTarget","floating","height","getClassNameForSlide","exhaustSwitchCase","style","CenterModal","LoadingModal","headerIconLeft","headerText","modalProps","jsxs","Column","Box","Spinner","Fragment","Spacing","Row","Icon","Indent","Heading","ModalHeader","onRequestClose","header","closeButtonClassName","Txt","FlatButton","stenaTimes","Modal","spacing","indent","footer","disableStickyFooter","props","ModalFooter"],"mappings":";;;;;;;;;;;;;;;GAaaA,IAA6B,0BAC7BC,IAA6B,0BAE7BC,IAAsC,CAAC;AAAA,EAClD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,KACGC;AACL,MAEI,gBAAAC;AAAA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A;AAAA,EAAA;AAAA,GC7BOC,KAA8B,CAAC;AAAA,EAC1C,QAAAL;AAAA,EACA,YAAAd;AAAA,EACA,UAAApB;AAAA,EACA,SAAAwC;AAAA,EACA,QAAAC;AAAA,EACA,WAAA1C,IAAY;AAAA,EACZ,gBAAAkC;AAAA,EACA,sBAAAE;AAAA,EACA,QAAAO;AAAA,EACA,qBAAAC,IAAsB;AAAA,KACnBC;AACL,MAKK,gBAAAtB,EAAA1B,GAAA,EAAW,GAAGgD,GAAO,gBAAAX,GAAgC,WAAAlC,GACpD,UAAA;AAAA,EAAA,gBAAAG;AAAA,IAAC8B;AAAA,IAAA;AAAA,MACC,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,YAAAd;AAAA,MACA,sBAAAe;AAAA,IAAA;AAAA,EACF;AAAA,oBACCX,GAAI,EAAA,SAXa,OAAOgB,KAAY,WAAWA,IAAU,GAW7B,QAVZ,OAAOC,KAAW,WAAWA,IAAS,GAWpD,UAAAzC,GACH;AAAA,EACC0C,KACC,gBAAAxC;AAAA,IAACsB;AAAA,IAAA;AAAA,MACC,WAAWlB,EAAGF,EAAO,QAAQ;AAAA,QAC3B,CAACA,EAAO,eAAe,CAACuC;AAAA,MAAA,CACzB;AAAA,MAEA,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ,EAAA,CAAA,GC3CSG,KAA0C,CAAC,EAAE,UAAA7C,EAAS,MAChE,gBAAAE,EAAAqB,GAAA,EAAO,QAAQ,GAAG,SAAS,GACzB,UAAAvB,EACH,CAAA;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/components/modal/BaseModal.tsx","../src/components/drawer/Drawer.tsx","../src/components/drawer/DrawerHeader.tsx","../src/components/center-modal/CenterModal.tsx","../src/components/loading-modal/LoadingModal.tsx","../src/components/modal/ModalHeader.tsx","../src/components/modal/Modal.tsx","../src/components/modal/ModalFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport Draggable from \"react-draggable\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface BaseModalProps extends ReactModal.Props {\n width?: string;\n maxWidth?: string;\n onRequestClose?: () => void;\n draggable?: boolean;\n}\n\nexport const DRAGGABLE_HANDLE_CLASSNAME = \"draggable-modal-handle\";\nexport const DRAGGABLE_CANCEL_CLASSNAME = \"draggable-modal-cancel\";\n\nexport const BaseModal: React.FC<BaseModalProps> = ({\n width,\n maxWidth,\n draggable = false,\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n {...reactModalProps}\n >\n <Draggable\n handle={`.${DRAGGABLE_HANDLE_CLASSNAME}`}\n cancel={`.${DRAGGABLE_CANCEL_CLASSNAME}, button, [role=\"tooltip\"]`}\n bounds=\".ReactModal__Overlay\"\n disabled={!draggable}\n >\n <div\n style={{\n [\"--swui-modal-width\" as string]: width,\n [\"--swui-modal-max-width\" as string]: maxWidth,\n }}\n className={cx(styles.content, {\n [styles.isDraggable]: draggable,\n })}\n >\n {children}\n </div>\n </Draggable>\n </ReactModal>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport cx from \"classnames\";\nimport styles from \"./Drawer.module.css\";\nimport { exhaustSwitchCase, FlattenUnion } from \"@stenajs-webui/core\";\n\nexport type SlideFrom = SlideFromLeftRight | SlideFromTopBottom;\nexport type SlideFromLeftRight = \"left\" | \"right\";\nexport type SlideFromTopBottom = \"top\" | \"bottom\";\n\nexport type DrawerProps = DrawerBaseLeftRight | DrawerBaseTopBottom;\n\ninterface DrawerBaseLeftRight extends DrawerBaseProps {\n width?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('left'|'right')}\n */\n slideFrom?: SlideFromLeftRight;\n}\n\ninterface DrawerBaseTopBottom extends DrawerBaseProps {\n height?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('top'|'bottom')}\n */\n slideFrom?: SlideFromTopBottom;\n}\n\ninterface DrawerBaseProps\n extends Omit<\n ReactModal.Props,\n | \"closeTimeoutMS\"\n | \"portalClassName\"\n | \"overlayClassName\"\n | \"className\"\n | \"style\"\n | \"parentSelector\"\n > {\n background?: string;\n\n /**\n * When true, there will be a gap between the drawer and the viewport.\n */\n floating?: boolean;\n\n zIndex?: number;\n onRequestClose?: () => void;\n /**\n * Portal target, HTML element. If not set, portal is not used.\n */\n portalTarget?: HTMLElement | null;\n}\n\nexport const Drawer: React.FC<DrawerProps> = ({\n background,\n zIndex,\n children,\n slideFrom = \"left\",\n portalTarget,\n floating,\n ...reactModalProps\n}) => {\n const { height, width } = reactModalProps as FlattenUnion<DrawerProps>;\n\n return (\n <ReactModal\n closeTimeoutMS={250}\n portalClassName={styles.portal}\n overlayClassName={{\n base: styles.overlay,\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n className={{\n base: cx(\n styles.content,\n getClassNameForSlide(slideFrom),\n floating && styles.floating\n ),\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n style={{ content: { width, height, background }, overlay: { zIndex } }}\n parentSelector={portalTarget ? () => portalTarget : undefined}\n {...reactModalProps}\n >\n {children}\n </ReactModal>\n );\n};\n\nconst getClassNameForSlide = (slideFrom: SlideFrom): string => {\n switch (slideFrom) {\n case \"left\":\n return styles.slideFromLeft;\n case \"right\":\n return styles.slideFromRight;\n case \"top\":\n return styles.slideFromTop;\n case \"bottom\":\n return styles.slideFromBottom;\n default:\n return exhaustSwitchCase(slideFrom, styles.slideFromLeft);\n }\n};\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { Heading, Row, Space, Spacing } from \"@stenajs-webui/core\";\nimport { FlatButton, Icon, stenaTimes } from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport { cssColor } from \"@stenajs-webui/theme\";\n\nexport interface DrawerHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n icon?: IconDefinition;\n}\n\nexport const DrawerHeader: React.FC<DrawerHeaderProps> = ({\n header,\n contentRight,\n onRequestClose,\n icon,\n}) => {\n return (\n <Spacing\n position={\"sticky\"}\n top={0}\n zIndex={100}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <Row\n justifyContent={\"space-between\"}\n alignItems={\"center\"}\n height={\"48px\"}\n >\n <Row alignItems={\"center\"} gap={2}>\n <Space num={1} />\n {icon && <Icon icon={icon} size={24} />}\n <Heading variant={\"h4\"}>{header}</Heading>\n </Row>\n <Row gap={1}>\n {contentRight}\n <FlatButton\n leftIcon={stenaTimes}\n onClick={onRequestClose}\n variant={\"danger\"}\n />\n <Space num={0.5} />\n </Row>\n </Row>\n </Spacing>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\n\nimport styles from \"../modal/Modal.module.css\";\n\nexport interface CenterModalProps extends ReactModal.Props {\n onRequestClose?: () => void;\n}\n\nconst style = { overlay: { justifyContent: \"center\" } };\n\nexport const CenterModal: React.FC<CenterModalProps> = ({\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n style={style}\n {...reactModalProps}\n >\n <div\n className={styles.content}\n style={{ [\"--swui-modal-width\" as string]: \"fit-content\" }}\n >\n {children}\n </div>\n </ReactModal>\n );\n};\n","import { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n Box,\n Column,\n Heading,\n Indent,\n Row,\n Spacing,\n} from \"@stenajs-webui/core\";\nimport { Icon, Spinner } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport styles from \"./LoadingModal.module.css\";\n\nexport interface LoadingModalProps extends Omit<ReactModal.Props, \"isOpen\"> {\n headerText?: string;\n headerIconLeft?: IconDefinition;\n}\n\nexport const LoadingModal: React.FC<LoadingModalProps> = ({\n headerIconLeft,\n headerText,\n ...modalProps\n}) => {\n return (\n <ReactModal\n {...modalProps}\n isOpen\n className={styles.modal}\n overlayClassName={styles.overlay}\n >\n <Column spacing={2} alignItems={\"center\"}>\n <Box\n alignItems={\"center\"}\n justifyContent={\"center\"}\n width={\"64px\"}\n height={\"64px\"}\n borderRadius={\"50%\"}\n background={\"white\"}\n shadow={\"modal\"}\n >\n <Spinner size={\"small\"} />\n </Box>\n {(headerIconLeft || headerText) && (\n <>\n <Spacing />\n <Row indent={2}>\n {headerIconLeft && (\n <>\n <Icon size={14} icon={headerIconLeft} color={\"white\"} />\n <Indent />\n </>\n )}\n {headerText && (\n <Heading variant={\"h4\"} color={\"white\"}>\n {headerText}\n </Heading>\n )}\n </Row>\n </>\n )}\n </Column>\n </ReactModal>\n );\n};\n","import { FlatButton, stenaTimes } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport {\n DRAGGABLE_CANCEL_CLASSNAME,\n DRAGGABLE_HANDLE_CLASSNAME,\n} from \"./BaseModal\";\nimport { Box, Row, Txt } from \"@stenajs-webui/core\";\n\nexport interface ModalHeaderProps {\n onRequestClose?: () => void;\n header?: ReactNode;\n headerText?: string;\n closeButtonClassName?: string;\n}\n\nexport const ModalHeader: React.FC<ModalHeaderProps> = ({\n onRequestClose,\n header,\n headerText,\n closeButtonClassName,\n}) => {\n return (\n <Row\n spacing={2}\n indent={2}\n borderBottom={\"1px solid var(--swui-modal-header-border-color)\"}\n className={DRAGGABLE_HANDLE_CLASSNAME}\n >\n <Row flex={1} indent alignItems={\"center\"}>\n {headerText && (\n <Txt className={DRAGGABLE_CANCEL_CLASSNAME} size={\"large\"}>\n {headerText}\n </Txt>\n )}\n {header}\n </Row>\n <Box alignSelf={\"flex-start\"}>\n <FlatButton\n className={closeButtonClassName}\n onClick={onRequestClose}\n aria-label={\"Close\"}\n leftIcon={stenaTimes}\n />\n </Box>\n </Row>\n );\n};\n","import { Box } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { BaseModal, BaseModalProps } from \"./BaseModal\";\nimport { ModalHeader, ModalHeaderProps } from \"./ModalHeader\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface ModalProps extends BaseModalProps, ModalHeaderProps {\n spacing?: number;\n indent?: number;\n draggable?: boolean;\n footer?: React.ReactNode;\n disableStickyFooter?: boolean;\n}\n\nexport const Modal: React.FC<ModalProps> = ({\n header,\n headerText,\n children,\n spacing,\n indent,\n draggable = false,\n onRequestClose,\n closeButtonClassName,\n footer,\n disableStickyFooter = false,\n ...props\n}) => {\n const activeSpacing = typeof spacing === \"number\" ? spacing : 1;\n const activeIndent = typeof indent === \"number\" ? indent : 1;\n\n return (\n <BaseModal {...props} onRequestClose={onRequestClose} draggable={draggable}>\n <ModalHeader\n onRequestClose={onRequestClose}\n header={header}\n headerText={headerText}\n closeButtonClassName={closeButtonClassName}\n />\n <Box spacing={activeSpacing} indent={activeIndent}>\n {children}\n </Box>\n {footer && (\n <Box\n className={cx(styles.footer, {\n [styles.stickyFooter]: !disableStickyFooter,\n })}\n >\n {footer}\n </Box>\n )}\n </BaseModal>\n );\n};\n","import { Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface ModalFooterProps {\n children?: ReactNode;\n}\n\nexport const ModalFooter: React.FC<ModalFooterProps> = ({ children }) => (\n <Column indent={2} spacing={2}>\n {children}\n </Column>\n);\n"],"names":["DRAGGABLE_HANDLE_CLASSNAME","DRAGGABLE_CANCEL_CLASSNAME","BaseModal","width","maxWidth","draggable","children","reactModalProps","jsx","ReactModal","styles","Draggable","cx","Drawer","background","zIndex","slideFrom","portalTarget","floating","height","getClassNameForSlide","exhaustSwitchCase","DrawerHeader","header","contentRight","onRequestClose","icon","Spacing","cssColor","jsxs","Row","Space","Icon","Heading","FlatButton","stenaTimes","style","CenterModal","LoadingModal","headerIconLeft","headerText","modalProps","Column","Box","Spinner","Fragment","Indent","ModalHeader","closeButtonClassName","Txt","Modal","spacing","indent","footer","disableStickyFooter","props","ModalFooter"],"mappings":";;;;;;;;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;AAAA,EACA,UAAAlC;AAAA,EACA,SAAA6C;AAAA,EACA,QAAAC;AAAA,EACA,WAAA/C,IAAY;AAAA,EACZ,gBAAAoB;AAAA,EACA,sBAAAuB;AAAA,EACA,QAAAK;AAAA,EACA,qBAAAC,IAAsB;AAAA,KACnBC;AACL,MAKK,gBAAA1B,EAAA3B,GAAA,EAAW,GAAGqD,GAAO,gBAAA9B,GAAgC,WAAApB,GACpD,UAAA;AAAA,EAAA,gBAAAG;AAAA,IAACuC;AAAA,IAAA;AAAA,MACC,gBAAAtB;AAAA,MACA,QAAAF;AAAA,MACA,YAAAiB;AAAA,MACA,sBAAAQ;AAAA,IAAA;AAAA,EACF;AAAA,oBACCL,GAAI,EAAA,SAXa,OAAOQ,KAAY,WAAWA,IAAU,GAW7B,QAVZ,OAAOC,KAAW,WAAWA,IAAS,GAWpD,UAAA9C,GACH;AAAA,EACC+C,KACC,gBAAA7C;AAAA,IAACmC;AAAA,IAAA;AAAA,MACC,WAAW/B,EAAGF,EAAO,QAAQ;AAAA,QAC3B,CAACA,EAAO,eAAe,CAAC4C;AAAA,MAAA,CACzB;AAAA,MAEA,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ,EAAA,CAAA,GC3CSG,KAA0C,CAAC,EAAE,UAAAlD,EAAS,MAChE,gBAAAE,EAAAkC,GAAA,EAAO,QAAQ,GAAG,SAAS,GACzB,UAAApC,EACH,CAAA;"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function(){"use strict";try{var t=document.createElement("style");t.appendChild(document.createTextNode("._overlay_5x3op_1{--swui-modal-animation-time: var(--swui-animation-time-fast);--swui-modal-overlay-bg-color: var(--swui-overlay-bg-color);--swui-modal-content-bg-color: var(--swui-white);--swui-modal-width: 960px;--swui-modal-max-width: 100%;--swui-modal-header-border-color: var(--lhds-color-ui-300);--swui-modal-shadow: var(--swui-shadow-modal);--swui-modal-footer-shadow: var(--swui-shadow-modal);position:fixed;z-index:10;top:0;left:0;right:0;bottom:0;background-color:var(--swui-modal-overlay-bg-color);overflow:auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;-webkit-animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both;animation:_fadeIn_5x3op_1 var(--swui-modal-animation-time) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1{background-color:#fff}}._overlay_5x3op_1 ._modal_5x3op_31{max-width:100%;outline:none;pointer-events:none}@media (max-width: 768px){._overlay_5x3op_1 ._modal_5x3op_31{width:100%}}._overlay_5x3op_1 ._content_5x3op_41{position:relative;display:block;background:var(--swui-modal-content-bg-color);box-shadow:var(--swui-modal-shadow);pointer-events:all;top:calc(var(--swui-metrics-space) * 2);width:var(--swui-modal-width);max-width:var(--swui-modal-max-width)}@media (max-width: 768px){._overlay_5x3op_1 ._content_5x3op_41{top:0;width:100%;max-width:100%}}._overlay_5x3op_1 ._content_5x3op_41{-webkit-animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both;animation:_appear_5x3op_1 var(--swui-animation-time-fast) cubic-bezier(.645,.045,.355,1) both}@media print{._overlay_5x3op_1 ._content_5x3op_41{box-shadow:none;top:0}}._overlay_5x3op_1 ._content_5x3op_41 :focus{outline:0}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle{cursor:move}._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle .draggable-modal-cancel,._overlay_5x3op_1 ._content_5x3op_41._isDraggable_5x3op_70 .draggable-modal-handle [role=tooltip]{cursor:initial}@-webkit-keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@keyframes _fadeIn_5x3op_1{0%{background-color:var(--swui-hidden)}to{background-color:var(--swui-modal-overlay-bg-color)}}@-webkit-keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}@keyframes _appear_5x3op_1{0%{opacity:0}to{opacity:1}}._footer_5x3op_101{background-color:var(--swui-modal-content-bg-color)}._stickyFooter_5x3op_105{position:-webkit-sticky;position:sticky;bottom:0;box-shadow:var(--swui-modal-footer-shadow)}@media print{._stickyFooter_5x3op_105{position:static;box-shadow:none}}._portal_9t5bd_1{--drawer-width: 370px}._portal_9t5bd_1 ._overlay_9t5bd_4{position:fixed;inset:0}._portal_9t5bd_1 ._content_9t5bd_9{box-shadow:var(--swui-shadow-modal);background:white;position:absolute;transition:-webkit-transform var(--swui-animation-time-medium) ease-in-out;transition:transform var(--swui-animation-time-medium) ease-in-out;transition:transform var(--swui-animation-time-medium) ease-in-out,-webkit-transform var(--swui-animation-time-medium) ease-in-out}._portal_9t5bd_1 ._content_9t5bd_9._floating_9t5bd_15{margin:var(--swui-metrics-space);border-radius:var(--swui-border-radius)}._portal_9t5bd_1 ._content_9t5bd_9:focus-visible{outline:unset}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25{-webkit-transform:translateX(var(--translate-x-outside-screen, 0));transform:translate(var(--translate-x-outside-screen, 0));overflow-y:auto;top:0;bottom:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24._afterOpen_9t5bd_31,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25._afterOpen_9t5bd_31{-webkit-transform:translateX(0);transform:translate(0)}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24._beforeClose_9t5bd_35,._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25._beforeClose_9t5bd_35{-webkit-transform:translateX(var(--translate-x-outside-screen));transform:translate(var(--translate-x-outside-screen))}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41{-webkit-transform:translateY(var(--translate-y-outside-screen, 0));transform:translateY(var(--translate-y-outside-screen, 0));overflow-x:auto;left:0;right:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40._afterOpen_9t5bd_31,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41._afterOpen_9t5bd_31{-webkit-transform:translateY(0);transform:translateY(0)}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40._beforeClose_9t5bd_35,._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41._beforeClose_9t5bd_35{-webkit-transform:translateY(var(--translate-y-outside-screen));transform:translateY(var(--translate-y-outside-screen))}._portal_9t5bd_1 ._content_9t5bd_9._slideFromLeft_9t5bd_24{--translate-x-outside-screen: -100%;width:var(--drawer-width);left:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromRight_9t5bd_25{--translate-x-outside-screen: 100%;width:var(--drawer-width);right:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromTop_9t5bd_40{--translate-y-outside-screen: -100%;height:var(--drawer-width);top:0}._portal_9t5bd_1 ._content_9t5bd_9._slideFromBottom_9t5bd_41{--translate-y-outside-screen: 100%;height:var(--drawer-width);bottom:0}._modal_4fwgb_1{display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;right:0;bottom:0;background-color:transparent}._overlay_4fwgb_13{position:fixed;top:0;left:0;right:0;bottom:0;background-color:var(--swui-overlay-bg-color)}")),document.head.appendChild(t)}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("react-modal"),M=require("react-draggable"),A=require("classnames"),o=require("@stenajs-webui/core"),_=require("@stenajs-webui/elements"),g=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},m=g(N),L=g(M),x=g(A),S="_overlay_5x3op_1",B="_fadeIn_5x3op_1",D="_modal_5x3op_31",R="_content_5x3op_41",E="_appear_5x3op_1",O="_isDraggable_5x3op_70",G="_footer_5x3op_101",I="_stickyFooter_5x3op_105",n={overlay:S,fadeIn:B,modal:D,content:R,appear:E,isDraggable:O,footer:G,stickyFooter:I},p="draggable-modal-handle",b="draggable-modal-cancel",h=({width:t,maxWidth:s,draggable:l=!1,children:r,...c})=>e.jsx(m.default,{overlayClassName:n.overlay,className:n.modal,...c,children:e.jsx(L.default,{handle:`.${p}`,cancel:`.${b}, button, [role="tooltip"]`,bounds:".ReactModal__Overlay",disabled:!l,children:e.jsx("div",{style:{["--swui-modal-width"]:t,["--swui-modal-max-width"]:s},className:x.default(n.content,{[n.isDraggable]:l}),children:r})})}),$="_portal_9t5bd_1",k="_overlay_9t5bd_4",q="_content_9t5bd_9",H="_floating_9t5bd_15",T="_slideFromLeft_9t5bd_24",z="_slideFromRight_9t5bd_25",J="_afterOpen_9t5bd_31",K="_beforeClose_9t5bd_35",P="_slideFromTop_9t5bd_40",Q="_slideFromBottom_9t5bd_41",a={portal:$,overlay:k,content:q,floating:H,slideFromLeft:T,slideFromRight:z,afterOpen:J,beforeClose:K,slideFromTop:P,slideFromBottom:Q},U=({background:t,zIndex:s,children:l,slideFrom:r="left",portalTarget:c,floating:f,...d})=>{const{height:u,width:i}=d;return e.jsx(m.default,{closeTimeoutMS:250,portalClassName:a.portal,overlayClassName:{base:a.overlay,afterOpen:a.afterOpen,beforeClose:a.beforeClose},className:{base:x.default(a.content,V(r),f&&a.floating),afterOpen:a.afterOpen,beforeClose:a.beforeClose},style:{content:{width:i,height:u,background:t},overlay:{zIndex:s}},parentSelector:c?()=>c:void 0,...d,children:l})},V=t=>{switch(t){case"left":return a.slideFromLeft;case"right":return a.slideFromRight;case"top":return a.slideFromTop;case"bottom":return a.slideFromBottom;default:return o.exhaustSwitchCase(t,a.slideFromLeft)}},W={overlay:{justifyContent:"center"}},X=({children:t,...s})=>e.jsx(m.default,{overlayClassName:n.overlay,className:n.modal,style:W,...s,children:e.jsx("div",{className:n.content,style:{["--swui-modal-width"]:"fit-content"},children:t})}),Y="_modal_4fwgb_1",Z="_overlay_4fwgb_13",y={modal:Y,overlay:Z},ee=({headerIconLeft:t,headerText:s,...l})=>e.jsx(m.default,{...l,isOpen:!0,className:y.modal,overlayClassName:y.overlay,children:e.jsxs(o.Column,{spacing:2,alignItems:"center",children:[e.jsx(o.Box,{alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"50%",background:"white",shadow:"modal",children:e.jsx(_.Spinner,{size:"small"})}),(t||s)&&e.jsxs(e.Fragment,{children:[e.jsx(o.Spacing,{}),e.jsxs(o.Row,{indent:2,children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(_.Icon,{size:14,icon:t,color:"white"}),e.jsx(o.Indent,{})]}),s&&e.jsx(o.Heading,{variant:"h4",color:"white",children:s})]})]})]})}),j=({onRequestClose:t,header:s,headerText:l,closeButtonClassName:r})=>e.jsxs(o.Row,{spacing:2,indent:2,borderBottom:"1px solid var(--swui-modal-header-border-color)",className:p,children:[e.jsxs(o.Row,{flex:1,indent:!0,alignItems:"center",children:[l&&e.jsx(o.Txt,{className:b,size:"large",children:l}),s]}),e.jsx(o.Box,{alignSelf:"flex-start",children:e.jsx(_.FlatButton,{className:r,onClick:t,"aria-label":"Close",leftIcon:_.stenaTimes})})]}),te=({header:t,headerText:s,children:l,spacing:r,indent:c,draggable:f=!1,onRequestClose:d,closeButtonClassName:u,footer:i,disableStickyFooter:v=!1,...C})=>{const F=typeof r=="number"?r:1,w=typeof c=="number"?c:1;return e.jsxs(h,{...C,onRequestClose:d,draggable:f,children:[e.jsx(j,{onRequestClose:d,header:t,headerText:s,closeButtonClassName:u}),e.jsx(o.Box,{spacing:F,indent:w,children:l}),i&&e.jsx(o.Box,{className:x.default(n.footer,{[n.stickyFooter]:!v}),children:i})]})},oe=({children:t})=>e.jsx(o.Column,{indent:2,spacing:2,children:t});exports.BaseModal=h;exports.CenterModal=X;exports.DRAGGABLE_CANCEL_CLASSNAME=b;exports.DRAGGABLE_HANDLE_CLASSNAME=p;exports.Drawer=U;exports.LoadingModal=ee;exports.Modal=te;exports.ModalFooter=oe;exports.ModalHeader=j;
2
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("react-modal"),M=require("react-draggable"),S=require("classnames"),o=require("@stenajs-webui/core"),i=require("@stenajs-webui/elements"),A=require("@stenajs-webui/theme"),x=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},_=x(N),L=x(M),g=x(S),R="_overlay_5x3op_1",B="_fadeIn_5x3op_1",D="_modal_5x3op_31",I="_content_5x3op_41",E="_appear_5x3op_1",O="_isDraggable_5x3op_70",k="_footer_5x3op_101",G="_stickyFooter_5x3op_105",r={overlay:R,fadeIn:B,modal:D,content:I,appear:E,isDraggable:O,footer:k,stickyFooter:G},p="draggable-modal-handle",b="draggable-modal-cancel",j=({width:t,maxWidth:s,draggable:a=!1,children:l,...c})=>e.jsx(_.default,{overlayClassName:r.overlay,className:r.modal,...c,children:e.jsx(L.default,{handle:`.${p}`,cancel:`.${b}, button, [role="tooltip"]`,bounds:".ReactModal__Overlay",disabled:!a,children:e.jsx("div",{style:{["--swui-modal-width"]:t,["--swui-modal-max-width"]:s},className:g.default(r.content,{[r.isDraggable]:a}),children:l})})}),H="_portal_9t5bd_1",$="_overlay_9t5bd_4",q="_content_9t5bd_9",z="_floating_9t5bd_15",T="_slideFromLeft_9t5bd_24",J="_slideFromRight_9t5bd_25",K="_afterOpen_9t5bd_31",P="_beforeClose_9t5bd_35",Q="_slideFromTop_9t5bd_40",U="_slideFromBottom_9t5bd_41",n={portal:H,overlay:$,content:q,floating:z,slideFromLeft:T,slideFromRight:J,afterOpen:K,beforeClose:P,slideFromTop:Q,slideFromBottom:U},V=({background:t,zIndex:s,children:a,slideFrom:l="left",portalTarget:c,floating:u,...d})=>{const{height:f,width:m}=d;return e.jsx(_.default,{closeTimeoutMS:250,portalClassName:n.portal,overlayClassName:{base:n.overlay,afterOpen:n.afterOpen,beforeClose:n.beforeClose},className:{base:g.default(n.content,W(l),u&&n.floating),afterOpen:n.afterOpen,beforeClose:n.beforeClose},style:{content:{width:m,height:f,background:t},overlay:{zIndex:s}},parentSelector:c?()=>c:void 0,...d,children:a})},W=t=>{switch(t){case"left":return n.slideFromLeft;case"right":return n.slideFromRight;case"top":return n.slideFromTop;case"bottom":return n.slideFromBottom;default:return o.exhaustSwitchCase(t,n.slideFromLeft)}},X=({header:t,contentRight:s,onRequestClose:a,icon:l})=>e.jsx(o.Spacing,{position:"sticky",top:0,zIndex:100,background:A.cssColor("--lhds-color-ui-50"),children:e.jsxs(o.Row,{justifyContent:"space-between",alignItems:"center",height:"48px",children:[e.jsxs(o.Row,{alignItems:"center",gap:2,children:[e.jsx(o.Space,{num:1}),l&&e.jsx(i.Icon,{icon:l,size:24}),e.jsx(o.Heading,{variant:"h4",children:t})]}),e.jsxs(o.Row,{gap:1,children:[s,e.jsx(i.FlatButton,{leftIcon:i.stenaTimes,onClick:a,variant:"danger"}),e.jsx(o.Space,{num:.5})]})]})}),Y={overlay:{justifyContent:"center"}},Z=({children:t,...s})=>e.jsx(_.default,{overlayClassName:r.overlay,className:r.modal,style:Y,...s,children:e.jsx("div",{className:r.content,style:{["--swui-modal-width"]:"fit-content"},children:t})}),ee="_modal_4fwgb_1",te="_overlay_4fwgb_13",h={modal:ee,overlay:te},oe=({headerIconLeft:t,headerText:s,...a})=>e.jsx(_.default,{...a,isOpen:!0,className:h.modal,overlayClassName:h.overlay,children:e.jsxs(o.Column,{spacing:2,alignItems:"center",children:[e.jsx(o.Box,{alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"50%",background:"white",shadow:"modal",children:e.jsx(i.Spinner,{size:"small"})}),(t||s)&&e.jsxs(e.Fragment,{children:[e.jsx(o.Spacing,{}),e.jsxs(o.Row,{indent:2,children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(i.Icon,{size:14,icon:t,color:"white"}),e.jsx(o.Indent,{})]}),s&&e.jsx(o.Heading,{variant:"h4",color:"white",children:s})]})]})]})}),y=({onRequestClose:t,header:s,headerText:a,closeButtonClassName:l})=>e.jsxs(o.Row,{spacing:2,indent:2,borderBottom:"1px solid var(--swui-modal-header-border-color)",className:p,children:[e.jsxs(o.Row,{flex:1,indent:!0,alignItems:"center",children:[a&&e.jsx(o.Txt,{className:b,size:"large",children:a}),s]}),e.jsx(o.Box,{alignSelf:"flex-start",children:e.jsx(i.FlatButton,{className:l,onClick:t,"aria-label":"Close",leftIcon:i.stenaTimes})})]}),se=({header:t,headerText:s,children:a,spacing:l,indent:c,draggable:u=!1,onRequestClose:d,closeButtonClassName:f,footer:m,disableStickyFooter:C=!1,...v})=>{const w=typeof l=="number"?l:1,F=typeof c=="number"?c:1;return e.jsxs(j,{...v,onRequestClose:d,draggable:u,children:[e.jsx(y,{onRequestClose:d,header:t,headerText:s,closeButtonClassName:f}),e.jsx(o.Box,{spacing:w,indent:F,children:a}),m&&e.jsx(o.Box,{className:g.default(r.footer,{[r.stickyFooter]:!C}),children:m})]})},ae=({children:t})=>e.jsx(o.Column,{indent:2,spacing:2,children:t});exports.BaseModal=j;exports.CenterModal=Z;exports.DRAGGABLE_CANCEL_CLASSNAME=b;exports.DRAGGABLE_HANDLE_CLASSNAME=p;exports.Drawer=V;exports.DrawerHeader=X;exports.LoadingModal=oe;exports.Modal=se;exports.ModalFooter=ae;exports.ModalHeader=y;
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/modal/BaseModal.tsx","../src/components/drawer/Drawer.tsx","../src/components/center-modal/CenterModal.tsx","../src/components/loading-modal/LoadingModal.tsx","../src/components/modal/ModalHeader.tsx","../src/components/modal/Modal.tsx","../src/components/modal/ModalFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport Draggable from \"react-draggable\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface BaseModalProps extends ReactModal.Props {\n width?: string;\n maxWidth?: string;\n onRequestClose?: () => void;\n draggable?: boolean;\n}\n\nexport const DRAGGABLE_HANDLE_CLASSNAME = \"draggable-modal-handle\";\nexport const DRAGGABLE_CANCEL_CLASSNAME = \"draggable-modal-cancel\";\n\nexport const BaseModal: React.FC<BaseModalProps> = ({\n width,\n maxWidth,\n draggable = false,\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n {...reactModalProps}\n >\n <Draggable\n handle={`.${DRAGGABLE_HANDLE_CLASSNAME}`}\n cancel={`.${DRAGGABLE_CANCEL_CLASSNAME}, button, [role=\"tooltip\"]`}\n bounds=\".ReactModal__Overlay\"\n disabled={!draggable}\n >\n <div\n style={{\n [\"--swui-modal-width\" as string]: width,\n [\"--swui-modal-max-width\" as string]: maxWidth,\n }}\n className={cx(styles.content, {\n [styles.isDraggable]: draggable,\n })}\n >\n {children}\n </div>\n </Draggable>\n </ReactModal>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport cx from \"classnames\";\nimport styles from \"./Drawer.module.css\";\nimport { exhaustSwitchCase, FlattenUnion } from \"@stenajs-webui/core\";\n\nexport type SlideFrom = SlideFromLeftRight | SlideFromTopBottom;\nexport type SlideFromLeftRight = \"left\" | \"right\";\nexport type SlideFromTopBottom = \"top\" | \"bottom\";\n\nexport type DrawerProps = DrawerBaseLeftRight | DrawerBaseTopBottom;\n\ninterface DrawerBaseLeftRight extends DrawerBaseProps {\n width?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('left'|'right')}\n */\n slideFrom?: SlideFromLeftRight;\n}\n\ninterface DrawerBaseTopBottom extends DrawerBaseProps {\n height?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('top'|'bottom')}\n */\n slideFrom?: SlideFromTopBottom;\n}\n\ninterface DrawerBaseProps\n extends Omit<\n ReactModal.Props,\n | \"closeTimeoutMS\"\n | \"portalClassName\"\n | \"overlayClassName\"\n | \"className\"\n | \"style\"\n | \"parentSelector\"\n > {\n background?: string;\n\n /**\n * When true, there will be a gap between the drawer and the viewport.\n */\n floating?: boolean;\n\n zIndex?: number;\n onRequestClose?: () => void;\n /**\n * Portal target, HTML element. If not set, portal is not used.\n */\n portalTarget?: HTMLElement | null;\n}\n\nexport const Drawer: React.FC<DrawerProps> = ({\n background,\n zIndex,\n children,\n slideFrom = \"left\",\n portalTarget,\n floating,\n ...reactModalProps\n}) => {\n const { height, width } = reactModalProps as FlattenUnion<DrawerProps>;\n\n return (\n <ReactModal\n closeTimeoutMS={250}\n portalClassName={styles.portal}\n overlayClassName={{\n base: styles.overlay,\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n className={{\n base: cx(\n styles.content,\n getClassNameForSlide(slideFrom),\n floating && styles.floating\n ),\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n style={{ content: { width, height, background }, overlay: { zIndex } }}\n parentSelector={portalTarget ? () => portalTarget : undefined}\n {...reactModalProps}\n >\n {children}\n </ReactModal>\n );\n};\n\nconst getClassNameForSlide = (slideFrom: SlideFrom): string => {\n switch (slideFrom) {\n case \"left\":\n return styles.slideFromLeft;\n case \"right\":\n return styles.slideFromRight;\n case \"top\":\n return styles.slideFromTop;\n case \"bottom\":\n return styles.slideFromBottom;\n default:\n return exhaustSwitchCase(slideFrom, styles.slideFromLeft);\n }\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\n\nimport styles from \"../modal/Modal.module.css\";\n\nexport interface CenterModalProps extends ReactModal.Props {\n onRequestClose?: () => void;\n}\n\nconst style = { overlay: { justifyContent: \"center\" } };\n\nexport const CenterModal: React.FC<CenterModalProps> = ({\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n style={style}\n {...reactModalProps}\n >\n <div\n className={styles.content}\n style={{ [\"--swui-modal-width\" as string]: \"fit-content\" }}\n >\n {children}\n </div>\n </ReactModal>\n );\n};\n","import { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n Box,\n Column,\n Heading,\n Indent,\n Row,\n Spacing,\n} from \"@stenajs-webui/core\";\nimport { Icon, Spinner } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport styles from \"./LoadingModal.module.css\";\n\nexport interface LoadingModalProps extends Omit<ReactModal.Props, \"isOpen\"> {\n headerText?: string;\n headerIconLeft?: IconDefinition;\n}\n\nexport const LoadingModal: React.FC<LoadingModalProps> = ({\n headerIconLeft,\n headerText,\n ...modalProps\n}) => {\n return (\n <ReactModal\n {...modalProps}\n isOpen\n className={styles.modal}\n overlayClassName={styles.overlay}\n >\n <Column spacing={2} alignItems={\"center\"}>\n <Box\n alignItems={\"center\"}\n justifyContent={\"center\"}\n width={\"64px\"}\n height={\"64px\"}\n borderRadius={\"50%\"}\n background={\"white\"}\n shadow={\"modal\"}\n >\n <Spinner size={\"small\"} />\n </Box>\n {(headerIconLeft || headerText) && (\n <>\n <Spacing />\n <Row indent={2}>\n {headerIconLeft && (\n <>\n <Icon size={14} icon={headerIconLeft} color={\"white\"} />\n <Indent />\n </>\n )}\n {headerText && (\n <Heading variant={\"h4\"} color={\"white\"}>\n {headerText}\n </Heading>\n )}\n </Row>\n </>\n )}\n </Column>\n </ReactModal>\n );\n};\n","import { FlatButton, stenaTimes } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport {\n DRAGGABLE_CANCEL_CLASSNAME,\n DRAGGABLE_HANDLE_CLASSNAME,\n} from \"./BaseModal\";\nimport { Box, Row, Txt } from \"@stenajs-webui/core\";\n\nexport interface ModalHeaderProps {\n onRequestClose?: () => void;\n header?: ReactNode;\n headerText?: string;\n closeButtonClassName?: string;\n}\n\nexport const ModalHeader: React.FC<ModalHeaderProps> = ({\n onRequestClose,\n header,\n headerText,\n closeButtonClassName,\n}) => {\n return (\n <Row\n spacing={2}\n indent={2}\n borderBottom={\"1px solid var(--swui-modal-header-border-color)\"}\n className={DRAGGABLE_HANDLE_CLASSNAME}\n >\n <Row flex={1} indent alignItems={\"center\"}>\n {headerText && (\n <Txt className={DRAGGABLE_CANCEL_CLASSNAME} size={\"large\"}>\n {headerText}\n </Txt>\n )}\n {header}\n </Row>\n <Box alignSelf={\"flex-start\"}>\n <FlatButton\n className={closeButtonClassName}\n onClick={onRequestClose}\n aria-label={\"Close\"}\n leftIcon={stenaTimes}\n />\n </Box>\n </Row>\n );\n};\n","import { Box } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { BaseModal, BaseModalProps } from \"./BaseModal\";\nimport { ModalHeader, ModalHeaderProps } from \"./ModalHeader\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface ModalProps extends BaseModalProps, ModalHeaderProps {\n spacing?: number;\n indent?: number;\n draggable?: boolean;\n footer?: React.ReactNode;\n disableStickyFooter?: boolean;\n}\n\nexport const Modal: React.FC<ModalProps> = ({\n header,\n headerText,\n children,\n spacing,\n indent,\n draggable = false,\n onRequestClose,\n closeButtonClassName,\n footer,\n disableStickyFooter = false,\n ...props\n}) => {\n const activeSpacing = typeof spacing === \"number\" ? spacing : 1;\n const activeIndent = typeof indent === \"number\" ? indent : 1;\n\n return (\n <BaseModal {...props} onRequestClose={onRequestClose} draggable={draggable}>\n <ModalHeader\n onRequestClose={onRequestClose}\n header={header}\n headerText={headerText}\n closeButtonClassName={closeButtonClassName}\n />\n <Box spacing={activeSpacing} indent={activeIndent}>\n {children}\n </Box>\n {footer && (\n <Box\n className={cx(styles.footer, {\n [styles.stickyFooter]: !disableStickyFooter,\n })}\n >\n {footer}\n </Box>\n )}\n </BaseModal>\n );\n};\n","import { Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface ModalFooterProps {\n children?: ReactNode;\n}\n\nexport const ModalFooter: React.FC<ModalFooterProps> = ({ children }) => (\n <Column indent={2} spacing={2}>\n {children}\n </Column>\n);\n"],"names":["DRAGGABLE_HANDLE_CLASSNAME","DRAGGABLE_CANCEL_CLASSNAME","BaseModal","width","maxWidth","draggable","children","reactModalProps","jsx","ReactModal","styles","Draggable","cx","Drawer","background","zIndex","slideFrom","portalTarget","floating","height","getClassNameForSlide","exhaustSwitchCase","style","CenterModal","LoadingModal","headerIconLeft","headerText","modalProps","jsxs","Column","Box","Spinner","Fragment","Spacing","Row","Icon","Indent","Heading","ModalHeader","onRequestClose","header","closeButtonClassName","Txt","FlatButton","stenaTimes","Modal","spacing","indent","footer","disableStickyFooter","props","activeSpacing","activeIndent","ModalFooter"],"mappings":"6nBAaaA,EAA6B,yBAC7BC,EAA6B,yBAE7BC,EAAsC,CAAC,CAClD,MAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,KACGC,CACL,IAEIC,EAAA,IAACC,EAAA,QAAA,CACC,iBAAkBC,EAAO,QACzB,UAAWA,EAAO,MACjB,GAAGH,EAEJ,SAAAC,EAAA,IAACG,EAAA,QAAA,CACC,OAAQ,IAAIX,IACZ,OAAQ,IAAIC,8BACZ,OAAO,uBACP,SAAU,CAACI,EAEX,SAAAG,EAAA,IAAC,MAAA,CACC,MAAO,CACL,CAAC,sBAAiCL,EAClC,CAAC,0BAAqCC,CACxC,EACA,UAAWQ,EAAAA,QAAGF,EAAO,QAAS,CAC5B,CAACA,EAAO,aAAcL,CAAA,CACvB,EAEA,SAAAC,CAAA,CACH,CAAA,CACF,CAAA,CAAA,mYCWOO,EAAgC,CAAC,CAC5C,WAAAC,EACA,OAAAC,EACA,SAAAT,EACA,UAAAU,EAAY,OACZ,aAAAC,EACA,SAAAC,KACGX,CACL,IAAM,CACE,KAAA,CAAE,OAAAY,EAAQ,MAAAhB,CAAU,EAAAI,EAGxB,OAAAC,EAAA,IAACC,EAAA,QAAA,CACC,eAAgB,IAChB,gBAAiBC,EAAO,OACxB,iBAAkB,CAChB,KA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M,CACJ,MAAMC,EAAgB,OAAOL,GAAY,SAAWA,EAAU,EACxDM,EAAe,OAAOL,GAAW,SAAWA,EAAS,EAE3D,OACGnB,EAAAA,KAAA1B,EAAA,CAAW,GAAGgD,EAAO,eAAAX,EAAgC,UAAAlC,EACpD,SAAA,CAAAG,EAAA,IAAC8B,EAAA,CACC,eAAAC,EACA,OAAAC,EACA,WAAAd,EACA,qBAAAe,CAAA,CACF,QACCX,EAAI,IAAA,CAAA,QAASqB,EAAe,OAAQC,EAClC,SAAA9C,EACH,EACC0C,GACCxC,EAAA,IAACsB,EAAA,IAAA,CACC,UAAWlB,EAAAA,QAAGF,EAAO,OAAQ,CAC3B,CAACA,EAAO,cAAe,CAACuC,CAAA,CACzB,EAEA,SAAAD,CAAA,CACH,CAEJ,CAAA,CAAA,CAEJ,EC7CaK,GAA0C,CAAC,CAAE,SAAA/C,CAAS,IAChEE,MAAAqB,EAAAA,OAAA,CAAO,OAAQ,EAAG,QAAS,EACzB,SAAAvB,CACH,CAAA"}
1
+ {"version":3,"file":"index.js","sources":["../src/components/modal/BaseModal.tsx","../src/components/drawer/Drawer.tsx","../src/components/drawer/DrawerHeader.tsx","../src/components/center-modal/CenterModal.tsx","../src/components/loading-modal/LoadingModal.tsx","../src/components/modal/ModalHeader.tsx","../src/components/modal/Modal.tsx","../src/components/modal/ModalFooter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport Draggable from \"react-draggable\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface BaseModalProps extends ReactModal.Props {\n width?: string;\n maxWidth?: string;\n onRequestClose?: () => void;\n draggable?: boolean;\n}\n\nexport const DRAGGABLE_HANDLE_CLASSNAME = \"draggable-modal-handle\";\nexport const DRAGGABLE_CANCEL_CLASSNAME = \"draggable-modal-cancel\";\n\nexport const BaseModal: React.FC<BaseModalProps> = ({\n width,\n maxWidth,\n draggable = false,\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n {...reactModalProps}\n >\n <Draggable\n handle={`.${DRAGGABLE_HANDLE_CLASSNAME}`}\n cancel={`.${DRAGGABLE_CANCEL_CLASSNAME}, button, [role=\"tooltip\"]`}\n bounds=\".ReactModal__Overlay\"\n disabled={!draggable}\n >\n <div\n style={{\n [\"--swui-modal-width\" as string]: width,\n [\"--swui-modal-max-width\" as string]: maxWidth,\n }}\n className={cx(styles.content, {\n [styles.isDraggable]: draggable,\n })}\n >\n {children}\n </div>\n </Draggable>\n </ReactModal>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport cx from \"classnames\";\nimport styles from \"./Drawer.module.css\";\nimport { exhaustSwitchCase, FlattenUnion } from \"@stenajs-webui/core\";\n\nexport type SlideFrom = SlideFromLeftRight | SlideFromTopBottom;\nexport type SlideFromLeftRight = \"left\" | \"right\";\nexport type SlideFromTopBottom = \"top\" | \"bottom\";\n\nexport type DrawerProps = DrawerBaseLeftRight | DrawerBaseTopBottom;\n\ninterface DrawerBaseLeftRight extends DrawerBaseProps {\n width?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('left'|'right')}\n */\n slideFrom?: SlideFromLeftRight;\n}\n\ninterface DrawerBaseTopBottom extends DrawerBaseProps {\n height?: string;\n /**\n * Which direction the drawer will appear from.\n * @default left\n * @param {String('top'|'bottom')}\n */\n slideFrom?: SlideFromTopBottom;\n}\n\ninterface DrawerBaseProps\n extends Omit<\n ReactModal.Props,\n | \"closeTimeoutMS\"\n | \"portalClassName\"\n | \"overlayClassName\"\n | \"className\"\n | \"style\"\n | \"parentSelector\"\n > {\n background?: string;\n\n /**\n * When true, there will be a gap between the drawer and the viewport.\n */\n floating?: boolean;\n\n zIndex?: number;\n onRequestClose?: () => void;\n /**\n * Portal target, HTML element. If not set, portal is not used.\n */\n portalTarget?: HTMLElement | null;\n}\n\nexport const Drawer: React.FC<DrawerProps> = ({\n background,\n zIndex,\n children,\n slideFrom = \"left\",\n portalTarget,\n floating,\n ...reactModalProps\n}) => {\n const { height, width } = reactModalProps as FlattenUnion<DrawerProps>;\n\n return (\n <ReactModal\n closeTimeoutMS={250}\n portalClassName={styles.portal}\n overlayClassName={{\n base: styles.overlay,\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n className={{\n base: cx(\n styles.content,\n getClassNameForSlide(slideFrom),\n floating && styles.floating\n ),\n afterOpen: styles.afterOpen,\n beforeClose: styles.beforeClose,\n }}\n style={{ content: { width, height, background }, overlay: { zIndex } }}\n parentSelector={portalTarget ? () => portalTarget : undefined}\n {...reactModalProps}\n >\n {children}\n </ReactModal>\n );\n};\n\nconst getClassNameForSlide = (slideFrom: SlideFrom): string => {\n switch (slideFrom) {\n case \"left\":\n return styles.slideFromLeft;\n case \"right\":\n return styles.slideFromRight;\n case \"top\":\n return styles.slideFromTop;\n case \"bottom\":\n return styles.slideFromBottom;\n default:\n return exhaustSwitchCase(slideFrom, styles.slideFromLeft);\n }\n};\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { Heading, Row, Space, Spacing } from \"@stenajs-webui/core\";\nimport { FlatButton, Icon, stenaTimes } from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport { cssColor } from \"@stenajs-webui/theme\";\n\nexport interface DrawerHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n icon?: IconDefinition;\n}\n\nexport const DrawerHeader: React.FC<DrawerHeaderProps> = ({\n header,\n contentRight,\n onRequestClose,\n icon,\n}) => {\n return (\n <Spacing\n position={\"sticky\"}\n top={0}\n zIndex={100}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <Row\n justifyContent={\"space-between\"}\n alignItems={\"center\"}\n height={\"48px\"}\n >\n <Row alignItems={\"center\"} gap={2}>\n <Space num={1} />\n {icon && <Icon icon={icon} size={24} />}\n <Heading variant={\"h4\"}>{header}</Heading>\n </Row>\n <Row gap={1}>\n {contentRight}\n <FlatButton\n leftIcon={stenaTimes}\n onClick={onRequestClose}\n variant={\"danger\"}\n />\n <Space num={0.5} />\n </Row>\n </Row>\n </Spacing>\n );\n};\n","import * as React from \"react\";\nimport ReactModal from \"react-modal\";\n\nimport styles from \"../modal/Modal.module.css\";\n\nexport interface CenterModalProps extends ReactModal.Props {\n onRequestClose?: () => void;\n}\n\nconst style = { overlay: { justifyContent: \"center\" } };\n\nexport const CenterModal: React.FC<CenterModalProps> = ({\n children,\n ...reactModalProps\n}) => {\n return (\n <ReactModal\n overlayClassName={styles.overlay}\n className={styles.modal}\n style={style}\n {...reactModalProps}\n >\n <div\n className={styles.content}\n style={{ [\"--swui-modal-width\" as string]: \"fit-content\" }}\n >\n {children}\n </div>\n </ReactModal>\n );\n};\n","import { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n Box,\n Column,\n Heading,\n Indent,\n Row,\n Spacing,\n} from \"@stenajs-webui/core\";\nimport { Icon, Spinner } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport ReactModal from \"react-modal\";\nimport styles from \"./LoadingModal.module.css\";\n\nexport interface LoadingModalProps extends Omit<ReactModal.Props, \"isOpen\"> {\n headerText?: string;\n headerIconLeft?: IconDefinition;\n}\n\nexport const LoadingModal: React.FC<LoadingModalProps> = ({\n headerIconLeft,\n headerText,\n ...modalProps\n}) => {\n return (\n <ReactModal\n {...modalProps}\n isOpen\n className={styles.modal}\n overlayClassName={styles.overlay}\n >\n <Column spacing={2} alignItems={\"center\"}>\n <Box\n alignItems={\"center\"}\n justifyContent={\"center\"}\n width={\"64px\"}\n height={\"64px\"}\n borderRadius={\"50%\"}\n background={\"white\"}\n shadow={\"modal\"}\n >\n <Spinner size={\"small\"} />\n </Box>\n {(headerIconLeft || headerText) && (\n <>\n <Spacing />\n <Row indent={2}>\n {headerIconLeft && (\n <>\n <Icon size={14} icon={headerIconLeft} color={\"white\"} />\n <Indent />\n </>\n )}\n {headerText && (\n <Heading variant={\"h4\"} color={\"white\"}>\n {headerText}\n </Heading>\n )}\n </Row>\n </>\n )}\n </Column>\n </ReactModal>\n );\n};\n","import { FlatButton, stenaTimes } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport {\n DRAGGABLE_CANCEL_CLASSNAME,\n DRAGGABLE_HANDLE_CLASSNAME,\n} from \"./BaseModal\";\nimport { Box, Row, Txt } from \"@stenajs-webui/core\";\n\nexport interface ModalHeaderProps {\n onRequestClose?: () => void;\n header?: ReactNode;\n headerText?: string;\n closeButtonClassName?: string;\n}\n\nexport const ModalHeader: React.FC<ModalHeaderProps> = ({\n onRequestClose,\n header,\n headerText,\n closeButtonClassName,\n}) => {\n return (\n <Row\n spacing={2}\n indent={2}\n borderBottom={\"1px solid var(--swui-modal-header-border-color)\"}\n className={DRAGGABLE_HANDLE_CLASSNAME}\n >\n <Row flex={1} indent alignItems={\"center\"}>\n {headerText && (\n <Txt className={DRAGGABLE_CANCEL_CLASSNAME} size={\"large\"}>\n {headerText}\n </Txt>\n )}\n {header}\n </Row>\n <Box alignSelf={\"flex-start\"}>\n <FlatButton\n className={closeButtonClassName}\n onClick={onRequestClose}\n aria-label={\"Close\"}\n leftIcon={stenaTimes}\n />\n </Box>\n </Row>\n );\n};\n","import { Box } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { BaseModal, BaseModalProps } from \"./BaseModal\";\nimport { ModalHeader, ModalHeaderProps } from \"./ModalHeader\";\nimport cx from \"classnames\";\nimport styles from \"./Modal.module.css\";\n\nexport interface ModalProps extends BaseModalProps, ModalHeaderProps {\n spacing?: number;\n indent?: number;\n draggable?: boolean;\n footer?: React.ReactNode;\n disableStickyFooter?: boolean;\n}\n\nexport const Modal: React.FC<ModalProps> = ({\n header,\n headerText,\n children,\n spacing,\n indent,\n draggable = false,\n onRequestClose,\n closeButtonClassName,\n footer,\n disableStickyFooter = false,\n ...props\n}) => {\n const activeSpacing = typeof spacing === \"number\" ? spacing : 1;\n const activeIndent = typeof indent === \"number\" ? indent : 1;\n\n return (\n <BaseModal {...props} onRequestClose={onRequestClose} draggable={draggable}>\n <ModalHeader\n onRequestClose={onRequestClose}\n header={header}\n headerText={headerText}\n closeButtonClassName={closeButtonClassName}\n />\n <Box spacing={activeSpacing} indent={activeIndent}>\n {children}\n </Box>\n {footer && (\n <Box\n className={cx(styles.footer, {\n [styles.stickyFooter]: !disableStickyFooter,\n })}\n >\n {footer}\n </Box>\n )}\n </BaseModal>\n );\n};\n","import { Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface ModalFooterProps {\n children?: ReactNode;\n}\n\nexport const ModalFooter: React.FC<ModalFooterProps> = ({ children }) => (\n <Column indent={2} spacing={2}>\n {children}\n </Column>\n);\n"],"names":["DRAGGABLE_HANDLE_CLASSNAME","DRAGGABLE_CANCEL_CLASSNAME","BaseModal","width","maxWidth","draggable","children","reactModalProps","jsx","ReactModal","styles","Draggable","cx","Drawer","background","zIndex","slideFrom","portalTarget","floating","height","getClassNameForSlide","exhaustSwitchCase","DrawerHeader","header","contentRight","onRequestClose","icon","Spacing","cssColor","jsxs","Row","Space","Icon","Heading","FlatButton","stenaTimes","style","CenterModal","LoadingModal","headerIconLeft","headerText","modalProps","Column","Box","Spinner","Fragment","Indent","ModalHeader","closeButtonClassName","Txt","Modal","spacing","indent","footer","disableStickyFooter","props","activeSpacing","activeIndent","ModalFooter"],"mappings":"+pBAaaA,EAA6B,yBAC7BC,EAA6B,yBAE7BC,EAAsC,CAAC,CAClD,MAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,KACGC,CACL,IAEIC,EAAA,IAACC,EAAA,QAAA,CACC,iBAAkBC,EAAO,QACzB,UAAWA,EAAO,MACjB,GAAGH,EAEJ,SAAAC,EAAA,IAACG,EAAA,QAAA,CACC,OAAQ,IAAIX,IACZ,OAAQ,IAAIC,8BACZ,OAAO,uBACP,SAAU,CAAC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ACA,OAAAK,EACA,oBAAAC,EAAsB,MACnBC,CACL,IAAM,CACJ,MAAMC,EAAgB,OAAOL,GAAY,SAAWA,EAAU,EACxDM,EAAe,OAAOL,GAAW,SAAWA,EAAS,EAE3D,OACGvB,EAAAA,KAAA3B,EAAA,CAAW,GAAGqD,EAAO,eAAA9B,EAAgC,UAAApB,EACpD,SAAA,CAAAG,EAAA,IAACuC,EAAA,CACC,eAAAtB,EACA,OAAAF,EACA,WAAAiB,EACA,qBAAAQ,CAAA,CACF,QACCL,EAAI,IAAA,CAAA,QAASa,EAAe,OAAQC,EAClC,SAAAnD,EACH,EACC+C,GACC7C,EAAA,IAACmC,EAAA,IAAA,CACC,UAAW/B,EAAAA,QAAGF,EAAO,OAAQ,CAC3B,CAACA,EAAO,cAAe,CAAC4C,CAAA,CACzB,EAEA,SAAAD,CAAA,CACH,CAEJ,CAAA,CAAA,CAEJ,EC7CaK,GAA0C,CAAC,CAAE,SAAApD,CAAS,IAChEE,MAAAkC,EAAAA,OAAA,CAAO,OAAQ,EAAG,QAAS,EACzB,SAAApC,CACH,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stenajs-webui/modal",
3
- "version": "19.0.0-next.13",
3
+ "version": "19.0.0-next.15",
4
4
  "description": "",
5
5
  "author": "mattias800",
6
6
  "license": "MIT",
@@ -26,9 +26,9 @@
26
26
  "deploy": "gh-pages -d example/build"
27
27
  },
28
28
  "dependencies": {
29
- "@stenajs-webui/core": "19.0.0-next.13",
30
- "@stenajs-webui/elements": "19.0.0-next.13",
31
- "@stenajs-webui/theme": "19.0.0-next.13",
29
+ "@stenajs-webui/core": "19.0.0-next.15",
30
+ "@stenajs-webui/elements": "19.0.0-next.15",
31
+ "@stenajs-webui/theme": "19.0.0-next.15",
32
32
  "@types/react-modal": "^3.13.1",
33
33
  "classnames": "^2.3.1",
34
34
  "react-draggable": "^4.4.5",
@@ -58,5 +58,5 @@
58
58
  "files": [
59
59
  "dist"
60
60
  ],
61
- "gitHead": "55e05b5f7db76c2114582b386d1dd807c20ff7de"
61
+ "gitHead": "e2ccdb3e55476210ac8eef20057c4f9376a0b3d4"
62
62
  }