get-elementa-ui 1.12.0 → 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 +34 -45
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -45
- package/dist/index.js.map +1 -1
- package/dist/types/components/button-group.d.ts +11 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -6187,7 +6187,7 @@ function isValidOrientation(orientation) {
|
|
|
6187
6187
|
var Root = Separator$1;
|
|
6188
6188
|
|
|
6189
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
|
|
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
6191
|
}
|
|
6192
6192
|
|
|
6193
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}
|
|
@@ -6240,14 +6240,14 @@ const buttonVariants = cva("focus-visible:border-ring py-1 cursor-pointer active
|
|
|
6240
6240
|
outline: 'border-stroke-base-primary bg-bg-base-primary hover:bg-muted aria-expanded:bg-muted text-text-primary',
|
|
6241
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
6242
|
ghost: 'hover:bg-muted text-text-primary aria-expanded:bg-muted',
|
|
6243
|
-
destructive: 'bg-bg-destructive hover:bg-bg-hover-destructive focus-visible:ring-destructive/20 text-text-destructive focus-visible:border-destructive/40 border-stroke-destructive',
|
|
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
6244
|
link: 'text-text-info underline-offset-4 hover:underline'
|
|
6245
6245
|
},
|
|
6246
6246
|
size: {
|
|
6247
|
-
default: 'h-10 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
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
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-[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 px-3 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-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
6251
|
icon: 'size-8',
|
|
6252
6252
|
'icon-xs': "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
6253
6253
|
'icon-sm': 'size-7',
|
|
@@ -9617,65 +9617,45 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
9617
9617
|
*/
|
|
9618
9618
|
|
|
9619
9619
|
|
|
9620
|
-
const __iconNode
|
|
9621
|
-
const Check = createLucideIcon("check", __iconNode
|
|
9622
|
-
|
|
9623
|
-
/**
|
|
9624
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9625
|
-
*
|
|
9626
|
-
* This source code is licensed under the ISC license.
|
|
9627
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9628
|
-
*/
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
9632
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
|
|
9633
|
-
|
|
9634
|
-
/**
|
|
9635
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9636
|
-
*
|
|
9637
|
-
* This source code is licensed under the ISC license.
|
|
9638
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9639
|
-
*/
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
9643
|
-
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);
|
|
9644
9622
|
|
|
9645
9623
|
function Checkbox({ className, ...props }) {
|
|
9646
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, {}) }) }));
|
|
9647
9625
|
}
|
|
9648
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
|
+
|
|
9649
9629
|
function Select({ ...props }) {
|
|
9650
9630
|
return jsxRuntime.jsx(Root2, { "data-slot": "select", ...props });
|
|
9651
9631
|
}
|
|
9652
9632
|
function SelectGroup({ className, ...props }) {
|
|
9653
|
-
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 }));
|
|
9654
9634
|
}
|
|
9655
9635
|
function SelectValue({ ...props }) {
|
|
9656
9636
|
return jsxRuntime.jsx(Value, { "data-slot": "select-value", ...props });
|
|
9657
9637
|
}
|
|
9658
9638
|
function SelectTrigger({ className, size = 'default', children, ...props }) {
|
|
9659
|
-
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" }) })] }));
|
|
9660
9640
|
}
|
|
9661
9641
|
function SelectContent({ className, children, position = 'item-aligned', align = 'center', ...props }) {
|
|
9662
|
-
return (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: cn('bg-
|
|
9663
|
-
'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, {})] }) }));
|
|
9664
9644
|
}
|
|
9665
9645
|
function SelectLabel({ className, ...props }) {
|
|
9666
|
-
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 }));
|
|
9667
9647
|
}
|
|
9668
9648
|
function SelectItem({ className, children, ...props }) {
|
|
9669
|
-
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 })] }));
|
|
9670
9650
|
}
|
|
9671
9651
|
function SelectSeparator({ className, ...props }) {
|
|
9672
|
-
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 }));
|
|
9673
9653
|
}
|
|
9674
9654
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9675
|
-
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, {}) }));
|
|
9676
9656
|
}
|
|
9677
9657
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9678
|
-
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, {}) }));
|
|
9679
9659
|
}
|
|
9680
9660
|
|
|
9681
9661
|
function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
@@ -9704,11 +9684,12 @@ var TextVariant;
|
|
|
9704
9684
|
/**
|
|
9705
9685
|
* This function renders the Text component for the library.
|
|
9706
9686
|
*/
|
|
9707
|
-
function Text({ variant = TextVariant.Body, color = 'text-primary', children, className }) {
|
|
9687
|
+
function Text({ variant = TextVariant.Body, color = 'text-text-primary', children, className }) {
|
|
9708
9688
|
// SECTION: Constants and Variables
|
|
9709
|
-
const
|
|
9689
|
+
const baseClassNames = 'w-fit';
|
|
9710
9690
|
// !SECTION: Constants and Variables
|
|
9711
9691
|
// SECTION: States
|
|
9692
|
+
const [internalClassName, setInternalClassName] = React.useState('');
|
|
9712
9693
|
// !SECTION: States
|
|
9713
9694
|
// SECTION: Functions
|
|
9714
9695
|
/**
|
|
@@ -9733,8 +9714,12 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9733
9714
|
return '';
|
|
9734
9715
|
case TextVariant.Body:
|
|
9735
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';
|
|
9736
9721
|
case TextVariant.Button:
|
|
9737
|
-
return 'text-sm font-body';
|
|
9722
|
+
return 'text-sm font-medium font-body';
|
|
9738
9723
|
case TextVariant.Caption:
|
|
9739
9724
|
return 'text-xs font-body';
|
|
9740
9725
|
default:
|
|
@@ -9746,7 +9731,7 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9746
9731
|
// !SECTION: Event Handlers
|
|
9747
9732
|
// SECTION: Side Effects
|
|
9748
9733
|
React.useEffect(() => {
|
|
9749
|
-
setInternalClassName(utils.cn(getVariantClass(variant), color, className));
|
|
9734
|
+
setInternalClassName(utils.cn(baseClassNames, getVariantClass(variant), color, className));
|
|
9750
9735
|
}, [variant, color, className]);
|
|
9751
9736
|
// !SECTION: Side Effects
|
|
9752
9737
|
// SECTION: UI
|
|
@@ -9764,11 +9749,15 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9764
9749
|
case TextVariant.H6:
|
|
9765
9750
|
return jsxRuntime.jsx("h6", { className: internalClassName, children: children });
|
|
9766
9751
|
case TextVariant.Button:
|
|
9767
|
-
return jsxRuntime.jsx("
|
|
9752
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9768
9753
|
case TextVariant.Caption:
|
|
9769
|
-
return jsxRuntime.jsx("
|
|
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 });
|
|
9770
9759
|
default:
|
|
9771
|
-
return jsxRuntime.jsx("p", { className:
|
|
9760
|
+
return jsxRuntime.jsx("p", { className: internalClassName, children: children });
|
|
9772
9761
|
}
|
|
9773
9762
|
// !SECTION: UI
|
|
9774
9763
|
}
|