infinity-ui-elements 1.9.11 → 1.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TabItem/TabItem.d.ts +2 -2
- package/dist/components/TabItem/TabItem.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +4 -0
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +46 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5224,11 +5224,12 @@ function AvatarCell({ name, initials, avatar, subtitle, color = "a1", className,
|
|
|
5224
5224
|
return (jsxs("div", { className: cn("flex items-center gap-3", className), children: [avatar ? (jsx("img", { src: avatar, alt: name, className: "w-10 h-10 rounded-full object-cover" })) : (jsx("div", { className: cn("w-10 h-10 rounded-full flex items-center justify-center text-body-medium-medium", `bg-${color}`), children: initials || name.charAt(0).toUpperCase() })), jsxs("div", { className: "flex flex-col", children: [jsx("div", { className: "text-body-medium-medium text-surface-ink-neutral-normal", children: name }), subtitle && (jsx("div", { className: "text-body-small-regular text-surface-ink-neutral-muted", children: subtitle }))] })] }));
|
|
5225
5225
|
}
|
|
5226
5226
|
|
|
5227
|
-
const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 relative cursor-pointer
|
|
5227
|
+
const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 relative cursor-pointer`, {
|
|
5228
5228
|
variants: {
|
|
5229
5229
|
variant: {
|
|
5230
|
-
bordered: "border-b-[1.5px]",
|
|
5231
|
-
borderless: "border-b-[1.5px]",
|
|
5230
|
+
bordered: "border-b-[1.5px] -mb-[1.5px]",
|
|
5231
|
+
borderless: "border-b-[1.5px] -mb-[1.5px]",
|
|
5232
|
+
segmented: "rounded-lg",
|
|
5232
5233
|
},
|
|
5233
5234
|
size: {
|
|
5234
5235
|
small: "px-2 py-3 h-9",
|
|
@@ -5301,6 +5302,44 @@ const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 white
|
|
|
5301
5302
|
isDisabled: true,
|
|
5302
5303
|
class: "text-text-body-disabled border-b-transparent",
|
|
5303
5304
|
},
|
|
5305
|
+
// Segmented variant - not selected
|
|
5306
|
+
{
|
|
5307
|
+
variant: "segmented",
|
|
5308
|
+
isSelected: false,
|
|
5309
|
+
isDisabled: false,
|
|
5310
|
+
class: `text-action-ink-neutral-muted
|
|
5311
|
+
hover:text-action-ink-neutral-subtle
|
|
5312
|
+
hover:bg-action-fill-neutral-faded-hover`,
|
|
5313
|
+
},
|
|
5314
|
+
// Segmented variant - selected
|
|
5315
|
+
{
|
|
5316
|
+
variant: "segmented",
|
|
5317
|
+
isSelected: true,
|
|
5318
|
+
isDisabled: false,
|
|
5319
|
+
class: "bg-action-fill-primary-faded text-action-ink-primary-subtle hover:text-action-ink-primary-normal",
|
|
5320
|
+
},
|
|
5321
|
+
// Segmented variant - disabled
|
|
5322
|
+
{
|
|
5323
|
+
variant: "segmented",
|
|
5324
|
+
isDisabled: true,
|
|
5325
|
+
class: "text-text-body-disabled bg-transparent",
|
|
5326
|
+
},
|
|
5327
|
+
// Segmented variant - size overrides (more compact)
|
|
5328
|
+
{
|
|
5329
|
+
variant: "segmented",
|
|
5330
|
+
size: "small",
|
|
5331
|
+
class: "px-3 py-1.5 h-8",
|
|
5332
|
+
},
|
|
5333
|
+
{
|
|
5334
|
+
variant: "segmented",
|
|
5335
|
+
size: "medium",
|
|
5336
|
+
class: "px-4 py-2 h-9",
|
|
5337
|
+
},
|
|
5338
|
+
{
|
|
5339
|
+
variant: "segmented",
|
|
5340
|
+
size: "large",
|
|
5341
|
+
class: "px-4 py-2.5 h-10",
|
|
5342
|
+
},
|
|
5304
5343
|
],
|
|
5305
5344
|
defaultVariants: {
|
|
5306
5345
|
variant: "bordered",
|
|
@@ -5336,9 +5375,11 @@ const Tabs = React.forwardRef(({ tabs, selectedTabId, defaultSelectedTabId, onTa
|
|
|
5336
5375
|
};
|
|
5337
5376
|
// Get the active tab content
|
|
5338
5377
|
const activeTab = tabs.find((tab) => tab.id === activeTabId);
|
|
5339
|
-
return (jsxs("div", { ref: ref, className: cn("w-full", className), ...props, children: [jsx("div", { role: "tablist", className: cn("inline-flex items-center
|
|
5378
|
+
return (jsxs("div", { ref: ref, className: cn("w-full", className), ...props, children: [jsx("div", { role: "tablist", className: cn("inline-flex items-center", {
|
|
5340
5379
|
"w-full": isFullWidth,
|
|
5341
|
-
"
|
|
5380
|
+
"gap-4": variant === "bordered" || variant === "borderless",
|
|
5381
|
+
"border-b-[1.5px] border-surface-outline-neutral-muted": variant === "bordered",
|
|
5382
|
+
"gap-1 p-1 rounded-xl bg-surface-background-neutral-faded-default": variant === "segmented",
|
|
5342
5383
|
}, tabListClassName), children: tabs.map((tab) => (jsx(TabItem, { id: String(tab.id), leadingComponent: tab.leadingComponent, title: tab.title, trailingComponent: tab.trailingComponent, isSelected: tab.id === activeTabId, isDisabled: tab.isDisabled, variant: variant, size: size, isFullWidth: isFullWidth, onClick: () => !tab.isDisabled && handleTabClick(tab.id) }, tab.id))) }), renderContent && activeTab?.content && (jsx("div", { role: "tabpanel", className: cn("mt-4", contentClassName), "aria-labelledby": String(activeTabId), children: activeTab.content }))] }));
|
|
5343
5384
|
});
|
|
5344
5385
|
Tabs.displayName = "Tabs";
|