@clickpalm/react 1.2.17 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +566 -247
- package/dist/index.mjs +542 -222
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -364,7 +364,8 @@ import {
|
|
|
364
364
|
TriangleRightIcon as TriangleRight,
|
|
365
365
|
EyeClosedIcon as EyeClosed,
|
|
366
366
|
EyeOpenIcon as EyeOpen,
|
|
367
|
-
QuestionMarkIcon as QuestionMark
|
|
367
|
+
QuestionMarkIcon as QuestionMark,
|
|
368
|
+
ReloadIcon as Reload
|
|
368
369
|
} from "@radix-ui/react-icons";
|
|
369
370
|
|
|
370
371
|
// src/components/Icon/Svgs/Calendar.tsx
|
|
@@ -664,6 +665,7 @@ var iconMap = {
|
|
|
664
665
|
EyeClosed,
|
|
665
666
|
EyeOpen,
|
|
666
667
|
QuestionMark,
|
|
668
|
+
Reload,
|
|
667
669
|
Calendar,
|
|
668
670
|
Closed,
|
|
669
671
|
Dots,
|
|
@@ -1115,12 +1117,12 @@ Checkbox2.displayName = "Checkbox";
|
|
|
1115
1117
|
// src/components/Datepicker/index.tsx
|
|
1116
1118
|
import { format as format2 } from "date-fns";
|
|
1117
1119
|
import { ptBR as ptBR2 } from "date-fns/locale";
|
|
1118
|
-
import { forwardRef as forwardRef4, useEffect as
|
|
1120
|
+
import { forwardRef as forwardRef4, useEffect as useEffect3, useImperativeHandle, useRef as useRef4, useState as useState4 } from "react";
|
|
1119
1121
|
import { DayPicker as DayPicker2 } from "react-day-picker";
|
|
1120
1122
|
import "react-day-picker/dist/style.css";
|
|
1121
1123
|
|
|
1122
1124
|
// src/components/Input/index.tsx
|
|
1123
|
-
import React, { forwardRef as forwardRef3, useRef as useRef2 } from "react";
|
|
1125
|
+
import React, { forwardRef as forwardRef3, useRef as useRef2, useState as useState2 } from "react";
|
|
1124
1126
|
|
|
1125
1127
|
// src/components/Input/styles.ts
|
|
1126
1128
|
var StyledWrapper2 = styled("div", {
|
|
@@ -1146,7 +1148,8 @@ var TextInputContainer = styled("div", {
|
|
|
1146
1148
|
marginBottom: "$6",
|
|
1147
1149
|
FontSize: "$md",
|
|
1148
1150
|
"&:has(input:focus), &:hover": {
|
|
1149
|
-
border: "2px solid $clickpalm_light"
|
|
1151
|
+
border: "2px solid $clickpalm_light",
|
|
1152
|
+
padding: "calc($4 - 0.9px) calc($4 - 0.9px)"
|
|
1150
1153
|
},
|
|
1151
1154
|
"&:has(input:disabled)": {
|
|
1152
1155
|
opacity: 0.5,
|
|
@@ -1167,9 +1170,15 @@ var TextInputContainer = styled("div", {
|
|
|
1167
1170
|
border: "1px solid $danger_dark",
|
|
1168
1171
|
marginBottom: "0px",
|
|
1169
1172
|
"&:has(input:focus), &:hover": {
|
|
1170
|
-
border: "2px solid $danger_dark"
|
|
1173
|
+
border: "2px solid $danger_dark",
|
|
1174
|
+
padding: "calc($4 - 0.9px) calc($4 - 0.9px)"
|
|
1171
1175
|
}
|
|
1172
1176
|
}
|
|
1177
|
+
},
|
|
1178
|
+
hasCounter: {
|
|
1179
|
+
true: {
|
|
1180
|
+
marginBottom: "0px"
|
|
1181
|
+
}
|
|
1173
1182
|
}
|
|
1174
1183
|
}
|
|
1175
1184
|
});
|
|
@@ -1209,17 +1218,45 @@ var Span2 = styled("span", {
|
|
|
1209
1218
|
fontFamily: "$default",
|
|
1210
1219
|
fontWeight: "$regular",
|
|
1211
1220
|
fontSize: "$sm",
|
|
1221
|
+
textAlign: "left",
|
|
1212
1222
|
color: "$danger_dark",
|
|
1213
1223
|
alignSelf: "flex-start",
|
|
1214
1224
|
paddingLeft: "1px",
|
|
1215
1225
|
marginTop: "2px",
|
|
1216
|
-
marginBottom: "$6"
|
|
1226
|
+
marginBottom: "$6",
|
|
1227
|
+
flexShrink: 1,
|
|
1228
|
+
wordBreak: "break-word"
|
|
1229
|
+
});
|
|
1230
|
+
var Footer = styled("div", {
|
|
1231
|
+
display: "flex",
|
|
1232
|
+
justifyContent: "space-between",
|
|
1233
|
+
width: "100%",
|
|
1234
|
+
gap: "$2"
|
|
1235
|
+
});
|
|
1236
|
+
var CharCounter = styled(Span2, {
|
|
1237
|
+
fontFamily: "$default",
|
|
1238
|
+
fontWeight: "$regular",
|
|
1239
|
+
fontSize: "$sm",
|
|
1240
|
+
color: "$gray_mid",
|
|
1241
|
+
marginLeft: "auto",
|
|
1242
|
+
whiteSpace: "nowrap",
|
|
1243
|
+
paddingRight: "1px",
|
|
1244
|
+
marginTop: "2px",
|
|
1245
|
+
marginBottom: "$6",
|
|
1246
|
+
variants: {
|
|
1247
|
+
hasReachedMax: {
|
|
1248
|
+
true: {
|
|
1249
|
+
color: "$danger_dark"
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1217
1253
|
});
|
|
1218
1254
|
|
|
1219
1255
|
// src/components/Input/index.tsx
|
|
1220
1256
|
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1221
1257
|
var Input2 = forwardRef3(
|
|
1222
|
-
({ prefix, suffix, label, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1258
|
+
({ prefix, suffix, label, maxLength, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1259
|
+
const [charCount, setCharCount] = useState2(0);
|
|
1223
1260
|
const localInputRef = useRef2(null);
|
|
1224
1261
|
const inputRef = forwardedRef || localInputRef;
|
|
1225
1262
|
const handleContainerClick = () => {
|
|
@@ -1239,20 +1276,237 @@ var Input2 = forwardRef3(
|
|
|
1239
1276
|
hasButtonSuffix: isButtonElement(suffix),
|
|
1240
1277
|
noMargin,
|
|
1241
1278
|
hasError: !!errorMessage,
|
|
1279
|
+
hasCounter: !!maxLength,
|
|
1242
1280
|
onClick: handleContainerClick,
|
|
1243
1281
|
children: [
|
|
1244
1282
|
!!prefix && /* @__PURE__ */ jsx19(Prefix, { children: prefix }),
|
|
1245
|
-
/* @__PURE__ */ jsx19(
|
|
1283
|
+
/* @__PURE__ */ jsx19(
|
|
1284
|
+
Input,
|
|
1285
|
+
{
|
|
1286
|
+
ref: inputRef,
|
|
1287
|
+
...props,
|
|
1288
|
+
maxLength,
|
|
1289
|
+
onChange: (e) => {
|
|
1290
|
+
if (props.onChange) {
|
|
1291
|
+
props.onChange(e);
|
|
1292
|
+
}
|
|
1293
|
+
setCharCount(e.target.value.length);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
),
|
|
1246
1297
|
!!suffix && /* @__PURE__ */ jsx19(Suffix, { children: suffix })
|
|
1247
1298
|
]
|
|
1248
1299
|
}
|
|
1249
1300
|
),
|
|
1250
|
-
|
|
1301
|
+
/* @__PURE__ */ jsxs4(Footer, { children: [
|
|
1302
|
+
errorMessage && /* @__PURE__ */ jsx19(Span2, { children: errorMessage }),
|
|
1303
|
+
maxLength && /* @__PURE__ */ jsxs4(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
1304
|
+
charCount,
|
|
1305
|
+
"/",
|
|
1306
|
+
maxLength
|
|
1307
|
+
] })
|
|
1308
|
+
] })
|
|
1251
1309
|
] });
|
|
1252
1310
|
}
|
|
1253
1311
|
);
|
|
1254
1312
|
Input2.displayName = "Input";
|
|
1255
1313
|
|
|
1314
|
+
// src/components/Datepicker/CustomSelect/index.tsx
|
|
1315
|
+
import { useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
|
|
1316
|
+
|
|
1317
|
+
// src/components/Datepicker/CustomSelect/styles.ts
|
|
1318
|
+
var IconWrapper = styled("span", {
|
|
1319
|
+
display: "flex",
|
|
1320
|
+
alignItems: "center",
|
|
1321
|
+
justifyContent: "center",
|
|
1322
|
+
transition: "transform 0.3s ease"
|
|
1323
|
+
});
|
|
1324
|
+
var SelectValueButton = styled("button", {
|
|
1325
|
+
position: "relative",
|
|
1326
|
+
display: "flex",
|
|
1327
|
+
alignItems: "center",
|
|
1328
|
+
width: "100%",
|
|
1329
|
+
backgroundColor: "transparent",
|
|
1330
|
+
borderRadius: "8px",
|
|
1331
|
+
padding: "8px",
|
|
1332
|
+
fontSize: "16px",
|
|
1333
|
+
fontWeight: theme.fontWeights.bold,
|
|
1334
|
+
fontFamily: theme.fonts.default,
|
|
1335
|
+
textAlign: "left",
|
|
1336
|
+
cursor: "pointer",
|
|
1337
|
+
gap: theme.space[2],
|
|
1338
|
+
"&:hover, &:focus": {
|
|
1339
|
+
backgroundColor: "transparent",
|
|
1340
|
+
outline: "none",
|
|
1341
|
+
boxShadow: "none",
|
|
1342
|
+
border: `2px solid ${theme.colors.gray_mid}`
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
var SelectOptionsList = styled("ul", {
|
|
1346
|
+
position: "absolute",
|
|
1347
|
+
top: "100%",
|
|
1348
|
+
left: 0,
|
|
1349
|
+
right: 0,
|
|
1350
|
+
backgroundColor: theme.colors.gray_background,
|
|
1351
|
+
border: `2px solid ${theme.colors.white}`,
|
|
1352
|
+
borderRadius: "8px",
|
|
1353
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
1354
|
+
listStyle: "none",
|
|
1355
|
+
margin: "4px 0 0",
|
|
1356
|
+
padding: "0 12px",
|
|
1357
|
+
zIndex: 10,
|
|
1358
|
+
maxHeight: "200px",
|
|
1359
|
+
overflowY: "auto",
|
|
1360
|
+
fontFamily: theme.fonts.default,
|
|
1361
|
+
fontWeight: theme.fontWeights.regular,
|
|
1362
|
+
textAlign: "left",
|
|
1363
|
+
width: "100%",
|
|
1364
|
+
"&::-webkit-scrollbar": {
|
|
1365
|
+
width: "8px"
|
|
1366
|
+
},
|
|
1367
|
+
"&::-webkit-scrollbar-track": {
|
|
1368
|
+
background: theme.colors.gray_light,
|
|
1369
|
+
borderRadius: "8px"
|
|
1370
|
+
},
|
|
1371
|
+
"&::-webkit-scrollbar-thumb": {
|
|
1372
|
+
backgroundColor: theme.colors.clickpalm_light,
|
|
1373
|
+
borderRadius: "8px"
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
var SelectOptionItem = styled("li", {
|
|
1377
|
+
padding: "12px 0",
|
|
1378
|
+
color: theme.colors.black,
|
|
1379
|
+
cursor: "pointer",
|
|
1380
|
+
borderBottom: `1px solid ${theme.colors.gray_mid}`,
|
|
1381
|
+
"&:last-child": {
|
|
1382
|
+
borderBottom: "none"
|
|
1383
|
+
},
|
|
1384
|
+
"&:hover": {
|
|
1385
|
+
backgroundColor: theme.colors.gray_background,
|
|
1386
|
+
color: theme.colors.clickpalm_mid
|
|
1387
|
+
},
|
|
1388
|
+
variants: {
|
|
1389
|
+
selected: {
|
|
1390
|
+
true: {
|
|
1391
|
+
backgroundColor: theme.colors.gray_background,
|
|
1392
|
+
color: theme.colors.clickpalm_mid
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
var SelectContainer = styled("div", {
|
|
1398
|
+
position: "relative",
|
|
1399
|
+
width: "100%",
|
|
1400
|
+
maxWidth: "130px",
|
|
1401
|
+
variants: {
|
|
1402
|
+
isOpen: {
|
|
1403
|
+
true: {
|
|
1404
|
+
[`& ${IconWrapper}`]: {
|
|
1405
|
+
transform: "rotate(180deg)"
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
color: {
|
|
1410
|
+
white: {
|
|
1411
|
+
[`& ${SelectValueButton}`]: {
|
|
1412
|
+
color: theme.colors.white,
|
|
1413
|
+
border: `2px solid ${theme.colors.white}`
|
|
1414
|
+
},
|
|
1415
|
+
[`& ${IconWrapper}`]: {
|
|
1416
|
+
color: theme.colors.white
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
black: {
|
|
1420
|
+
marginBottom: 0,
|
|
1421
|
+
[`& ${SelectValueButton}`]: {
|
|
1422
|
+
color: theme.colors.black,
|
|
1423
|
+
border: "1px solid transparent"
|
|
1424
|
+
},
|
|
1425
|
+
[`& ${IconWrapper}`]: {
|
|
1426
|
+
color: theme.colors.black
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
// src/components/Datepicker/CustomSelect/index.tsx
|
|
1434
|
+
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1435
|
+
var CustomSelect = ({
|
|
1436
|
+
options = [],
|
|
1437
|
+
value,
|
|
1438
|
+
onChange,
|
|
1439
|
+
color = "white"
|
|
1440
|
+
}) => {
|
|
1441
|
+
const [isOpen, setIsOpen] = useState3(false);
|
|
1442
|
+
const selectRef = useRef3(null);
|
|
1443
|
+
const handleToggle = () => setIsOpen(!isOpen);
|
|
1444
|
+
const handleOptionClick = (optionValue) => {
|
|
1445
|
+
if (onChange) {
|
|
1446
|
+
onChange(optionValue);
|
|
1447
|
+
}
|
|
1448
|
+
setIsOpen(false);
|
|
1449
|
+
};
|
|
1450
|
+
useEffect2(() => {
|
|
1451
|
+
const handleClickOutside = (event) => {
|
|
1452
|
+
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
1453
|
+
setIsOpen(false);
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1457
|
+
return () => {
|
|
1458
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1459
|
+
};
|
|
1460
|
+
}, []);
|
|
1461
|
+
const safeValue = value ?? "";
|
|
1462
|
+
const selectedLabel = options.find((opt) => opt.value === safeValue)?.label || safeValue;
|
|
1463
|
+
return /* @__PURE__ */ jsxs5(SelectContainer, { color, isOpen, ref: selectRef, children: [
|
|
1464
|
+
/* @__PURE__ */ jsxs5(SelectValueButton, { onClick: handleToggle, children: [
|
|
1465
|
+
selectedLabel,
|
|
1466
|
+
/* @__PURE__ */ jsx20(IconWrapper, { children: /* @__PURE__ */ jsx20(Icon, { name: "TriangleDown", size: 16 }) })
|
|
1467
|
+
] }),
|
|
1468
|
+
isOpen && /* @__PURE__ */ jsx20(SelectOptionsList, { onMouseDown: (e) => e.preventDefault(), children: options.map((option) => /* @__PURE__ */ jsx20(
|
|
1469
|
+
SelectOptionItem,
|
|
1470
|
+
{
|
|
1471
|
+
selected: option.value === value,
|
|
1472
|
+
onClick: () => handleOptionClick(option.value),
|
|
1473
|
+
children: option.label
|
|
1474
|
+
},
|
|
1475
|
+
option.value
|
|
1476
|
+
)) })
|
|
1477
|
+
] });
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
// src/components/Datepicker/DatePickerSelectAdapter.tsx
|
|
1481
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1482
|
+
function DatePickerSelectAdapter(props) {
|
|
1483
|
+
const { options, value, onChange } = props;
|
|
1484
|
+
const handleValueChange = (newValue) => {
|
|
1485
|
+
if (onChange) {
|
|
1486
|
+
const syntheticEvent = {
|
|
1487
|
+
target: { value: newValue }
|
|
1488
|
+
};
|
|
1489
|
+
onChange(syntheticEvent);
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
const selectOptions = options?.map((option) => {
|
|
1493
|
+
const label = typeof option.label === "string" ? option.label.charAt(0).toUpperCase() + option.label.slice(1) : option.label;
|
|
1494
|
+
return {
|
|
1495
|
+
label,
|
|
1496
|
+
value: option.value?.toString() ?? ""
|
|
1497
|
+
};
|
|
1498
|
+
}) || [];
|
|
1499
|
+
return /* @__PURE__ */ jsx21(
|
|
1500
|
+
CustomSelect,
|
|
1501
|
+
{
|
|
1502
|
+
color: "black",
|
|
1503
|
+
options: selectOptions,
|
|
1504
|
+
value: value?.toString() || "",
|
|
1505
|
+
onChange: handleValueChange
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1256
1510
|
// src/components/Datepicker/styles.ts
|
|
1257
1511
|
var datePickerStyles = globalCss({
|
|
1258
1512
|
".rdp-root": {
|
|
@@ -1280,7 +1534,8 @@ var datePickerStyles = globalCss({
|
|
|
1280
1534
|
paddingLeft: "15px"
|
|
1281
1535
|
},
|
|
1282
1536
|
".rdp-caption_label": {
|
|
1283
|
-
paddingLeft: theme.space[1]
|
|
1537
|
+
paddingLeft: theme.space[1],
|
|
1538
|
+
textTransform: "capitalize"
|
|
1284
1539
|
},
|
|
1285
1540
|
".rdp-nav": {
|
|
1286
1541
|
gap: theme.space[1]
|
|
@@ -1312,17 +1567,46 @@ var datePickerStyles = globalCss({
|
|
|
1312
1567
|
background: theme.colors.clickpalm_light,
|
|
1313
1568
|
color: theme.colors.white
|
|
1314
1569
|
}
|
|
1570
|
+
// '.rdp-caption_dropdowns': {
|
|
1571
|
+
// display: 'flex',
|
|
1572
|
+
// gap: theme.space[2],
|
|
1573
|
+
// },
|
|
1574
|
+
// '.rdp-dropdown': {
|
|
1575
|
+
// padding: '6px 8px',
|
|
1576
|
+
// fontFamily: theme.fonts.default,
|
|
1577
|
+
// fontSize: theme.fontSizes.sm,
|
|
1578
|
+
// color: theme.colors.black,
|
|
1579
|
+
// border: `1px solid ${theme.colors.gray_light}`,
|
|
1580
|
+
// borderRadius: theme.radii.md,
|
|
1581
|
+
// backgroundColor: theme.colors.white,
|
|
1582
|
+
// appearance: 'none',
|
|
1583
|
+
// backgroundRepeat: 'no-repeat',
|
|
1584
|
+
// backgroundPosition: `right ${theme.space[2]} center`,
|
|
1585
|
+
// backgroundSize: '1em',
|
|
1586
|
+
// '&:focus, &:hover': {
|
|
1587
|
+
// outline: 'none',
|
|
1588
|
+
// borderColor: theme.colors.clickpalm_light,
|
|
1589
|
+
// },
|
|
1590
|
+
// '& option:checked': {
|
|
1591
|
+
// backgroundColor: theme.colors.clickpalm_light,
|
|
1592
|
+
// color: theme.colors.white,
|
|
1593
|
+
// },
|
|
1594
|
+
// '& option:hover': {
|
|
1595
|
+
// backgroundColor: theme.colors.gray_background,
|
|
1596
|
+
// color: theme.colors.black,
|
|
1597
|
+
// },
|
|
1598
|
+
// },
|
|
1315
1599
|
});
|
|
1316
1600
|
|
|
1317
1601
|
// src/components/Datepicker/index.tsx
|
|
1318
|
-
import { jsx as
|
|
1602
|
+
import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1319
1603
|
datePickerStyles();
|
|
1320
|
-
var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) => {
|
|
1321
|
-
const [selected, setSelected] =
|
|
1322
|
-
const [month, setMonth] =
|
|
1323
|
-
const [open, setOpen] =
|
|
1324
|
-
const inputRef =
|
|
1325
|
-
const calendarRef =
|
|
1604
|
+
var Datepicker = forwardRef4(({ label, placeholder, value, onChange, errorMessage }, ref) => {
|
|
1605
|
+
const [selected, setSelected] = useState4(void 0);
|
|
1606
|
+
const [month, setMonth] = useState4(/* @__PURE__ */ new Date());
|
|
1607
|
+
const [open, setOpen] = useState4(false);
|
|
1608
|
+
const inputRef = useRef4(null);
|
|
1609
|
+
const calendarRef = useRef4(null);
|
|
1326
1610
|
useImperativeHandle(ref, () => inputRef.current);
|
|
1327
1611
|
const handleDaySelect = (date) => {
|
|
1328
1612
|
setSelected(date);
|
|
@@ -1332,7 +1616,7 @@ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) =>
|
|
|
1332
1616
|
}
|
|
1333
1617
|
setOpen(false);
|
|
1334
1618
|
};
|
|
1335
|
-
|
|
1619
|
+
useEffect3(() => {
|
|
1336
1620
|
const handleClickOutside = (event) => {
|
|
1337
1621
|
if (calendarRef.current && !calendarRef.current.contains(event.target) && inputRef.current && !inputRef.current.contains(event.target)) {
|
|
1338
1622
|
setOpen(false);
|
|
@@ -1341,26 +1625,27 @@ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) =>
|
|
|
1341
1625
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1342
1626
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1343
1627
|
}, []);
|
|
1344
|
-
|
|
1628
|
+
useEffect3(() => {
|
|
1345
1629
|
if (!open && selected) {
|
|
1346
1630
|
setMonth(selected);
|
|
1347
1631
|
}
|
|
1348
1632
|
}, [open, selected]);
|
|
1349
|
-
return /* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsxs6("div", { children: [
|
|
1634
|
+
/* @__PURE__ */ jsx22(
|
|
1351
1635
|
Input2,
|
|
1352
1636
|
{
|
|
1353
1637
|
ref: inputRef,
|
|
1354
1638
|
label,
|
|
1355
|
-
placeholder
|
|
1639
|
+
placeholder,
|
|
1356
1640
|
onFocus: () => setOpen(true),
|
|
1357
1641
|
value: value || "",
|
|
1358
1642
|
readOnly: true,
|
|
1359
|
-
suffix: /* @__PURE__ */
|
|
1360
|
-
errorMessage
|
|
1643
|
+
suffix: /* @__PURE__ */ jsx22(Icon, { name: "Calendar", size: 16 }),
|
|
1644
|
+
errorMessage,
|
|
1645
|
+
noMargin: true
|
|
1361
1646
|
}
|
|
1362
1647
|
),
|
|
1363
|
-
open && /* @__PURE__ */
|
|
1648
|
+
open && /* @__PURE__ */ jsx22(
|
|
1364
1649
|
"div",
|
|
1365
1650
|
{
|
|
1366
1651
|
ref: calendarRef,
|
|
@@ -1372,7 +1657,7 @@ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) =>
|
|
|
1372
1657
|
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
1373
1658
|
borderRadius: "8px"
|
|
1374
1659
|
},
|
|
1375
|
-
children: /* @__PURE__ */
|
|
1660
|
+
children: /* @__PURE__ */ jsx22(
|
|
1376
1661
|
DayPicker2,
|
|
1377
1662
|
{
|
|
1378
1663
|
mode: "single",
|
|
@@ -1382,20 +1667,13 @@ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) =>
|
|
|
1382
1667
|
onMonthChange: setMonth,
|
|
1383
1668
|
locale: ptBR2,
|
|
1384
1669
|
showOutsideDays: true,
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
const ano = format2(month2, "yyyy", options);
|
|
1389
|
-
return `${mes} de ${ano}`;
|
|
1390
|
-
},
|
|
1391
|
-
formatWeekdayName: (date, options) => {
|
|
1392
|
-
const dia = format2(date, "EEEEEE", options);
|
|
1393
|
-
return dia.charAt(0).toUpperCase() + dia.slice(1);
|
|
1394
|
-
}
|
|
1395
|
-
},
|
|
1670
|
+
captionLayout: "dropdown",
|
|
1671
|
+
startMonth: new Date(1915, 0),
|
|
1672
|
+
endMonth: /* @__PURE__ */ new Date(),
|
|
1396
1673
|
components: {
|
|
1397
|
-
PreviousMonthButton: (props) => /* @__PURE__ */
|
|
1398
|
-
NextMonthButton: (props) => /* @__PURE__ */
|
|
1674
|
+
PreviousMonthButton: (props) => /* @__PURE__ */ jsx22(Button, { size: "sm", variant: "secondary", ...props, children: /* @__PURE__ */ jsx22(Icon, { name: "TriangleLeft", size: 16 }) }),
|
|
1675
|
+
NextMonthButton: (props) => /* @__PURE__ */ jsx22(Button, { size: "sm", variant: "secondary", ...props, children: /* @__PURE__ */ jsx22(Icon, { name: "TriangleRight", size: 16 }) }),
|
|
1676
|
+
Dropdown: DatePickerSelectAdapter
|
|
1399
1677
|
}
|
|
1400
1678
|
}
|
|
1401
1679
|
)
|
|
@@ -1407,7 +1685,7 @@ Datepicker.displayName = "Datepicker";
|
|
|
1407
1685
|
|
|
1408
1686
|
// src/components/Hr.tsx
|
|
1409
1687
|
import { forwardRef as forwardRef5 } from "react";
|
|
1410
|
-
import { jsx as
|
|
1688
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1411
1689
|
var StyledHr = styled("hr", {
|
|
1412
1690
|
border: "none",
|
|
1413
1691
|
height: "1px",
|
|
@@ -1424,7 +1702,7 @@ var StyledHr = styled("hr", {
|
|
|
1424
1702
|
}
|
|
1425
1703
|
});
|
|
1426
1704
|
var Hr = forwardRef5(function Hr2({ children, ...props }, ref) {
|
|
1427
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ jsx23(StyledHr, { ref, ...props, children });
|
|
1428
1706
|
});
|
|
1429
1707
|
Hr.displayName = "Hr";
|
|
1430
1708
|
|
|
@@ -1501,26 +1779,26 @@ var StyledChildren = styled("div", {
|
|
|
1501
1779
|
});
|
|
1502
1780
|
|
|
1503
1781
|
// src/components/Modal/index.tsx
|
|
1504
|
-
import { jsx as
|
|
1782
|
+
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1505
1783
|
var Modal = ({ open, onOpenChange, title, description, children }) => {
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1511
|
-
/* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx24(Dialog2.Root, { open, onOpenChange, modal: true, children: /* @__PURE__ */ jsxs7(Dialog2.Portal, { children: [
|
|
1785
|
+
/* @__PURE__ */ jsx24(StyledOverlay, {}),
|
|
1786
|
+
/* @__PURE__ */ jsxs7(StyledContent, { children: [
|
|
1787
|
+
/* @__PURE__ */ jsxs7(Wrapper, { children: [
|
|
1788
|
+
/* @__PURE__ */ jsx24(StyledTitle, { children: title }),
|
|
1789
|
+
/* @__PURE__ */ jsx24(StyledClose, { asChild: true, "aria-label": "Close", children: /* @__PURE__ */ jsx24(Button, { variant: "secondary", size: "sm", children: /* @__PURE__ */ jsx24(Icon, { name: "Closed", size: 8 }) }) })
|
|
1512
1790
|
] }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
description && /* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ jsx24(StyledDivider, {}),
|
|
1792
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1793
|
+
description && /* @__PURE__ */ jsx24(StyledDescription, { children: description }),
|
|
1794
|
+
/* @__PURE__ */ jsx24(StyledChildren, { children })
|
|
1517
1795
|
] })
|
|
1518
1796
|
] })
|
|
1519
1797
|
] }) });
|
|
1520
1798
|
};
|
|
1521
1799
|
|
|
1522
1800
|
// src/components/ProgressBar/index.tsx
|
|
1523
|
-
import { useEffect as
|
|
1801
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1524
1802
|
|
|
1525
1803
|
// src/components/ProgressBar/styles.ts
|
|
1526
1804
|
import * as Progress from "@radix-ui/react-progress";
|
|
@@ -1550,23 +1828,23 @@ var StyledIndicator = styled(Progress.Indicator, {
|
|
|
1550
1828
|
});
|
|
1551
1829
|
|
|
1552
1830
|
// src/components/ProgressBar/index.tsx
|
|
1553
|
-
import { jsx as
|
|
1831
|
+
import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1554
1832
|
var ProgressBar = ({ label, value = 0, max = 100, ...rest }) => {
|
|
1555
|
-
const [progress2, setProgress] =
|
|
1556
|
-
|
|
1833
|
+
const [progress2, setProgress] = useState5(0);
|
|
1834
|
+
useEffect4(() => {
|
|
1557
1835
|
const timer = setTimeout(() => setProgress(value), 500);
|
|
1558
1836
|
return () => clearTimeout(timer);
|
|
1559
1837
|
}, [value]);
|
|
1560
1838
|
const valueLabel = `${Math.round(progress2 / max * 100)}%`;
|
|
1561
|
-
return /* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ jsxs8(StyledWrapper3, { children: [
|
|
1840
|
+
/* @__PURE__ */ jsx25("label", { style: { fontSize: 16, alignSelf: "flex-start", color: "black" }, children: label }),
|
|
1841
|
+
/* @__PURE__ */ jsx25(
|
|
1564
1842
|
StyledRoot,
|
|
1565
1843
|
{
|
|
1566
1844
|
value: progress2,
|
|
1567
1845
|
"aria-valuetext": valueLabel,
|
|
1568
1846
|
...rest,
|
|
1569
|
-
children: /* @__PURE__ */
|
|
1847
|
+
children: /* @__PURE__ */ jsx25(
|
|
1570
1848
|
StyledIndicator,
|
|
1571
1849
|
{
|
|
1572
1850
|
style: { transform: `translateX(-${100 - progress2}%)` }
|
|
@@ -1673,7 +1951,7 @@ var Span3 = styled("span", {
|
|
|
1673
1951
|
});
|
|
1674
1952
|
|
|
1675
1953
|
// src/components/Radio/index.tsx
|
|
1676
|
-
import { jsx as
|
|
1954
|
+
import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1677
1955
|
var Radio = forwardRef6(({
|
|
1678
1956
|
labels,
|
|
1679
1957
|
value,
|
|
@@ -1682,8 +1960,8 @@ var Radio = forwardRef6(({
|
|
|
1682
1960
|
required = false,
|
|
1683
1961
|
errorMessage
|
|
1684
1962
|
}, ref) => {
|
|
1685
|
-
return /* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1963
|
+
return /* @__PURE__ */ jsxs9("form", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start" }, children: [
|
|
1964
|
+
/* @__PURE__ */ jsx26(
|
|
1687
1965
|
StyledRoot2,
|
|
1688
1966
|
{
|
|
1689
1967
|
ref,
|
|
@@ -1693,28 +1971,28 @@ var Radio = forwardRef6(({
|
|
|
1693
1971
|
disabled,
|
|
1694
1972
|
required,
|
|
1695
1973
|
loop: true,
|
|
1696
|
-
children: labels.map((label, index) => /* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1974
|
+
children: labels.map((label, index) => /* @__PURE__ */ jsxs9(Wrapper2, { children: [
|
|
1975
|
+
/* @__PURE__ */ jsx26(
|
|
1698
1976
|
StyledItem,
|
|
1699
1977
|
{
|
|
1700
1978
|
value: label,
|
|
1701
1979
|
id: `radio-${index}`,
|
|
1702
1980
|
"aria-label": label,
|
|
1703
1981
|
hasError: !!errorMessage,
|
|
1704
|
-
children: /* @__PURE__ */
|
|
1982
|
+
children: /* @__PURE__ */ jsx26(StyledIndicator2, {})
|
|
1705
1983
|
}
|
|
1706
1984
|
),
|
|
1707
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ jsx26(ItemLabel, { htmlFor: `radio-${index}`, children: label })
|
|
1708
1986
|
] }, label))
|
|
1709
1987
|
}
|
|
1710
1988
|
),
|
|
1711
|
-
errorMessage && /* @__PURE__ */
|
|
1989
|
+
errorMessage && /* @__PURE__ */ jsx26(Span3, { children: errorMessage })
|
|
1712
1990
|
] });
|
|
1713
1991
|
});
|
|
1714
1992
|
Radio.displayName = "Radio";
|
|
1715
1993
|
|
|
1716
1994
|
// src/components/Spacing.tsx
|
|
1717
|
-
import { jsx as
|
|
1995
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1718
1996
|
var spacingMap = {
|
|
1719
1997
|
xs: 8,
|
|
1720
1998
|
sm: 12,
|
|
@@ -1726,7 +2004,7 @@ var spacingMap = {
|
|
|
1726
2004
|
};
|
|
1727
2005
|
var Spacing = ({ size, axis = "vertical" }) => {
|
|
1728
2006
|
const style = axis === "vertical" ? { height: spacingMap[size], width: "100%" } : { width: spacingMap[size], height: "100%" };
|
|
1729
|
-
return /* @__PURE__ */
|
|
2007
|
+
return /* @__PURE__ */ jsx27("div", { style, "data-testid": `spacing-${size}-${axis}` });
|
|
1730
2008
|
};
|
|
1731
2009
|
|
|
1732
2010
|
// src/components/Switch/index.tsx
|
|
@@ -1827,7 +2105,7 @@ var Span4 = styled("span", {
|
|
|
1827
2105
|
});
|
|
1828
2106
|
|
|
1829
2107
|
// src/components/Switch/index.tsx
|
|
1830
|
-
import { jsx as
|
|
2108
|
+
import { jsx as jsx28, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1831
2109
|
var Switch2 = forwardRef7(({
|
|
1832
2110
|
label,
|
|
1833
2111
|
checked,
|
|
@@ -1838,9 +2116,9 @@ var Switch2 = forwardRef7(({
|
|
|
1838
2116
|
id,
|
|
1839
2117
|
errorMessage
|
|
1840
2118
|
}, ref) => {
|
|
1841
|
-
return /* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start" }, children: [
|
|
2120
|
+
/* @__PURE__ */ jsxs10(Wrapper3, { hasError: !!errorMessage, children: [
|
|
2121
|
+
/* @__PURE__ */ jsx28(
|
|
1844
2122
|
StyledRoot3,
|
|
1845
2123
|
{
|
|
1846
2124
|
ref,
|
|
@@ -1851,18 +2129,18 @@ var Switch2 = forwardRef7(({
|
|
|
1851
2129
|
hasError: !!errorMessage,
|
|
1852
2130
|
disabled,
|
|
1853
2131
|
required,
|
|
1854
|
-
children: /* @__PURE__ */
|
|
2132
|
+
children: /* @__PURE__ */ jsx28(StyledThumb, {})
|
|
1855
2133
|
}
|
|
1856
2134
|
),
|
|
1857
|
-
label && /* @__PURE__ */
|
|
2135
|
+
label && /* @__PURE__ */ jsx28(Label2, { htmlFor: id, children: label })
|
|
1858
2136
|
] }),
|
|
1859
|
-
errorMessage && /* @__PURE__ */
|
|
2137
|
+
errorMessage && /* @__PURE__ */ jsx28(Span4, { children: errorMessage })
|
|
1860
2138
|
] });
|
|
1861
2139
|
});
|
|
1862
2140
|
Switch2.displayName = "Switch";
|
|
1863
2141
|
|
|
1864
2142
|
// src/components/Tabs/index.tsx
|
|
1865
|
-
import { Children, isValidElement, useLayoutEffect, useRef as
|
|
2143
|
+
import { Children, isValidElement, useLayoutEffect, useRef as useRef5, useState as useState6 } from "react";
|
|
1866
2144
|
|
|
1867
2145
|
// src/components/Tabs/styles.ts
|
|
1868
2146
|
import * as Tabs from "@radix-ui/react-tabs";
|
|
@@ -1943,9 +2221,9 @@ var TabsContent = styled(Tabs.Content, {
|
|
|
1943
2221
|
});
|
|
1944
2222
|
|
|
1945
2223
|
// src/components/Tabs/index.tsx
|
|
1946
|
-
import { Fragment, jsx as
|
|
2224
|
+
import { Fragment, jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1947
2225
|
var TabsItem = ({ children }) => {
|
|
1948
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx29(Fragment, { children });
|
|
1949
2227
|
};
|
|
1950
2228
|
var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) => {
|
|
1951
2229
|
const items = [];
|
|
@@ -1956,10 +2234,10 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
1956
2234
|
items.push({ value: value2, label, forceMount, children: content });
|
|
1957
2235
|
}
|
|
1958
2236
|
});
|
|
1959
|
-
const listRef =
|
|
1960
|
-
const rootRef =
|
|
1961
|
-
const hasOverflowRef =
|
|
1962
|
-
const [hasOverflow, setHasOverflow] =
|
|
2237
|
+
const listRef = useRef5(null);
|
|
2238
|
+
const rootRef = useRef5(null);
|
|
2239
|
+
const hasOverflowRef = useRef5(false);
|
|
2240
|
+
const [hasOverflow, setHasOverflow] = useState6(false);
|
|
1963
2241
|
const checkOverflow = () => {
|
|
1964
2242
|
const listEl = listRef.current;
|
|
1965
2243
|
const rootEl = rootRef.current;
|
|
@@ -1995,7 +2273,7 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
1995
2273
|
});
|
|
1996
2274
|
}
|
|
1997
2275
|
};
|
|
1998
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ jsxs11(
|
|
1999
2277
|
TabsRoot,
|
|
2000
2278
|
{
|
|
2001
2279
|
defaultValue: defaultValue || items[0]?.value,
|
|
@@ -2003,22 +2281,22 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2003
2281
|
value,
|
|
2004
2282
|
onValueChange,
|
|
2005
2283
|
children: [
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
hasOverflow && /* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2285
|
+
hasOverflow && /* @__PURE__ */ jsx29(
|
|
2008
2286
|
Button,
|
|
2009
2287
|
{
|
|
2010
2288
|
variant: "secondary",
|
|
2011
2289
|
size: "sm",
|
|
2012
2290
|
onClick: () => scroll("left"),
|
|
2013
|
-
children: /* @__PURE__ */
|
|
2291
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "TriangleLeft", size: 64 })
|
|
2014
2292
|
}
|
|
2015
2293
|
),
|
|
2016
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx29(
|
|
2017
2295
|
TabsList,
|
|
2018
2296
|
{
|
|
2019
2297
|
ref: listRef,
|
|
2020
2298
|
scrollable: hasOverflow,
|
|
2021
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2299
|
+
children: items.map((item) => /* @__PURE__ */ jsx29(
|
|
2022
2300
|
TabsTrigger,
|
|
2023
2301
|
{
|
|
2024
2302
|
value: item.value,
|
|
@@ -2029,17 +2307,17 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2029
2307
|
))
|
|
2030
2308
|
}
|
|
2031
2309
|
),
|
|
2032
|
-
hasOverflow && /* @__PURE__ */
|
|
2310
|
+
hasOverflow && /* @__PURE__ */ jsx29(
|
|
2033
2311
|
Button,
|
|
2034
2312
|
{
|
|
2035
2313
|
variant: "secondary",
|
|
2036
2314
|
size: "sm",
|
|
2037
2315
|
onClick: () => scroll("right"),
|
|
2038
|
-
children: /* @__PURE__ */
|
|
2316
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "TriangleRight", size: 64 })
|
|
2039
2317
|
}
|
|
2040
2318
|
)
|
|
2041
2319
|
] }),
|
|
2042
|
-
items.map((item) => /* @__PURE__ */
|
|
2320
|
+
items.map((item) => /* @__PURE__ */ jsx29(
|
|
2043
2321
|
TabsContent,
|
|
2044
2322
|
{
|
|
2045
2323
|
colorContent,
|
|
@@ -2056,8 +2334,8 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2056
2334
|
Tabs2.Item = TabsItem;
|
|
2057
2335
|
|
|
2058
2336
|
// src/components/TextArea.tsx
|
|
2059
|
-
import { forwardRef as forwardRef8 } from "react";
|
|
2060
|
-
import { jsx as
|
|
2337
|
+
import { forwardRef as forwardRef8, useState as useState7 } from "react";
|
|
2338
|
+
import { jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2061
2339
|
var Wrapper4 = styled("div", {
|
|
2062
2340
|
display: "flex",
|
|
2063
2341
|
flexDirection: "column"
|
|
@@ -2081,9 +2359,8 @@ var TextAreaElement = styled("textarea", {
|
|
|
2081
2359
|
fontSize: "$sm",
|
|
2082
2360
|
color: "$black",
|
|
2083
2361
|
fontWeight: "$regular",
|
|
2084
|
-
resize: "
|
|
2085
|
-
minHeight:
|
|
2086
|
-
maxHeight: "170px",
|
|
2362
|
+
resize: "vertical",
|
|
2363
|
+
minHeight: "100px",
|
|
2087
2364
|
overflowY: "auto",
|
|
2088
2365
|
width: "100%",
|
|
2089
2366
|
"&:focus": {
|
|
@@ -2119,6 +2396,11 @@ var TextAreaElement = styled("textarea", {
|
|
|
2119
2396
|
border: "2px solid $danger_dark"
|
|
2120
2397
|
}
|
|
2121
2398
|
}
|
|
2399
|
+
},
|
|
2400
|
+
hasCounter: {
|
|
2401
|
+
true: {
|
|
2402
|
+
marginBottom: "0px"
|
|
2403
|
+
}
|
|
2122
2404
|
}
|
|
2123
2405
|
}
|
|
2124
2406
|
});
|
|
@@ -2126,27 +2408,70 @@ var Span5 = styled("span", {
|
|
|
2126
2408
|
fontFamily: "$default",
|
|
2127
2409
|
fontWeight: "$regular",
|
|
2128
2410
|
fontSize: "$sm",
|
|
2411
|
+
textAlign: "left",
|
|
2129
2412
|
color: "$danger_dark",
|
|
2130
2413
|
alignSelf: "flex-start",
|
|
2131
2414
|
paddingLeft: "1px",
|
|
2132
2415
|
marginTop: "2px",
|
|
2133
|
-
marginBottom: "$6"
|
|
2416
|
+
marginBottom: "$6",
|
|
2417
|
+
flexShrink: 1,
|
|
2418
|
+
wordBreak: "break-word"
|
|
2419
|
+
});
|
|
2420
|
+
var Footer2 = styled("div", {
|
|
2421
|
+
display: "flex",
|
|
2422
|
+
justifyContent: "space-between",
|
|
2423
|
+
width: "100%",
|
|
2424
|
+
gap: "$2"
|
|
2425
|
+
});
|
|
2426
|
+
var CharCounter2 = styled(Span5, {
|
|
2427
|
+
fontFamily: "$default",
|
|
2428
|
+
fontWeight: "$regular",
|
|
2429
|
+
fontSize: "$sm",
|
|
2430
|
+
color: "$gray_mid",
|
|
2431
|
+
marginLeft: "auto",
|
|
2432
|
+
whiteSpace: "nowrap",
|
|
2433
|
+
paddingRight: "1px",
|
|
2434
|
+
marginTop: "2px",
|
|
2435
|
+
marginBottom: "$6",
|
|
2436
|
+
variants: {
|
|
2437
|
+
hasReachedMax: {
|
|
2438
|
+
true: {
|
|
2439
|
+
color: "$danger_dark"
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2134
2443
|
});
|
|
2135
2444
|
var TextArea = forwardRef8(
|
|
2136
|
-
({ label, id, htmlFor, errorMessage, ...props }, ref) => {
|
|
2445
|
+
({ label, id, htmlFor, errorMessage, maxLength, ...props }, ref) => {
|
|
2137
2446
|
const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
/* @__PURE__ */
|
|
2447
|
+
const [charCount, setCharCount] = useState7(0);
|
|
2448
|
+
return /* @__PURE__ */ jsxs12(Wrapper4, { children: [
|
|
2449
|
+
label && /* @__PURE__ */ jsx30(StyledLabel2, { htmlFor: textAreaId, children: label }),
|
|
2450
|
+
/* @__PURE__ */ jsx30(
|
|
2141
2451
|
TextAreaElement,
|
|
2142
2452
|
{
|
|
2143
2453
|
id: textAreaId,
|
|
2144
2454
|
...props,
|
|
2145
2455
|
hasError: !!errorMessage,
|
|
2146
|
-
|
|
2456
|
+
hasCounter: !!maxLength,
|
|
2457
|
+
ref,
|
|
2458
|
+
maxLength,
|
|
2459
|
+
onChange: (e) => {
|
|
2460
|
+
if (props.onChange) {
|
|
2461
|
+
props.onChange(e);
|
|
2462
|
+
}
|
|
2463
|
+
setCharCount(e.target.value.length);
|
|
2464
|
+
}
|
|
2147
2465
|
}
|
|
2148
2466
|
),
|
|
2149
|
-
|
|
2467
|
+
/* @__PURE__ */ jsxs12(Footer2, { children: [
|
|
2468
|
+
errorMessage && /* @__PURE__ */ jsx30(Span5, { children: errorMessage }),
|
|
2469
|
+
maxLength && /* @__PURE__ */ jsxs12(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
2470
|
+
charCount,
|
|
2471
|
+
"/",
|
|
2472
|
+
maxLength
|
|
2473
|
+
] })
|
|
2474
|
+
] })
|
|
2150
2475
|
] });
|
|
2151
2476
|
}
|
|
2152
2477
|
);
|
|
@@ -2203,7 +2528,7 @@ var TooltipArrow = styled(RadixTooltip.Arrow, {
|
|
|
2203
2528
|
});
|
|
2204
2529
|
|
|
2205
2530
|
// src/components/Tooltip/index.tsx
|
|
2206
|
-
import { jsx as
|
|
2531
|
+
import { jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2207
2532
|
var Tooltip = ({
|
|
2208
2533
|
content,
|
|
2209
2534
|
children,
|
|
@@ -2213,11 +2538,11 @@ var Tooltip = ({
|
|
|
2213
2538
|
onOpenChange,
|
|
2214
2539
|
delayDuration = 100
|
|
2215
2540
|
}) => {
|
|
2216
|
-
return /* @__PURE__ */
|
|
2217
|
-
/* @__PURE__ */
|
|
2218
|
-
/* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ jsx31(RadixTooltip2.Provider, { children: /* @__PURE__ */ jsxs13(RadixTooltip2.Root, { open, onOpenChange, delayDuration, children: [
|
|
2542
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children }),
|
|
2543
|
+
/* @__PURE__ */ jsxs13(TooltipContent, { side, sideOffset, children: [
|
|
2219
2544
|
content,
|
|
2220
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ jsx31(TooltipArrow, {})
|
|
2221
2546
|
] })
|
|
2222
2547
|
] }) });
|
|
2223
2548
|
};
|
|
@@ -2301,14 +2626,14 @@ var Spinner = styled("span", {
|
|
|
2301
2626
|
});
|
|
2302
2627
|
|
|
2303
2628
|
// src/components/Loader/index.tsx
|
|
2304
|
-
import { jsx as
|
|
2629
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2305
2630
|
var Loader = ({ show, fullscreen = false }) => {
|
|
2306
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ jsx32(Overlay2, { show, fullscreen, children: /* @__PURE__ */ jsx32(SpinnerContainer, { children: /* @__PURE__ */ jsx32(Spinner, {}) }) });
|
|
2307
2632
|
};
|
|
2308
2633
|
Loader.displayName = "Loader";
|
|
2309
2634
|
|
|
2310
2635
|
// src/components/MaskedInput/index.tsx
|
|
2311
|
-
import { forwardRef as forwardRef9, useState as
|
|
2636
|
+
import { forwardRef as forwardRef9, useState as useState8, useRef as useRef6 } from "react";
|
|
2312
2637
|
|
|
2313
2638
|
// src/components/MaskedInput/utils.ts
|
|
2314
2639
|
var MAX_LENGTHS = {
|
|
@@ -2372,11 +2697,11 @@ var applyMask = (value, maskType) => {
|
|
|
2372
2697
|
};
|
|
2373
2698
|
|
|
2374
2699
|
// src/components/MaskedInput/index.tsx
|
|
2375
|
-
import { jsx as
|
|
2700
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2376
2701
|
var MaskedInput = forwardRef9(
|
|
2377
2702
|
({ maskType, onChange, ...props }, ref) => {
|
|
2378
|
-
const [value, setValue] =
|
|
2379
|
-
const inputRef =
|
|
2703
|
+
const [value, setValue] = useState8("");
|
|
2704
|
+
const inputRef = useRef6(null);
|
|
2380
2705
|
const handleChange = (e) => {
|
|
2381
2706
|
const { value: inputValue, selectionStart } = e.target;
|
|
2382
2707
|
const isBackspace = value.length > inputValue.length;
|
|
@@ -2409,7 +2734,7 @@ var MaskedInput = forwardRef9(
|
|
|
2409
2734
|
onChange(syntheticEvent);
|
|
2410
2735
|
}
|
|
2411
2736
|
};
|
|
2412
|
-
return /* @__PURE__ */
|
|
2737
|
+
return /* @__PURE__ */ jsx33(
|
|
2413
2738
|
Input2,
|
|
2414
2739
|
{
|
|
2415
2740
|
...props,
|
|
@@ -2463,7 +2788,9 @@ var StyledContent2 = styled(DropdownMenu.Content, {
|
|
|
2463
2788
|
});
|
|
2464
2789
|
var itemStyles = {
|
|
2465
2790
|
all: "unset",
|
|
2791
|
+
fontFamily: "$default",
|
|
2466
2792
|
fontSize: "$sm",
|
|
2793
|
+
fontWeights: "$regular",
|
|
2467
2794
|
lineHeight: 1,
|
|
2468
2795
|
color: "$black",
|
|
2469
2796
|
borderRadius: "$sm",
|
|
@@ -2508,27 +2835,27 @@ var IconButton = styled("button", {
|
|
|
2508
2835
|
});
|
|
2509
2836
|
|
|
2510
2837
|
// src/components/Dropdown/index.tsx
|
|
2511
|
-
import { jsx as
|
|
2838
|
+
import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2512
2839
|
var Dropdown = ({ children }) => {
|
|
2513
2840
|
const childrenArray = Children2.toArray(children);
|
|
2514
|
-
return /* @__PURE__ */
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2841
|
+
return /* @__PURE__ */ jsxs14(DropdownMenu2.Root, { children: [
|
|
2842
|
+
/* @__PURE__ */ jsx34(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx34(Button, { variant: "secondary", size: "sm", children: /* @__PURE__ */ jsx34(Icon, { name: "Dots", size: 16 }) }) }),
|
|
2843
|
+
/* @__PURE__ */ jsx34(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsx34(StyledContent2, { sideOffset: 5, align: "end", children: childrenArray.map((child, index) => /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
2517
2844
|
child,
|
|
2518
|
-
index < childrenArray.length - 1 && /* @__PURE__ */
|
|
2845
|
+
index < childrenArray.length - 1 && /* @__PURE__ */ jsx34(DropdownSeparator, {})
|
|
2519
2846
|
] }, index)) }) })
|
|
2520
2847
|
] });
|
|
2521
2848
|
};
|
|
2522
2849
|
var DropdownSeparator = StyledSeparator;
|
|
2523
2850
|
var DropdownItem = React3.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
2524
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ jsx34(StyledItem2, { ...props, ref: forwardedRef, children });
|
|
2525
2852
|
});
|
|
2526
2853
|
Dropdown.displayName = "Dropdown";
|
|
2527
2854
|
DropdownItem.displayName = "DropdownItem";
|
|
2528
2855
|
DropdownSeparator.displayName = "DropdownSeparator";
|
|
2529
2856
|
|
|
2530
2857
|
// src/components/Box.tsx
|
|
2531
|
-
import { jsx as
|
|
2858
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2532
2859
|
var StyledBox = styled("div", {
|
|
2533
2860
|
padding: "$5",
|
|
2534
2861
|
borderRadius: "$md",
|
|
@@ -2550,12 +2877,12 @@ var StyledBox = styled("div", {
|
|
|
2550
2877
|
}
|
|
2551
2878
|
});
|
|
2552
2879
|
var Box = (props) => {
|
|
2553
|
-
return /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ jsx35(StyledBox, { ...props });
|
|
2554
2881
|
};
|
|
2555
2882
|
Box.displayName = "Box";
|
|
2556
2883
|
|
|
2557
2884
|
// src/components/Paragraph.tsx
|
|
2558
|
-
import { jsx as
|
|
2885
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2559
2886
|
var StyledParagraph = styled("p", {
|
|
2560
2887
|
fontFamily: "$default",
|
|
2561
2888
|
lineHeight: "$short",
|
|
@@ -2597,17 +2924,17 @@ var StyledParagraph = styled("p", {
|
|
|
2597
2924
|
}
|
|
2598
2925
|
});
|
|
2599
2926
|
var Paragraph = (props) => {
|
|
2600
|
-
return /* @__PURE__ */
|
|
2927
|
+
return /* @__PURE__ */ jsx36(StyledParagraph, { ...props });
|
|
2601
2928
|
};
|
|
2602
2929
|
Paragraph.displayName = "Paragraph";
|
|
2603
2930
|
|
|
2604
2931
|
// src/components/Heading.tsx
|
|
2605
2932
|
import { forwardRef as forwardRef10 } from "react";
|
|
2606
|
-
import { jsx as
|
|
2933
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2607
2934
|
var StyledHeading = styled("h2", {
|
|
2608
2935
|
fontFamily: "$default",
|
|
2609
2936
|
lineHeight: "$shorter",
|
|
2610
|
-
margin:
|
|
2937
|
+
margin: "1px",
|
|
2611
2938
|
color: "$black",
|
|
2612
2939
|
variants: {
|
|
2613
2940
|
size: {
|
|
@@ -2626,14 +2953,14 @@ var StyledHeading = styled("h2", {
|
|
|
2626
2953
|
}
|
|
2627
2954
|
});
|
|
2628
2955
|
var Heading = forwardRef10(function Heading2({ children, ...props }, ref) {
|
|
2629
|
-
return /* @__PURE__ */
|
|
2956
|
+
return /* @__PURE__ */ jsx37(StyledHeading, { ref, ...props, children });
|
|
2630
2957
|
});
|
|
2631
2958
|
Heading.displayName = "Heading";
|
|
2632
2959
|
|
|
2633
2960
|
// src/components/Select/index.tsx
|
|
2634
2961
|
import { TriangleDownIcon, TriangleUpIcon } from "@radix-ui/react-icons";
|
|
2635
|
-
import * as
|
|
2636
|
-
import { forwardRef as forwardRef11, useState as
|
|
2962
|
+
import * as CustomSelect2 from "@radix-ui/react-select";
|
|
2963
|
+
import { forwardRef as forwardRef11, useState as useState9 } from "react";
|
|
2637
2964
|
|
|
2638
2965
|
// src/components/Select/styles.ts
|
|
2639
2966
|
import * as Select from "@radix-ui/react-select";
|
|
@@ -2669,7 +2996,8 @@ var StyledTrigger = styled(Select.Trigger, {
|
|
|
2669
2996
|
},
|
|
2670
2997
|
"&[data-highlighted], &:focus, &:hover": {
|
|
2671
2998
|
outline: "none",
|
|
2672
|
-
border: "2px solid $clickpalm_light"
|
|
2999
|
+
border: "2px solid $clickpalm_light",
|
|
3000
|
+
padding: "calc(0.92rem - 0.9px) calc($4 - 0.9px)"
|
|
2673
3001
|
},
|
|
2674
3002
|
"&:disabled": {
|
|
2675
3003
|
opacity: 0.5,
|
|
@@ -2682,7 +3010,8 @@ var StyledTrigger = styled(Select.Trigger, {
|
|
|
2682
3010
|
marginBottom: "0px",
|
|
2683
3011
|
"&[data-highlighted], &:focus, &:hover": {
|
|
2684
3012
|
outline: "none",
|
|
2685
|
-
border: "2px solid $danger_dark"
|
|
3013
|
+
border: "2px solid $danger_dark",
|
|
3014
|
+
padding: "calc(0.92rem - 0.9px) calc($4 - 0.9px)"
|
|
2686
3015
|
}
|
|
2687
3016
|
}
|
|
2688
3017
|
}
|
|
@@ -2765,7 +3094,7 @@ var Span6 = styled("span", {
|
|
|
2765
3094
|
});
|
|
2766
3095
|
|
|
2767
3096
|
// src/components/Select/index.tsx
|
|
2768
|
-
import { jsx as
|
|
3097
|
+
import { jsx as jsx38, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2769
3098
|
var Select2 = forwardRef11(
|
|
2770
3099
|
({
|
|
2771
3100
|
value,
|
|
@@ -2779,36 +3108,27 @@ var Select2 = forwardRef11(
|
|
|
2779
3108
|
style,
|
|
2780
3109
|
...rest
|
|
2781
3110
|
}, ref) => {
|
|
2782
|
-
const [open, setOpen] =
|
|
2783
|
-
return /* @__PURE__ */
|
|
2784
|
-
label && /* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
|
|
3111
|
+
const [open, setOpen] = useState9(false);
|
|
3112
|
+
return /* @__PURE__ */ jsxs15(StyledWrapper4, { css: css2, className, style, children: [
|
|
3113
|
+
label && /* @__PURE__ */ jsx38(Label3, { children: label }),
|
|
3114
|
+
/* @__PURE__ */ jsxs15(
|
|
3115
|
+
CustomSelect2.Root,
|
|
2787
3116
|
{
|
|
2788
3117
|
value,
|
|
2789
3118
|
onValueChange,
|
|
2790
3119
|
onOpenChange: setOpen,
|
|
2791
3120
|
...rest,
|
|
2792
3121
|
children: [
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsxs15(StyledTrigger, { "aria-label": label, hasError: !!errorMessage, ref, children: [
|
|
3123
|
+
/* @__PURE__ */ jsx38(CustomSelect2.Value, { placeholder }),
|
|
3124
|
+
/* @__PURE__ */ jsx38(StyledIcon, { open, children: /* @__PURE__ */ jsx38(TriangleDownIcon, {}) })
|
|
2796
3125
|
] }),
|
|
2797
|
-
errorMessage && /* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
|
|
2800
|
-
{
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
position: "popper",
|
|
2804
|
-
className,
|
|
2805
|
-
children: [
|
|
2806
|
-
/* @__PURE__ */ jsx36(CustomSelect.ScrollUpButton, { children: /* @__PURE__ */ jsx36(TriangleUpIcon, {}) }),
|
|
2807
|
-
/* @__PURE__ */ jsx36(StyledViewport, { children: items.map((item) => /* @__PURE__ */ jsx36(StyledItem3, { value: item.value, children: /* @__PURE__ */ jsx36(StyledItemText, { children: item.label }) }, item.value)) }),
|
|
2808
|
-
/* @__PURE__ */ jsx36(CustomSelect.ScrollDownButton, { children: /* @__PURE__ */ jsx36(TriangleDownIcon, {}) })
|
|
2809
|
-
]
|
|
2810
|
-
}
|
|
2811
|
-
) })
|
|
3126
|
+
errorMessage && /* @__PURE__ */ jsx38(Span6, { children: errorMessage }),
|
|
3127
|
+
/* @__PURE__ */ jsx38(CustomSelect2.Portal, { children: /* @__PURE__ */ jsxs15(StyledContent3, { side: "bottom", align: "start", position: "popper", children: [
|
|
3128
|
+
/* @__PURE__ */ jsx38(CustomSelect2.ScrollUpButton, { children: /* @__PURE__ */ jsx38(TriangleUpIcon, {}) }),
|
|
3129
|
+
/* @__PURE__ */ jsx38(StyledViewport, { children: items.map((item) => /* @__PURE__ */ jsx38(StyledItem3, { value: item.value, children: /* @__PURE__ */ jsx38(StyledItemText, { children: item.label }) }, item.value)) }),
|
|
3130
|
+
/* @__PURE__ */ jsx38(CustomSelect2.ScrollDownButton, { children: /* @__PURE__ */ jsx38(TriangleDownIcon, {}) })
|
|
3131
|
+
] }) })
|
|
2812
3132
|
]
|
|
2813
3133
|
}
|
|
2814
3134
|
)
|
|
@@ -2883,9 +3203,9 @@ var Value2 = styled("div", {
|
|
|
2883
3203
|
});
|
|
2884
3204
|
|
|
2885
3205
|
// src/components/LabelledValue/index.tsx
|
|
2886
|
-
import { jsx as
|
|
3206
|
+
import { jsx as jsx39, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2887
3207
|
function LabelledValue({ position = "vertical", withRow = false, children }) {
|
|
2888
|
-
return /* @__PURE__ */
|
|
3208
|
+
return /* @__PURE__ */ jsx39(Container, { position, children: Children3.map(children, (child) => {
|
|
2889
3209
|
if (isValidElement2(child)) {
|
|
2890
3210
|
return cloneElement(child, { position, withRow });
|
|
2891
3211
|
}
|
|
@@ -2893,9 +3213,9 @@ function LabelledValue({ position = "vertical", withRow = false, children }) {
|
|
|
2893
3213
|
}) });
|
|
2894
3214
|
}
|
|
2895
3215
|
function Item4({ label, value, position = "vertical", withRow = false }) {
|
|
2896
|
-
return /* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
/* @__PURE__ */
|
|
3216
|
+
return /* @__PURE__ */ jsxs16(ItemWrapper, { position, withRow, children: [
|
|
3217
|
+
/* @__PURE__ */ jsx39(Label4, { children: label }),
|
|
3218
|
+
/* @__PURE__ */ jsx39(Value2, { children: value })
|
|
2899
3219
|
] });
|
|
2900
3220
|
}
|
|
2901
3221
|
LabelledValue.Item = Item4;
|
|
@@ -2967,11 +3287,11 @@ var Span7 = styled("span", {
|
|
|
2967
3287
|
});
|
|
2968
3288
|
|
|
2969
3289
|
// src/components/OneTimePassword/index.tsx
|
|
2970
|
-
import { jsx as
|
|
3290
|
+
import { jsx as jsx40, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2971
3291
|
var OneTimePassword = ({ label, length, value, errorMessage, onValueChange, ...rootProps }) => {
|
|
2972
|
-
return /* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsx40(Container2, { children: /* @__PURE__ */ jsxs17(StyledWrapper5, { children: [
|
|
3293
|
+
/* @__PURE__ */ jsx40(StyledLabel3, { children: label }),
|
|
3294
|
+
/* @__PURE__ */ jsxs17(
|
|
2975
3295
|
StyledRoot4,
|
|
2976
3296
|
{
|
|
2977
3297
|
value,
|
|
@@ -2979,12 +3299,12 @@ var OneTimePassword = ({ label, length, value, errorMessage, onValueChange, ...r
|
|
|
2979
3299
|
...rootProps,
|
|
2980
3300
|
style: { "--otp-length": length },
|
|
2981
3301
|
children: [
|
|
2982
|
-
Array.from({ length }).map((_, index) => /* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
3302
|
+
Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx40(StyledInput, {}, index)),
|
|
3303
|
+
/* @__PURE__ */ jsx40(OneTimePasswordField2.HiddenInput, {})
|
|
2984
3304
|
]
|
|
2985
3305
|
}
|
|
2986
3306
|
),
|
|
2987
|
-
errorMessage && /* @__PURE__ */
|
|
3307
|
+
errorMessage && /* @__PURE__ */ jsx40(Span7, { children: errorMessage })
|
|
2988
3308
|
] }) });
|
|
2989
3309
|
};
|
|
2990
3310
|
OneTimePassword.displayName = "OneTimePasswordInput";
|
|
@@ -3106,7 +3426,7 @@ var ToastProgress = styled("div", {
|
|
|
3106
3426
|
borderBottomRightRadius: "$full",
|
|
3107
3427
|
backgroundColor: "$clickpalm_light",
|
|
3108
3428
|
animationTimingFunction: "linear",
|
|
3109
|
-
animation: `${progress}
|
|
3429
|
+
animation: `${progress} 6s linear`,
|
|
3110
3430
|
animationFillMode: "forwards",
|
|
3111
3431
|
variants: {
|
|
3112
3432
|
paused: {
|
|
@@ -3154,7 +3474,7 @@ var toast = {
|
|
|
3154
3474
|
};
|
|
3155
3475
|
|
|
3156
3476
|
// src/components/Toast/index.tsx
|
|
3157
|
-
import { jsx as
|
|
3477
|
+
import { jsx as jsx41, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3158
3478
|
var Toast = () => {
|
|
3159
3479
|
const [messages, setMessages] = React4.useState([]);
|
|
3160
3480
|
const [paused, setPaused] = React4.useState(false);
|
|
@@ -3170,8 +3490,8 @@ var Toast = () => {
|
|
|
3170
3490
|
const removeToast = (id) => {
|
|
3171
3491
|
setMessages((prev) => prev.filter((msg) => msg.id !== id));
|
|
3172
3492
|
};
|
|
3173
|
-
return /* @__PURE__ */
|
|
3174
|
-
messages.map((message) => /* @__PURE__ */
|
|
3493
|
+
return /* @__PURE__ */ jsxs18(ToastPrimitive2.Provider, { swipeDirection: "right", children: [
|
|
3494
|
+
messages.map((message) => /* @__PURE__ */ jsxs18(
|
|
3175
3495
|
ToastRoot,
|
|
3176
3496
|
{
|
|
3177
3497
|
open: true,
|
|
@@ -3180,15 +3500,15 @@ var Toast = () => {
|
|
|
3180
3500
|
removeToast(message.id);
|
|
3181
3501
|
},
|
|
3182
3502
|
variant: message.variant,
|
|
3183
|
-
duration:
|
|
3503
|
+
duration: 6e3,
|
|
3184
3504
|
onPause: () => setPaused(true),
|
|
3185
3505
|
onResume: () => setPaused(false),
|
|
3186
3506
|
children: [
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
message.description && /* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsxs18(ToastContent, { children: [
|
|
3508
|
+
/* @__PURE__ */ jsx41(ToastTitle, { children: message.title }),
|
|
3509
|
+
message.description && /* @__PURE__ */ jsx41(ToastDescription, { children: message.description })
|
|
3190
3510
|
] }),
|
|
3191
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx41(ToastAction, { altText: "Fechar", asChild: true, children: /* @__PURE__ */ jsx41(
|
|
3192
3512
|
"button",
|
|
3193
3513
|
{
|
|
3194
3514
|
style: {
|
|
@@ -3198,15 +3518,15 @@ var Toast = () => {
|
|
|
3198
3518
|
alignItems: "center"
|
|
3199
3519
|
},
|
|
3200
3520
|
onClick: () => removeToast(message.id),
|
|
3201
|
-
children: /* @__PURE__ */
|
|
3521
|
+
children: /* @__PURE__ */ jsx41(Icon, { name: "Closed", size: 16, height: 14, width: 14 })
|
|
3202
3522
|
}
|
|
3203
3523
|
) }),
|
|
3204
|
-
/* @__PURE__ */
|
|
3524
|
+
/* @__PURE__ */ jsx41(ToastProgress, { paused, variant: message.variant })
|
|
3205
3525
|
]
|
|
3206
3526
|
},
|
|
3207
3527
|
message.id
|
|
3208
3528
|
)),
|
|
3209
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsx41(ToastViewport, {})
|
|
3210
3530
|
] });
|
|
3211
3531
|
};
|
|
3212
3532
|
|
|
@@ -3441,22 +3761,22 @@ var StepLabel = styled("span", {
|
|
|
3441
3761
|
});
|
|
3442
3762
|
|
|
3443
3763
|
// src/components/MultiStep/index.tsx
|
|
3444
|
-
import { jsx as
|
|
3764
|
+
import { jsx as jsx42, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3445
3765
|
var MultiStep = ({
|
|
3446
3766
|
steps,
|
|
3447
3767
|
currentStep,
|
|
3448
3768
|
orientation = "horizontal",
|
|
3449
3769
|
variant
|
|
3450
3770
|
}) => {
|
|
3451
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ jsx42(
|
|
3452
3772
|
Wrapper5,
|
|
3453
3773
|
{
|
|
3454
3774
|
orientation,
|
|
3455
3775
|
children: steps.map((step, index) => {
|
|
3456
3776
|
const isFirst = index === 0;
|
|
3457
3777
|
const isLast = index === steps.length - 1;
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3778
|
+
return /* @__PURE__ */ jsxs19(StepItem, { orientation, children: [
|
|
3779
|
+
/* @__PURE__ */ jsx42(
|
|
3460
3780
|
StepCircle,
|
|
3461
3781
|
{
|
|
3462
3782
|
orientation,
|
|
@@ -3467,7 +3787,7 @@ var MultiStep = ({
|
|
|
3467
3787
|
children: index + 1
|
|
3468
3788
|
}
|
|
3469
3789
|
),
|
|
3470
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsx42(
|
|
3471
3791
|
StepLabel,
|
|
3472
3792
|
{
|
|
3473
3793
|
orientation,
|
|
@@ -3483,7 +3803,7 @@ var MultiStep = ({
|
|
|
3483
3803
|
MultiStep.displayName = "MultiStep";
|
|
3484
3804
|
|
|
3485
3805
|
// src/components/Carousel/index.tsx
|
|
3486
|
-
import { useState as
|
|
3806
|
+
import { useState as useState11, Children as Children4, cloneElement as cloneElement2 } from "react";
|
|
3487
3807
|
|
|
3488
3808
|
// src/components/Carousel/styles.ts
|
|
3489
3809
|
var CarouselContainer = styled("div", {
|
|
@@ -3591,13 +3911,13 @@ var CarouselItemContainer = styled("div", {
|
|
|
3591
3911
|
});
|
|
3592
3912
|
|
|
3593
3913
|
// src/components/Carousel/index.tsx
|
|
3594
|
-
import { jsx as
|
|
3914
|
+
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3595
3915
|
var SWIPE_THRESHOLD = 50;
|
|
3596
3916
|
var Carousel = ({ title, variant, children }) => {
|
|
3597
3917
|
const items = Children4.toArray(children);
|
|
3598
|
-
const [activeIndex, setActiveIndex] =
|
|
3599
|
-
const [touchStartX, setTouchStartX] =
|
|
3600
|
-
const [touchEndX, setTouchEndX] =
|
|
3918
|
+
const [activeIndex, setActiveIndex] = useState11(0);
|
|
3919
|
+
const [touchStartX, setTouchStartX] = useState11(null);
|
|
3920
|
+
const [touchEndX, setTouchEndX] = useState11(null);
|
|
3601
3921
|
const prev = () => {
|
|
3602
3922
|
setActiveIndex((prevIndex) => prevIndex === 0 ? items.length - 1 : prevIndex - 1);
|
|
3603
3923
|
};
|
|
@@ -3625,18 +3945,18 @@ var Carousel = ({ title, variant, children }) => {
|
|
|
3625
3945
|
setTouchStartX(null);
|
|
3626
3946
|
setTouchEndX(null);
|
|
3627
3947
|
};
|
|
3628
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsxs20(
|
|
3629
3949
|
CarouselContainer,
|
|
3630
3950
|
{
|
|
3631
3951
|
role: "region",
|
|
3632
3952
|
"aria-roledescription": "carousel",
|
|
3633
3953
|
"aria-label": "Carousel Component",
|
|
3634
3954
|
children: [
|
|
3635
|
-
/* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3638
|
-
/* @__PURE__ */
|
|
3639
|
-
/* @__PURE__ */
|
|
3955
|
+
/* @__PURE__ */ jsxs20(Wrapper6, { variant, children: [
|
|
3956
|
+
/* @__PURE__ */ jsxs20(CarouselHeader, { children: [
|
|
3957
|
+
/* @__PURE__ */ jsx43(Title2, { children: title }),
|
|
3958
|
+
/* @__PURE__ */ jsxs20(Navigation, { children: [
|
|
3959
|
+
/* @__PURE__ */ jsx43(
|
|
3640
3960
|
Button,
|
|
3641
3961
|
{
|
|
3642
3962
|
size: "sm",
|
|
@@ -3644,10 +3964,10 @@ var Carousel = ({ title, variant, children }) => {
|
|
|
3644
3964
|
"aria-label": "Previous Slide",
|
|
3645
3965
|
onClick: prev,
|
|
3646
3966
|
tabIndex: 0,
|
|
3647
|
-
children: /* @__PURE__ */
|
|
3967
|
+
children: /* @__PURE__ */ jsx43(Icon, { name: "TriangleLeft", size: 16, color: variant === "purple" ? "white" : "black" })
|
|
3648
3968
|
}
|
|
3649
3969
|
),
|
|
3650
|
-
/* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ jsx43(
|
|
3651
3971
|
Button,
|
|
3652
3972
|
{
|
|
3653
3973
|
size: "sm",
|
|
@@ -3655,15 +3975,15 @@ var Carousel = ({ title, variant, children }) => {
|
|
|
3655
3975
|
"aria-label": "Previous Slide",
|
|
3656
3976
|
onClick: next,
|
|
3657
3977
|
tabIndex: 0,
|
|
3658
|
-
children: /* @__PURE__ */
|
|
3978
|
+
children: /* @__PURE__ */ jsx43(Icon, { name: "TriangleRight", size: 16, color: variant === "purple" ? "white" : "black" })
|
|
3659
3979
|
}
|
|
3660
3980
|
)
|
|
3661
3981
|
] })
|
|
3662
3982
|
] }),
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
/* @__PURE__ */
|
|
3666
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx43(Spacing, { size: "xs" }),
|
|
3984
|
+
/* @__PURE__ */ jsx43(Hr, { variant }),
|
|
3985
|
+
/* @__PURE__ */ jsx43(Spacing, { size: "xs" }),
|
|
3986
|
+
/* @__PURE__ */ jsx43(
|
|
3667
3987
|
CarouselContent,
|
|
3668
3988
|
{
|
|
3669
3989
|
onTouchStart,
|
|
@@ -3680,8 +4000,8 @@ var Carousel = ({ title, variant, children }) => {
|
|
|
3680
4000
|
}
|
|
3681
4001
|
)
|
|
3682
4002
|
] }),
|
|
3683
|
-
/* @__PURE__ */
|
|
3684
|
-
/* @__PURE__ */
|
|
4003
|
+
/* @__PURE__ */ jsx43(Spacing, { size: "md" }),
|
|
4004
|
+
/* @__PURE__ */ jsx43(DotsContainer, { children: /* @__PURE__ */ jsx43(Dots2, { role: "tablist", "aria-label": "Carousel Pagination", children: items.map((_, idx) => /* @__PURE__ */ jsx43(
|
|
3685
4005
|
DotButton,
|
|
3686
4006
|
{
|
|
3687
4007
|
active: idx === activeIndex,
|
|
@@ -3697,12 +4017,12 @@ var Carousel = ({ title, variant, children }) => {
|
|
|
3697
4017
|
}
|
|
3698
4018
|
);
|
|
3699
4019
|
};
|
|
3700
|
-
var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */
|
|
4020
|
+
var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ jsx43(CarouselItemContainer, { ...props, style: { ...style }, children });
|
|
3701
4021
|
Carousel.Item = CarouselItem;
|
|
3702
4022
|
|
|
3703
4023
|
// src/components/PasswordInput.tsx
|
|
3704
|
-
import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as
|
|
3705
|
-
import { jsx as
|
|
4024
|
+
import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as useRef7, useState as useState12 } from "react";
|
|
4025
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3706
4026
|
var ToggleButton = styled("button", {
|
|
3707
4027
|
all: "unset",
|
|
3708
4028
|
cursor: "pointer",
|
|
@@ -3719,8 +4039,8 @@ var ToggleButton = styled("button", {
|
|
|
3719
4039
|
});
|
|
3720
4040
|
var PasswordInput = forwardRef12(
|
|
3721
4041
|
({ value, onChange, ...props }, ref) => {
|
|
3722
|
-
const [visible, setVisible] =
|
|
3723
|
-
const innerRef =
|
|
4042
|
+
const [visible, setVisible] = useState12(false);
|
|
4043
|
+
const innerRef = useRef7(null);
|
|
3724
4044
|
useImperativeHandle2(ref, () => innerRef.current);
|
|
3725
4045
|
const handleToggleVisibility = () => {
|
|
3726
4046
|
setVisible((v) => !v);
|
|
@@ -3731,7 +4051,7 @@ var PasswordInput = forwardRef12(
|
|
|
3731
4051
|
}
|
|
3732
4052
|
}, 0);
|
|
3733
4053
|
};
|
|
3734
|
-
return /* @__PURE__ */
|
|
4054
|
+
return /* @__PURE__ */ jsx44(
|
|
3735
4055
|
Input2,
|
|
3736
4056
|
{
|
|
3737
4057
|
...props,
|
|
@@ -3739,14 +4059,14 @@ var PasswordInput = forwardRef12(
|
|
|
3739
4059
|
type: visible ? "text" : "password",
|
|
3740
4060
|
value,
|
|
3741
4061
|
onChange,
|
|
3742
|
-
suffix: /* @__PURE__ */
|
|
4062
|
+
suffix: /* @__PURE__ */ jsx44(
|
|
3743
4063
|
ToggleButton,
|
|
3744
4064
|
{
|
|
3745
4065
|
type: "button",
|
|
3746
4066
|
onClick: handleToggleVisibility,
|
|
3747
4067
|
onMouseDown: (e) => e.preventDefault(),
|
|
3748
4068
|
"aria-label": visible ? "Ocultar senha" : "Mostrar senha",
|
|
3749
|
-
children: visible ? /* @__PURE__ */
|
|
4069
|
+
children: visible ? /* @__PURE__ */ jsx44(Icon, { name: "EyeClosed", size: 16, color: "black" }) : /* @__PURE__ */ jsx44(Icon, { name: "EyeOpen", size: 16, color: "black" })
|
|
3750
4070
|
}
|
|
3751
4071
|
)
|
|
3752
4072
|
}
|
|
@@ -3838,18 +4158,18 @@ var OptionsButton = styled(Button, {
|
|
|
3838
4158
|
});
|
|
3839
4159
|
|
|
3840
4160
|
// src/components/Accordion/index.tsx
|
|
3841
|
-
import { jsx as
|
|
4161
|
+
import { jsx as jsx45, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3842
4162
|
var Accordion2 = React6.forwardRef(
|
|
3843
4163
|
({ title, children, dropdownItems }, ref) => {
|
|
3844
|
-
return /* @__PURE__ */
|
|
3845
|
-
/* @__PURE__ */
|
|
3846
|
-
/* @__PURE__ */
|
|
3847
|
-
/* @__PURE__ */
|
|
4164
|
+
return /* @__PURE__ */ jsx45(AccordionContainer, { type: "single", collapsible: true, ref, children: /* @__PURE__ */ jsxs21(AccordionItem, { value: "item-1", children: [
|
|
4165
|
+
/* @__PURE__ */ jsxs21(AccordionHeader, { children: [
|
|
4166
|
+
/* @__PURE__ */ jsx45(AccordionTrigger, { children: /* @__PURE__ */ jsx45("span", { children: title }) }),
|
|
4167
|
+
/* @__PURE__ */ jsxs21(TriggerContent, { children: [
|
|
3848
4168
|
dropdownItems && dropdownItems,
|
|
3849
|
-
/* @__PURE__ */
|
|
4169
|
+
/* @__PURE__ */ jsx45(RadixAccordion.Trigger, { asChild: true, children: /* @__PURE__ */ jsx45(StyledButton, { as: "div", variant: "secondary", size: "sm", children: /* @__PURE__ */ jsx45(AccordionChevron, { name: "TriangleDown", size: 16, "aria-hidden": true }) }) })
|
|
3850
4170
|
] })
|
|
3851
4171
|
] }),
|
|
3852
|
-
/* @__PURE__ */
|
|
4172
|
+
/* @__PURE__ */ jsx45(RadixAccordion.Content, { asChild: true, children: /* @__PURE__ */ jsx45(AccordionContent, { children }) })
|
|
3853
4173
|
] }) });
|
|
3854
4174
|
}
|
|
3855
4175
|
);
|