aloha-ui-library 0.2.3 → 0.2.5
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/components/FormError/FormError.d.ts +6 -0
- package/dist/components/FormError/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +11 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +171 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +170 -37
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2764,7 +2764,7 @@ var themeVars = {
|
|
|
2764
2764
|
primary: 'var(--theme-primary)'
|
|
2765
2765
|
};
|
|
2766
2766
|
|
|
2767
|
-
var _excluded$
|
|
2767
|
+
var _excluded$q = ["className", "variant", "size", "loading", "disabled", "color", "textColor", "borderColor", "icon", "children", "style", "borderWidth"];
|
|
2768
2768
|
var buttonVariants = cva('inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {
|
|
2769
2769
|
variants: {
|
|
2770
2770
|
variant: {
|
|
@@ -2801,7 +2801,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2801
2801
|
style = _ref.style,
|
|
2802
2802
|
_ref$borderWidth = _ref.borderWidth,
|
|
2803
2803
|
borderWidth = _ref$borderWidth === void 0 ? 1 : _ref$borderWidth,
|
|
2804
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2804
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
2805
2805
|
var customStyle = {};
|
|
2806
2806
|
// Aplicar color de fondo si se especifica
|
|
2807
2807
|
if (color) {
|
|
@@ -2860,7 +2860,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2860
2860
|
});
|
|
2861
2861
|
Button.displayName = 'Button';
|
|
2862
2862
|
|
|
2863
|
-
var _excluded$
|
|
2863
|
+
var _excluded$p = ["className", "children", "font", "weight", "color", "style"],
|
|
2864
2864
|
_excluded2$3 = ["className", "children", "font", "weight", "color", "style"],
|
|
2865
2865
|
_excluded3$2 = ["className", "children", "font", "weight", "color", "style"],
|
|
2866
2866
|
_excluded4$1 = ["className", "children", "font", "weight", "color", "style"],
|
|
@@ -2899,7 +2899,7 @@ var H1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2899
2899
|
weight = _ref.weight,
|
|
2900
2900
|
color = _ref.color,
|
|
2901
2901
|
style = _ref.style,
|
|
2902
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2902
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
2903
2903
|
return jsxRuntime.jsx("h1", _objectSpread2(_objectSpread2({
|
|
2904
2904
|
ref: ref,
|
|
2905
2905
|
className: cn('scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl', fontFamilyClasses[font], weight && fontWeightClasses[weight], className),
|
|
@@ -3054,7 +3054,7 @@ var Muted = /*#__PURE__*/React.forwardRef(function (_ref9, ref) {
|
|
|
3054
3054
|
});
|
|
3055
3055
|
Muted.displayName = 'Muted';
|
|
3056
3056
|
|
|
3057
|
-
var _excluded$
|
|
3057
|
+
var _excluded$o = ["className", "size", "borderRadius", "showBorder", "backgroundColor", "borderColor", "shadow", "padding", "margin", "style"],
|
|
3058
3058
|
_excluded2$2 = ["className", "padding", "margin", "style"],
|
|
3059
3059
|
_excluded3$1 = ["className", "font", "weight", "descriptionColor", "small", "children"],
|
|
3060
3060
|
_excluded4 = ["color"],
|
|
@@ -3153,7 +3153,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3153
3153
|
padding = _ref.padding,
|
|
3154
3154
|
margin = _ref.margin,
|
|
3155
3155
|
style = _ref.style,
|
|
3156
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3156
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
3157
3157
|
return jsxRuntime.jsx("div", _objectSpread2({
|
|
3158
3158
|
ref: ref,
|
|
3159
3159
|
className: cn('text-card-foreground', sizeClasses$2[size], borderRadiusClasses[borderRadius], showBorder ? 'border' : '', showBorder ? getBorderColor(borderColor) : '', getBackgroundColor(backgroundColor), shadow ? 'shadow-sm' : '', className),
|
|
@@ -3266,7 +3266,7 @@ var CardFooter = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
|
3266
3266
|
});
|
|
3267
3267
|
CardFooter.displayName = 'CardFooter';
|
|
3268
3268
|
|
|
3269
|
-
var _excluded$
|
|
3269
|
+
var _excluded$n = ["className", "src", "alt", "fallback", "size"];
|
|
3270
3270
|
var Avatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3271
3271
|
var _alt$charAt;
|
|
3272
3272
|
var className = _ref.className,
|
|
@@ -3275,7 +3275,7 @@ var Avatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3275
3275
|
fallback = _ref.fallback,
|
|
3276
3276
|
_ref$size = _ref.size,
|
|
3277
3277
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3278
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3278
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
3279
3279
|
var _React$useState = React.useState(false),
|
|
3280
3280
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3281
3281
|
imageFailed = _React$useState2[0],
|
|
@@ -3308,7 +3308,7 @@ var Avatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3308
3308
|
});
|
|
3309
3309
|
Avatar.displayName = 'Avatar';
|
|
3310
3310
|
|
|
3311
|
-
var _excluded$
|
|
3311
|
+
var _excluded$m = ["className", "variant"];
|
|
3312
3312
|
var badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
|
|
3313
3313
|
variants: {
|
|
3314
3314
|
variant: {
|
|
@@ -3325,7 +3325,7 @@ var badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-
|
|
|
3325
3325
|
function Badge(_ref) {
|
|
3326
3326
|
var className = _ref.className,
|
|
3327
3327
|
variant = _ref.variant,
|
|
3328
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3328
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
3329
3329
|
return jsxRuntime.jsx("div", _objectSpread2({
|
|
3330
3330
|
className: cn(badgeVariants({
|
|
3331
3331
|
variant: variant
|
|
@@ -3333,7 +3333,33 @@ function Badge(_ref) {
|
|
|
3333
3333
|
}, props));
|
|
3334
3334
|
}
|
|
3335
3335
|
|
|
3336
|
-
var _excluded$
|
|
3336
|
+
var _excluded$l = ["className", "error"];
|
|
3337
|
+
var FormError = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3338
|
+
var className = _ref.className,
|
|
3339
|
+
error = _ref.error,
|
|
3340
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
3341
|
+
if (!error) return null;
|
|
3342
|
+
return jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({
|
|
3343
|
+
ref: ref,
|
|
3344
|
+
className: cn('flex items-center gap-1.5 mt-1.5', className)
|
|
3345
|
+
}, props), {}, {
|
|
3346
|
+
children: [jsxRuntime.jsx(lucideReact.AlertCircle, {
|
|
3347
|
+
className: "w-4 h-4",
|
|
3348
|
+
style: {
|
|
3349
|
+
color: colors.coral
|
|
3350
|
+
}
|
|
3351
|
+
}), jsxRuntime.jsx(P, {
|
|
3352
|
+
className: "text-sm m-0 font-medium",
|
|
3353
|
+
style: {
|
|
3354
|
+
color: colors.coral
|
|
3355
|
+
},
|
|
3356
|
+
children: error
|
|
3357
|
+
})]
|
|
3358
|
+
}));
|
|
3359
|
+
});
|
|
3360
|
+
FormError.displayName = 'FormError';
|
|
3361
|
+
|
|
3362
|
+
var _excluded$k = ["className", "type", "label", "helperText", "required", "id", "error"];
|
|
3337
3363
|
var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3338
3364
|
var className = _ref.className,
|
|
3339
3365
|
type = _ref.type,
|
|
@@ -3341,7 +3367,18 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3341
3367
|
helperText = _ref.helperText,
|
|
3342
3368
|
required = _ref.required,
|
|
3343
3369
|
id = _ref.id,
|
|
3344
|
-
|
|
3370
|
+
error = _ref.error,
|
|
3371
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
3372
|
+
var _useState = React.useState(false),
|
|
3373
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3374
|
+
showPassword = _useState2[0],
|
|
3375
|
+
setShowPassword = _useState2[1];
|
|
3376
|
+
var isPassword = type === 'password';
|
|
3377
|
+
var inputType = isPassword ? showPassword ? 'text' : 'password' : type;
|
|
3378
|
+
// Determine if type was explicitly set to text by parent but it's meant to be a password
|
|
3379
|
+
// Wait, the parent might already be doing `type={showPassword ? 'text' : 'password'}`
|
|
3380
|
+
// If we handle it internally, we check if `type === 'password'`. If the parent does that, our internal toggle wouldn't work when parent overrides.
|
|
3381
|
+
// However, since we now handle it internally, parents won't need to control the toggle.
|
|
3345
3382
|
var inputId = id || "input-".concat(Math.random().toString(36).substr(2, 9));
|
|
3346
3383
|
return jsxRuntime.jsxs("div", {
|
|
3347
3384
|
className: "w-full",
|
|
@@ -3359,27 +3396,47 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3359
3396
|
className: "text-xs text-gray-500 m-0 mt-1 [&:not(:first-child)]:mt-1",
|
|
3360
3397
|
children: helperText
|
|
3361
3398
|
})]
|
|
3362
|
-
}), jsxRuntime.
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3399
|
+
}), jsxRuntime.jsxs("div", {
|
|
3400
|
+
className: "relative",
|
|
3401
|
+
children: [jsxRuntime.jsx("input", _objectSpread2({
|
|
3402
|
+
type: inputType,
|
|
3403
|
+
id: inputId,
|
|
3404
|
+
className: cn('flex h-10 w-full rounded-lg border-2 px-3 py-2 text-sm transition-all', 'placeholder:text-gray-500', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', isPassword ? 'pr-10' : '',
|
|
3405
|
+
// make room for the eye icon
|
|
3406
|
+
error ? 'border-coral/50' : '',
|
|
3407
|
+
// simple error indication on border
|
|
3408
|
+
className),
|
|
3409
|
+
style: {
|
|
3410
|
+
borderColor: error ? colors.coral : colors.piedra,
|
|
3411
|
+
backgroundColor: colors.koala
|
|
3412
|
+
},
|
|
3413
|
+
ref: ref,
|
|
3414
|
+
required: required
|
|
3415
|
+
}, props)), isPassword && jsxRuntime.jsx("button", {
|
|
3416
|
+
type: "button",
|
|
3417
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 focus:outline-none",
|
|
3418
|
+
onClick: function onClick() {
|
|
3419
|
+
return setShowPassword(!showPassword);
|
|
3420
|
+
},
|
|
3421
|
+
children: showPassword ? jsxRuntime.jsx(lucideReact.EyeOff, {
|
|
3422
|
+
size: 18
|
|
3423
|
+
}) : jsxRuntime.jsx(lucideReact.Eye, {
|
|
3424
|
+
size: 18
|
|
3425
|
+
})
|
|
3426
|
+
})]
|
|
3427
|
+
}), error && typeof error === 'string' && jsxRuntime.jsx(FormError, {
|
|
3428
|
+
error: error
|
|
3429
|
+
})]
|
|
3373
3430
|
});
|
|
3374
3431
|
});
|
|
3375
3432
|
Input.displayName = 'Input';
|
|
3376
3433
|
|
|
3377
|
-
var _excluded$
|
|
3434
|
+
var _excluded$j = ["className", "label", "id"];
|
|
3378
3435
|
var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3379
3436
|
var className = _ref.className,
|
|
3380
3437
|
label = _ref.label,
|
|
3381
3438
|
id = _ref.id,
|
|
3382
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3439
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
3383
3440
|
var checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
3384
3441
|
var _React$useState = React.useState(false),
|
|
3385
3442
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -3439,7 +3496,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3439
3496
|
});
|
|
3440
3497
|
Checkbox.displayName = 'Checkbox';
|
|
3441
3498
|
|
|
3442
|
-
var _excluded$
|
|
3499
|
+
var _excluded$i = ["className", "label", "font", "weight", "labelColor", "id"];
|
|
3443
3500
|
var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3444
3501
|
var className = _ref.className,
|
|
3445
3502
|
label = _ref.label,
|
|
@@ -3447,7 +3504,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3447
3504
|
weight = _ref.weight,
|
|
3448
3505
|
labelColor = _ref.labelColor,
|
|
3449
3506
|
id = _ref.id,
|
|
3450
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3507
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
3451
3508
|
var switchId = id || "switch-".concat(Math.random().toString(36).substr(2, 9));
|
|
3452
3509
|
return jsxRuntime.jsxs("div", {
|
|
3453
3510
|
className: "flex items-center space-x-3",
|
|
@@ -3473,11 +3530,11 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3473
3530
|
});
|
|
3474
3531
|
Switch.displayName = 'Switch';
|
|
3475
3532
|
|
|
3476
|
-
var _excluded$
|
|
3533
|
+
var _excluded$h = ["className", "onSearch"];
|
|
3477
3534
|
var SearchInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3478
3535
|
var className = _ref.className,
|
|
3479
3536
|
onSearch = _ref.onSearch,
|
|
3480
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3537
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
3481
3538
|
var handleKeyDown = function handleKeyDown(e) {
|
|
3482
3539
|
if (e.key === 'Enter' && onSearch) {
|
|
3483
3540
|
onSearch(e.currentTarget.value);
|
|
@@ -3497,7 +3554,7 @@ var SearchInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3497
3554
|
});
|
|
3498
3555
|
SearchInput.displayName = 'SearchInput';
|
|
3499
3556
|
|
|
3500
|
-
var _excluded$
|
|
3557
|
+
var _excluded$g = ["type", "title", "message", "timestamp", "avatar", "read", "onClose", "onClick", "className"];
|
|
3501
3558
|
var Notification = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3502
3559
|
var type = _ref.type,
|
|
3503
3560
|
title = _ref.title,
|
|
@@ -3509,7 +3566,7 @@ var Notification = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3509
3566
|
onClose = _ref.onClose,
|
|
3510
3567
|
onClick = _ref.onClick,
|
|
3511
3568
|
className = _ref.className,
|
|
3512
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3569
|
+
props = _objectWithoutProperties(_ref, _excluded$g);
|
|
3513
3570
|
var typeColors = {
|
|
3514
3571
|
like: 'text-red-500',
|
|
3515
3572
|
comment: 'text-blue-500',
|
|
@@ -3560,7 +3617,7 @@ var Notification = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3560
3617
|
});
|
|
3561
3618
|
Notification.displayName = 'Notification';
|
|
3562
3619
|
|
|
3563
|
-
var _excluded$
|
|
3620
|
+
var _excluded$f = ["className", "text", "component", "font", "weight", "textColor", "lineColor", "lineThickness", "avatars", "avatarRingColor", "rightSlot"];
|
|
3564
3621
|
// ── Color de la línea (herencia del original) ─────────────────────
|
|
3565
3622
|
var getLineColorClass = function getLineColorClass(color) {
|
|
3566
3623
|
if (!color || color === 'default') return 'bg-gray-300';
|
|
@@ -3599,7 +3656,7 @@ var TextDivider = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3599
3656
|
avatars = _ref.avatars,
|
|
3600
3657
|
avatarRingColor = _ref.avatarRingColor,
|
|
3601
3658
|
rightSlot = _ref.rightSlot,
|
|
3602
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3659
|
+
props = _objectWithoutProperties(_ref, _excluded$f);
|
|
3603
3660
|
var renderText = function renderText() {
|
|
3604
3661
|
var commonProps = {
|
|
3605
3662
|
font: font,
|
|
@@ -3673,7 +3730,7 @@ var TextDivider = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3673
3730
|
});
|
|
3674
3731
|
TextDivider.displayName = 'TextDivider';
|
|
3675
3732
|
|
|
3676
|
-
var _excluded$
|
|
3733
|
+
var _excluded$e = ["className", "children", "color", "hoverColor", "underline", "external"],
|
|
3677
3734
|
_excluded2$1 = ["to"],
|
|
3678
3735
|
_excluded3 = ["href", "target", "rel"];
|
|
3679
3736
|
var getColorClass = function getColorClass(color) {
|
|
@@ -3737,7 +3794,7 @@ var Link = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3737
3794
|
underline = _ref$underline === void 0 ? 'hover' : _ref$underline,
|
|
3738
3795
|
_ref$external = _ref.external,
|
|
3739
3796
|
external = _ref$external === void 0 ? false : _ref$external,
|
|
3740
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3797
|
+
props = _objectWithoutProperties(_ref, _excluded$e);
|
|
3741
3798
|
var linkClasses = cn('inline-flex items-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', getColorClass(color), hoverColor ? '' : getHoverColorClass(color), getUnderlineClass(underline), className);
|
|
3742
3799
|
// Si tiene la prop "to", usar React Router Link
|
|
3743
3800
|
if ('to' in props && props.to) {
|
|
@@ -3778,7 +3835,7 @@ var Link = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3778
3835
|
});
|
|
3779
3836
|
Link.displayName = 'Link';
|
|
3780
3837
|
|
|
3781
|
-
var _excluded$
|
|
3838
|
+
var _excluded$d = ["src", "alt", "width", "height", "objectFit", "loading", "fallbackSrc", "onError", "className"];
|
|
3782
3839
|
var Image = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3783
3840
|
var src = _ref.src,
|
|
3784
3841
|
alt = _ref.alt,
|
|
@@ -3791,7 +3848,7 @@ var Image = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3791
3848
|
fallbackSrc = _ref.fallbackSrc,
|
|
3792
3849
|
onError = _ref.onError,
|
|
3793
3850
|
className = _ref.className,
|
|
3794
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3851
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
3795
3852
|
var _React$useState = React.useState(src),
|
|
3796
3853
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3797
3854
|
imgSrc = _React$useState2[0],
|
|
@@ -4030,6 +4087,80 @@ var Error = function Error(_ref) {
|
|
|
4030
4087
|
});
|
|
4031
4088
|
};
|
|
4032
4089
|
|
|
4090
|
+
var _excluded$c = ["message", "type", "onClose", "duration", "className", "position"];
|
|
4091
|
+
var Toast = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
4092
|
+
var message = _ref.message,
|
|
4093
|
+
_ref$type = _ref.type,
|
|
4094
|
+
type = _ref$type === void 0 ? 'error' : _ref$type,
|
|
4095
|
+
onClose = _ref.onClose,
|
|
4096
|
+
_ref$duration = _ref.duration,
|
|
4097
|
+
duration = _ref$duration === void 0 ? 3000 : _ref$duration,
|
|
4098
|
+
className = _ref.className,
|
|
4099
|
+
_ref$position = _ref.position,
|
|
4100
|
+
position = _ref$position === void 0 ? 'bottom-center' : _ref$position,
|
|
4101
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
4102
|
+
React.useEffect(function () {
|
|
4103
|
+
if (duration > 0) {
|
|
4104
|
+
var timer = setTimeout(onClose, duration);
|
|
4105
|
+
return function () {
|
|
4106
|
+
return clearTimeout(timer);
|
|
4107
|
+
};
|
|
4108
|
+
}
|
|
4109
|
+
}, [duration, onClose]);
|
|
4110
|
+
var typeConfig = {
|
|
4111
|
+
error: {
|
|
4112
|
+
icon: jsxRuntime.jsx(lucideReact.AlertCircle, {
|
|
4113
|
+
className: "w-5 h-5 text-white"
|
|
4114
|
+
}),
|
|
4115
|
+
bgColor: colors.coral
|
|
4116
|
+
},
|
|
4117
|
+
success: {
|
|
4118
|
+
icon: jsxRuntime.jsx(lucideReact.CheckCircle, {
|
|
4119
|
+
className: "w-5 h-5 text-white"
|
|
4120
|
+
}),
|
|
4121
|
+
bgColor: colors.lima
|
|
4122
|
+
},
|
|
4123
|
+
info: {
|
|
4124
|
+
icon: jsxRuntime.jsx(lucideReact.Info, {
|
|
4125
|
+
className: "w-5 h-5 text-white"
|
|
4126
|
+
}),
|
|
4127
|
+
bgColor: colors.electrico
|
|
4128
|
+
}
|
|
4129
|
+
};
|
|
4130
|
+
var config = typeConfig[type];
|
|
4131
|
+
var positionClasses = {
|
|
4132
|
+
'top-left': 'top-4 left-4',
|
|
4133
|
+
'top-center': 'top-4 left-1/2 -translate-x-1/2',
|
|
4134
|
+
'top-right': 'top-4 right-4',
|
|
4135
|
+
'bottom-left': 'bottom-4 left-4',
|
|
4136
|
+
'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2',
|
|
4137
|
+
'bottom-right': 'bottom-4 right-4'
|
|
4138
|
+
};
|
|
4139
|
+
return jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({
|
|
4140
|
+
ref: ref,
|
|
4141
|
+
className: cn('fixed z-50 flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg min-w-[300px] animate-in fade-in slide-in-from-bottom-5', positionClasses[position], className),
|
|
4142
|
+
style: {
|
|
4143
|
+
backgroundColor: config.bgColor
|
|
4144
|
+
},
|
|
4145
|
+
role: "alert"
|
|
4146
|
+
}, props), {}, {
|
|
4147
|
+
children: [jsxRuntime.jsx("div", {
|
|
4148
|
+
className: "flex-shrink-0",
|
|
4149
|
+
children: config.icon
|
|
4150
|
+
}), jsxRuntime.jsx(P, {
|
|
4151
|
+
className: "text-white m-0 font-medium flex-1 text-sm",
|
|
4152
|
+
children: message
|
|
4153
|
+
}), jsxRuntime.jsx("button", {
|
|
4154
|
+
onClick: onClose,
|
|
4155
|
+
className: "flex-shrink-0 text-white opacity-70 hover:opacity-100 transition-opacity focus:outline-none",
|
|
4156
|
+
children: jsxRuntime.jsx(lucideReact.X, {
|
|
4157
|
+
className: "w-4 h-4"
|
|
4158
|
+
})
|
|
4159
|
+
})]
|
|
4160
|
+
}));
|
|
4161
|
+
});
|
|
4162
|
+
Toast.displayName = 'Toast';
|
|
4163
|
+
|
|
4033
4164
|
var Loading = function Loading(_ref) {
|
|
4034
4165
|
var message = _ref.message,
|
|
4035
4166
|
className = _ref.className,
|
|
@@ -5411,6 +5542,7 @@ exports.ColorSwatch = ColorSwatch;
|
|
|
5411
5542
|
exports.Emoji = Emoji;
|
|
5412
5543
|
exports.Error = Error;
|
|
5413
5544
|
exports.ErrorFullScreen = ErrorFullScreen;
|
|
5545
|
+
exports.FormError = FormError;
|
|
5414
5546
|
exports.FriendListItem = FriendListItem;
|
|
5415
5547
|
exports.FullPage = FullPage;
|
|
5416
5548
|
exports.Grid = Grid;
|
|
@@ -5442,6 +5574,7 @@ exports.Streak = Streak;
|
|
|
5442
5574
|
exports.Subtitle = Subtitle;
|
|
5443
5575
|
exports.Switch = Switch;
|
|
5444
5576
|
exports.TextDivider = TextDivider;
|
|
5577
|
+
exports.Toast = Toast;
|
|
5445
5578
|
exports.badgeVariants = badgeVariants;
|
|
5446
5579
|
exports.buttonVariants = buttonVariants;
|
|
5447
5580
|
exports.cn = cn;
|