@rockshin/tao-ui 0.0.24 → 0.0.26

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 (76) hide show
  1. package/README.md +17 -6
  2. package/component-manifest.json +534 -6
  3. package/dist/components/alert/alert.css +120 -0
  4. package/dist/components/alert/alert.d.ts +20 -0
  5. package/dist/components/alert/alert.js +185 -0
  6. package/dist/components/button/button.css +19 -18
  7. package/dist/components/button/button.d.ts +8 -0
  8. package/dist/components/date-picker/date-picker.js +1 -1
  9. package/dist/components/date-picker/range-picker.js +1 -1
  10. package/dist/components/dropdown/dropdown.css +22 -1
  11. package/dist/components/dropdown/dropdown.js +4 -3
  12. package/dist/components/form/form-context.d.ts +7 -0
  13. package/dist/components/form/form-context.js +8 -0
  14. package/dist/components/form/form-item.d.ts +55 -0
  15. package/dist/components/form/form-item.js +131 -0
  16. package/dist/components/form/form.css +22 -0
  17. package/dist/components/form/form.d.ts +35 -0
  18. package/dist/components/form/form.js +125 -0
  19. package/dist/components/form/index.d.ts +2 -0
  20. package/dist/components/form/index.js +1 -0
  21. package/dist/components/form-field/form-field-view.d.ts +30 -0
  22. package/dist/components/form-field/form-field-view.js +154 -0
  23. package/dist/components/form-field/form-field.d.ts +2 -2
  24. package/dist/components/form-field/form-field.js +29 -137
  25. package/dist/components/form-field/form.css +17 -7
  26. package/dist/components/input/input.css +18 -8
  27. package/dist/components/modal/confirm-dialog.js +14 -111
  28. package/dist/components/modal/modal.d.ts +7 -1
  29. package/dist/components/modal/modal.js +205 -195
  30. package/dist/components/popconfirm/popconfirm.css +44 -0
  31. package/dist/components/popconfirm/popconfirm.d.ts +41 -0
  32. package/dist/components/popconfirm/popconfirm.js +238 -0
  33. package/dist/components/popover/popover.css +105 -0
  34. package/dist/components/popover/popover.d.ts +41 -0
  35. package/dist/components/popover/popover.js +412 -0
  36. package/dist/components/select/select.js +1 -1
  37. package/dist/components/status-icon/status-icon.d.ts +5 -0
  38. package/dist/components/status-icon/status-icon.js +77 -0
  39. package/dist/components/table/table-types.d.ts +7 -0
  40. package/dist/components/table/table.d.ts +1 -1
  41. package/dist/components/table/table.js +296 -283
  42. package/dist/components/tooltip/tooltip.css +93 -0
  43. package/dist/components/tooltip/tooltip.d.ts +33 -0
  44. package/dist/components/tooltip/tooltip.js +226 -0
  45. package/dist/docs/components/alert.doc.d.ts +29 -0
  46. package/dist/docs/components/alert.doc.js +93 -0
  47. package/dist/docs/components/form.doc.d.ts +29 -0
  48. package/dist/docs/components/form.doc.js +71 -0
  49. package/dist/docs/components/modal.doc.d.ts +6 -0
  50. package/dist/docs/components/modal.doc.js +9 -1
  51. package/dist/docs/components/popconfirm.doc.d.ts +29 -0
  52. package/dist/docs/components/popconfirm.doc.js +132 -0
  53. package/dist/docs/components/popover.doc.d.ts +29 -0
  54. package/dist/docs/components/popover.doc.js +121 -0
  55. package/dist/docs/components/stack.doc.d.ts +6 -0
  56. package/dist/docs/components/stack.doc.js +23 -2
  57. package/dist/docs/components/table.doc.js +2 -1
  58. package/dist/docs/components/tao-provider.doc.js +11 -1
  59. package/dist/docs/components/tooltip.doc.d.ts +37 -0
  60. package/dist/docs/components/tooltip.doc.js +76 -0
  61. package/dist/index.d.ts +9 -1
  62. package/dist/index.js +8 -1
  63. package/dist/layouts/stack/stack.d.ts +12 -3
  64. package/dist/layouts/stack/stack.js +60 -34
  65. package/dist/provider/tao-provider.d.ts +71 -0
  66. package/dist/provider/tao-provider.js +166 -120
  67. package/dist/theme/control.css +12 -12
  68. package/dist/theme/theme.css +23 -0
  69. package/dist/utils/breakpoint.d.ts +31 -0
  70. package/dist/utils/breakpoint.js +80 -0
  71. package/dist/utils/overlay.d.ts +19 -0
  72. package/dist/utils/overlay.js +41 -0
  73. package/llms.txt +68 -3
  74. package/package.json +6 -4
  75. package/dist/components/select/use-is-mobile.d.ts +0 -1
  76. package/dist/components/select/use-is-mobile.js +0 -27
@@ -2,13 +2,14 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useEffect, useRef } from "react";
4
4
  import { TaoPortalScope } from "../../provider/tao-provider.js";
5
+ import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js";
5
6
  import { preventParentOutsideDismiss } from "../../utils/portal.js";
6
7
  import { cx } from "../../utils/semantic.js";
7
8
  import { Button } from "../button/button.js";
8
9
  import "./modal.css";
9
10
  import * as __rspack_external__radix_ui_react_dialog_dabd8325 from "@radix-ui/react-dialog";
10
11
  function Modal(t0) {
11
- const $ = c(83);
12
+ const $ = c(86);
12
13
  const { open, onClose, title, footer, onOk, okText: t1, cancelText: t2, confirmLoading, okButtonProps, cancelButtonProps, width: t3, centered: t4, closable: t5, maskClosable: t6, keyboard: t7, afterClose, destroyOnHidden: t8, children, classNames, styles: stylesProp } = t0;
13
14
  const okText = void 0 === t1 ? "OK" : t1;
14
15
  const cancelText = void 0 === t2 ? "Cancel" : t2;
@@ -39,145 +40,154 @@ function Modal(t0) {
39
40
  t9 = $[3];
40
41
  }
41
42
  useEffect(t9, t10);
42
- const t11 = "number" == typeof width ? `${width}px` : width;
43
- const t12 = stylesProp?.root;
44
- let t13;
45
- if ($[4] !== t11 || $[5] !== t12) {
46
- t13 = {
47
- width: t11,
48
- ...t12
49
- };
50
- $[4] = t11;
51
- $[5] = t12;
52
- $[6] = t13;
53
- } else t13 = $[6];
54
- const contentStyle = t13;
43
+ const screens = useBreakpoint();
44
+ let t11;
45
+ if ($[4] !== screens || $[5] !== width) {
46
+ t11 = resolveResponsiveValue(width, screens) ?? 520;
47
+ $[4] = screens;
48
+ $[5] = width;
49
+ $[6] = t11;
50
+ } else t11 = $[6];
51
+ const resolvedWidth = t11;
52
+ const t12 = "number" == typeof resolvedWidth ? `${resolvedWidth}px` : resolvedWidth;
53
+ const t13 = stylesProp?.root;
55
54
  let t14;
56
- if ($[7] !== cancelButtonProps || $[8] !== cancelText || $[9] !== onClose) {
57
- t14 = ()=>/*#__PURE__*/ jsx(Button, {
55
+ if ($[7] !== t12 || $[8] !== t13) {
56
+ t14 = {
57
+ width: t12,
58
+ ...t13
59
+ };
60
+ $[7] = t12;
61
+ $[8] = t13;
62
+ $[9] = t14;
63
+ } else t14 = $[9];
64
+ const contentStyle = t14;
65
+ let t15;
66
+ if ($[10] !== cancelButtonProps || $[11] !== cancelText || $[12] !== onClose) {
67
+ t15 = ()=>/*#__PURE__*/ jsx(Button, {
58
68
  variant: "secondary",
59
69
  onClick: onClose,
60
70
  ...cancelButtonProps,
61
71
  children: cancelText
62
72
  });
63
- $[7] = cancelButtonProps;
64
- $[8] = cancelText;
65
- $[9] = onClose;
66
- $[10] = t14;
67
- } else t14 = $[10];
68
- const CancelBtn = t14;
69
- let t15;
70
- if ($[11] !== confirmLoading || $[12] !== okButtonProps || $[13] !== okText || $[14] !== onOk) {
71
- t15 = ()=>/*#__PURE__*/ jsx(Button, {
73
+ $[10] = cancelButtonProps;
74
+ $[11] = cancelText;
75
+ $[12] = onClose;
76
+ $[13] = t15;
77
+ } else t15 = $[13];
78
+ const CancelBtn = t15;
79
+ let t16;
80
+ if ($[14] !== confirmLoading || $[15] !== okButtonProps || $[16] !== okText || $[17] !== onOk) {
81
+ t16 = ()=>/*#__PURE__*/ jsx(Button, {
72
82
  variant: "primary",
73
83
  loading: confirmLoading,
74
84
  onClick: onOk,
75
85
  ...okButtonProps,
76
86
  children: okText
77
87
  });
78
- $[11] = confirmLoading;
79
- $[12] = okButtonProps;
80
- $[13] = okText;
81
- $[14] = onOk;
82
- $[15] = t15;
83
- } else t15 = $[15];
84
- const OkBtn = t15;
85
- let t16;
86
- if ($[16] !== CancelBtn) {
87
- t16 = /*#__PURE__*/ jsx(CancelBtn, {});
88
- $[16] = CancelBtn;
89
- $[17] = t16;
90
- } else t16 = $[17];
88
+ $[14] = confirmLoading;
89
+ $[15] = okButtonProps;
90
+ $[16] = okText;
91
+ $[17] = onOk;
92
+ $[18] = t16;
93
+ } else t16 = $[18];
94
+ const OkBtn = t16;
91
95
  let t17;
92
- if ($[18] !== OkBtn) {
93
- t17 = /*#__PURE__*/ jsx(OkBtn, {});
94
- $[18] = OkBtn;
95
- $[19] = t17;
96
- } else t17 = $[19];
96
+ if ($[19] !== CancelBtn) {
97
+ t17 = /*#__PURE__*/ jsx(CancelBtn, {});
98
+ $[19] = CancelBtn;
99
+ $[20] = t17;
100
+ } else t17 = $[20];
97
101
  let t18;
98
- if ($[20] !== t16 || $[21] !== t17) {
99
- t18 = /*#__PURE__*/ jsxs(Fragment, {
102
+ if ($[21] !== OkBtn) {
103
+ t18 = /*#__PURE__*/ jsx(OkBtn, {});
104
+ $[21] = OkBtn;
105
+ $[22] = t18;
106
+ } else t18 = $[22];
107
+ let t19;
108
+ if ($[23] !== t17 || $[24] !== t18) {
109
+ t19 = /*#__PURE__*/ jsxs(Fragment, {
100
110
  children: [
101
- t16,
102
- t17
111
+ t17,
112
+ t18
103
113
  ]
104
114
  });
105
- $[20] = t16;
106
- $[21] = t17;
107
- $[22] = t18;
108
- } else t18 = $[22];
109
- const defaultFooter = t18;
115
+ $[23] = t17;
116
+ $[24] = t18;
117
+ $[25] = t19;
118
+ } else t19 = $[25];
119
+ const defaultFooter = t19;
110
120
  let footerContent;
111
121
  if (void 0 === footer) footerContent = defaultFooter;
112
122
  else if ("function" == typeof footer) {
113
- let t19;
114
- if ($[23] !== CancelBtn || $[24] !== OkBtn || $[25] !== defaultFooter || $[26] !== footer) {
115
- t19 = footer(defaultFooter, {
123
+ let t20;
124
+ if ($[26] !== CancelBtn || $[27] !== OkBtn || $[28] !== defaultFooter || $[29] !== footer) {
125
+ t20 = footer(defaultFooter, {
116
126
  OkBtn,
117
127
  CancelBtn
118
128
  });
119
- $[23] = CancelBtn;
120
- $[24] = OkBtn;
121
- $[25] = defaultFooter;
122
- $[26] = footer;
123
- $[27] = t19;
124
- } else t19 = $[27];
125
- footerContent = t19;
129
+ $[26] = CancelBtn;
130
+ $[27] = OkBtn;
131
+ $[28] = defaultFooter;
132
+ $[29] = footer;
133
+ $[30] = t20;
134
+ } else t20 = $[30];
135
+ footerContent = t20;
126
136
  } else footerContent = footer;
127
137
  const keepAlive = !destroyOnHidden;
128
138
  const forceMount = keepAlive ? true : void 0;
129
- let t19;
130
- if ($[28] !== onClose) {
131
- t19 = (v)=>{
139
+ let t20;
140
+ if ($[31] !== onClose) {
141
+ t20 = (v)=>{
132
142
  if (!v) onClose?.();
133
143
  };
134
- $[28] = onClose;
135
- $[29] = t19;
136
- } else t19 = $[29];
137
- const t20 = classNames?.overlay;
138
- let t21;
139
- if ($[30] !== t20) {
140
- t21 = cx(t20);
141
- $[30] = t20;
142
- $[31] = t21;
143
- } else t21 = $[31];
144
- const t22 = stylesProp?.overlay;
145
- const t23 = maskClosable ? onClose : void 0;
146
- let t24;
147
- if ($[32] !== forceMount || $[33] !== t21 || $[34] !== t22 || $[35] !== t23) {
148
- t24 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
144
+ $[31] = onClose;
145
+ $[32] = t20;
146
+ } else t20 = $[32];
147
+ const t21 = classNames?.overlay;
148
+ let t22;
149
+ if ($[33] !== t21) {
150
+ t22 = cx(t21);
151
+ $[33] = t21;
152
+ $[34] = t22;
153
+ } else t22 = $[34];
154
+ const t23 = stylesProp?.overlay;
155
+ const t24 = maskClosable ? onClose : void 0;
156
+ let t25;
157
+ if ($[35] !== forceMount || $[36] !== t22 || $[37] !== t23 || $[38] !== t24) {
158
+ t25 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
149
159
  forceMount: forceMount,
150
160
  "data-tao-modal-overlay": "",
151
- className: t21,
152
- style: t22,
153
- onClick: t23
161
+ className: t22,
162
+ style: t23,
163
+ onClick: t24
154
164
  });
155
- $[32] = forceMount;
156
- $[33] = t21;
157
- $[34] = t22;
158
- $[35] = t23;
159
- $[36] = t24;
160
- } else t24 = $[36];
161
- const t25 = centered ? "" : void 0;
162
- const t26 = open ? "" : void 0;
163
- const t27 = classNames?.root;
164
- let t28;
165
- if ($[37] !== t27) {
166
- t28 = cx(t27);
167
- $[37] = t27;
168
- $[38] = t28;
169
- } else t28 = $[38];
165
+ $[35] = forceMount;
166
+ $[36] = t22;
167
+ $[37] = t23;
168
+ $[38] = t24;
169
+ $[39] = t25;
170
+ } else t25 = $[39];
171
+ const t26 = centered ? "" : void 0;
172
+ const t27 = open ? "" : void 0;
173
+ const t28 = classNames?.root;
170
174
  let t29;
171
- if ($[39] !== keyboard) {
172
- t29 = (e)=>{
175
+ if ($[40] !== t28) {
176
+ t29 = cx(t28);
177
+ $[40] = t28;
178
+ $[41] = t29;
179
+ } else t29 = $[41];
180
+ let t30;
181
+ if ($[42] !== keyboard) {
182
+ t30 = (e)=>{
173
183
  if (!keyboard) e.preventDefault();
174
184
  };
175
- $[39] = keyboard;
176
- $[40] = t29;
177
- } else t29 = $[40];
178
- let t30;
179
- if ($[41] !== classNames?.close || $[42] !== classNames?.header || $[43] !== classNames?.title || $[44] !== closable || $[45] !== onClose || $[46] !== stylesProp?.close || $[47] !== stylesProp?.header || $[48] !== stylesProp?.title || $[49] !== title) {
180
- t30 = (null != title || closable) && /*#__PURE__*/ jsxs("div", {
185
+ $[42] = keyboard;
186
+ $[43] = t30;
187
+ } else t30 = $[43];
188
+ let t31;
189
+ if ($[44] !== classNames?.close || $[45] !== classNames?.header || $[46] !== classNames?.title || $[47] !== closable || $[48] !== onClose || $[49] !== stylesProp?.close || $[50] !== stylesProp?.header || $[51] !== stylesProp?.title || $[52] !== title) {
190
+ t31 = (null != title || closable) && /*#__PURE__*/ jsxs("div", {
181
191
  "data-tao-modal-header": "",
182
192
  className: cx(classNames?.header),
183
193
  style: stylesProp?.header,
@@ -204,125 +214,125 @@ function Modal(t0) {
204
214
  })
205
215
  ]
206
216
  });
207
- $[41] = classNames?.close;
208
- $[42] = classNames?.header;
209
- $[43] = classNames?.title;
210
- $[44] = closable;
211
- $[45] = onClose;
212
- $[46] = stylesProp?.close;
213
- $[47] = stylesProp?.header;
214
- $[48] = stylesProp?.title;
215
- $[49] = title;
216
- $[50] = t30;
217
- } else t30 = $[50];
218
- const t31 = classNames?.body;
219
- let t32;
220
- if ($[51] !== t31) {
221
- t32 = cx(t31);
222
- $[51] = t31;
223
- $[52] = t32;
224
- } else t32 = $[52];
225
- const t33 = stylesProp?.body;
226
- let t34;
227
- if ($[53] !== children || $[54] !== t32 || $[55] !== t33) {
228
- t34 = /*#__PURE__*/ jsx("div", {
229
- "data-tao-modal-body": "",
230
- className: t32,
231
- style: t33,
232
- children: children
233
- });
234
- $[53] = children;
217
+ $[44] = classNames?.close;
218
+ $[45] = classNames?.header;
219
+ $[46] = classNames?.title;
220
+ $[47] = closable;
221
+ $[48] = onClose;
222
+ $[49] = stylesProp?.close;
223
+ $[50] = stylesProp?.header;
224
+ $[51] = stylesProp?.title;
225
+ $[52] = title;
226
+ $[53] = t31;
227
+ } else t31 = $[53];
228
+ const t32 = classNames?.body;
229
+ let t33;
230
+ if ($[54] !== t32) {
231
+ t33 = cx(t32);
235
232
  $[54] = t32;
236
233
  $[55] = t33;
237
- $[56] = t34;
238
- } else t34 = $[56];
234
+ } else t33 = $[55];
235
+ const t34 = stylesProp?.body;
239
236
  let t35;
240
- if ($[57] !== classNames?.footer || $[58] !== footerContent || $[59] !== stylesProp?.footer) {
241
- t35 = null != footerContent && /*#__PURE__*/ jsx("div", {
237
+ if ($[56] !== children || $[57] !== t33 || $[58] !== t34) {
238
+ t35 = /*#__PURE__*/ jsx("div", {
239
+ "data-tao-modal-body": "",
240
+ className: t33,
241
+ style: t34,
242
+ children: children
243
+ });
244
+ $[56] = children;
245
+ $[57] = t33;
246
+ $[58] = t34;
247
+ $[59] = t35;
248
+ } else t35 = $[59];
249
+ let t36;
250
+ if ($[60] !== classNames?.footer || $[61] !== footerContent || $[62] !== stylesProp?.footer) {
251
+ t36 = null != footerContent && /*#__PURE__*/ jsx("div", {
242
252
  "data-tao-modal-footer": "",
243
253
  className: cx(classNames?.footer),
244
254
  style: stylesProp?.footer,
245
255
  children: footerContent
246
256
  });
247
- $[57] = classNames?.footer;
248
- $[58] = footerContent;
249
- $[59] = stylesProp?.footer;
250
- $[60] = t35;
251
- } else t35 = $[60];
252
- let t36;
253
- if ($[61] !== contentStyle || $[62] !== forceMount || $[63] !== t28 || $[64] !== t29 || $[65] !== t30 || $[66] !== t34 || $[67] !== t35) {
254
- t36 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dialog_dabd8325.Content, {
257
+ $[60] = classNames?.footer;
258
+ $[61] = footerContent;
259
+ $[62] = stylesProp?.footer;
260
+ $[63] = t36;
261
+ } else t36 = $[63];
262
+ let t37;
263
+ if ($[64] !== contentStyle || $[65] !== forceMount || $[66] !== t29 || $[67] !== t30 || $[68] !== t31 || $[69] !== t35 || $[70] !== t36) {
264
+ t37 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dialog_dabd8325.Content, {
255
265
  forceMount: forceMount,
256
266
  "data-tao-modal": "",
257
267
  style: contentStyle,
258
- className: t28,
268
+ className: t29,
259
269
  "aria-describedby": void 0,
260
- onEscapeKeyDown: t29,
270
+ onEscapeKeyDown: t30,
261
271
  onPointerDownOutside: preventParentOutsideDismiss,
262
272
  onInteractOutside: preventParentOutsideDismiss,
263
273
  children: [
264
- t30,
265
- t34,
266
- t35
274
+ t31,
275
+ t35,
276
+ t36
267
277
  ]
268
278
  });
269
- $[61] = contentStyle;
270
- $[62] = forceMount;
271
- $[63] = t28;
272
- $[64] = t29;
273
- $[65] = t30;
274
- $[66] = t34;
275
- $[67] = t35;
276
- $[68] = t36;
277
- } else t36 = $[68];
278
- let t37;
279
- if ($[69] !== t25 || $[70] !== t26 || $[71] !== t36) {
280
- t37 = /*#__PURE__*/ jsx("div", {
281
- "data-tao-modal-wrap": "",
282
- "data-tao-centered": t25,
283
- "data-tao-open": t26,
284
- children: t36
285
- });
286
- $[69] = t25;
287
- $[70] = t26;
288
- $[71] = t36;
289
- $[72] = t37;
290
- } else t37 = $[72];
279
+ $[64] = contentStyle;
280
+ $[65] = forceMount;
281
+ $[66] = t29;
282
+ $[67] = t30;
283
+ $[68] = t31;
284
+ $[69] = t35;
285
+ $[70] = t36;
286
+ $[71] = t37;
287
+ } else t37 = $[71];
291
288
  let t38;
292
- if ($[73] !== t24 || $[74] !== t37) {
293
- t38 = /*#__PURE__*/ jsxs(TaoPortalScope, {
294
- children: [
295
- t24,
296
- t37
297
- ]
289
+ if ($[72] !== t26 || $[73] !== t27 || $[74] !== t37) {
290
+ t38 = /*#__PURE__*/ jsx("div", {
291
+ "data-tao-modal-wrap": "",
292
+ "data-tao-centered": t26,
293
+ "data-tao-open": t27,
294
+ children: t37
298
295
  });
299
- $[73] = t24;
296
+ $[72] = t26;
297
+ $[73] = t27;
300
298
  $[74] = t37;
301
299
  $[75] = t38;
302
300
  } else t38 = $[75];
303
301
  let t39;
304
- if ($[76] !== forceMount || $[77] !== t38) {
305
- t39 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
306
- forceMount: forceMount,
307
- children: t38
302
+ if ($[76] !== t25 || $[77] !== t38) {
303
+ t39 = /*#__PURE__*/ jsxs(TaoPortalScope, {
304
+ children: [
305
+ t25,
306
+ t38
307
+ ]
308
308
  });
309
- $[76] = forceMount;
309
+ $[76] = t25;
310
310
  $[77] = t38;
311
311
  $[78] = t39;
312
312
  } else t39 = $[78];
313
313
  let t40;
314
- if ($[79] !== open || $[80] !== t19 || $[81] !== t39) {
315
- t40 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
316
- open: open,
317
- onOpenChange: t19,
314
+ if ($[79] !== forceMount || $[80] !== t39) {
315
+ t40 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
316
+ forceMount: forceMount,
318
317
  children: t39
319
318
  });
320
- $[79] = open;
321
- $[80] = t19;
322
- $[81] = t39;
323
- $[82] = t40;
324
- } else t40 = $[82];
325
- return t40;
319
+ $[79] = forceMount;
320
+ $[80] = t39;
321
+ $[81] = t40;
322
+ } else t40 = $[81];
323
+ let t41;
324
+ if ($[82] !== open || $[83] !== t20 || $[84] !== t40) {
325
+ t41 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
326
+ open: open,
327
+ onOpenChange: t20,
328
+ children: t40
329
+ });
330
+ $[82] = open;
331
+ $[83] = t20;
332
+ $[84] = t40;
333
+ $[85] = t41;
334
+ } else t41 = $[85];
335
+ return t41;
326
336
  }
327
337
  function CloseIcon() {
328
338
  const $ = c(1);
@@ -0,0 +1,44 @@
1
+ [data-tao-popconfirm] {
2
+ box-sizing: border-box;
3
+ max-width: 260px;
4
+ font-family: var(--tao-font-family);
5
+ font-size: var(--tao-font-size-base);
6
+ line-height: var(--tao-line-height);
7
+ color: var(--tao-color-text);
8
+ }
9
+
10
+ [data-tao-popconfirm-message] {
11
+ align-items: flex-start;
12
+ gap: var(--tao-padding-xs);
13
+ display: flex;
14
+ }
15
+
16
+ [data-tao-popconfirm-icon] {
17
+ color: var(--tao-warning);
18
+ flex-shrink: 0;
19
+ margin-block-start: 2px;
20
+ display: inline-flex;
21
+ }
22
+
23
+ [data-tao-popconfirm-text] {
24
+ flex: 1;
25
+ min-width: 0;
26
+ }
27
+
28
+ [data-tao-popconfirm-title] {
29
+ font-weight: var(--tao-font-weight-strong);
30
+ color: var(--tao-color-text);
31
+ }
32
+
33
+ [data-tao-popconfirm-description] {
34
+ color: var(--tao-color-text-secondary);
35
+ margin-block-start: var(--tao-padding-xs);
36
+ }
37
+
38
+ [data-tao-popconfirm-footer] {
39
+ justify-content: flex-end;
40
+ gap: var(--tao-padding-xs);
41
+ margin-block-start: var(--tao-padding-sm);
42
+ display: flex;
43
+ }
44
+
@@ -0,0 +1,41 @@
1
+ import type { CSSProperties, MouseEvent, ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
3
+ import { type ButtonProps } from '../button/button';
4
+ import { type PopoverPlacement } from '../popover/popover';
5
+ import './popconfirm.css';
6
+ export type PopconfirmSemanticPart = 'content' | 'title' | 'description' | 'footer' | 'icon';
7
+ export interface PopconfirmProps {
8
+ /** Main question text of the confirm popup (required, antd parity). */
9
+ title: ReactNode;
10
+ /** Secondary text shown under the title. */
11
+ description?: ReactNode;
12
+ /** Called when OK is clicked; the popup also closes. */
13
+ onConfirm?: (e?: MouseEvent<HTMLElement>) => void;
14
+ /** Called when Cancel is clicked; the popup also closes. */
15
+ onCancel?: (e?: MouseEvent<HTMLElement>) => void;
16
+ /** Text of the OK button. Defaults to `'OK'`. */
17
+ okText?: ReactNode;
18
+ /** Text of the Cancel button. Defaults to `'Cancel'`. */
19
+ cancelText?: ReactNode;
20
+ /** Extra props forwarded to the OK button. */
21
+ okButtonProps?: ButtonProps;
22
+ /** Extra props forwarded to the Cancel button. */
23
+ cancelButtonProps?: ButtonProps;
24
+ /** Icon shown before the title. Defaults to a warning triangle; pass `null` to hide it. */
25
+ icon?: ReactNode | null;
26
+ /** When true, the trigger still renders but the popup never opens. */
27
+ disabled?: boolean;
28
+ open?: boolean;
29
+ defaultOpen?: boolean;
30
+ onOpenChange?: (open: boolean) => void;
31
+ /** Popup side relative to the trigger. Defaults to `'top'`. */
32
+ placement?: PopoverPlacement;
33
+ /** Merged onto the confirm content wrapper. */
34
+ className?: string;
35
+ style?: CSSProperties;
36
+ classNames?: SemanticClassNames<PopconfirmSemanticPart>;
37
+ styles?: SemanticStyles<PopconfirmSemanticPart>;
38
+ /** Exactly one trigger element. */
39
+ children: ReactNode;
40
+ }
41
+ export declare function Popconfirm({ title, description, onConfirm, onCancel, okText, cancelText, okButtonProps, cancelButtonProps, icon, disabled, open, defaultOpen, onOpenChange, placement, className, style, classNames, styles, children, }: PopconfirmProps): import("react/jsx-runtime").JSX.Element;