Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export default {
children: <TabsContent />,
defaultValue: 'mjs',
tabs: [
{ key: 'mjs', label: 'MJS' },
{ key: 'cjs', label: 'CJS' },
{ key: 'mjs', label: 'Example', extension: 'MJS' },
{ key: 'cjs', label: 'Example', extension: 'CJS' },
],
},
} as Meta;
19 changes: 19 additions & 0 deletions packages/ui-components/src/Common/Tabs/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
text-neutral-800
dark:text-neutral-200;

.tabExtension {
@apply ml-1
rounded-xs
border
border-neutral-200
p-0.5
Comment thread
naveenkarmegam marked this conversation as resolved.
Outdated
text-[10px]
Comment thread
naveenkarmegam marked this conversation as resolved.
Outdated
font-normal
text-neutral-800
dark:text-neutral-200;
Comment thread
naveenkarmegam marked this conversation as resolved.
Outdated
}

.tabSecondaryLabel {
@apply pl-1
Comment thread
naveenkarmegam marked this conversation as resolved.
text-neutral-500
Comment thread
naveenkarmegam marked this conversation as resolved.
Expand All @@ -34,6 +46,13 @@
dark:border-b-green-400
dark:text-green-400;

.tabExtension {
@apply border-green-600
text-green-600
dark:border-green-400
dark:text-green-400;
Comment thread
naveenkarmegam marked this conversation as resolved.
Outdated
}

.tabSecondaryLabel {
@apply text-green-800
dark:text-green-600;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-components/src/Common/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Tab = {
label: string;
secondaryLabel?: string;
value?: string;
extension?: string;
};

type TabsProps = TabsPrimitive.TabsProps & {
Expand Down Expand Up @@ -37,6 +38,9 @@ const Tabs: FC<PropsWithChildren<TabsProps>> = ({
className={classNames(styles.tabsTrigger, triggerClassName)}
>
{tab.label}
{tab.extension ? (
<span className={styles.tabExtension}>{tab.extension}</span>
) : null}
Comment thread
naveenkarmegam marked this conversation as resolved.
Outdated
{tab.secondaryLabel ? (
<span className={styles.tabSecondaryLabel}>
{tab.secondaryLabel}
Expand Down