@lets-events/react 12.1.9 → 12.1.11
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/QuillComponent-C2NXFWIZ.mjs +459 -0
- package/dist/QuillComponent-O5RSHCDS.mjs +459 -0
- package/dist/QuillComponent-QFVVQA6K.mjs +459 -0
- package/dist/index.css +1 -12
- package/dist/index.js +1520 -1700
- package/dist/index.mjs +2632 -298
- package/package.json +1 -1
- package/src/components/RichEditor/QuillComponent.tsx +1 -1
- package/src/components/RichEditor/RichEditor.tsx +3 -6
- package/src/components/RichEditor/styledComponents.ts +3 -1
- package/src/components/RichEditor/styles.css +1300 -0
package/dist/index.mjs
CHANGED
|
@@ -1,24 +1,1434 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
37
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
48
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
49
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
50
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
51
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
52
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
|
+
mod
|
|
54
|
+
));
|
|
55
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
56
|
+
var __async = (__this, __arguments, generator) => {
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
var fulfilled = (value) => {
|
|
59
|
+
try {
|
|
60
|
+
step(generator.next(value));
|
|
61
|
+
} catch (e) {
|
|
62
|
+
reject(e);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var rejected = (value) => {
|
|
66
|
+
try {
|
|
67
|
+
step(generator.throw(value));
|
|
68
|
+
} catch (e) {
|
|
69
|
+
reject(e);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
73
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
78
|
+
var require_react_is_development = __commonJS({
|
|
79
|
+
"../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
80
|
+
"use strict";
|
|
81
|
+
if (true) {
|
|
82
|
+
(function() {
|
|
83
|
+
"use strict";
|
|
84
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
85
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
86
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
87
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
88
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
89
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
90
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
91
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
92
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
93
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
94
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
95
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
96
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
97
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
98
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
99
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
100
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
101
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
102
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
103
|
+
function isValidElementType(type) {
|
|
104
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
105
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
106
|
+
}
|
|
107
|
+
function typeOf(object) {
|
|
108
|
+
if (typeof object === "object" && object !== null) {
|
|
109
|
+
var $$typeof = object.$$typeof;
|
|
110
|
+
switch ($$typeof) {
|
|
111
|
+
case REACT_ELEMENT_TYPE:
|
|
112
|
+
var type = object.type;
|
|
113
|
+
switch (type) {
|
|
114
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
115
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
116
|
+
case REACT_FRAGMENT_TYPE:
|
|
117
|
+
case REACT_PROFILER_TYPE:
|
|
118
|
+
case REACT_STRICT_MODE_TYPE:
|
|
119
|
+
case REACT_SUSPENSE_TYPE:
|
|
120
|
+
return type;
|
|
121
|
+
default:
|
|
122
|
+
var $$typeofType = type && type.$$typeof;
|
|
123
|
+
switch ($$typeofType) {
|
|
124
|
+
case REACT_CONTEXT_TYPE:
|
|
125
|
+
case REACT_FORWARD_REF_TYPE:
|
|
126
|
+
case REACT_LAZY_TYPE:
|
|
127
|
+
case REACT_MEMO_TYPE:
|
|
128
|
+
case REACT_PROVIDER_TYPE:
|
|
129
|
+
return $$typeofType;
|
|
130
|
+
default:
|
|
131
|
+
return $$typeof;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
case REACT_PORTAL_TYPE:
|
|
135
|
+
return $$typeof;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return void 0;
|
|
139
|
+
}
|
|
140
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
141
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
142
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
143
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
144
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
145
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
146
|
+
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
147
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
148
|
+
var Memo = REACT_MEMO_TYPE;
|
|
149
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
150
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
151
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
152
|
+
var Suspense2 = REACT_SUSPENSE_TYPE;
|
|
153
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
154
|
+
function isAsyncMode(object) {
|
|
155
|
+
{
|
|
156
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
157
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
158
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
162
|
+
}
|
|
163
|
+
function isConcurrentMode(object) {
|
|
164
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
165
|
+
}
|
|
166
|
+
function isContextConsumer(object) {
|
|
167
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
168
|
+
}
|
|
169
|
+
function isContextProvider(object) {
|
|
170
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
171
|
+
}
|
|
172
|
+
function isElement(object) {
|
|
173
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
174
|
+
}
|
|
175
|
+
function isForwardRef(object) {
|
|
176
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
177
|
+
}
|
|
178
|
+
function isFragment(object) {
|
|
179
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
180
|
+
}
|
|
181
|
+
function isLazy(object) {
|
|
182
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
183
|
+
}
|
|
184
|
+
function isMemo(object) {
|
|
185
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
186
|
+
}
|
|
187
|
+
function isPortal(object) {
|
|
188
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
189
|
+
}
|
|
190
|
+
function isProfiler(object) {
|
|
191
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
192
|
+
}
|
|
193
|
+
function isStrictMode(object) {
|
|
194
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
195
|
+
}
|
|
196
|
+
function isSuspense(object) {
|
|
197
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
198
|
+
}
|
|
199
|
+
exports.AsyncMode = AsyncMode;
|
|
200
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
201
|
+
exports.ContextConsumer = ContextConsumer;
|
|
202
|
+
exports.ContextProvider = ContextProvider;
|
|
203
|
+
exports.Element = Element;
|
|
204
|
+
exports.ForwardRef = ForwardRef;
|
|
205
|
+
exports.Fragment = Fragment6;
|
|
206
|
+
exports.Lazy = Lazy;
|
|
207
|
+
exports.Memo = Memo;
|
|
208
|
+
exports.Portal = Portal;
|
|
209
|
+
exports.Profiler = Profiler;
|
|
210
|
+
exports.StrictMode = StrictMode;
|
|
211
|
+
exports.Suspense = Suspense2;
|
|
212
|
+
exports.isAsyncMode = isAsyncMode;
|
|
213
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
214
|
+
exports.isContextConsumer = isContextConsumer;
|
|
215
|
+
exports.isContextProvider = isContextProvider;
|
|
216
|
+
exports.isElement = isElement;
|
|
217
|
+
exports.isForwardRef = isForwardRef;
|
|
218
|
+
exports.isFragment = isFragment;
|
|
219
|
+
exports.isLazy = isLazy;
|
|
220
|
+
exports.isMemo = isMemo;
|
|
221
|
+
exports.isPortal = isPortal;
|
|
222
|
+
exports.isProfiler = isProfiler;
|
|
223
|
+
exports.isStrictMode = isStrictMode;
|
|
224
|
+
exports.isSuspense = isSuspense;
|
|
225
|
+
exports.isValidElementType = isValidElementType;
|
|
226
|
+
exports.typeOf = typeOf;
|
|
227
|
+
})();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// ../../node_modules/prop-types/node_modules/react-is/index.js
|
|
233
|
+
var require_react_is = __commonJS({
|
|
234
|
+
"../../node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
235
|
+
"use strict";
|
|
236
|
+
if (false) {
|
|
237
|
+
module.exports = null;
|
|
238
|
+
} else {
|
|
239
|
+
module.exports = require_react_is_development();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// ../../node_modules/object-assign/index.js
|
|
245
|
+
var require_object_assign = __commonJS({
|
|
246
|
+
"../../node_modules/object-assign/index.js"(exports, module) {
|
|
247
|
+
"use strict";
|
|
248
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
249
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
250
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
251
|
+
function toObject(val) {
|
|
252
|
+
if (val === null || val === void 0) {
|
|
253
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
254
|
+
}
|
|
255
|
+
return Object(val);
|
|
256
|
+
}
|
|
257
|
+
function shouldUseNative() {
|
|
258
|
+
try {
|
|
259
|
+
if (!Object.assign) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
var test1 = new String("abc");
|
|
263
|
+
test1[5] = "de";
|
|
264
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
var test2 = {};
|
|
268
|
+
for (var i = 0; i < 10; i++) {
|
|
269
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
270
|
+
}
|
|
271
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
272
|
+
return test2[n];
|
|
273
|
+
});
|
|
274
|
+
if (order2.join("") !== "0123456789") {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
var test3 = {};
|
|
278
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
279
|
+
test3[letter] = letter;
|
|
280
|
+
});
|
|
281
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
return true;
|
|
285
|
+
} catch (err) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
290
|
+
var from;
|
|
291
|
+
var to = toObject(target);
|
|
292
|
+
var symbols;
|
|
293
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
294
|
+
from = Object(arguments[s]);
|
|
295
|
+
for (var key in from) {
|
|
296
|
+
if (hasOwnProperty.call(from, key)) {
|
|
297
|
+
to[key] = from[key];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (getOwnPropertySymbols) {
|
|
301
|
+
symbols = getOwnPropertySymbols(from);
|
|
302
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
303
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
304
|
+
to[symbols[i]] = from[symbols[i]];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return to;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
315
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
316
|
+
"../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
317
|
+
"use strict";
|
|
318
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
319
|
+
module.exports = ReactPropTypesSecret;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// ../../node_modules/prop-types/lib/has.js
|
|
324
|
+
var require_has = __commonJS({
|
|
325
|
+
"../../node_modules/prop-types/lib/has.js"(exports, module) {
|
|
326
|
+
"use strict";
|
|
327
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
// ../../node_modules/prop-types/checkPropTypes.js
|
|
332
|
+
var require_checkPropTypes = __commonJS({
|
|
333
|
+
"../../node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
334
|
+
"use strict";
|
|
335
|
+
var printWarning = function() {
|
|
336
|
+
};
|
|
337
|
+
if (true) {
|
|
338
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
339
|
+
loggedTypeFailures = {};
|
|
340
|
+
has = require_has();
|
|
341
|
+
printWarning = function(text) {
|
|
342
|
+
var message2 = "Warning: " + text;
|
|
343
|
+
if (typeof console !== "undefined") {
|
|
344
|
+
console.error(message2);
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
throw new Error(message2);
|
|
348
|
+
} catch (x) {
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
var ReactPropTypesSecret;
|
|
353
|
+
var loggedTypeFailures;
|
|
354
|
+
var has;
|
|
355
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
356
|
+
if (true) {
|
|
357
|
+
for (var typeSpecName in typeSpecs) {
|
|
358
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
359
|
+
var error;
|
|
360
|
+
try {
|
|
361
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
362
|
+
var err = Error(
|
|
363
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
364
|
+
);
|
|
365
|
+
err.name = "Invariant Violation";
|
|
366
|
+
throw err;
|
|
367
|
+
}
|
|
368
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
369
|
+
} catch (ex) {
|
|
370
|
+
error = ex;
|
|
371
|
+
}
|
|
372
|
+
if (error && !(error instanceof Error)) {
|
|
373
|
+
printWarning(
|
|
374
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
378
|
+
loggedTypeFailures[error.message] = true;
|
|
379
|
+
var stack = getStack ? getStack() : "";
|
|
380
|
+
printWarning(
|
|
381
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
checkPropTypes.resetWarningCache = function() {
|
|
389
|
+
if (true) {
|
|
390
|
+
loggedTypeFailures = {};
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
module.exports = checkPropTypes;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// ../../node_modules/prop-types/factoryWithTypeCheckers.js
|
|
398
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
399
|
+
"../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
400
|
+
"use strict";
|
|
401
|
+
var ReactIs = require_react_is();
|
|
402
|
+
var assign = require_object_assign();
|
|
403
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
404
|
+
var has = require_has();
|
|
405
|
+
var checkPropTypes = require_checkPropTypes();
|
|
406
|
+
var printWarning = function() {
|
|
407
|
+
};
|
|
408
|
+
if (true) {
|
|
409
|
+
printWarning = function(text) {
|
|
410
|
+
var message2 = "Warning: " + text;
|
|
411
|
+
if (typeof console !== "undefined") {
|
|
412
|
+
console.error(message2);
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
throw new Error(message2);
|
|
416
|
+
} catch (x) {
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function emptyFunctionThatReturnsNull() {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
424
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
425
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
426
|
+
function getIteratorFn(maybeIterable) {
|
|
427
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
428
|
+
if (typeof iteratorFn === "function") {
|
|
429
|
+
return iteratorFn;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
433
|
+
var ReactPropTypes = {
|
|
434
|
+
array: createPrimitiveTypeChecker("array"),
|
|
435
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
436
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
437
|
+
func: createPrimitiveTypeChecker("function"),
|
|
438
|
+
number: createPrimitiveTypeChecker("number"),
|
|
439
|
+
object: createPrimitiveTypeChecker("object"),
|
|
440
|
+
string: createPrimitiveTypeChecker("string"),
|
|
441
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
442
|
+
any: createAnyTypeChecker(),
|
|
443
|
+
arrayOf: createArrayOfTypeChecker,
|
|
444
|
+
element: createElementTypeChecker(),
|
|
445
|
+
elementType: createElementTypeTypeChecker(),
|
|
446
|
+
instanceOf: createInstanceTypeChecker,
|
|
447
|
+
node: createNodeChecker(),
|
|
448
|
+
objectOf: createObjectOfTypeChecker,
|
|
449
|
+
oneOf: createEnumTypeChecker,
|
|
450
|
+
oneOfType: createUnionTypeChecker,
|
|
451
|
+
shape: createShapeTypeChecker,
|
|
452
|
+
exact: createStrictShapeTypeChecker
|
|
453
|
+
};
|
|
454
|
+
function is(x, y) {
|
|
455
|
+
if (x === y) {
|
|
456
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
457
|
+
} else {
|
|
458
|
+
return x !== x && y !== y;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function PropTypeError(message2, data) {
|
|
462
|
+
this.message = message2;
|
|
463
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
464
|
+
this.stack = "";
|
|
465
|
+
}
|
|
466
|
+
PropTypeError.prototype = Error.prototype;
|
|
467
|
+
function createChainableTypeChecker(validate) {
|
|
468
|
+
if (true) {
|
|
469
|
+
var manualPropTypeCallCache = {};
|
|
470
|
+
var manualPropTypeWarningCount = 0;
|
|
471
|
+
}
|
|
472
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
473
|
+
componentName = componentName || ANONYMOUS;
|
|
474
|
+
propFullName = propFullName || propName;
|
|
475
|
+
if (secret !== ReactPropTypesSecret) {
|
|
476
|
+
if (throwOnDirectAccess) {
|
|
477
|
+
var err = new Error(
|
|
478
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
479
|
+
);
|
|
480
|
+
err.name = "Invariant Violation";
|
|
481
|
+
throw err;
|
|
482
|
+
} else if (typeof console !== "undefined") {
|
|
483
|
+
var cacheKey = componentName + ":" + propName;
|
|
484
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
485
|
+
manualPropTypeWarningCount < 3) {
|
|
486
|
+
printWarning(
|
|
487
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
488
|
+
);
|
|
489
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
490
|
+
manualPropTypeWarningCount++;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (props[propName] == null) {
|
|
495
|
+
if (isRequired) {
|
|
496
|
+
if (props[propName] === null) {
|
|
497
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
498
|
+
}
|
|
499
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
500
|
+
}
|
|
501
|
+
return null;
|
|
502
|
+
} else {
|
|
503
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
507
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
508
|
+
return chainedCheckType;
|
|
509
|
+
}
|
|
510
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
511
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
512
|
+
var propValue = props[propName];
|
|
513
|
+
var propType = getPropType(propValue);
|
|
514
|
+
if (propType !== expectedType) {
|
|
515
|
+
var preciseType = getPreciseType(propValue);
|
|
516
|
+
return new PropTypeError(
|
|
517
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
518
|
+
{ expectedType }
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
return createChainableTypeChecker(validate);
|
|
524
|
+
}
|
|
525
|
+
function createAnyTypeChecker() {
|
|
526
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
527
|
+
}
|
|
528
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
529
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
530
|
+
if (typeof typeChecker !== "function") {
|
|
531
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
532
|
+
}
|
|
533
|
+
var propValue = props[propName];
|
|
534
|
+
if (!Array.isArray(propValue)) {
|
|
535
|
+
var propType = getPropType(propValue);
|
|
536
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
537
|
+
}
|
|
538
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
539
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
540
|
+
if (error instanceof Error) {
|
|
541
|
+
return error;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
return createChainableTypeChecker(validate);
|
|
547
|
+
}
|
|
548
|
+
function createElementTypeChecker() {
|
|
549
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
550
|
+
var propValue = props[propName];
|
|
551
|
+
if (!isValidElement(propValue)) {
|
|
552
|
+
var propType = getPropType(propValue);
|
|
553
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
554
|
+
}
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
return createChainableTypeChecker(validate);
|
|
558
|
+
}
|
|
559
|
+
function createElementTypeTypeChecker() {
|
|
560
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
561
|
+
var propValue = props[propName];
|
|
562
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
563
|
+
var propType = getPropType(propValue);
|
|
564
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
565
|
+
}
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
return createChainableTypeChecker(validate);
|
|
569
|
+
}
|
|
570
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
571
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
572
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
573
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
574
|
+
var actualClassName = getClassName(props[propName]);
|
|
575
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
576
|
+
}
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
return createChainableTypeChecker(validate);
|
|
580
|
+
}
|
|
581
|
+
function createEnumTypeChecker(expectedValues) {
|
|
582
|
+
if (!Array.isArray(expectedValues)) {
|
|
583
|
+
if (true) {
|
|
584
|
+
if (arguments.length > 1) {
|
|
585
|
+
printWarning(
|
|
586
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
587
|
+
);
|
|
588
|
+
} else {
|
|
589
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return emptyFunctionThatReturnsNull;
|
|
593
|
+
}
|
|
594
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
595
|
+
var propValue = props[propName];
|
|
596
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
597
|
+
if (is(propValue, expectedValues[i])) {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
602
|
+
var type = getPreciseType(value);
|
|
603
|
+
if (type === "symbol") {
|
|
604
|
+
return String(value);
|
|
605
|
+
}
|
|
606
|
+
return value;
|
|
607
|
+
});
|
|
608
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
609
|
+
}
|
|
610
|
+
return createChainableTypeChecker(validate);
|
|
611
|
+
}
|
|
612
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
613
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
614
|
+
if (typeof typeChecker !== "function") {
|
|
615
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
616
|
+
}
|
|
617
|
+
var propValue = props[propName];
|
|
618
|
+
var propType = getPropType(propValue);
|
|
619
|
+
if (propType !== "object") {
|
|
620
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
621
|
+
}
|
|
622
|
+
for (var key in propValue) {
|
|
623
|
+
if (has(propValue, key)) {
|
|
624
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
625
|
+
if (error instanceof Error) {
|
|
626
|
+
return error;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
632
|
+
return createChainableTypeChecker(validate);
|
|
633
|
+
}
|
|
634
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
635
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
636
|
+
true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
637
|
+
return emptyFunctionThatReturnsNull;
|
|
638
|
+
}
|
|
639
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
640
|
+
var checker = arrayOfTypeCheckers[i];
|
|
641
|
+
if (typeof checker !== "function") {
|
|
642
|
+
printWarning(
|
|
643
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
644
|
+
);
|
|
645
|
+
return emptyFunctionThatReturnsNull;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
649
|
+
var expectedTypes = [];
|
|
650
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
651
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
652
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
653
|
+
if (checkerResult == null) {
|
|
654
|
+
return null;
|
|
655
|
+
}
|
|
656
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
657
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
661
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
662
|
+
}
|
|
663
|
+
return createChainableTypeChecker(validate);
|
|
664
|
+
}
|
|
665
|
+
function createNodeChecker() {
|
|
666
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
667
|
+
if (!isNode(props[propName])) {
|
|
668
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
669
|
+
}
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
return createChainableTypeChecker(validate);
|
|
673
|
+
}
|
|
674
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
675
|
+
return new PropTypeError(
|
|
676
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
680
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
681
|
+
var propValue = props[propName];
|
|
682
|
+
var propType = getPropType(propValue);
|
|
683
|
+
if (propType !== "object") {
|
|
684
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
685
|
+
}
|
|
686
|
+
for (var key in shapeTypes) {
|
|
687
|
+
var checker = shapeTypes[key];
|
|
688
|
+
if (typeof checker !== "function") {
|
|
689
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
690
|
+
}
|
|
691
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
692
|
+
if (error) {
|
|
693
|
+
return error;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
return createChainableTypeChecker(validate);
|
|
699
|
+
}
|
|
700
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
701
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
702
|
+
var propValue = props[propName];
|
|
703
|
+
var propType = getPropType(propValue);
|
|
704
|
+
if (propType !== "object") {
|
|
705
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
706
|
+
}
|
|
707
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
708
|
+
for (var key in allKeys) {
|
|
709
|
+
var checker = shapeTypes[key];
|
|
710
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
711
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
712
|
+
}
|
|
713
|
+
if (!checker) {
|
|
714
|
+
return new PropTypeError(
|
|
715
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
719
|
+
if (error) {
|
|
720
|
+
return error;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
725
|
+
return createChainableTypeChecker(validate);
|
|
726
|
+
}
|
|
727
|
+
function isNode(propValue) {
|
|
728
|
+
switch (typeof propValue) {
|
|
729
|
+
case "number":
|
|
730
|
+
case "string":
|
|
731
|
+
case "undefined":
|
|
732
|
+
return true;
|
|
733
|
+
case "boolean":
|
|
734
|
+
return !propValue;
|
|
735
|
+
case "object":
|
|
736
|
+
if (Array.isArray(propValue)) {
|
|
737
|
+
return propValue.every(isNode);
|
|
738
|
+
}
|
|
739
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
740
|
+
return true;
|
|
741
|
+
}
|
|
742
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
743
|
+
if (iteratorFn) {
|
|
744
|
+
var iterator = iteratorFn.call(propValue);
|
|
745
|
+
var step;
|
|
746
|
+
if (iteratorFn !== propValue.entries) {
|
|
747
|
+
while (!(step = iterator.next()).done) {
|
|
748
|
+
if (!isNode(step.value)) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
} else {
|
|
753
|
+
while (!(step = iterator.next()).done) {
|
|
754
|
+
var entry = step.value;
|
|
755
|
+
if (entry) {
|
|
756
|
+
if (!isNode(entry[1])) {
|
|
757
|
+
return false;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
} else {
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
return true;
|
|
766
|
+
default:
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function isSymbol(propType, propValue) {
|
|
771
|
+
if (propType === "symbol") {
|
|
772
|
+
return true;
|
|
773
|
+
}
|
|
774
|
+
if (!propValue) {
|
|
775
|
+
return false;
|
|
776
|
+
}
|
|
777
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
781
|
+
return true;
|
|
782
|
+
}
|
|
783
|
+
return false;
|
|
784
|
+
}
|
|
785
|
+
function getPropType(propValue) {
|
|
786
|
+
var propType = typeof propValue;
|
|
787
|
+
if (Array.isArray(propValue)) {
|
|
788
|
+
return "array";
|
|
789
|
+
}
|
|
790
|
+
if (propValue instanceof RegExp) {
|
|
791
|
+
return "object";
|
|
792
|
+
}
|
|
793
|
+
if (isSymbol(propType, propValue)) {
|
|
794
|
+
return "symbol";
|
|
795
|
+
}
|
|
796
|
+
return propType;
|
|
797
|
+
}
|
|
798
|
+
function getPreciseType(propValue) {
|
|
799
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
800
|
+
return "" + propValue;
|
|
801
|
+
}
|
|
802
|
+
var propType = getPropType(propValue);
|
|
803
|
+
if (propType === "object") {
|
|
804
|
+
if (propValue instanceof Date) {
|
|
805
|
+
return "date";
|
|
806
|
+
} else if (propValue instanceof RegExp) {
|
|
807
|
+
return "regexp";
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return propType;
|
|
811
|
+
}
|
|
812
|
+
function getPostfixForTypeWarning(value) {
|
|
813
|
+
var type = getPreciseType(value);
|
|
814
|
+
switch (type) {
|
|
815
|
+
case "array":
|
|
816
|
+
case "object":
|
|
817
|
+
return "an " + type;
|
|
818
|
+
case "boolean":
|
|
819
|
+
case "date":
|
|
820
|
+
case "regexp":
|
|
821
|
+
return "a " + type;
|
|
822
|
+
default:
|
|
823
|
+
return type;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
function getClassName(propValue) {
|
|
827
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
828
|
+
return ANONYMOUS;
|
|
829
|
+
}
|
|
830
|
+
return propValue.constructor.name;
|
|
831
|
+
}
|
|
832
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
833
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
834
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
835
|
+
return ReactPropTypes;
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
// ../../node_modules/prop-types/index.js
|
|
841
|
+
var require_prop_types = __commonJS({
|
|
842
|
+
"../../node_modules/prop-types/index.js"(exports, module) {
|
|
843
|
+
"use strict";
|
|
844
|
+
if (true) {
|
|
845
|
+
ReactIs = require_react_is();
|
|
846
|
+
throwOnDirectAccess = true;
|
|
847
|
+
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
848
|
+
} else {
|
|
849
|
+
module.exports = null();
|
|
850
|
+
}
|
|
851
|
+
var ReactIs;
|
|
852
|
+
var throwOnDirectAccess;
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
// src/components/Icon.tsx
|
|
857
|
+
var import_prop_types = __toESM(require_prop_types());
|
|
858
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
859
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
860
|
+
import { fas } from "@fortawesome/free-solid-svg-icons";
|
|
861
|
+
import { far } from "@fortawesome/free-regular-svg-icons";
|
|
862
|
+
import { fab } from "@fortawesome/free-brands-svg-icons";
|
|
863
|
+
import { jsx } from "react/jsx-runtime";
|
|
864
|
+
library.add(fas, far, fab);
|
|
865
|
+
var Icon = (_a) => {
|
|
866
|
+
var _b = _a, { name, prefix = "fas", size = "sm", color = "currentColor", className = "" } = _b, props = __objRest(_b, ["name", "prefix", "size", "color", "className"]);
|
|
867
|
+
var _a2, _b2;
|
|
868
|
+
const sizeMap = {
|
|
869
|
+
"xs": { width: "0.625rem", height: "0.625rem", fontSize: "0.625rem" },
|
|
870
|
+
"sm": { width: "0.625rem", height: "0.625rem", fontSize: "0.625rem" },
|
|
871
|
+
"md": { width: "0.75rem", height: "0.75rem", fontSize: "0.75rem" },
|
|
872
|
+
"xl": { width: "1rem", height: "1rem", fontSize: "1rem" },
|
|
873
|
+
undefined: { width: "0.75rem", height: "0.75rem", fontSize: "0.75rem" }
|
|
874
|
+
};
|
|
875
|
+
return /* @__PURE__ */ jsx(
|
|
876
|
+
FontAwesomeIcon,
|
|
877
|
+
__spreadProps(__spreadValues({
|
|
878
|
+
icon: [prefix, name],
|
|
879
|
+
style: sizeMap[size],
|
|
880
|
+
color,
|
|
881
|
+
className
|
|
882
|
+
}, props), {
|
|
883
|
+
width: (_a2 = sizeMap[size]) == null ? void 0 : _a2.width,
|
|
884
|
+
height: (_b2 = sizeMap[size]) == null ? void 0 : _b2.height
|
|
885
|
+
})
|
|
886
|
+
);
|
|
887
|
+
};
|
|
888
|
+
Icon.propTypes = {
|
|
889
|
+
name: import_prop_types.default.string.isRequired,
|
|
890
|
+
prefix: import_prop_types.default.string,
|
|
891
|
+
size: import_prop_types.default.string,
|
|
892
|
+
color: import_prop_types.default.string,
|
|
893
|
+
className: import_prop_types.default.string
|
|
894
|
+
};
|
|
895
|
+
var Icon_default = Icon;
|
|
896
|
+
|
|
897
|
+
// ../tokens/dist/index.mjs
|
|
898
|
+
var colors = {
|
|
899
|
+
brand50: "#DBE8FF",
|
|
900
|
+
brand100: "#BDD5FF",
|
|
901
|
+
brand200: "#7AABFF",
|
|
902
|
+
brand300: "#3881FF",
|
|
903
|
+
brand400: "#005AF5",
|
|
904
|
+
brand500: "#004ED2",
|
|
905
|
+
brand600: "#0042B2",
|
|
906
|
+
brand700: "#00348F",
|
|
907
|
+
brand800: "#00276B",
|
|
908
|
+
brand900: "#001A47",
|
|
909
|
+
brand950: "#000D24",
|
|
910
|
+
blue50: "#E5F1FF",
|
|
911
|
+
blue100: "#CCE4FF",
|
|
912
|
+
blue200: "#9AC9FF",
|
|
913
|
+
blue300: "#66ADFF",
|
|
914
|
+
blue400: "#3392FF",
|
|
915
|
+
blue500: "#0278FE",
|
|
916
|
+
blue600: "#005FCD",
|
|
917
|
+
blue700: "#004799",
|
|
918
|
+
blue800: "#013066",
|
|
919
|
+
blue900: "#001834",
|
|
920
|
+
blue950: "#000C1A",
|
|
921
|
+
red50: "#FCEEEF",
|
|
922
|
+
red100: "#F9DCDF",
|
|
923
|
+
red200: "#F3BEC3",
|
|
924
|
+
red300: "#ED9CA2",
|
|
925
|
+
red400: "#E77982",
|
|
926
|
+
red500: "#E15662",
|
|
927
|
+
red600: "#DB3644",
|
|
928
|
+
red700: "#AD1F2B",
|
|
929
|
+
red800: "#75151D",
|
|
930
|
+
red900: "#380A0E",
|
|
931
|
+
red950: "#1E0507",
|
|
932
|
+
pink100: "#F9DCF3",
|
|
933
|
+
purple50: "#F3EFFB",
|
|
934
|
+
purple100: "#E6DEF7",
|
|
935
|
+
purple200: "#D1C2F0",
|
|
936
|
+
purple300: "#B9A1E8",
|
|
937
|
+
purple400: "#A080E0",
|
|
938
|
+
purple500: "#8961D8",
|
|
939
|
+
purple600: "#6431C8",
|
|
940
|
+
purple700: "#4B2597",
|
|
941
|
+
purple800: "#331966",
|
|
942
|
+
purple900: "#180C31",
|
|
943
|
+
purple950: "#0C0619",
|
|
944
|
+
yellow50: "#FFF9E6",
|
|
945
|
+
yellow100: "#FFF3CD",
|
|
946
|
+
yellow200: "#FFE69C",
|
|
947
|
+
yellow300: "#FFDA6A",
|
|
948
|
+
yellow400: "#FFCD39",
|
|
949
|
+
yellow500: "#FFC107",
|
|
950
|
+
yellow600: "#CC9A06",
|
|
951
|
+
yellow700: "#997404",
|
|
952
|
+
yellow800: "#664D03",
|
|
953
|
+
yellow900: "#332701",
|
|
954
|
+
yellow950: "#191300",
|
|
955
|
+
orange100: "#FEE0D8",
|
|
956
|
+
dark50: "#FFFFFF",
|
|
957
|
+
dark100: "#F4F4F4",
|
|
958
|
+
dark200: "#EAEBF0",
|
|
959
|
+
dark300: "#C2C3C7",
|
|
960
|
+
dark400: "#A9ABB1",
|
|
961
|
+
dark500: "#808289",
|
|
962
|
+
dark600: "#4C4F54",
|
|
963
|
+
dark700: "#34363B",
|
|
964
|
+
dark800: "#1E2023",
|
|
965
|
+
dark900: "#040507",
|
|
966
|
+
dark950: "#030303",
|
|
967
|
+
neutral50: "#FFFFFF",
|
|
968
|
+
neutral100: "#F4F4F4",
|
|
969
|
+
neutral200: "#EAEBF0",
|
|
970
|
+
neutral300: "#C2C3C7",
|
|
971
|
+
neutral400: "#A9ABB1",
|
|
972
|
+
neutral500: "#808289",
|
|
973
|
+
neutral600: "#4C4F54",
|
|
974
|
+
neutral700: "#34363B",
|
|
975
|
+
neutral800: "#1E2023",
|
|
976
|
+
neutral900: "#040507",
|
|
977
|
+
neutral950: "#030303",
|
|
978
|
+
green50: "#E6F9EA",
|
|
979
|
+
green100: "#CDF4D5",
|
|
980
|
+
green200: "#9BE8AC",
|
|
981
|
+
green300: "#6CD783",
|
|
982
|
+
green400: "#5BCA72",
|
|
983
|
+
green500: "#26A743",
|
|
984
|
+
green600: "#1E8535",
|
|
985
|
+
green700: "#176427",
|
|
986
|
+
green800: "#0F421A",
|
|
987
|
+
green900: "#08210D",
|
|
988
|
+
green950: "#041107",
|
|
989
|
+
grey50: "#F4F8FB",
|
|
990
|
+
grey100: "#E6EEF4",
|
|
991
|
+
grey200: "#DBE7F0",
|
|
992
|
+
grey300: "#BCCEDD",
|
|
993
|
+
grey400: "#9FB6C7",
|
|
994
|
+
grey500: "#849DAE",
|
|
995
|
+
grey600: "#698496",
|
|
996
|
+
grey700: "#516A7A",
|
|
997
|
+
grey800: "#394F61",
|
|
998
|
+
grey900: "#233543",
|
|
999
|
+
grey950: "#101B23",
|
|
1000
|
+
error50: "#FCEEEF",
|
|
1001
|
+
error100: "#F9DCDF",
|
|
1002
|
+
error200: "#F3BEC3",
|
|
1003
|
+
error300: "#ED9CA2",
|
|
1004
|
+
error400: "#E77982",
|
|
1005
|
+
error500: "#E15662",
|
|
1006
|
+
error600: "#DB3644",
|
|
1007
|
+
error700: "#AD1F2B",
|
|
1008
|
+
error800: "#75151D",
|
|
1009
|
+
error900: "#380A0E",
|
|
1010
|
+
error950: "#1E0507",
|
|
1011
|
+
success50: "#E6F9EA",
|
|
1012
|
+
success100: "#CDF4D5",
|
|
1013
|
+
success200: "#9BE8AC",
|
|
1014
|
+
success300: "#6CD783",
|
|
1015
|
+
success400: "#5BCA72",
|
|
1016
|
+
success500: "#26A743",
|
|
1017
|
+
success600: "#1E8535",
|
|
1018
|
+
success700: "#176427",
|
|
1019
|
+
success800: "#0F421A",
|
|
1020
|
+
success900: "#08210D",
|
|
1021
|
+
success950: "#041107",
|
|
1022
|
+
warning50: "#FFF9E6",
|
|
1023
|
+
warning100: "#FFF3CD",
|
|
1024
|
+
warning200: "#FFE69C",
|
|
1025
|
+
warning300: "#FFDA6A",
|
|
1026
|
+
warning400: "#FFCD39",
|
|
1027
|
+
warning500: "#FFC107",
|
|
1028
|
+
warning600: "#CC9A06",
|
|
1029
|
+
warning700: "#997404",
|
|
1030
|
+
warning800: "#664D03",
|
|
1031
|
+
warning900: "#332701",
|
|
1032
|
+
warning950: "#191300",
|
|
1033
|
+
info50: "#E5F1FF",
|
|
1034
|
+
info100: "#CCE4FF",
|
|
1035
|
+
info200: "#9AC9FF",
|
|
1036
|
+
info300: "#66ADFF",
|
|
1037
|
+
info400: "#3392FF",
|
|
1038
|
+
info500: "#0278FE",
|
|
1039
|
+
info600: "#005FCD",
|
|
1040
|
+
info700: "#004799",
|
|
1041
|
+
info800: "#013066",
|
|
1042
|
+
info900: "#001834",
|
|
1043
|
+
info950: "#000C1A",
|
|
1044
|
+
shadow50: "#546B923D"
|
|
1045
|
+
};
|
|
1046
|
+
var fonts = {
|
|
1047
|
+
default: '"Work Sans", sans-serif'
|
|
1048
|
+
};
|
|
1049
|
+
var fontSizes = {
|
|
1050
|
+
2: "0.125rem",
|
|
1051
|
+
4: "0.25rem",
|
|
1052
|
+
6: "0.375rem",
|
|
1053
|
+
8: "0.5rem",
|
|
1054
|
+
10: "0.625rem",
|
|
1055
|
+
12: "0.75rem",
|
|
1056
|
+
13: "0.8125rem",
|
|
1057
|
+
14: "0.875rem",
|
|
1058
|
+
16: "1rem",
|
|
1059
|
+
18: "1.125rem",
|
|
1060
|
+
20: "1.25rem",
|
|
1061
|
+
22: "1.375rem",
|
|
1062
|
+
24: "1.5rem",
|
|
1063
|
+
32: "2rem",
|
|
1064
|
+
36: "2.25rem",
|
|
1065
|
+
40: "2.5rem",
|
|
1066
|
+
48: "3rem",
|
|
1067
|
+
56: "3.5rem",
|
|
1068
|
+
64: "4rem",
|
|
1069
|
+
72: "4.5rem",
|
|
1070
|
+
80: "5rem",
|
|
1071
|
+
xs: "0.375rem",
|
|
1072
|
+
sm: "0.5rem",
|
|
1073
|
+
md: "0.75rem",
|
|
1074
|
+
lg: "1rem",
|
|
1075
|
+
"2xl": "1.5rem",
|
|
1076
|
+
"3xl": "2rem",
|
|
1077
|
+
"4xl": "2.5rem",
|
|
1078
|
+
full: "62.4375rem",
|
|
1079
|
+
displayLarge: "3.5rem",
|
|
1080
|
+
displayMedium: "3rem",
|
|
1081
|
+
displaySmall: "2.25rem",
|
|
1082
|
+
headline1: "2.5rem",
|
|
1083
|
+
headline2: "2rem",
|
|
1084
|
+
headline3: "1.75rem",
|
|
1085
|
+
headline4: "1.375rem",
|
|
1086
|
+
headline5: "1.25rem",
|
|
1087
|
+
headline6: "1.125rem",
|
|
1088
|
+
headline7: "1rem",
|
|
1089
|
+
headline8: "0.875rem",
|
|
1090
|
+
bodyXL: "1.25rem",
|
|
1091
|
+
bodyL: "1.125rem",
|
|
1092
|
+
bodyM: "1rem",
|
|
1093
|
+
bodyS: "0.875rem",
|
|
1094
|
+
bodyXS: "0.8125rem",
|
|
1095
|
+
bodyXXS: "0.75rem",
|
|
1096
|
+
buttonLarge: "1.25rem",
|
|
1097
|
+
buttonMedium: "0.875rem",
|
|
1098
|
+
buttonSmall: "0.875rem",
|
|
1099
|
+
buttonExtraSmall: "0.75rem",
|
|
1100
|
+
badgeLarge: "1rem",
|
|
1101
|
+
badgeMedium: "0.875rem",
|
|
1102
|
+
badgeSmall: "0.75rem",
|
|
1103
|
+
badgeExtraSmall: "0.625rem",
|
|
1104
|
+
tooltip: "0.875rem",
|
|
1105
|
+
popoversRegular: "0.875rem",
|
|
1106
|
+
labelLarge: "1rem",
|
|
1107
|
+
labelMedium: "0.875rem",
|
|
1108
|
+
labelSmall: "0.8125rem",
|
|
1109
|
+
labelExtraSmall: "0.75rem",
|
|
1110
|
+
captionLarge: "0.8125rem",
|
|
1111
|
+
captionMedium: "0.75rem",
|
|
1112
|
+
captionSmall: "0.625rem"
|
|
1113
|
+
};
|
|
1114
|
+
var fontWeights = {
|
|
1115
|
+
regular: "400",
|
|
1116
|
+
medium: "500",
|
|
1117
|
+
semibold: "600",
|
|
1118
|
+
bold: "700"
|
|
1119
|
+
};
|
|
1120
|
+
var lineHeights = {
|
|
1121
|
+
smaller: "112.5%",
|
|
1122
|
+
// 4px
|
|
1123
|
+
shorter: "125%",
|
|
1124
|
+
// 8px
|
|
1125
|
+
short: "137.5%",
|
|
1126
|
+
// 12px
|
|
1127
|
+
base: "150%",
|
|
1128
|
+
// 16px
|
|
1129
|
+
tall: "175%",
|
|
1130
|
+
// 24px
|
|
1131
|
+
displayLarge: "4.5rem",
|
|
1132
|
+
displayMedium: "4rem",
|
|
1133
|
+
displaySmall: "3.25rem",
|
|
1134
|
+
headline1: "3.25rem",
|
|
1135
|
+
headline2: "2.75rem",
|
|
1136
|
+
headline3: "2.5rem",
|
|
1137
|
+
headline4: "1.75rem",
|
|
1138
|
+
headline5: "1.5rem",
|
|
1139
|
+
headline6: "1.375rem",
|
|
1140
|
+
headline7: "1.5rem",
|
|
1141
|
+
headline8: "1.25rem",
|
|
1142
|
+
bodyXL: "1.75rem",
|
|
1143
|
+
bodyL: "1.625rem",
|
|
1144
|
+
bodyM: "1.5rem",
|
|
1145
|
+
bodyS: "1.25rem",
|
|
1146
|
+
bodyXS: "1.125rem",
|
|
1147
|
+
bodyXXS: "1rem",
|
|
1148
|
+
buttonLarge: "1.25rem",
|
|
1149
|
+
buttonMedium: "1rem",
|
|
1150
|
+
buttonSmall: "0.875rem",
|
|
1151
|
+
buttonExtraSmall: "0.75rem",
|
|
1152
|
+
badgeLarge: "1rem",
|
|
1153
|
+
badgeMedium: "0.875rem",
|
|
1154
|
+
badgeSmall: "0.75rem",
|
|
1155
|
+
badgeExtraSmall: "0.625rem",
|
|
1156
|
+
tooltip: "1rem",
|
|
1157
|
+
popoversRegular: "1rem",
|
|
1158
|
+
labelLarge: "1.125rem",
|
|
1159
|
+
labelMedium: "1.125rem",
|
|
1160
|
+
labelSmall: "1rem",
|
|
1161
|
+
labelExtraSmall: "1rem",
|
|
1162
|
+
captionLarge: "1rem",
|
|
1163
|
+
captionMedium: "0.875rem",
|
|
1164
|
+
captionSmall: "0.75rem"
|
|
1165
|
+
};
|
|
1166
|
+
var radii = {
|
|
1167
|
+
"3xs": "2px",
|
|
1168
|
+
"2xs": "4px",
|
|
1169
|
+
"xs": "6px",
|
|
1170
|
+
"sm": "8px",
|
|
1171
|
+
"md": "10px",
|
|
1172
|
+
"lg": "12px",
|
|
1173
|
+
"xl": "14px",
|
|
1174
|
+
"2xl": "16px",
|
|
1175
|
+
"3xl": "18px",
|
|
1176
|
+
"4xl": "20px",
|
|
1177
|
+
"5xl": "22px",
|
|
1178
|
+
"6xl": "24px",
|
|
1179
|
+
"7xl": "32px",
|
|
1180
|
+
"8xl": "36px",
|
|
1181
|
+
"9xl": "40px",
|
|
1182
|
+
"10xl": "48px",
|
|
1183
|
+
"11xl": "56px",
|
|
1184
|
+
"12xl": "64px",
|
|
1185
|
+
"13xl": "72px",
|
|
1186
|
+
"14xl": "80px",
|
|
1187
|
+
full: "99999px"
|
|
1188
|
+
};
|
|
1189
|
+
var space = {
|
|
1190
|
+
2: "0.125rem",
|
|
1191
|
+
4: "0.25rem",
|
|
1192
|
+
6: "0.375rem",
|
|
1193
|
+
8: "0.5rem",
|
|
1194
|
+
10: "0.625rem",
|
|
1195
|
+
12: "0.75rem",
|
|
1196
|
+
13: "0.8125rem",
|
|
1197
|
+
14: "0.875rem",
|
|
1198
|
+
16: "1rem",
|
|
1199
|
+
18: "1.125rem",
|
|
1200
|
+
20: "1.25rem",
|
|
1201
|
+
22: "1.375rem",
|
|
1202
|
+
24: "1.5rem",
|
|
1203
|
+
32: "2rem",
|
|
1204
|
+
36: "2.25rem",
|
|
1205
|
+
40: "2.5rem",
|
|
1206
|
+
48: "3rem",
|
|
1207
|
+
56: "3.5rem",
|
|
1208
|
+
64: "4rem",
|
|
1209
|
+
72: "4.5rem",
|
|
1210
|
+
80: "5rem",
|
|
1211
|
+
full: "62.4375rem"
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
// src/styles/index.ts
|
|
1215
|
+
import { createStitches, defaultThemeMap } from "@stitches/react";
|
|
1216
|
+
var {
|
|
17
1217
|
styled,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1218
|
+
css,
|
|
1219
|
+
globalCss,
|
|
1220
|
+
keyframes,
|
|
1221
|
+
getCssText,
|
|
1222
|
+
theme,
|
|
1223
|
+
createTheme,
|
|
1224
|
+
config
|
|
1225
|
+
} = createStitches({
|
|
1226
|
+
themeMap: __spreadProps(__spreadValues({}, defaultThemeMap), {
|
|
1227
|
+
height: "space",
|
|
1228
|
+
width: "space",
|
|
1229
|
+
gap: "space"
|
|
1230
|
+
}),
|
|
1231
|
+
theme: {
|
|
1232
|
+
colors,
|
|
1233
|
+
fontSizes,
|
|
1234
|
+
fonts,
|
|
1235
|
+
fontWeights,
|
|
1236
|
+
lineHeights,
|
|
1237
|
+
radii,
|
|
1238
|
+
space
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
// src/components/Text.tsx
|
|
1243
|
+
import { Text as TextRadix } from "@radix-ui/themes";
|
|
1244
|
+
|
|
1245
|
+
// src/types/typographyValues.ts
|
|
1246
|
+
var typographyValues = {
|
|
1247
|
+
displayLarge: {
|
|
1248
|
+
fontSize: "$displayLarge",
|
|
1249
|
+
lineHeight: "$displayLarge",
|
|
1250
|
+
letterSpacing: "$displayLarge"
|
|
1251
|
+
},
|
|
1252
|
+
displayMedium: {
|
|
1253
|
+
fontSize: "$displayMedium",
|
|
1254
|
+
lineHeight: "$displayMedium",
|
|
1255
|
+
letterSpacing: "$displayMedium"
|
|
1256
|
+
},
|
|
1257
|
+
displaySmall: {
|
|
1258
|
+
fontSize: "$displaySmall",
|
|
1259
|
+
lineHeight: "$displaySmall",
|
|
1260
|
+
letterSpacing: "$displaySmall"
|
|
1261
|
+
},
|
|
1262
|
+
headline1: {
|
|
1263
|
+
fontSize: "$headline1",
|
|
1264
|
+
lineHeight: "$headline1"
|
|
1265
|
+
},
|
|
1266
|
+
headline2: {
|
|
1267
|
+
fontSize: "$headline2",
|
|
1268
|
+
lineHeight: "$headline2"
|
|
1269
|
+
},
|
|
1270
|
+
headline3: {
|
|
1271
|
+
fontSize: "$headline3",
|
|
1272
|
+
lineHeight: "$headline3"
|
|
1273
|
+
},
|
|
1274
|
+
headline4: {
|
|
1275
|
+
fontSize: "$headline4",
|
|
1276
|
+
lineHeight: "$headline4"
|
|
1277
|
+
},
|
|
1278
|
+
headline5: {
|
|
1279
|
+
fontSize: "$headline5",
|
|
1280
|
+
lineHeight: "$headline5"
|
|
1281
|
+
},
|
|
1282
|
+
headline6: {
|
|
1283
|
+
fontSize: "$headline6",
|
|
1284
|
+
lineHeight: "$headline6"
|
|
1285
|
+
},
|
|
1286
|
+
headline7: {
|
|
1287
|
+
fontSize: "$headline7",
|
|
1288
|
+
lineHeight: "$headline7"
|
|
1289
|
+
},
|
|
1290
|
+
headline8: {
|
|
1291
|
+
fontSize: "$headline8",
|
|
1292
|
+
lineHeight: "$headline8"
|
|
1293
|
+
},
|
|
1294
|
+
bodyXL: {
|
|
1295
|
+
fontSize: "$bodyXL",
|
|
1296
|
+
lineHeight: "$bodyXL"
|
|
1297
|
+
},
|
|
1298
|
+
bodyL: {
|
|
1299
|
+
fontSize: "$bodyL",
|
|
1300
|
+
lineHeight: "$bodyL"
|
|
1301
|
+
},
|
|
1302
|
+
bodyM: {
|
|
1303
|
+
fontSize: "$bodyM",
|
|
1304
|
+
lineHeight: "$bodyM"
|
|
1305
|
+
},
|
|
1306
|
+
bodyS: {
|
|
1307
|
+
fontSize: "$bodyS",
|
|
1308
|
+
lineHeight: "$bodyS"
|
|
1309
|
+
},
|
|
1310
|
+
bodyXS: {
|
|
1311
|
+
fontSize: "$bodyXS",
|
|
1312
|
+
lineHeight: "$bodyXS"
|
|
1313
|
+
},
|
|
1314
|
+
bodyXXS: {
|
|
1315
|
+
fontSize: "$bodyXXS",
|
|
1316
|
+
lineHeight: "$bodyXXS"
|
|
1317
|
+
},
|
|
1318
|
+
badgeLarge: {
|
|
1319
|
+
fontSize: "$badgeLarge",
|
|
1320
|
+
lineHeight: "$badgeLarge"
|
|
1321
|
+
},
|
|
1322
|
+
badgeMedium: {
|
|
1323
|
+
fontSize: "$badgeMedium",
|
|
1324
|
+
lineHeight: "$badgeMedium"
|
|
1325
|
+
},
|
|
1326
|
+
badgeSmall: {
|
|
1327
|
+
fontSize: "$badgeSmall",
|
|
1328
|
+
lineHeight: "$badgeSmall"
|
|
1329
|
+
},
|
|
1330
|
+
badgeExtraSmall: {
|
|
1331
|
+
fontSize: "$badgeExtraSmall",
|
|
1332
|
+
lineHeight: "$badgeExtraSmall"
|
|
1333
|
+
},
|
|
1334
|
+
tooltip: {
|
|
1335
|
+
fontSize: "$tooltip",
|
|
1336
|
+
lineHeight: "$tooltip"
|
|
1337
|
+
},
|
|
1338
|
+
popoversRegular: {
|
|
1339
|
+
fontSize: "$popoversRegular",
|
|
1340
|
+
lineHeight: "$popoversRegular"
|
|
1341
|
+
},
|
|
1342
|
+
captionLarge: {
|
|
1343
|
+
fontSize: "$captionLarge",
|
|
1344
|
+
lineHeight: "$captionLarge"
|
|
1345
|
+
},
|
|
1346
|
+
captionMedium: {
|
|
1347
|
+
fontSize: "$captionMedium",
|
|
1348
|
+
lineHeight: "$captionMedium"
|
|
1349
|
+
},
|
|
1350
|
+
captionSmall: {
|
|
1351
|
+
fontSize: "$captionSmall",
|
|
1352
|
+
lineHeight: "$captionSmall"
|
|
1353
|
+
},
|
|
1354
|
+
buttonLarge: {
|
|
1355
|
+
fontSize: "$buttonLarge",
|
|
1356
|
+
lineHeight: "$buttonLarge"
|
|
1357
|
+
},
|
|
1358
|
+
buttonMedium: {
|
|
1359
|
+
fontSize: "$buttonMedium",
|
|
1360
|
+
lineHeight: "$buttonMedium"
|
|
1361
|
+
},
|
|
1362
|
+
buttonSmall: {
|
|
1363
|
+
fontSize: "$buttonSmall",
|
|
1364
|
+
lineHeight: "$buttonSmall"
|
|
1365
|
+
},
|
|
1366
|
+
buttonExtraSmall: {
|
|
1367
|
+
fontSize: "$buttonExtraSmall",
|
|
1368
|
+
lineHeight: "$buttonExtraSmall"
|
|
1369
|
+
},
|
|
1370
|
+
labelLarge: {
|
|
1371
|
+
fontSize: "$labelLarge",
|
|
1372
|
+
lineHeight: "$labelLarge"
|
|
1373
|
+
},
|
|
1374
|
+
labelMedium: {
|
|
1375
|
+
fontSize: "$labelMedium",
|
|
1376
|
+
lineHeight: "$labelMedium"
|
|
1377
|
+
},
|
|
1378
|
+
labelSmall: {
|
|
1379
|
+
fontSize: "$labelSmall",
|
|
1380
|
+
lineHeight: "$labelSmall"
|
|
1381
|
+
},
|
|
1382
|
+
labelExtraSmall: {
|
|
1383
|
+
fontSize: "$labelExtraSmall",
|
|
1384
|
+
lineHeight: "$labelExtraSmall"
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
var typographyLabelValues = {
|
|
1388
|
+
labelLarge: {
|
|
1389
|
+
fontSize: "$labelLarge",
|
|
1390
|
+
lineHeight: "$labelLarge"
|
|
1391
|
+
},
|
|
1392
|
+
labelMedium: {
|
|
1393
|
+
fontSize: "$labelMedium",
|
|
1394
|
+
lineHeight: "$labelMedium"
|
|
1395
|
+
},
|
|
1396
|
+
labelSmall: {
|
|
1397
|
+
fontSize: "$labelSmall",
|
|
1398
|
+
lineHeight: "$labelSmall"
|
|
1399
|
+
},
|
|
1400
|
+
labelExtraSmall: {
|
|
1401
|
+
fontSize: "$labelExtraSmall",
|
|
1402
|
+
lineHeight: "$labelExtraSmall"
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
// src/components/Text.tsx
|
|
1407
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1408
|
+
var TextStyle = styled(TextRadix, {
|
|
1409
|
+
fontFamily: "$default",
|
|
1410
|
+
lineHeight: "$base",
|
|
1411
|
+
variants: {
|
|
1412
|
+
typography: typographyValues,
|
|
1413
|
+
fontWeight: {
|
|
1414
|
+
regular: { fontWeight: "$regular" },
|
|
1415
|
+
medium: { fontWeight: "$medium" },
|
|
1416
|
+
semibold: { fontWeight: "$semibold" },
|
|
1417
|
+
bold: { fontWeight: "$bold" }
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
});
|
|
1421
|
+
function Text(_a) {
|
|
1422
|
+
var _b = _a, { color } = _b, props = __objRest(_b, ["color"]);
|
|
1423
|
+
return /* @__PURE__ */ jsx2(
|
|
1424
|
+
TextStyle,
|
|
1425
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1426
|
+
css: __spreadValues({
|
|
1427
|
+
color: color ? "$" + color : "$dark600"
|
|
1428
|
+
}, props.css)
|
|
1429
|
+
})
|
|
1430
|
+
);
|
|
1431
|
+
}
|
|
22
1432
|
|
|
23
1433
|
// src/components/Button/styledComponents.ts
|
|
24
1434
|
import { Button as ButtonRadix } from "@radix-ui/themes";
|
|
@@ -307,16 +1717,16 @@ var ButtonStyled = styled(ButtonRadix, {
|
|
|
307
1717
|
|
|
308
1718
|
// src/components/Button/index.tsx
|
|
309
1719
|
import { Button as ButtonRadix2 } from "@radix-ui/themes";
|
|
310
|
-
import { jsx } from "react/jsx-runtime";
|
|
1720
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
311
1721
|
function Button(_a) {
|
|
312
1722
|
var _b = _a, { asChild } = _b, props = __objRest(_b, ["asChild"]);
|
|
313
1723
|
const Component = asChild ? ButtonRadix2 : "button";
|
|
314
|
-
return /* @__PURE__ */
|
|
1724
|
+
return /* @__PURE__ */ jsx3(ButtonStyled, __spreadValues({ as: Component }, props));
|
|
315
1725
|
}
|
|
316
1726
|
|
|
317
1727
|
// src/components/ButtonGroup.tsx
|
|
318
|
-
import { Button as Button2, Flex
|
|
319
|
-
import { jsx as
|
|
1728
|
+
import { Button as Button2, Flex } from "@radix-ui/themes";
|
|
1729
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
320
1730
|
var ButtonItemStyled = styled(Button2, {
|
|
321
1731
|
fontFamily: "$default",
|
|
322
1732
|
letterSpacing: 0,
|
|
@@ -330,7 +1740,7 @@ var ButtonItemStyled = styled(Button2, {
|
|
|
330
1740
|
}
|
|
331
1741
|
}
|
|
332
1742
|
});
|
|
333
|
-
var ButtonGroupStyled = styled(
|
|
1743
|
+
var ButtonGroupStyled = styled(Flex, {
|
|
334
1744
|
display: "flex",
|
|
335
1745
|
borderRadius: "$md",
|
|
336
1746
|
overflow: "hidden",
|
|
@@ -782,16 +2192,16 @@ var ButtonGroupStyled = styled(Flex2, {
|
|
|
782
2192
|
});
|
|
783
2193
|
function ButtonItem(_a) {
|
|
784
2194
|
var _b = _a, { children, active } = _b, props = __objRest(_b, ["children", "active"]);
|
|
785
|
-
return /* @__PURE__ */
|
|
2195
|
+
return /* @__PURE__ */ jsx4(ButtonItemStyled, __spreadProps(__spreadValues({ className: active ? "active" : "" }, props), { children }));
|
|
786
2196
|
}
|
|
787
2197
|
function ButtonGroup(_a) {
|
|
788
2198
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
789
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsx4(ButtonGroupStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
790
2200
|
}
|
|
791
2201
|
|
|
792
2202
|
// src/components/Avatar.tsx
|
|
793
2203
|
import { Avatar as AvatarRadix } from "@radix-ui/themes";
|
|
794
|
-
import { jsx as
|
|
2204
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
795
2205
|
var AvatarStyled = styled(AvatarRadix, {
|
|
796
2206
|
fontFamily: "$default",
|
|
797
2207
|
color: "$gray100",
|
|
@@ -836,14 +2246,125 @@ var AvatarStyled = styled(AvatarRadix, {
|
|
|
836
2246
|
});
|
|
837
2247
|
function Avatar(_a) {
|
|
838
2248
|
var _b = _a, { asChild } = _b, props = __objRest(_b, ["asChild"]);
|
|
839
|
-
return /* @__PURE__ */
|
|
2249
|
+
return /* @__PURE__ */ jsx5(AvatarStyled, __spreadValues({ as: AvatarRadix }, props));
|
|
840
2250
|
}
|
|
841
2251
|
|
|
842
2252
|
// src/components/TextField.tsx
|
|
843
2253
|
import React from "react";
|
|
844
2254
|
import { TextField as TextFieldRadix } from "@radix-ui/themes";
|
|
2255
|
+
|
|
2256
|
+
// src/components/Flex.tsx
|
|
2257
|
+
import { Flex as FlexRadix } from "@radix-ui/themes";
|
|
2258
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2259
|
+
var FlexStyled = styled(FlexRadix, {
|
|
2260
|
+
variants: {
|
|
2261
|
+
display: {
|
|
2262
|
+
"flex": { display: "flex" },
|
|
2263
|
+
"inline-flex": { display: "inline-flex" }
|
|
2264
|
+
},
|
|
2265
|
+
align: {
|
|
2266
|
+
start: { alignItems: "flex-start" },
|
|
2267
|
+
center: { alignItems: "center" },
|
|
2268
|
+
end: { alignItems: "flex-end" },
|
|
2269
|
+
stretch: { alignItems: "stretch" },
|
|
2270
|
+
baseline: { alignItems: "baseline" }
|
|
2271
|
+
},
|
|
2272
|
+
justify: {
|
|
2273
|
+
start: { justifyContent: "flex-start" },
|
|
2274
|
+
center: { justifyContent: "center" },
|
|
2275
|
+
end: { justifyContent: "flex-end" },
|
|
2276
|
+
between: { justifyContent: "space-between" },
|
|
2277
|
+
around: { justifyContent: "space-around" },
|
|
2278
|
+
evenly: { justifyContent: "space-evenly" }
|
|
2279
|
+
},
|
|
2280
|
+
direction: {
|
|
2281
|
+
row: { flexDirection: "row" },
|
|
2282
|
+
column: { flexDirection: "column" },
|
|
2283
|
+
"row-reverse": { flexDirection: "row-reverse" },
|
|
2284
|
+
"column-reverse": { flexDirection: "column-reverse" }
|
|
2285
|
+
},
|
|
2286
|
+
gap: {
|
|
2287
|
+
0: { gap: "0px" },
|
|
2288
|
+
2: { gap: "$2" },
|
|
2289
|
+
4: { gap: "$4" },
|
|
2290
|
+
6: { gap: "$6" },
|
|
2291
|
+
8: { gap: "$8" },
|
|
2292
|
+
10: { gap: "$10" },
|
|
2293
|
+
12: { gap: "$12" },
|
|
2294
|
+
14: { gap: "$14" },
|
|
2295
|
+
16: { gap: "$16" },
|
|
2296
|
+
20: { gap: "$20" },
|
|
2297
|
+
22: { gap: "$22" },
|
|
2298
|
+
24: { gap: "$24" },
|
|
2299
|
+
32: { gap: "$32" },
|
|
2300
|
+
36: { gap: "$36" },
|
|
2301
|
+
40: { gap: "$40" },
|
|
2302
|
+
48: { gap: "$48" },
|
|
2303
|
+
56: { gap: "$56" },
|
|
2304
|
+
64: { gap: "$64" },
|
|
2305
|
+
72: { gap: "$72" },
|
|
2306
|
+
80: { gap: "$80" },
|
|
2307
|
+
full: { gap: "$full" }
|
|
2308
|
+
},
|
|
2309
|
+
gapY: {
|
|
2310
|
+
2: { gap: "$2" },
|
|
2311
|
+
4: { gap: "$4" },
|
|
2312
|
+
6: { gap: "$6" },
|
|
2313
|
+
8: { gap: "$8" },
|
|
2314
|
+
10: { gap: "$10" },
|
|
2315
|
+
12: { gap: "$12" },
|
|
2316
|
+
14: { gap: "$14" },
|
|
2317
|
+
16: { gap: "$16" },
|
|
2318
|
+
20: { gap: "$20" },
|
|
2319
|
+
22: { gap: "$22" },
|
|
2320
|
+
24: { gap: "$24" },
|
|
2321
|
+
32: { gap: "$32" },
|
|
2322
|
+
36: { gap: "$36" },
|
|
2323
|
+
40: { gap: "$40" },
|
|
2324
|
+
48: { gap: "$48" },
|
|
2325
|
+
56: { gap: "$56" },
|
|
2326
|
+
64: { gap: "$64" },
|
|
2327
|
+
72: { gap: "$72" },
|
|
2328
|
+
80: { gap: "$80" },
|
|
2329
|
+
full: { gap: "$full" }
|
|
2330
|
+
},
|
|
2331
|
+
gapX: {
|
|
2332
|
+
2: { gap: "$2" },
|
|
2333
|
+
4: { gap: "$4" },
|
|
2334
|
+
6: { gap: "$6" },
|
|
2335
|
+
8: { gap: "$8" },
|
|
2336
|
+
10: { gap: "$10" },
|
|
2337
|
+
12: { gap: "$12" },
|
|
2338
|
+
14: { gap: "$14" },
|
|
2339
|
+
16: { gap: "$16" },
|
|
2340
|
+
20: { gap: "$20" },
|
|
2341
|
+
22: { gap: "$22" },
|
|
2342
|
+
24: { gap: "$24" },
|
|
2343
|
+
32: { gap: "$32" },
|
|
2344
|
+
36: { gap: "$36" },
|
|
2345
|
+
40: { gap: "$40" },
|
|
2346
|
+
48: { gap: "$48" },
|
|
2347
|
+
56: { gap: "$56" },
|
|
2348
|
+
64: { gap: "$64" },
|
|
2349
|
+
72: { gap: "$72" },
|
|
2350
|
+
80: { gap: "$80" },
|
|
2351
|
+
full: { gap: "$full" }
|
|
2352
|
+
}
|
|
2353
|
+
},
|
|
2354
|
+
defaultVariants: {
|
|
2355
|
+
display: "flex",
|
|
2356
|
+
direction: "row",
|
|
2357
|
+
gap: 10
|
|
2358
|
+
}
|
|
2359
|
+
});
|
|
2360
|
+
function Flex2(_a) {
|
|
2361
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
2362
|
+
return /* @__PURE__ */ jsx6(FlexStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
// src/components/TextField.tsx
|
|
845
2366
|
import { format, useMask, unformat } from "@react-input/mask";
|
|
846
|
-
import { jsx as
|
|
2367
|
+
import { jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
847
2368
|
var TextFieldStyled = styled(TextFieldRadix.Root, {
|
|
848
2369
|
height: "$40",
|
|
849
2370
|
fontFamily: "$default",
|
|
@@ -1075,9 +2596,9 @@ var TextField = React.forwardRef(
|
|
|
1075
2596
|
updateCharCountBadge();
|
|
1076
2597
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
1077
2598
|
};
|
|
1078
|
-
return /* @__PURE__ */ jsxs(
|
|
1079
|
-
/* @__PURE__ */ jsxs(
|
|
1080
|
-
!!addon && /* @__PURE__ */
|
|
2599
|
+
return /* @__PURE__ */ jsxs(Flex2, { direction: "column", css: { width: "100%", position: "relative" }, children: [
|
|
2600
|
+
/* @__PURE__ */ jsxs(Flex2, { gap: "0", css: { width: "100%" }, children: [
|
|
2601
|
+
!!addon && /* @__PURE__ */ jsx7(
|
|
1081
2602
|
InputAddon,
|
|
1082
2603
|
{
|
|
1083
2604
|
color: hasError ? "error" : color,
|
|
@@ -1112,7 +2633,7 @@ var TextField = React.forwardRef(
|
|
|
1112
2633
|
} : void 0,
|
|
1113
2634
|
children: [
|
|
1114
2635
|
children,
|
|
1115
|
-
isValid2 && /* @__PURE__ */
|
|
2636
|
+
isValid2 && /* @__PURE__ */ jsx7(
|
|
1116
2637
|
TextFieldSlot,
|
|
1117
2638
|
{
|
|
1118
2639
|
position: "flex-end",
|
|
@@ -1121,14 +2642,14 @@ var TextField = React.forwardRef(
|
|
|
1121
2642
|
typography,
|
|
1122
2643
|
fontWeight,
|
|
1123
2644
|
textAlign,
|
|
1124
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ jsx7(Icon_default, { name: "check" })
|
|
1125
2646
|
}
|
|
1126
2647
|
)
|
|
1127
2648
|
]
|
|
1128
2649
|
})
|
|
1129
2650
|
)
|
|
1130
2651
|
] }),
|
|
1131
|
-
maxLength && /* @__PURE__ */
|
|
2652
|
+
maxLength && /* @__PURE__ */ jsx7(TextFieldLimitIndicator, { children: /* @__PURE__ */ jsx7("span", { ref: badgeRef, children: maxLength }) })
|
|
1132
2653
|
] });
|
|
1133
2654
|
}
|
|
1134
2655
|
);
|
|
@@ -1155,7 +2676,7 @@ function TextFieldSlot(_a) {
|
|
|
1155
2676
|
}, props), {
|
|
1156
2677
|
color: void 0
|
|
1157
2678
|
});
|
|
1158
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ jsx7(
|
|
1159
2680
|
TextFieldSlotStyled,
|
|
1160
2681
|
__spreadProps(__spreadValues({}, sharedStyles), {
|
|
1161
2682
|
style: {
|
|
@@ -1173,7 +2694,7 @@ function TextFieldSlot(_a) {
|
|
|
1173
2694
|
|
|
1174
2695
|
// src/components/RadioGroup.tsx
|
|
1175
2696
|
import { RadioGroup as RadioGroupRadix } from "@radix-ui/themes";
|
|
1176
|
-
import { jsx as
|
|
2697
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1177
2698
|
var RadioGroupStyled = styled(RadioGroupRadix.Root, {
|
|
1178
2699
|
fontFamily: "$default",
|
|
1179
2700
|
"label": {
|
|
@@ -1343,7 +2864,7 @@ function RadioGroup(_a) {
|
|
|
1343
2864
|
"children",
|
|
1344
2865
|
"disabled"
|
|
1345
2866
|
]);
|
|
1346
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ jsx8(
|
|
1347
2868
|
RadioGroupStyled,
|
|
1348
2869
|
__spreadProps(__spreadValues({
|
|
1349
2870
|
disabled
|
|
@@ -1358,12 +2879,12 @@ function RadioItem(_a) {
|
|
|
1358
2879
|
} = _b, props = __objRest(_b, [
|
|
1359
2880
|
"children"
|
|
1360
2881
|
]);
|
|
1361
|
-
return /* @__PURE__ */
|
|
2882
|
+
return /* @__PURE__ */ jsx8(RadioGroupRadix.Item, __spreadProps(__spreadValues({}, props), { children }));
|
|
1362
2883
|
}
|
|
1363
2884
|
|
|
1364
2885
|
// src/components/CheckboxGroup.tsx
|
|
1365
2886
|
import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
|
|
1366
|
-
import { jsx as
|
|
2887
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1367
2888
|
var CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
|
|
1368
2889
|
fontFamily: "$default",
|
|
1369
2890
|
svg: {
|
|
@@ -1508,16 +3029,16 @@ var CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
|
|
|
1508
3029
|
var StyledItem = styled(CheckboxGroupRadix.Item, {});
|
|
1509
3030
|
function CheckboxGroup(_a) {
|
|
1510
3031
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1511
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ jsx9(CheckboxGroupStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
1512
3033
|
}
|
|
1513
3034
|
function CheckboxItem(_a) {
|
|
1514
3035
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1515
|
-
return /* @__PURE__ */
|
|
3036
|
+
return /* @__PURE__ */ jsx9(StyledItem, __spreadProps(__spreadValues({}, props), { children }));
|
|
1516
3037
|
}
|
|
1517
3038
|
|
|
1518
3039
|
// src/components/Filter.tsx
|
|
1519
3040
|
import { Theme, DropdownMenu } from "@radix-ui/themes";
|
|
1520
|
-
import { jsx as
|
|
3041
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1521
3042
|
var FilterContentStyled = styled(DropdownMenu.Content, {
|
|
1522
3043
|
background: "white",
|
|
1523
3044
|
padding: "$8 $12",
|
|
@@ -1627,13 +3148,13 @@ function Filter(_a) {
|
|
|
1627
3148
|
"typography",
|
|
1628
3149
|
"fontWeight"
|
|
1629
3150
|
]);
|
|
1630
|
-
return /* @__PURE__ */
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ jsx10(Theme, { children: /* @__PURE__ */ jsx10(DropdownMenu.Root, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxs2(FilterStyled, { typography, fontWeight, children: [
|
|
3152
|
+
/* @__PURE__ */ jsx10(DropdownMenu.Trigger, { children: /* @__PURE__ */ jsxs2("button", { "aria-label": placeholder || "Fitrar", children: [
|
|
3153
|
+
/* @__PURE__ */ jsx10(Icon, { name: "filter" }),
|
|
3154
|
+
/* @__PURE__ */ jsx10("span", { children: placeholder || "Fitrar" }),
|
|
3155
|
+
/* @__PURE__ */ jsx10(DropdownMenu.TriggerIcon, {})
|
|
1635
3156
|
] }) }),
|
|
1636
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsx10(
|
|
1637
3158
|
FilterContentStyled,
|
|
1638
3159
|
{
|
|
1639
3160
|
avoidCollisions: false,
|
|
@@ -1641,7 +3162,7 @@ function Filter(_a) {
|
|
|
1641
3162
|
alignOffset: -14,
|
|
1642
3163
|
typography,
|
|
1643
3164
|
fontWeight,
|
|
1644
|
-
children: /* @__PURE__ */
|
|
3165
|
+
children: /* @__PURE__ */ jsx10(CheckboxGroup, { children })
|
|
1645
3166
|
}
|
|
1646
3167
|
)
|
|
1647
3168
|
] }) })) });
|
|
@@ -1652,7 +3173,7 @@ function FilterItem(_a) {
|
|
|
1652
3173
|
} = _b, props = __objRest(_b, [
|
|
1653
3174
|
"children"
|
|
1654
3175
|
]);
|
|
1655
|
-
return /* @__PURE__ */
|
|
3176
|
+
return /* @__PURE__ */ jsx10(CheckboxItem, __spreadProps(__spreadValues({}, props), { style: { padding: "8px 12px" }, children }));
|
|
1656
3177
|
}
|
|
1657
3178
|
|
|
1658
3179
|
// src/components/Dropdown.tsx
|
|
@@ -1662,8 +3183,8 @@ import React2, {
|
|
|
1662
3183
|
useEffect
|
|
1663
3184
|
} from "react";
|
|
1664
3185
|
import { faChevronDown, faChevronUp } from "@fortawesome/free-solid-svg-icons";
|
|
1665
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
1666
|
-
import { jsx as
|
|
3186
|
+
import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
|
|
3187
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1667
3188
|
var DropdownMenuItemStyled = styled("div", {
|
|
1668
3189
|
fontFamily: "$default",
|
|
1669
3190
|
color: "$dark600",
|
|
@@ -1852,9 +3373,9 @@ function DropdownMenu2(_a) {
|
|
|
1852
3373
|
}
|
|
1853
3374
|
},
|
|
1854
3375
|
children: [
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
|
|
3376
|
+
/* @__PURE__ */ jsx11("span", { children: placeholder || "Filtrar" }),
|
|
3377
|
+
/* @__PURE__ */ jsx11(
|
|
3378
|
+
FontAwesomeIcon2,
|
|
1858
3379
|
{
|
|
1859
3380
|
icon: isOpen ? faChevronUp : faChevronDown,
|
|
1860
3381
|
size: "sm",
|
|
@@ -1864,7 +3385,7 @@ function DropdownMenu2(_a) {
|
|
|
1864
3385
|
]
|
|
1865
3386
|
}
|
|
1866
3387
|
),
|
|
1867
|
-
isOpen && /* @__PURE__ */
|
|
3388
|
+
isOpen && /* @__PURE__ */ jsx11(DropdownMenuContentStyled, { role: "listbox", children: /* @__PURE__ */ jsx11(DropdownMenuProvider, { onItemSelect: handleClose, children }) })
|
|
1868
3389
|
]
|
|
1869
3390
|
})
|
|
1870
3391
|
);
|
|
@@ -1874,7 +3395,7 @@ function DropdownMenuProvider({
|
|
|
1874
3395
|
children,
|
|
1875
3396
|
onItemSelect
|
|
1876
3397
|
}) {
|
|
1877
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ jsx11(DropdownMenuContext.Provider, { value: { onItemSelect }, children });
|
|
1878
3399
|
}
|
|
1879
3400
|
function DropdownMenuItem(_a) {
|
|
1880
3401
|
var _b = _a, {
|
|
@@ -1905,7 +3426,7 @@ function DropdownMenuItem(_a) {
|
|
|
1905
3426
|
context == null ? void 0 : context.onItemSelect();
|
|
1906
3427
|
}
|
|
1907
3428
|
};
|
|
1908
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsx11(
|
|
1909
3430
|
DropdownMenuItemStyled,
|
|
1910
3431
|
__spreadProps(__spreadValues({
|
|
1911
3432
|
typography,
|
|
@@ -1923,7 +3444,7 @@ function DropdownMenuItem(_a) {
|
|
|
1923
3444
|
// src/components/Badge.tsx
|
|
1924
3445
|
import React3 from "react";
|
|
1925
3446
|
import { Badge as BadgeRadix } from "@radix-ui/themes";
|
|
1926
|
-
import { jsx as
|
|
3447
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1927
3448
|
var BadgeStyled = styled(BadgeRadix, {
|
|
1928
3449
|
fontFamily: "$default",
|
|
1929
3450
|
borderRadius: "$sm",
|
|
@@ -2025,7 +3546,7 @@ var BadgeStyled = styled(BadgeRadix, {
|
|
|
2025
3546
|
});
|
|
2026
3547
|
function Badge(_a) {
|
|
2027
3548
|
var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
|
|
2028
|
-
return /* @__PURE__ */
|
|
3549
|
+
return /* @__PURE__ */ jsx12(BadgeStyled, __spreadProps(__spreadValues({}, props), { children: React3.Children.map(children, (child) => {
|
|
2029
3550
|
if (React3.isValidElement(child)) {
|
|
2030
3551
|
return React3.cloneElement(child, { size: props.size });
|
|
2031
3552
|
}
|
|
@@ -2041,7 +3562,7 @@ import { Box as BoxRadix } from "@radix-ui/themes";
|
|
|
2041
3562
|
var Box = BoxRadix;
|
|
2042
3563
|
|
|
2043
3564
|
// src/components/Modal.tsx
|
|
2044
|
-
import { jsx as
|
|
3565
|
+
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2045
3566
|
var ModalContentStyled = styled(ModalRadix.Content, {
|
|
2046
3567
|
fontFamily: "$default",
|
|
2047
3568
|
lineHeight: "$base",
|
|
@@ -2090,13 +3611,13 @@ var ModalTitleStyled = styled(ModalRadix.Title, {
|
|
|
2090
3611
|
function Modal(_a) {
|
|
2091
3612
|
var _b = _a, { children, title, trigger } = _b, props = __objRest(_b, ["children", "title", "trigger"]);
|
|
2092
3613
|
return /* @__PURE__ */ jsxs4(ModalRadix.Root, __spreadProps(__spreadValues({}, props), { children: [
|
|
2093
|
-
trigger && /* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
3614
|
+
trigger && /* @__PURE__ */ jsx13(ModalRadix.Trigger, { asChild: true, children: trigger }),
|
|
3615
|
+
/* @__PURE__ */ jsx13(ModalRadix.Portal, { children: /* @__PURE__ */ jsx13(ModalOverlay, { children: /* @__PURE__ */ jsxs4(ModalContentStyled, { children: [
|
|
2095
3616
|
title && /* @__PURE__ */ jsxs4(ModalHeaderStyled, { children: [
|
|
2096
|
-
/* @__PURE__ */
|
|
2097
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx13(ModalTitleStyled, { asChild: true, children: /* @__PURE__ */ jsx13(Text, { typography: "headline6", fontWeight: "medium", children: title }) }),
|
|
3618
|
+
/* @__PURE__ */ jsx13(ModalRadix.Close, { asChild: true, children: /* @__PURE__ */ jsx13(ModalIconClose, { name: "close", size: "xl" }) })
|
|
2098
3619
|
] }),
|
|
2099
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx13(Box, { children })
|
|
2100
3621
|
] }) }) })
|
|
2101
3622
|
] }));
|
|
2102
3623
|
}
|
|
@@ -2169,7 +3690,7 @@ function useOnClickOutside(ref, handler) {
|
|
|
2169
3690
|
}
|
|
2170
3691
|
|
|
2171
3692
|
// src/components/MenuDropdown/index.tsx
|
|
2172
|
-
import { jsx as
|
|
3693
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2173
3694
|
function MenuDropdown({
|
|
2174
3695
|
children,
|
|
2175
3696
|
isOpen,
|
|
@@ -2180,8 +3701,8 @@ function MenuDropdown({
|
|
|
2180
3701
|
setIsOpen(false);
|
|
2181
3702
|
});
|
|
2182
3703
|
return /* @__PURE__ */ jsxs5(MenuDropdownContainerStyled, { children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
isOpen && /* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsx14(TriggerButtonStyled, { onClick: () => setIsOpen(!isOpen), children: /* @__PURE__ */ jsx14(Icon_default, { name: "ellipsis", size: "xl", color: "#FFFFFF" }) }),
|
|
3705
|
+
isOpen && /* @__PURE__ */ jsx14(MenuItemsContainerStyled, { ref: dropdownItemsContainerRef, children })
|
|
2185
3706
|
] });
|
|
2186
3707
|
}
|
|
2187
3708
|
|
|
@@ -6320,7 +7841,7 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
6320
7841
|
});
|
|
6321
7842
|
|
|
6322
7843
|
// src/components/Calendar/index.tsx
|
|
6323
|
-
import { jsx as
|
|
7844
|
+
import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6324
7845
|
function formatToDateMask(value) {
|
|
6325
7846
|
const numeric = value.replace(/\D/g, "").slice(0, 8);
|
|
6326
7847
|
const parts = numeric.match(/^(\d{0,2})(\d{0,2})(\d{0,4})$/);
|
|
@@ -6379,14 +7900,14 @@ function Calendar(_a) {
|
|
|
6379
7900
|
console.warn("Data inv\xE1lida inserida no input:", masked);
|
|
6380
7901
|
}
|
|
6381
7902
|
};
|
|
6382
|
-
return /* @__PURE__ */
|
|
6383
|
-
/* @__PURE__ */
|
|
7903
|
+
return /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsxs6(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
|
|
7904
|
+
/* @__PURE__ */ jsx15(
|
|
6384
7905
|
CalendarButtonStyled,
|
|
6385
7906
|
{
|
|
6386
7907
|
expand,
|
|
6387
7908
|
type: "button",
|
|
6388
7909
|
onClick: () => setShowCalendar((prev) => !prev),
|
|
6389
|
-
children: /* @__PURE__ */
|
|
7910
|
+
children: /* @__PURE__ */ jsx15(
|
|
6390
7911
|
TextField,
|
|
6391
7912
|
{
|
|
6392
7913
|
placeholder: "00/00/0000",
|
|
@@ -6396,13 +7917,13 @@ function Calendar(_a) {
|
|
|
6396
7917
|
inputMode: "numeric",
|
|
6397
7918
|
textAlign: "right",
|
|
6398
7919
|
color: hasError ? "error" : "default",
|
|
6399
|
-
children: /* @__PURE__ */
|
|
7920
|
+
children: /* @__PURE__ */ jsx15(TextFieldSlot, { children: /* @__PURE__ */ jsx15(Icon_default, { name: "calendar", size: "xl" }) })
|
|
6400
7921
|
}
|
|
6401
7922
|
)
|
|
6402
7923
|
}
|
|
6403
7924
|
),
|
|
6404
7925
|
showContainer && /* @__PURE__ */ jsxs6(CalendarContentStyled, { position, children: [
|
|
6405
|
-
/* @__PURE__ */
|
|
7926
|
+
/* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(DayPickerWrapperStyled, { children: /* @__PURE__ */ jsx15(
|
|
6406
7927
|
DayPicker,
|
|
6407
7928
|
{
|
|
6408
7929
|
mode: "single",
|
|
@@ -6416,7 +7937,7 @@ function Calendar(_a) {
|
|
|
6416
7937
|
endMonth: maxDate
|
|
6417
7938
|
}
|
|
6418
7939
|
) }) }),
|
|
6419
|
-
action && /* @__PURE__ */
|
|
7940
|
+
action && /* @__PURE__ */ jsx15(CalendarFooterStyled, { children: /* @__PURE__ */ jsx15(
|
|
6420
7941
|
Button,
|
|
6421
7942
|
{
|
|
6422
7943
|
variant: "text",
|
|
@@ -6482,7 +8003,7 @@ var DrawerHeaderCloseButton = styled("button", {
|
|
|
6482
8003
|
});
|
|
6483
8004
|
|
|
6484
8005
|
// src/components/Drawer/index.tsx
|
|
6485
|
-
import { jsx as
|
|
8006
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6486
8007
|
function Drawer({
|
|
6487
8008
|
isOpen,
|
|
6488
8009
|
onClose,
|
|
@@ -6533,7 +8054,7 @@ function Drawer({
|
|
|
6533
8054
|
onClose();
|
|
6534
8055
|
}
|
|
6535
8056
|
});
|
|
6536
|
-
return /* @__PURE__ */
|
|
8057
|
+
return /* @__PURE__ */ jsx16(DrawerOverlayStyled, { children: /* @__PURE__ */ jsxs7(
|
|
6537
8058
|
DrawerContainerStyled,
|
|
6538
8059
|
{
|
|
6539
8060
|
ref: drawerContainerRef,
|
|
@@ -6543,8 +8064,8 @@ function Drawer({
|
|
|
6543
8064
|
},
|
|
6544
8065
|
children: [
|
|
6545
8066
|
/* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
|
|
6546
|
-
/* @__PURE__ */
|
|
6547
|
-
/* @__PURE__ */
|
|
8067
|
+
/* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title }),
|
|
8068
|
+
/* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
6548
8069
|
] }),
|
|
6549
8070
|
children
|
|
6550
8071
|
]
|
|
@@ -6554,7 +8075,7 @@ function Drawer({
|
|
|
6554
8075
|
|
|
6555
8076
|
// src/components/TimePicker.tsx
|
|
6556
8077
|
import { useCallback, useRef as useRef5, useState as useState3 } from "react";
|
|
6557
|
-
import { jsx as
|
|
8078
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6558
8079
|
var TimePickerStyled = styled("div", {
|
|
6559
8080
|
position: "relative",
|
|
6560
8081
|
width: "fit-content",
|
|
@@ -6712,13 +8233,13 @@ function TimePicker({
|
|
|
6712
8233
|
[hours, minutes]
|
|
6713
8234
|
);
|
|
6714
8235
|
return /* @__PURE__ */ jsxs8(TimePickerStyled, { ref: dropdownRef, expand, children: [
|
|
6715
|
-
/* @__PURE__ */
|
|
8236
|
+
/* @__PURE__ */ jsx17(
|
|
6716
8237
|
TimePickerButtonStyled,
|
|
6717
8238
|
{
|
|
6718
8239
|
type: "button",
|
|
6719
8240
|
onClick: () => setIsOpen((prev) => !prev),
|
|
6720
8241
|
expand,
|
|
6721
|
-
children: /* @__PURE__ */
|
|
8242
|
+
children: /* @__PURE__ */ jsx17(
|
|
6722
8243
|
TextField,
|
|
6723
8244
|
{
|
|
6724
8245
|
value: selected,
|
|
@@ -6728,7 +8249,7 @@ function TimePicker({
|
|
|
6728
8249
|
typography: "labelSmall",
|
|
6729
8250
|
fontWeight: "regular",
|
|
6730
8251
|
color: hasError ? "error" : "default",
|
|
6731
|
-
children: /* @__PURE__ */
|
|
8252
|
+
children: /* @__PURE__ */ jsx17(TextFieldSlot, { children: /* @__PURE__ */ jsx17(Icon_default, { name: "clock", size: "xl" }) })
|
|
6732
8253
|
}
|
|
6733
8254
|
)
|
|
6734
8255
|
}
|
|
@@ -6748,7 +8269,7 @@ function TimePicker({
|
|
|
6748
8269
|
flexDirection: "column"
|
|
6749
8270
|
},
|
|
6750
8271
|
children: [
|
|
6751
|
-
/* @__PURE__ */
|
|
8272
|
+
/* @__PURE__ */ jsx17(
|
|
6752
8273
|
TimePickerIconButton,
|
|
6753
8274
|
{
|
|
6754
8275
|
type: "button",
|
|
@@ -6763,14 +8284,14 @@ function TimePicker({
|
|
|
6763
8284
|
viewBox: "0 0 32 32",
|
|
6764
8285
|
fill: "none",
|
|
6765
8286
|
children: [
|
|
6766
|
-
/* @__PURE__ */
|
|
8287
|
+
/* @__PURE__ */ jsx17(
|
|
6767
8288
|
"path",
|
|
6768
8289
|
{
|
|
6769
8290
|
d: "M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",
|
|
6770
8291
|
fill: "white"
|
|
6771
8292
|
}
|
|
6772
8293
|
),
|
|
6773
|
-
/* @__PURE__ */
|
|
8294
|
+
/* @__PURE__ */ jsx17(
|
|
6774
8295
|
"path",
|
|
6775
8296
|
{
|
|
6776
8297
|
d: "M16.7063 12.2937C16.3157 11.9031 15.6813 11.9031 15.2907 12.2937L10.2907 17.2937C9.9001 17.6843 9.9001 18.3187 10.2907 18.7093C10.6813 19.1 11.3157 19.1 11.7063 18.7093L16.0001 14.4156L20.2938 18.7062C20.6845 19.0968 21.3188 19.0968 21.7095 18.7062C22.1001 18.3156 22.1001 17.6812 21.7095 17.2906L16.7095 12.2906L16.7063 12.2937Z",
|
|
@@ -6782,7 +8303,7 @@ function TimePicker({
|
|
|
6782
8303
|
)
|
|
6783
8304
|
}
|
|
6784
8305
|
),
|
|
6785
|
-
/* @__PURE__ */
|
|
8306
|
+
/* @__PURE__ */ jsx17(
|
|
6786
8307
|
InputStyled,
|
|
6787
8308
|
{
|
|
6788
8309
|
inputMode: "numeric",
|
|
@@ -6820,7 +8341,7 @@ function TimePicker({
|
|
|
6820
8341
|
}
|
|
6821
8342
|
}
|
|
6822
8343
|
),
|
|
6823
|
-
/* @__PURE__ */
|
|
8344
|
+
/* @__PURE__ */ jsx17(
|
|
6824
8345
|
TimePickerIconButton,
|
|
6825
8346
|
{
|
|
6826
8347
|
type: "button",
|
|
@@ -6835,14 +8356,14 @@ function TimePicker({
|
|
|
6835
8356
|
viewBox: "0 0 32 32",
|
|
6836
8357
|
fill: "none",
|
|
6837
8358
|
children: [
|
|
6838
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ jsx17(
|
|
6839
8360
|
"path",
|
|
6840
8361
|
{
|
|
6841
8362
|
d: "M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",
|
|
6842
8363
|
fill: "white"
|
|
6843
8364
|
}
|
|
6844
8365
|
),
|
|
6845
|
-
/* @__PURE__ */
|
|
8366
|
+
/* @__PURE__ */ jsx17(
|
|
6846
8367
|
"path",
|
|
6847
8368
|
{
|
|
6848
8369
|
d: "M15.2937 19.7063C15.6843 20.0969 16.3187 20.0969 16.7093 19.7063L21.7093 14.7063C22.0999 14.3157 22.0999 13.6813 21.7093 13.2907C21.3187 12.9 20.6843 12.9 20.2937 13.2907L15.9999 17.5844L11.7062 13.2938C11.3155 12.9032 10.6812 12.9032 10.2905 13.2938C9.8999 13.6844 9.8999 14.3188 10.2905 14.7094L15.2905 19.7094L15.2937 19.7063Z",
|
|
@@ -6858,9 +8379,9 @@ function TimePicker({
|
|
|
6858
8379
|
},
|
|
6859
8380
|
unit
|
|
6860
8381
|
)),
|
|
6861
|
-
/* @__PURE__ */
|
|
8382
|
+
/* @__PURE__ */ jsx17(Text, { children: ":" })
|
|
6862
8383
|
] }),
|
|
6863
|
-
/* @__PURE__ */
|
|
8384
|
+
/* @__PURE__ */ jsx17(TimePickerFooterStyled, { children: /* @__PURE__ */ jsx17(
|
|
6864
8385
|
Button,
|
|
6865
8386
|
{
|
|
6866
8387
|
type: "button",
|
|
@@ -6883,7 +8404,7 @@ function TimePicker({
|
|
|
6883
8404
|
|
|
6884
8405
|
// src/components/Alert.tsx
|
|
6885
8406
|
import { Theme as Theme2, AlertDialog } from "@radix-ui/themes";
|
|
6886
|
-
import { Fragment, jsx as
|
|
8407
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
6887
8408
|
var AlertDialogSimpleStyled = styled(AlertDialog.Content, {
|
|
6888
8409
|
fontFamily: "$default",
|
|
6889
8410
|
lineHeight: "$base",
|
|
@@ -6998,15 +8519,15 @@ function Alert(_a) {
|
|
|
6998
8519
|
"simpleAlert"
|
|
6999
8520
|
]);
|
|
7000
8521
|
return /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
7001
|
-
simpleAlert && /* @__PURE__ */
|
|
7002
|
-
/* @__PURE__ */
|
|
7003
|
-
/* @__PURE__ */
|
|
7004
|
-
/* @__PURE__ */
|
|
7005
|
-
simpleAlert.cancel && /* @__PURE__ */
|
|
8522
|
+
simpleAlert && /* @__PURE__ */ jsx18(Theme2, { children: /* @__PURE__ */ jsxs9(AlertDialog.Root, { children: [
|
|
8523
|
+
/* @__PURE__ */ jsx18(AlertDialog.Trigger, { children: trigger }),
|
|
8524
|
+
/* @__PURE__ */ jsx18(Fragment, { children: /* @__PURE__ */ jsxs9(AlertDialogSimpleStyled, __spreadProps(__spreadValues({}, props), { children: [
|
|
8525
|
+
/* @__PURE__ */ jsx18(AlertDialogDescriptionStyled, { children: simpleAlert.description }),
|
|
8526
|
+
simpleAlert.cancel && /* @__PURE__ */ jsx18(AlertDialog.Cancel, { children: /* @__PURE__ */ jsx18(Button, { variant: "text", children: /* @__PURE__ */ jsx18(Icon_default, { name: "close" }) }) })
|
|
7006
8527
|
] })) })
|
|
7007
8528
|
] }) }),
|
|
7008
|
-
completAlert && /* @__PURE__ */
|
|
7009
|
-
/* @__PURE__ */
|
|
8529
|
+
completAlert && /* @__PURE__ */ jsx18(Theme2, { children: /* @__PURE__ */ jsxs9(AlertDialog.Root, { children: [
|
|
8530
|
+
/* @__PURE__ */ jsx18(AlertDialog.Trigger, { children: trigger }),
|
|
7010
8531
|
/* @__PURE__ */ jsxs9(AlertDialogCompleteStyled, { children: [
|
|
7011
8532
|
/* @__PURE__ */ jsxs9(AlertDialogRowStyled, { className: "le-alert-dialog-row", children: [
|
|
7012
8533
|
color === "success" && /* @__PURE__ */ jsxs9(
|
|
@@ -7018,14 +8539,14 @@ function Alert(_a) {
|
|
|
7018
8539
|
fill: "none",
|
|
7019
8540
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7020
8541
|
children: [
|
|
7021
|
-
/* @__PURE__ */
|
|
8542
|
+
/* @__PURE__ */ jsx18("g", { clipPath: "url(#clip0_1428_9995)", children: /* @__PURE__ */ jsx18(
|
|
7022
8543
|
"path",
|
|
7023
8544
|
{
|
|
7024
8545
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM40.3594 22.8594L26.3594 36.8594C25.3312 37.8875 23.6688 37.8875 22.6516 36.8594L15.6516 29.8594C14.6234 28.8312 14.6234 27.1688 15.6516 26.1516C16.6797 25.1344 18.3422 25.1234 19.3594 26.1516L24.5 31.2922L36.6406 19.1406C37.6688 18.1125 39.3312 18.1125 40.3484 19.1406C41.3656 20.1688 41.3766 21.8312 40.3484 22.8484L40.3594 22.8594Z",
|
|
7025
8546
|
fill: "#1E8535"
|
|
7026
8547
|
}
|
|
7027
8548
|
) }),
|
|
7028
|
-
/* @__PURE__ */
|
|
8549
|
+
/* @__PURE__ */ jsx18("defs", { children: /* @__PURE__ */ jsx18("clipPath", { id: "clip0_1428_9995", children: /* @__PURE__ */ jsx18("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
7029
8550
|
]
|
|
7030
8551
|
}
|
|
7031
8552
|
),
|
|
@@ -7038,14 +8559,14 @@ function Alert(_a) {
|
|
|
7038
8559
|
fill: "none",
|
|
7039
8560
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7040
8561
|
children: [
|
|
7041
|
-
/* @__PURE__ */
|
|
8562
|
+
/* @__PURE__ */ jsx18("g", { clipPath: "url(#clip0_1428_10022)", children: /* @__PURE__ */ jsx18(
|
|
7042
8563
|
"path",
|
|
7043
8564
|
{
|
|
7044
8565
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM19.1406 19.1406C20.1687 18.1125 21.8312 18.1125 22.8484 19.1406L27.9891 24.2812L33.1297 19.1406C34.1578 18.1125 35.8203 18.1125 36.8375 19.1406C37.8547 20.1687 37.8656 21.8312 36.8375 22.8484L31.6969 27.9891L36.8375 33.1297C37.8656 34.1578 37.8656 35.8203 36.8375 36.8375C35.8094 37.8547 34.1469 37.8656 33.1297 36.8375L27.9891 31.6969L22.8484 36.8375C21.8203 37.8656 20.1578 37.8656 19.1406 36.8375C18.1234 35.8094 18.1125 34.1469 19.1406 33.1297L24.2812 27.9891L19.1406 22.8484C18.1125 21.8203 18.1125 20.1578 19.1406 19.1406Z",
|
|
7045
8566
|
fill: "#AD1F2B"
|
|
7046
8567
|
}
|
|
7047
8568
|
) }),
|
|
7048
|
-
/* @__PURE__ */
|
|
8569
|
+
/* @__PURE__ */ jsx18("defs", { children: /* @__PURE__ */ jsx18("clipPath", { id: "clip0_1428_10022", children: /* @__PURE__ */ jsx18("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
7049
8570
|
]
|
|
7050
8571
|
}
|
|
7051
8572
|
),
|
|
@@ -7058,14 +8579,14 @@ function Alert(_a) {
|
|
|
7058
8579
|
fill: "none",
|
|
7059
8580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7060
8581
|
children: [
|
|
7061
|
-
/* @__PURE__ */
|
|
8582
|
+
/* @__PURE__ */ jsx18("g", { clipPath: "url(#clip0_1428_10038)", children: /* @__PURE__ */ jsx18(
|
|
7062
8583
|
"path",
|
|
7063
8584
|
{
|
|
7064
8585
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM28 14C29.4547 14 30.625 15.1703 30.625 16.625V28.875C30.625 30.3297 29.4547 31.5 28 31.5C26.5453 31.5 25.375 30.3297 25.375 28.875V16.625C25.375 15.1703 26.5453 14 28 14ZM24.5 38.5C24.5 37.5717 24.8687 36.6815 25.5251 36.0251C26.1815 35.3688 27.0717 35 28 35C28.9283 35 29.8185 35.3688 30.4749 36.0251C31.1313 36.6815 31.5 37.5717 31.5 38.5C31.5 39.4283 31.1313 40.3185 30.4749 40.9749C29.8185 41.6312 28.9283 42 28 42C27.0717 42 26.1815 41.6312 25.5251 40.9749C24.8687 40.3185 24.5 39.4283 24.5 38.5Z",
|
|
7065
8586
|
fill: "#CC9A06"
|
|
7066
8587
|
}
|
|
7067
8588
|
) }),
|
|
7068
|
-
/* @__PURE__ */
|
|
8589
|
+
/* @__PURE__ */ jsx18("defs", { children: /* @__PURE__ */ jsx18("clipPath", { id: "clip0_1428_10038", children: /* @__PURE__ */ jsx18("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
7069
8590
|
]
|
|
7070
8591
|
}
|
|
7071
8592
|
),
|
|
@@ -7078,35 +8599,35 @@ function Alert(_a) {
|
|
|
7078
8599
|
fill: "none",
|
|
7079
8600
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7080
8601
|
children: [
|
|
7081
|
-
/* @__PURE__ */
|
|
8602
|
+
/* @__PURE__ */ jsx18("g", { clipPath: "url(#clip0_1645_46)", children: /* @__PURE__ */ jsx18(
|
|
7082
8603
|
"path",
|
|
7083
8604
|
{
|
|
7084
8605
|
d: "M20 40C25.3043 40 30.3914 37.8929 34.1421 34.1421C37.8929 30.3914 40 25.3043 40 20C40 14.6957 37.8929 9.60859 34.1421 5.85786C30.3914 2.10714 25.3043 0 20 0C14.6957 0 9.60859 2.10714 5.85786 5.85786C2.10714 9.60859 0 14.6957 0 20C0 25.3043 2.10714 30.3914 5.85786 34.1421C9.60859 37.8929 14.6957 40 20 40ZM20 10C21.0391 10 21.875 10.8359 21.875 11.875V20.625C21.875 21.6641 21.0391 22.5 20 22.5C18.9609 22.5 18.125 21.6641 18.125 20.625V11.875C18.125 10.8359 18.9609 10 20 10ZM17.5 27.5C17.5 26.837 17.7634 26.2011 18.2322 25.7322C18.7011 25.2634 19.337 25 20 25C20.663 25 21.2989 25.2634 21.7678 25.7322C22.2366 26.2011 22.5 26.837 22.5 27.5C22.5 28.163 22.2366 28.7989 21.7678 29.2678C21.2989 29.7366 20.663 30 20 30C19.337 30 18.7011 29.7366 18.2322 29.2678C17.7634 28.7989 17.5 28.163 17.5 27.5Z",
|
|
7085
8606
|
fill: "#9FB6C7"
|
|
7086
8607
|
}
|
|
7087
8608
|
) }),
|
|
7088
|
-
/* @__PURE__ */
|
|
8609
|
+
/* @__PURE__ */ jsx18("defs", { children: /* @__PURE__ */ jsx18("clipPath", { id: "clip0_1645_46", children: /* @__PURE__ */ jsx18("rect", { width: "40", height: "40", fill: "white" }) }) })
|
|
7089
8610
|
]
|
|
7090
8611
|
}
|
|
7091
8612
|
),
|
|
7092
|
-
completAlert.title && /* @__PURE__ */
|
|
8613
|
+
completAlert.title && /* @__PURE__ */ jsx18(AlertDialogTitleStyled, { children: completAlert.title }),
|
|
7093
8614
|
/* @__PURE__ */ jsxs9(AlertDialogDescriptionStyled, { children: [
|
|
7094
|
-
completAlert.subtitle && /* @__PURE__ */
|
|
8615
|
+
completAlert.subtitle && /* @__PURE__ */ jsx18(
|
|
7095
8616
|
Text,
|
|
7096
8617
|
{
|
|
7097
8618
|
css: {
|
|
7098
8619
|
fontSize: "$16"
|
|
7099
8620
|
},
|
|
7100
8621
|
asChild: true,
|
|
7101
|
-
children: /* @__PURE__ */
|
|
8622
|
+
children: /* @__PURE__ */ jsx18("h2", { children: completAlert.subtitle })
|
|
7102
8623
|
}
|
|
7103
8624
|
),
|
|
7104
8625
|
completAlert.description
|
|
7105
8626
|
] })
|
|
7106
8627
|
] }),
|
|
7107
|
-
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */
|
|
7108
|
-
/* @__PURE__ */
|
|
7109
|
-
completAlert.onAction && /* @__PURE__ */
|
|
8628
|
+
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */ jsx18(AlertDialoghrStyled, {}) : null,
|
|
8629
|
+
/* @__PURE__ */ jsx18(AlertDialogRowStyled, { children: /* @__PURE__ */ jsxs9(Flex2, { gap: "10", justify: "end", width: "100%", children: [
|
|
8630
|
+
completAlert.onAction && /* @__PURE__ */ jsx18(AlertDialog.Action, { children: /* @__PURE__ */ jsx18(
|
|
7110
8631
|
Button,
|
|
7111
8632
|
{
|
|
7112
8633
|
variant: "contained",
|
|
@@ -7114,7 +8635,7 @@ function Alert(_a) {
|
|
|
7114
8635
|
children: completAlert.actionText || "Salvar"
|
|
7115
8636
|
}
|
|
7116
8637
|
) }),
|
|
7117
|
-
completAlert.cancel && /* @__PURE__ */
|
|
8638
|
+
completAlert.cancel && /* @__PURE__ */ jsx18(AlertDialog.Cancel, { children: /* @__PURE__ */ jsx18(Button, { variant: "outlined", color: "neutral", children: completAlert.cancelText || "Cancelar" }) })
|
|
7118
8639
|
] }) })
|
|
7119
8640
|
] })
|
|
7120
8641
|
] }) })
|
|
@@ -7123,7 +8644,7 @@ function Alert(_a) {
|
|
|
7123
8644
|
|
|
7124
8645
|
// src/components/Switch.tsx
|
|
7125
8646
|
import { Switch as RadixSwitch } from "@radix-ui/themes";
|
|
7126
|
-
import { jsx as
|
|
8647
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
7127
8648
|
var SwitchStyled = styled(RadixSwitch, {
|
|
7128
8649
|
all: "unset",
|
|
7129
8650
|
borderRadius: "$full",
|
|
@@ -7217,13 +8738,13 @@ var SwitchStyled = styled(RadixSwitch, {
|
|
|
7217
8738
|
}
|
|
7218
8739
|
});
|
|
7219
8740
|
function Switch(props) {
|
|
7220
|
-
return /* @__PURE__ */
|
|
8741
|
+
return /* @__PURE__ */ jsx19(SwitchStyled, __spreadValues({ color: "brand", defaultChecked: true }, props));
|
|
7221
8742
|
}
|
|
7222
8743
|
|
|
7223
8744
|
// src/components/Step.tsx
|
|
7224
8745
|
import React7 from "react";
|
|
7225
8746
|
import { Box as Box2, Tabs as StepRadix } from "@radix-ui/themes";
|
|
7226
|
-
import { jsx as
|
|
8747
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
7227
8748
|
var StepStyled = styled("div", {
|
|
7228
8749
|
fontFamily: "$default",
|
|
7229
8750
|
color: "$gray100",
|
|
@@ -7296,7 +8817,7 @@ var StepListStyled = styled(StepRadix.List, {
|
|
|
7296
8817
|
});
|
|
7297
8818
|
function Step(_a) {
|
|
7298
8819
|
var _b = _a, { children, defaultValue } = _b, props = __objRest(_b, ["children", "defaultValue"]);
|
|
7299
|
-
return /* @__PURE__ */
|
|
8820
|
+
return /* @__PURE__ */ jsx20(StepRadix.Root, { defaultValue: String(defaultValue), children: /* @__PURE__ */ jsx20(StepStyled, __spreadProps(__spreadValues({}, props), { children })) });
|
|
7300
8821
|
}
|
|
7301
8822
|
function StepTrigger(_a) {
|
|
7302
8823
|
var _b = _a, {
|
|
@@ -7309,7 +8830,7 @@ function StepTrigger(_a) {
|
|
|
7309
8830
|
"currentStep"
|
|
7310
8831
|
]);
|
|
7311
8832
|
const isActiveOrPrevious = currentStep !== void 0 && value <= currentStep;
|
|
7312
|
-
return /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsx20(
|
|
7313
8834
|
StepTriggerStyled,
|
|
7314
8835
|
__spreadProps(__spreadValues({
|
|
7315
8836
|
"data-filled": isActiveOrPrevious,
|
|
@@ -7327,7 +8848,7 @@ function StepContent(_a) {
|
|
|
7327
8848
|
"value",
|
|
7328
8849
|
"children"
|
|
7329
8850
|
]);
|
|
7330
|
-
return /* @__PURE__ */
|
|
8851
|
+
return /* @__PURE__ */ jsx20(StepRadix.Content, __spreadProps(__spreadValues({ value: String(value) }, props), { children }));
|
|
7331
8852
|
}
|
|
7332
8853
|
function StepList(_a) {
|
|
7333
8854
|
var _b = _a, {
|
|
@@ -7337,7 +8858,7 @@ function StepList(_a) {
|
|
|
7337
8858
|
"children",
|
|
7338
8859
|
"currentStep"
|
|
7339
8860
|
]);
|
|
7340
|
-
return /* @__PURE__ */
|
|
8861
|
+
return /* @__PURE__ */ jsx20(StepListStyled, __spreadProps(__spreadValues({}, props), { children: React7.Children.map(children, (child) => {
|
|
7341
8862
|
if (React7.isValidElement(child) && child.type === StepTrigger) {
|
|
7342
8863
|
return React7.cloneElement(child, { currentStep });
|
|
7343
8864
|
}
|
|
@@ -7350,12 +8871,12 @@ function StepWrapper(_a) {
|
|
|
7350
8871
|
} = _b, props = __objRest(_b, [
|
|
7351
8872
|
"children"
|
|
7352
8873
|
]);
|
|
7353
|
-
return /* @__PURE__ */
|
|
8874
|
+
return /* @__PURE__ */ jsx20(Box2, __spreadProps(__spreadValues({}, props), { children }));
|
|
7354
8875
|
}
|
|
7355
8876
|
|
|
7356
8877
|
// src/components/Card.tsx
|
|
7357
8878
|
import { Card as CardRadix } from "@radix-ui/themes";
|
|
7358
|
-
import { jsx as
|
|
8879
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
7359
8880
|
var CardStyled = styled(CardRadix, {
|
|
7360
8881
|
borderRadius: "$2xl",
|
|
7361
8882
|
border: "1px solid $dark100",
|
|
@@ -7391,13 +8912,13 @@ var CardStyled = styled(CardRadix, {
|
|
|
7391
8912
|
});
|
|
7392
8913
|
function Card(_a) {
|
|
7393
8914
|
var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
|
|
7394
|
-
return /* @__PURE__ */
|
|
8915
|
+
return /* @__PURE__ */ jsx21(CardStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
7395
8916
|
}
|
|
7396
8917
|
|
|
7397
8918
|
// src/components/TextareaField.tsx
|
|
7398
8919
|
import { TextArea as TextAreaRadix } from "@radix-ui/themes";
|
|
7399
8920
|
import React8, { useRef as useRef6, useState as useState4, useEffect as useEffect4 } from "react";
|
|
7400
|
-
import { jsx as
|
|
8921
|
+
import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7401
8922
|
var TextareaFieldStyle = styled(TextAreaRadix, {
|
|
7402
8923
|
display: "flex",
|
|
7403
8924
|
flex: 1,
|
|
@@ -7479,7 +9000,7 @@ var TextareaField = React8.forwardRef((_a, forwardedRef) => {
|
|
|
7479
9000
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
7480
9001
|
};
|
|
7481
9002
|
return /* @__PURE__ */ jsxs10(TextareaContainer, { color, children: [
|
|
7482
|
-
/* @__PURE__ */
|
|
9003
|
+
/* @__PURE__ */ jsx22(
|
|
7483
9004
|
TextareaFieldStyle,
|
|
7484
9005
|
__spreadValues({
|
|
7485
9006
|
rows: 4,
|
|
@@ -7495,13 +9016,224 @@ var TextareaField = React8.forwardRef((_a, forwardedRef) => {
|
|
|
7495
9016
|
maxLength
|
|
7496
9017
|
}, props)
|
|
7497
9018
|
),
|
|
7498
|
-
maxLength && /* @__PURE__ */
|
|
9019
|
+
maxLength && /* @__PURE__ */ jsx22(TextareaLimitIndicator, { children: /* @__PURE__ */ jsx22(Text, { typography: "badgeMedium", children: remaining }) })
|
|
7499
9020
|
] });
|
|
7500
9021
|
});
|
|
7501
9022
|
|
|
9023
|
+
// src/components/Toast/components/ToastItem.tsx
|
|
9024
|
+
import { useState as useState5 } from "react";
|
|
9025
|
+
|
|
9026
|
+
// src/components/Toast/styles/index.ts
|
|
9027
|
+
import { keyframes as keyframes2 } from "@stitches/react";
|
|
9028
|
+
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
9029
|
+
var slideIn = keyframes2({
|
|
9030
|
+
from: {
|
|
9031
|
+
transform: "translateX(calc(100% + 25px))",
|
|
9032
|
+
opacity: 0
|
|
9033
|
+
},
|
|
9034
|
+
to: {
|
|
9035
|
+
transform: "translateX(0)",
|
|
9036
|
+
opacity: 1
|
|
9037
|
+
}
|
|
9038
|
+
});
|
|
9039
|
+
var slideOut = keyframes2({
|
|
9040
|
+
from: {
|
|
9041
|
+
transform: "translateX(0)",
|
|
9042
|
+
opacity: 1
|
|
9043
|
+
},
|
|
9044
|
+
to: {
|
|
9045
|
+
transform: "translateX(calc(100% + 25px))",
|
|
9046
|
+
opacity: 0
|
|
9047
|
+
}
|
|
9048
|
+
});
|
|
9049
|
+
var swipeOut = keyframes2({
|
|
9050
|
+
from: {
|
|
9051
|
+
transform: "translateX(var(--radix-toast-swipe-end-x))",
|
|
9052
|
+
opacity: 1
|
|
9053
|
+
},
|
|
9054
|
+
to: {
|
|
9055
|
+
transform: "translateX(calc(100% + 25px))",
|
|
9056
|
+
opacity: 0
|
|
9057
|
+
}
|
|
9058
|
+
});
|
|
9059
|
+
var ToastViewport = styled(ToastPrimitive.Viewport, {
|
|
9060
|
+
position: "fixed",
|
|
9061
|
+
top: 0,
|
|
9062
|
+
right: 0,
|
|
9063
|
+
display: "flex",
|
|
9064
|
+
flexDirection: "column",
|
|
9065
|
+
padding: 25,
|
|
9066
|
+
gap: 10,
|
|
9067
|
+
width: 390,
|
|
9068
|
+
maxWidth: "100vw",
|
|
9069
|
+
margin: 0,
|
|
9070
|
+
listStyle: "none",
|
|
9071
|
+
zIndex: 2147483647,
|
|
9072
|
+
outline: "none"
|
|
9073
|
+
});
|
|
9074
|
+
var ToastRoot = styled(ToastPrimitive.Root, {
|
|
9075
|
+
backgroundColor: "$neutral50",
|
|
9076
|
+
borderRadius: "$sm",
|
|
9077
|
+
boxShadow: "hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px",
|
|
9078
|
+
padding: "$16",
|
|
9079
|
+
gap: "$8",
|
|
9080
|
+
display: "flex",
|
|
9081
|
+
alignItems: "center",
|
|
9082
|
+
border: "1px solid",
|
|
9083
|
+
position: "relative",
|
|
9084
|
+
zIndex: 9999,
|
|
9085
|
+
'&[data-state="open"]': {
|
|
9086
|
+
animation: `${slideIn} 150ms cubic-bezier(0.16, 1, 0.3, 1)`
|
|
9087
|
+
},
|
|
9088
|
+
'&[data-state="closed"]': {
|
|
9089
|
+
animation: `${slideOut} 100ms ease-in`
|
|
9090
|
+
},
|
|
9091
|
+
'&[data-swipe="move"]': {
|
|
9092
|
+
transform: "translateX(var(--radix-toast-swipe-move-x))"
|
|
9093
|
+
},
|
|
9094
|
+
'&[data-swipe="cancel"]': {
|
|
9095
|
+
transform: "translateX(0)",
|
|
9096
|
+
transition: "transform 200ms ease-out"
|
|
9097
|
+
},
|
|
9098
|
+
'&[data-swipe="end"]': {
|
|
9099
|
+
animation: `${swipeOut} 100ms ease-out`
|
|
9100
|
+
},
|
|
9101
|
+
$$toastColor: "inherit",
|
|
9102
|
+
color: "$$toastColor",
|
|
9103
|
+
borderColor: "$$toastColor",
|
|
9104
|
+
variants: {
|
|
9105
|
+
type: {
|
|
9106
|
+
success: {
|
|
9107
|
+
$$toastColor: "$colors$success600",
|
|
9108
|
+
backgroundColor: "$success50"
|
|
9109
|
+
},
|
|
9110
|
+
error: {
|
|
9111
|
+
$$toastColor: "$colors$error600",
|
|
9112
|
+
backgroundColor: "$error50"
|
|
9113
|
+
},
|
|
9114
|
+
warning: {
|
|
9115
|
+
$$toastColor: "$colors$warning600",
|
|
9116
|
+
backgroundColor: "$warning50"
|
|
9117
|
+
},
|
|
9118
|
+
info: {
|
|
9119
|
+
$$toastColor: "$colors$info600",
|
|
9120
|
+
backgroundColor: "$info50"
|
|
9121
|
+
}
|
|
9122
|
+
}
|
|
9123
|
+
},
|
|
9124
|
+
defaultVariants: {
|
|
9125
|
+
type: "info"
|
|
9126
|
+
}
|
|
9127
|
+
});
|
|
9128
|
+
var ToastClose = styled(ToastPrimitive.Close, {
|
|
9129
|
+
border: "none",
|
|
9130
|
+
backgroundColor: "transparent",
|
|
9131
|
+
display: "flex",
|
|
9132
|
+
alignItems: "center",
|
|
9133
|
+
justifyContent: "center",
|
|
9134
|
+
color: "inherit",
|
|
9135
|
+
borderRadius: 4,
|
|
9136
|
+
padding: 4,
|
|
9137
|
+
cursor: "pointer",
|
|
9138
|
+
opacity: 0.7,
|
|
9139
|
+
"&:hover": {
|
|
9140
|
+
opacity: 1,
|
|
9141
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)"
|
|
9142
|
+
},
|
|
9143
|
+
"&:focus": {
|
|
9144
|
+
boxShadow: "0 0 0 2px currentColor",
|
|
9145
|
+
opacity: 1
|
|
9146
|
+
}
|
|
9147
|
+
});
|
|
9148
|
+
|
|
9149
|
+
// src/components/Toast/components/ToastItem.tsx
|
|
9150
|
+
import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
9151
|
+
function ToastItem({
|
|
9152
|
+
toast,
|
|
9153
|
+
onRemove
|
|
9154
|
+
}) {
|
|
9155
|
+
const [open, setOpen] = useState5(true);
|
|
9156
|
+
const handleOpenChange = (open2) => {
|
|
9157
|
+
setOpen(open2);
|
|
9158
|
+
if (!open2) {
|
|
9159
|
+
onRemove(toast.id);
|
|
9160
|
+
}
|
|
9161
|
+
};
|
|
9162
|
+
return /* @__PURE__ */ jsxs11(
|
|
9163
|
+
ToastRoot,
|
|
9164
|
+
{
|
|
9165
|
+
type: toast.type,
|
|
9166
|
+
duration: toast.duration,
|
|
9167
|
+
open,
|
|
9168
|
+
onOpenChange: handleOpenChange,
|
|
9169
|
+
children: [
|
|
9170
|
+
(toast == null ? void 0 : toast.icon) && /* @__PURE__ */ jsx23(Icon_default, { name: toast.icon, size: "xl" }),
|
|
9171
|
+
/* @__PURE__ */ jsx23("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx23(Text, { typography: "bodyS", fontWeight: "medium", children: toast.message }) }),
|
|
9172
|
+
/* @__PURE__ */ jsx23(ToastClose, { "aria-label": "Close", children: /* @__PURE__ */ jsx23(Icon_default, { name: "xmark", size: "md" }) })
|
|
9173
|
+
]
|
|
9174
|
+
}
|
|
9175
|
+
);
|
|
9176
|
+
}
|
|
9177
|
+
|
|
9178
|
+
// src/components/Toast/components/ToastProvider.tsx
|
|
9179
|
+
import { createContext, useState as useState6 } from "react";
|
|
9180
|
+
import * as ToastPrimitive2 from "@radix-ui/react-toast";
|
|
9181
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9182
|
+
var ToastContext = createContext(null);
|
|
9183
|
+
function ToastProvider({
|
|
9184
|
+
children,
|
|
9185
|
+
defaultDuration = 5e3,
|
|
9186
|
+
maxToasts = 5,
|
|
9187
|
+
swipeDirection = "right"
|
|
9188
|
+
}) {
|
|
9189
|
+
const [toasts, setToasts] = useState6([]);
|
|
9190
|
+
const addToast = (toastData) => {
|
|
9191
|
+
const id = Math.random().toString(36).substr(2, 9);
|
|
9192
|
+
const newToast = __spreadProps(__spreadValues({
|
|
9193
|
+
id
|
|
9194
|
+
}, toastData), {
|
|
9195
|
+
type: (toastData == null ? void 0 : toastData.type) || "info",
|
|
9196
|
+
duration: (toastData == null ? void 0 : toastData.duration) || defaultDuration,
|
|
9197
|
+
createdAt: Date.now()
|
|
9198
|
+
});
|
|
9199
|
+
setToasts((prevToasts) => {
|
|
9200
|
+
const updatedToasts = [...prevToasts, newToast];
|
|
9201
|
+
return updatedToasts.slice(-maxToasts);
|
|
9202
|
+
});
|
|
9203
|
+
return id;
|
|
9204
|
+
};
|
|
9205
|
+
const removeToast = (id) => {
|
|
9206
|
+
setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
|
|
9207
|
+
};
|
|
9208
|
+
const removeAllToasts = () => {
|
|
9209
|
+
setToasts([]);
|
|
9210
|
+
};
|
|
9211
|
+
const contextValue = {
|
|
9212
|
+
toasts,
|
|
9213
|
+
addToast,
|
|
9214
|
+
removeToast,
|
|
9215
|
+
removeAllToasts
|
|
9216
|
+
};
|
|
9217
|
+
return /* @__PURE__ */ jsx24(ToastContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs12(ToastPrimitive2.Provider, { swipeDirection, children: [
|
|
9218
|
+
children,
|
|
9219
|
+
toasts.map((toast) => /* @__PURE__ */ jsx24(ToastItem, { toast, onRemove: removeToast }, toast.id)),
|
|
9220
|
+
/* @__PURE__ */ jsx24(ToastViewport, {})
|
|
9221
|
+
] }) });
|
|
9222
|
+
}
|
|
9223
|
+
|
|
9224
|
+
// src/components/Toast/hooks/useToast.ts
|
|
9225
|
+
import { useContext } from "react";
|
|
9226
|
+
var useToast = () => {
|
|
9227
|
+
const context = useContext(ToastContext);
|
|
9228
|
+
if (!context) {
|
|
9229
|
+
throw new Error("useToast deve ser usado dentro de um ToastProvider");
|
|
9230
|
+
}
|
|
9231
|
+
return context;
|
|
9232
|
+
};
|
|
9233
|
+
|
|
7502
9234
|
// src/components/Tooltip/index.tsx
|
|
7503
9235
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
7504
|
-
import { jsx as
|
|
9236
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7505
9237
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
7506
9238
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
7507
9239
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -7540,26 +9272,26 @@ function Tooltip({
|
|
|
7540
9272
|
delayDuration = 200,
|
|
7541
9273
|
side = "top"
|
|
7542
9274
|
}) {
|
|
7543
|
-
return /* @__PURE__ */
|
|
7544
|
-
/* @__PURE__ */
|
|
7545
|
-
/* @__PURE__ */
|
|
7546
|
-
typeof content === "string" ? /* @__PURE__ */
|
|
7547
|
-
/* @__PURE__ */
|
|
9275
|
+
return /* @__PURE__ */ jsx25(TooltipProvider, { children: /* @__PURE__ */ jsxs13(TooltipRoot, { delayDuration, children: [
|
|
9276
|
+
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children }),
|
|
9277
|
+
/* @__PURE__ */ jsxs13(TooltipContent, { side, sideOffset: 5, children: [
|
|
9278
|
+
typeof content === "string" ? /* @__PURE__ */ jsx25(Text, { typography: "tooltip", children: content }) : content,
|
|
9279
|
+
/* @__PURE__ */ jsx25(TooltipArrow, {})
|
|
7548
9280
|
] })
|
|
7549
9281
|
] }) });
|
|
7550
9282
|
}
|
|
7551
9283
|
|
|
7552
9284
|
// src/components/MultiSelect.tsx
|
|
7553
|
-
import React9, { useCallback as useCallback2, useRef as useRef7, useState as
|
|
9285
|
+
import React9, { useCallback as useCallback2, useRef as useRef7, useState as useState7 } from "react";
|
|
7554
9286
|
import { DropdownMenu as DropdownMenu3, Theme as Theme3 } from "@radix-ui/themes";
|
|
7555
|
-
import { FontAwesomeIcon as
|
|
9287
|
+
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
7556
9288
|
import {
|
|
7557
9289
|
faChevronDown as faChevronDown2,
|
|
7558
9290
|
faChevronUp as faChevronUp2,
|
|
7559
9291
|
faSquareXmark
|
|
7560
9292
|
} from "@fortawesome/free-solid-svg-icons";
|
|
7561
9293
|
import { useMemo } from "react";
|
|
7562
|
-
import { Fragment as Fragment2, jsx as
|
|
9294
|
+
import { Fragment as Fragment2, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7563
9295
|
var StyledContent = styled(DropdownMenu3.Content, {
|
|
7564
9296
|
backgroundColor: "$dark50",
|
|
7565
9297
|
borderRadius: "$sm",
|
|
@@ -7617,7 +9349,7 @@ var StyledItem2 = styled("div", __spreadValues({}, itemStyle));
|
|
|
7617
9349
|
var BadgeCloseBtn = styled("div", {
|
|
7618
9350
|
cursor: "pointer"
|
|
7619
9351
|
});
|
|
7620
|
-
var StyledFlexWithMaxHeight = styled(
|
|
9352
|
+
var StyledFlexWithMaxHeight = styled(Flex2, {
|
|
7621
9353
|
variants: {
|
|
7622
9354
|
hasMaxHeight: {
|
|
7623
9355
|
true: {
|
|
@@ -7664,7 +9396,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
7664
9396
|
disabled = false,
|
|
7665
9397
|
maxHeight
|
|
7666
9398
|
}, fowardedRef) => {
|
|
7667
|
-
const [isOpen, setIsOpen] =
|
|
9399
|
+
const [isOpen, setIsOpen] = useState7(false);
|
|
7668
9400
|
const triggerRef = useRef7(null);
|
|
7669
9401
|
const labelByValue = useMemo(() => {
|
|
7670
9402
|
return options.reduce((prev, curr) => {
|
|
@@ -7700,9 +9432,9 @@ var MultiSelect = React9.forwardRef(
|
|
|
7700
9432
|
},
|
|
7701
9433
|
[disabled]
|
|
7702
9434
|
);
|
|
7703
|
-
return /* @__PURE__ */
|
|
7704
|
-
/* @__PURE__ */
|
|
7705
|
-
/* @__PURE__ */
|
|
9435
|
+
return /* @__PURE__ */ jsxs14(Theme3, { children: [
|
|
9436
|
+
/* @__PURE__ */ jsxs14(DropdownMenu3.Root, { children: [
|
|
9437
|
+
/* @__PURE__ */ jsx26(DropdownMenu3.Trigger, { children: /* @__PURE__ */ jsxs14(
|
|
7706
9438
|
StyledTrigger,
|
|
7707
9439
|
{
|
|
7708
9440
|
ref: (r) => {
|
|
@@ -7720,7 +9452,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
7720
9452
|
style: width !== "100%" ? { width } : void 0,
|
|
7721
9453
|
onClick: handleToggle,
|
|
7722
9454
|
children: [
|
|
7723
|
-
/* @__PURE__ */
|
|
9455
|
+
/* @__PURE__ */ jsx26(
|
|
7724
9456
|
StyledText,
|
|
7725
9457
|
{
|
|
7726
9458
|
typography: "labelMedium",
|
|
@@ -7728,8 +9460,8 @@ var MultiSelect = React9.forwardRef(
|
|
|
7728
9460
|
children: text
|
|
7729
9461
|
}
|
|
7730
9462
|
),
|
|
7731
|
-
/* @__PURE__ */
|
|
7732
|
-
|
|
9463
|
+
/* @__PURE__ */ jsx26(
|
|
9464
|
+
FontAwesomeIcon3,
|
|
7733
9465
|
{
|
|
7734
9466
|
icon: isOpen ? faChevronUp2 : faChevronDown2,
|
|
7735
9467
|
size: "sm",
|
|
@@ -7739,60 +9471,60 @@ var MultiSelect = React9.forwardRef(
|
|
|
7739
9471
|
]
|
|
7740
9472
|
}
|
|
7741
9473
|
) }),
|
|
7742
|
-
/* @__PURE__ */
|
|
9474
|
+
/* @__PURE__ */ jsx26(
|
|
7743
9475
|
StyledContent,
|
|
7744
9476
|
{
|
|
7745
9477
|
css: {
|
|
7746
9478
|
width: "100%",
|
|
7747
9479
|
zIndex: zIndex === "auto" ? 999999 : zIndex
|
|
7748
9480
|
},
|
|
7749
|
-
children: !singleSelect ? /* @__PURE__ */
|
|
9481
|
+
children: !singleSelect ? /* @__PURE__ */ jsx26(
|
|
7750
9482
|
CheckboxGroup,
|
|
7751
9483
|
{
|
|
7752
9484
|
value: selectedValues,
|
|
7753
9485
|
onValueChange: (v) => {
|
|
7754
9486
|
onValueChange == null ? void 0 : onValueChange(v);
|
|
7755
9487
|
},
|
|
7756
|
-
children: /* @__PURE__ */
|
|
9488
|
+
children: /* @__PURE__ */ jsx26(
|
|
7757
9489
|
StyledFlexWithMaxHeight,
|
|
7758
9490
|
{
|
|
7759
9491
|
direction: "column",
|
|
7760
9492
|
gap: 8,
|
|
7761
9493
|
hasMaxHeight: !!maxHeight,
|
|
7762
9494
|
style: maxHeight ? { maxHeight } : void 0,
|
|
7763
|
-
children: options.map(({ value, label }, i) => /* @__PURE__ */
|
|
9495
|
+
children: options.map(({ value, label }, i) => /* @__PURE__ */ jsx26(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ jsx26(Text, { typography: "labelSmall", children: label }) }, i))
|
|
7764
9496
|
}
|
|
7765
9497
|
)
|
|
7766
9498
|
}
|
|
7767
|
-
) : /* @__PURE__ */
|
|
9499
|
+
) : /* @__PURE__ */ jsx26(
|
|
7768
9500
|
StyledFlexWithMaxHeight,
|
|
7769
9501
|
{
|
|
7770
9502
|
direction: "column",
|
|
7771
9503
|
gap: 8,
|
|
7772
9504
|
hasMaxHeight: !!maxHeight,
|
|
7773
9505
|
style: maxHeight ? { maxHeight } : void 0,
|
|
7774
|
-
children: options.map(({ value, label }, i) => /* @__PURE__ */
|
|
9506
|
+
children: options.map(({ value, label }, i) => /* @__PURE__ */ jsx26(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ jsx26(Text, { typography: "labelSmall", children: label }) }, i))
|
|
7775
9507
|
}
|
|
7776
9508
|
)
|
|
7777
9509
|
}
|
|
7778
9510
|
)
|
|
7779
9511
|
] }),
|
|
7780
|
-
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */
|
|
7781
|
-
|
|
9512
|
+
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ jsx26(Fragment2, { children: /* @__PURE__ */ jsx26(
|
|
9513
|
+
Flex2,
|
|
7782
9514
|
{
|
|
7783
9515
|
direction: selectedOrientation,
|
|
7784
9516
|
gap: 8,
|
|
7785
9517
|
align: selectedOrientation === "column" ? "start" : "center",
|
|
7786
9518
|
justify: "start",
|
|
7787
9519
|
css: { margin: "8px 0" },
|
|
7788
|
-
children: selectedValues.map((value) => /* @__PURE__ */
|
|
7789
|
-
|
|
9520
|
+
children: selectedValues.map((value) => /* @__PURE__ */ jsxs14(
|
|
9521
|
+
Flex2,
|
|
7790
9522
|
{
|
|
7791
9523
|
gap: 4,
|
|
7792
9524
|
align: "center",
|
|
7793
9525
|
css: { flexWrap: "wrap" },
|
|
7794
9526
|
children: [
|
|
7795
|
-
/* @__PURE__ */
|
|
9527
|
+
/* @__PURE__ */ jsx26(
|
|
7796
9528
|
BadgeCloseBtn,
|
|
7797
9529
|
{
|
|
7798
9530
|
onClick: (e) => {
|
|
@@ -7800,10 +9532,10 @@ var MultiSelect = React9.forwardRef(
|
|
|
7800
9532
|
handleRemove(value);
|
|
7801
9533
|
},
|
|
7802
9534
|
role: "button",
|
|
7803
|
-
children: /* @__PURE__ */
|
|
9535
|
+
children: /* @__PURE__ */ jsx26(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
7804
9536
|
}
|
|
7805
9537
|
),
|
|
7806
|
-
/* @__PURE__ */
|
|
9538
|
+
/* @__PURE__ */ jsx26(
|
|
7807
9539
|
Text,
|
|
7808
9540
|
{
|
|
7809
9541
|
typography: "captionMedium",
|
|
@@ -7824,7 +9556,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
7824
9556
|
|
|
7825
9557
|
// src/components/Grid.tsx
|
|
7826
9558
|
import { Grid as GridRadix } from "@radix-ui/themes";
|
|
7827
|
-
import { jsx as
|
|
9559
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
7828
9560
|
var GridStyled = styled(GridRadix, {
|
|
7829
9561
|
display: "grid",
|
|
7830
9562
|
variants: {
|
|
@@ -7946,12 +9678,12 @@ var GridStyled = styled(GridRadix, {
|
|
|
7946
9678
|
});
|
|
7947
9679
|
function Grid(_a) {
|
|
7948
9680
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
7949
|
-
return /* @__PURE__ */
|
|
9681
|
+
return /* @__PURE__ */ jsx27(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
7950
9682
|
}
|
|
7951
9683
|
|
|
7952
9684
|
// src/components/Container.tsx
|
|
7953
9685
|
import { Container as ContainerRadix } from "@radix-ui/themes";
|
|
7954
|
-
import { jsx as
|
|
9686
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
7955
9687
|
var ContainerStyled = styled(ContainerRadix, {
|
|
7956
9688
|
variants: {
|
|
7957
9689
|
size: {
|
|
@@ -7981,12 +9713,12 @@ var ContainerStyled = styled(ContainerRadix, {
|
|
|
7981
9713
|
});
|
|
7982
9714
|
function Container(_a) {
|
|
7983
9715
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
7984
|
-
return /* @__PURE__ */
|
|
9716
|
+
return /* @__PURE__ */ jsx28(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
7985
9717
|
}
|
|
7986
9718
|
|
|
7987
9719
|
// src/components/Section.tsx
|
|
7988
9720
|
import { Section as SectionRadix } from "@radix-ui/themes";
|
|
7989
|
-
import { jsx as
|
|
9721
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
7990
9722
|
var SectionStyled = styled(SectionRadix, {
|
|
7991
9723
|
variants: {
|
|
7992
9724
|
size: {
|
|
@@ -8010,26 +9742,26 @@ var SectionStyled = styled(SectionRadix, {
|
|
|
8010
9742
|
});
|
|
8011
9743
|
function Section(_a) {
|
|
8012
9744
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
8013
|
-
return /* @__PURE__ */
|
|
9745
|
+
return /* @__PURE__ */ jsx29(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
8014
9746
|
}
|
|
8015
9747
|
|
|
8016
9748
|
// src/components/FormFields/subComponents/ErrorFormMessage.tsx
|
|
8017
9749
|
import { faXmarkCircle } from "@fortawesome/free-solid-svg-icons";
|
|
8018
|
-
import { FontAwesomeIcon as
|
|
8019
|
-
import { jsx as
|
|
9750
|
+
import { FontAwesomeIcon as FontAwesomeIcon4 } from "@fortawesome/react-fontawesome";
|
|
9751
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8020
9752
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
8021
9753
|
if (!message2) return null;
|
|
8022
9754
|
if (typeof message2 !== "string") {
|
|
8023
9755
|
return null;
|
|
8024
9756
|
}
|
|
8025
|
-
return /* @__PURE__ */
|
|
8026
|
-
/* @__PURE__ */
|
|
8027
|
-
/* @__PURE__ */
|
|
9757
|
+
return /* @__PURE__ */ jsxs15(Flex2, { justify: "start", align: "center", gap: 6, children: [
|
|
9758
|
+
/* @__PURE__ */ jsx30(FontAwesomeIcon4, { icon: faXmarkCircle, color: colors.error600, size: "1x" }),
|
|
9759
|
+
/* @__PURE__ */ jsx30(Text, { typography: "bodyXS", fontWeight: "medium", color: "error600", children: message2 })
|
|
8028
9760
|
] });
|
|
8029
9761
|
};
|
|
8030
9762
|
|
|
8031
9763
|
// src/components/FormFields/subComponents/FormLabel.tsx
|
|
8032
|
-
import { jsx as
|
|
9764
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
8033
9765
|
var FormLabel = ({
|
|
8034
9766
|
name,
|
|
8035
9767
|
label,
|
|
@@ -8037,7 +9769,7 @@ var FormLabel = ({
|
|
|
8037
9769
|
required
|
|
8038
9770
|
}) => {
|
|
8039
9771
|
if (!label) return null;
|
|
8040
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ jsxs16(
|
|
8041
9773
|
Text,
|
|
8042
9774
|
{
|
|
8043
9775
|
typography: "labelMedium",
|
|
@@ -8046,7 +9778,7 @@ var FormLabel = ({
|
|
|
8046
9778
|
id: `${name}-label`,
|
|
8047
9779
|
children: [
|
|
8048
9780
|
label,
|
|
8049
|
-
!required && /* @__PURE__ */
|
|
9781
|
+
!required && /* @__PURE__ */ jsx31(Text, { color: "dark500", children: " (opcional)" })
|
|
8050
9782
|
]
|
|
8051
9783
|
}
|
|
8052
9784
|
);
|
|
@@ -8054,7 +9786,7 @@ var FormLabel = ({
|
|
|
8054
9786
|
|
|
8055
9787
|
// src/components/FormFields/TextAreaFormField.tsx
|
|
8056
9788
|
import { useFormContext } from "react-hook-form";
|
|
8057
|
-
import { jsx as
|
|
9789
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
8058
9790
|
var TextAreaFormField = (_a) => {
|
|
8059
9791
|
var _b = _a, {
|
|
8060
9792
|
name,
|
|
@@ -8082,8 +9814,8 @@ var TextAreaFormField = (_a) => {
|
|
|
8082
9814
|
required: required ? validationErrorMessage : false,
|
|
8083
9815
|
validate
|
|
8084
9816
|
};
|
|
8085
|
-
return /* @__PURE__ */
|
|
8086
|
-
/* @__PURE__ */
|
|
9817
|
+
return /* @__PURE__ */ jsxs17(Flex2, { direction: "column", children: [
|
|
9818
|
+
/* @__PURE__ */ jsx32(
|
|
8087
9819
|
FormLabel,
|
|
8088
9820
|
{
|
|
8089
9821
|
name,
|
|
@@ -8092,7 +9824,7 @@ var TextAreaFormField = (_a) => {
|
|
|
8092
9824
|
haveError
|
|
8093
9825
|
}
|
|
8094
9826
|
),
|
|
8095
|
-
/* @__PURE__ */
|
|
9827
|
+
/* @__PURE__ */ jsx32(
|
|
8096
9828
|
TextareaField,
|
|
8097
9829
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
8098
9830
|
placeholder,
|
|
@@ -8100,7 +9832,7 @@ var TextAreaFormField = (_a) => {
|
|
|
8100
9832
|
"aria-labelledby": `${name}-label`
|
|
8101
9833
|
})
|
|
8102
9834
|
),
|
|
8103
|
-
/* @__PURE__ */
|
|
9835
|
+
/* @__PURE__ */ jsx32(ErrorFormMessage, { message: errorMsg })
|
|
8104
9836
|
] });
|
|
8105
9837
|
};
|
|
8106
9838
|
|
|
@@ -8110,7 +9842,7 @@ import {
|
|
|
8110
9842
|
} from "react-hook-form";
|
|
8111
9843
|
import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
8112
9844
|
import { format as format3, unformat as unformat2 } from "@react-input/mask";
|
|
8113
|
-
import { jsx as
|
|
9845
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8114
9846
|
var TextFormField = (_a) => {
|
|
8115
9847
|
var _b = _a, {
|
|
8116
9848
|
name,
|
|
@@ -8165,8 +9897,8 @@ var TextFormField = (_a) => {
|
|
|
8165
9897
|
if (valueFormatter) value = valueFormatter.unformat(value);
|
|
8166
9898
|
formChange(value);
|
|
8167
9899
|
};
|
|
8168
|
-
return /* @__PURE__ */
|
|
8169
|
-
label && /* @__PURE__ */
|
|
9900
|
+
return /* @__PURE__ */ jsxs18(Flex2, { direction: "column", children: [
|
|
9901
|
+
label && /* @__PURE__ */ jsx33(
|
|
8170
9902
|
FormLabel,
|
|
8171
9903
|
{
|
|
8172
9904
|
name,
|
|
@@ -8175,7 +9907,7 @@ var TextFormField = (_a) => {
|
|
|
8175
9907
|
haveError
|
|
8176
9908
|
}
|
|
8177
9909
|
),
|
|
8178
|
-
/* @__PURE__ */
|
|
9910
|
+
/* @__PURE__ */ jsx33(
|
|
8179
9911
|
TextField,
|
|
8180
9912
|
__spreadProps(__spreadValues(__spreadValues({
|
|
8181
9913
|
mask,
|
|
@@ -8186,7 +9918,7 @@ var TextFormField = (_a) => {
|
|
|
8186
9918
|
value: formattedValue
|
|
8187
9919
|
})
|
|
8188
9920
|
),
|
|
8189
|
-
/* @__PURE__ */
|
|
9921
|
+
/* @__PURE__ */ jsx33(ErrorFormMessage, { message: errorMsg })
|
|
8190
9922
|
] });
|
|
8191
9923
|
};
|
|
8192
9924
|
|
|
@@ -8195,7 +9927,7 @@ import {
|
|
|
8195
9927
|
FormProvider,
|
|
8196
9928
|
useForm
|
|
8197
9929
|
} from "react-hook-form";
|
|
8198
|
-
import { jsx as
|
|
9930
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
8199
9931
|
var Form = (_a) => {
|
|
8200
9932
|
var _b = _a, {
|
|
8201
9933
|
onSubmit,
|
|
@@ -8207,7 +9939,7 @@ var Form = (_a) => {
|
|
|
8207
9939
|
const formMethods = useForm(__spreadValues({
|
|
8208
9940
|
mode: "onTouched"
|
|
8209
9941
|
}, props));
|
|
8210
|
-
return /* @__PURE__ */
|
|
9942
|
+
return /* @__PURE__ */ jsx34(FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ jsx34("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
8211
9943
|
if (typeof children === "function") {
|
|
8212
9944
|
return children(formMethods);
|
|
8213
9945
|
}
|
|
@@ -8217,7 +9949,7 @@ var Form = (_a) => {
|
|
|
8217
9949
|
|
|
8218
9950
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
8219
9951
|
import { useController as useController2 } from "react-hook-form";
|
|
8220
|
-
import { jsx as
|
|
9952
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8221
9953
|
var MultiSelectFormField = (_a) => {
|
|
8222
9954
|
var _b = _a, {
|
|
8223
9955
|
name,
|
|
@@ -8248,8 +9980,8 @@ var MultiSelectFormField = (_a) => {
|
|
|
8248
9980
|
const handleChange = (v) => {
|
|
8249
9981
|
onChange(v);
|
|
8250
9982
|
};
|
|
8251
|
-
return /* @__PURE__ */
|
|
8252
|
-
/* @__PURE__ */
|
|
9983
|
+
return /* @__PURE__ */ jsxs19(Flex2, { direction: "column", children: [
|
|
9984
|
+
/* @__PURE__ */ jsx35(
|
|
8253
9985
|
FormLabel,
|
|
8254
9986
|
{
|
|
8255
9987
|
name,
|
|
@@ -8258,7 +9990,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
8258
9990
|
haveError
|
|
8259
9991
|
}
|
|
8260
9992
|
),
|
|
8261
|
-
/* @__PURE__ */
|
|
9993
|
+
/* @__PURE__ */ jsx35(
|
|
8262
9994
|
MultiSelect,
|
|
8263
9995
|
__spreadValues({
|
|
8264
9996
|
value,
|
|
@@ -8270,7 +10002,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
8270
10002
|
maxHeight
|
|
8271
10003
|
}, rest)
|
|
8272
10004
|
),
|
|
8273
|
-
/* @__PURE__ */
|
|
10005
|
+
/* @__PURE__ */ jsx35(ErrorFormMessage, { message: errorMsg })
|
|
8274
10006
|
] });
|
|
8275
10007
|
};
|
|
8276
10008
|
|
|
@@ -8288,13 +10020,13 @@ var minMaxLength = (min, max, errorMsg) => (value) => {
|
|
|
8288
10020
|
};
|
|
8289
10021
|
|
|
8290
10022
|
// src/components/FormFields/PhoneFormField.tsx
|
|
8291
|
-
import { jsx as
|
|
10023
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
8292
10024
|
var PhoneFormField = ({
|
|
8293
10025
|
name,
|
|
8294
10026
|
label,
|
|
8295
10027
|
required
|
|
8296
10028
|
}) => {
|
|
8297
|
-
return /* @__PURE__ */
|
|
10029
|
+
return /* @__PURE__ */ jsx36(
|
|
8298
10030
|
TextFormField,
|
|
8299
10031
|
{
|
|
8300
10032
|
name,
|
|
@@ -8324,7 +10056,7 @@ var PhoneFormField = ({
|
|
|
8324
10056
|
|
|
8325
10057
|
// src/components/FormFields/CPFFormField.tsx
|
|
8326
10058
|
import { useFormContext as useFormContext4, useWatch } from "react-hook-form";
|
|
8327
|
-
import { jsx as
|
|
10059
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8328
10060
|
var isValidCPF = (cpf) => {
|
|
8329
10061
|
cpf = cpf.replace(/[^\d]+/g, "");
|
|
8330
10062
|
if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) return false;
|
|
@@ -8350,8 +10082,8 @@ var CPFFormField = ({
|
|
|
8350
10082
|
}) => {
|
|
8351
10083
|
const { control, setValue } = useFormContext4();
|
|
8352
10084
|
const foreigner = useWatch({ name: "foreigner", control });
|
|
8353
|
-
return /* @__PURE__ */
|
|
8354
|
-
/* @__PURE__ */
|
|
10085
|
+
return /* @__PURE__ */ jsxs20(Flex2, { direction: "column", children: [
|
|
10086
|
+
/* @__PURE__ */ jsx37(
|
|
8355
10087
|
TextFormField,
|
|
8356
10088
|
{
|
|
8357
10089
|
name,
|
|
@@ -8369,7 +10101,7 @@ var CPFFormField = ({
|
|
|
8369
10101
|
disabled: foreigner
|
|
8370
10102
|
}
|
|
8371
10103
|
),
|
|
8372
|
-
/* @__PURE__ */
|
|
10104
|
+
/* @__PURE__ */ jsx37(
|
|
8373
10105
|
CheckboxGroup,
|
|
8374
10106
|
{
|
|
8375
10107
|
value: foreigner ? ["true"] : [],
|
|
@@ -8381,14 +10113,14 @@ var CPFFormField = ({
|
|
|
8381
10113
|
setValue(name, "");
|
|
8382
10114
|
}
|
|
8383
10115
|
},
|
|
8384
|
-
children: /* @__PURE__ */
|
|
10116
|
+
children: /* @__PURE__ */ jsx37(CheckboxItem, { value: "true", children: foreignerLabel })
|
|
8385
10117
|
}
|
|
8386
10118
|
)
|
|
8387
10119
|
] });
|
|
8388
10120
|
};
|
|
8389
10121
|
|
|
8390
10122
|
// src/components/FormFields/CNPJFormField.tsx
|
|
8391
|
-
import { jsx as
|
|
10123
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
8392
10124
|
var matchesNonDigit = new RegExp(/\D+/g);
|
|
8393
10125
|
var getWeights = (size, start, end) => {
|
|
8394
10126
|
const weights = [];
|
|
@@ -8437,7 +10169,7 @@ var CNPJFormField = ({
|
|
|
8437
10169
|
placeholder,
|
|
8438
10170
|
validationErrorMessage
|
|
8439
10171
|
}) => {
|
|
8440
|
-
return /* @__PURE__ */
|
|
10172
|
+
return /* @__PURE__ */ jsx38(
|
|
8441
10173
|
TextFormField,
|
|
8442
10174
|
{
|
|
8443
10175
|
name,
|
|
@@ -8458,7 +10190,7 @@ var CNPJFormField = ({
|
|
|
8458
10190
|
};
|
|
8459
10191
|
|
|
8460
10192
|
// src/components/FormFields/BirthDateFormField.tsx
|
|
8461
|
-
import { jsx as
|
|
10193
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
8462
10194
|
var isValidDate = (day, month, year) => {
|
|
8463
10195
|
const date = new Date(year, month - 1, day);
|
|
8464
10196
|
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
|
|
@@ -8495,7 +10227,7 @@ var BirthDateFormField = ({
|
|
|
8495
10227
|
language
|
|
8496
10228
|
}) => {
|
|
8497
10229
|
const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
|
|
8498
|
-
return /* @__PURE__ */
|
|
10230
|
+
return /* @__PURE__ */ jsx39(
|
|
8499
10231
|
TextFormField,
|
|
8500
10232
|
{
|
|
8501
10233
|
name,
|
|
@@ -8516,7 +10248,7 @@ var BirthDateFormField = ({
|
|
|
8516
10248
|
};
|
|
8517
10249
|
|
|
8518
10250
|
// src/components/FormFields/IdentityDocumentNumberFormField.tsx
|
|
8519
|
-
import { jsx as
|
|
10251
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
8520
10252
|
var IdentityDocumentNumberFormField = ({
|
|
8521
10253
|
name,
|
|
8522
10254
|
label,
|
|
@@ -8524,7 +10256,7 @@ var IdentityDocumentNumberFormField = ({
|
|
|
8524
10256
|
placeholder,
|
|
8525
10257
|
validationErrorMessage
|
|
8526
10258
|
}) => {
|
|
8527
|
-
return /* @__PURE__ */
|
|
10259
|
+
return /* @__PURE__ */ jsx40(
|
|
8528
10260
|
TextFormField,
|
|
8529
10261
|
{
|
|
8530
10262
|
name,
|
|
@@ -8553,7 +10285,7 @@ function getNestedValue(obj, path) {
|
|
|
8553
10285
|
}
|
|
8554
10286
|
|
|
8555
10287
|
// src/components/FormFields/SelectFormField.tsx
|
|
8556
|
-
import { jsx as
|
|
10288
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8557
10289
|
var SelectFormField = ({
|
|
8558
10290
|
name,
|
|
8559
10291
|
label,
|
|
@@ -8574,8 +10306,8 @@ var SelectFormField = ({
|
|
|
8574
10306
|
const validationRules = __spreadValues({
|
|
8575
10307
|
required: required ? validationErrorMessage : false
|
|
8576
10308
|
}, validation);
|
|
8577
|
-
return /* @__PURE__ */
|
|
8578
|
-
/* @__PURE__ */
|
|
10309
|
+
return /* @__PURE__ */ jsxs21(Flex2, { direction: "column", children: [
|
|
10310
|
+
/* @__PURE__ */ jsx41(
|
|
8579
10311
|
FormLabel,
|
|
8580
10312
|
{
|
|
8581
10313
|
name,
|
|
@@ -8584,7 +10316,7 @@ var SelectFormField = ({
|
|
|
8584
10316
|
haveError
|
|
8585
10317
|
}
|
|
8586
10318
|
),
|
|
8587
|
-
/* @__PURE__ */
|
|
10319
|
+
/* @__PURE__ */ jsx41(
|
|
8588
10320
|
Controller,
|
|
8589
10321
|
{
|
|
8590
10322
|
control,
|
|
@@ -8593,14 +10325,14 @@ var SelectFormField = ({
|
|
|
8593
10325
|
defaultValue: defaultValue || "",
|
|
8594
10326
|
render: ({ field: { value, onChange } }) => {
|
|
8595
10327
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
8596
|
-
return /* @__PURE__ */
|
|
10328
|
+
return /* @__PURE__ */ jsx41(
|
|
8597
10329
|
DropdownMenu2,
|
|
8598
10330
|
{
|
|
8599
10331
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
8600
10332
|
fontWeight: "regular",
|
|
8601
10333
|
typography: "labelLarge",
|
|
8602
10334
|
color: haveError ? "error" : "default",
|
|
8603
|
-
children: options.map((option, index) => /* @__PURE__ */
|
|
10335
|
+
children: options.map((option, index) => /* @__PURE__ */ jsx41(
|
|
8604
10336
|
DropdownMenuItem,
|
|
8605
10337
|
{
|
|
8606
10338
|
value: option.value,
|
|
@@ -8616,7 +10348,7 @@ var SelectFormField = ({
|
|
|
8616
10348
|
}
|
|
8617
10349
|
}
|
|
8618
10350
|
),
|
|
8619
|
-
/* @__PURE__ */
|
|
10351
|
+
/* @__PURE__ */ jsx41(ErrorFormMessage, { message: errorMsg })
|
|
8620
10352
|
] });
|
|
8621
10353
|
};
|
|
8622
10354
|
|
|
@@ -8649,7 +10381,7 @@ function useCountries(language = "pt-BR") {
|
|
|
8649
10381
|
}
|
|
8650
10382
|
|
|
8651
10383
|
// src/components/FormFields/AddressFormFields/CountryFormField.tsx
|
|
8652
|
-
import { jsx as
|
|
10384
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
8653
10385
|
function CountryFormField({
|
|
8654
10386
|
name,
|
|
8655
10387
|
label,
|
|
@@ -8657,7 +10389,7 @@ function CountryFormField({
|
|
|
8657
10389
|
language = "pt-BR"
|
|
8658
10390
|
}) {
|
|
8659
10391
|
const countries2 = useCountries(language);
|
|
8660
|
-
return /* @__PURE__ */
|
|
10392
|
+
return /* @__PURE__ */ jsx42(Flex2, { direction: "column", children: /* @__PURE__ */ jsx42(
|
|
8661
10393
|
SelectFormField,
|
|
8662
10394
|
{
|
|
8663
10395
|
label,
|
|
@@ -8670,7 +10402,7 @@ function CountryFormField({
|
|
|
8670
10402
|
}
|
|
8671
10403
|
|
|
8672
10404
|
// src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx
|
|
8673
|
-
import { jsx as
|
|
10405
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
8674
10406
|
var PostalCodeFormField = ({
|
|
8675
10407
|
name,
|
|
8676
10408
|
label,
|
|
@@ -8679,7 +10411,7 @@ var PostalCodeFormField = ({
|
|
|
8679
10411
|
validationErrorMessage,
|
|
8680
10412
|
onChange
|
|
8681
10413
|
}) => {
|
|
8682
|
-
return /* @__PURE__ */
|
|
10414
|
+
return /* @__PURE__ */ jsx43(
|
|
8683
10415
|
TextFormField,
|
|
8684
10416
|
{
|
|
8685
10417
|
name,
|
|
@@ -8732,14 +10464,14 @@ var brazilianStates = [
|
|
|
8732
10464
|
];
|
|
8733
10465
|
|
|
8734
10466
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
8735
|
-
import { Fragment as Fragment3, jsx as
|
|
10467
|
+
import { Fragment as Fragment3, jsx as jsx44 } from "react/jsx-runtime";
|
|
8736
10468
|
function StateFormField({
|
|
8737
10469
|
name,
|
|
8738
10470
|
label,
|
|
8739
10471
|
required,
|
|
8740
10472
|
isBrazil
|
|
8741
10473
|
}) {
|
|
8742
|
-
return /* @__PURE__ */
|
|
10474
|
+
return /* @__PURE__ */ jsx44(Fragment3, { children: isBrazil ? /* @__PURE__ */ jsx44(
|
|
8743
10475
|
SelectFormField,
|
|
8744
10476
|
{
|
|
8745
10477
|
name,
|
|
@@ -8747,13 +10479,13 @@ function StateFormField({
|
|
|
8747
10479
|
required,
|
|
8748
10480
|
label
|
|
8749
10481
|
}
|
|
8750
|
-
) : /* @__PURE__ */
|
|
10482
|
+
) : /* @__PURE__ */ jsx44(TextFormField, { name, required, label }) });
|
|
8751
10483
|
}
|
|
8752
10484
|
|
|
8753
10485
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
8754
|
-
import { useEffect as useEffect5, useState as
|
|
10486
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
8755
10487
|
import { useFormContext as useFormContext6, Controller as Controller2 } from "react-hook-form";
|
|
8756
|
-
import { Fragment as Fragment4, jsx as
|
|
10488
|
+
import { Fragment as Fragment4, jsx as jsx45 } from "react/jsx-runtime";
|
|
8757
10489
|
function CityFormField({
|
|
8758
10490
|
name,
|
|
8759
10491
|
label,
|
|
@@ -8764,8 +10496,8 @@ function CityFormField({
|
|
|
8764
10496
|
}) {
|
|
8765
10497
|
const { control, watch } = useFormContext6();
|
|
8766
10498
|
const selectedState = watch(stateName);
|
|
8767
|
-
const [cities, setCities] =
|
|
8768
|
-
const [loading, setLoading] =
|
|
10499
|
+
const [cities, setCities] = useState8([]);
|
|
10500
|
+
const [loading, setLoading] = useState8(false);
|
|
8769
10501
|
useEffect5(() => {
|
|
8770
10502
|
if (!isBrazil) {
|
|
8771
10503
|
setCities([]);
|
|
@@ -8805,13 +10537,13 @@ function CityFormField({
|
|
|
8805
10537
|
}
|
|
8806
10538
|
fetchCities();
|
|
8807
10539
|
}, [selectedState, isBrazil]);
|
|
8808
|
-
return /* @__PURE__ */
|
|
10540
|
+
return /* @__PURE__ */ jsx45(Fragment4, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ jsx45(
|
|
8809
10541
|
Controller2,
|
|
8810
10542
|
{
|
|
8811
10543
|
name,
|
|
8812
10544
|
control,
|
|
8813
10545
|
rules: { required },
|
|
8814
|
-
render: ({ field }) => /* @__PURE__ */
|
|
10546
|
+
render: ({ field }) => /* @__PURE__ */ jsx45(
|
|
8815
10547
|
SelectFormField,
|
|
8816
10548
|
__spreadProps(__spreadValues({
|
|
8817
10549
|
label,
|
|
@@ -8825,7 +10557,7 @@ function CityFormField({
|
|
|
8825
10557
|
})
|
|
8826
10558
|
)
|
|
8827
10559
|
}
|
|
8828
|
-
) : /* @__PURE__ */
|
|
10560
|
+
) : /* @__PURE__ */ jsx45(
|
|
8829
10561
|
TextFormField,
|
|
8830
10562
|
{
|
|
8831
10563
|
name,
|
|
@@ -8837,7 +10569,7 @@ function CityFormField({
|
|
|
8837
10569
|
}
|
|
8838
10570
|
|
|
8839
10571
|
// src/components/FormFields/AddressFormFields/index.tsx
|
|
8840
|
-
import { jsx as
|
|
10572
|
+
import { jsx as jsx46, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8841
10573
|
function getNestedValue2(obj, path) {
|
|
8842
10574
|
return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
8843
10575
|
}
|
|
@@ -8887,8 +10619,8 @@ function AddressFormFields({
|
|
|
8887
10619
|
console.error("Erro ao buscar CEP");
|
|
8888
10620
|
});
|
|
8889
10621
|
};
|
|
8890
|
-
return /* @__PURE__ */
|
|
8891
|
-
/* @__PURE__ */
|
|
10622
|
+
return /* @__PURE__ */ jsxs22(AddressContainerStyled, { layout, children: [
|
|
10623
|
+
/* @__PURE__ */ jsx46(
|
|
8892
10624
|
FormLabel,
|
|
8893
10625
|
{
|
|
8894
10626
|
name,
|
|
@@ -8897,7 +10629,7 @@ function AddressFormFields({
|
|
|
8897
10629
|
haveError
|
|
8898
10630
|
}
|
|
8899
10631
|
),
|
|
8900
|
-
/* @__PURE__ */
|
|
10632
|
+
/* @__PURE__ */ jsx46(
|
|
8901
10633
|
CountryFormField,
|
|
8902
10634
|
{
|
|
8903
10635
|
name: `${name}.country`,
|
|
@@ -8906,7 +10638,7 @@ function AddressFormFields({
|
|
|
8906
10638
|
language: "pt-BR"
|
|
8907
10639
|
}
|
|
8908
10640
|
),
|
|
8909
|
-
isBrazil ? /* @__PURE__ */
|
|
10641
|
+
isBrazil ? /* @__PURE__ */ jsx46(
|
|
8910
10642
|
PostalCodeFormField,
|
|
8911
10643
|
{
|
|
8912
10644
|
name: `${name}.zip_code`,
|
|
@@ -8916,7 +10648,7 @@ function AddressFormFields({
|
|
|
8916
10648
|
validationErrorMessage: "CEP inv\xE1lido",
|
|
8917
10649
|
onChange: handleCEPChange
|
|
8918
10650
|
}
|
|
8919
|
-
) : /* @__PURE__ */
|
|
10651
|
+
) : /* @__PURE__ */ jsx46(
|
|
8920
10652
|
TextFormField,
|
|
8921
10653
|
{
|
|
8922
10654
|
name: `${name}.zip_code`,
|
|
@@ -8924,7 +10656,7 @@ function AddressFormFields({
|
|
|
8924
10656
|
required
|
|
8925
10657
|
}
|
|
8926
10658
|
),
|
|
8927
|
-
/* @__PURE__ */
|
|
10659
|
+
/* @__PURE__ */ jsx46(
|
|
8928
10660
|
StateFormField,
|
|
8929
10661
|
{
|
|
8930
10662
|
name: `${name}.state`,
|
|
@@ -8933,7 +10665,7 @@ function AddressFormFields({
|
|
|
8933
10665
|
isBrazil
|
|
8934
10666
|
}
|
|
8935
10667
|
),
|
|
8936
|
-
/* @__PURE__ */
|
|
10668
|
+
/* @__PURE__ */ jsx46(
|
|
8937
10669
|
CityFormField,
|
|
8938
10670
|
{
|
|
8939
10671
|
name: `${name}.city`,
|
|
@@ -8943,8 +10675,8 @@ function AddressFormFields({
|
|
|
8943
10675
|
isBrazil
|
|
8944
10676
|
}
|
|
8945
10677
|
),
|
|
8946
|
-
/* @__PURE__ */
|
|
8947
|
-
/* @__PURE__ */
|
|
10678
|
+
/* @__PURE__ */ jsx46(TextFormField, { name: `${name}.street`, label: "Rua", required }),
|
|
10679
|
+
/* @__PURE__ */ jsx46(
|
|
8948
10680
|
TextFormField,
|
|
8949
10681
|
{
|
|
8950
10682
|
name: `${name}.number`,
|
|
@@ -8952,7 +10684,7 @@ function AddressFormFields({
|
|
|
8952
10684
|
required
|
|
8953
10685
|
}
|
|
8954
10686
|
),
|
|
8955
|
-
/* @__PURE__ */
|
|
10687
|
+
/* @__PURE__ */ jsx46(
|
|
8956
10688
|
TextFormField,
|
|
8957
10689
|
{
|
|
8958
10690
|
name: `${name}.neighborhood`,
|
|
@@ -8960,13 +10692,13 @@ function AddressFormFields({
|
|
|
8960
10692
|
required
|
|
8961
10693
|
}
|
|
8962
10694
|
),
|
|
8963
|
-
/* @__PURE__ */
|
|
10695
|
+
/* @__PURE__ */ jsx46(TextFormField, { name: `${name}.complement`, label: "Complemento" })
|
|
8964
10696
|
] });
|
|
8965
10697
|
}
|
|
8966
10698
|
|
|
8967
10699
|
// src/components/FormFields/RadioGroupFormField.tsx
|
|
8968
10700
|
import { Controller as Controller3, useFormContext as useFormContext8 } from "react-hook-form";
|
|
8969
|
-
import { jsx as
|
|
10701
|
+
import { jsx as jsx47, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8970
10702
|
var RadioGroupFormField = ({
|
|
8971
10703
|
name,
|
|
8972
10704
|
label,
|
|
@@ -8988,8 +10720,8 @@ var RadioGroupFormField = ({
|
|
|
8988
10720
|
const validationRules = {
|
|
8989
10721
|
required: required ? validationErrorMessage : false
|
|
8990
10722
|
};
|
|
8991
|
-
return /* @__PURE__ */
|
|
8992
|
-
/* @__PURE__ */
|
|
10723
|
+
return /* @__PURE__ */ jsxs23(Flex2, { direction: "column", children: [
|
|
10724
|
+
/* @__PURE__ */ jsx47(
|
|
8993
10725
|
FormLabel,
|
|
8994
10726
|
{
|
|
8995
10727
|
name,
|
|
@@ -8998,14 +10730,14 @@ var RadioGroupFormField = ({
|
|
|
8998
10730
|
haveError
|
|
8999
10731
|
}
|
|
9000
10732
|
),
|
|
9001
|
-
/* @__PURE__ */
|
|
10733
|
+
/* @__PURE__ */ jsx47(
|
|
9002
10734
|
Controller3,
|
|
9003
10735
|
{
|
|
9004
10736
|
name,
|
|
9005
10737
|
control,
|
|
9006
10738
|
defaultValue: defaultValue || "",
|
|
9007
10739
|
rules: validationRules,
|
|
9008
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */
|
|
10740
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsx47(
|
|
9009
10741
|
RadioGroup,
|
|
9010
10742
|
{
|
|
9011
10743
|
value,
|
|
@@ -9013,21 +10745,21 @@ var RadioGroupFormField = ({
|
|
|
9013
10745
|
color: haveError ? "error" : color,
|
|
9014
10746
|
fontWeight,
|
|
9015
10747
|
disabled,
|
|
9016
|
-
children: options.map((option) => /* @__PURE__ */
|
|
9017
|
-
/* @__PURE__ */
|
|
10748
|
+
children: options.map((option) => /* @__PURE__ */ jsxs23("label", { children: [
|
|
10749
|
+
/* @__PURE__ */ jsx47(RadioItem, { value: option.value }),
|
|
9018
10750
|
option.label
|
|
9019
10751
|
] }, option.value))
|
|
9020
10752
|
}
|
|
9021
10753
|
)
|
|
9022
10754
|
}
|
|
9023
10755
|
),
|
|
9024
|
-
/* @__PURE__ */
|
|
10756
|
+
/* @__PURE__ */ jsx47(ErrorFormMessage, { message: errorMsg })
|
|
9025
10757
|
] });
|
|
9026
10758
|
};
|
|
9027
10759
|
|
|
9028
10760
|
// src/components/FormFields/CheckboxGroupFormField.tsx
|
|
9029
10761
|
import { Controller as Controller4, useFormContext as useFormContext9 } from "react-hook-form";
|
|
9030
|
-
import { jsx as
|
|
10762
|
+
import { jsx as jsx48, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9031
10763
|
var CheckboxGroupFormField = ({
|
|
9032
10764
|
name,
|
|
9033
10765
|
label,
|
|
@@ -9050,8 +10782,8 @@ var CheckboxGroupFormField = ({
|
|
|
9050
10782
|
required: required ? validationErrorMessage : false,
|
|
9051
10783
|
validate: required ? (value) => (value == null ? void 0 : value.length) > 0 || validationErrorMessage : void 0
|
|
9052
10784
|
};
|
|
9053
|
-
return /* @__PURE__ */
|
|
9054
|
-
/* @__PURE__ */
|
|
10785
|
+
return /* @__PURE__ */ jsxs24(Flex2, { direction: "column", children: [
|
|
10786
|
+
/* @__PURE__ */ jsx48(
|
|
9055
10787
|
FormLabel,
|
|
9056
10788
|
{
|
|
9057
10789
|
name,
|
|
@@ -9060,14 +10792,14 @@ var CheckboxGroupFormField = ({
|
|
|
9060
10792
|
haveError
|
|
9061
10793
|
}
|
|
9062
10794
|
),
|
|
9063
|
-
/* @__PURE__ */
|
|
10795
|
+
/* @__PURE__ */ jsx48(
|
|
9064
10796
|
Controller4,
|
|
9065
10797
|
{
|
|
9066
10798
|
name,
|
|
9067
10799
|
control,
|
|
9068
10800
|
rules: validationRules,
|
|
9069
10801
|
defaultValue,
|
|
9070
|
-
render: ({ field }) => /* @__PURE__ */
|
|
10802
|
+
render: ({ field }) => /* @__PURE__ */ jsx48(
|
|
9071
10803
|
CheckboxGroup,
|
|
9072
10804
|
{
|
|
9073
10805
|
name,
|
|
@@ -9076,7 +10808,7 @@ var CheckboxGroupFormField = ({
|
|
|
9076
10808
|
color: haveError ? "error" : color,
|
|
9077
10809
|
fontWeight,
|
|
9078
10810
|
disabled,
|
|
9079
|
-
children: options.map((option) => /* @__PURE__ */
|
|
10811
|
+
children: options.map((option) => /* @__PURE__ */ jsx48(
|
|
9080
10812
|
CheckboxItem,
|
|
9081
10813
|
{
|
|
9082
10814
|
value: option.value,
|
|
@@ -9089,13 +10821,13 @@ var CheckboxGroupFormField = ({
|
|
|
9089
10821
|
)
|
|
9090
10822
|
}
|
|
9091
10823
|
),
|
|
9092
|
-
/* @__PURE__ */
|
|
10824
|
+
/* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
|
|
9093
10825
|
] });
|
|
9094
10826
|
};
|
|
9095
10827
|
|
|
9096
10828
|
// src/components/FormFields/SwitchFormField.tsx
|
|
9097
10829
|
import { useFormContext as useFormContext10, Controller as Controller5 } from "react-hook-form";
|
|
9098
|
-
import { jsx as
|
|
10830
|
+
import { jsx as jsx49, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9099
10831
|
var SwitchFormField = ({
|
|
9100
10832
|
name,
|
|
9101
10833
|
label,
|
|
@@ -9109,15 +10841,15 @@ var SwitchFormField = ({
|
|
|
9109
10841
|
if (watch) {
|
|
9110
10842
|
watchForm(name);
|
|
9111
10843
|
}
|
|
9112
|
-
return /* @__PURE__ */
|
|
9113
|
-
/* @__PURE__ */
|
|
9114
|
-
/* @__PURE__ */
|
|
10844
|
+
return /* @__PURE__ */ jsxs25(Flex2, { justify: "between", style: { margin: "1rem 0" }, children: [
|
|
10845
|
+
/* @__PURE__ */ jsx49(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
|
|
10846
|
+
/* @__PURE__ */ jsx49(
|
|
9115
10847
|
Controller5,
|
|
9116
10848
|
{
|
|
9117
10849
|
control,
|
|
9118
10850
|
name,
|
|
9119
10851
|
defaultValue,
|
|
9120
|
-
render: ({ field }) => /* @__PURE__ */
|
|
10852
|
+
render: ({ field }) => /* @__PURE__ */ jsx49(
|
|
9121
10853
|
Switch,
|
|
9122
10854
|
{
|
|
9123
10855
|
checked: field.value,
|
|
@@ -9130,14 +10862,14 @@ var SwitchFormField = ({
|
|
|
9130
10862
|
};
|
|
9131
10863
|
|
|
9132
10864
|
// src/components/FormFields/EmailFormField.tsx
|
|
9133
|
-
import { jsx as
|
|
10865
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
9134
10866
|
var EmailFormField = ({
|
|
9135
10867
|
name,
|
|
9136
10868
|
label,
|
|
9137
10869
|
required,
|
|
9138
10870
|
placeholder
|
|
9139
10871
|
}) => {
|
|
9140
|
-
return /* @__PURE__ */
|
|
10872
|
+
return /* @__PURE__ */ jsx50(
|
|
9141
10873
|
TextFormField,
|
|
9142
10874
|
{
|
|
9143
10875
|
name,
|
|
@@ -9154,22 +10886,605 @@ var EmailFormField = ({
|
|
|
9154
10886
|
import { useController as useController3 } from "react-hook-form";
|
|
9155
10887
|
|
|
9156
10888
|
// src/components/RichEditor/RichEditor.tsx
|
|
9157
|
-
import {
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
10889
|
+
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
10890
|
+
|
|
10891
|
+
// src/components/RichEditor/QuillComponent.tsx
|
|
10892
|
+
import { useState as useState9, useRef as useRef8, useEffect as useEffect6, useCallback as useCallback4 } from "react";
|
|
10893
|
+
import { useQuill } from "react-quilljs";
|
|
10894
|
+
|
|
10895
|
+
// src/utils/uploadService.ts
|
|
10896
|
+
var generateUniqueFilename = (originalName) => {
|
|
10897
|
+
const timestamp = Date.now().toString(36);
|
|
10898
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
10899
|
+
const extension = originalName.split(".").pop();
|
|
10900
|
+
return `${timestamp}_${random}.${extension}`;
|
|
10901
|
+
};
|
|
10902
|
+
var UploadService = class {
|
|
10903
|
+
static getPresignedUrl(filename, contentType, config2) {
|
|
10904
|
+
return __async(this, null, function* () {
|
|
10905
|
+
var _a;
|
|
10906
|
+
const apiUrl = config2.apiUrl;
|
|
10907
|
+
const presignedUrlEndpoint = (_a = config2.endpoints) == null ? void 0 : _a.presignedUrl;
|
|
10908
|
+
const bucket = config2.s3Bucket;
|
|
10909
|
+
try {
|
|
10910
|
+
const response = yield fetch(`${apiUrl}${presignedUrlEndpoint}`, {
|
|
10911
|
+
method: "POST",
|
|
10912
|
+
headers: {
|
|
10913
|
+
"Content-Type": "application/json"
|
|
10914
|
+
},
|
|
10915
|
+
body: JSON.stringify({
|
|
10916
|
+
filename,
|
|
10917
|
+
contentType,
|
|
10918
|
+
bucket
|
|
10919
|
+
})
|
|
10920
|
+
});
|
|
10921
|
+
if (!response.ok) {
|
|
10922
|
+
throw new Error("Falha ao gerar URL de upload");
|
|
10923
|
+
}
|
|
10924
|
+
const data = yield response.json();
|
|
10925
|
+
return data.presignedUrl;
|
|
10926
|
+
} catch (error) {
|
|
10927
|
+
console.error("Erro ao gerar URL pr\xE9-assinada:", error);
|
|
10928
|
+
throw new Error("Falha ao gerar URL de upload");
|
|
10929
|
+
}
|
|
10930
|
+
});
|
|
10931
|
+
}
|
|
10932
|
+
static uploadToS3(file, config2, onProgress) {
|
|
10933
|
+
return __async(this, null, function* () {
|
|
10934
|
+
try {
|
|
10935
|
+
const uniqueFilename = generateUniqueFilename(file.name);
|
|
10936
|
+
const blob = new Blob([file], { type: file.type });
|
|
10937
|
+
const s3Url = `${config2.s3Url}/${uniqueFilename}`;
|
|
10938
|
+
return new Promise((resolve, reject) => {
|
|
10939
|
+
const xhr = new XMLHttpRequest();
|
|
10940
|
+
xhr.upload.addEventListener("progress", (event) => {
|
|
10941
|
+
if (event.lengthComputable) {
|
|
10942
|
+
const percentComplete = Math.round(
|
|
10943
|
+
event.loaded / event.total * 100
|
|
10944
|
+
);
|
|
10945
|
+
onProgress == null ? void 0 : onProgress({
|
|
10946
|
+
amount: percentComplete,
|
|
10947
|
+
message: `Fazendo upload... ${percentComplete}%`
|
|
10948
|
+
});
|
|
10949
|
+
}
|
|
10950
|
+
});
|
|
10951
|
+
xhr.addEventListener("load", () => {
|
|
10952
|
+
if (xhr.status === 200) {
|
|
10953
|
+
resolve({
|
|
10954
|
+
url: s3Url,
|
|
10955
|
+
filename: uniqueFilename,
|
|
10956
|
+
size: file.size,
|
|
10957
|
+
type: file.type
|
|
10958
|
+
});
|
|
10959
|
+
} else {
|
|
10960
|
+
reject(new Error(`Upload falhou com status: ${xhr.status}`));
|
|
10961
|
+
}
|
|
10962
|
+
});
|
|
10963
|
+
xhr.addEventListener("error", () => {
|
|
10964
|
+
reject(new Error("Erro de rede durante upload"));
|
|
10965
|
+
});
|
|
10966
|
+
xhr.open("PUT", s3Url);
|
|
10967
|
+
xhr.setRequestHeader("Content-Type", file.type);
|
|
10968
|
+
xhr.send(blob);
|
|
10969
|
+
});
|
|
10970
|
+
} catch (error) {
|
|
10971
|
+
console.error("Erro no upload:", error);
|
|
10972
|
+
throw error;
|
|
10973
|
+
}
|
|
10974
|
+
});
|
|
10975
|
+
}
|
|
10976
|
+
static uploadViaAPI(file, config2, onProgress) {
|
|
10977
|
+
return __async(this, null, function* () {
|
|
10978
|
+
try {
|
|
10979
|
+
const formData = new FormData();
|
|
10980
|
+
formData.append("file", file);
|
|
10981
|
+
const bucket = config2.s3Bucket;
|
|
10982
|
+
formData.append("bucket", bucket);
|
|
10983
|
+
const xhr = new XMLHttpRequest();
|
|
10984
|
+
return new Promise((resolve, reject) => {
|
|
10985
|
+
var _a;
|
|
10986
|
+
xhr.upload.addEventListener("progress", (event) => {
|
|
10987
|
+
if (event.lengthComputable) {
|
|
10988
|
+
const percentComplete = Math.round(
|
|
10989
|
+
event.loaded / event.total * 100
|
|
10990
|
+
);
|
|
10991
|
+
onProgress == null ? void 0 : onProgress({
|
|
10992
|
+
amount: percentComplete,
|
|
10993
|
+
message: `Fazendo upload... ${percentComplete}%`
|
|
10994
|
+
});
|
|
10995
|
+
}
|
|
10996
|
+
});
|
|
10997
|
+
xhr.addEventListener("load", () => {
|
|
10998
|
+
if (xhr.status === 200) {
|
|
10999
|
+
try {
|
|
11000
|
+
const response = JSON.parse(xhr.responseText);
|
|
11001
|
+
resolve({
|
|
11002
|
+
url: response.url,
|
|
11003
|
+
filename: response.filename,
|
|
11004
|
+
size: file.size,
|
|
11005
|
+
type: file.type
|
|
11006
|
+
});
|
|
11007
|
+
} catch (error) {
|
|
11008
|
+
reject(new Error("Resposta inv\xE1lida do servidor"));
|
|
11009
|
+
}
|
|
11010
|
+
} else {
|
|
11011
|
+
reject(new Error(`Upload falhou com status: ${xhr.status}`));
|
|
11012
|
+
}
|
|
11013
|
+
});
|
|
11014
|
+
xhr.addEventListener("error", () => {
|
|
11015
|
+
reject(new Error("Erro de rede durante upload"));
|
|
11016
|
+
});
|
|
11017
|
+
const apiUrl = config2.apiUrl;
|
|
11018
|
+
const uploadEndpoint = (_a = config2.endpoints) == null ? void 0 : _a.upload;
|
|
11019
|
+
xhr.open("POST", `${apiUrl}${uploadEndpoint}`);
|
|
11020
|
+
xhr.send(formData);
|
|
11021
|
+
});
|
|
11022
|
+
} catch (error) {
|
|
11023
|
+
console.error("Erro no upload via API:", error);
|
|
11024
|
+
throw error;
|
|
11025
|
+
}
|
|
11026
|
+
});
|
|
11027
|
+
}
|
|
11028
|
+
};
|
|
11029
|
+
|
|
11030
|
+
// src/components/RichEditor/styledComponents.ts
|
|
11031
|
+
var QuillContainer = styled("div", {
|
|
11032
|
+
display: "flex",
|
|
11033
|
+
flexDirection: "column"
|
|
11034
|
+
});
|
|
11035
|
+
var QuillEditor = styled("div", {
|
|
11036
|
+
"& .ql-editor": {
|
|
11037
|
+
minHeight: "200px",
|
|
11038
|
+
padding: "$12",
|
|
11039
|
+
fontSize: "$14",
|
|
11040
|
+
lineHeight: "$base",
|
|
11041
|
+
fontFamily: "$default",
|
|
11042
|
+
color: "$neutral900",
|
|
11043
|
+
backgroundColor: "$white",
|
|
11044
|
+
border: "none",
|
|
11045
|
+
outline: "none",
|
|
11046
|
+
cursor: "text",
|
|
11047
|
+
caretColor: "$primary500",
|
|
11048
|
+
"&:focus": {
|
|
11049
|
+
borderColor: "$primary500",
|
|
11050
|
+
boxShadow: "0 0 0 1px $primary500"
|
|
11051
|
+
},
|
|
11052
|
+
"& p": {
|
|
11053
|
+
margin: "0 0 $8 0"
|
|
11054
|
+
},
|
|
11055
|
+
"& h1 span, & h1, & h2, & h2 span": {
|
|
11056
|
+
lineHeight: "1.5rem"
|
|
11057
|
+
},
|
|
11058
|
+
"& p:last-child": {
|
|
11059
|
+
marginBottom: 0
|
|
11060
|
+
},
|
|
11061
|
+
"& .ql-cursor": {
|
|
11062
|
+
borderLeft: "2px solid $primary500"
|
|
11063
|
+
}
|
|
11064
|
+
},
|
|
11065
|
+
"& .ql-toolbar": {
|
|
11066
|
+
backgroundColor: "$grey100",
|
|
11067
|
+
border: "1px solid $neutral300",
|
|
11068
|
+
borderBottom: "none",
|
|
11069
|
+
borderTopLeftRadius: "$sm",
|
|
11070
|
+
borderTopRightRadius: "$sm",
|
|
11071
|
+
padding: "$8 $12"
|
|
11072
|
+
},
|
|
11073
|
+
"& .ql-container": {
|
|
11074
|
+
border: "1px solid $neutral300",
|
|
11075
|
+
borderTop: "none",
|
|
11076
|
+
borderBottomLeftRadius: "$sm",
|
|
11077
|
+
borderBottomRightRadius: "$sm",
|
|
11078
|
+
fontFamily: "$default"
|
|
11079
|
+
},
|
|
11080
|
+
"& .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before": {
|
|
11081
|
+
content: "T\xEDtulo 1"
|
|
11082
|
+
},
|
|
11083
|
+
"& .ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before": {
|
|
11084
|
+
content: "T\xEDtulo 2"
|
|
11085
|
+
}
|
|
11086
|
+
});
|
|
11087
|
+
|
|
11088
|
+
// src/components/RichEditor/QuillComponent.tsx
|
|
11089
|
+
import { jsx as jsx51, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11090
|
+
var QuillComponent = ({
|
|
11091
|
+
value = "",
|
|
11092
|
+
onChange,
|
|
11093
|
+
placeholder = "Digite seu texto aqui...",
|
|
11094
|
+
disabled = false,
|
|
11095
|
+
className,
|
|
11096
|
+
uploadConfig,
|
|
11097
|
+
simpleVersion = false,
|
|
11098
|
+
onCharacterCountChange,
|
|
11099
|
+
maxLength
|
|
11100
|
+
}) => {
|
|
11101
|
+
const [showVideoModal, setShowVideoModal] = useState9(false);
|
|
11102
|
+
const [videoUrl, setVideoUrl] = useState9("");
|
|
11103
|
+
const [showLinkModal, setShowLinkModal] = useState9(false);
|
|
11104
|
+
const [linkUrl, setLinkUrl] = useState9("");
|
|
11105
|
+
const videoModalRef = useRef8(null);
|
|
11106
|
+
const linkModalRef = useRef8(null);
|
|
11107
|
+
const { addToast, removeToast } = useToast();
|
|
11108
|
+
const modules = simpleVersion ? {
|
|
11109
|
+
toolbar: [
|
|
11110
|
+
["bold", "italic", "underline"],
|
|
11111
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
11112
|
+
["link"]
|
|
11113
|
+
],
|
|
11114
|
+
clipboard: {
|
|
11115
|
+
matchVisual: false
|
|
11116
|
+
}
|
|
11117
|
+
} : {
|
|
11118
|
+
toolbar: [
|
|
11119
|
+
[{ header: [1, 2, false] }],
|
|
11120
|
+
["bold", "italic", "underline", "strike"],
|
|
11121
|
+
[{ color: [] }, { background: [] }],
|
|
11122
|
+
[{ align: [] }],
|
|
11123
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
11124
|
+
["link", "image", "video"]
|
|
11125
|
+
],
|
|
11126
|
+
clipboard: {
|
|
11127
|
+
matchVisual: false
|
|
11128
|
+
}
|
|
11129
|
+
};
|
|
11130
|
+
const formats = simpleVersion ? ["bold", "italic", "underline", "list", "link"] : [
|
|
11131
|
+
"header",
|
|
11132
|
+
"bold",
|
|
11133
|
+
"italic",
|
|
11134
|
+
"underline",
|
|
11135
|
+
"strike",
|
|
11136
|
+
"color",
|
|
11137
|
+
"background",
|
|
11138
|
+
"align",
|
|
11139
|
+
"list",
|
|
11140
|
+
"link",
|
|
11141
|
+
"image",
|
|
11142
|
+
"video"
|
|
11143
|
+
];
|
|
11144
|
+
const { quill, quillRef } = useQuill({
|
|
11145
|
+
theme: "snow",
|
|
11146
|
+
modules,
|
|
11147
|
+
formats,
|
|
11148
|
+
placeholder,
|
|
11149
|
+
readOnly: disabled
|
|
11150
|
+
});
|
|
11151
|
+
const handleImageUpload = useCallback4(
|
|
11152
|
+
(file) => __async(null, null, function* () {
|
|
11153
|
+
if (disabled || !quill || !uploadConfig) return;
|
|
11154
|
+
try {
|
|
11155
|
+
addToast({
|
|
11156
|
+
type: "info",
|
|
11157
|
+
message: "Carregando imagem...",
|
|
11158
|
+
duration: 2e3
|
|
11159
|
+
});
|
|
11160
|
+
const uploadedFile = yield UploadService.uploadToS3(file, uploadConfig);
|
|
11161
|
+
removeToast("info");
|
|
11162
|
+
addToast({
|
|
11163
|
+
type: "success",
|
|
11164
|
+
message: "Imagem adicionada com sucesso!"
|
|
11165
|
+
});
|
|
11166
|
+
const selection = quill.getSelection();
|
|
11167
|
+
const index = selection ? selection.index : quill.getLength();
|
|
11168
|
+
quill.insertEmbed(index, "image", uploadedFile.url);
|
|
11169
|
+
quill.setSelection(index + 1, 0);
|
|
11170
|
+
} catch (error) {
|
|
11171
|
+
console.error("Erro no upload:", error);
|
|
11172
|
+
addToast({
|
|
11173
|
+
type: "error",
|
|
11174
|
+
message: "Erro no upload: N\xE3o foi poss\xEDvel enviar a imagem. Tente novamente."
|
|
11175
|
+
});
|
|
11176
|
+
}
|
|
11177
|
+
}),
|
|
11178
|
+
[disabled, quill, addToast, removeToast, uploadConfig]
|
|
11179
|
+
);
|
|
11180
|
+
useEffect6(() => {
|
|
11181
|
+
if (quill && value) {
|
|
11182
|
+
const currentContent = quill.root.innerHTML;
|
|
11183
|
+
if (currentContent !== value) {
|
|
11184
|
+
const selection = quill.getSelection();
|
|
11185
|
+
quill.clipboard.dangerouslyPasteHTML(value);
|
|
11186
|
+
if (selection) {
|
|
11187
|
+
quill.setSelection(selection.index, selection.length);
|
|
11188
|
+
} else {
|
|
11189
|
+
quill.setSelection(quill.getLength(), 0);
|
|
11190
|
+
}
|
|
11191
|
+
}
|
|
11192
|
+
}
|
|
11193
|
+
}, [quill, value]);
|
|
11194
|
+
useEffect6(() => {
|
|
11195
|
+
if (quill) {
|
|
11196
|
+
quill.on("text-change", (delta, oldDelta, source) => {
|
|
11197
|
+
if (source === "user") {
|
|
11198
|
+
const text = quill.getText().trim();
|
|
11199
|
+
const count = text.length;
|
|
11200
|
+
if (maxLength !== void 0 && count > maxLength) {
|
|
11201
|
+
quill.deleteText(maxLength, count - maxLength);
|
|
11202
|
+
return;
|
|
11203
|
+
}
|
|
11204
|
+
onChange == null ? void 0 : onChange(quill.root.innerHTML);
|
|
11205
|
+
onCharacterCountChange == null ? void 0 : onCharacterCountChange(count);
|
|
11206
|
+
}
|
|
11207
|
+
});
|
|
11208
|
+
const toolbar = quill.getModule("toolbar");
|
|
11209
|
+
if (toolbar) {
|
|
11210
|
+
toolbar.addHandler("link", () => setShowLinkModal(true));
|
|
11211
|
+
toolbar.addHandler("video", () => setShowVideoModal(true));
|
|
11212
|
+
toolbar.addHandler("image", () => {
|
|
11213
|
+
const input = document.createElement("input");
|
|
11214
|
+
input.setAttribute("type", "file");
|
|
11215
|
+
input.setAttribute("accept", "image/*");
|
|
11216
|
+
input.click();
|
|
11217
|
+
input.onchange = () => __async(null, null, function* () {
|
|
11218
|
+
var _a;
|
|
11219
|
+
const file = (_a = input.files) == null ? void 0 : _a[0];
|
|
11220
|
+
if (file) {
|
|
11221
|
+
yield handleImageUpload(file);
|
|
11222
|
+
}
|
|
11223
|
+
});
|
|
11224
|
+
});
|
|
11225
|
+
}
|
|
11226
|
+
setTimeout(() => {
|
|
11227
|
+
var _a, _b;
|
|
11228
|
+
const toolbarElement = (_b = (_a = quillRef.current) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.querySelector(".ql-toolbar");
|
|
11229
|
+
if (toolbarElement) {
|
|
11230
|
+
const headerSelect = toolbarElement.querySelector(
|
|
11231
|
+
"select[data-value]"
|
|
11232
|
+
);
|
|
11233
|
+
if (headerSelect) {
|
|
11234
|
+
const options = headerSelect.querySelectorAll("option");
|
|
11235
|
+
options.forEach((option) => {
|
|
11236
|
+
if (option.value === "1") {
|
|
11237
|
+
option.textContent = "T\xEDtulo 1";
|
|
11238
|
+
} else if (option.value === "2") {
|
|
11239
|
+
option.textContent = "T\xEDtulo 2";
|
|
11240
|
+
} else if (option.value === "") {
|
|
11241
|
+
option.textContent = "Normal";
|
|
11242
|
+
}
|
|
11243
|
+
});
|
|
11244
|
+
}
|
|
11245
|
+
}
|
|
11246
|
+
}, 2e3);
|
|
11247
|
+
}
|
|
11248
|
+
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
11249
|
+
useEffect6(() => {
|
|
11250
|
+
if (quill) {
|
|
11251
|
+
quill.enable(!disabled);
|
|
11252
|
+
if (!disabled) {
|
|
11253
|
+
if (quill.getLength() <= 1) {
|
|
11254
|
+
quill.focus();
|
|
11255
|
+
quill.setSelection(0, 0);
|
|
11256
|
+
}
|
|
11257
|
+
}
|
|
11258
|
+
}
|
|
11259
|
+
}, [quill, disabled]);
|
|
11260
|
+
const handleLinkCancel = useCallback4(() => {
|
|
11261
|
+
setLinkUrl("");
|
|
11262
|
+
setShowLinkModal(false);
|
|
11263
|
+
}, []);
|
|
11264
|
+
const handleLinkSubmit = useCallback4(() => {
|
|
11265
|
+
if (!linkUrl.trim() || !quill) return;
|
|
11266
|
+
const url = linkUrl.trim();
|
|
11267
|
+
const selection = quill.getSelection();
|
|
11268
|
+
if (selection && selection.length > 0) {
|
|
11269
|
+
quill.format("link", url);
|
|
11270
|
+
} else {
|
|
11271
|
+
const index = quill.getLength();
|
|
11272
|
+
quill.insertText(index, url, "link", url);
|
|
11273
|
+
quill.setSelection(index + url.length, 0);
|
|
11274
|
+
}
|
|
11275
|
+
setLinkUrl("");
|
|
11276
|
+
setShowLinkModal(false);
|
|
11277
|
+
}, [linkUrl, quill]);
|
|
11278
|
+
const handleVideoCancel = useCallback4(() => {
|
|
11279
|
+
setVideoUrl("");
|
|
11280
|
+
setShowVideoModal(false);
|
|
11281
|
+
}, []);
|
|
11282
|
+
const handleVideoSubmit = useCallback4(() => {
|
|
11283
|
+
var _a, _b;
|
|
11284
|
+
if (!videoUrl.trim() || !quill) return;
|
|
11285
|
+
let processedUrl = videoUrl.trim();
|
|
11286
|
+
if (processedUrl.includes("youtube.com/watch")) {
|
|
11287
|
+
const videoId = (_a = processedUrl.match(/[?&]v=([^&]+)/)) == null ? void 0 : _a[1];
|
|
11288
|
+
if (videoId) {
|
|
11289
|
+
processedUrl = `https://www.youtube.com/embed/${videoId}`;
|
|
11290
|
+
}
|
|
11291
|
+
} else if (processedUrl.includes("youtu.be/")) {
|
|
11292
|
+
const videoId = (_b = processedUrl.split("youtu.be/")[1]) == null ? void 0 : _b.split("?")[0];
|
|
11293
|
+
if (videoId) {
|
|
11294
|
+
processedUrl = `https://www.youtube.com/embed/${videoId}`;
|
|
11295
|
+
}
|
|
11296
|
+
}
|
|
11297
|
+
const videoHTML = `
|
|
11298
|
+
<iframe
|
|
11299
|
+
src="${processedUrl}"
|
|
11300
|
+
style="max-width:100%; height:315px; border:0;"
|
|
11301
|
+
title="Video player"
|
|
11302
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
11303
|
+
allowfullscreen>
|
|
11304
|
+
</iframe>
|
|
11305
|
+
<br/>
|
|
11306
|
+
`;
|
|
11307
|
+
const selection = quill.getSelection();
|
|
11308
|
+
const insertIndex = selection ? selection.index : quill.getLength();
|
|
11309
|
+
quill.clipboard.dangerouslyPasteHTML(insertIndex, videoHTML);
|
|
11310
|
+
quill.setSelection(insertIndex + 1, 0);
|
|
11311
|
+
setVideoUrl("");
|
|
11312
|
+
setShowVideoModal(false);
|
|
11313
|
+
}, [videoUrl, quill]);
|
|
9162
11314
|
useEffect6(() => {
|
|
11315
|
+
const handleClickOutside = (event) => {
|
|
11316
|
+
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
11317
|
+
handleVideoCancel();
|
|
11318
|
+
}
|
|
11319
|
+
if (showLinkModal && linkModalRef.current && !linkModalRef.current.contains(event.target)) {
|
|
11320
|
+
handleLinkCancel();
|
|
11321
|
+
}
|
|
11322
|
+
};
|
|
11323
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
11324
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
11325
|
+
}, [showVideoModal, showLinkModal, handleVideoCancel, handleLinkCancel]);
|
|
11326
|
+
return /* @__PURE__ */ jsx51(QuillContainer, { className, children: /* @__PURE__ */ jsxs26(QuillEditor, { style: { position: "relative" }, children: [
|
|
11327
|
+
/* @__PURE__ */ jsx51("div", { ref: quillRef }),
|
|
11328
|
+
showVideoModal && /* @__PURE__ */ jsx51(
|
|
11329
|
+
"div",
|
|
11330
|
+
{
|
|
11331
|
+
ref: videoModalRef,
|
|
11332
|
+
style: {
|
|
11333
|
+
position: "absolute",
|
|
11334
|
+
top: "20px",
|
|
11335
|
+
left: "20px",
|
|
11336
|
+
right: "20px",
|
|
11337
|
+
backgroundColor: "white",
|
|
11338
|
+
border: "1px solid #e0e0e0",
|
|
11339
|
+
borderRadius: "4px",
|
|
11340
|
+
padding: "12px",
|
|
11341
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
11342
|
+
zIndex: 1e3,
|
|
11343
|
+
width: "fit-content"
|
|
11344
|
+
},
|
|
11345
|
+
children: /* @__PURE__ */ jsxs26(Flex2, { gap: 8, align: "center", children: [
|
|
11346
|
+
/* @__PURE__ */ jsx51(
|
|
11347
|
+
Text,
|
|
11348
|
+
{
|
|
11349
|
+
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
11350
|
+
children: "V\xEDdeo:"
|
|
11351
|
+
}
|
|
11352
|
+
),
|
|
11353
|
+
/* @__PURE__ */ jsx51(
|
|
11354
|
+
"input",
|
|
11355
|
+
{
|
|
11356
|
+
type: "text",
|
|
11357
|
+
value: videoUrl,
|
|
11358
|
+
onChange: (e) => setVideoUrl(e.target.value),
|
|
11359
|
+
placeholder: "Embed URL",
|
|
11360
|
+
style: {
|
|
11361
|
+
padding: "8px 12px",
|
|
11362
|
+
border: "1px solid #d0d0d0",
|
|
11363
|
+
borderRadius: "4px",
|
|
11364
|
+
fontSize: "14px",
|
|
11365
|
+
backgroundColor: "#f8f8f8"
|
|
11366
|
+
},
|
|
11367
|
+
onKeyDown: (e) => {
|
|
11368
|
+
if (e.key === "Enter") {
|
|
11369
|
+
handleVideoSubmit();
|
|
11370
|
+
} else if (e.key === "Escape") {
|
|
11371
|
+
handleVideoCancel();
|
|
11372
|
+
}
|
|
11373
|
+
},
|
|
11374
|
+
autoFocus: true
|
|
11375
|
+
}
|
|
11376
|
+
),
|
|
11377
|
+
/* @__PURE__ */ jsx51(
|
|
11378
|
+
"button",
|
|
11379
|
+
{
|
|
11380
|
+
onClick: handleVideoSubmit,
|
|
11381
|
+
disabled: !videoUrl.trim(),
|
|
11382
|
+
style: {
|
|
11383
|
+
padding: "8px 16px",
|
|
11384
|
+
backgroundColor: "#007bff",
|
|
11385
|
+
color: "white",
|
|
11386
|
+
border: "none",
|
|
11387
|
+
borderRadius: "4px",
|
|
11388
|
+
fontSize: "14px",
|
|
11389
|
+
cursor: videoUrl.trim() ? "pointer" : "not-allowed",
|
|
11390
|
+
opacity: videoUrl.trim() ? 1 : 0.6
|
|
11391
|
+
},
|
|
11392
|
+
children: "Ok"
|
|
11393
|
+
}
|
|
11394
|
+
)
|
|
11395
|
+
] })
|
|
11396
|
+
}
|
|
11397
|
+
),
|
|
11398
|
+
showLinkModal && /* @__PURE__ */ jsx51(
|
|
11399
|
+
"div",
|
|
11400
|
+
{
|
|
11401
|
+
ref: linkModalRef,
|
|
11402
|
+
style: {
|
|
11403
|
+
position: "absolute",
|
|
11404
|
+
top: "20px",
|
|
11405
|
+
left: "20px",
|
|
11406
|
+
right: "20px",
|
|
11407
|
+
backgroundColor: "white",
|
|
11408
|
+
border: "1px solid #e0e0e0",
|
|
11409
|
+
borderRadius: "4px",
|
|
11410
|
+
padding: "12px",
|
|
11411
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
11412
|
+
zIndex: 1e3,
|
|
11413
|
+
width: "fit-content"
|
|
11414
|
+
},
|
|
11415
|
+
children: /* @__PURE__ */ jsxs26(Flex2, { gap: 8, align: "center", children: [
|
|
11416
|
+
/* @__PURE__ */ jsx51(
|
|
11417
|
+
Text,
|
|
11418
|
+
{
|
|
11419
|
+
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
11420
|
+
children: "Link:"
|
|
11421
|
+
}
|
|
11422
|
+
),
|
|
11423
|
+
/* @__PURE__ */ jsx51(
|
|
11424
|
+
"input",
|
|
11425
|
+
{
|
|
11426
|
+
type: "text",
|
|
11427
|
+
value: linkUrl,
|
|
11428
|
+
onChange: (e) => setLinkUrl(e.target.value),
|
|
11429
|
+
placeholder: "URL do link",
|
|
11430
|
+
style: {
|
|
11431
|
+
padding: "8px 12px",
|
|
11432
|
+
border: "1px solid #d0d0d0",
|
|
11433
|
+
borderRadius: "4px",
|
|
11434
|
+
fontSize: "14px",
|
|
11435
|
+
backgroundColor: "#f8f8f8",
|
|
11436
|
+
width: "300px"
|
|
11437
|
+
},
|
|
11438
|
+
onKeyDown: (e) => {
|
|
11439
|
+
if (e.key === "Enter") {
|
|
11440
|
+
handleLinkSubmit();
|
|
11441
|
+
} else if (e.key === "Escape") {
|
|
11442
|
+
handleLinkCancel();
|
|
11443
|
+
}
|
|
11444
|
+
},
|
|
11445
|
+
autoFocus: true
|
|
11446
|
+
}
|
|
11447
|
+
),
|
|
11448
|
+
/* @__PURE__ */ jsx51(
|
|
11449
|
+
"button",
|
|
11450
|
+
{
|
|
11451
|
+
onClick: handleLinkSubmit,
|
|
11452
|
+
disabled: !linkUrl.trim(),
|
|
11453
|
+
style: {
|
|
11454
|
+
padding: "8px 16px",
|
|
11455
|
+
backgroundColor: "#007bff",
|
|
11456
|
+
color: "white",
|
|
11457
|
+
border: "none",
|
|
11458
|
+
borderRadius: "4px",
|
|
11459
|
+
fontSize: "14px",
|
|
11460
|
+
cursor: linkUrl.trim() ? "pointer" : "not-allowed",
|
|
11461
|
+
opacity: linkUrl.trim() ? 1 : 0.6
|
|
11462
|
+
},
|
|
11463
|
+
children: "Ok"
|
|
11464
|
+
}
|
|
11465
|
+
)
|
|
11466
|
+
] })
|
|
11467
|
+
}
|
|
11468
|
+
)
|
|
11469
|
+
] }) });
|
|
11470
|
+
};
|
|
11471
|
+
var QuillComponent_default = QuillComponent;
|
|
11472
|
+
|
|
11473
|
+
// src/components/RichEditor/RichEditor.tsx
|
|
11474
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
11475
|
+
var RichEditor = (props) => {
|
|
11476
|
+
const [isClient, setIsClient] = useState10(false);
|
|
11477
|
+
useEffect7(() => {
|
|
9163
11478
|
setIsClient(typeof window !== "undefined");
|
|
9164
11479
|
}, []);
|
|
9165
11480
|
if (!isClient) return null;
|
|
9166
|
-
return /* @__PURE__ */
|
|
11481
|
+
return /* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsx52(ToastProvider, { children: /* @__PURE__ */ jsx52(QuillComponent_default, __spreadValues({}, props)) }) });
|
|
9167
11482
|
};
|
|
9168
11483
|
var RichEditor_default = RichEditor;
|
|
9169
11484
|
|
|
9170
11485
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
9171
|
-
import { useState as
|
|
9172
|
-
import { Fragment as Fragment5, jsx as
|
|
11486
|
+
import { useState as useState11 } from "react";
|
|
11487
|
+
import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9173
11488
|
var RichEditorFormField = (_a) => {
|
|
9174
11489
|
var _b = _a, {
|
|
9175
11490
|
name,
|
|
@@ -9199,7 +11514,7 @@ var RichEditorFormField = (_a) => {
|
|
|
9199
11514
|
},
|
|
9200
11515
|
defaultValue: ""
|
|
9201
11516
|
});
|
|
9202
|
-
const [caracterQuantity, setCaracterQuantity] =
|
|
11517
|
+
const [caracterQuantity, setCaracterQuantity] = useState11(maxLength);
|
|
9203
11518
|
const handleCharacterCountChange = (count) => {
|
|
9204
11519
|
if (maxLength !== void 0) {
|
|
9205
11520
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -9208,9 +11523,9 @@ var RichEditorFormField = (_a) => {
|
|
|
9208
11523
|
const fieldError = fieldState.error;
|
|
9209
11524
|
const haveError = !!fieldError;
|
|
9210
11525
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
9211
|
-
return /* @__PURE__ */
|
|
9212
|
-
maxLength ? /* @__PURE__ */
|
|
9213
|
-
label && /* @__PURE__ */
|
|
11526
|
+
return /* @__PURE__ */ jsxs27(Flex2, { direction: "column", children: [
|
|
11527
|
+
maxLength ? /* @__PURE__ */ jsxs27(Flex2, { direction: "row", justify: "between", children: [
|
|
11528
|
+
label && /* @__PURE__ */ jsx53(
|
|
9214
11529
|
FormLabel,
|
|
9215
11530
|
{
|
|
9216
11531
|
name,
|
|
@@ -9219,8 +11534,8 @@ var RichEditorFormField = (_a) => {
|
|
|
9219
11534
|
haveError
|
|
9220
11535
|
}
|
|
9221
11536
|
),
|
|
9222
|
-
/* @__PURE__ */
|
|
9223
|
-
] }) : /* @__PURE__ */
|
|
11537
|
+
/* @__PURE__ */ jsx53(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
11538
|
+
] }) : /* @__PURE__ */ jsx53(Fragment5, { children: label && /* @__PURE__ */ jsx53(
|
|
9224
11539
|
FormLabel,
|
|
9225
11540
|
{
|
|
9226
11541
|
name,
|
|
@@ -9229,7 +11544,7 @@ var RichEditorFormField = (_a) => {
|
|
|
9229
11544
|
haveError
|
|
9230
11545
|
}
|
|
9231
11546
|
) }),
|
|
9232
|
-
/* @__PURE__ */
|
|
11547
|
+
/* @__PURE__ */ jsx53(
|
|
9233
11548
|
RichEditor_default,
|
|
9234
11549
|
__spreadProps(__spreadValues({}, props), {
|
|
9235
11550
|
value: field.value,
|
|
@@ -9239,14 +11554,14 @@ var RichEditorFormField = (_a) => {
|
|
|
9239
11554
|
maxLength
|
|
9240
11555
|
})
|
|
9241
11556
|
),
|
|
9242
|
-
/* @__PURE__ */
|
|
11557
|
+
/* @__PURE__ */ jsx53(ErrorFormMessage, { message: errorMsg })
|
|
9243
11558
|
] });
|
|
9244
11559
|
};
|
|
9245
11560
|
|
|
9246
11561
|
// src/components/FormFields/CalendarFormField.tsx
|
|
9247
11562
|
import { useController as useController4 } from "react-hook-form";
|
|
9248
|
-
import { useCallback as
|
|
9249
|
-
import { jsx as
|
|
11563
|
+
import { useCallback as useCallback5 } from "react";
|
|
11564
|
+
import { jsx as jsx54, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9250
11565
|
var CalendarFormField = (_a) => {
|
|
9251
11566
|
var _b = _a, {
|
|
9252
11567
|
name,
|
|
@@ -9267,7 +11582,7 @@ var CalendarFormField = (_a) => {
|
|
|
9267
11582
|
"onChange",
|
|
9268
11583
|
"allowPastDates"
|
|
9269
11584
|
]);
|
|
9270
|
-
const handleValidate =
|
|
11585
|
+
const handleValidate = useCallback5(
|
|
9271
11586
|
(value) => {
|
|
9272
11587
|
var _a2;
|
|
9273
11588
|
if (value === void 0 || value === null) {
|
|
@@ -9293,8 +11608,8 @@ var CalendarFormField = (_a) => {
|
|
|
9293
11608
|
const handleCalendarChange = (date) => {
|
|
9294
11609
|
setSelected(date);
|
|
9295
11610
|
};
|
|
9296
|
-
return /* @__PURE__ */
|
|
9297
|
-
label && /* @__PURE__ */
|
|
11611
|
+
return /* @__PURE__ */ jsxs28(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
11612
|
+
label && /* @__PURE__ */ jsx54(
|
|
9298
11613
|
FormLabel,
|
|
9299
11614
|
{
|
|
9300
11615
|
name,
|
|
@@ -9303,7 +11618,7 @@ var CalendarFormField = (_a) => {
|
|
|
9303
11618
|
haveError
|
|
9304
11619
|
}
|
|
9305
11620
|
),
|
|
9306
|
-
/* @__PURE__ */
|
|
11621
|
+
/* @__PURE__ */ jsx54(
|
|
9307
11622
|
Calendar,
|
|
9308
11623
|
__spreadValues({
|
|
9309
11624
|
selected,
|
|
@@ -9315,14 +11630,14 @@ var CalendarFormField = (_a) => {
|
|
|
9315
11630
|
allowPastDates
|
|
9316
11631
|
}, calendarProps)
|
|
9317
11632
|
),
|
|
9318
|
-
/* @__PURE__ */
|
|
11633
|
+
/* @__PURE__ */ jsx54(ErrorFormMessage, { message: errorMsg })
|
|
9319
11634
|
] });
|
|
9320
11635
|
};
|
|
9321
11636
|
|
|
9322
11637
|
// src/components/FormFields/TimePickerFormField.tsx
|
|
9323
11638
|
import { useController as useController5 } from "react-hook-form";
|
|
9324
|
-
import { useCallback as
|
|
9325
|
-
import { jsx as
|
|
11639
|
+
import { useCallback as useCallback6 } from "react";
|
|
11640
|
+
import { jsx as jsx55, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9326
11641
|
var TimePickerFormField = (_a) => {
|
|
9327
11642
|
var _b = _a, {
|
|
9328
11643
|
name,
|
|
@@ -9339,7 +11654,7 @@ var TimePickerFormField = (_a) => {
|
|
|
9339
11654
|
"validationErrorMessage",
|
|
9340
11655
|
"rules"
|
|
9341
11656
|
]);
|
|
9342
|
-
const handleValidate =
|
|
11657
|
+
const handleValidate = useCallback6(
|
|
9343
11658
|
(value) => {
|
|
9344
11659
|
var _a2;
|
|
9345
11660
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -9365,8 +11680,8 @@ var TimePickerFormField = (_a) => {
|
|
|
9365
11680
|
const handleTimePickerChange = (time) => {
|
|
9366
11681
|
setSelected(time);
|
|
9367
11682
|
};
|
|
9368
|
-
return /* @__PURE__ */
|
|
9369
|
-
label && /* @__PURE__ */
|
|
11683
|
+
return /* @__PURE__ */ jsxs29(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
11684
|
+
label && /* @__PURE__ */ jsx55(
|
|
9370
11685
|
FormLabel,
|
|
9371
11686
|
{
|
|
9372
11687
|
name,
|
|
@@ -9375,7 +11690,7 @@ var TimePickerFormField = (_a) => {
|
|
|
9375
11690
|
haveError
|
|
9376
11691
|
}
|
|
9377
11692
|
),
|
|
9378
|
-
/* @__PURE__ */
|
|
11693
|
+
/* @__PURE__ */ jsx55(
|
|
9379
11694
|
TimePicker,
|
|
9380
11695
|
__spreadValues({
|
|
9381
11696
|
selected,
|
|
@@ -9386,16 +11701,16 @@ var TimePickerFormField = (_a) => {
|
|
|
9386
11701
|
hasError: haveError
|
|
9387
11702
|
}, timePickerProps)
|
|
9388
11703
|
),
|
|
9389
|
-
/* @__PURE__ */
|
|
11704
|
+
/* @__PURE__ */ jsx55(ErrorFormMessage, { message: errorMsg })
|
|
9390
11705
|
] });
|
|
9391
11706
|
};
|
|
9392
11707
|
|
|
9393
11708
|
// src/hooks/useImageUpload.ts
|
|
9394
|
-
import { useState as
|
|
11709
|
+
import { useState as useState12, useCallback as useCallback7 } from "react";
|
|
9395
11710
|
var useImageUpload = (options) => {
|
|
9396
|
-
const [isUploading, setIsUploading] =
|
|
9397
|
-
const [progress, setProgress] =
|
|
9398
|
-
const [error, setError] =
|
|
11711
|
+
const [isUploading, setIsUploading] = useState12(false);
|
|
11712
|
+
const [progress, setProgress] = useState12(null);
|
|
11713
|
+
const [error, setError] = useState12(null);
|
|
9399
11714
|
const {
|
|
9400
11715
|
onSuccess,
|
|
9401
11716
|
onError,
|
|
@@ -9405,7 +11720,7 @@ var useImageUpload = (options) => {
|
|
|
9405
11720
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
9406
11721
|
uploadConfig
|
|
9407
11722
|
} = options;
|
|
9408
|
-
const validateFile =
|
|
11723
|
+
const validateFile = useCallback7(
|
|
9409
11724
|
(file) => {
|
|
9410
11725
|
if (!allowedTypes.includes(file.type)) {
|
|
9411
11726
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -9423,7 +11738,7 @@ var useImageUpload = (options) => {
|
|
|
9423
11738
|
},
|
|
9424
11739
|
[allowedTypes, maxFileSize, onError]
|
|
9425
11740
|
);
|
|
9426
|
-
const uploadFile =
|
|
11741
|
+
const uploadFile = useCallback7(
|
|
9427
11742
|
(file) => __async(null, null, function* () {
|
|
9428
11743
|
if (!validateFile(file)) {
|
|
9429
11744
|
return null;
|
|
@@ -9476,7 +11791,7 @@ var useImageUpload = (options) => {
|
|
|
9476
11791
|
}),
|
|
9477
11792
|
[validateFile, onSuccess, onError, onProgress]
|
|
9478
11793
|
);
|
|
9479
|
-
const reset =
|
|
11794
|
+
const reset = useCallback7(() => {
|
|
9480
11795
|
setIsUploading(false);
|
|
9481
11796
|
setProgress(null);
|
|
9482
11797
|
setError(null);
|
|
@@ -9530,7 +11845,7 @@ export {
|
|
|
9530
11845
|
ErrorFormMessage,
|
|
9531
11846
|
Filter,
|
|
9532
11847
|
FilterItem,
|
|
9533
|
-
Flex,
|
|
11848
|
+
Flex2 as Flex,
|
|
9534
11849
|
FlexStyled,
|
|
9535
11850
|
Form,
|
|
9536
11851
|
FormLabel,
|
|
@@ -9594,3 +11909,22 @@ export {
|
|
|
9594
11909
|
useImageUpload,
|
|
9595
11910
|
useToast
|
|
9596
11911
|
};
|
|
11912
|
+
/*! Bundled license information:
|
|
11913
|
+
|
|
11914
|
+
react-is/cjs/react-is.development.js:
|
|
11915
|
+
(** @license React v16.13.1
|
|
11916
|
+
* react-is.development.js
|
|
11917
|
+
*
|
|
11918
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11919
|
+
*
|
|
11920
|
+
* This source code is licensed under the MIT license found in the
|
|
11921
|
+
* LICENSE file in the root directory of this source tree.
|
|
11922
|
+
*)
|
|
11923
|
+
|
|
11924
|
+
object-assign/index.js:
|
|
11925
|
+
(*
|
|
11926
|
+
object-assign
|
|
11927
|
+
(c) Sindre Sorhus
|
|
11928
|
+
@license MIT
|
|
11929
|
+
*)
|
|
11930
|
+
*/
|