get-elementa-ui 1.11.6 → 1.14.0
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.esm.js +135 -127
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +135 -127
- package/dist/index.js.map +1 -1
- package/dist/types/components/button-group.d.ts +11 -0
- package/dist/types/components/label.d.ts +4 -0
- package/dist/types/components/spinner.d.ts +2 -0
- package/dist/types/components/text.d.ts +21 -3
- package/package.json +3 -2
- package/dist/types/lib/types.d.ts +0 -22
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { cn as cn$1 } from '@/lib/utils';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import React__default, { useState, useLayoutEffect, forwardRef, createElement, useEffect } from 'react';
|
|
4
5
|
import * as ReactDOM from 'react-dom';
|
|
@@ -65,7 +66,6 @@ function createSlot(ownerName) {
|
|
|
65
66
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
66
67
|
return Slot2;
|
|
67
68
|
}
|
|
68
|
-
var Slot$1 = /* @__PURE__ */ createSlot("Slot");
|
|
69
69
|
// @__NO_SIDE_EFFECTS__
|
|
70
70
|
function createSlotClone(ownerName) {
|
|
71
71
|
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
@@ -6166,8 +6166,83 @@ function isValidOrientation(orientation) {
|
|
|
6166
6166
|
}
|
|
6167
6167
|
var Root = Separator$1;
|
|
6168
6168
|
|
|
6169
|
+
function Avatar({ className, size = 'default', ...props }) {
|
|
6170
|
+
return (jsx(Root$2, { "data-slot": "avatar", "data-size": size, className: cn$1('group/avatar border-stroke-active-primary relative flex size-8 shrink-0 rounded-full border-[1.5px] select-none data-[size=lg]:size-10 data-[size=sm]:size-6', className), ...props }));
|
|
6171
|
+
}
|
|
6172
|
+
|
|
6169
6173
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6170
6174
|
|
|
6175
|
+
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
6176
|
+
const cx = clsx;
|
|
6177
|
+
const cva = (base, config)=>(props)=>{
|
|
6178
|
+
var _config_compoundVariants;
|
|
6179
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
6180
|
+
const { variants, defaultVariants } = config;
|
|
6181
|
+
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
6182
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
6183
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
6184
|
+
if (variantProp === null) return null;
|
|
6185
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
6186
|
+
return variants[variant][variantKey];
|
|
6187
|
+
});
|
|
6188
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
6189
|
+
let [key, value] = param;
|
|
6190
|
+
if (value === undefined) {
|
|
6191
|
+
return acc;
|
|
6192
|
+
}
|
|
6193
|
+
acc[key] = value;
|
|
6194
|
+
return acc;
|
|
6195
|
+
}, {});
|
|
6196
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
|
|
6197
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
6198
|
+
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
6199
|
+
let [key, value] = param;
|
|
6200
|
+
return Array.isArray(value) ? value.includes({
|
|
6201
|
+
...defaultVariants,
|
|
6202
|
+
...propsWithoutUndefined
|
|
6203
|
+
}[key]) : ({
|
|
6204
|
+
...defaultVariants,
|
|
6205
|
+
...propsWithoutUndefined
|
|
6206
|
+
})[key] === value;
|
|
6207
|
+
}) ? [
|
|
6208
|
+
...acc,
|
|
6209
|
+
cvClass,
|
|
6210
|
+
cvClassName
|
|
6211
|
+
] : acc;
|
|
6212
|
+
}, []);
|
|
6213
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
6214
|
+
};
|
|
6215
|
+
|
|
6216
|
+
const buttonVariants = cva("focus-visible:border-ring py-1 cursor-pointer active:scale-95 focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive rounded-[8px] border border-transparent font-body font-bold focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
6217
|
+
variants: {
|
|
6218
|
+
variant: {
|
|
6219
|
+
default: 'bg-bg-active-primary text-text-primary hover:bg-bg-active-hover-primary [a]:hover:bg-primary/80',
|
|
6220
|
+
outline: 'border-stroke-base-primary bg-bg-base-primary hover:bg-muted aria-expanded:bg-muted text-text-primary',
|
|
6221
|
+
secondary: 'bg-bg-active-secondary text-text-primary hover:bg-bg-active-hover-secondary aria-expanded:bg-secondary aria-expanded:text-text-primary',
|
|
6222
|
+
ghost: 'hover:bg-muted text-text-primary aria-expanded:bg-muted',
|
|
6223
|
+
destructive: 'bg-bg-fill-destructive hover:bg-bg-hover-destructive focus-visible:ring-destructive/20 text-text-destructive focus-visible:border-destructive/40 border-stroke-destructive',
|
|
6224
|
+
link: 'text-text-info underline-offset-4 hover:underline'
|
|
6225
|
+
},
|
|
6226
|
+
size: {
|
|
6227
|
+
default: 'h-10 gap-1.5 text-sm px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
6228
|
+
xs: "h-8 gap-1 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
6229
|
+
sm: "h-9 gap-1 px-3 text-sm text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
6230
|
+
lg: 'h-11 gap-1.5 text-base px-3 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
6231
|
+
icon: 'size-8',
|
|
6232
|
+
'icon-xs': "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
6233
|
+
'icon-sm': 'size-7',
|
|
6234
|
+
'icon-lg': 'size-9'
|
|
6235
|
+
}
|
|
6236
|
+
},
|
|
6237
|
+
defaultVariants: {
|
|
6238
|
+
variant: 'default',
|
|
6239
|
+
size: 'default'
|
|
6240
|
+
}
|
|
6241
|
+
});
|
|
6242
|
+
function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
|
|
6243
|
+
return (jsx("button", { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn$1(buttonVariants({ variant, size, className })), ...props }));
|
|
6244
|
+
}
|
|
6245
|
+
|
|
6171
6246
|
/**
|
|
6172
6247
|
* Concatenates two arrays faster than the array spread operator.
|
|
6173
6248
|
*/
|
|
@@ -9371,82 +9446,6 @@ function cn(...inputs) {
|
|
|
9371
9446
|
return twMerge(clsx(inputs));
|
|
9372
9447
|
}
|
|
9373
9448
|
|
|
9374
|
-
function Avatar({ className, size = 'default', ...props }) {
|
|
9375
|
-
return (jsx(Root$2, { "data-slot": "avatar", "data-size": size, className: cn('group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6', className), ...props }));
|
|
9376
|
-
}
|
|
9377
|
-
|
|
9378
|
-
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
9379
|
-
const cx = clsx;
|
|
9380
|
-
const cva = (base, config)=>(props)=>{
|
|
9381
|
-
var _config_compoundVariants;
|
|
9382
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9383
|
-
const { variants, defaultVariants } = config;
|
|
9384
|
-
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
9385
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
9386
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
9387
|
-
if (variantProp === null) return null;
|
|
9388
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
9389
|
-
return variants[variant][variantKey];
|
|
9390
|
-
});
|
|
9391
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
9392
|
-
let [key, value] = param;
|
|
9393
|
-
if (value === undefined) {
|
|
9394
|
-
return acc;
|
|
9395
|
-
}
|
|
9396
|
-
acc[key] = value;
|
|
9397
|
-
return acc;
|
|
9398
|
-
}, {});
|
|
9399
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
|
|
9400
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
9401
|
-
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
9402
|
-
let [key, value] = param;
|
|
9403
|
-
return Array.isArray(value) ? value.includes({
|
|
9404
|
-
...defaultVariants,
|
|
9405
|
-
...propsWithoutUndefined
|
|
9406
|
-
}[key]) : ({
|
|
9407
|
-
...defaultVariants,
|
|
9408
|
-
...propsWithoutUndefined
|
|
9409
|
-
})[key] === value;
|
|
9410
|
-
}) ? [
|
|
9411
|
-
...acc,
|
|
9412
|
-
cvClass,
|
|
9413
|
-
cvClassName
|
|
9414
|
-
] : acc;
|
|
9415
|
-
}, []);
|
|
9416
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9417
|
-
};
|
|
9418
|
-
|
|
9419
|
-
const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
|
|
9420
|
-
variants: {
|
|
9421
|
-
variant: {
|
|
9422
|
-
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
9423
|
-
outline: 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
9424
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
9425
|
-
ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
9426
|
-
destructive: 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
|
|
9427
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
9428
|
-
},
|
|
9429
|
-
size: {
|
|
9430
|
-
default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
9431
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
9432
|
-
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
9433
|
-
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
9434
|
-
icon: 'size-8',
|
|
9435
|
-
'icon-xs': "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
9436
|
-
'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
9437
|
-
'icon-lg': 'size-9'
|
|
9438
|
-
}
|
|
9439
|
-
},
|
|
9440
|
-
defaultVariants: {
|
|
9441
|
-
variant: 'default',
|
|
9442
|
-
size: 'default'
|
|
9443
|
-
}
|
|
9444
|
-
});
|
|
9445
|
-
function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
|
|
9446
|
-
const Comp = asChild ? Slot$1 : 'button';
|
|
9447
|
-
return (jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
9448
|
-
}
|
|
9449
|
-
|
|
9450
9449
|
/**
|
|
9451
9450
|
* @license lucide-react v0.575.0 - ISC
|
|
9452
9451
|
*
|
|
@@ -9598,73 +9597,53 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
9598
9597
|
*/
|
|
9599
9598
|
|
|
9600
9599
|
|
|
9601
|
-
const __iconNode
|
|
9602
|
-
const Check = createLucideIcon("check", __iconNode
|
|
9603
|
-
|
|
9604
|
-
/**
|
|
9605
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9606
|
-
*
|
|
9607
|
-
* This source code is licensed under the ISC license.
|
|
9608
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9609
|
-
*/
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
9613
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
|
|
9614
|
-
|
|
9615
|
-
/**
|
|
9616
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9617
|
-
*
|
|
9618
|
-
* This source code is licensed under the ISC license.
|
|
9619
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9620
|
-
*/
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
9624
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode);
|
|
9600
|
+
const __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
9601
|
+
const Check = createLucideIcon("check", __iconNode);
|
|
9625
9602
|
|
|
9626
9603
|
function Checkbox({ className, ...props }) {
|
|
9627
9604
|
return (jsx(Checkbox$1, { "data-slot": "checkbox", className: cn('border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: jsx(CheckboxIndicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: jsx(Check, {}) }) }));
|
|
9628
9605
|
}
|
|
9629
9606
|
|
|
9607
|
+
const h=({color:c="#000000",height:l="1em",strokeWidth:e=1,width:t="1em"})=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:2},viewBox:"0 0 33 13",height:l,width:t,stroke:c,strokeWidth:e,fill:c,children:jsx("path",{d:"M32.121.435s-3.57 2.356-7.379 4.954a359 359 0 0 0-4.38 3.035c-1.105.778-2.095 1.501-2.886 2.068a2.03 2.03 0 0 1-1.209.388 2.03 2.03 0 0 1-1.21-.385c-1.46-1.026-3.594-2.557-5.812-4.087C4.95 3.445.414.435.414.435a.243.243 0 1 0-.292.39S4.28 4.337 8.328 7.632c2.09 1.7 4.157 3.321 5.55 4.433a3.94 3.94 0 0 0 2.39.815 3.94 3.94 0 0 0 2.39-.812c.766-.6 1.737-1.349 2.793-2.192a344 344 0 0 0 4.14-3.355A658 658 0 0 0 32.413.825a.244.244 0 0 0-.292-.39"})}),d=({color:c="#000000",height:l="1em",strokeWidth:e=1,width:t="1em"})=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:2},viewBox:"0 0 34 13",height:l,width:t,stroke:c,strokeWidth:e,fill:c,children:jsx("path",{d:"M.93 12.828s3.57-2.356 7.378-4.954a359 359 0 0 0 4.38-3.035c1.105-.778 2.095-1.5 2.886-2.068a2.03 2.03 0 0 1 1.21-.388c.424 0 .851.121 1.21.385 1.46 1.026 3.593 2.557 5.811 4.087a687 687 0 0 0 8.832 5.973.243.243 0 1 0 .292-.39s-4.159-3.512-8.207-6.807c-2.089-1.7-4.157-3.32-5.55-4.433a3.94 3.94 0 0 0-2.389-.815 3.94 3.94 0 0 0-2.39.812c-.767.601-1.738 1.35-2.794 2.192a344 344 0 0 0-4.14 3.355C3.9 9.672.637 12.438.637 12.438a.244.244 0 0 0 .292.39"})}),yl=({color:c="#000000",height:l="1em",strokeWidth:e=1,width:t="1em"})=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:2},viewBox:"0 0 33 24",height:l,width:t,stroke:c,strokeWidth:e,fill:c,children:jsx("path",{d:"M.323 12.132s3.41 4.214 6.18 7.543c1.081 1.3 2.073 2.454 2.694 3.19a1.87 1.87 0 0 0 1.347.634 1.9 1.9 0 0 0 1.403-.554c.697-.691 1.853-1.802 3.233-3.208.96-.978 2.03-2.094 3.146-3.293a443 443 0 0 0 5.721-6.295C28.564 5.106 32.495.577 32.495.577a.037.037 0 0 0 0-.052.037.037 0 0 0-.053 0s-4.42 4.053-9.34 8.704a446 446 0 0 0-6.139 5.888 179 179 0 0 0-3.207 3.234c-1.369 1.417-2.448 2.602-3.12 3.318l-.063.05-.099-.018c-.674-.687-1.73-1.781-2.925-2.98a841 841 0 0 0-6.936-6.854.197.197 0 0 0-.277-.013.197.197 0 0 0-.013.278"})});
|
|
9608
|
+
|
|
9630
9609
|
function Select({ ...props }) {
|
|
9631
9610
|
return jsx(Root2, { "data-slot": "select", ...props });
|
|
9632
9611
|
}
|
|
9633
9612
|
function SelectGroup({ className, ...props }) {
|
|
9634
|
-
return (jsx(Group, { "data-slot": "select-group", className: cn('scroll-my-1 p-1', className), ...props }));
|
|
9613
|
+
return (jsx(Group, { "data-slot": "select-group", className: cn$1('scroll-my-1 p-1', className), ...props }));
|
|
9635
9614
|
}
|
|
9636
9615
|
function SelectValue({ ...props }) {
|
|
9637
9616
|
return jsx(Value, { "data-slot": "select-value", ...props });
|
|
9638
9617
|
}
|
|
9639
9618
|
function SelectTrigger({ className, size = 'default', children, ...props }) {
|
|
9640
|
-
return (jsxs(Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-
|
|
9619
|
+
return (jsxs(Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn$1("border-stroke-flat-secondary font-body data-placeholder:text-text-tertiary bg-bg-flat-primary flex w-fit items-center justify-between gap-1.5 rounded-lg border py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", 'aria-invalid:border-stroke-destructive aria-invalid:ring-bg-fill-destructive aria-invalid:ring-3', 'focus-visible:border-stroke-active-primary focus-visible:ring-bg-fill-active-primary focus-visible:ring-3', 'cursor-pointer', className), ...props, children: [children, jsx(Icon$1, { asChild: true, children: jsx(h, { className: "text-text-primary pointer-events-none size-4" }) })] }));
|
|
9641
9620
|
}
|
|
9642
9621
|
function SelectContent({ className, children, position = 'item-aligned', align = 'center', ...props }) {
|
|
9643
|
-
return (jsx(Portal, { children: jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: cn('bg-
|
|
9644
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, align: align, ...props, children: [jsx(SelectScrollUpButton, {}), jsx(Viewport, { "data-position": position, className: cn('data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)', position === 'popper' && ''), children: children }), jsx(SelectScrollDownButton, {})] }) }));
|
|
9622
|
+
return (jsx(Portal, { children: jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: cn$1('bg-bg-flat-primary text-text-primary ring-stroke-flat-secondary/30 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none', position === 'popper' &&
|
|
9623
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, align: align, ...props, children: [jsx(SelectScrollUpButton, {}), jsx(Viewport, { "data-position": position, className: cn$1('data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)', position === 'popper' && ''), children: children }), jsx(SelectScrollDownButton, {})] }) }));
|
|
9645
9624
|
}
|
|
9646
9625
|
function SelectLabel({ className, ...props }) {
|
|
9647
|
-
return (jsx(Label, { "data-slot": "select-label", className: cn('text-
|
|
9626
|
+
return (jsx(Label, { "data-slot": "select-label", className: cn$1('text-text-primary font-body px-1.5 py-1 text-xs', className), ...props }));
|
|
9648
9627
|
}
|
|
9649
9628
|
function SelectItem({ className, children, ...props }) {
|
|
9650
|
-
return (jsxs(Item, { "data-slot": "select-item", className: cn("focus:bg-
|
|
9629
|
+
return (jsxs(Item, { "data-slot": "select-item", className: cn$1('relative flex w-full items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5', "focus:bg-bg-base-selected-primary focus:text-text-primary not-data-[variant=destructive]:focus:**:text-text-primary text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", 'cursor-pointer', className), ...props, children: [jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: jsx(ItemIndicator, { children: jsx(yl, { className: "pointer-events-none" }) }) }), jsx(ItemText, { children: children })] }));
|
|
9651
9630
|
}
|
|
9652
9631
|
function SelectSeparator({ className, ...props }) {
|
|
9653
|
-
return (jsx(Separator$2, { "data-slot": "select-separator", className: cn('bg-
|
|
9632
|
+
return (jsx(Separator$2, { "data-slot": "select-separator", className: cn$1('bg-stroke-flat-primary pointer-events-none -mx-1 my-1 h-px', className), ...props }));
|
|
9654
9633
|
}
|
|
9655
9634
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9656
|
-
return (jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("bg-
|
|
9635
|
+
return (jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn$1("bg-bg-flat-primary z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: jsx(d, {}) }));
|
|
9657
9636
|
}
|
|
9658
9637
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9659
|
-
return (jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("bg-
|
|
9638
|
+
return (jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn$1("bg-bg-flat-primary z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: jsx(h, {}) }));
|
|
9660
9639
|
}
|
|
9661
9640
|
|
|
9662
9641
|
function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
9663
|
-
return (jsx(Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('bg-
|
|
9642
|
+
return (jsx(Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn$1('bg-stroke-base-primary shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch', className), ...props }));
|
|
9664
9643
|
}
|
|
9665
9644
|
|
|
9666
9645
|
function Skeleton({ className, ...props }) {
|
|
9667
|
-
return (jsx("div", { "data-slot": "skeleton", className: cn('bg-
|
|
9646
|
+
return (jsx("div", { "data-slot": "skeleton", className: cn$1('bg-bg-modal-primary animate-pulse rounded-md', className), ...props }));
|
|
9668
9647
|
}
|
|
9669
9648
|
|
|
9670
9649
|
var TextVariant;
|
|
@@ -9682,15 +9661,15 @@ var TextVariant;
|
|
|
9682
9661
|
TextVariant[TextVariant["Caption"] = 10] = "Caption";
|
|
9683
9662
|
TextVariant[TextVariant["Custom"] = 11] = "Custom";
|
|
9684
9663
|
})(TextVariant || (TextVariant = {}));
|
|
9685
|
-
|
|
9686
9664
|
/**
|
|
9687
9665
|
* This function renders the Text component for the library.
|
|
9688
9666
|
*/
|
|
9689
|
-
function Text({ variant = TextVariant.Body, color, children,
|
|
9667
|
+
function Text({ variant = TextVariant.Body, color = 'text-text-primary', children, className }) {
|
|
9690
9668
|
// SECTION: Constants and Variables
|
|
9691
|
-
const
|
|
9669
|
+
const baseClassNames = 'w-fit';
|
|
9692
9670
|
// !SECTION: Constants and Variables
|
|
9693
9671
|
// SECTION: States
|
|
9672
|
+
const [internalClassName, setInternalClassName] = useState('');
|
|
9694
9673
|
// !SECTION: States
|
|
9695
9674
|
// SECTION: Functions
|
|
9696
9675
|
/**
|
|
@@ -9702,23 +9681,29 @@ function Text({ variant = TextVariant.Body, color, children, customClassName })
|
|
|
9702
9681
|
const getVariantClass = (variant) => {
|
|
9703
9682
|
switch (variant) {
|
|
9704
9683
|
case TextVariant.H1:
|
|
9705
|
-
return '
|
|
9684
|
+
return '';
|
|
9706
9685
|
case TextVariant.H2:
|
|
9707
|
-
return '
|
|
9686
|
+
return '';
|
|
9708
9687
|
case TextVariant.H3:
|
|
9709
|
-
return '
|
|
9688
|
+
return '';
|
|
9710
9689
|
case TextVariant.H4:
|
|
9711
|
-
return '
|
|
9690
|
+
return '';
|
|
9712
9691
|
case TextVariant.H5:
|
|
9713
|
-
return '
|
|
9692
|
+
return '';
|
|
9714
9693
|
case TextVariant.H6:
|
|
9715
|
-
return '
|
|
9694
|
+
return '';
|
|
9716
9695
|
case TextVariant.Body:
|
|
9717
|
-
return 'text-
|
|
9696
|
+
return 'text-sm font-body';
|
|
9697
|
+
case TextVariant.Subtitle1:
|
|
9698
|
+
return 'text-sm font-medium font-body';
|
|
9699
|
+
case TextVariant.Subtitle2:
|
|
9700
|
+
return 'text-xs font-medium font-body';
|
|
9718
9701
|
case TextVariant.Button:
|
|
9719
|
-
return 'text-
|
|
9702
|
+
return 'text-sm font-medium font-body';
|
|
9703
|
+
case TextVariant.Caption:
|
|
9704
|
+
return 'text-xs font-body';
|
|
9720
9705
|
default:
|
|
9721
|
-
return 'text-
|
|
9706
|
+
return 'text-sm font-body';
|
|
9722
9707
|
}
|
|
9723
9708
|
};
|
|
9724
9709
|
// !SECTION Functions
|
|
@@ -9726,11 +9711,34 @@ function Text({ variant = TextVariant.Body, color, children, customClassName })
|
|
|
9726
9711
|
// !SECTION: Event Handlers
|
|
9727
9712
|
// SECTION: Side Effects
|
|
9728
9713
|
useEffect(() => {
|
|
9729
|
-
|
|
9730
|
-
}, [variant, color,
|
|
9714
|
+
setInternalClassName(cn$1(baseClassNames, getVariantClass(variant), color, className));
|
|
9715
|
+
}, [variant, color, className]);
|
|
9731
9716
|
// !SECTION: Side Effects
|
|
9732
9717
|
// SECTION: UI
|
|
9733
|
-
|
|
9718
|
+
switch (variant) {
|
|
9719
|
+
case TextVariant.H1:
|
|
9720
|
+
return jsx("h1", { className: internalClassName, children: children });
|
|
9721
|
+
case TextVariant.H2:
|
|
9722
|
+
return jsx("h2", { className: internalClassName, children: children });
|
|
9723
|
+
case TextVariant.H3:
|
|
9724
|
+
return jsx("h3", { className: internalClassName, children: children });
|
|
9725
|
+
case TextVariant.H4:
|
|
9726
|
+
return jsx("h4", { className: internalClassName, children: children });
|
|
9727
|
+
case TextVariant.H5:
|
|
9728
|
+
return jsx("h5", { className: internalClassName, children: children });
|
|
9729
|
+
case TextVariant.H6:
|
|
9730
|
+
return jsx("h6", { className: internalClassName, children: children });
|
|
9731
|
+
case TextVariant.Button:
|
|
9732
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9733
|
+
case TextVariant.Caption:
|
|
9734
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9735
|
+
case TextVariant.Subtitle1:
|
|
9736
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9737
|
+
case TextVariant.Subtitle2:
|
|
9738
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9739
|
+
default:
|
|
9740
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9741
|
+
}
|
|
9734
9742
|
// !SECTION: UI
|
|
9735
9743
|
}
|
|
9736
9744
|
|