@rubenpazch/confirmation-dialog 3.0.0 → 3.1.0
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/README.md +33 -0
- package/dist/ConfirmationDialog.d.ts +18 -4
- package/dist/ConfirmationDialog.d.ts.map +1 -1
- package/dist/index.cjs.js +11 -468
- package/dist/index.d.ts +17 -2
- package/dist/index.esm.js +11 -468
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
1
|
# ConfirmationDialog
|
|
2
2
|
|
|
3
3
|
Generated component package.
|
|
4
|
+
|
|
5
|
+
<!-- catalogo:inicio (generado por pnpm catalogo, no editar) -->
|
|
6
|
+
|
|
7
|
+
Diálogo modal de confirmación (aceptar/cancelar).
|
|
8
|
+
|
|
9
|
+
- **Usar cuando:** Confirmar acciones destructivas o irreversibles (eliminar, anular, cerrar periodo).
|
|
10
|
+
- **Evitar cuando:** Mostrar formularios o contenido largo: usa Drawer.
|
|
11
|
+
|
|
12
|
+
Se recomienda instalar el paquete completo `@rubenpazch/ui` (incluye este). Por separado:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @rubenpazch/confirmation-dialog
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## ConfirmationDialog
|
|
19
|
+
|
|
20
|
+
Diálogo de confirmación (alertdialog) sobre Modal: foco retenido, Escape para cancelar y
|
|
21
|
+
el foco inicial en "Cancelar", la opción segura.
|
|
22
|
+
|
|
23
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
24
|
+
| ------------- | ------------ | ---- | ----------- | -------------------------------------------------------------------- |
|
|
25
|
+
| `isOpen` | `boolean` | sí | | Si el diálogo está abierto. |
|
|
26
|
+
| `message` | `ReactNode` | sí | | Explicación de la consecuencia. |
|
|
27
|
+
| `onCancel` | `() => void` | sí | | Al cancelar, pulsar Escape o hacer clic fuera (si no está cargando). |
|
|
28
|
+
| `onConfirm` | `() => void` | sí | | Al confirmar. |
|
|
29
|
+
| `title` | `string` | sí | | Pregunta o título: "¿Eliminar la convocatoria?". |
|
|
30
|
+
| `cancelText` | `string` | | `Cancelar` | Texto del botón de cancelar (por defecto "Cancelar"). |
|
|
31
|
+
| `children` | `ReactNode` | | | Contenido extra bajo el mensaje (p. ej. un campo "motivo"). |
|
|
32
|
+
| `confirmText` | `string` | | `Confirmar` | Texto del botón de confirmar (por defecto "Confirmar"). |
|
|
33
|
+
| `isDangerous` | `boolean` | | `false` | Acción destructiva: botón rojo. |
|
|
34
|
+
| `isLoading` | `boolean` | | `false` | Muestra el botón de confirmar cargando y bloquea los botones. |
|
|
35
|
+
|
|
36
|
+
<!-- catalogo:fin -->
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
interface ConfirmationDialogProps {
|
|
2
|
+
export interface ConfirmationDialogProps {
|
|
3
|
+
/** Si el diálogo está abierto. */
|
|
3
4
|
isOpen: boolean;
|
|
5
|
+
/** Pregunta o título: "¿Eliminar la convocatoria?". */
|
|
4
6
|
title: string;
|
|
5
|
-
|
|
7
|
+
/** Explicación de la consecuencia. */
|
|
8
|
+
message: React.ReactNode;
|
|
9
|
+
/** Texto del botón de confirmar (por defecto "Confirmar"). */
|
|
6
10
|
confirmText?: string;
|
|
11
|
+
/** Texto del botón de cancelar (por defecto "Cancelar"). */
|
|
7
12
|
cancelText?: string;
|
|
13
|
+
/** Acción destructiva: botón rojo. */
|
|
8
14
|
isDangerous?: boolean;
|
|
15
|
+
/** Muestra el botón de confirmar cargando y bloquea los botones. */
|
|
9
16
|
isLoading?: boolean;
|
|
17
|
+
/** Al confirmar. */
|
|
10
18
|
onConfirm: () => void;
|
|
19
|
+
/** Al cancelar, pulsar Escape o hacer clic fuera (si no está cargando). */
|
|
11
20
|
onCancel: () => void;
|
|
21
|
+
/** Contenido extra bajo el mensaje (p. ej. un campo "motivo"). */
|
|
22
|
+
children?: React.ReactNode;
|
|
12
23
|
}
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Diálogo de confirmación (alertdialog) sobre Modal: foco retenido, Escape para cancelar y
|
|
26
|
+
* el foco inicial en "Cancelar", la opción segura.
|
|
27
|
+
*/
|
|
28
|
+
export default function ConfirmationDialog({ isOpen, title, message, confirmText, cancelText, isDangerous, isLoading, onConfirm, onCancel, children, }: ConfirmationDialogProps): React.JSX.Element;
|
|
15
29
|
//# sourceMappingURL=ConfirmationDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../src/ConfirmationDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../src/ConfirmationDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAyB,EACzB,UAAuB,EACvB,WAAmB,EACnB,SAAiB,EACjB,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE,uBAAuB,qBAuCzB"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,476 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var reactJsxRuntime_production = {};
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Button = require('@rubenpazch/button');
|
|
5
|
+
var Modal = require('@rubenpazch/modal');
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
* Diálogo de confirmación (alertdialog) sobre Modal: foco retenido, Escape para cancelar y
|
|
9
|
+
* el foco inicial en "Cancelar", la opción segura.
|
|
17
10
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
25
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
26
|
-
function jsxProd(type, config, maybeKey) {
|
|
27
|
-
var key = null;
|
|
28
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
29
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
30
|
-
if ("key" in config) {
|
|
31
|
-
maybeKey = {};
|
|
32
|
-
for (var propName in config)
|
|
33
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
34
|
-
} else maybeKey = config;
|
|
35
|
-
config = maybeKey.ref;
|
|
36
|
-
return {
|
|
37
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
38
|
-
type: type,
|
|
39
|
-
key: key,
|
|
40
|
-
ref: void 0 !== config ? config : null,
|
|
41
|
-
props: maybeKey
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
45
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
46
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
47
|
-
return reactJsxRuntime_production;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var reactJsxRuntime_development = {};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @license React
|
|
54
|
-
* react-jsx-runtime.development.js
|
|
55
|
-
*
|
|
56
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
57
|
-
*
|
|
58
|
-
* This source code is licensed under the MIT license found in the
|
|
59
|
-
* LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
var hasRequiredReactJsxRuntime_development;
|
|
63
|
-
|
|
64
|
-
function requireReactJsxRuntime_development () {
|
|
65
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
66
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
67
|
-
"production" !== process.env.NODE_ENV &&
|
|
68
|
-
(function () {
|
|
69
|
-
function getComponentNameFromType(type) {
|
|
70
|
-
if (null == type) return null;
|
|
71
|
-
if ("function" === typeof type)
|
|
72
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
73
|
-
? null
|
|
74
|
-
: type.displayName || type.name || null;
|
|
75
|
-
if ("string" === typeof type) return type;
|
|
76
|
-
switch (type) {
|
|
77
|
-
case REACT_FRAGMENT_TYPE:
|
|
78
|
-
return "Fragment";
|
|
79
|
-
case REACT_PROFILER_TYPE:
|
|
80
|
-
return "Profiler";
|
|
81
|
-
case REACT_STRICT_MODE_TYPE:
|
|
82
|
-
return "StrictMode";
|
|
83
|
-
case REACT_SUSPENSE_TYPE:
|
|
84
|
-
return "Suspense";
|
|
85
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
86
|
-
return "SuspenseList";
|
|
87
|
-
case REACT_ACTIVITY_TYPE:
|
|
88
|
-
return "Activity";
|
|
89
|
-
}
|
|
90
|
-
if ("object" === typeof type)
|
|
91
|
-
switch (
|
|
92
|
-
("number" === typeof type.tag &&
|
|
93
|
-
console.error(
|
|
94
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
95
|
-
),
|
|
96
|
-
type.$$typeof)
|
|
97
|
-
) {
|
|
98
|
-
case REACT_PORTAL_TYPE:
|
|
99
|
-
return "Portal";
|
|
100
|
-
case REACT_CONTEXT_TYPE:
|
|
101
|
-
return type.displayName || "Context";
|
|
102
|
-
case REACT_CONSUMER_TYPE:
|
|
103
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
104
|
-
case REACT_FORWARD_REF_TYPE:
|
|
105
|
-
var innerType = type.render;
|
|
106
|
-
type = type.displayName;
|
|
107
|
-
type ||
|
|
108
|
-
((type = innerType.displayName || innerType.name || ""),
|
|
109
|
-
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
110
|
-
return type;
|
|
111
|
-
case REACT_MEMO_TYPE:
|
|
112
|
-
return (
|
|
113
|
-
(innerType = type.displayName || null),
|
|
114
|
-
null !== innerType
|
|
115
|
-
? innerType
|
|
116
|
-
: getComponentNameFromType(type.type) || "Memo"
|
|
117
|
-
);
|
|
118
|
-
case REACT_LAZY_TYPE:
|
|
119
|
-
innerType = type._payload;
|
|
120
|
-
type = type._init;
|
|
121
|
-
try {
|
|
122
|
-
return getComponentNameFromType(type(innerType));
|
|
123
|
-
} catch (x) {}
|
|
124
|
-
}
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
function testStringCoercion(value) {
|
|
128
|
-
return "" + value;
|
|
129
|
-
}
|
|
130
|
-
function checkKeyStringCoercion(value) {
|
|
131
|
-
try {
|
|
132
|
-
testStringCoercion(value);
|
|
133
|
-
var JSCompiler_inline_result = !1;
|
|
134
|
-
} catch (e) {
|
|
135
|
-
JSCompiler_inline_result = true;
|
|
136
|
-
}
|
|
137
|
-
if (JSCompiler_inline_result) {
|
|
138
|
-
JSCompiler_inline_result = console;
|
|
139
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
140
|
-
var JSCompiler_inline_result$jscomp$0 =
|
|
141
|
-
("function" === typeof Symbol &&
|
|
142
|
-
Symbol.toStringTag &&
|
|
143
|
-
value[Symbol.toStringTag]) ||
|
|
144
|
-
value.constructor.name ||
|
|
145
|
-
"Object";
|
|
146
|
-
JSCompiler_temp_const.call(
|
|
147
|
-
JSCompiler_inline_result,
|
|
148
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
149
|
-
JSCompiler_inline_result$jscomp$0
|
|
150
|
-
);
|
|
151
|
-
return testStringCoercion(value);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function getTaskName(type) {
|
|
155
|
-
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
156
|
-
if (
|
|
157
|
-
"object" === typeof type &&
|
|
158
|
-
null !== type &&
|
|
159
|
-
type.$$typeof === REACT_LAZY_TYPE
|
|
160
|
-
)
|
|
161
|
-
return "<...>";
|
|
162
|
-
try {
|
|
163
|
-
var name = getComponentNameFromType(type);
|
|
164
|
-
return name ? "<" + name + ">" : "<...>";
|
|
165
|
-
} catch (x) {
|
|
166
|
-
return "<...>";
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function getOwner() {
|
|
170
|
-
var dispatcher = ReactSharedInternals.A;
|
|
171
|
-
return null === dispatcher ? null : dispatcher.getOwner();
|
|
172
|
-
}
|
|
173
|
-
function UnknownOwner() {
|
|
174
|
-
return Error("react-stack-top-frame");
|
|
175
|
-
}
|
|
176
|
-
function hasValidKey(config) {
|
|
177
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
178
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
179
|
-
if (getter && getter.isReactWarning) return false;
|
|
180
|
-
}
|
|
181
|
-
return void 0 !== config.key;
|
|
182
|
-
}
|
|
183
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
184
|
-
function warnAboutAccessingKey() {
|
|
185
|
-
specialPropKeyWarningShown ||
|
|
186
|
-
((specialPropKeyWarningShown = true),
|
|
187
|
-
console.error(
|
|
188
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
189
|
-
displayName
|
|
190
|
-
));
|
|
191
|
-
}
|
|
192
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
193
|
-
Object.defineProperty(props, "key", {
|
|
194
|
-
get: warnAboutAccessingKey,
|
|
195
|
-
configurable: true
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
199
|
-
var componentName = getComponentNameFromType(this.type);
|
|
200
|
-
didWarnAboutElementRef[componentName] ||
|
|
201
|
-
((didWarnAboutElementRef[componentName] = true),
|
|
202
|
-
console.error(
|
|
203
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
204
|
-
));
|
|
205
|
-
componentName = this.props.ref;
|
|
206
|
-
return void 0 !== componentName ? componentName : null;
|
|
207
|
-
}
|
|
208
|
-
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
209
|
-
var refProp = props.ref;
|
|
210
|
-
type = {
|
|
211
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
212
|
-
type: type,
|
|
213
|
-
key: key,
|
|
214
|
-
props: props,
|
|
215
|
-
_owner: owner
|
|
216
|
-
};
|
|
217
|
-
null !== (void 0 !== refProp ? refProp : null)
|
|
218
|
-
? Object.defineProperty(type, "ref", {
|
|
219
|
-
enumerable: false,
|
|
220
|
-
get: elementRefGetterWithDeprecationWarning
|
|
221
|
-
})
|
|
222
|
-
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
223
|
-
type._store = {};
|
|
224
|
-
Object.defineProperty(type._store, "validated", {
|
|
225
|
-
configurable: false,
|
|
226
|
-
enumerable: false,
|
|
227
|
-
writable: true,
|
|
228
|
-
value: 0
|
|
229
|
-
});
|
|
230
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
231
|
-
configurable: false,
|
|
232
|
-
enumerable: false,
|
|
233
|
-
writable: true,
|
|
234
|
-
value: null
|
|
235
|
-
});
|
|
236
|
-
Object.defineProperty(type, "_debugStack", {
|
|
237
|
-
configurable: false,
|
|
238
|
-
enumerable: false,
|
|
239
|
-
writable: true,
|
|
240
|
-
value: debugStack
|
|
241
|
-
});
|
|
242
|
-
Object.defineProperty(type, "_debugTask", {
|
|
243
|
-
configurable: false,
|
|
244
|
-
enumerable: false,
|
|
245
|
-
writable: true,
|
|
246
|
-
value: debugTask
|
|
247
|
-
});
|
|
248
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
249
|
-
return type;
|
|
250
|
-
}
|
|
251
|
-
function jsxDEVImpl(
|
|
252
|
-
type,
|
|
253
|
-
config,
|
|
254
|
-
maybeKey,
|
|
255
|
-
isStaticChildren,
|
|
256
|
-
debugStack,
|
|
257
|
-
debugTask
|
|
258
|
-
) {
|
|
259
|
-
var children = config.children;
|
|
260
|
-
if (void 0 !== children)
|
|
261
|
-
if (isStaticChildren)
|
|
262
|
-
if (isArrayImpl(children)) {
|
|
263
|
-
for (
|
|
264
|
-
isStaticChildren = 0;
|
|
265
|
-
isStaticChildren < children.length;
|
|
266
|
-
isStaticChildren++
|
|
267
|
-
)
|
|
268
|
-
validateChildKeys(children[isStaticChildren]);
|
|
269
|
-
Object.freeze && Object.freeze(children);
|
|
270
|
-
} else
|
|
271
|
-
console.error(
|
|
272
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
273
|
-
);
|
|
274
|
-
else validateChildKeys(children);
|
|
275
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
276
|
-
children = getComponentNameFromType(type);
|
|
277
|
-
var keys = Object.keys(config).filter(function (k) {
|
|
278
|
-
return "key" !== k;
|
|
279
|
-
});
|
|
280
|
-
isStaticChildren =
|
|
281
|
-
0 < keys.length
|
|
282
|
-
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
283
|
-
: "{key: someKey}";
|
|
284
|
-
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
285
|
-
((keys =
|
|
286
|
-
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
287
|
-
console.error(
|
|
288
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
289
|
-
isStaticChildren,
|
|
290
|
-
children,
|
|
291
|
-
keys,
|
|
292
|
-
children
|
|
293
|
-
),
|
|
294
|
-
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
295
|
-
}
|
|
296
|
-
children = null;
|
|
297
|
-
void 0 !== maybeKey &&
|
|
298
|
-
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
299
|
-
hasValidKey(config) &&
|
|
300
|
-
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
301
|
-
if ("key" in config) {
|
|
302
|
-
maybeKey = {};
|
|
303
|
-
for (var propName in config)
|
|
304
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
305
|
-
} else maybeKey = config;
|
|
306
|
-
children &&
|
|
307
|
-
defineKeyPropWarningGetter(
|
|
308
|
-
maybeKey,
|
|
309
|
-
"function" === typeof type
|
|
310
|
-
? type.displayName || type.name || "Unknown"
|
|
311
|
-
: type
|
|
312
|
-
);
|
|
313
|
-
return ReactElement(
|
|
314
|
-
type,
|
|
315
|
-
children,
|
|
316
|
-
maybeKey,
|
|
317
|
-
getOwner(),
|
|
318
|
-
debugStack,
|
|
319
|
-
debugTask
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
function validateChildKeys(node) {
|
|
323
|
-
isValidElement(node)
|
|
324
|
-
? node._store && (node._store.validated = 1)
|
|
325
|
-
: "object" === typeof node &&
|
|
326
|
-
null !== node &&
|
|
327
|
-
node.$$typeof === REACT_LAZY_TYPE &&
|
|
328
|
-
("fulfilled" === node._payload.status
|
|
329
|
-
? isValidElement(node._payload.value) &&
|
|
330
|
-
node._payload.value._store &&
|
|
331
|
-
(node._payload.value._store.validated = 1)
|
|
332
|
-
: node._store && (node._store.validated = 1));
|
|
333
|
-
}
|
|
334
|
-
function isValidElement(object) {
|
|
335
|
-
return (
|
|
336
|
-
"object" === typeof object &&
|
|
337
|
-
null !== object &&
|
|
338
|
-
object.$$typeof === REACT_ELEMENT_TYPE
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
var React = n,
|
|
342
|
-
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
343
|
-
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
344
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
345
|
-
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
346
|
-
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
347
|
-
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
348
|
-
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
349
|
-
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
350
|
-
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
351
|
-
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
352
|
-
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
353
|
-
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
354
|
-
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
355
|
-
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
356
|
-
ReactSharedInternals =
|
|
357
|
-
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
358
|
-
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
359
|
-
isArrayImpl = Array.isArray,
|
|
360
|
-
createTask = console.createTask
|
|
361
|
-
? console.createTask
|
|
362
|
-
: function () {
|
|
363
|
-
return null;
|
|
364
|
-
};
|
|
365
|
-
React = {
|
|
366
|
-
react_stack_bottom_frame: function (callStackForError) {
|
|
367
|
-
return callStackForError();
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
var specialPropKeyWarningShown;
|
|
371
|
-
var didWarnAboutElementRef = {};
|
|
372
|
-
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
373
|
-
React,
|
|
374
|
-
UnknownOwner
|
|
375
|
-
)();
|
|
376
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
377
|
-
var didWarnAboutKeySpread = {};
|
|
378
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
379
|
-
reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
|
|
380
|
-
var trackActualOwner =
|
|
381
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
382
|
-
return jsxDEVImpl(
|
|
383
|
-
type,
|
|
384
|
-
config,
|
|
385
|
-
maybeKey,
|
|
386
|
-
false,
|
|
387
|
-
trackActualOwner
|
|
388
|
-
? Error("react-stack-top-frame")
|
|
389
|
-
: unknownOwnerDebugStack,
|
|
390
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
391
|
-
);
|
|
392
|
-
};
|
|
393
|
-
reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
|
|
394
|
-
var trackActualOwner =
|
|
395
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
396
|
-
return jsxDEVImpl(
|
|
397
|
-
type,
|
|
398
|
-
config,
|
|
399
|
-
maybeKey,
|
|
400
|
-
true,
|
|
401
|
-
trackActualOwner
|
|
402
|
-
? Error("react-stack-top-frame")
|
|
403
|
-
: unknownOwnerDebugStack,
|
|
404
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
405
|
-
);
|
|
406
|
-
};
|
|
407
|
-
})();
|
|
408
|
-
return reactJsxRuntime_development;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
var hasRequiredJsxRuntime;
|
|
412
|
-
|
|
413
|
-
function requireJsxRuntime () {
|
|
414
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
415
|
-
hasRequiredJsxRuntime = 1;
|
|
416
|
-
|
|
417
|
-
if (process.env.NODE_ENV === 'production') {
|
|
418
|
-
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
419
|
-
} else {
|
|
420
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
421
|
-
}
|
|
422
|
-
return jsxRuntime.exports;
|
|
11
|
+
function ConfirmationDialog({ isOpen, title, message, confirmText = "Confirmar", cancelText = "Cancelar", isDangerous = false, isLoading = false, onConfirm, onCancel, children, }) {
|
|
12
|
+
const cancel = () => {
|
|
13
|
+
if (!isLoading)
|
|
14
|
+
onCancel();
|
|
15
|
+
};
|
|
16
|
+
return (jsxRuntime.jsx(Modal, { open: isOpen, onClose: cancel, role: "alertdialog", size: "sm", title: title, description: message, showCloseButton: false, closeOnOverlayClick: !isLoading, closeOnEscape: !isLoading, footer: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button, { onClick: cancel, disabled: isLoading, variant: "outlined", color: "secondary", children: cancelText }), jsxRuntime.jsx(Button, { onClick: onConfirm, loading: isLoading, variant: "contained", color: isDangerous ? "error" : "primary", children: confirmText })] }), children: children }));
|
|
423
17
|
}
|
|
424
18
|
|
|
425
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
426
|
-
|
|
427
|
-
var o,e={exports:{}},r={};var t,a,l={};
|
|
428
|
-
/**
|
|
429
|
-
* @license React
|
|
430
|
-
* react-jsx-runtime.development.js
|
|
431
|
-
*
|
|
432
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the MIT license found in the
|
|
435
|
-
* LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/function i(){return t||(t=1,"production"!==process.env.NODE_ENV&&function(){function o(n){if(null==n)return null;if("function"==typeof n)return n.$$typeof===E?null:n.displayName||n.name||null;if("string"==typeof n)return n;switch(n){case p:return "Fragment";case g:return "Profiler";case f:return "StrictMode";case h:return "Suspense";case B:return "SuspenseList";case w:return "Activity"}if("object"==typeof n)switch("number"==typeof n.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case b:return "Portal";case v:return n.displayName||"Context";case y:return (n._context.displayName||"Context")+".Consumer";case x:var e=n.render;return (n=n.displayName)||(n=""!==(n=e.displayName||e.name||"")?"ForwardRef("+n+")":"ForwardRef"),n;case k:return null!==(e=n.displayName||null)?e:o(n.type)||"Memo";case S:e=n._payload,n=n._init;try{return o(n(e))}catch(n){}}return null}function e(n){return ""+n}function r(n){try{e(n);var o=!1;}catch(n){o=true;}if(o){var r=(o=console).error,t="function"==typeof Symbol&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return r.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",t),e(n)}}function t(n){if(n===p)return "<>";if("object"==typeof n&&null!==n&&n.$$typeof===S)return "<...>";try{var e=o(n);return e?"<"+e+">":"<...>"}catch(n){return "<...>"}}function a(){return Error("react-stack-top-frame")}function i(){var n=o(this.type);return P[n]||(P[n]=true,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(n=this.props.ref)?n:null}function c(n,e,t,a,l,c){var s,_=e.children;if(void 0!==_)if(a)if(j(_)){for(a=0;a<_.length;a++)u(_[a]);Object.freeze&&Object.freeze(_);}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(_);if(N.call(e,"key")){_=o(n);var b=Object.keys(e).filter(function(n){return "key"!==n});a=0<b.length?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}",C[_+a]||(b=0<b.length?"{"+b.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,_,b,_),C[_+a]=true);}if(_=null,void 0!==t&&(r(t),_=""+t),function(n){if(N.call(n,"key")){var o=Object.getOwnPropertyDescriptor(n,"key").get;if(o&&o.isReactWarning)return false}return void 0!==n.key}(e)&&(r(e.key),_=""+e.key),"key"in e)for(var p in t={},e)"key"!==p&&(t[p]=e[p]);else t=e;return _&&function(n,o){function e(){d||(d=true,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o));}e.isReactWarning=true,Object.defineProperty(n,"key",{get:e,configurable:true});}(t,"function"==typeof n?n.displayName||n.name||"Unknown":n),function(n,o,e,r,t,a){var l=e.ref;return n={$$typeof:m,type:n,key:o,props:e,_owner:r},null!==(void 0!==l?l:null)?Object.defineProperty(n,"ref",{enumerable:false,get:i}):Object.defineProperty(n,"ref",{enumerable:false,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(n,"_debugStack",{configurable:false,enumerable:false,writable:true,value:t}),Object.defineProperty(n,"_debugTask",{configurable:false,enumerable:false,writable:true,value:a}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}(n,_,t,null===(s=O.A)?null:s.getOwner(),l,c)}function u(n){s(n)?n._store&&(n._store.validated=1):"object"==typeof n&&null!==n&&n.$$typeof===S&&("fulfilled"===n._payload.status?s(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1));}function s(n){return "object"==typeof n&&null!==n&&n.$$typeof===m}var d,_=n,m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),v=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),E=Symbol.for("react.client.reference"),O=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,j=Array.isArray,I=console.createTask?console.createTask:function(){return null},P={},W=(_={react_stack_bottom_frame:function(n){return n()}}).react_stack_bottom_frame.bind(_,a)(),z=I(t(a)),C={};l.Fragment=p,l.jsx=function(n,o,e){var r=1e4>O.recentlyCreatedOwnerStacks++;return c(n,o,e,false,r?Error("react-stack-top-frame"):W,r?I(t(n)):z)},l.jsxs=function(n,o,e){var r=1e4>O.recentlyCreatedOwnerStacks++;return c(n,o,e,true,r?Error("react-stack-top-frame"):W,r?I(t(n)):z)};}()),l}var c=(a||(a=1,"production"===process.env.NODE_ENV?e.exports=function(){if(o)return r;o=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(o,e,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==e.key&&(t=""+e.key),"key"in e)for(var a in r={},e)"key"!==a&&(r[a]=e[a]);else r=e;return e=r.ref,{$$typeof:n,type:o,key:t,ref:void 0!==e?e:null,props:r}}return r.Fragment=e,r.jsx=t,r.jsxs=t,r}():e.exports=i()),e.exports);var u={root:"Button-module_root__CbGH4",sizeSmall:"Button-module_sizeSmall__cwk1u",sizeMedium:"Button-module_sizeMedium__WI9SU",sizeLarge:"Button-module_sizeLarge__DCsOs",disabled:"Button-module_disabled__JgtZl",fullWidth:"Button-module_fullWidth__dOsPn",noElevation:"Button-module_noElevation__I6-zN",loading:"Button-module_loading__fZbPs",loadingWrapper:"Button-module_loadingWrapper__NrZp3",content:"Button-module_content__xCYa9",contentHidden:"Button-module_contentHidden__lJy-Z",startIcon:"Button-module_startIcon__x3190",endIcon:"Button-module_endIcon__9vUum",text:"Button-module_text__5mE0X",textPrimary:"Button-module_textPrimary__vfnk5",textSecondary:"Button-module_textSecondary__a3EiY",textSuccess:"Button-module_textSuccess__F84Hf",textError:"Button-module_textError__47t2-",textWarning:"Button-module_textWarning__sUoJ4",textInfo:"Button-module_textInfo__eHIQf",contained:"Button-module_contained__ihcEr",containedPrimary:"Button-module_containedPrimary__QABiB",containedSecondary:"Button-module_containedSecondary__Amyuq",containedSuccess:"Button-module_containedSuccess__klgok",containedError:"Button-module_containedError__WOxWG",containedWarning:"Button-module_containedWarning__dFc-N",containedInfo:"Button-module_containedInfo__PLgZO",outlined:"Button-module_outlined__3QTXD",outlinedPrimary:"Button-module_outlinedPrimary__fKrCf",outlinedSecondary:"Button-module_outlinedSecondary__n7OpX",outlinedSuccess:"Button-module_outlinedSuccess__Y2Plg",outlinedError:"Button-module_outlinedError__6NJ-J",outlinedWarning:"Button-module_outlinedWarning__aXlYk",outlinedInfo:"Button-module_outlinedInfo__hpDkF",spinner:"Button-module_spinner__vwfOT",spin:"Button-module_spin__fjXhP",spinnerCircle:"Button-module_spinnerCircle__7vRpf",spinnerDash:"Button-module_spinnerDash__y8Dii"};!function(n,o){ void 0===o&&(o={});var e=o.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===e&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));}}(".Button-module_root__CbGH4 {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n font-family: var(--lb-font-sans);\n font-weight: var(--lb-font-weight-medium);\n border: 1px solid transparent;\n line-height: 1.75;\n white-space: nowrap;\n background: transparent;\n color: inherit;\n cursor: pointer;\n border-radius: var(--lb-radius-md);\n transition:\n background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.Button-module_root__CbGH4:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--lb-color-ring) 50%, transparent);\n}\n\n/* Size variants */\n.Button-module_sizeSmall__cwk1u {\n padding: 0.25rem 0.625rem;\n font-size: var(--lb-font-size-sm);\n min-height: 1.875rem;\n}\n\n.Button-module_sizeMedium__WI9SU {\n padding: 0.375rem 1rem;\n font-size: var(--lb-font-size-sm);\n min-height: 2.25rem;\n}\n\n.Button-module_sizeLarge__DCsOs {\n padding: 0.5rem 1.375rem;\n font-size: var(--lb-font-size-md);\n min-height: 2.625rem;\n}\n\n/* Disabled state */\n/* Combined with `.root` so it beats variant colors (e.g. .containedPrimary)\n regardless of source order (higher specificity). */\n.Button-module_root__CbGH4.Button-module_disabled__JgtZl {\n background: var(--lb-color-muted);\n background-color: var(--lb-color-muted);\n color: var(--lb-color-muted-foreground);\n border-color: transparent;\n cursor: not-allowed;\n pointer-events: none;\n box-shadow: none;\n opacity: 1;\n}\n\n/* Full width */\n.Button-module_fullWidth__dOsPn {\n width: 100%;\n}\n\n/* No elevation */\n.Button-module_noElevation__I6-zN {\n box-shadow: none !important;\n}\n\n/* Loading state */\n.Button-module_loading__fZbPs {\n pointer-events: none;\n}\n\n.Button-module_loadingWrapper__NrZp3 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.Button-module_content__xCYa9 {\n display: inline-flex;\n align-items: inherit;\n justify-content: inherit;\n gap: 0.5rem;\n}\n\n.Button-module_contentHidden__lJy-Z {\n opacity: 0;\n}\n\n.Button-module_startIcon__x3190,\n.Button-module_endIcon__9vUum {\n display: inherit;\n font-size: 1.25em;\n line-height: 1;\n}\n\n/* Variant: text */\n.Button-module_text__5mE0X {\n padding: 0.375rem 0.5rem;\n}\n\n.Button-module_text__5mE0X:hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n/* ============================================\n COLOR STYLES - TEXT VARIANT\n ============================================ */\n\n/* Primary */\n.Button-module_textPrimary__vfnk5 {\n color: var(--lb-color-primary);\n}\n.Button-module_textPrimary__vfnk5:hover {\n background-color: color-mix(in srgb, var(--lb-color-primary) 6%, transparent);\n}\n\n/* Secondary */\n.Button-module_textSecondary__a3EiY {\n color: var(--lb-color-neutral-600);\n}\n.Button-module_textSecondary__a3EiY:hover {\n background-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 6%,\n transparent\n );\n}\n\n/* Success */\n.Button-module_textSuccess__F84Hf {\n color: var(--lb-color-success);\n}\n.Button-module_textSuccess__F84Hf:hover {\n background-color: color-mix(in srgb, var(--lb-color-success) 6%, transparent);\n}\n\n/* Error */\n.Button-module_textError__47t2- {\n color: var(--lb-color-danger);\n}\n.Button-module_textError__47t2-:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger) 6%, transparent);\n}\n\n/* Warning */\n.Button-module_textWarning__sUoJ4 {\n color: var(--lb-color-warning);\n}\n.Button-module_textWarning__sUoJ4:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning) 6%, transparent);\n}\n\n/* Info */\n.Button-module_textInfo__eHIQf {\n color: var(--lb-color-info);\n}\n.Button-module_textInfo__eHIQf:hover {\n background-color: color-mix(in srgb, var(--lb-color-info) 6%, transparent);\n}\n\n/* ============================================\n COLOR STYLES - CONTAINED VARIANT\n ============================================ */\n\n/* Contained base */\n.Button-module_contained__ihcEr {\n box-shadow:\n 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 5px 0px rgba(0, 0, 0, 0.12);\n}\n\n.Button-module_contained__ihcEr:hover {\n box-shadow:\n 0px 2px 4px -1px rgba(0, 0, 0, 0.2),\n 0px 4px 5px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 10px 0px rgba(0, 0, 0, 0.12);\n}\n\n.Button-module_contained__ihcEr:active {\n box-shadow:\n 0px 5px 5px -3px rgba(0, 0, 0, 0.2),\n 0px 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0px 3px 14px 2px rgba(0, 0, 0, 0.12);\n}\n\n/* Primary */\n.Button-module_containedPrimary__QABiB {\n background-color: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n}\n.Button-module_containedPrimary__QABiB:hover {\n background-color: var(--lb-color-primary-hover);\n}\n\n/* Secondary */\n.Button-module_containedSecondary__Amyuq {\n background-color: var(--lb-color-neutral-600);\n color: var(--lb-color-primary-foreground);\n}\n.Button-module_containedSecondary__Amyuq:hover {\n background-color: var(--lb-color-neutral-700);\n}\n\n/* Success */\n.Button-module_containedSuccess__klgok {\n background-color: var(--lb-color-success);\n color: var(--lb-color-success-foreground);\n}\n.Button-module_containedSuccess__klgok:hover {\n background-color: color-mix(in srgb, var(--lb-color-success), black 12%);\n}\n\n/* Error */\n.Button-module_containedError__WOxWG {\n background-color: var(--lb-color-danger);\n color: var(--lb-color-danger-foreground);\n}\n.Button-module_containedError__WOxWG:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger), black 12%);\n}\n\n/* Warning */\n.Button-module_containedWarning__dFc-N {\n background-color: var(--lb-color-warning);\n color: var(--lb-color-warning-foreground);\n}\n.Button-module_containedWarning__dFc-N:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning), black 12%);\n}\n\n/* Info */\n.Button-module_containedInfo__PLgZO {\n background-color: var(--lb-color-info);\n color: var(--lb-color-info-foreground);\n}\n.Button-module_containedInfo__PLgZO:hover {\n background-color: color-mix(in srgb, var(--lb-color-info), black 12%);\n}\n\n/* ============================================\n COLOR STYLES - OUTLINED VARIANT\n ============================================ */\n\n/* Outlined base */\n.Button-module_outlined__3QTXD {\n border: 1px solid var(--lb-color-border);\n}\n\n/* Primary */\n.Button-module_outlinedPrimary__fKrCf {\n color: var(--lb-color-primary);\n border-color: color-mix(in srgb, var(--lb-color-primary) 50%, transparent);\n}\n.Button-module_outlinedPrimary__fKrCf:hover {\n background-color: color-mix(in srgb, var(--lb-color-primary) 6%, transparent);\n border-color: var(--lb-color-primary);\n}\n\n/* Secondary */\n.Button-module_outlinedSecondary__n7OpX {\n color: var(--lb-color-neutral-600);\n border-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 50%,\n transparent\n );\n}\n.Button-module_outlinedSecondary__n7OpX:hover {\n background-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 6%,\n transparent\n );\n border-color: var(--lb-color-neutral-600);\n}\n\n/* Success */\n.Button-module_outlinedSuccess__Y2Plg {\n color: var(--lb-color-success);\n border-color: color-mix(in srgb, var(--lb-color-success) 50%, transparent);\n}\n.Button-module_outlinedSuccess__Y2Plg:hover {\n background-color: color-mix(in srgb, var(--lb-color-success) 6%, transparent);\n border-color: var(--lb-color-success);\n}\n\n/* Error */\n.Button-module_outlinedError__6NJ-J {\n color: var(--lb-color-danger);\n border-color: color-mix(in srgb, var(--lb-color-danger) 50%, transparent);\n}\n.Button-module_outlinedError__6NJ-J:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger) 6%, transparent);\n border-color: var(--lb-color-danger);\n}\n\n/* Warning */\n.Button-module_outlinedWarning__aXlYk {\n color: var(--lb-color-warning);\n border-color: color-mix(in srgb, var(--lb-color-warning) 50%, transparent);\n}\n.Button-module_outlinedWarning__aXlYk:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning) 6%, transparent);\n border-color: var(--lb-color-warning);\n}\n\n/* Info */\n.Button-module_outlinedInfo__hpDkF {\n color: var(--lb-color-info);\n border-color: color-mix(in srgb, var(--lb-color-info) 50%, transparent);\n}\n.Button-module_outlinedInfo__hpDkF:hover {\n background-color: color-mix(in srgb, var(--lb-color-info) 6%, transparent);\n border-color: var(--lb-color-info);\n}\n\n/* Spinner animation */\n.Button-module_spinner__vwfOT {\n display: inline-flex;\n animation: Button-module_spin__fjXhP 0.8s linear infinite;\n}\n\n.Button-module_spinnerCircle__7vRpf {\n stroke-dasharray: 50;\n stroke-dashoffset: 25;\n animation: Button-module_spinnerDash__y8Dii 1.5s ease-in-out infinite;\n}\n\n@keyframes Button-module_spin__fjXhP {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes Button-module_spinnerDash__y8Dii {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}\n");const s=(...n)=>n.filter(Boolean).join(" "),d={small:u.sizeSmall,medium:u.sizeMedium,large:u.sizeLarge},_=({size:n})=>{const o={small:14,medium:18,large:22}[n];return c.jsx("svg",{className:u.spinner,width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("circle",{className:u.spinnerCircle,cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})},m=n.forwardRef((n,o)=>{const{variant:e="text",color:r="primary",size:t="medium",component:a,className:l,loading:i=false,startIcon:m,endIcon:b,fullWidth:p=false,disableElevation:f=false,children:g,...y}=n,v="disabled"in n&&n.disabled,x="href"in n?n.href:void 0,h=a||(x?"a":"button"),B=v||i,k=s(u.root,u[e],((n,o)=>{const e=`${o}${n.charAt(0).toUpperCase()}${n.slice(1)}`;return u[e]||""})(r,e),d[t],B?u.disabled:void 0,p?u.fullWidth:void 0,f?u.noElevation:void 0,i?u.loading:void 0,l),S="button"===h?{disabled:B}:{},w="a"===h?{href:x,"aria-disabled":B}:{};return c.jsxs(h,{ref:o,className:k,...S,...w,...y,children:[i&&c.jsx("span",{className:u.loadingWrapper,children:c.jsx(_,{size:t})}),c.jsxs("span",{className:s(u.content,i?u.contentHidden:void 0),children:[m&&c.jsx("span",{className:u.startIcon,children:m}),g,b&&c.jsx("span",{className:u.endIcon,children:b})]})]})});m.displayName="Button";
|
|
437
|
-
|
|
438
|
-
function styleInject(css, ref) {
|
|
439
|
-
if ( ref === void 0 ) ref = {};
|
|
440
|
-
var insertAt = ref.insertAt;
|
|
441
|
-
|
|
442
|
-
if (typeof document === 'undefined') { return; }
|
|
443
|
-
|
|
444
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
445
|
-
var style = document.createElement('style');
|
|
446
|
-
style.type = 'text/css';
|
|
447
|
-
|
|
448
|
-
if (insertAt === 'top') {
|
|
449
|
-
if (head.firstChild) {
|
|
450
|
-
head.insertBefore(style, head.firstChild);
|
|
451
|
-
} else {
|
|
452
|
-
head.appendChild(style);
|
|
453
|
-
}
|
|
454
|
-
} else {
|
|
455
|
-
head.appendChild(style);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
if (style.styleSheet) {
|
|
459
|
-
style.styleSheet.cssText = css;
|
|
460
|
-
} else {
|
|
461
|
-
style.appendChild(document.createTextNode(css));
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
var css_248z = ".ConfirmationDialog-module_overlay__bdQDI {\n position: fixed;\n inset: 0;\n z-index: 50;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.2);\n backdrop-filter: blur(4px);\n}\n\n.ConfirmationDialog-module_dialog__ODwV- {\n background: var(--lb-color-background);\n border-radius: 0.75rem;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n width: min(100%, 28rem);\n margin: 0 1rem;\n overflow: hidden;\n}\n\n.ConfirmationDialog-module_animateIn__Fb5nP {\n animation:\n ConfirmationDialog-module_dialogFade__F0jpT 160ms ease-out,\n ConfirmationDialog-module_dialogZoom__WN57G 160ms ease-out;\n}\n\n@keyframes ConfirmationDialog-module_dialogFade__F0jpT {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes ConfirmationDialog-module_dialogZoom__WN57G {\n from {\n transform: scale(0.95);\n }\n to {\n transform: scale(1);\n }\n}\n\n.ConfirmationDialog-module_header__xJoKH {\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--lb-color-neutral-200);\n}\n\n.ConfirmationDialog-module_headerNormal__i1bDj {\n background: var(--lb-color-blue-subtle);\n border-color: var(--lb-color-blue-border);\n}\n\n.ConfirmationDialog-module_headerDanger__aM2CV {\n background: var(--lb-color-red-subtle);\n border-color: var(--lb-color-red-border);\n}\n\n.ConfirmationDialog-module_title__75-FA {\n font-size: 1.125rem;\n line-height: 1.75rem;\n font-weight: 600;\n}\n\n.ConfirmationDialog-module_titleNormal__kfGGy {\n color: var(--lb-color-blue-strong);\n}\n\n.ConfirmationDialog-module_titleDanger__8NChY {\n color: var(--lb-color-red-strong);\n}\n\n.ConfirmationDialog-module_body__kz4pG {\n padding: 1rem 1.5rem;\n}\n\n.ConfirmationDialog-module_message__jxj5U {\n color: var(--lb-color-neutral-600);\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.ConfirmationDialog-module_footer__bdQzE {\n display: flex;\n justify-content: flex-end;\n gap: 0.75rem;\n padding: 1rem 1.5rem;\n background: var(--lb-color-neutral-50);\n border-top: 1px solid var(--lb-color-neutral-200);\n}\n\n.ConfirmationDialog-module_storyStack__F4Q8j {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.ConfirmationDialog-module_storyStackLarge__yW6eR {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n}\n\n.ConfirmationDialog-module_storyButton__pES1K {\n padding: 0.5rem 1rem;\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n border-radius: 0.5rem;\n border: none;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 150ms ease;\n}\n\n.ConfirmationDialog-module_storyButton__pES1K:hover {\n background: var(--lb-color-primary-hover);\n}\n\n.ConfirmationDialog-module_storyDangerButton__-22gf {\n padding: 0.5rem 1rem;\n background: var(--lb-color-danger);\n color: var(--lb-color-danger-foreground);\n border-radius: 0.5rem;\n border: none;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 150ms ease;\n}\n\n.ConfirmationDialog-module_storyDangerButton__-22gf:hover {\n background: var(--lb-color-red-strong);\n}\n\n.ConfirmationDialog-module_storyHeading__qteHG {\n margin-bottom: 1rem;\n font-weight: 600;\n color: var(--lb-color-neutral-700);\n}\n";
|
|
466
|
-
var styles = {"overlay":"ConfirmationDialog-module_overlay__bdQDI","dialog":"ConfirmationDialog-module_dialog__ODwV-","animateIn":"ConfirmationDialog-module_animateIn__Fb5nP","header":"ConfirmationDialog-module_header__xJoKH","headerNormal":"ConfirmationDialog-module_headerNormal__i1bDj","headerDanger":"ConfirmationDialog-module_headerDanger__aM2CV","title":"ConfirmationDialog-module_title__75-FA","titleNormal":"ConfirmationDialog-module_titleNormal__kfGGy","titleDanger":"ConfirmationDialog-module_titleDanger__8NChY","body":"ConfirmationDialog-module_body__kz4pG","message":"ConfirmationDialog-module_message__jxj5U","footer":"ConfirmationDialog-module_footer__bdQzE"};
|
|
467
|
-
styleInject(css_248z);
|
|
468
|
-
|
|
469
|
-
const classNames = (...classes) => classes.filter(Boolean).join(" ");
|
|
470
|
-
const ConfirmationDialog = ({ isOpen, title, message, confirmText = "Confirm", cancelText = "Cancel", isDangerous = false, isLoading = false, onConfirm, onCancel, }) => {
|
|
471
|
-
if (!isOpen)
|
|
472
|
-
return null;
|
|
473
|
-
return (jsxRuntimeExports.jsx("div", { className: styles.overlay, children: jsxRuntimeExports.jsxs("div", { className: classNames(styles.dialog, styles.animateIn), children: [jsxRuntimeExports.jsx("div", { className: classNames(styles.header, isDangerous ? styles.headerDanger : styles.headerNormal), children: jsxRuntimeExports.jsx("h2", { className: classNames(styles.title, isDangerous ? styles.titleDanger : styles.titleNormal), children: title }) }), jsxRuntimeExports.jsx("div", { className: styles.body, children: jsxRuntimeExports.jsx("p", { className: styles.message, children: message }) }), jsxRuntimeExports.jsxs("div", { className: styles.footer, children: [jsxRuntimeExports.jsx(m, { onClick: onCancel, disabled: isLoading, variant: "outlined", color: "secondary", children: cancelText }), jsxRuntimeExports.jsx(m, { onClick: onConfirm, loading: isLoading, variant: "contained", color: isDangerous ? "error" : "primary", children: confirmText })] })] }) }));
|
|
474
|
-
};
|
|
475
|
-
|
|
476
19
|
module.exports = ConfirmationDialog;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
interface ConfirmationDialogProps {
|
|
4
|
+
/** Si el diálogo está abierto. */
|
|
4
5
|
isOpen: boolean;
|
|
6
|
+
/** Pregunta o título: "¿Eliminar la convocatoria?". */
|
|
5
7
|
title: string;
|
|
6
|
-
|
|
8
|
+
/** Explicación de la consecuencia. */
|
|
9
|
+
message: React.ReactNode;
|
|
10
|
+
/** Texto del botón de confirmar (por defecto "Confirmar"). */
|
|
7
11
|
confirmText?: string;
|
|
12
|
+
/** Texto del botón de cancelar (por defecto "Cancelar"). */
|
|
8
13
|
cancelText?: string;
|
|
14
|
+
/** Acción destructiva: botón rojo. */
|
|
9
15
|
isDangerous?: boolean;
|
|
16
|
+
/** Muestra el botón de confirmar cargando y bloquea los botones. */
|
|
10
17
|
isLoading?: boolean;
|
|
18
|
+
/** Al confirmar. */
|
|
11
19
|
onConfirm: () => void;
|
|
20
|
+
/** Al cancelar, pulsar Escape o hacer clic fuera (si no está cargando). */
|
|
12
21
|
onCancel: () => void;
|
|
22
|
+
/** Contenido extra bajo el mensaje (p. ej. un campo "motivo"). */
|
|
23
|
+
children?: React.ReactNode;
|
|
13
24
|
}
|
|
14
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Diálogo de confirmación (alertdialog) sobre Modal: foco retenido, Escape para cancelar y
|
|
27
|
+
* el foco inicial en "Cancelar", la opción segura.
|
|
28
|
+
*/
|
|
29
|
+
declare function ConfirmationDialog({ isOpen, title, message, confirmText, cancelText, isDangerous, isLoading, onConfirm, onCancel, children, }: ConfirmationDialogProps): React.JSX.Element;
|
|
15
30
|
|
|
16
31
|
export { ConfirmationDialog as default };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,474 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var reactJsxRuntime_production = {};
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import Button from '@rubenpazch/button';
|
|
3
|
+
import Modal from '@rubenpazch/modal';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* Diálogo de confirmación (alertdialog) sobre Modal: foco retenido, Escape para cancelar y
|
|
7
|
+
* el foco inicial en "Cancelar", la opción segura.
|
|
15
8
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
23
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
24
|
-
function jsxProd(type, config, maybeKey) {
|
|
25
|
-
var key = null;
|
|
26
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
27
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
28
|
-
if ("key" in config) {
|
|
29
|
-
maybeKey = {};
|
|
30
|
-
for (var propName in config)
|
|
31
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
32
|
-
} else maybeKey = config;
|
|
33
|
-
config = maybeKey.ref;
|
|
34
|
-
return {
|
|
35
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
36
|
-
type: type,
|
|
37
|
-
key: key,
|
|
38
|
-
ref: void 0 !== config ? config : null,
|
|
39
|
-
props: maybeKey
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
43
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
44
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
45
|
-
return reactJsxRuntime_production;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var reactJsxRuntime_development = {};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @license React
|
|
52
|
-
* react-jsx-runtime.development.js
|
|
53
|
-
*
|
|
54
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the MIT license found in the
|
|
57
|
-
* LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
var hasRequiredReactJsxRuntime_development;
|
|
61
|
-
|
|
62
|
-
function requireReactJsxRuntime_development () {
|
|
63
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
64
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
65
|
-
"production" !== process.env.NODE_ENV &&
|
|
66
|
-
(function () {
|
|
67
|
-
function getComponentNameFromType(type) {
|
|
68
|
-
if (null == type) return null;
|
|
69
|
-
if ("function" === typeof type)
|
|
70
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
71
|
-
? null
|
|
72
|
-
: type.displayName || type.name || null;
|
|
73
|
-
if ("string" === typeof type) return type;
|
|
74
|
-
switch (type) {
|
|
75
|
-
case REACT_FRAGMENT_TYPE:
|
|
76
|
-
return "Fragment";
|
|
77
|
-
case REACT_PROFILER_TYPE:
|
|
78
|
-
return "Profiler";
|
|
79
|
-
case REACT_STRICT_MODE_TYPE:
|
|
80
|
-
return "StrictMode";
|
|
81
|
-
case REACT_SUSPENSE_TYPE:
|
|
82
|
-
return "Suspense";
|
|
83
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
84
|
-
return "SuspenseList";
|
|
85
|
-
case REACT_ACTIVITY_TYPE:
|
|
86
|
-
return "Activity";
|
|
87
|
-
}
|
|
88
|
-
if ("object" === typeof type)
|
|
89
|
-
switch (
|
|
90
|
-
("number" === typeof type.tag &&
|
|
91
|
-
console.error(
|
|
92
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
93
|
-
),
|
|
94
|
-
type.$$typeof)
|
|
95
|
-
) {
|
|
96
|
-
case REACT_PORTAL_TYPE:
|
|
97
|
-
return "Portal";
|
|
98
|
-
case REACT_CONTEXT_TYPE:
|
|
99
|
-
return type.displayName || "Context";
|
|
100
|
-
case REACT_CONSUMER_TYPE:
|
|
101
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
102
|
-
case REACT_FORWARD_REF_TYPE:
|
|
103
|
-
var innerType = type.render;
|
|
104
|
-
type = type.displayName;
|
|
105
|
-
type ||
|
|
106
|
-
((type = innerType.displayName || innerType.name || ""),
|
|
107
|
-
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
108
|
-
return type;
|
|
109
|
-
case REACT_MEMO_TYPE:
|
|
110
|
-
return (
|
|
111
|
-
(innerType = type.displayName || null),
|
|
112
|
-
null !== innerType
|
|
113
|
-
? innerType
|
|
114
|
-
: getComponentNameFromType(type.type) || "Memo"
|
|
115
|
-
);
|
|
116
|
-
case REACT_LAZY_TYPE:
|
|
117
|
-
innerType = type._payload;
|
|
118
|
-
type = type._init;
|
|
119
|
-
try {
|
|
120
|
-
return getComponentNameFromType(type(innerType));
|
|
121
|
-
} catch (x) {}
|
|
122
|
-
}
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
function testStringCoercion(value) {
|
|
126
|
-
return "" + value;
|
|
127
|
-
}
|
|
128
|
-
function checkKeyStringCoercion(value) {
|
|
129
|
-
try {
|
|
130
|
-
testStringCoercion(value);
|
|
131
|
-
var JSCompiler_inline_result = !1;
|
|
132
|
-
} catch (e) {
|
|
133
|
-
JSCompiler_inline_result = true;
|
|
134
|
-
}
|
|
135
|
-
if (JSCompiler_inline_result) {
|
|
136
|
-
JSCompiler_inline_result = console;
|
|
137
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
138
|
-
var JSCompiler_inline_result$jscomp$0 =
|
|
139
|
-
("function" === typeof Symbol &&
|
|
140
|
-
Symbol.toStringTag &&
|
|
141
|
-
value[Symbol.toStringTag]) ||
|
|
142
|
-
value.constructor.name ||
|
|
143
|
-
"Object";
|
|
144
|
-
JSCompiler_temp_const.call(
|
|
145
|
-
JSCompiler_inline_result,
|
|
146
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
147
|
-
JSCompiler_inline_result$jscomp$0
|
|
148
|
-
);
|
|
149
|
-
return testStringCoercion(value);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function getTaskName(type) {
|
|
153
|
-
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
154
|
-
if (
|
|
155
|
-
"object" === typeof type &&
|
|
156
|
-
null !== type &&
|
|
157
|
-
type.$$typeof === REACT_LAZY_TYPE
|
|
158
|
-
)
|
|
159
|
-
return "<...>";
|
|
160
|
-
try {
|
|
161
|
-
var name = getComponentNameFromType(type);
|
|
162
|
-
return name ? "<" + name + ">" : "<...>";
|
|
163
|
-
} catch (x) {
|
|
164
|
-
return "<...>";
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function getOwner() {
|
|
168
|
-
var dispatcher = ReactSharedInternals.A;
|
|
169
|
-
return null === dispatcher ? null : dispatcher.getOwner();
|
|
170
|
-
}
|
|
171
|
-
function UnknownOwner() {
|
|
172
|
-
return Error("react-stack-top-frame");
|
|
173
|
-
}
|
|
174
|
-
function hasValidKey(config) {
|
|
175
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
176
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
177
|
-
if (getter && getter.isReactWarning) return false;
|
|
178
|
-
}
|
|
179
|
-
return void 0 !== config.key;
|
|
180
|
-
}
|
|
181
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
182
|
-
function warnAboutAccessingKey() {
|
|
183
|
-
specialPropKeyWarningShown ||
|
|
184
|
-
((specialPropKeyWarningShown = true),
|
|
185
|
-
console.error(
|
|
186
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
187
|
-
displayName
|
|
188
|
-
));
|
|
189
|
-
}
|
|
190
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
191
|
-
Object.defineProperty(props, "key", {
|
|
192
|
-
get: warnAboutAccessingKey,
|
|
193
|
-
configurable: true
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
197
|
-
var componentName = getComponentNameFromType(this.type);
|
|
198
|
-
didWarnAboutElementRef[componentName] ||
|
|
199
|
-
((didWarnAboutElementRef[componentName] = true),
|
|
200
|
-
console.error(
|
|
201
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
202
|
-
));
|
|
203
|
-
componentName = this.props.ref;
|
|
204
|
-
return void 0 !== componentName ? componentName : null;
|
|
205
|
-
}
|
|
206
|
-
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
207
|
-
var refProp = props.ref;
|
|
208
|
-
type = {
|
|
209
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
210
|
-
type: type,
|
|
211
|
-
key: key,
|
|
212
|
-
props: props,
|
|
213
|
-
_owner: owner
|
|
214
|
-
};
|
|
215
|
-
null !== (void 0 !== refProp ? refProp : null)
|
|
216
|
-
? Object.defineProperty(type, "ref", {
|
|
217
|
-
enumerable: false,
|
|
218
|
-
get: elementRefGetterWithDeprecationWarning
|
|
219
|
-
})
|
|
220
|
-
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
221
|
-
type._store = {};
|
|
222
|
-
Object.defineProperty(type._store, "validated", {
|
|
223
|
-
configurable: false,
|
|
224
|
-
enumerable: false,
|
|
225
|
-
writable: true,
|
|
226
|
-
value: 0
|
|
227
|
-
});
|
|
228
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
229
|
-
configurable: false,
|
|
230
|
-
enumerable: false,
|
|
231
|
-
writable: true,
|
|
232
|
-
value: null
|
|
233
|
-
});
|
|
234
|
-
Object.defineProperty(type, "_debugStack", {
|
|
235
|
-
configurable: false,
|
|
236
|
-
enumerable: false,
|
|
237
|
-
writable: true,
|
|
238
|
-
value: debugStack
|
|
239
|
-
});
|
|
240
|
-
Object.defineProperty(type, "_debugTask", {
|
|
241
|
-
configurable: false,
|
|
242
|
-
enumerable: false,
|
|
243
|
-
writable: true,
|
|
244
|
-
value: debugTask
|
|
245
|
-
});
|
|
246
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
247
|
-
return type;
|
|
248
|
-
}
|
|
249
|
-
function jsxDEVImpl(
|
|
250
|
-
type,
|
|
251
|
-
config,
|
|
252
|
-
maybeKey,
|
|
253
|
-
isStaticChildren,
|
|
254
|
-
debugStack,
|
|
255
|
-
debugTask
|
|
256
|
-
) {
|
|
257
|
-
var children = config.children;
|
|
258
|
-
if (void 0 !== children)
|
|
259
|
-
if (isStaticChildren)
|
|
260
|
-
if (isArrayImpl(children)) {
|
|
261
|
-
for (
|
|
262
|
-
isStaticChildren = 0;
|
|
263
|
-
isStaticChildren < children.length;
|
|
264
|
-
isStaticChildren++
|
|
265
|
-
)
|
|
266
|
-
validateChildKeys(children[isStaticChildren]);
|
|
267
|
-
Object.freeze && Object.freeze(children);
|
|
268
|
-
} else
|
|
269
|
-
console.error(
|
|
270
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
271
|
-
);
|
|
272
|
-
else validateChildKeys(children);
|
|
273
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
274
|
-
children = getComponentNameFromType(type);
|
|
275
|
-
var keys = Object.keys(config).filter(function (k) {
|
|
276
|
-
return "key" !== k;
|
|
277
|
-
});
|
|
278
|
-
isStaticChildren =
|
|
279
|
-
0 < keys.length
|
|
280
|
-
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
281
|
-
: "{key: someKey}";
|
|
282
|
-
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
283
|
-
((keys =
|
|
284
|
-
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
285
|
-
console.error(
|
|
286
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
287
|
-
isStaticChildren,
|
|
288
|
-
children,
|
|
289
|
-
keys,
|
|
290
|
-
children
|
|
291
|
-
),
|
|
292
|
-
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
293
|
-
}
|
|
294
|
-
children = null;
|
|
295
|
-
void 0 !== maybeKey &&
|
|
296
|
-
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
297
|
-
hasValidKey(config) &&
|
|
298
|
-
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
299
|
-
if ("key" in config) {
|
|
300
|
-
maybeKey = {};
|
|
301
|
-
for (var propName in config)
|
|
302
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
303
|
-
} else maybeKey = config;
|
|
304
|
-
children &&
|
|
305
|
-
defineKeyPropWarningGetter(
|
|
306
|
-
maybeKey,
|
|
307
|
-
"function" === typeof type
|
|
308
|
-
? type.displayName || type.name || "Unknown"
|
|
309
|
-
: type
|
|
310
|
-
);
|
|
311
|
-
return ReactElement(
|
|
312
|
-
type,
|
|
313
|
-
children,
|
|
314
|
-
maybeKey,
|
|
315
|
-
getOwner(),
|
|
316
|
-
debugStack,
|
|
317
|
-
debugTask
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
function validateChildKeys(node) {
|
|
321
|
-
isValidElement(node)
|
|
322
|
-
? node._store && (node._store.validated = 1)
|
|
323
|
-
: "object" === typeof node &&
|
|
324
|
-
null !== node &&
|
|
325
|
-
node.$$typeof === REACT_LAZY_TYPE &&
|
|
326
|
-
("fulfilled" === node._payload.status
|
|
327
|
-
? isValidElement(node._payload.value) &&
|
|
328
|
-
node._payload.value._store &&
|
|
329
|
-
(node._payload.value._store.validated = 1)
|
|
330
|
-
: node._store && (node._store.validated = 1));
|
|
331
|
-
}
|
|
332
|
-
function isValidElement(object) {
|
|
333
|
-
return (
|
|
334
|
-
"object" === typeof object &&
|
|
335
|
-
null !== object &&
|
|
336
|
-
object.$$typeof === REACT_ELEMENT_TYPE
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
var React = n,
|
|
340
|
-
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
341
|
-
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
342
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
343
|
-
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
344
|
-
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
345
|
-
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
346
|
-
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
347
|
-
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
348
|
-
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
349
|
-
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
350
|
-
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
351
|
-
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
352
|
-
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
353
|
-
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
354
|
-
ReactSharedInternals =
|
|
355
|
-
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
356
|
-
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
357
|
-
isArrayImpl = Array.isArray,
|
|
358
|
-
createTask = console.createTask
|
|
359
|
-
? console.createTask
|
|
360
|
-
: function () {
|
|
361
|
-
return null;
|
|
362
|
-
};
|
|
363
|
-
React = {
|
|
364
|
-
react_stack_bottom_frame: function (callStackForError) {
|
|
365
|
-
return callStackForError();
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
var specialPropKeyWarningShown;
|
|
369
|
-
var didWarnAboutElementRef = {};
|
|
370
|
-
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
371
|
-
React,
|
|
372
|
-
UnknownOwner
|
|
373
|
-
)();
|
|
374
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
375
|
-
var didWarnAboutKeySpread = {};
|
|
376
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
377
|
-
reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
|
|
378
|
-
var trackActualOwner =
|
|
379
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
380
|
-
return jsxDEVImpl(
|
|
381
|
-
type,
|
|
382
|
-
config,
|
|
383
|
-
maybeKey,
|
|
384
|
-
false,
|
|
385
|
-
trackActualOwner
|
|
386
|
-
? Error("react-stack-top-frame")
|
|
387
|
-
: unknownOwnerDebugStack,
|
|
388
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
389
|
-
);
|
|
390
|
-
};
|
|
391
|
-
reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
|
|
392
|
-
var trackActualOwner =
|
|
393
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
394
|
-
return jsxDEVImpl(
|
|
395
|
-
type,
|
|
396
|
-
config,
|
|
397
|
-
maybeKey,
|
|
398
|
-
true,
|
|
399
|
-
trackActualOwner
|
|
400
|
-
? Error("react-stack-top-frame")
|
|
401
|
-
: unknownOwnerDebugStack,
|
|
402
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
403
|
-
);
|
|
404
|
-
};
|
|
405
|
-
})();
|
|
406
|
-
return reactJsxRuntime_development;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
var hasRequiredJsxRuntime;
|
|
410
|
-
|
|
411
|
-
function requireJsxRuntime () {
|
|
412
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
413
|
-
hasRequiredJsxRuntime = 1;
|
|
414
|
-
|
|
415
|
-
if (process.env.NODE_ENV === 'production') {
|
|
416
|
-
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
417
|
-
} else {
|
|
418
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
419
|
-
}
|
|
420
|
-
return jsxRuntime.exports;
|
|
9
|
+
function ConfirmationDialog({ isOpen, title, message, confirmText = "Confirmar", cancelText = "Cancelar", isDangerous = false, isLoading = false, onConfirm, onCancel, children, }) {
|
|
10
|
+
const cancel = () => {
|
|
11
|
+
if (!isLoading)
|
|
12
|
+
onCancel();
|
|
13
|
+
};
|
|
14
|
+
return (jsx(Modal, { open: isOpen, onClose: cancel, role: "alertdialog", size: "sm", title: title, description: message, showCloseButton: false, closeOnOverlayClick: !isLoading, closeOnEscape: !isLoading, footer: jsxs(Fragment, { children: [jsx(Button, { onClick: cancel, disabled: isLoading, variant: "outlined", color: "secondary", children: cancelText }), jsx(Button, { onClick: onConfirm, loading: isLoading, variant: "contained", color: isDangerous ? "error" : "primary", children: confirmText })] }), children: children }));
|
|
421
15
|
}
|
|
422
16
|
|
|
423
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
424
|
-
|
|
425
|
-
var o,e={exports:{}},r={};var t,a,l={};
|
|
426
|
-
/**
|
|
427
|
-
* @license React
|
|
428
|
-
* react-jsx-runtime.development.js
|
|
429
|
-
*
|
|
430
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
431
|
-
*
|
|
432
|
-
* This source code is licensed under the MIT license found in the
|
|
433
|
-
* LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/function i(){return t||(t=1,"production"!==process.env.NODE_ENV&&function(){function o(n){if(null==n)return null;if("function"==typeof n)return n.$$typeof===E?null:n.displayName||n.name||null;if("string"==typeof n)return n;switch(n){case p:return "Fragment";case g:return "Profiler";case f:return "StrictMode";case h:return "Suspense";case B:return "SuspenseList";case w:return "Activity"}if("object"==typeof n)switch("number"==typeof n.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case b:return "Portal";case v:return n.displayName||"Context";case y:return (n._context.displayName||"Context")+".Consumer";case x:var e=n.render;return (n=n.displayName)||(n=""!==(n=e.displayName||e.name||"")?"ForwardRef("+n+")":"ForwardRef"),n;case k:return null!==(e=n.displayName||null)?e:o(n.type)||"Memo";case S:e=n._payload,n=n._init;try{return o(n(e))}catch(n){}}return null}function e(n){return ""+n}function r(n){try{e(n);var o=!1;}catch(n){o=true;}if(o){var r=(o=console).error,t="function"==typeof Symbol&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return r.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",t),e(n)}}function t(n){if(n===p)return "<>";if("object"==typeof n&&null!==n&&n.$$typeof===S)return "<...>";try{var e=o(n);return e?"<"+e+">":"<...>"}catch(n){return "<...>"}}function a(){return Error("react-stack-top-frame")}function i(){var n=o(this.type);return P[n]||(P[n]=true,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(n=this.props.ref)?n:null}function c(n,e,t,a,l,c){var s,_=e.children;if(void 0!==_)if(a)if(j(_)){for(a=0;a<_.length;a++)u(_[a]);Object.freeze&&Object.freeze(_);}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(_);if(N.call(e,"key")){_=o(n);var b=Object.keys(e).filter(function(n){return "key"!==n});a=0<b.length?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}",C[_+a]||(b=0<b.length?"{"+b.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,_,b,_),C[_+a]=true);}if(_=null,void 0!==t&&(r(t),_=""+t),function(n){if(N.call(n,"key")){var o=Object.getOwnPropertyDescriptor(n,"key").get;if(o&&o.isReactWarning)return false}return void 0!==n.key}(e)&&(r(e.key),_=""+e.key),"key"in e)for(var p in t={},e)"key"!==p&&(t[p]=e[p]);else t=e;return _&&function(n,o){function e(){d||(d=true,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o));}e.isReactWarning=true,Object.defineProperty(n,"key",{get:e,configurable:true});}(t,"function"==typeof n?n.displayName||n.name||"Unknown":n),function(n,o,e,r,t,a){var l=e.ref;return n={$$typeof:m,type:n,key:o,props:e,_owner:r},null!==(void 0!==l?l:null)?Object.defineProperty(n,"ref",{enumerable:false,get:i}):Object.defineProperty(n,"ref",{enumerable:false,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(n,"_debugStack",{configurable:false,enumerable:false,writable:true,value:t}),Object.defineProperty(n,"_debugTask",{configurable:false,enumerable:false,writable:true,value:a}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}(n,_,t,null===(s=O.A)?null:s.getOwner(),l,c)}function u(n){s(n)?n._store&&(n._store.validated=1):"object"==typeof n&&null!==n&&n.$$typeof===S&&("fulfilled"===n._payload.status?s(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1));}function s(n){return "object"==typeof n&&null!==n&&n.$$typeof===m}var d,_=n,m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),v=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),E=Symbol.for("react.client.reference"),O=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,j=Array.isArray,I=console.createTask?console.createTask:function(){return null},P={},W=(_={react_stack_bottom_frame:function(n){return n()}}).react_stack_bottom_frame.bind(_,a)(),z=I(t(a)),C={};l.Fragment=p,l.jsx=function(n,o,e){var r=1e4>O.recentlyCreatedOwnerStacks++;return c(n,o,e,false,r?Error("react-stack-top-frame"):W,r?I(t(n)):z)},l.jsxs=function(n,o,e){var r=1e4>O.recentlyCreatedOwnerStacks++;return c(n,o,e,true,r?Error("react-stack-top-frame"):W,r?I(t(n)):z)};}()),l}var c=(a||(a=1,"production"===process.env.NODE_ENV?e.exports=function(){if(o)return r;o=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(o,e,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==e.key&&(t=""+e.key),"key"in e)for(var a in r={},e)"key"!==a&&(r[a]=e[a]);else r=e;return e=r.ref,{$$typeof:n,type:o,key:t,ref:void 0!==e?e:null,props:r}}return r.Fragment=e,r.jsx=t,r.jsxs=t,r}():e.exports=i()),e.exports);var u={root:"Button-module_root__CbGH4",sizeSmall:"Button-module_sizeSmall__cwk1u",sizeMedium:"Button-module_sizeMedium__WI9SU",sizeLarge:"Button-module_sizeLarge__DCsOs",disabled:"Button-module_disabled__JgtZl",fullWidth:"Button-module_fullWidth__dOsPn",noElevation:"Button-module_noElevation__I6-zN",loading:"Button-module_loading__fZbPs",loadingWrapper:"Button-module_loadingWrapper__NrZp3",content:"Button-module_content__xCYa9",contentHidden:"Button-module_contentHidden__lJy-Z",startIcon:"Button-module_startIcon__x3190",endIcon:"Button-module_endIcon__9vUum",text:"Button-module_text__5mE0X",textPrimary:"Button-module_textPrimary__vfnk5",textSecondary:"Button-module_textSecondary__a3EiY",textSuccess:"Button-module_textSuccess__F84Hf",textError:"Button-module_textError__47t2-",textWarning:"Button-module_textWarning__sUoJ4",textInfo:"Button-module_textInfo__eHIQf",contained:"Button-module_contained__ihcEr",containedPrimary:"Button-module_containedPrimary__QABiB",containedSecondary:"Button-module_containedSecondary__Amyuq",containedSuccess:"Button-module_containedSuccess__klgok",containedError:"Button-module_containedError__WOxWG",containedWarning:"Button-module_containedWarning__dFc-N",containedInfo:"Button-module_containedInfo__PLgZO",outlined:"Button-module_outlined__3QTXD",outlinedPrimary:"Button-module_outlinedPrimary__fKrCf",outlinedSecondary:"Button-module_outlinedSecondary__n7OpX",outlinedSuccess:"Button-module_outlinedSuccess__Y2Plg",outlinedError:"Button-module_outlinedError__6NJ-J",outlinedWarning:"Button-module_outlinedWarning__aXlYk",outlinedInfo:"Button-module_outlinedInfo__hpDkF",spinner:"Button-module_spinner__vwfOT",spin:"Button-module_spin__fjXhP",spinnerCircle:"Button-module_spinnerCircle__7vRpf",spinnerDash:"Button-module_spinnerDash__y8Dii"};!function(n,o){ void 0===o&&(o={});var e=o.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===e&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n));}}(".Button-module_root__CbGH4 {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n font-family: var(--lb-font-sans);\n font-weight: var(--lb-font-weight-medium);\n border: 1px solid transparent;\n line-height: 1.75;\n white-space: nowrap;\n background: transparent;\n color: inherit;\n cursor: pointer;\n border-radius: var(--lb-radius-md);\n transition:\n background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.Button-module_root__CbGH4:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--lb-color-ring) 50%, transparent);\n}\n\n/* Size variants */\n.Button-module_sizeSmall__cwk1u {\n padding: 0.25rem 0.625rem;\n font-size: var(--lb-font-size-sm);\n min-height: 1.875rem;\n}\n\n.Button-module_sizeMedium__WI9SU {\n padding: 0.375rem 1rem;\n font-size: var(--lb-font-size-sm);\n min-height: 2.25rem;\n}\n\n.Button-module_sizeLarge__DCsOs {\n padding: 0.5rem 1.375rem;\n font-size: var(--lb-font-size-md);\n min-height: 2.625rem;\n}\n\n/* Disabled state */\n/* Combined with `.root` so it beats variant colors (e.g. .containedPrimary)\n regardless of source order (higher specificity). */\n.Button-module_root__CbGH4.Button-module_disabled__JgtZl {\n background: var(--lb-color-muted);\n background-color: var(--lb-color-muted);\n color: var(--lb-color-muted-foreground);\n border-color: transparent;\n cursor: not-allowed;\n pointer-events: none;\n box-shadow: none;\n opacity: 1;\n}\n\n/* Full width */\n.Button-module_fullWidth__dOsPn {\n width: 100%;\n}\n\n/* No elevation */\n.Button-module_noElevation__I6-zN {\n box-shadow: none !important;\n}\n\n/* Loading state */\n.Button-module_loading__fZbPs {\n pointer-events: none;\n}\n\n.Button-module_loadingWrapper__NrZp3 {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.Button-module_content__xCYa9 {\n display: inline-flex;\n align-items: inherit;\n justify-content: inherit;\n gap: 0.5rem;\n}\n\n.Button-module_contentHidden__lJy-Z {\n opacity: 0;\n}\n\n.Button-module_startIcon__x3190,\n.Button-module_endIcon__9vUum {\n display: inherit;\n font-size: 1.25em;\n line-height: 1;\n}\n\n/* Variant: text */\n.Button-module_text__5mE0X {\n padding: 0.375rem 0.5rem;\n}\n\n.Button-module_text__5mE0X:hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n/* ============================================\n COLOR STYLES - TEXT VARIANT\n ============================================ */\n\n/* Primary */\n.Button-module_textPrimary__vfnk5 {\n color: var(--lb-color-primary);\n}\n.Button-module_textPrimary__vfnk5:hover {\n background-color: color-mix(in srgb, var(--lb-color-primary) 6%, transparent);\n}\n\n/* Secondary */\n.Button-module_textSecondary__a3EiY {\n color: var(--lb-color-neutral-600);\n}\n.Button-module_textSecondary__a3EiY:hover {\n background-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 6%,\n transparent\n );\n}\n\n/* Success */\n.Button-module_textSuccess__F84Hf {\n color: var(--lb-color-success);\n}\n.Button-module_textSuccess__F84Hf:hover {\n background-color: color-mix(in srgb, var(--lb-color-success) 6%, transparent);\n}\n\n/* Error */\n.Button-module_textError__47t2- {\n color: var(--lb-color-danger);\n}\n.Button-module_textError__47t2-:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger) 6%, transparent);\n}\n\n/* Warning */\n.Button-module_textWarning__sUoJ4 {\n color: var(--lb-color-warning);\n}\n.Button-module_textWarning__sUoJ4:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning) 6%, transparent);\n}\n\n/* Info */\n.Button-module_textInfo__eHIQf {\n color: var(--lb-color-info);\n}\n.Button-module_textInfo__eHIQf:hover {\n background-color: color-mix(in srgb, var(--lb-color-info) 6%, transparent);\n}\n\n/* ============================================\n COLOR STYLES - CONTAINED VARIANT\n ============================================ */\n\n/* Contained base */\n.Button-module_contained__ihcEr {\n box-shadow:\n 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 5px 0px rgba(0, 0, 0, 0.12);\n}\n\n.Button-module_contained__ihcEr:hover {\n box-shadow:\n 0px 2px 4px -1px rgba(0, 0, 0, 0.2),\n 0px 4px 5px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 10px 0px rgba(0, 0, 0, 0.12);\n}\n\n.Button-module_contained__ihcEr:active {\n box-shadow:\n 0px 5px 5px -3px rgba(0, 0, 0, 0.2),\n 0px 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0px 3px 14px 2px rgba(0, 0, 0, 0.12);\n}\n\n/* Primary */\n.Button-module_containedPrimary__QABiB {\n background-color: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n}\n.Button-module_containedPrimary__QABiB:hover {\n background-color: var(--lb-color-primary-hover);\n}\n\n/* Secondary */\n.Button-module_containedSecondary__Amyuq {\n background-color: var(--lb-color-neutral-600);\n color: var(--lb-color-primary-foreground);\n}\n.Button-module_containedSecondary__Amyuq:hover {\n background-color: var(--lb-color-neutral-700);\n}\n\n/* Success */\n.Button-module_containedSuccess__klgok {\n background-color: var(--lb-color-success);\n color: var(--lb-color-success-foreground);\n}\n.Button-module_containedSuccess__klgok:hover {\n background-color: color-mix(in srgb, var(--lb-color-success), black 12%);\n}\n\n/* Error */\n.Button-module_containedError__WOxWG {\n background-color: var(--lb-color-danger);\n color: var(--lb-color-danger-foreground);\n}\n.Button-module_containedError__WOxWG:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger), black 12%);\n}\n\n/* Warning */\n.Button-module_containedWarning__dFc-N {\n background-color: var(--lb-color-warning);\n color: var(--lb-color-warning-foreground);\n}\n.Button-module_containedWarning__dFc-N:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning), black 12%);\n}\n\n/* Info */\n.Button-module_containedInfo__PLgZO {\n background-color: var(--lb-color-info);\n color: var(--lb-color-info-foreground);\n}\n.Button-module_containedInfo__PLgZO:hover {\n background-color: color-mix(in srgb, var(--lb-color-info), black 12%);\n}\n\n/* ============================================\n COLOR STYLES - OUTLINED VARIANT\n ============================================ */\n\n/* Outlined base */\n.Button-module_outlined__3QTXD {\n border: 1px solid var(--lb-color-border);\n}\n\n/* Primary */\n.Button-module_outlinedPrimary__fKrCf {\n color: var(--lb-color-primary);\n border-color: color-mix(in srgb, var(--lb-color-primary) 50%, transparent);\n}\n.Button-module_outlinedPrimary__fKrCf:hover {\n background-color: color-mix(in srgb, var(--lb-color-primary) 6%, transparent);\n border-color: var(--lb-color-primary);\n}\n\n/* Secondary */\n.Button-module_outlinedSecondary__n7OpX {\n color: var(--lb-color-neutral-600);\n border-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 50%,\n transparent\n );\n}\n.Button-module_outlinedSecondary__n7OpX:hover {\n background-color: color-mix(\n in srgb,\n var(--lb-color-neutral-600) 6%,\n transparent\n );\n border-color: var(--lb-color-neutral-600);\n}\n\n/* Success */\n.Button-module_outlinedSuccess__Y2Plg {\n color: var(--lb-color-success);\n border-color: color-mix(in srgb, var(--lb-color-success) 50%, transparent);\n}\n.Button-module_outlinedSuccess__Y2Plg:hover {\n background-color: color-mix(in srgb, var(--lb-color-success) 6%, transparent);\n border-color: var(--lb-color-success);\n}\n\n/* Error */\n.Button-module_outlinedError__6NJ-J {\n color: var(--lb-color-danger);\n border-color: color-mix(in srgb, var(--lb-color-danger) 50%, transparent);\n}\n.Button-module_outlinedError__6NJ-J:hover {\n background-color: color-mix(in srgb, var(--lb-color-danger) 6%, transparent);\n border-color: var(--lb-color-danger);\n}\n\n/* Warning */\n.Button-module_outlinedWarning__aXlYk {\n color: var(--lb-color-warning);\n border-color: color-mix(in srgb, var(--lb-color-warning) 50%, transparent);\n}\n.Button-module_outlinedWarning__aXlYk:hover {\n background-color: color-mix(in srgb, var(--lb-color-warning) 6%, transparent);\n border-color: var(--lb-color-warning);\n}\n\n/* Info */\n.Button-module_outlinedInfo__hpDkF {\n color: var(--lb-color-info);\n border-color: color-mix(in srgb, var(--lb-color-info) 50%, transparent);\n}\n.Button-module_outlinedInfo__hpDkF:hover {\n background-color: color-mix(in srgb, var(--lb-color-info) 6%, transparent);\n border-color: var(--lb-color-info);\n}\n\n/* Spinner animation */\n.Button-module_spinner__vwfOT {\n display: inline-flex;\n animation: Button-module_spin__fjXhP 0.8s linear infinite;\n}\n\n.Button-module_spinnerCircle__7vRpf {\n stroke-dasharray: 50;\n stroke-dashoffset: 25;\n animation: Button-module_spinnerDash__y8Dii 1.5s ease-in-out infinite;\n}\n\n@keyframes Button-module_spin__fjXhP {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes Button-module_spinnerDash__y8Dii {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}\n");const s=(...n)=>n.filter(Boolean).join(" "),d={small:u.sizeSmall,medium:u.sizeMedium,large:u.sizeLarge},_=({size:n})=>{const o={small:14,medium:18,large:22}[n];return c.jsx("svg",{className:u.spinner,width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("circle",{className:u.spinnerCircle,cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})},m=n.forwardRef((n,o)=>{const{variant:e="text",color:r="primary",size:t="medium",component:a,className:l,loading:i=false,startIcon:m,endIcon:b,fullWidth:p=false,disableElevation:f=false,children:g,...y}=n,v="disabled"in n&&n.disabled,x="href"in n?n.href:void 0,h=a||(x?"a":"button"),B=v||i,k=s(u.root,u[e],((n,o)=>{const e=`${o}${n.charAt(0).toUpperCase()}${n.slice(1)}`;return u[e]||""})(r,e),d[t],B?u.disabled:void 0,p?u.fullWidth:void 0,f?u.noElevation:void 0,i?u.loading:void 0,l),S="button"===h?{disabled:B}:{},w="a"===h?{href:x,"aria-disabled":B}:{};return c.jsxs(h,{ref:o,className:k,...S,...w,...y,children:[i&&c.jsx("span",{className:u.loadingWrapper,children:c.jsx(_,{size:t})}),c.jsxs("span",{className:s(u.content,i?u.contentHidden:void 0),children:[m&&c.jsx("span",{className:u.startIcon,children:m}),g,b&&c.jsx("span",{className:u.endIcon,children:b})]})]})});m.displayName="Button";
|
|
435
|
-
|
|
436
|
-
function styleInject(css, ref) {
|
|
437
|
-
if ( ref === void 0 ) ref = {};
|
|
438
|
-
var insertAt = ref.insertAt;
|
|
439
|
-
|
|
440
|
-
if (typeof document === 'undefined') { return; }
|
|
441
|
-
|
|
442
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
443
|
-
var style = document.createElement('style');
|
|
444
|
-
style.type = 'text/css';
|
|
445
|
-
|
|
446
|
-
if (insertAt === 'top') {
|
|
447
|
-
if (head.firstChild) {
|
|
448
|
-
head.insertBefore(style, head.firstChild);
|
|
449
|
-
} else {
|
|
450
|
-
head.appendChild(style);
|
|
451
|
-
}
|
|
452
|
-
} else {
|
|
453
|
-
head.appendChild(style);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
if (style.styleSheet) {
|
|
457
|
-
style.styleSheet.cssText = css;
|
|
458
|
-
} else {
|
|
459
|
-
style.appendChild(document.createTextNode(css));
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
var css_248z = ".ConfirmationDialog-module_overlay__bdQDI {\n position: fixed;\n inset: 0;\n z-index: 50;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.2);\n backdrop-filter: blur(4px);\n}\n\n.ConfirmationDialog-module_dialog__ODwV- {\n background: var(--lb-color-background);\n border-radius: 0.75rem;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n width: min(100%, 28rem);\n margin: 0 1rem;\n overflow: hidden;\n}\n\n.ConfirmationDialog-module_animateIn__Fb5nP {\n animation:\n ConfirmationDialog-module_dialogFade__F0jpT 160ms ease-out,\n ConfirmationDialog-module_dialogZoom__WN57G 160ms ease-out;\n}\n\n@keyframes ConfirmationDialog-module_dialogFade__F0jpT {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes ConfirmationDialog-module_dialogZoom__WN57G {\n from {\n transform: scale(0.95);\n }\n to {\n transform: scale(1);\n }\n}\n\n.ConfirmationDialog-module_header__xJoKH {\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--lb-color-neutral-200);\n}\n\n.ConfirmationDialog-module_headerNormal__i1bDj {\n background: var(--lb-color-blue-subtle);\n border-color: var(--lb-color-blue-border);\n}\n\n.ConfirmationDialog-module_headerDanger__aM2CV {\n background: var(--lb-color-red-subtle);\n border-color: var(--lb-color-red-border);\n}\n\n.ConfirmationDialog-module_title__75-FA {\n font-size: 1.125rem;\n line-height: 1.75rem;\n font-weight: 600;\n}\n\n.ConfirmationDialog-module_titleNormal__kfGGy {\n color: var(--lb-color-blue-strong);\n}\n\n.ConfirmationDialog-module_titleDanger__8NChY {\n color: var(--lb-color-red-strong);\n}\n\n.ConfirmationDialog-module_body__kz4pG {\n padding: 1rem 1.5rem;\n}\n\n.ConfirmationDialog-module_message__jxj5U {\n color: var(--lb-color-neutral-600);\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.ConfirmationDialog-module_footer__bdQzE {\n display: flex;\n justify-content: flex-end;\n gap: 0.75rem;\n padding: 1rem 1.5rem;\n background: var(--lb-color-neutral-50);\n border-top: 1px solid var(--lb-color-neutral-200);\n}\n\n.ConfirmationDialog-module_storyStack__F4Q8j {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.ConfirmationDialog-module_storyStackLarge__yW6eR {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n}\n\n.ConfirmationDialog-module_storyButton__pES1K {\n padding: 0.5rem 1rem;\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n border-radius: 0.5rem;\n border: none;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 150ms ease;\n}\n\n.ConfirmationDialog-module_storyButton__pES1K:hover {\n background: var(--lb-color-primary-hover);\n}\n\n.ConfirmationDialog-module_storyDangerButton__-22gf {\n padding: 0.5rem 1rem;\n background: var(--lb-color-danger);\n color: var(--lb-color-danger-foreground);\n border-radius: 0.5rem;\n border: none;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 150ms ease;\n}\n\n.ConfirmationDialog-module_storyDangerButton__-22gf:hover {\n background: var(--lb-color-red-strong);\n}\n\n.ConfirmationDialog-module_storyHeading__qteHG {\n margin-bottom: 1rem;\n font-weight: 600;\n color: var(--lb-color-neutral-700);\n}\n";
|
|
464
|
-
var styles = {"overlay":"ConfirmationDialog-module_overlay__bdQDI","dialog":"ConfirmationDialog-module_dialog__ODwV-","animateIn":"ConfirmationDialog-module_animateIn__Fb5nP","header":"ConfirmationDialog-module_header__xJoKH","headerNormal":"ConfirmationDialog-module_headerNormal__i1bDj","headerDanger":"ConfirmationDialog-module_headerDanger__aM2CV","title":"ConfirmationDialog-module_title__75-FA","titleNormal":"ConfirmationDialog-module_titleNormal__kfGGy","titleDanger":"ConfirmationDialog-module_titleDanger__8NChY","body":"ConfirmationDialog-module_body__kz4pG","message":"ConfirmationDialog-module_message__jxj5U","footer":"ConfirmationDialog-module_footer__bdQzE"};
|
|
465
|
-
styleInject(css_248z);
|
|
466
|
-
|
|
467
|
-
const classNames = (...classes) => classes.filter(Boolean).join(" ");
|
|
468
|
-
const ConfirmationDialog = ({ isOpen, title, message, confirmText = "Confirm", cancelText = "Cancel", isDangerous = false, isLoading = false, onConfirm, onCancel, }) => {
|
|
469
|
-
if (!isOpen)
|
|
470
|
-
return null;
|
|
471
|
-
return (jsxRuntimeExports.jsx("div", { className: styles.overlay, children: jsxRuntimeExports.jsxs("div", { className: classNames(styles.dialog, styles.animateIn), children: [jsxRuntimeExports.jsx("div", { className: classNames(styles.header, isDangerous ? styles.headerDanger : styles.headerNormal), children: jsxRuntimeExports.jsx("h2", { className: classNames(styles.title, isDangerous ? styles.titleDanger : styles.titleNormal), children: title }) }), jsxRuntimeExports.jsx("div", { className: styles.body, children: jsxRuntimeExports.jsx("p", { className: styles.message, children: message }) }), jsxRuntimeExports.jsxs("div", { className: styles.footer, children: [jsxRuntimeExports.jsx(m, { onClick: onCancel, disabled: isLoading, variant: "outlined", color: "secondary", children: cancelText }), jsxRuntimeExports.jsx(m, { onClick: onConfirm, loading: isLoading, variant: "contained", color: isDangerous ? "error" : "primary", children: confirmText })] })] }) }));
|
|
472
|
-
};
|
|
473
|
-
|
|
474
17
|
export { ConfirmationDialog as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubenpazch/confirmation-dialog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "ConfirmationDialog component",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^19.0.0",
|
|
31
31
|
"react-dom": "^19.0.0",
|
|
32
|
-
"@rubenpazch/tokens": "0.
|
|
32
|
+
"@rubenpazch/tokens": "0.4.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@rubenpazch/button": "6.
|
|
35
|
+
"@rubenpazch/button": "6.2.0",
|
|
36
|
+
"@rubenpazch/modal": "0.1.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@rubenpazch/typescript-config": "3.0.0"
|
|
@@ -40,6 +41,12 @@
|
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|
|
44
|
+
"lbyte": {
|
|
45
|
+
"categoria": "retroalimentacion",
|
|
46
|
+
"resumen": "Diálogo modal de confirmación (aceptar/cancelar).",
|
|
47
|
+
"usarCuando": "Confirmar acciones destructivas o irreversibles (eliminar, anular, cerrar periodo).",
|
|
48
|
+
"evitarCuando": "Mostrar formularios o contenido largo: usa Drawer."
|
|
49
|
+
},
|
|
43
50
|
"scripts": {
|
|
44
51
|
"build": "rollup -c",
|
|
45
52
|
"test": "jest --passWithNoTests"
|