@koaris/bloom-ui 1.2.4 → 1.2.6
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.cjs +349 -85
- package/dist/index.d.cts +58 -19
- package/dist/index.d.ts +58 -19
- package/dist/index.mjs +351 -86
- package/package.json +1 -1
- package/tailwind.css +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2787,7 +2787,6 @@ var phoneFormats = {
|
|
|
2787
2787
|
"UK": { countryCode: "+44", format: "$1 $2 $3" },
|
|
2788
2788
|
"DE": { countryCode: "+49", format: "$1 $2 $3" },
|
|
2789
2789
|
"FR": { countryCode: "+33", format: "$1 $2 $3 $4" }
|
|
2790
|
-
// Add more countries as needed
|
|
2791
2790
|
};
|
|
2792
2791
|
var Input = forwardRef2(
|
|
2793
2792
|
({
|
|
@@ -2991,6 +2990,8 @@ var Input = forwardRef2(
|
|
|
2991
2990
|
return "password";
|
|
2992
2991
|
case "email":
|
|
2993
2992
|
return "email";
|
|
2993
|
+
case "datePicker":
|
|
2994
|
+
return "date";
|
|
2994
2995
|
case "date":
|
|
2995
2996
|
case "cpf":
|
|
2996
2997
|
case "phone":
|
|
@@ -3004,15 +3005,15 @@ var Input = forwardRef2(
|
|
|
3004
3005
|
const renderPhonePrefix = () => {
|
|
3005
3006
|
if (type !== "phone") return null;
|
|
3006
3007
|
const format = phoneFormats[countryCode] || phoneFormats["BR"];
|
|
3007
|
-
return /* @__PURE__ */ jsx6("span", { className: "absolute left-
|
|
3008
|
+
return /* @__PURE__ */ jsx6("span", { className: "absolute left-3 top-1.5 text-gray-500", children: format.countryCode });
|
|
3008
3009
|
};
|
|
3009
3010
|
const inputClasses = twMerge(
|
|
3010
|
-
"flex items-center justify-center border-2 border-
|
|
3011
|
+
"flex items-center justify-center border-2 border-gray-400 rounded-sm w-full px-3 py-1 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none transition-all duration-200",
|
|
3011
3012
|
className,
|
|
3012
3013
|
disabled && "opacity-50 cursor-not-allowed",
|
|
3013
3014
|
selected && "border-2 border-orange-500",
|
|
3014
3015
|
validated && isValid && "border-2 border-green-900",
|
|
3015
|
-
error && "border-2 border-red-900",
|
|
3016
|
+
(error || !isValid && inputValue != "") && "border-2 border-red-900",
|
|
3016
3017
|
type === "phone" && "pl-10"
|
|
3017
3018
|
);
|
|
3018
3019
|
const renderPasswordValidation = () => {
|
|
@@ -3155,76 +3156,205 @@ TextInput.displayName = "TextInput";
|
|
|
3155
3156
|
// src/components/TextArea/index.tsx
|
|
3156
3157
|
import {
|
|
3157
3158
|
useEffect as useEffect3,
|
|
3158
|
-
useState as useState5
|
|
3159
|
+
useState as useState5,
|
|
3160
|
+
forwardRef as forwardRef4
|
|
3159
3161
|
} from "react";
|
|
3160
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3161
|
-
var TextArea = (
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
},
|
|
3187
|
-
|
|
3188
|
-
"
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3162
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3163
|
+
var TextArea = forwardRef4(
|
|
3164
|
+
({
|
|
3165
|
+
className,
|
|
3166
|
+
disabled,
|
|
3167
|
+
placeholder,
|
|
3168
|
+
value,
|
|
3169
|
+
validated,
|
|
3170
|
+
error,
|
|
3171
|
+
required,
|
|
3172
|
+
resize = "vertical",
|
|
3173
|
+
type = "text",
|
|
3174
|
+
onClick,
|
|
3175
|
+
errorMessage,
|
|
3176
|
+
onChange: externalOnChange,
|
|
3177
|
+
label,
|
|
3178
|
+
helperText,
|
|
3179
|
+
id,
|
|
3180
|
+
maxLength,
|
|
3181
|
+
minRows = 3,
|
|
3182
|
+
maxRows = 8,
|
|
3183
|
+
size = "md",
|
|
3184
|
+
variant = "primary",
|
|
3185
|
+
showCount = false,
|
|
3186
|
+
autoGrow = false,
|
|
3187
|
+
...rest
|
|
3188
|
+
}, ref) => {
|
|
3189
|
+
const [selected, setSelected] = useState5(false);
|
|
3190
|
+
const [inputValue, setInputValue] = useState5(value || "");
|
|
3191
|
+
const [isValid, setIsValid] = useState5(true);
|
|
3192
|
+
const [rows, setRows] = useState5(minRows);
|
|
3193
|
+
const sizeStyles = {
|
|
3194
|
+
sm: "px-2 py-1 text-sm",
|
|
3195
|
+
md: "px-3 py-2 text-base",
|
|
3196
|
+
lg: "px-4 py-3 text-lg"
|
|
3197
|
+
};
|
|
3198
|
+
const variantStyles = {
|
|
3199
|
+
primary: "border-gray-400 focus:border-orange-500",
|
|
3200
|
+
secondary: "border-neutral-500 bg-neutral-100 focus:border-orange-500",
|
|
3201
|
+
outline: "border-gray-300 bg-transparent focus:border-orange-500"
|
|
3202
|
+
};
|
|
3203
|
+
const resizeStyles = {
|
|
3204
|
+
none: "resize-none",
|
|
3205
|
+
vertical: "resize-y",
|
|
3206
|
+
horizontal: "resize-x",
|
|
3207
|
+
both: "resize"
|
|
3208
|
+
};
|
|
3209
|
+
const handleFocus = () => {
|
|
3210
|
+
setSelected(true);
|
|
3211
|
+
};
|
|
3212
|
+
const handleBlur = () => {
|
|
3213
|
+
setSelected(false);
|
|
3214
|
+
validateInput(inputValue);
|
|
3215
|
+
};
|
|
3216
|
+
const validateInput = (value2) => {
|
|
3217
|
+
if (required && (!value2 || value2.trim().length === 0)) {
|
|
3218
|
+
setIsValid(false);
|
|
3219
|
+
return false;
|
|
3220
|
+
}
|
|
3221
|
+
if (maxLength && value2.length > maxLength) {
|
|
3222
|
+
setIsValid(false);
|
|
3223
|
+
return false;
|
|
3224
|
+
}
|
|
3225
|
+
if (type === "json" && value2.trim().length > 0) {
|
|
3226
|
+
try {
|
|
3227
|
+
JSON.parse(value2);
|
|
3228
|
+
setIsValid(true);
|
|
3229
|
+
return true;
|
|
3230
|
+
} catch (e) {
|
|
3231
|
+
setIsValid(false);
|
|
3232
|
+
return false;
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
setIsValid(true);
|
|
3236
|
+
return true;
|
|
3237
|
+
};
|
|
3238
|
+
const handleInput = (event) => {
|
|
3239
|
+
const newValue = event.currentTarget.value;
|
|
3240
|
+
setInputValue(newValue);
|
|
3241
|
+
validateInput(newValue);
|
|
3242
|
+
if (autoGrow) {
|
|
3243
|
+
const textareaLineHeight = 24;
|
|
3244
|
+
const newRows = Math.max(
|
|
3245
|
+
minRows,
|
|
3246
|
+
Math.min(
|
|
3247
|
+
maxRows,
|
|
3248
|
+
Math.floor(event.currentTarget.scrollHeight / textareaLineHeight)
|
|
3249
|
+
)
|
|
3250
|
+
);
|
|
3251
|
+
setRows(newRows);
|
|
3252
|
+
}
|
|
3253
|
+
if (externalOnChange) {
|
|
3254
|
+
externalOnChange(event);
|
|
3255
|
+
}
|
|
3256
|
+
};
|
|
3257
|
+
useEffect3(() => {
|
|
3258
|
+
setInputValue(value || "");
|
|
3259
|
+
if (value) {
|
|
3260
|
+
validateInput(value);
|
|
3261
|
+
}
|
|
3262
|
+
}, [value, required, maxLength]);
|
|
3263
|
+
const characterCount = inputValue?.length || 0;
|
|
3264
|
+
const hasMaxLength = maxLength !== void 0 && maxLength > 0;
|
|
3265
|
+
const isOverLimit = hasMaxLength && characterCount > maxLength;
|
|
3266
|
+
const textareaClasses = twMerge(
|
|
3267
|
+
"w-full border-2 rounded-sm focus:outline-none transition-all duration-200",
|
|
3268
|
+
"hover:shadow-md hover:shadow-neutral-500",
|
|
3269
|
+
sizeStyles[size],
|
|
3270
|
+
variantStyles[variant],
|
|
3271
|
+
resizeStyles[resize],
|
|
3272
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
3273
|
+
selected && "border-orange-500",
|
|
3274
|
+
validated && isValid && "border-green-500",
|
|
3275
|
+
(error || !isValid && inputValue !== "") && "border-red-900",
|
|
3276
|
+
className
|
|
3277
|
+
);
|
|
3278
|
+
return /* @__PURE__ */ jsxs7("div", { className: "w-full", children: [
|
|
3279
|
+
label && /* @__PURE__ */ jsxs7(
|
|
3280
|
+
"label",
|
|
3281
|
+
{
|
|
3282
|
+
htmlFor: id,
|
|
3283
|
+
className: "block text-sm font-medium text-gray-700 mb-1",
|
|
3284
|
+
children: [
|
|
3285
|
+
label,
|
|
3286
|
+
required && /* @__PURE__ */ jsx8("span", { className: "text-red-500 ml-1", children: "*" })
|
|
3287
|
+
]
|
|
3288
|
+
}
|
|
3201
3289
|
),
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3290
|
+
/* @__PURE__ */ jsx8(
|
|
3291
|
+
"textarea",
|
|
3292
|
+
{
|
|
3293
|
+
ref,
|
|
3294
|
+
id,
|
|
3295
|
+
rows,
|
|
3296
|
+
disabled,
|
|
3297
|
+
required,
|
|
3298
|
+
className: textareaClasses,
|
|
3299
|
+
onClick,
|
|
3300
|
+
onFocus: handleFocus,
|
|
3301
|
+
onChange: handleInput,
|
|
3302
|
+
onBlur: handleBlur,
|
|
3303
|
+
placeholder,
|
|
3304
|
+
value: inputValue,
|
|
3305
|
+
maxLength: hasMaxLength && !showCount ? maxLength : void 0,
|
|
3306
|
+
"aria-invalid": error || !isValid,
|
|
3307
|
+
"aria-describedby": error || !isValid ? `${id}-error` : helperText ? `${id}-helper` : void 0,
|
|
3308
|
+
...rest
|
|
3309
|
+
}
|
|
3310
|
+
),
|
|
3311
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between mt-1", children: [
|
|
3312
|
+
(error || !isValid && inputValue !== "") && /* @__PURE__ */ jsx8("p", { id: `${id}-error`, className: "text-sm text-red-900", role: "alert", children: errorMessage || "This field is invalid." }),
|
|
3313
|
+
helperText && isValid && !error && /* @__PURE__ */ jsx8("p", { id: `${id}-helper`, className: "text-sm text-gray-500", children: helperText }),
|
|
3314
|
+
showCount && hasMaxLength && /* @__PURE__ */ jsxs7(
|
|
3315
|
+
"p",
|
|
3316
|
+
{
|
|
3317
|
+
className: `text-sm ml-auto ${isOverLimit ? "text-red-600" : "text-gray-500"}`,
|
|
3318
|
+
children: [
|
|
3319
|
+
characterCount,
|
|
3320
|
+
"/",
|
|
3321
|
+
maxLength
|
|
3322
|
+
]
|
|
3323
|
+
}
|
|
3324
|
+
)
|
|
3325
|
+
] })
|
|
3326
|
+
] });
|
|
3327
|
+
}
|
|
3328
|
+
);
|
|
3329
|
+
TextArea.displayName = "TextArea";
|
|
3212
3330
|
|
|
3213
3331
|
// src/components/Text/index.tsx
|
|
3214
3332
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
3215
3333
|
var Text = ({
|
|
3216
3334
|
children,
|
|
3217
|
-
color = "neutral
|
|
3335
|
+
color = "neutral",
|
|
3336
|
+
colorShade = "800",
|
|
3218
3337
|
size = "md",
|
|
3219
3338
|
tag = "p",
|
|
3339
|
+
weight = "normal",
|
|
3340
|
+
tracking = "normal",
|
|
3341
|
+
leading = "normal",
|
|
3342
|
+
alignment = "left",
|
|
3343
|
+
truncate = false,
|
|
3344
|
+
italic = false,
|
|
3345
|
+
uppercase = false,
|
|
3346
|
+
lowercase = false,
|
|
3347
|
+
capitalize = false,
|
|
3220
3348
|
className,
|
|
3221
3349
|
...rest
|
|
3222
3350
|
}) => {
|
|
3223
3351
|
const fontSize = {
|
|
3224
|
-
xxs: "text-
|
|
3352
|
+
xxs: "text-xs",
|
|
3353
|
+
// fallback to xs since xxs isn't standard in Tailwind
|
|
3225
3354
|
xs: "text-xs",
|
|
3226
3355
|
sm: "text-sm",
|
|
3227
|
-
md: "text-
|
|
3356
|
+
md: "text-base",
|
|
3357
|
+
// fixed from 'text-md' to 'text-base'
|
|
3228
3358
|
lg: "text-lg",
|
|
3229
3359
|
xl: "text-xl",
|
|
3230
3360
|
"2xl": "text-2xl",
|
|
@@ -3236,22 +3366,88 @@ var Text = ({
|
|
|
3236
3366
|
"8xl": "text-8xl",
|
|
3237
3367
|
"9xl": "text-9xl"
|
|
3238
3368
|
}[size];
|
|
3369
|
+
const fontWeight = {
|
|
3370
|
+
thin: "font-thin",
|
|
3371
|
+
extralight: "font-extralight",
|
|
3372
|
+
light: "font-light",
|
|
3373
|
+
normal: "font-normal",
|
|
3374
|
+
medium: "font-medium",
|
|
3375
|
+
semibold: "font-semibold",
|
|
3376
|
+
bold: "font-bold",
|
|
3377
|
+
extrabold: "font-extrabold",
|
|
3378
|
+
black: "font-black"
|
|
3379
|
+
}[weight];
|
|
3380
|
+
const letterTracking = {
|
|
3381
|
+
tighter: "tracking-tighter",
|
|
3382
|
+
tight: "tracking-tight",
|
|
3383
|
+
normal: "tracking-normal",
|
|
3384
|
+
wide: "tracking-wide",
|
|
3385
|
+
wider: "tracking-wider",
|
|
3386
|
+
widest: "tracking-widest"
|
|
3387
|
+
}[tracking];
|
|
3388
|
+
const lineHeight = {
|
|
3389
|
+
none: "leading-none",
|
|
3390
|
+
tight: "leading-tight",
|
|
3391
|
+
snug: "leading-snug",
|
|
3392
|
+
normal: "leading-normal",
|
|
3393
|
+
relaxed: "leading-relaxed",
|
|
3394
|
+
loose: "leading-loose"
|
|
3395
|
+
}[leading];
|
|
3396
|
+
const textAlignment = {
|
|
3397
|
+
left: "text-left",
|
|
3398
|
+
center: "text-center",
|
|
3399
|
+
right: "text-right",
|
|
3400
|
+
justify: "text-justify"
|
|
3401
|
+
}[alignment];
|
|
3402
|
+
const colorClass = `text-${color}-${colorShade}`;
|
|
3403
|
+
const truncateClass = truncate ? "truncate" : "";
|
|
3404
|
+
const italicClass = italic ? "italic" : "";
|
|
3405
|
+
let transformClass = "";
|
|
3406
|
+
if (uppercase) transformClass = "uppercase";
|
|
3407
|
+
else if (lowercase) transformClass = "lowercase";
|
|
3408
|
+
else if (capitalize) transformClass = "capitalize";
|
|
3239
3409
|
const Tag = tag;
|
|
3240
|
-
return /* @__PURE__ */ jsx9(
|
|
3410
|
+
return /* @__PURE__ */ jsx9(
|
|
3411
|
+
Tag,
|
|
3412
|
+
{
|
|
3413
|
+
className: twMerge(
|
|
3414
|
+
colorClass,
|
|
3415
|
+
fontSize,
|
|
3416
|
+
fontWeight,
|
|
3417
|
+
letterTracking,
|
|
3418
|
+
lineHeight,
|
|
3419
|
+
textAlignment,
|
|
3420
|
+
truncateClass,
|
|
3421
|
+
italicClass,
|
|
3422
|
+
transformClass,
|
|
3423
|
+
className
|
|
3424
|
+
),
|
|
3425
|
+
...rest,
|
|
3426
|
+
children
|
|
3427
|
+
}
|
|
3428
|
+
);
|
|
3241
3429
|
};
|
|
3430
|
+
Text.displayName = "Text";
|
|
3242
3431
|
|
|
3243
3432
|
// src/components/Heading/index.tsx
|
|
3244
3433
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
3245
3434
|
var Heading = ({
|
|
3246
3435
|
children,
|
|
3247
|
-
color = "neutral
|
|
3436
|
+
color = "neutral",
|
|
3437
|
+
colorShade = "800",
|
|
3248
3438
|
size = "lg",
|
|
3249
3439
|
tag = "h2",
|
|
3250
|
-
|
|
3440
|
+
weight = "bold",
|
|
3441
|
+
tracking = "normal",
|
|
3442
|
+
alignment = "left",
|
|
3443
|
+
truncate = false,
|
|
3444
|
+
uppercase = false,
|
|
3445
|
+
className,
|
|
3446
|
+
...rest
|
|
3251
3447
|
}) => {
|
|
3252
3448
|
const fontSize = {
|
|
3253
3449
|
sm: "text-sm",
|
|
3254
|
-
md: "text-
|
|
3450
|
+
md: "text-base",
|
|
3255
3451
|
lg: "text-lg",
|
|
3256
3452
|
xl: "text-xl",
|
|
3257
3453
|
"2xl": "text-2xl",
|
|
@@ -3263,32 +3459,101 @@ var Heading = ({
|
|
|
3263
3459
|
"8xl": "text-8xl",
|
|
3264
3460
|
"9xl": "text-9xl"
|
|
3265
3461
|
}[size];
|
|
3462
|
+
const fontWeight = {
|
|
3463
|
+
normal: "font-normal",
|
|
3464
|
+
medium: "font-medium",
|
|
3465
|
+
semibold: "font-semibold",
|
|
3466
|
+
bold: "font-bold",
|
|
3467
|
+
extrabold: "font-extrabold"
|
|
3468
|
+
}[weight];
|
|
3469
|
+
const letterTracking = {
|
|
3470
|
+
tighter: "tracking-tighter",
|
|
3471
|
+
tight: "tracking-tight",
|
|
3472
|
+
normal: "tracking-normal",
|
|
3473
|
+
wide: "tracking-wide",
|
|
3474
|
+
wider: "tracking-wider",
|
|
3475
|
+
widest: "tracking-widest"
|
|
3476
|
+
}[tracking];
|
|
3477
|
+
const textAlignment = {
|
|
3478
|
+
left: "text-left",
|
|
3479
|
+
center: "text-center",
|
|
3480
|
+
right: "text-right"
|
|
3481
|
+
}[alignment];
|
|
3482
|
+
const colorClass = `text-${color}-${colorShade}`;
|
|
3483
|
+
const truncateClass = truncate ? "truncate" : "";
|
|
3484
|
+
const uppercaseClass = uppercase ? "uppercase" : "";
|
|
3266
3485
|
const Tag = tag;
|
|
3267
|
-
return /* @__PURE__ */ jsx10(
|
|
3486
|
+
return /* @__PURE__ */ jsx10(
|
|
3487
|
+
Tag,
|
|
3488
|
+
{
|
|
3489
|
+
className: twMerge(
|
|
3490
|
+
colorClass,
|
|
3491
|
+
fontSize,
|
|
3492
|
+
fontWeight,
|
|
3493
|
+
letterTracking,
|
|
3494
|
+
textAlignment,
|
|
3495
|
+
truncateClass,
|
|
3496
|
+
uppercaseClass,
|
|
3497
|
+
className
|
|
3498
|
+
),
|
|
3499
|
+
...rest,
|
|
3500
|
+
children
|
|
3501
|
+
}
|
|
3502
|
+
);
|
|
3268
3503
|
};
|
|
3269
3504
|
|
|
3270
3505
|
// src/components/Box/index.tsx
|
|
3506
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
3271
3507
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3272
|
-
var Box = ({
|
|
3508
|
+
var Box = forwardRef5(({
|
|
3273
3509
|
className,
|
|
3274
3510
|
children,
|
|
3275
3511
|
tag = "div",
|
|
3276
|
-
variant = "secondary"
|
|
3277
|
-
|
|
3512
|
+
variant = "secondary",
|
|
3513
|
+
size = "md",
|
|
3514
|
+
elevated = false,
|
|
3515
|
+
hasBorder = true,
|
|
3516
|
+
isInteractive = false,
|
|
3517
|
+
fullWidth = false,
|
|
3518
|
+
...props
|
|
3519
|
+
}, ref) => {
|
|
3278
3520
|
const Tag = tag;
|
|
3521
|
+
const variantStyles = {
|
|
3522
|
+
primary: "text-neutral-800 bg-neutral-200 border-neutral-300",
|
|
3523
|
+
secondary: "text-neutral-200 bg-neutral-600 border-neutral-800",
|
|
3524
|
+
ghost: "text-neutral-800 bg-transparent border-transparent",
|
|
3525
|
+
outline: "text-neutral-800 bg-transparent border-neutral-300"
|
|
3526
|
+
};
|
|
3527
|
+
const sizeStyles = {
|
|
3528
|
+
sm: "p-3 text-sm",
|
|
3529
|
+
md: "p-6 text-base",
|
|
3530
|
+
lg: "p-8 text-lg",
|
|
3531
|
+
xl: "p-10 text-xl"
|
|
3532
|
+
};
|
|
3533
|
+
const elevationStyles = elevated ? "shadow-md hover:shadow-lg transition-shadow duration-200" : "";
|
|
3534
|
+
const borderStyles = hasBorder ? "border" : "border-0";
|
|
3535
|
+
const interactiveStyles = isInteractive ? "cursor-pointer hover:brightness-105 active:brightness-95 transition-all duration-200" : "";
|
|
3536
|
+
const widthStyles = fullWidth ? "w-full" : "";
|
|
3279
3537
|
return /* @__PURE__ */ jsx11(
|
|
3280
3538
|
Tag,
|
|
3281
3539
|
{
|
|
3540
|
+
ref,
|
|
3282
3541
|
className: twMerge(
|
|
3283
|
-
"
|
|
3284
|
-
|
|
3285
|
-
|
|
3542
|
+
"rounded-md",
|
|
3543
|
+
borderStyles,
|
|
3544
|
+
sizeStyles[size],
|
|
3545
|
+
variantStyles[variant],
|
|
3546
|
+
elevationStyles,
|
|
3547
|
+
interactiveStyles,
|
|
3548
|
+
widthStyles,
|
|
3286
3549
|
className
|
|
3287
3550
|
),
|
|
3551
|
+
...props,
|
|
3288
3552
|
children
|
|
3289
3553
|
}
|
|
3290
3554
|
);
|
|
3291
|
-
};
|
|
3555
|
+
});
|
|
3556
|
+
Box.displayName = "Box";
|
|
3292
3557
|
|
|
3293
3558
|
// src/components/Form/index.tsx
|
|
3294
3559
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
@@ -3334,10 +3599,10 @@ var Avatar = ({ className, ...rest }) => {
|
|
|
3334
3599
|
};
|
|
3335
3600
|
|
|
3336
3601
|
// src/components/MultiStep/index.tsx
|
|
3337
|
-
import { jsx as jsx14, jsxs as
|
|
3602
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3338
3603
|
var MultiStep = ({ className, size, currentStep }) => {
|
|
3339
|
-
return /* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */ jsx14(Text, { tag: "label", color: "
|
|
3604
|
+
return /* @__PURE__ */ jsxs8("div", { className: "w-full", children: [
|
|
3605
|
+
/* @__PURE__ */ jsx14(Text, { tag: "label", color: "primary", size: "xs", children: `Passo ${currentStep} de ${size}` }),
|
|
3341
3606
|
/* @__PURE__ */ jsx14("div", { className: `grid gap-2 grid-cols-${size} grid-flow-col mt-1`, children: Array.from(Array(size).keys()).map((_, index) => {
|
|
3342
3607
|
return /* @__PURE__ */ jsx14(
|
|
3343
3608
|
"div",
|
|
@@ -3355,7 +3620,7 @@ var MultiStep = ({ className, size, currentStep }) => {
|
|
|
3355
3620
|
};
|
|
3356
3621
|
|
|
3357
3622
|
// src/components/Toggle/index.tsx
|
|
3358
|
-
import { jsx as jsx15, jsxs as
|
|
3623
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3359
3624
|
var Toggle = ({
|
|
3360
3625
|
className,
|
|
3361
3626
|
disabled,
|
|
@@ -3394,7 +3659,7 @@ var Toggle = ({
|
|
|
3394
3659
|
}
|
|
3395
3660
|
}
|
|
3396
3661
|
};
|
|
3397
|
-
return /* @__PURE__ */
|
|
3662
|
+
return /* @__PURE__ */ jsxs9(
|
|
3398
3663
|
"div",
|
|
3399
3664
|
{
|
|
3400
3665
|
className: twMerge("flex items-center gap-3", className),
|
|
@@ -3475,7 +3740,7 @@ var Skeleton = ({
|
|
|
3475
3740
|
Skeleton.displayName = "Skeleton";
|
|
3476
3741
|
|
|
3477
3742
|
// src/components/Loading/index.tsx
|
|
3478
|
-
import { jsx as jsx17, jsxs as
|
|
3743
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3479
3744
|
var Loading = ({
|
|
3480
3745
|
size = "md",
|
|
3481
3746
|
color = "primary",
|
|
@@ -3503,7 +3768,7 @@ var Loading = ({
|
|
|
3503
3768
|
md: "text-base",
|
|
3504
3769
|
lg: "text-lg"
|
|
3505
3770
|
};
|
|
3506
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ jsxs10(
|
|
3507
3772
|
"div",
|
|
3508
3773
|
{
|
|
3509
3774
|
className: twMerge(
|
|
@@ -3513,7 +3778,7 @@ var Loading = ({
|
|
|
3513
3778
|
),
|
|
3514
3779
|
role: "status",
|
|
3515
3780
|
children: [
|
|
3516
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ jsxs10(
|
|
3517
3782
|
"svg",
|
|
3518
3783
|
{
|
|
3519
3784
|
className: twMerge(
|
|
@@ -3561,7 +3826,7 @@ Loading.displayName = "Loading";
|
|
|
3561
3826
|
|
|
3562
3827
|
// src/components/Modal/index.tsx
|
|
3563
3828
|
import { useEffect as useEffect4, useState as useState6, useRef } from "react";
|
|
3564
|
-
import { jsx as jsx18, jsxs as
|
|
3829
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3565
3830
|
var Modal = ({
|
|
3566
3831
|
className,
|
|
3567
3832
|
isOpen,
|
|
@@ -3622,7 +3887,7 @@ var Modal = ({
|
|
|
3622
3887
|
"aria-modal": "true",
|
|
3623
3888
|
role: "dialog",
|
|
3624
3889
|
...rest,
|
|
3625
|
-
children: /* @__PURE__ */
|
|
3890
|
+
children: /* @__PURE__ */ jsxs11(
|
|
3626
3891
|
"div",
|
|
3627
3892
|
{
|
|
3628
3893
|
ref: modalRef,
|
|
@@ -3633,7 +3898,7 @@ var Modal = ({
|
|
|
3633
3898
|
className
|
|
3634
3899
|
),
|
|
3635
3900
|
children: [
|
|
3636
|
-
(title || showCloseButton) && /* @__PURE__ */
|
|
3901
|
+
(title || showCloseButton) && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
3637
3902
|
title && /* @__PURE__ */ jsx18("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100", children: title }),
|
|
3638
3903
|
showCloseButton && /* @__PURE__ */ jsx18(
|
|
3639
3904
|
"button",
|
|
@@ -3657,7 +3922,7 @@ var Modal = ({
|
|
|
3657
3922
|
|
|
3658
3923
|
// src/components/Toast/index.tsx
|
|
3659
3924
|
import { useEffect as useEffect5, useState as useState7, useRef as useRef2 } from "react";
|
|
3660
|
-
import { Fragment, jsx as jsx19, jsxs as
|
|
3925
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3661
3926
|
var ToastService = class _ToastService {
|
|
3662
3927
|
constructor() {
|
|
3663
3928
|
this.listeners = /* @__PURE__ */ new Set();
|
|
@@ -3735,7 +4000,7 @@ var Toast = ({
|
|
|
3735
4000
|
warning: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
3736
4001
|
info: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) })
|
|
3737
4002
|
};
|
|
3738
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ jsxs12(
|
|
3739
4004
|
"div",
|
|
3740
4005
|
{
|
|
3741
4006
|
className: twMerge(
|
|
@@ -3747,7 +4012,7 @@ var Toast = ({
|
|
|
3747
4012
|
role: "alert",
|
|
3748
4013
|
children: [
|
|
3749
4014
|
/* @__PURE__ */ jsx19("div", { className: `flex-shrink-0 mr-3 text-${variant}-500`, children: icons[variant] }),
|
|
3750
|
-
/* @__PURE__ */
|
|
4015
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1", children: [
|
|
3751
4016
|
title && /* @__PURE__ */ jsx19("h3", { className: "font-medium text-sm", children: title }),
|
|
3752
4017
|
/* @__PURE__ */ jsx19("div", { className: "text-sm", children: message })
|
|
3753
4018
|
] }),
|
|
@@ -3814,7 +4079,7 @@ var useToast = () => {
|
|
|
3814
4079
|
};
|
|
3815
4080
|
};
|
|
3816
4081
|
var ToastProvider = ({ position = "top-right", children }) => {
|
|
3817
|
-
return /* @__PURE__ */
|
|
4082
|
+
return /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
3818
4083
|
children,
|
|
3819
4084
|
/* @__PURE__ */ jsx19(ToastContainer, { position })
|
|
3820
4085
|
] });
|
package/package.json
CHANGED