@clickpalm/react 1.2.18 → 1.3.1
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 +6 -0
- package/dist/index.js +118 -16
- package/dist/index.mjs +142 -39
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2309,6 +2309,7 @@ declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxProps, "ref
|
|
|
2309
2309
|
|
|
2310
2310
|
interface DatePickerInputProps {
|
|
2311
2311
|
label: string;
|
|
2312
|
+
placeholder?: string;
|
|
2312
2313
|
value?: string;
|
|
2313
2314
|
onChange: (date: string) => void;
|
|
2314
2315
|
errorMessage?: string;
|
|
@@ -2613,6 +2614,7 @@ declare const Tabs: React.FC<TabsProps> & {
|
|
|
2613
2614
|
|
|
2614
2615
|
declare const TextAreaElement: _stitches_react_types_styled_component.StyledComponent<"textarea", {
|
|
2615
2616
|
hasError?: boolean | "true" | undefined;
|
|
2617
|
+
hasCounter?: boolean | "true" | undefined;
|
|
2616
2618
|
}, {
|
|
2617
2619
|
sm: "(min-width: 375px)";
|
|
2618
2620
|
md: "(min-width: 768px)";
|
|
@@ -3055,6 +3057,8 @@ interface TextAreaProps extends ComponentPropsWithoutRef<'textarea'>, VariantPro
|
|
|
3055
3057
|
label?: string;
|
|
3056
3058
|
htmlFor?: string;
|
|
3057
3059
|
errorMessage?: string;
|
|
3060
|
+
maxLength?: number;
|
|
3061
|
+
showCounter?: boolean;
|
|
3058
3062
|
}
|
|
3059
3063
|
declare const TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
3060
3064
|
|
|
@@ -3084,6 +3088,8 @@ interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
3084
3088
|
suffix?: react__default.ReactNode;
|
|
3085
3089
|
noMargin?: boolean;
|
|
3086
3090
|
errorMessage?: string;
|
|
3091
|
+
maxLength?: number;
|
|
3092
|
+
showCounter?: boolean;
|
|
3087
3093
|
}
|
|
3088
3094
|
declare const Input: react__default.ForwardRefExoticComponent<TextInputProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
3089
3095
|
|
package/dist/index.js
CHANGED
|
@@ -735,6 +735,7 @@ var iconMap = {
|
|
|
735
735
|
EyeClosed: import_react_icons.EyeClosedIcon,
|
|
736
736
|
EyeOpen: import_react_icons.EyeOpenIcon,
|
|
737
737
|
QuestionMark: import_react_icons.QuestionMarkIcon,
|
|
738
|
+
Reload: import_react_icons.ReloadIcon,
|
|
738
739
|
Calendar,
|
|
739
740
|
Closed,
|
|
740
741
|
Dots,
|
|
@@ -1243,6 +1244,11 @@ var TextInputContainer = styled("div", {
|
|
|
1243
1244
|
padding: "calc($4 - 0.9px) calc($4 - 0.9px)"
|
|
1244
1245
|
}
|
|
1245
1246
|
}
|
|
1247
|
+
},
|
|
1248
|
+
hasCounter: {
|
|
1249
|
+
true: {
|
|
1250
|
+
marginBottom: "0px"
|
|
1251
|
+
}
|
|
1246
1252
|
}
|
|
1247
1253
|
}
|
|
1248
1254
|
});
|
|
@@ -1282,17 +1288,45 @@ var Span2 = styled("span", {
|
|
|
1282
1288
|
fontFamily: "$default",
|
|
1283
1289
|
fontWeight: "$regular",
|
|
1284
1290
|
fontSize: "$sm",
|
|
1291
|
+
textAlign: "left",
|
|
1285
1292
|
color: "$danger_dark",
|
|
1286
1293
|
alignSelf: "flex-start",
|
|
1287
1294
|
paddingLeft: "1px",
|
|
1288
1295
|
marginTop: "2px",
|
|
1289
|
-
marginBottom: "$6"
|
|
1296
|
+
marginBottom: "$6",
|
|
1297
|
+
flexShrink: 1,
|
|
1298
|
+
wordBreak: "break-word"
|
|
1299
|
+
});
|
|
1300
|
+
var Footer = styled("div", {
|
|
1301
|
+
display: "flex",
|
|
1302
|
+
justifyContent: "space-between",
|
|
1303
|
+
width: "100%",
|
|
1304
|
+
gap: "$2"
|
|
1305
|
+
});
|
|
1306
|
+
var CharCounter = styled(Span2, {
|
|
1307
|
+
fontFamily: "$default",
|
|
1308
|
+
fontWeight: "$regular",
|
|
1309
|
+
fontSize: "$sm",
|
|
1310
|
+
color: "$gray_mid",
|
|
1311
|
+
marginLeft: "auto",
|
|
1312
|
+
whiteSpace: "nowrap",
|
|
1313
|
+
paddingRight: "1px",
|
|
1314
|
+
marginTop: "2px",
|
|
1315
|
+
marginBottom: "0px",
|
|
1316
|
+
variants: {
|
|
1317
|
+
hasReachedMax: {
|
|
1318
|
+
true: {
|
|
1319
|
+
color: "$danger_dark"
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1290
1323
|
});
|
|
1291
1324
|
|
|
1292
1325
|
// src/components/Input/index.tsx
|
|
1293
1326
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1294
1327
|
var Input2 = (0, import_react5.forwardRef)(
|
|
1295
|
-
({ prefix, suffix, label, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1328
|
+
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1329
|
+
const [charCount, setCharCount] = (0, import_react5.useState)(0);
|
|
1296
1330
|
const localInputRef = (0, import_react5.useRef)(null);
|
|
1297
1331
|
const inputRef = forwardedRef || localInputRef;
|
|
1298
1332
|
const handleContainerClick = () => {
|
|
@@ -1312,15 +1346,36 @@ var Input2 = (0, import_react5.forwardRef)(
|
|
|
1312
1346
|
hasButtonSuffix: isButtonElement(suffix),
|
|
1313
1347
|
noMargin,
|
|
1314
1348
|
hasError: !!errorMessage,
|
|
1349
|
+
hasCounter: showCounter,
|
|
1315
1350
|
onClick: handleContainerClick,
|
|
1316
1351
|
children: [
|
|
1317
1352
|
!!prefix && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Prefix, { children: prefix }),
|
|
1318
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1354
|
+
Input,
|
|
1355
|
+
{
|
|
1356
|
+
ref: inputRef,
|
|
1357
|
+
...props,
|
|
1358
|
+
maxLength,
|
|
1359
|
+
onChange: (e) => {
|
|
1360
|
+
if (props.onChange) {
|
|
1361
|
+
props.onChange(e);
|
|
1362
|
+
}
|
|
1363
|
+
setCharCount(e.target.value.length);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1319
1367
|
!!suffix && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Suffix, { children: suffix })
|
|
1320
1368
|
]
|
|
1321
1369
|
}
|
|
1322
1370
|
),
|
|
1323
|
-
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Footer, { children: [
|
|
1372
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Span2, { children: errorMessage }),
|
|
1373
|
+
showCounter && maxLength && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
1374
|
+
charCount,
|
|
1375
|
+
"/",
|
|
1376
|
+
maxLength
|
|
1377
|
+
] })
|
|
1378
|
+
] })
|
|
1324
1379
|
] });
|
|
1325
1380
|
}
|
|
1326
1381
|
);
|
|
@@ -1616,7 +1671,7 @@ var datePickerStyles = globalCss({
|
|
|
1616
1671
|
// src/components/Datepicker/index.tsx
|
|
1617
1672
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1618
1673
|
datePickerStyles();
|
|
1619
|
-
var Datepicker = (0, import_react7.forwardRef)(({ label, value, onChange, errorMessage }, ref) => {
|
|
1674
|
+
var Datepicker = (0, import_react7.forwardRef)(({ label, placeholder, value, onChange, errorMessage }, ref) => {
|
|
1620
1675
|
const [selected, setSelected] = (0, import_react7.useState)(void 0);
|
|
1621
1676
|
const [month, setMonth] = (0, import_react7.useState)(/* @__PURE__ */ new Date());
|
|
1622
1677
|
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
@@ -1651,7 +1706,7 @@ var Datepicker = (0, import_react7.forwardRef)(({ label, value, onChange, errorM
|
|
|
1651
1706
|
{
|
|
1652
1707
|
ref: inputRef,
|
|
1653
1708
|
label,
|
|
1654
|
-
placeholder
|
|
1709
|
+
placeholder,
|
|
1655
1710
|
onFocus: () => setOpen(true),
|
|
1656
1711
|
value: value || "",
|
|
1657
1712
|
readOnly: true,
|
|
@@ -2374,9 +2429,8 @@ var TextAreaElement = styled("textarea", {
|
|
|
2374
2429
|
fontSize: "$sm",
|
|
2375
2430
|
color: "$black",
|
|
2376
2431
|
fontWeight: "$regular",
|
|
2377
|
-
resize: "
|
|
2378
|
-
minHeight:
|
|
2379
|
-
maxHeight: "170px",
|
|
2432
|
+
resize: "vertical",
|
|
2433
|
+
minHeight: "100px",
|
|
2380
2434
|
overflowY: "auto",
|
|
2381
2435
|
width: "100%",
|
|
2382
2436
|
"&:focus": {
|
|
@@ -2412,6 +2466,11 @@ var TextAreaElement = styled("textarea", {
|
|
|
2412
2466
|
border: "2px solid $danger_dark"
|
|
2413
2467
|
}
|
|
2414
2468
|
}
|
|
2469
|
+
},
|
|
2470
|
+
hasCounter: {
|
|
2471
|
+
true: {
|
|
2472
|
+
marginBottom: "0px"
|
|
2473
|
+
}
|
|
2415
2474
|
}
|
|
2416
2475
|
}
|
|
2417
2476
|
});
|
|
@@ -2419,15 +2478,43 @@ var Span5 = styled("span", {
|
|
|
2419
2478
|
fontFamily: "$default",
|
|
2420
2479
|
fontWeight: "$regular",
|
|
2421
2480
|
fontSize: "$sm",
|
|
2481
|
+
textAlign: "left",
|
|
2422
2482
|
color: "$danger_dark",
|
|
2423
2483
|
alignSelf: "flex-start",
|
|
2424
2484
|
paddingLeft: "1px",
|
|
2425
2485
|
marginTop: "2px",
|
|
2426
|
-
marginBottom: "$6"
|
|
2486
|
+
marginBottom: "$6",
|
|
2487
|
+
flexShrink: 1,
|
|
2488
|
+
wordBreak: "break-word"
|
|
2489
|
+
});
|
|
2490
|
+
var Footer2 = styled("div", {
|
|
2491
|
+
display: "flex",
|
|
2492
|
+
justifyContent: "space-between",
|
|
2493
|
+
width: "100%",
|
|
2494
|
+
gap: "$2"
|
|
2495
|
+
});
|
|
2496
|
+
var CharCounter2 = styled(Span5, {
|
|
2497
|
+
fontFamily: "$default",
|
|
2498
|
+
fontWeight: "$regular",
|
|
2499
|
+
fontSize: "$sm",
|
|
2500
|
+
color: "$gray_mid",
|
|
2501
|
+
marginLeft: "auto",
|
|
2502
|
+
whiteSpace: "nowrap",
|
|
2503
|
+
paddingRight: "1px",
|
|
2504
|
+
marginTop: "2px",
|
|
2505
|
+
marginBottom: "0px",
|
|
2506
|
+
variants: {
|
|
2507
|
+
hasReachedMax: {
|
|
2508
|
+
true: {
|
|
2509
|
+
color: "$danger_dark"
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2427
2513
|
});
|
|
2428
2514
|
var TextArea = (0, import_react13.forwardRef)(
|
|
2429
|
-
({ label, id, htmlFor, errorMessage, ...props }, ref) => {
|
|
2515
|
+
({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
|
|
2430
2516
|
const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
|
|
2517
|
+
const [charCount, setCharCount] = (0, import_react13.useState)(0);
|
|
2431
2518
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Wrapper4, { children: [
|
|
2432
2519
|
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StyledLabel2, { htmlFor: textAreaId, children: label }),
|
|
2433
2520
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
@@ -2436,10 +2523,25 @@ var TextArea = (0, import_react13.forwardRef)(
|
|
|
2436
2523
|
id: textAreaId,
|
|
2437
2524
|
...props,
|
|
2438
2525
|
hasError: !!errorMessage,
|
|
2439
|
-
|
|
2526
|
+
hasCounter: showCounter,
|
|
2527
|
+
ref,
|
|
2528
|
+
maxLength,
|
|
2529
|
+
onChange: (e) => {
|
|
2530
|
+
if (props.onChange) {
|
|
2531
|
+
props.onChange(e);
|
|
2532
|
+
}
|
|
2533
|
+
setCharCount(e.target.value.length);
|
|
2534
|
+
}
|
|
2440
2535
|
}
|
|
2441
2536
|
),
|
|
2442
|
-
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Footer2, { children: [
|
|
2538
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Span5, { children: errorMessage }),
|
|
2539
|
+
showCounter && maxLength && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
2540
|
+
charCount,
|
|
2541
|
+
"/",
|
|
2542
|
+
maxLength
|
|
2543
|
+
] })
|
|
2544
|
+
] })
|
|
2443
2545
|
] });
|
|
2444
2546
|
}
|
|
2445
2547
|
);
|
|
@@ -2902,7 +3004,7 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
|
2902
3004
|
var StyledHeading = styled("h2", {
|
|
2903
3005
|
fontFamily: "$default",
|
|
2904
3006
|
lineHeight: "$shorter",
|
|
2905
|
-
margin:
|
|
3007
|
+
margin: "1px",
|
|
2906
3008
|
color: "$black",
|
|
2907
3009
|
variants: {
|
|
2908
3010
|
size: {
|
|
@@ -3390,7 +3492,7 @@ var ToastProgress = styled("div", {
|
|
|
3390
3492
|
borderBottomRightRadius: "$full",
|
|
3391
3493
|
backgroundColor: "$clickpalm_light",
|
|
3392
3494
|
animationTimingFunction: "linear",
|
|
3393
|
-
animation: `${progress}
|
|
3495
|
+
animation: `${progress} 6s linear`,
|
|
3394
3496
|
animationFillMode: "forwards",
|
|
3395
3497
|
variants: {
|
|
3396
3498
|
paused: {
|
|
@@ -3464,7 +3566,7 @@ var Toast = () => {
|
|
|
3464
3566
|
removeToast(message.id);
|
|
3465
3567
|
},
|
|
3466
3568
|
variant: message.variant,
|
|
3467
|
-
duration:
|
|
3569
|
+
duration: 6e3,
|
|
3468
3570
|
onPause: () => setPaused(true),
|
|
3469
3571
|
onResume: () => setPaused(false),
|
|
3470
3572
|
children: [
|
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 useEffect3, useImperativeHandle, useRef as useRef4, useState 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", {
|
|
@@ -1172,6 +1174,11 @@ var TextInputContainer = styled("div", {
|
|
|
1172
1174
|
padding: "calc($4 - 0.9px) calc($4 - 0.9px)"
|
|
1173
1175
|
}
|
|
1174
1176
|
}
|
|
1177
|
+
},
|
|
1178
|
+
hasCounter: {
|
|
1179
|
+
true: {
|
|
1180
|
+
marginBottom: "0px"
|
|
1181
|
+
}
|
|
1175
1182
|
}
|
|
1176
1183
|
}
|
|
1177
1184
|
});
|
|
@@ -1211,17 +1218,45 @@ var Span2 = styled("span", {
|
|
|
1211
1218
|
fontFamily: "$default",
|
|
1212
1219
|
fontWeight: "$regular",
|
|
1213
1220
|
fontSize: "$sm",
|
|
1221
|
+
textAlign: "left",
|
|
1214
1222
|
color: "$danger_dark",
|
|
1215
1223
|
alignSelf: "flex-start",
|
|
1216
1224
|
paddingLeft: "1px",
|
|
1217
1225
|
marginTop: "2px",
|
|
1218
|
-
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: "0px",
|
|
1246
|
+
variants: {
|
|
1247
|
+
hasReachedMax: {
|
|
1248
|
+
true: {
|
|
1249
|
+
color: "$danger_dark"
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1219
1253
|
});
|
|
1220
1254
|
|
|
1221
1255
|
// src/components/Input/index.tsx
|
|
1222
1256
|
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1223
1257
|
var Input2 = forwardRef3(
|
|
1224
|
-
({ prefix, suffix, label, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1258
|
+
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1259
|
+
const [charCount, setCharCount] = useState2(0);
|
|
1225
1260
|
const localInputRef = useRef2(null);
|
|
1226
1261
|
const inputRef = forwardedRef || localInputRef;
|
|
1227
1262
|
const handleContainerClick = () => {
|
|
@@ -1241,22 +1276,43 @@ var Input2 = forwardRef3(
|
|
|
1241
1276
|
hasButtonSuffix: isButtonElement(suffix),
|
|
1242
1277
|
noMargin,
|
|
1243
1278
|
hasError: !!errorMessage,
|
|
1279
|
+
hasCounter: showCounter,
|
|
1244
1280
|
onClick: handleContainerClick,
|
|
1245
1281
|
children: [
|
|
1246
1282
|
!!prefix && /* @__PURE__ */ jsx19(Prefix, { children: prefix }),
|
|
1247
|
-
/* @__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
|
+
),
|
|
1248
1297
|
!!suffix && /* @__PURE__ */ jsx19(Suffix, { children: suffix })
|
|
1249
1298
|
]
|
|
1250
1299
|
}
|
|
1251
1300
|
),
|
|
1252
|
-
|
|
1301
|
+
/* @__PURE__ */ jsxs4(Footer, { children: [
|
|
1302
|
+
errorMessage && /* @__PURE__ */ jsx19(Span2, { children: errorMessage }),
|
|
1303
|
+
showCounter && maxLength && /* @__PURE__ */ jsxs4(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
1304
|
+
charCount,
|
|
1305
|
+
"/",
|
|
1306
|
+
maxLength
|
|
1307
|
+
] })
|
|
1308
|
+
] })
|
|
1253
1309
|
] });
|
|
1254
1310
|
}
|
|
1255
1311
|
);
|
|
1256
1312
|
Input2.displayName = "Input";
|
|
1257
1313
|
|
|
1258
1314
|
// src/components/Datepicker/CustomSelect/index.tsx
|
|
1259
|
-
import { useEffect as useEffect2, useRef as useRef3, useState as
|
|
1315
|
+
import { useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
|
|
1260
1316
|
|
|
1261
1317
|
// src/components/Datepicker/CustomSelect/styles.ts
|
|
1262
1318
|
var IconWrapper = styled("span", {
|
|
@@ -1382,7 +1438,7 @@ var CustomSelect = ({
|
|
|
1382
1438
|
onChange,
|
|
1383
1439
|
color = "white"
|
|
1384
1440
|
}) => {
|
|
1385
|
-
const [isOpen, setIsOpen] =
|
|
1441
|
+
const [isOpen, setIsOpen] = useState3(false);
|
|
1386
1442
|
const selectRef = useRef3(null);
|
|
1387
1443
|
const handleToggle = () => setIsOpen(!isOpen);
|
|
1388
1444
|
const handleOptionClick = (optionValue) => {
|
|
@@ -1545,10 +1601,10 @@ var datePickerStyles = globalCss({
|
|
|
1545
1601
|
// src/components/Datepicker/index.tsx
|
|
1546
1602
|
import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1547
1603
|
datePickerStyles();
|
|
1548
|
-
var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) => {
|
|
1549
|
-
const [selected, setSelected] =
|
|
1550
|
-
const [month, setMonth] =
|
|
1551
|
-
const [open, setOpen] =
|
|
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);
|
|
1552
1608
|
const inputRef = useRef4(null);
|
|
1553
1609
|
const calendarRef = useRef4(null);
|
|
1554
1610
|
useImperativeHandle(ref, () => inputRef.current);
|
|
@@ -1580,7 +1636,7 @@ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) =>
|
|
|
1580
1636
|
{
|
|
1581
1637
|
ref: inputRef,
|
|
1582
1638
|
label,
|
|
1583
|
-
placeholder
|
|
1639
|
+
placeholder,
|
|
1584
1640
|
onFocus: () => setOpen(true),
|
|
1585
1641
|
value: value || "",
|
|
1586
1642
|
readOnly: true,
|
|
@@ -1742,7 +1798,7 @@ var Modal = ({ open, onOpenChange, title, description, children }) => {
|
|
|
1742
1798
|
};
|
|
1743
1799
|
|
|
1744
1800
|
// src/components/ProgressBar/index.tsx
|
|
1745
|
-
import { useEffect as useEffect4, useState as
|
|
1801
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1746
1802
|
|
|
1747
1803
|
// src/components/ProgressBar/styles.ts
|
|
1748
1804
|
import * as Progress from "@radix-ui/react-progress";
|
|
@@ -1774,7 +1830,7 @@ var StyledIndicator = styled(Progress.Indicator, {
|
|
|
1774
1830
|
// src/components/ProgressBar/index.tsx
|
|
1775
1831
|
import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1776
1832
|
var ProgressBar = ({ label, value = 0, max = 100, ...rest }) => {
|
|
1777
|
-
const [progress2, setProgress] =
|
|
1833
|
+
const [progress2, setProgress] = useState5(0);
|
|
1778
1834
|
useEffect4(() => {
|
|
1779
1835
|
const timer = setTimeout(() => setProgress(value), 500);
|
|
1780
1836
|
return () => clearTimeout(timer);
|
|
@@ -2084,7 +2140,7 @@ var Switch2 = forwardRef7(({
|
|
|
2084
2140
|
Switch2.displayName = "Switch";
|
|
2085
2141
|
|
|
2086
2142
|
// src/components/Tabs/index.tsx
|
|
2087
|
-
import { Children, isValidElement, useLayoutEffect, useRef as useRef5, useState as
|
|
2143
|
+
import { Children, isValidElement, useLayoutEffect, useRef as useRef5, useState as useState6 } from "react";
|
|
2088
2144
|
|
|
2089
2145
|
// src/components/Tabs/styles.ts
|
|
2090
2146
|
import * as Tabs from "@radix-ui/react-tabs";
|
|
@@ -2181,7 +2237,7 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2181
2237
|
const listRef = useRef5(null);
|
|
2182
2238
|
const rootRef = useRef5(null);
|
|
2183
2239
|
const hasOverflowRef = useRef5(false);
|
|
2184
|
-
const [hasOverflow, setHasOverflow] =
|
|
2240
|
+
const [hasOverflow, setHasOverflow] = useState6(false);
|
|
2185
2241
|
const checkOverflow = () => {
|
|
2186
2242
|
const listEl = listRef.current;
|
|
2187
2243
|
const rootEl = rootRef.current;
|
|
@@ -2278,7 +2334,7 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2278
2334
|
Tabs2.Item = TabsItem;
|
|
2279
2335
|
|
|
2280
2336
|
// src/components/TextArea.tsx
|
|
2281
|
-
import { forwardRef as forwardRef8 } from "react";
|
|
2337
|
+
import { forwardRef as forwardRef8, useState as useState7 } from "react";
|
|
2282
2338
|
import { jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2283
2339
|
var Wrapper4 = styled("div", {
|
|
2284
2340
|
display: "flex",
|
|
@@ -2303,9 +2359,8 @@ var TextAreaElement = styled("textarea", {
|
|
|
2303
2359
|
fontSize: "$sm",
|
|
2304
2360
|
color: "$black",
|
|
2305
2361
|
fontWeight: "$regular",
|
|
2306
|
-
resize: "
|
|
2307
|
-
minHeight:
|
|
2308
|
-
maxHeight: "170px",
|
|
2362
|
+
resize: "vertical",
|
|
2363
|
+
minHeight: "100px",
|
|
2309
2364
|
overflowY: "auto",
|
|
2310
2365
|
width: "100%",
|
|
2311
2366
|
"&:focus": {
|
|
@@ -2341,6 +2396,11 @@ var TextAreaElement = styled("textarea", {
|
|
|
2341
2396
|
border: "2px solid $danger_dark"
|
|
2342
2397
|
}
|
|
2343
2398
|
}
|
|
2399
|
+
},
|
|
2400
|
+
hasCounter: {
|
|
2401
|
+
true: {
|
|
2402
|
+
marginBottom: "0px"
|
|
2403
|
+
}
|
|
2344
2404
|
}
|
|
2345
2405
|
}
|
|
2346
2406
|
});
|
|
@@ -2348,15 +2408,43 @@ var Span5 = styled("span", {
|
|
|
2348
2408
|
fontFamily: "$default",
|
|
2349
2409
|
fontWeight: "$regular",
|
|
2350
2410
|
fontSize: "$sm",
|
|
2411
|
+
textAlign: "left",
|
|
2351
2412
|
color: "$danger_dark",
|
|
2352
2413
|
alignSelf: "flex-start",
|
|
2353
2414
|
paddingLeft: "1px",
|
|
2354
2415
|
marginTop: "2px",
|
|
2355
|
-
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: "0px",
|
|
2436
|
+
variants: {
|
|
2437
|
+
hasReachedMax: {
|
|
2438
|
+
true: {
|
|
2439
|
+
color: "$danger_dark"
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2356
2443
|
});
|
|
2357
2444
|
var TextArea = forwardRef8(
|
|
2358
|
-
({ label, id, htmlFor, errorMessage, ...props }, ref) => {
|
|
2445
|
+
({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
|
|
2359
2446
|
const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
|
|
2447
|
+
const [charCount, setCharCount] = useState7(0);
|
|
2360
2448
|
return /* @__PURE__ */ jsxs12(Wrapper4, { children: [
|
|
2361
2449
|
label && /* @__PURE__ */ jsx30(StyledLabel2, { htmlFor: textAreaId, children: label }),
|
|
2362
2450
|
/* @__PURE__ */ jsx30(
|
|
@@ -2365,10 +2453,25 @@ var TextArea = forwardRef8(
|
|
|
2365
2453
|
id: textAreaId,
|
|
2366
2454
|
...props,
|
|
2367
2455
|
hasError: !!errorMessage,
|
|
2368
|
-
|
|
2456
|
+
hasCounter: showCounter,
|
|
2457
|
+
ref,
|
|
2458
|
+
maxLength,
|
|
2459
|
+
onChange: (e) => {
|
|
2460
|
+
if (props.onChange) {
|
|
2461
|
+
props.onChange(e);
|
|
2462
|
+
}
|
|
2463
|
+
setCharCount(e.target.value.length);
|
|
2464
|
+
}
|
|
2369
2465
|
}
|
|
2370
2466
|
),
|
|
2371
|
-
|
|
2467
|
+
/* @__PURE__ */ jsxs12(Footer2, { children: [
|
|
2468
|
+
errorMessage && /* @__PURE__ */ jsx30(Span5, { children: errorMessage }),
|
|
2469
|
+
showCounter && maxLength && /* @__PURE__ */ jsxs12(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
|
|
2470
|
+
charCount,
|
|
2471
|
+
"/",
|
|
2472
|
+
maxLength
|
|
2473
|
+
] })
|
|
2474
|
+
] })
|
|
2372
2475
|
] });
|
|
2373
2476
|
}
|
|
2374
2477
|
);
|
|
@@ -2530,7 +2633,7 @@ var Loader = ({ show, fullscreen = false }) => {
|
|
|
2530
2633
|
Loader.displayName = "Loader";
|
|
2531
2634
|
|
|
2532
2635
|
// src/components/MaskedInput/index.tsx
|
|
2533
|
-
import { forwardRef as forwardRef9, useState as
|
|
2636
|
+
import { forwardRef as forwardRef9, useState as useState8, useRef as useRef6 } from "react";
|
|
2534
2637
|
|
|
2535
2638
|
// src/components/MaskedInput/utils.ts
|
|
2536
2639
|
var MAX_LENGTHS = {
|
|
@@ -2597,7 +2700,7 @@ var applyMask = (value, maskType) => {
|
|
|
2597
2700
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2598
2701
|
var MaskedInput = forwardRef9(
|
|
2599
2702
|
({ maskType, onChange, ...props }, ref) => {
|
|
2600
|
-
const [value, setValue] =
|
|
2703
|
+
const [value, setValue] = useState8("");
|
|
2601
2704
|
const inputRef = useRef6(null);
|
|
2602
2705
|
const handleChange = (e) => {
|
|
2603
2706
|
const { value: inputValue, selectionStart } = e.target;
|
|
@@ -2831,7 +2934,7 @@ import { jsx as jsx37 } from "react/jsx-runtime";
|
|
|
2831
2934
|
var StyledHeading = styled("h2", {
|
|
2832
2935
|
fontFamily: "$default",
|
|
2833
2936
|
lineHeight: "$shorter",
|
|
2834
|
-
margin:
|
|
2937
|
+
margin: "1px",
|
|
2835
2938
|
color: "$black",
|
|
2836
2939
|
variants: {
|
|
2837
2940
|
size: {
|
|
@@ -2857,7 +2960,7 @@ Heading.displayName = "Heading";
|
|
|
2857
2960
|
// src/components/Select/index.tsx
|
|
2858
2961
|
import { TriangleDownIcon, TriangleUpIcon } from "@radix-ui/react-icons";
|
|
2859
2962
|
import * as CustomSelect2 from "@radix-ui/react-select";
|
|
2860
|
-
import { forwardRef as forwardRef11, useState as
|
|
2963
|
+
import { forwardRef as forwardRef11, useState as useState9 } from "react";
|
|
2861
2964
|
|
|
2862
2965
|
// src/components/Select/styles.ts
|
|
2863
2966
|
import * as Select from "@radix-ui/react-select";
|
|
@@ -3005,7 +3108,7 @@ var Select2 = forwardRef11(
|
|
|
3005
3108
|
style,
|
|
3006
3109
|
...rest
|
|
3007
3110
|
}, ref) => {
|
|
3008
|
-
const [open, setOpen] =
|
|
3111
|
+
const [open, setOpen] = useState9(false);
|
|
3009
3112
|
return /* @__PURE__ */ jsxs15(StyledWrapper4, { css: css2, className, style, children: [
|
|
3010
3113
|
label && /* @__PURE__ */ jsx38(Label3, { children: label }),
|
|
3011
3114
|
/* @__PURE__ */ jsxs15(
|
|
@@ -3323,7 +3426,7 @@ var ToastProgress = styled("div", {
|
|
|
3323
3426
|
borderBottomRightRadius: "$full",
|
|
3324
3427
|
backgroundColor: "$clickpalm_light",
|
|
3325
3428
|
animationTimingFunction: "linear",
|
|
3326
|
-
animation: `${progress}
|
|
3429
|
+
animation: `${progress} 6s linear`,
|
|
3327
3430
|
animationFillMode: "forwards",
|
|
3328
3431
|
variants: {
|
|
3329
3432
|
paused: {
|
|
@@ -3397,7 +3500,7 @@ var Toast = () => {
|
|
|
3397
3500
|
removeToast(message.id);
|
|
3398
3501
|
},
|
|
3399
3502
|
variant: message.variant,
|
|
3400
|
-
duration:
|
|
3503
|
+
duration: 6e3,
|
|
3401
3504
|
onPause: () => setPaused(true),
|
|
3402
3505
|
onResume: () => setPaused(false),
|
|
3403
3506
|
children: [
|
|
@@ -3700,7 +3803,7 @@ var MultiStep = ({
|
|
|
3700
3803
|
MultiStep.displayName = "MultiStep";
|
|
3701
3804
|
|
|
3702
3805
|
// src/components/Carousel/index.tsx
|
|
3703
|
-
import { useState as
|
|
3806
|
+
import { useState as useState11, Children as Children4, cloneElement as cloneElement2 } from "react";
|
|
3704
3807
|
|
|
3705
3808
|
// src/components/Carousel/styles.ts
|
|
3706
3809
|
var CarouselContainer = styled("div", {
|
|
@@ -3812,9 +3915,9 @@ import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
|
3812
3915
|
var SWIPE_THRESHOLD = 50;
|
|
3813
3916
|
var Carousel = ({ title, variant, children }) => {
|
|
3814
3917
|
const items = Children4.toArray(children);
|
|
3815
|
-
const [activeIndex, setActiveIndex] =
|
|
3816
|
-
const [touchStartX, setTouchStartX] =
|
|
3817
|
-
const [touchEndX, setTouchEndX] =
|
|
3918
|
+
const [activeIndex, setActiveIndex] = useState11(0);
|
|
3919
|
+
const [touchStartX, setTouchStartX] = useState11(null);
|
|
3920
|
+
const [touchEndX, setTouchEndX] = useState11(null);
|
|
3818
3921
|
const prev = () => {
|
|
3819
3922
|
setActiveIndex((prevIndex) => prevIndex === 0 ? items.length - 1 : prevIndex - 1);
|
|
3820
3923
|
};
|
|
@@ -3918,7 +4021,7 @@ var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ jsx43(Caro
|
|
|
3918
4021
|
Carousel.Item = CarouselItem;
|
|
3919
4022
|
|
|
3920
4023
|
// src/components/PasswordInput.tsx
|
|
3921
|
-
import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as useRef7, useState as
|
|
4024
|
+
import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as useRef7, useState as useState12 } from "react";
|
|
3922
4025
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3923
4026
|
var ToggleButton = styled("button", {
|
|
3924
4027
|
all: "unset",
|
|
@@ -3936,7 +4039,7 @@ var ToggleButton = styled("button", {
|
|
|
3936
4039
|
});
|
|
3937
4040
|
var PasswordInput = forwardRef12(
|
|
3938
4041
|
({ value, onChange, ...props }, ref) => {
|
|
3939
|
-
const [visible, setVisible] =
|
|
4042
|
+
const [visible, setVisible] = useState12(false);
|
|
3940
4043
|
const innerRef = useRef7(null);
|
|
3941
4044
|
useImperativeHandle2(ref, () => innerRef.current);
|
|
3942
4045
|
const handleToggleVisibility = () => {
|
package/package.json
CHANGED