Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion packages/raystack/components/sidebar/sidebar-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ export const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(
leadingIcon
)}
</Flex>
{!isCollapsed && <span className={styles['nav-text']}>{children}</span>}
{!isCollapsed && (
<span className={cx(styles['nav-text'], classNames?.text)}>
{children}
</span>
)}
</>
);

Expand Down
3 changes: 2 additions & 1 deletion packages/raystack/components/sidebar/sidebar-main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { cx } from 'class-variance-authority';
import { ComponentPropsWithoutRef, forwardRef } from 'react';
import { Flex } from '../flex';
import styles from './sidebar.module.css';
Expand All @@ -10,7 +11,7 @@ export const SidebarMain = forwardRef<
>(({ className, children, ...props }, ref) => (
<Flex
ref={ref}
className={styles.main}
className={cx(styles.main, className)}
direction='column'
role='group'
aria-label='Main navigation'
Expand Down
4 changes: 2 additions & 2 deletions packages/raystack/components/sidebar/sidebar-misc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SidebarHeader = forwardRef<
<Flex
align='center'
ref={ref}
className={styles.header}
className={cx(styles.header, className)}
role='banner'
{...props}
>
Expand All @@ -27,7 +27,7 @@ export const SidebarFooter = forwardRef<
>(({ className, children, ...props }, ref) => (
<Flex
ref={ref}
className={styles.footer}
className={cx(styles.footer, className)}
direction='column'
role='group'
aria-label='Footer navigation'
Expand Down
6 changes: 2 additions & 4 deletions packages/raystack/components/sidebar/sidebar-root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { cva } from 'class-variance-authority';
import { cx } from 'class-variance-authority';
import { Collapsible } from 'radix-ui';
import {
ComponentPropsWithoutRef,
Expand All @@ -23,8 +23,6 @@ export const SidebarContext = createContext<SidebarContextValue>({
isCollapsed: false
});

const root = cva(styles.root);

export interface SidebarRootProps
extends ComponentPropsWithoutRef<typeof Collapsible.Root> {
position?: 'left' | 'right';
Expand Down Expand Up @@ -71,7 +69,7 @@ export const SidebarRoot = forwardRef<
<Tooltip.Provider>
<Collapsible.Root
ref={ref}
className={root({ className })}
className={cx(styles.root, className)}
data-position={position}
data-state={open ? 'expanded' : 'collapsed'}
data-collapse-disabled={!collapsible}
Expand Down