@plastic-js/tsumiki 0.1.41 → 0.1.42
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.
- package/dist/components/Dialog.js +41 -65
- package/package.json +1 -1
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import Portal_default from "./Portal.js";
|
|
2
|
-
import
|
|
2
|
+
import Button from "./Button.js";
|
|
3
3
|
import Icon from "./Icon.js";
|
|
4
4
|
import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
5
5
|
import { css, keyframes } from "@emotion/css";
|
|
6
6
|
import { Dialog } from "@plastic-js/ark";
|
|
7
7
|
import { mergeProps as mergeProps$2, splitProps } from "@plastic-js/plastic";
|
|
8
8
|
//#region src/components/Dialog.jsx
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _tmpl4 = template("<span><!><!></span>");
|
|
13
|
-
var _tmpl3 = template("<button data-part=\"positive-trigger\" type=\"button\"></button>");
|
|
14
|
-
var _tmpl2 = template("<button data-part=\"negative-trigger\" type=\"button\"></button>");
|
|
9
|
+
var _tmpl4 = template("<div data-scope=\"dialog\" data-part=\"footer\"></div>");
|
|
10
|
+
var _tmpl3 = template("<div data-scope=\"dialog\" data-part=\"body\"></div>");
|
|
11
|
+
var _tmpl2 = template("<div data-scope=\"dialog\" data-part=\"header\"><div><!><!></div><!></div>");
|
|
15
12
|
var _tmpl = template("<div><!><!></div>");
|
|
16
13
|
var backdropModalClass = css({
|
|
17
14
|
position: "fixed",
|
|
@@ -140,41 +137,22 @@ var footerBtnClass = css({
|
|
|
140
137
|
justifyContent: "flex-end",
|
|
141
138
|
"&.tsu-dialog-footer--center": { justifyContent: "center" }
|
|
142
139
|
});
|
|
143
|
-
var
|
|
140
|
+
var negativeBtnClass = css({
|
|
144
141
|
flex: 1,
|
|
145
|
-
height: "var(--tsu-comp-height-xl)",
|
|
146
142
|
borderRadius: "var(--tsu-radius-l1-lg)",
|
|
147
143
|
border: "1px solid var(--tsu-neutral-7)",
|
|
148
144
|
background: "transparent",
|
|
149
145
|
color: "var(--tsu-fg)",
|
|
150
146
|
fontSize: "var(--tsu-comp-font-size-lg)",
|
|
151
147
|
fontWeight: "var(--tsu-font-weight-semibold)",
|
|
152
|
-
fontFamily: "inherit"
|
|
153
|
-
cursor: "pointer"
|
|
148
|
+
fontFamily: "inherit"
|
|
154
149
|
});
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
cursor: "not-allowed"
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
var btnDangerClass = css({
|
|
165
|
-
background: "var(--tsu-danger-9)",
|
|
166
|
-
borderColor: "var(--tsu-danger-9)",
|
|
167
|
-
color: "var(--tsu-bg)",
|
|
168
|
-
"&:disabled": {
|
|
169
|
-
opacity: .5,
|
|
170
|
-
cursor: "not-allowed"
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
var positiveLoadingClass = css({
|
|
174
|
-
display: "inline-flex",
|
|
175
|
-
alignItems: "center",
|
|
176
|
-
justifyContent: "center",
|
|
177
|
-
gap: "8px"
|
|
150
|
+
var positiveBtnClass = css({
|
|
151
|
+
flex: 1,
|
|
152
|
+
borderRadius: "var(--tsu-radius-l1-lg)",
|
|
153
|
+
fontSize: "var(--tsu-comp-font-size-lg)",
|
|
154
|
+
fontWeight: "var(--tsu-font-weight-semibold)",
|
|
155
|
+
fontFamily: "inherit"
|
|
178
156
|
});
|
|
179
157
|
var read = (v) => typeof v === "function" ? v() : v;
|
|
180
158
|
var warnedSheetNoTitle = false;
|
|
@@ -241,34 +219,32 @@ var Dialog$1 = (props) => {
|
|
|
241
219
|
const _el0 = _tmpl.cloneNode(true);
|
|
242
220
|
const _el1 = _el0.firstChild;
|
|
243
221
|
const _el2 = _el0.firstChild.nextSibling;
|
|
244
|
-
insert(_el0, () => local.showCancel && ((
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return _el0;
|
|
271
|
-
}), _el2);
|
|
222
|
+
insert(_el0, () => local.showCancel && jsx(Button, mergeProps({
|
|
223
|
+
className: negativeBtnClass,
|
|
224
|
+
"data-part": "negative-trigger",
|
|
225
|
+
get disabled() {
|
|
226
|
+
return read(local.loading);
|
|
227
|
+
},
|
|
228
|
+
onClick: handleCancel,
|
|
229
|
+
size: "xl",
|
|
230
|
+
type: "button",
|
|
231
|
+
children: () => local.cancelText
|
|
232
|
+
})), _el1);
|
|
233
|
+
insert(_el0, () => local.showConfirm && jsx(Button, mergeProps({
|
|
234
|
+
className: positiveBtnClass,
|
|
235
|
+
"data-part": "positive-trigger",
|
|
236
|
+
get danger() {
|
|
237
|
+
return local.danger;
|
|
238
|
+
},
|
|
239
|
+
get loading() {
|
|
240
|
+
return read(local.loading);
|
|
241
|
+
},
|
|
242
|
+
onClick: handleConfirm,
|
|
243
|
+
size: "xl",
|
|
244
|
+
solid: true,
|
|
245
|
+
type: "button",
|
|
246
|
+
children: () => local.confirmText
|
|
247
|
+
})), _el2);
|
|
272
248
|
setProp(_el0, "className", () => onlyOneBtn ? `${footerBtnClass} tsu-dialog-footer--center` : footerBtnClass);
|
|
273
249
|
return _el0;
|
|
274
250
|
} : void 0;
|
|
@@ -305,7 +281,7 @@ var Dialog$1 = (props) => {
|
|
|
305
281
|
},
|
|
306
282
|
children: [
|
|
307
283
|
() => {
|
|
308
|
-
const _el0 =
|
|
284
|
+
const _el0 = _tmpl2.cloneNode(true);
|
|
309
285
|
const _el1 = _el0.firstChild;
|
|
310
286
|
const _el2 = _el1.firstChild;
|
|
311
287
|
const _el3 = _el1.firstChild.nextSibling;
|
|
@@ -334,13 +310,13 @@ var Dialog$1 = (props) => {
|
|
|
334
310
|
return _el0;
|
|
335
311
|
},
|
|
336
312
|
() => {
|
|
337
|
-
const _el0 =
|
|
313
|
+
const _el0 = _tmpl3.cloneNode(true);
|
|
338
314
|
insert(_el0, () => local.children);
|
|
339
315
|
setProp(_el0, "className", () => bodyClass);
|
|
340
316
|
return _el0;
|
|
341
317
|
},
|
|
342
318
|
() => {
|
|
343
|
-
const _el0 =
|
|
319
|
+
const _el0 = _tmpl4.cloneNode(true);
|
|
344
320
|
insert(_el0, () => footerContent);
|
|
345
321
|
setProp(_el0, "className", () => footerClass);
|
|
346
322
|
return _el0;
|