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.esm.js
CHANGED
|
@@ -6167,7 +6167,7 @@ function isValidOrientation(orientation) {
|
|
|
6167
6167
|
var Root = Separator$1;
|
|
6168
6168
|
|
|
6169
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
|
|
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
6171
|
}
|
|
6172
6172
|
|
|
6173
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}
|
|
@@ -6220,14 +6220,14 @@ const buttonVariants = cva("focus-visible:border-ring py-1 cursor-pointer active
|
|
|
6220
6220
|
outline: 'border-stroke-base-primary bg-bg-base-primary hover:bg-muted aria-expanded:bg-muted text-text-primary',
|
|
6221
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
6222
|
ghost: 'hover:bg-muted text-text-primary aria-expanded:bg-muted',
|
|
6223
|
-
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',
|
|
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
6224
|
link: 'text-text-info underline-offset-4 hover:underline'
|
|
6225
6225
|
},
|
|
6226
6226
|
size: {
|
|
6227
|
-
default: 'h-10 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
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
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-[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 px-3 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-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
6231
|
icon: 'size-8',
|
|
6232
6232
|
'icon-xs': "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
6233
6233
|
'icon-sm': 'size-7',
|
|
@@ -9597,65 +9597,45 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
9597
9597
|
*/
|
|
9598
9598
|
|
|
9599
9599
|
|
|
9600
|
-
const __iconNode
|
|
9601
|
-
const Check = createLucideIcon("check", __iconNode
|
|
9602
|
-
|
|
9603
|
-
/**
|
|
9604
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9605
|
-
*
|
|
9606
|
-
* This source code is licensed under the ISC license.
|
|
9607
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9608
|
-
*/
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
9612
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
|
|
9613
|
-
|
|
9614
|
-
/**
|
|
9615
|
-
* @license lucide-react v0.575.0 - ISC
|
|
9616
|
-
*
|
|
9617
|
-
* This source code is licensed under the ISC license.
|
|
9618
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9619
|
-
*/
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
9623
|
-
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);
|
|
9624
9602
|
|
|
9625
9603
|
function Checkbox({ className, ...props }) {
|
|
9626
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, {}) }) }));
|
|
9627
9605
|
}
|
|
9628
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
|
+
|
|
9629
9609
|
function Select({ ...props }) {
|
|
9630
9610
|
return jsx(Root2, { "data-slot": "select", ...props });
|
|
9631
9611
|
}
|
|
9632
9612
|
function SelectGroup({ className, ...props }) {
|
|
9633
|
-
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 }));
|
|
9634
9614
|
}
|
|
9635
9615
|
function SelectValue({ ...props }) {
|
|
9636
9616
|
return jsx(Value, { "data-slot": "select-value", ...props });
|
|
9637
9617
|
}
|
|
9638
9618
|
function SelectTrigger({ className, size = 'default', children, ...props }) {
|
|
9639
|
-
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" }) })] }));
|
|
9640
9620
|
}
|
|
9641
9621
|
function SelectContent({ className, children, position = 'item-aligned', align = 'center', ...props }) {
|
|
9642
|
-
return (jsx(Portal, { children: jsxs(Content2, { "data-slot": "select-content", "data-align-trigger": position === 'item-aligned', className: cn('bg-
|
|
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: [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, {})] }) }));
|
|
9644
9624
|
}
|
|
9645
9625
|
function SelectLabel({ className, ...props }) {
|
|
9646
|
-
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 }));
|
|
9647
9627
|
}
|
|
9648
9628
|
function SelectItem({ className, children, ...props }) {
|
|
9649
|
-
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 })] }));
|
|
9650
9630
|
}
|
|
9651
9631
|
function SelectSeparator({ className, ...props }) {
|
|
9652
|
-
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 }));
|
|
9653
9633
|
}
|
|
9654
9634
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9655
|
-
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, {}) }));
|
|
9656
9636
|
}
|
|
9657
9637
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9658
|
-
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, {}) }));
|
|
9659
9639
|
}
|
|
9660
9640
|
|
|
9661
9641
|
function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
@@ -9684,11 +9664,12 @@ var TextVariant;
|
|
|
9684
9664
|
/**
|
|
9685
9665
|
* This function renders the Text component for the library.
|
|
9686
9666
|
*/
|
|
9687
|
-
function Text({ variant = TextVariant.Body, color = 'text-primary', children, className }) {
|
|
9667
|
+
function Text({ variant = TextVariant.Body, color = 'text-text-primary', children, className }) {
|
|
9688
9668
|
// SECTION: Constants and Variables
|
|
9689
|
-
const
|
|
9669
|
+
const baseClassNames = 'w-fit';
|
|
9690
9670
|
// !SECTION: Constants and Variables
|
|
9691
9671
|
// SECTION: States
|
|
9672
|
+
const [internalClassName, setInternalClassName] = useState('');
|
|
9692
9673
|
// !SECTION: States
|
|
9693
9674
|
// SECTION: Functions
|
|
9694
9675
|
/**
|
|
@@ -9713,8 +9694,12 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9713
9694
|
return '';
|
|
9714
9695
|
case TextVariant.Body:
|
|
9715
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';
|
|
9716
9701
|
case TextVariant.Button:
|
|
9717
|
-
return 'text-sm font-body';
|
|
9702
|
+
return 'text-sm font-medium font-body';
|
|
9718
9703
|
case TextVariant.Caption:
|
|
9719
9704
|
return 'text-xs font-body';
|
|
9720
9705
|
default:
|
|
@@ -9726,7 +9711,7 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9726
9711
|
// !SECTION: Event Handlers
|
|
9727
9712
|
// SECTION: Side Effects
|
|
9728
9713
|
useEffect(() => {
|
|
9729
|
-
setInternalClassName(cn$1(getVariantClass(variant), color, className));
|
|
9714
|
+
setInternalClassName(cn$1(baseClassNames, getVariantClass(variant), color, className));
|
|
9730
9715
|
}, [variant, color, className]);
|
|
9731
9716
|
// !SECTION: Side Effects
|
|
9732
9717
|
// SECTION: UI
|
|
@@ -9744,11 +9729,15 @@ function Text({ variant = TextVariant.Body, color = 'text-primary', children, cl
|
|
|
9744
9729
|
case TextVariant.H6:
|
|
9745
9730
|
return jsx("h6", { className: internalClassName, children: children });
|
|
9746
9731
|
case TextVariant.Button:
|
|
9747
|
-
return jsx("
|
|
9732
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9748
9733
|
case TextVariant.Caption:
|
|
9749
|
-
return jsx("
|
|
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 });
|
|
9750
9739
|
default:
|
|
9751
|
-
return jsx("p", { className:
|
|
9740
|
+
return jsx("p", { className: internalClassName, children: children });
|
|
9752
9741
|
}
|
|
9753
9742
|
// !SECTION: UI
|
|
9754
9743
|
}
|