aloha-ui-library 0.2.6 → 0.2.8
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.js
CHANGED
|
@@ -2764,7 +2764,7 @@ var themeVars = {
|
|
|
2764
2764
|
primary: 'var(--theme-primary)'
|
|
2765
2765
|
};
|
|
2766
2766
|
|
|
2767
|
-
var _excluded$
|
|
2767
|
+
var _excluded$r = ["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$r);
|
|
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$q = ["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$q);
|
|
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$p = ["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$p);
|
|
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,49 +3266,232 @@ var CardFooter = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
|
3266
3266
|
});
|
|
3267
3267
|
CardFooter.displayName = 'CardFooter';
|
|
3268
3268
|
|
|
3269
|
-
|
|
3269
|
+
/**
|
|
3270
|
+
* Avatar Parts Catalog
|
|
3271
|
+
* Contains all available avatar customization layers
|
|
3272
|
+
*/
|
|
3273
|
+
var AVATAR_PARTS = [
|
|
3274
|
+
// ========== SKIN ==========
|
|
3275
|
+
{
|
|
3276
|
+
id: 1,
|
|
3277
|
+
type: 'skin',
|
|
3278
|
+
color: '#62391b',
|
|
3279
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base1.png'
|
|
3280
|
+
}, {
|
|
3281
|
+
id: 2,
|
|
3282
|
+
type: 'skin',
|
|
3283
|
+
color: '#fbdfca',
|
|
3284
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base2.png'
|
|
3285
|
+
}, {
|
|
3286
|
+
id: 3,
|
|
3287
|
+
type: 'skin',
|
|
3288
|
+
color: '#fae1ab',
|
|
3289
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base3.png'
|
|
3290
|
+
}, {
|
|
3291
|
+
id: 4,
|
|
3292
|
+
type: 'skin',
|
|
3293
|
+
color: '#ab8b64',
|
|
3294
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base4.png'
|
|
3295
|
+
}, {
|
|
3296
|
+
id: 5,
|
|
3297
|
+
type: 'skin',
|
|
3298
|
+
color: '#e7bc91',
|
|
3299
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base5.png'
|
|
3300
|
+
}, {
|
|
3301
|
+
id: 6,
|
|
3302
|
+
type: 'skin',
|
|
3303
|
+
color: '#b16b49',
|
|
3304
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/base/Base6.png'
|
|
3305
|
+
},
|
|
3306
|
+
// ========== EYES ==========
|
|
3307
|
+
{
|
|
3308
|
+
id: 1,
|
|
3309
|
+
type: 'eyes',
|
|
3310
|
+
color: '#383517',
|
|
3311
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes1.png'
|
|
3312
|
+
}, {
|
|
3313
|
+
id: 2,
|
|
3314
|
+
type: 'eyes',
|
|
3315
|
+
color: '#65421e',
|
|
3316
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes2.png'
|
|
3317
|
+
}, {
|
|
3318
|
+
id: 3,
|
|
3319
|
+
type: 'eyes',
|
|
3320
|
+
color: '#aa783e',
|
|
3321
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes3.png'
|
|
3322
|
+
}, {
|
|
3323
|
+
id: 4,
|
|
3324
|
+
type: 'eyes',
|
|
3325
|
+
color: '#889e94',
|
|
3326
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes4.png'
|
|
3327
|
+
}, {
|
|
3328
|
+
id: 5,
|
|
3329
|
+
type: 'eyes',
|
|
3330
|
+
color: '#b8a582',
|
|
3331
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes5.png'
|
|
3332
|
+
}, {
|
|
3333
|
+
id: 6,
|
|
3334
|
+
type: 'eyes',
|
|
3335
|
+
color: '#79bbcb',
|
|
3336
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes6.png'
|
|
3337
|
+
}, {
|
|
3338
|
+
id: 7,
|
|
3339
|
+
type: 'eyes',
|
|
3340
|
+
color: '#8e9452',
|
|
3341
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyes/Eyes7.png'
|
|
3342
|
+
},
|
|
3343
|
+
// ========== EYEBROWS ==========
|
|
3344
|
+
{
|
|
3345
|
+
id: 1,
|
|
3346
|
+
type: 'eyebrow',
|
|
3347
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow1.png'
|
|
3348
|
+
}, {
|
|
3349
|
+
id: 2,
|
|
3350
|
+
type: 'eyebrow',
|
|
3351
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow2.png'
|
|
3352
|
+
}, {
|
|
3353
|
+
id: 3,
|
|
3354
|
+
type: 'eyebrow',
|
|
3355
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow3.png'
|
|
3356
|
+
}, {
|
|
3357
|
+
id: 4,
|
|
3358
|
+
type: 'eyebrow',
|
|
3359
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow4.png'
|
|
3360
|
+
}, {
|
|
3361
|
+
id: 5,
|
|
3362
|
+
type: 'eyebrow',
|
|
3363
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/eyebrow/Eyebrow5.png'
|
|
3364
|
+
},
|
|
3365
|
+
// ========== FACIAL HAIR ==========
|
|
3366
|
+
{
|
|
3367
|
+
id: 1,
|
|
3368
|
+
type: 'facialHair',
|
|
3369
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/facialHair/FacialHair1.png'
|
|
3370
|
+
},
|
|
3371
|
+
// ========== HAIR ==========
|
|
3372
|
+
{
|
|
3373
|
+
id: 1,
|
|
3374
|
+
type: 'hair',
|
|
3375
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair1.png'
|
|
3376
|
+
}, {
|
|
3377
|
+
id: 2,
|
|
3378
|
+
type: 'hair',
|
|
3379
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair2.png'
|
|
3380
|
+
}, {
|
|
3381
|
+
id: 3,
|
|
3382
|
+
type: 'hair',
|
|
3383
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/hair/Hair3.png'
|
|
3384
|
+
},
|
|
3385
|
+
// ========== MOUTH ==========
|
|
3386
|
+
{
|
|
3387
|
+
id: 1,
|
|
3388
|
+
type: 'mouth',
|
|
3389
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth1.png'
|
|
3390
|
+
}, {
|
|
3391
|
+
id: 2,
|
|
3392
|
+
type: 'mouth',
|
|
3393
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth2.png'
|
|
3394
|
+
}, {
|
|
3395
|
+
id: 3,
|
|
3396
|
+
type: 'mouth',
|
|
3397
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth3.png'
|
|
3398
|
+
}, {
|
|
3399
|
+
id: 4,
|
|
3400
|
+
type: 'mouth',
|
|
3401
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth4.png'
|
|
3402
|
+
}, {
|
|
3403
|
+
id: 5,
|
|
3404
|
+
type: 'mouth',
|
|
3405
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth5.png'
|
|
3406
|
+
}, {
|
|
3407
|
+
id: 6,
|
|
3408
|
+
type: 'mouth',
|
|
3409
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth6.png'
|
|
3410
|
+
}, {
|
|
3411
|
+
id: 7,
|
|
3412
|
+
type: 'mouth',
|
|
3413
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth7.png'
|
|
3414
|
+
}, {
|
|
3415
|
+
id: 8,
|
|
3416
|
+
type: 'mouth',
|
|
3417
|
+
image: 'https://ik.imagekit.io/svccjb2ny/emojiEdit/mouth/Mouth8.png'
|
|
3418
|
+
}];
|
|
3419
|
+
/**
|
|
3420
|
+
* Get avatar part by ID and type
|
|
3421
|
+
*/
|
|
3422
|
+
var getAvatarPart = function getAvatarPart(id, type) {
|
|
3423
|
+
return AVATAR_PARTS.find(function (part) {
|
|
3424
|
+
return part.id === id && part.type === type;
|
|
3425
|
+
});
|
|
3426
|
+
};
|
|
3427
|
+
/**
|
|
3428
|
+
* Get image URL for a part ID and type
|
|
3429
|
+
*/
|
|
3430
|
+
var getAvatarPartImage = function getAvatarPartImage(id, type) {
|
|
3431
|
+
var part = getAvatarPart(id, type);
|
|
3432
|
+
return (part === null || part === void 0 ? void 0 : part.image) || null;
|
|
3433
|
+
};
|
|
3434
|
+
|
|
3435
|
+
var _excluded$o = ["className", "emoji", "size"];
|
|
3436
|
+
var DEFAULT_AVATAR = {
|
|
3437
|
+
skinId: 1,
|
|
3438
|
+
eyebrowId: 1,
|
|
3439
|
+
eyesId: 1,
|
|
3440
|
+
facialHairId: 1,
|
|
3441
|
+
hairId: 1,
|
|
3442
|
+
mouthId: 1
|
|
3443
|
+
};
|
|
3270
3444
|
var Avatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3271
|
-
var _alt$charAt;
|
|
3272
3445
|
var className = _ref.className,
|
|
3273
|
-
|
|
3274
|
-
alt = _ref.alt,
|
|
3275
|
-
fallback = _ref.fallback,
|
|
3446
|
+
emoji = _ref.emoji,
|
|
3276
3447
|
_ref$size = _ref.size,
|
|
3277
|
-
size = _ref$size === void 0 ?
|
|
3278
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3279
|
-
var
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
var
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
xl: 'h-16 w-16 text-lg'
|
|
3288
|
-
};
|
|
3289
|
-
return jsxRuntime.jsx("div", _objectSpread2(_objectSpread2({
|
|
3448
|
+
size = _ref$size === void 0 ? 100 : _ref$size,
|
|
3449
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
3450
|
+
var currentEmoji = emoji || DEFAULT_AVATAR;
|
|
3451
|
+
var currentSkin = getAvatarPartImage(currentEmoji.skinId, 'skin');
|
|
3452
|
+
var currentEyes = getAvatarPartImage(currentEmoji.eyesId, 'eyes');
|
|
3453
|
+
var currentMouth = getAvatarPartImage(currentEmoji.mouthId, 'mouth');
|
|
3454
|
+
var currentEyebrow = getAvatarPartImage(currentEmoji.eyebrowId, 'eyebrow');
|
|
3455
|
+
var currentHair = getAvatarPartImage(currentEmoji.hairId, 'hair');
|
|
3456
|
+
var currentFacialHair = getAvatarPartImage(currentEmoji.facialHairId, 'facialHair');
|
|
3457
|
+
return jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({
|
|
3290
3458
|
ref: ref,
|
|
3291
|
-
className: cn('
|
|
3459
|
+
className: cn('avatar-container', className),
|
|
3460
|
+
style: {
|
|
3461
|
+
width: "".concat(size, "px"),
|
|
3462
|
+
height: "".concat(size, "px")
|
|
3463
|
+
}
|
|
3292
3464
|
}, props), {}, {
|
|
3293
|
-
children:
|
|
3294
|
-
src:
|
|
3295
|
-
alt:
|
|
3296
|
-
className: "
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3465
|
+
children: [currentSkin && jsxRuntime.jsx("img", {
|
|
3466
|
+
src: currentSkin,
|
|
3467
|
+
alt: "Base",
|
|
3468
|
+
className: "avatar-layer"
|
|
3469
|
+
}), currentEyes && jsxRuntime.jsx("img", {
|
|
3470
|
+
src: currentEyes,
|
|
3471
|
+
alt: "Eyes",
|
|
3472
|
+
className: "avatar-layer"
|
|
3473
|
+
}), currentEyebrow && jsxRuntime.jsx("img", {
|
|
3474
|
+
src: currentEyebrow,
|
|
3475
|
+
alt: "Eyebrows",
|
|
3476
|
+
className: "avatar-layer"
|
|
3477
|
+
}), currentMouth && jsxRuntime.jsx("img", {
|
|
3478
|
+
src: currentMouth,
|
|
3479
|
+
alt: "Mouth",
|
|
3480
|
+
className: "avatar-layer"
|
|
3481
|
+
}), currentHair && jsxRuntime.jsx("img", {
|
|
3482
|
+
src: currentHair,
|
|
3483
|
+
alt: "Hair",
|
|
3484
|
+
className: "avatar-layer"
|
|
3485
|
+
}), currentFacialHair && jsxRuntime.jsx("img", {
|
|
3486
|
+
src: currentFacialHair,
|
|
3487
|
+
alt: "Facial Hair",
|
|
3488
|
+
className: "avatar-layer"
|
|
3489
|
+
})]
|
|
3307
3490
|
}));
|
|
3308
3491
|
});
|
|
3309
3492
|
Avatar.displayName = 'Avatar';
|
|
3310
3493
|
|
|
3311
|
-
var _excluded$
|
|
3494
|
+
var _excluded$n = ["className", "variant"];
|
|
3312
3495
|
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
3496
|
variants: {
|
|
3314
3497
|
variant: {
|
|
@@ -3325,7 +3508,7 @@ var badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-
|
|
|
3325
3508
|
function Badge(_ref) {
|
|
3326
3509
|
var className = _ref.className,
|
|
3327
3510
|
variant = _ref.variant,
|
|
3328
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3511
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
3329
3512
|
return jsxRuntime.jsx("div", _objectSpread2({
|
|
3330
3513
|
className: cn(badgeVariants({
|
|
3331
3514
|
variant: variant
|
|
@@ -3333,11 +3516,11 @@ function Badge(_ref) {
|
|
|
3333
3516
|
}, props));
|
|
3334
3517
|
}
|
|
3335
3518
|
|
|
3336
|
-
var _excluded$
|
|
3519
|
+
var _excluded$m = ["className", "error"];
|
|
3337
3520
|
var FormError = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3338
3521
|
var className = _ref.className,
|
|
3339
3522
|
error = _ref.error,
|
|
3340
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3523
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
3341
3524
|
if (!error) return null;
|
|
3342
3525
|
return jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({
|
|
3343
3526
|
ref: ref,
|
|
@@ -3359,7 +3542,7 @@ var FormError = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3359
3542
|
});
|
|
3360
3543
|
FormError.displayName = 'FormError';
|
|
3361
3544
|
|
|
3362
|
-
var _excluded$
|
|
3545
|
+
var _excluded$l = ["className", "type", "label", "helperText", "required", "id", "error"];
|
|
3363
3546
|
var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3364
3547
|
var className = _ref.className,
|
|
3365
3548
|
type = _ref.type,
|
|
@@ -3368,7 +3551,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3368
3551
|
required = _ref.required,
|
|
3369
3552
|
id = _ref.id,
|
|
3370
3553
|
error = _ref.error,
|
|
3371
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3554
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
3372
3555
|
var _useState = React.useState(false),
|
|
3373
3556
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3374
3557
|
showPassword = _useState2[0],
|
|
@@ -3431,6 +3614,69 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3431
3614
|
});
|
|
3432
3615
|
Input.displayName = 'Input';
|
|
3433
3616
|
|
|
3617
|
+
var _excluded$k = ["className", "label", "helperText", "required", "id", "error", "options", "placeholder", "children"];
|
|
3618
|
+
var Select = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3619
|
+
var className = _ref.className,
|
|
3620
|
+
label = _ref.label,
|
|
3621
|
+
helperText = _ref.helperText,
|
|
3622
|
+
required = _ref.required,
|
|
3623
|
+
id = _ref.id,
|
|
3624
|
+
error = _ref.error,
|
|
3625
|
+
options = _ref.options,
|
|
3626
|
+
placeholder = _ref.placeholder,
|
|
3627
|
+
children = _ref.children,
|
|
3628
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
3629
|
+
var selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
|
|
3630
|
+
return jsxRuntime.jsxs("div", {
|
|
3631
|
+
className: "w-full",
|
|
3632
|
+
children: [(label || helperText) && jsxRuntime.jsxs("div", {
|
|
3633
|
+
className: "mb-2",
|
|
3634
|
+
children: [label && jsxRuntime.jsxs(P, {
|
|
3635
|
+
className: "text-sm font-medium m-0 [&:not(:first-child)]:mt-0 inline",
|
|
3636
|
+
children: [label, required && jsxRuntime.jsx("span", {
|
|
3637
|
+
style: {
|
|
3638
|
+
color: colors.coral
|
|
3639
|
+
},
|
|
3640
|
+
children: " *"
|
|
3641
|
+
})]
|
|
3642
|
+
}), helperText && jsxRuntime.jsx(P, {
|
|
3643
|
+
className: "text-xs text-gray-500 m-0 mt-1 [&:not(:first-child)]:mt-1",
|
|
3644
|
+
children: helperText
|
|
3645
|
+
})]
|
|
3646
|
+
}), jsxRuntime.jsxs("div", {
|
|
3647
|
+
className: "relative",
|
|
3648
|
+
children: [jsxRuntime.jsxs("select", _objectSpread2(_objectSpread2({
|
|
3649
|
+
id: selectId,
|
|
3650
|
+
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),
|
|
3651
|
+
style: {
|
|
3652
|
+
borderColor: error ? colors.coral : colors.piedra,
|
|
3653
|
+
backgroundColor: colors.koala
|
|
3654
|
+
},
|
|
3655
|
+
ref: ref,
|
|
3656
|
+
required: required
|
|
3657
|
+
}, props), {}, {
|
|
3658
|
+
children: [placeholder && jsxRuntime.jsx("option", {
|
|
3659
|
+
value: "",
|
|
3660
|
+
disabled: true,
|
|
3661
|
+
children: placeholder
|
|
3662
|
+
}), options ? options.map(function (opt) {
|
|
3663
|
+
return jsxRuntime.jsx("option", {
|
|
3664
|
+
value: opt.value,
|
|
3665
|
+
disabled: opt.disabled,
|
|
3666
|
+
children: opt.label
|
|
3667
|
+
}, opt.value);
|
|
3668
|
+
}) : children]
|
|
3669
|
+
})), jsxRuntime.jsx(lucideReact.ChevronDown, {
|
|
3670
|
+
size: 18,
|
|
3671
|
+
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-gray-500"
|
|
3672
|
+
})]
|
|
3673
|
+
}), error && typeof error === 'string' && jsxRuntime.jsx(FormError, {
|
|
3674
|
+
error: error
|
|
3675
|
+
})]
|
|
3676
|
+
});
|
|
3677
|
+
});
|
|
3678
|
+
Select.displayName = 'Select';
|
|
3679
|
+
|
|
3434
3680
|
var _excluded$j = ["className", "label", "id"];
|
|
3435
3681
|
var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3436
3682
|
var className = _ref.className,
|
|
@@ -5569,6 +5815,7 @@ exports.PatternGroup = PatternGroup;
|
|
|
5569
5815
|
exports.Popup = Popup;
|
|
5570
5816
|
exports.QuestionCard = QuestionCard;
|
|
5571
5817
|
exports.SearchInput = SearchInput;
|
|
5818
|
+
exports.Select = Select;
|
|
5572
5819
|
exports.Small = Small;
|
|
5573
5820
|
exports.Streak = Streak;
|
|
5574
5821
|
exports.Subtitle = Subtitle;
|