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.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var utils = require('@/lib/utils');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var ReactDOM = require('react-dom');
|
|
6
7
|
|
|
@@ -85,7 +86,6 @@ function createSlot(ownerName) {
|
|
|
85
86
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
86
87
|
return Slot2;
|
|
87
88
|
}
|
|
88
|
-
var Slot$1 = /* @__PURE__ */ createSlot("Slot");
|
|
89
89
|
// @__NO_SIDE_EFFECTS__
|
|
90
90
|
function createSlotClone(ownerName) {
|
|
91
91
|
const SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
@@ -6186,8 +6186,83 @@ function isValidOrientation(orientation) {
|
|
|
6186
6186
|
}
|
|
6187
6187
|
var Root = Separator$1;
|
|
6188
6188
|
|
|
6189
|
+
function Avatar({ className, size = 'default', ...props }) {
|
|
6190
|
+
return (jsxRuntime.jsx(Root$2, { "data-slot": "avatar", "data-size": size, className: utils.cn('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 }));
|
|
6191
|
+
}
|
|
6192
|
+
|
|
6189
6193
|
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}
|
|
6190
6194
|
|
|
6195
|
+
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
6196
|
+
const cx = clsx;
|
|
6197
|
+
const cva = (base, config)=>(props)=>{
|
|
6198
|
+
var _config_compoundVariants;
|
|
6199
|
+
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);
|
|
6200
|
+
const { variants, defaultVariants } = config;
|
|
6201
|
+
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
6202
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
6203
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
6204
|
+
if (variantProp === null) return null;
|
|
6205
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
6206
|
+
return variants[variant][variantKey];
|
|
6207
|
+
});
|
|
6208
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
6209
|
+
let [key, value] = param;
|
|
6210
|
+
if (value === undefined) {
|
|
6211
|
+
return acc;
|
|
6212
|
+
}
|
|
6213
|
+
acc[key] = value;
|
|
6214
|
+
return acc;
|
|
6215
|
+
}, {});
|
|
6216
|
+
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)=>{
|
|
6217
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
6218
|
+
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
6219
|
+
let [key, value] = param;
|
|
6220
|
+
return Array.isArray(value) ? value.includes({
|
|
6221
|
+
...defaultVariants,
|
|
6222
|
+
...propsWithoutUndefined
|
|
6223
|
+
}[key]) : ({
|
|
6224
|
+
...defaultVariants,
|
|
6225
|
+
...propsWithoutUndefined
|
|
6226
|
+
})[key] === value;
|
|
6227
|
+
}) ? [
|
|
6228
|
+
...acc,
|
|
6229
|
+
cvClass,
|
|
6230
|
+
cvClassName
|
|
6231
|
+
] : acc;
|
|
6232
|
+
}, []);
|
|
6233
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
6234
|
+
};
|
|
6235
|
+
|
|
6236
|
+
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", {
|
|
6237
|
+
variants: {
|
|
6238
|
+
variant: {
|
|
6239
|
+
default: 'bg-bg-active-primary text-text-primary hover:bg-bg-active-hover-primary [a]:hover:bg-primary/80',
|
|
6240
|
+
outline: 'border-stroke-base-primary bg-bg-base-primary hover:bg-muted aria-expanded:bg-muted text-text-primary',
|
|
6241
|
+
secondary: 'bg-bg-active-secondary text-text-primary hover:bg-bg-active-hover-secondary aria-expanded:bg-secondary aria-expanded:text-text-primary',
|
|
6242
|
+
ghost: 'hover:bg-muted text-text-primary aria-expanded:bg-muted',
|
|
6243
|
+
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',
|
|
6244
|
+
link: 'text-text-info underline-offset-4 hover:underline'
|
|
6245
|
+
},
|
|
6246
|
+
size: {
|
|
6247
|
+
default: 'h-10 gap-1.5 text-sm px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
6248
|
+
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",
|
|
6249
|
+
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",
|
|
6250
|
+
lg: 'h-11 gap-1.5 text-base px-3 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
6251
|
+
icon: 'size-8',
|
|
6252
|
+
'icon-xs': "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
6253
|
+
'icon-sm': 'size-7',
|
|
6254
|
+
'icon-lg': 'size-9'
|
|
6255
|
+
}
|
|
6256
|
+
},
|
|
6257
|
+
defaultVariants: {
|
|
6258
|
+
variant: 'default',
|
|
6259
|
+
size: 'default'
|
|
6260
|
+
}
|
|
6261
|
+
});
|
|
6262
|
+
function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
|
|
6263
|
+
return (jsxRuntime.jsx("button", { "data-slot": "button", "data-variant": variant, "data-size": size, className: utils.cn(buttonVariants({ variant, size, className })), ...props }));
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6191
6266
|
/**
|
|
6192
6267
|
* Concatenates two arrays faster than the array spread operator.
|
|
6193
6268
|
*/
|
|
@@ -9391,82 +9466,6 @@ function cn(...inputs) {
|
|
|
9391
9466
|
return twMerge(clsx(inputs));
|
|
9392
9467
|
}
|
|
9393
9468
|
|
|
9394
|
-
function Avatar({ className, size = 'default', ...props }) {
|
|
9395
|
-
return (jsxRuntime.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 }));
|
|
9396
|
-
}
|
|
9397
|
-
|
|
9398
|
-
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
9399
|
-
const cx = clsx;
|
|
9400
|
-
const cva = (base, config)=>(props)=>{
|
|
9401
|
-
var _config_compoundVariants;
|
|
9402
|
-
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);
|
|
9403
|
-
const { variants, defaultVariants } = config;
|
|
9404
|
-
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
9405
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
9406
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
9407
|
-
if (variantProp === null) return null;
|
|
9408
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
9409
|
-
return variants[variant][variantKey];
|
|
9410
|
-
});
|
|
9411
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
9412
|
-
let [key, value] = param;
|
|
9413
|
-
if (value === undefined) {
|
|
9414
|
-
return acc;
|
|
9415
|
-
}
|
|
9416
|
-
acc[key] = value;
|
|
9417
|
-
return acc;
|
|
9418
|
-
}, {});
|
|
9419
|
-
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)=>{
|
|
9420
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
9421
|
-
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
9422
|
-
let [key, value] = param;
|
|
9423
|
-
return Array.isArray(value) ? value.includes({
|
|
9424
|
-
...defaultVariants,
|
|
9425
|
-
...propsWithoutUndefined
|
|
9426
|
-
}[key]) : ({
|
|
9427
|
-
...defaultVariants,
|
|
9428
|
-
...propsWithoutUndefined
|
|
9429
|
-
})[key] === value;
|
|
9430
|
-
}) ? [
|
|
9431
|
-
...acc,
|
|
9432
|
-
cvClass,
|
|
9433
|
-
cvClassName
|
|
9434
|
-
] : acc;
|
|
9435
|
-
}, []);
|
|
9436
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9437
|
-
};
|
|
9438
|
-
|
|
9439
|
-
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", {
|
|
9440
|
-
variants: {
|
|
9441
|
-
variant: {
|
|
9442
|
-
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
9443
|
-
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',
|
|
9444
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
9445
|
-
ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
9446
|
-
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',
|
|
9447
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
9448
|
-
},
|
|
9449
|
-
size: {
|
|
9450
|
-
default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
9451
|
-
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",
|
|
9452
|
-
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",
|
|
9453
|
-
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
9454
|
-
icon: 'size-8',
|
|
9455
|
-
'icon-xs': "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
9456
|
-
'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
9457
|
-
'icon-lg': 'size-9'
|
|
9458
|
-
}
|
|
9459
|
-
},
|
|
9460
|
-
defaultVariants: {
|
|
9461
|
-
variant: 'default',
|
|
9462
|
-
size: 'default'
|
|
9463
|
-
}
|
|
9464
|
-
});
|
|
9465
|
-
function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
|
|
9466
|
-
const Comp = asChild ? Slot$1 : 'button';
|
|
9467
|
-
return (jsxRuntime.jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
9468
|
-
}
|
|
9469
|
-
|
|
9470
9469
|
/**
|
|
9471
9470
|
* @license lucide-react v0.575.0 - ISC
|
|
9472
9471
|
*
|
|
@@ -9618,73 +9617,53 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
9618
9617
|
*/
|
|
9619
9618
|
|
|
9620
9619
|
|
|
9621
|
-
const __iconNode
|
|
9622
|
-
const Check = createLucideIcon("check", __iconNode
|
|
9623
|
-
|
|
9624
|
-
/**
|
|
9625
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9626
|
-
*
|
|
9627
|
-
* This source code is licensed under the ISC license.
|
|
9628
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9629
|
-
*/
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
9633
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
|
|
9634
|
-
|
|
9635
|
-
/**
|
|
9636
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9637
|
-
*
|
|
9638
|
-
* This source code is licensed under the ISC license.
|
|
9639
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9640
|
-
*/
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
9644
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode);
|
|
9620
|
+
const __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
9621
|
+
const Check = createLucideIcon("check", __iconNode);
|
|
9645
9622
|
|
|
9646
9623
|
function Checkbox({ className, ...props }) {
|
|
9647
9624
|
return (jsxRuntime.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: jsxRuntime.jsx(CheckboxIndicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: jsxRuntime.jsx(Check, {}) }) }));
|
|
9648
9625
|
}
|
|
9649
9626
|
|
|
9627
|
+
const h=({color:c="#000000",height:l="1em",strokeWidth:e=1,width:t="1em"})=>jsxRuntime.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:jsxRuntime.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"})=>jsxRuntime.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:jsxRuntime.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"})=>jsxRuntime.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:jsxRuntime.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"})});
|
|
9628
|
+
|
|
9650
9629
|
function Select({ ...props }) {
|
|
9651
9630
|
return jsxRuntime.jsx(Root2, { "data-slot": "select", ...props });
|
|
9652
9631
|
}
|
|
9653
9632
|
function SelectGroup({ className, ...props }) {
|
|
9654
|
-
return (jsxRuntime.jsx(Group, { "data-slot": "select-group", className: cn('scroll-my-1 p-1', className), ...props }));
|
|
9633
|
+
return (jsxRuntime.jsx(Group, { "data-slot": "select-group", className: utils.cn('scroll-my-1 p-1', className), ...props }));
|
|
9655
9634
|
}
|
|
9656
9635
|
function SelectValue({ ...props }) {
|
|
9657
9636
|
return jsxRuntime.jsx(Value, { "data-slot": "select-value", ...props });
|
|
9658
9637
|
}
|
|
9659
9638
|
function SelectTrigger({ className, size = 'default', children, ...props }) {
|
|
9660
|
-
return (jsxRuntime.jsxs(Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-
|
|
9639
|
+
return (jsxRuntime.jsxs(Trigger, { "data-slot": "select-trigger", "data-size": size, className: utils.cn("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, jsxRuntime.jsx(Icon$1, { asChild: true, children: jsxRuntime.jsx(h, { className: "text-text-primary pointer-events-none size-4" }) })] }));
|
|
9661
9640
|
}
|
|
9662
9641
|
function SelectContent({ className, children, position = 'item-aligned', align = 'center', ...props }) {
|
|
9663
|
-
return (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: cn('bg-
|
|
9664
|
-
'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: [jsxRuntime.jsx(SelectScrollUpButton, {}), jsxRuntime.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 }), jsxRuntime.jsx(SelectScrollDownButton, {})] }) }));
|
|
9642
|
+
return (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: utils.cn('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' &&
|
|
9643
|
+
'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: [jsxRuntime.jsx(SelectScrollUpButton, {}), jsxRuntime.jsx(Viewport, { "data-position": position, className: utils.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 }), jsxRuntime.jsx(SelectScrollDownButton, {})] }) }));
|
|
9665
9644
|
}
|
|
9666
9645
|
function SelectLabel({ className, ...props }) {
|
|
9667
|
-
return (jsxRuntime.jsx(Label, { "data-slot": "select-label", className: cn('text-
|
|
9646
|
+
return (jsxRuntime.jsx(Label, { "data-slot": "select-label", className: utils.cn('text-text-primary font-body px-1.5 py-1 text-xs', className), ...props }));
|
|
9668
9647
|
}
|
|
9669
9648
|
function SelectItem({ className, children, ...props }) {
|
|
9670
|
-
return (jsxRuntime.jsxs(Item, { "data-slot": "select-item", className: cn("focus:bg-
|
|
9649
|
+
return (jsxRuntime.jsxs(Item, { "data-slot": "select-item", className: utils.cn('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: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: jsxRuntime.jsx(ItemIndicator, { children: jsxRuntime.jsx(yl, { className: "pointer-events-none" }) }) }), jsxRuntime.jsx(ItemText, { children: children })] }));
|
|
9671
9650
|
}
|
|
9672
9651
|
function SelectSeparator({ className, ...props }) {
|
|
9673
|
-
return (jsxRuntime.jsx(Separator$2, { "data-slot": "select-separator", className: cn('bg-
|
|
9652
|
+
return (jsxRuntime.jsx(Separator$2, { "data-slot": "select-separator", className: utils.cn('bg-stroke-flat-primary pointer-events-none -mx-1 my-1 h-px', className), ...props }));
|
|
9674
9653
|
}
|
|
9675
9654
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9676
|
-
return (jsxRuntime.jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("bg-
|
|
9655
|
+
return (jsxRuntime.jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: utils.cn("bg-bg-flat-primary z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: jsxRuntime.jsx(d, {}) }));
|
|
9677
9656
|
}
|
|
9678
9657
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9679
|
-
return (jsxRuntime.jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("bg-
|
|
9658
|
+
return (jsxRuntime.jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: utils.cn("bg-bg-flat-primary z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: jsxRuntime.jsx(h, {}) }));
|
|
9680
9659
|
}
|
|
9681
9660
|
|
|
9682
9661
|
function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
9683
|
-
return (jsxRuntime.jsx(Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('bg-
|
|
9662
|
+
return (jsxRuntime.jsx(Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: utils.cn('bg-stroke-base-primary shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch', className), ...props }));
|
|
9684
9663
|
}
|
|
9685
9664
|
|
|
9686
9665
|
function Skeleton({ className, ...props }) {
|
|
9687
|
-
return (jsxRuntime.jsx("div", { "data-slot": "skeleton", className: cn('bg-
|
|
9666
|
+
return (jsxRuntime.jsx("div", { "data-slot": "skeleton", className: utils.cn('bg-bg-modal-primary animate-pulse rounded-md', className), ...props }));
|
|
9688
9667
|
}
|
|
9689
9668
|
|
|
9690
9669
|
var TextVariant;
|
|
@@ -9702,15 +9681,15 @@ var TextVariant;
|
|
|
9702
9681
|
TextVariant[TextVariant["Caption"] = 10] = "Caption";
|
|
9703
9682
|
TextVariant[TextVariant["Custom"] = 11] = "Custom";
|
|
9704
9683
|
})(TextVariant || (TextVariant = {}));
|
|
9705
|
-
|
|
9706
9684
|
/**
|
|
9707
9685
|
* This function renders the Text component for the library.
|
|
9708
9686
|
*/
|
|
9709
|
-
function Text({ variant = TextVariant.Body, color, children,
|
|
9687
|
+
function Text({ variant = TextVariant.Body, color = 'text-text-primary', children, className }) {
|
|
9710
9688
|
// SECTION: Constants and Variables
|
|
9711
|
-
const
|
|
9689
|
+
const baseClassNames = 'w-fit';
|
|
9712
9690
|
// !SECTION: Constants and Variables
|
|
9713
9691
|
// SECTION: States
|
|
9692
|
+
const [internalClassName, setInternalClassName] = React.useState('');
|
|
9714
9693
|
// !SECTION: States
|
|
9715
9694
|
// SECTION: Functions
|
|
9716
9695
|
/**
|
|
@@ -9722,23 +9701,29 @@ function Text({ variant = TextVariant.Body, color, children, customClassName })
|
|
|
9722
9701
|
const getVariantClass = (variant) => {
|
|
9723
9702
|
switch (variant) {
|
|
9724
9703
|
case TextVariant.H1:
|
|
9725
|
-
return '
|
|
9704
|
+
return '';
|
|
9726
9705
|
case TextVariant.H2:
|
|
9727
|
-
return '
|
|
9706
|
+
return '';
|
|
9728
9707
|
case TextVariant.H3:
|
|
9729
|
-
return '
|
|
9708
|
+
return '';
|
|
9730
9709
|
case TextVariant.H4:
|
|
9731
|
-
return '
|
|
9710
|
+
return '';
|
|
9732
9711
|
case TextVariant.H5:
|
|
9733
|
-
return '
|
|
9712
|
+
return '';
|
|
9734
9713
|
case TextVariant.H6:
|
|
9735
|
-
return '
|
|
9714
|
+
return '';
|
|
9736
9715
|
case TextVariant.Body:
|
|
9737
|
-
return 'text-
|
|
9716
|
+
return 'text-sm font-body';
|
|
9717
|
+
case TextVariant.Subtitle1:
|
|
9718
|
+
return 'text-sm font-medium font-body';
|
|
9719
|
+
case TextVariant.Subtitle2:
|
|
9720
|
+
return 'text-xs font-medium font-body';
|
|
9738
9721
|
case TextVariant.Button:
|
|
9739
|
-
return 'text-
|
|
9722
|
+
return 'text-sm font-medium font-body';
|
|
9723
|
+
case TextVariant.Caption:
|
|
9724
|
+
return 'text-xs font-body';
|
|
9740
9725
|
default:
|
|
9741
|
-
return 'text-
|
|
9726
|
+
return 'text-sm font-body';
|
|
9742
9727
|
}
|
|
9743
9728
|
};
|
|
9744
9729
|
// !SECTION Functions
|
|
@@ -9746,11 +9731,34 @@ function Text({ variant = TextVariant.Body, color, children, customClassName })
|
|
|
9746
9731
|
// !SECTION: Event Handlers
|
|
9747
9732
|
// SECTION: Side Effects
|
|
9748
9733
|
React.useEffect(() => {
|
|
9749
|
-
|
|
9750
|
-
}, [variant, color,
|
|
9734
|
+
setInternalClassName(utils.cn(baseClassNames, getVariantClass(variant), color, className));
|
|
9735
|
+
}, [variant, color, className]);
|
|
9751
9736
|
// !SECTION: Side Effects
|
|
9752
9737
|
// SECTION: UI
|
|
9753
|
-
|
|
9738
|
+
switch (variant) {
|
|
9739
|
+
case TextVariant.H1:
|
|
9740
|
+
return jsxRuntime.jsx("h1", { className: internalClassName, children: children });
|
|
9741
|
+
case TextVariant.H2:
|
|
9742
|
+
return jsxRuntime.jsx("h2", { className: internalClassName, children: children });
|
|
9743
|
+
case TextVariant.H3:
|
|
9744
|
+
return jsxRuntime.jsx("h3", { className: internalClassName, children: children });
|
|
9745
|
+
case TextVariant.H4:
|
|
9746
|
+
return jsxRuntime.jsx("h4", { className: internalClassName, children: children });
|
|
9747
|
+
case TextVariant.H5:
|
|
9748
|
+
return jsxRuntime.jsx("h5", { className: internalClassName, children: children });
|
|
9749
|
+
case TextVariant.H6:
|
|
9750
|
+
return jsxRuntime.jsx("h6", { className: internalClassName, children: children });
|
|
9751
|
+
case TextVariant.Button:
|
|
9752
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9753
|
+
case TextVariant.Caption:
|
|
9754
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9755
|
+
case TextVariant.Subtitle1:
|
|
9756
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9757
|
+
case TextVariant.Subtitle2:
|
|
9758
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9759
|
+
default:
|
|
9760
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9761
|
+
}
|
|
9754
9762
|
// !SECTION: UI
|
|
9755
9763
|
}
|
|
9756
9764
|
|