aloha-ui-library 0.2.6 → 0.2.7
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/Avatar/Avatar.d.ts +11 -4
- package/dist/components/Avatar/avatarParts.d.ts +23 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +15 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +2 -2
- package/dist/index.esm.js +293 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +292 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import { AlertCircle, EyeOff, Eye, Search, Bell, X, RefreshCw, Info, CheckCircle, Loader2 } from 'lucide-react';
|
|
3
|
+
import { AlertCircle, EyeOff, Eye, ChevronDown, Search, Bell, X, RefreshCw, Info, CheckCircle, Loader2 } from 'lucide-react';
|
|
4
4
|
import { Link as Link$1 } from 'react-router-dom';
|
|
5
5
|
|
|
6
6
|
function _arrayLikeToArray(r, a) {
|
|
@@ -2762,7 +2762,7 @@ var themeVars = {
|
|
|
2762
2762
|
primary: 'var(--theme-primary)'
|
|
2763
2763
|
};
|
|
2764
2764
|
|
|
2765
|
-
var _excluded$
|
|
2765
|
+
var _excluded$r = ["className", "variant", "size", "loading", "disabled", "color", "textColor", "borderColor", "icon", "children", "style", "borderWidth"];
|
|
2766
2766
|
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', {
|
|
2767
2767
|
variants: {
|
|
2768
2768
|
variant: {
|
|
@@ -2799,7 +2799,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2799
2799
|
style = _ref.style,
|
|
2800
2800
|
_ref$borderWidth = _ref.borderWidth,
|
|
2801
2801
|
borderWidth = _ref$borderWidth === void 0 ? 1 : _ref$borderWidth,
|
|
2802
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2802
|
+
props = _objectWithoutProperties(_ref, _excluded$r);
|
|
2803
2803
|
var customStyle = {};
|
|
2804
2804
|
// Aplicar color de fondo si se especifica
|
|
2805
2805
|
if (color) {
|
|
@@ -2858,7 +2858,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2858
2858
|
});
|
|
2859
2859
|
Button.displayName = 'Button';
|
|
2860
2860
|
|
|
2861
|
-
var _excluded$
|
|
2861
|
+
var _excluded$q = ["className", "children", "font", "weight", "color", "style"],
|
|
2862
2862
|
_excluded2$3 = ["className", "children", "font", "weight", "color", "style"],
|
|
2863
2863
|
_excluded3$2 = ["className", "children", "font", "weight", "color", "style"],
|
|
2864
2864
|
_excluded4$1 = ["className", "children", "font", "weight", "color", "style"],
|
|
@@ -2897,7 +2897,7 @@ var H1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2897
2897
|
weight = _ref.weight,
|
|
2898
2898
|
color = _ref.color,
|
|
2899
2899
|
style = _ref.style,
|
|
2900
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2900
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
2901
2901
|
return jsx("h1", _objectSpread2(_objectSpread2({
|
|
2902
2902
|
ref: ref,
|
|
2903
2903
|
className: cn('scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl', fontFamilyClasses[font], weight && fontWeightClasses[weight], className),
|
|
@@ -3052,7 +3052,7 @@ var Muted = /*#__PURE__*/React.forwardRef(function (_ref9, ref) {
|
|
|
3052
3052
|
});
|
|
3053
3053
|
Muted.displayName = 'Muted';
|
|
3054
3054
|
|
|
3055
|
-
var _excluded$
|
|
3055
|
+
var _excluded$p = ["className", "size", "borderRadius", "showBorder", "backgroundColor", "borderColor", "shadow", "padding", "margin", "style"],
|
|
3056
3056
|
_excluded2$2 = ["className", "padding", "margin", "style"],
|
|
3057
3057
|
_excluded3$1 = ["className", "font", "weight", "descriptionColor", "small", "children"],
|
|
3058
3058
|
_excluded4 = ["color"],
|
|
@@ -3151,7 +3151,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3151
3151
|
padding = _ref.padding,
|
|
3152
3152
|
margin = _ref.margin,
|
|
3153
3153
|
style = _ref.style,
|
|
3154
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3154
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
3155
3155
|
return jsx("div", _objectSpread2({
|
|
3156
3156
|
ref: ref,
|
|
3157
3157
|
className: cn('text-card-foreground', sizeClasses$2[size], borderRadiusClasses[borderRadius], showBorder ? 'border' : '', showBorder ? getBorderColor(borderColor) : '', getBackgroundColor(backgroundColor), shadow ? 'shadow-sm' : '', className),
|
|
@@ -3264,49 +3264,232 @@ var CardFooter = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
|
3264
3264
|
});
|
|
3265
3265
|
CardFooter.displayName = 'CardFooter';
|
|
3266
3266
|
|
|
3267
|
-
|
|
3267
|
+
/**
|
|
3268
|
+
* Avatar Parts Catalog
|
|
3269
|
+
* Contains all available avatar customization layers
|
|
3270
|
+
*/
|
|
3271
|
+
var AVATAR_PARTS = [
|
|
3272
|
+
// ========== SKIN ==========
|
|
3273
|
+
{
|
|
3274
|
+
id: 1,
|
|
3275
|
+
type: 'skin',
|
|
3276
|
+
color: '#62391b',
|
|
3277
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base1.png'
|
|
3278
|
+
}, {
|
|
3279
|
+
id: 2,
|
|
3280
|
+
type: 'skin',
|
|
3281
|
+
color: '#fbdfca',
|
|
3282
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base2.png'
|
|
3283
|
+
}, {
|
|
3284
|
+
id: 3,
|
|
3285
|
+
type: 'skin',
|
|
3286
|
+
color: '#fae1ab',
|
|
3287
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base3.png'
|
|
3288
|
+
}, {
|
|
3289
|
+
id: 4,
|
|
3290
|
+
type: 'skin',
|
|
3291
|
+
color: '#ab8b64',
|
|
3292
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base4.png'
|
|
3293
|
+
}, {
|
|
3294
|
+
id: 5,
|
|
3295
|
+
type: 'skin',
|
|
3296
|
+
color: '#e7bc91',
|
|
3297
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base5.png'
|
|
3298
|
+
}, {
|
|
3299
|
+
id: 6,
|
|
3300
|
+
type: 'skin',
|
|
3301
|
+
color: '#b16b49',
|
|
3302
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base6.png'
|
|
3303
|
+
},
|
|
3304
|
+
// ========== EYES ==========
|
|
3305
|
+
{
|
|
3306
|
+
id: 1,
|
|
3307
|
+
type: 'eyes',
|
|
3308
|
+
color: '#383517',
|
|
3309
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes1.png'
|
|
3310
|
+
}, {
|
|
3311
|
+
id: 2,
|
|
3312
|
+
type: 'eyes',
|
|
3313
|
+
color: '#65421e',
|
|
3314
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes2.png'
|
|
3315
|
+
}, {
|
|
3316
|
+
id: 3,
|
|
3317
|
+
type: 'eyes',
|
|
3318
|
+
color: '#aa783e',
|
|
3319
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes3.png'
|
|
3320
|
+
}, {
|
|
3321
|
+
id: 4,
|
|
3322
|
+
type: 'eyes',
|
|
3323
|
+
color: '#889e94',
|
|
3324
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes4.png'
|
|
3325
|
+
}, {
|
|
3326
|
+
id: 5,
|
|
3327
|
+
type: 'eyes',
|
|
3328
|
+
color: '#b8a582',
|
|
3329
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes5.png'
|
|
3330
|
+
}, {
|
|
3331
|
+
id: 6,
|
|
3332
|
+
type: 'eyes',
|
|
3333
|
+
color: '#79bbcb',
|
|
3334
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes6.png'
|
|
3335
|
+
}, {
|
|
3336
|
+
id: 7,
|
|
3337
|
+
type: 'eyes',
|
|
3338
|
+
color: '#8e9452',
|
|
3339
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes7.png'
|
|
3340
|
+
},
|
|
3341
|
+
// ========== EYEBROWS ==========
|
|
3342
|
+
{
|
|
3343
|
+
id: 1,
|
|
3344
|
+
type: 'eyebrow',
|
|
3345
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow1.png'
|
|
3346
|
+
}, {
|
|
3347
|
+
id: 2,
|
|
3348
|
+
type: 'eyebrow',
|
|
3349
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow2.png'
|
|
3350
|
+
}, {
|
|
3351
|
+
id: 3,
|
|
3352
|
+
type: 'eyebrow',
|
|
3353
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow3.png'
|
|
3354
|
+
}, {
|
|
3355
|
+
id: 4,
|
|
3356
|
+
type: 'eyebrow',
|
|
3357
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow4.png'
|
|
3358
|
+
}, {
|
|
3359
|
+
id: 5,
|
|
3360
|
+
type: 'eyebrow',
|
|
3361
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow5.png'
|
|
3362
|
+
},
|
|
3363
|
+
// ========== FACIAL HAIR ==========
|
|
3364
|
+
{
|
|
3365
|
+
id: 1,
|
|
3366
|
+
type: 'facialHair',
|
|
3367
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/facialHair/FacialHair1.png'
|
|
3368
|
+
},
|
|
3369
|
+
// ========== HAIR ==========
|
|
3370
|
+
{
|
|
3371
|
+
id: 1,
|
|
3372
|
+
type: 'hair',
|
|
3373
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair1.png'
|
|
3374
|
+
}, {
|
|
3375
|
+
id: 2,
|
|
3376
|
+
type: 'hair',
|
|
3377
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair2.png'
|
|
3378
|
+
}, {
|
|
3379
|
+
id: 3,
|
|
3380
|
+
type: 'hair',
|
|
3381
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair3.png'
|
|
3382
|
+
},
|
|
3383
|
+
// ========== MOUTH ==========
|
|
3384
|
+
{
|
|
3385
|
+
id: 1,
|
|
3386
|
+
type: 'mouth',
|
|
3387
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth1.png'
|
|
3388
|
+
}, {
|
|
3389
|
+
id: 2,
|
|
3390
|
+
type: 'mouth',
|
|
3391
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth2.png'
|
|
3392
|
+
}, {
|
|
3393
|
+
id: 3,
|
|
3394
|
+
type: 'mouth',
|
|
3395
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth3.png'
|
|
3396
|
+
}, {
|
|
3397
|
+
id: 4,
|
|
3398
|
+
type: 'mouth',
|
|
3399
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth4.png'
|
|
3400
|
+
}, {
|
|
3401
|
+
id: 5,
|
|
3402
|
+
type: 'mouth',
|
|
3403
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth5.png'
|
|
3404
|
+
}, {
|
|
3405
|
+
id: 6,
|
|
3406
|
+
type: 'mouth',
|
|
3407
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth6.png'
|
|
3408
|
+
}, {
|
|
3409
|
+
id: 7,
|
|
3410
|
+
type: 'mouth',
|
|
3411
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth7.png'
|
|
3412
|
+
}, {
|
|
3413
|
+
id: 8,
|
|
3414
|
+
type: 'mouth',
|
|
3415
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth8.png'
|
|
3416
|
+
}];
|
|
3417
|
+
/**
|
|
3418
|
+
* Get avatar part by ID and type
|
|
3419
|
+
*/
|
|
3420
|
+
var getAvatarPart = function getAvatarPart(id, type) {
|
|
3421
|
+
return AVATAR_PARTS.find(function (part) {
|
|
3422
|
+
return part.id === id && part.type === type;
|
|
3423
|
+
});
|
|
3424
|
+
};
|
|
3425
|
+
/**
|
|
3426
|
+
* Get image URL for a part ID and type
|
|
3427
|
+
*/
|
|
3428
|
+
var getAvatarPartImage = function getAvatarPartImage(id, type) {
|
|
3429
|
+
var part = getAvatarPart(id, type);
|
|
3430
|
+
return (part === null || part === void 0 ? void 0 : part.image) || null;
|
|
3431
|
+
};
|
|
3432
|
+
|
|
3433
|
+
var _excluded$o = ["className", "emoji", "size"];
|
|
3434
|
+
var DEFAULT_AVATAR = {
|
|
3435
|
+
skinId: 1,
|
|
3436
|
+
eyebrowId: 1,
|
|
3437
|
+
eyesId: 1,
|
|
3438
|
+
facialHairId: 1,
|
|
3439
|
+
hairId: 1,
|
|
3440
|
+
mouthId: 1
|
|
3441
|
+
};
|
|
3268
3442
|
var Avatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3269
|
-
var _alt$charAt;
|
|
3270
3443
|
var className = _ref.className,
|
|
3271
|
-
|
|
3272
|
-
alt = _ref.alt,
|
|
3273
|
-
fallback = _ref.fallback,
|
|
3444
|
+
emoji = _ref.emoji,
|
|
3274
3445
|
_ref$size = _ref.size,
|
|
3275
|
-
size = _ref$size === void 0 ?
|
|
3276
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3277
|
-
var
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
var
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
xl: 'h-16 w-16 text-lg'
|
|
3286
|
-
};
|
|
3287
|
-
return jsx("div", _objectSpread2(_objectSpread2({
|
|
3446
|
+
size = _ref$size === void 0 ? 100 : _ref$size,
|
|
3447
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
3448
|
+
var currentEmoji = emoji || DEFAULT_AVATAR;
|
|
3449
|
+
var currentSkin = getAvatarPartImage(currentEmoji.skinId, 'skin');
|
|
3450
|
+
var currentEyes = getAvatarPartImage(currentEmoji.eyesId, 'eyes');
|
|
3451
|
+
var currentMouth = getAvatarPartImage(currentEmoji.mouthId, 'mouth');
|
|
3452
|
+
var currentEyebrow = getAvatarPartImage(currentEmoji.eyebrowId, 'eyebrow');
|
|
3453
|
+
var currentHair = getAvatarPartImage(currentEmoji.hairId, 'hair');
|
|
3454
|
+
var currentFacialHair = getAvatarPartImage(currentEmoji.facialHairId, 'facialHair');
|
|
3455
|
+
return jsxs("div", _objectSpread2(_objectSpread2({
|
|
3288
3456
|
ref: ref,
|
|
3289
|
-
className: cn('
|
|
3457
|
+
className: cn('avatar-container', className),
|
|
3458
|
+
style: {
|
|
3459
|
+
width: "".concat(size, "px"),
|
|
3460
|
+
height: "".concat(size, "px")
|
|
3461
|
+
}
|
|
3290
3462
|
}, props), {}, {
|
|
3291
|
-
children:
|
|
3292
|
-
src:
|
|
3293
|
-
alt:
|
|
3294
|
-
className: "
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3463
|
+
children: [currentSkin && jsx("img", {
|
|
3464
|
+
src: currentSkin,
|
|
3465
|
+
alt: "Base",
|
|
3466
|
+
className: "avatar-layer"
|
|
3467
|
+
}), currentEyes && jsx("img", {
|
|
3468
|
+
src: currentEyes,
|
|
3469
|
+
alt: "Eyes",
|
|
3470
|
+
className: "avatar-layer"
|
|
3471
|
+
}), currentEyebrow && jsx("img", {
|
|
3472
|
+
src: currentEyebrow,
|
|
3473
|
+
alt: "Eyebrows",
|
|
3474
|
+
className: "avatar-layer"
|
|
3475
|
+
}), currentMouth && jsx("img", {
|
|
3476
|
+
src: currentMouth,
|
|
3477
|
+
alt: "Mouth",
|
|
3478
|
+
className: "avatar-layer"
|
|
3479
|
+
}), currentHair && jsx("img", {
|
|
3480
|
+
src: currentHair,
|
|
3481
|
+
alt: "Hair",
|
|
3482
|
+
className: "avatar-layer"
|
|
3483
|
+
}), currentFacialHair && jsx("img", {
|
|
3484
|
+
src: currentFacialHair,
|
|
3485
|
+
alt: "Facial Hair",
|
|
3486
|
+
className: "avatar-layer"
|
|
3487
|
+
})]
|
|
3305
3488
|
}));
|
|
3306
3489
|
});
|
|
3307
3490
|
Avatar.displayName = 'Avatar';
|
|
3308
3491
|
|
|
3309
|
-
var _excluded$
|
|
3492
|
+
var _excluded$n = ["className", "variant"];
|
|
3310
3493
|
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', {
|
|
3311
3494
|
variants: {
|
|
3312
3495
|
variant: {
|
|
@@ -3323,7 +3506,7 @@ var badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-
|
|
|
3323
3506
|
function Badge(_ref) {
|
|
3324
3507
|
var className = _ref.className,
|
|
3325
3508
|
variant = _ref.variant,
|
|
3326
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3509
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
3327
3510
|
return jsx("div", _objectSpread2({
|
|
3328
3511
|
className: cn(badgeVariants({
|
|
3329
3512
|
variant: variant
|
|
@@ -3331,11 +3514,11 @@ function Badge(_ref) {
|
|
|
3331
3514
|
}, props));
|
|
3332
3515
|
}
|
|
3333
3516
|
|
|
3334
|
-
var _excluded$
|
|
3517
|
+
var _excluded$m = ["className", "error"];
|
|
3335
3518
|
var FormError = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3336
3519
|
var className = _ref.className,
|
|
3337
3520
|
error = _ref.error,
|
|
3338
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3521
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
3339
3522
|
if (!error) return null;
|
|
3340
3523
|
return jsxs("div", _objectSpread2(_objectSpread2({
|
|
3341
3524
|
ref: ref,
|
|
@@ -3357,7 +3540,7 @@ var FormError = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3357
3540
|
});
|
|
3358
3541
|
FormError.displayName = 'FormError';
|
|
3359
3542
|
|
|
3360
|
-
var _excluded$
|
|
3543
|
+
var _excluded$l = ["className", "type", "label", "helperText", "required", "id", "error"];
|
|
3361
3544
|
var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3362
3545
|
var className = _ref.className,
|
|
3363
3546
|
type = _ref.type,
|
|
@@ -3366,7 +3549,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3366
3549
|
required = _ref.required,
|
|
3367
3550
|
id = _ref.id,
|
|
3368
3551
|
error = _ref.error,
|
|
3369
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3552
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
3370
3553
|
var _useState = useState(false),
|
|
3371
3554
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3372
3555
|
showPassword = _useState2[0],
|
|
@@ -3429,6 +3612,69 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3429
3612
|
});
|
|
3430
3613
|
Input.displayName = 'Input';
|
|
3431
3614
|
|
|
3615
|
+
var _excluded$k = ["className", "label", "helperText", "required", "id", "error", "options", "placeholder", "children"];
|
|
3616
|
+
var Select = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3617
|
+
var className = _ref.className,
|
|
3618
|
+
label = _ref.label,
|
|
3619
|
+
helperText = _ref.helperText,
|
|
3620
|
+
required = _ref.required,
|
|
3621
|
+
id = _ref.id,
|
|
3622
|
+
error = _ref.error,
|
|
3623
|
+
options = _ref.options,
|
|
3624
|
+
placeholder = _ref.placeholder,
|
|
3625
|
+
children = _ref.children,
|
|
3626
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
3627
|
+
var selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
|
|
3628
|
+
return jsxs("div", {
|
|
3629
|
+
className: "w-full",
|
|
3630
|
+
children: [(label || helperText) && jsxs("div", {
|
|
3631
|
+
className: "mb-2",
|
|
3632
|
+
children: [label && jsxs(P, {
|
|
3633
|
+
className: "text-sm font-medium m-0 [&:not(:first-child)]:mt-0 inline",
|
|
3634
|
+
children: [label, required && jsx("span", {
|
|
3635
|
+
style: {
|
|
3636
|
+
color: colors.coral
|
|
3637
|
+
},
|
|
3638
|
+
children: " *"
|
|
3639
|
+
})]
|
|
3640
|
+
}), helperText && jsx(P, {
|
|
3641
|
+
className: "text-xs text-gray-500 m-0 mt-1 [&:not(:first-child)]:mt-1",
|
|
3642
|
+
children: helperText
|
|
3643
|
+
})]
|
|
3644
|
+
}), jsxs("div", {
|
|
3645
|
+
className: "relative",
|
|
3646
|
+
children: [jsxs("select", _objectSpread2(_objectSpread2({
|
|
3647
|
+
id: selectId,
|
|
3648
|
+
className: cn('flex h-10 w-full rounded-lg border-2 px-3 py-2 text-sm transition-all appearance-none pr-9', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', className),
|
|
3649
|
+
style: {
|
|
3650
|
+
borderColor: error ? colors.coral : colors.piedra,
|
|
3651
|
+
backgroundColor: colors.koala
|
|
3652
|
+
},
|
|
3653
|
+
ref: ref,
|
|
3654
|
+
required: required
|
|
3655
|
+
}, props), {}, {
|
|
3656
|
+
children: [placeholder && jsx("option", {
|
|
3657
|
+
value: "",
|
|
3658
|
+
disabled: true,
|
|
3659
|
+
children: placeholder
|
|
3660
|
+
}), options ? options.map(function (opt) {
|
|
3661
|
+
return jsx("option", {
|
|
3662
|
+
value: opt.value,
|
|
3663
|
+
disabled: opt.disabled,
|
|
3664
|
+
children: opt.label
|
|
3665
|
+
}, opt.value);
|
|
3666
|
+
}) : children]
|
|
3667
|
+
})), jsx(ChevronDown, {
|
|
3668
|
+
size: 18,
|
|
3669
|
+
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-gray-500"
|
|
3670
|
+
})]
|
|
3671
|
+
}), error && typeof error === 'string' && jsx(FormError, {
|
|
3672
|
+
error: error
|
|
3673
|
+
})]
|
|
3674
|
+
});
|
|
3675
|
+
});
|
|
3676
|
+
Select.displayName = 'Select';
|
|
3677
|
+
|
|
3432
3678
|
var _excluded$j = ["className", "label", "id"];
|
|
3433
3679
|
var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3434
3680
|
var className = _ref.className,
|
|
@@ -5524,5 +5770,5 @@ var ColorPalette = function ColorPalette(_ref2) {
|
|
|
5524
5770
|
});
|
|
5525
5771
|
};
|
|
5526
5772
|
|
|
5527
|
-
export { Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ColorPalette, ColorSwatch, Emoji, Error, ErrorFullScreen, FormError, FriendListItem, FullPage, Grid, GridItem, H1, H2, H3, H4, Icon, Image, Input, Lead, Link, Loading, LoadingFullScreen, Logo, Muted, Navbar, Notification, P, Pattern, PatternFill, PatternGroup, Popup, QuestionCard, SearchInput, Small, Streak, Subtitle, Switch, TextDivider, Toast, badgeVariants, buttonVariants, cn, colorEntries, colors, cssVars, getColor, getCssVar, themeVars };
|
|
5773
|
+
export { Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatMessage, Checkbox, ColorPalette, ColorSwatch, Emoji, Error, ErrorFullScreen, FormError, FriendListItem, FullPage, Grid, GridItem, H1, H2, H3, H4, Icon, Image, Input, Lead, Link, Loading, LoadingFullScreen, Logo, Muted, Navbar, Notification, P, Pattern, PatternFill, PatternGroup, Popup, QuestionCard, SearchInput, Select, Small, Streak, Subtitle, Switch, TextDivider, Toast, badgeVariants, buttonVariants, cn, colorEntries, colors, cssVars, getColor, getCssVar, themeVars };
|
|
5528
5774
|
//# sourceMappingURL=index.esm.js.map
|