Skip to content

feat: add Toolbar#701

Open
rohanchkrabrty wants to merge 7 commits intomainfrom
feat-toolbar
Open

feat: add Toolbar#701
rohanchkrabrty wants to merge 7 commits intomainfrom
feat-toolbar

Conversation

@rohanchkrabrty
Copy link
Contributor

@rohanchkrabrty rohanchkrabrty commented Mar 12, 2026

Summary

  • Add new Toolbar component wrapping Base UI Toolbar primitive
  • Sub-components: Root, Button, Group, Separator, Link, Input
  • Styles match Figma design (bordered container, vertical separators, group border reset)
  • Toolbar.Button supports render prop for composition with Button/IconButton
  • 16 tests covering rendering, ref forwarding, className merging, clicks, keyboard nav
  • Docs page with anatomy, API reference, and examples (grouped, composition, disabled)
  • Playground examples including Figma-matching icon toolbar

Summary by CodeRabbit

  • New Features

    • Introduced a new Toolbar component with support for buttons, groups, separators, links, and inputs, including horizontal/vertical orientation options and disabled state support.
  • Documentation

    • Added comprehensive documentation and interactive examples for the Toolbar component.
  • Breaking Changes

    • Updated Toast API: ToastContainer and toast replaced with Toast and toastManager.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Mar 17, 2026 11:05am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

Warning

Rate limit exceeded

@rohanchkrabrty has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c66248b6-0d5f-48cc-9d48-8667393b3ab0

📥 Commits

Reviewing files that changed from the base of the PR and between 0384539 and 2a37f41.

📒 Files selected for processing (4)
  • apps/www/src/content/docs/components/toolbar/demo.ts
  • apps/www/src/content/docs/components/toolbar/index.mdx
  • packages/raystack/components/toolbar/__tests__/toolbar.test.tsx
  • packages/raystack/components/toolbar/toolbar.module.css
📝 Walkthrough

Walkthrough

A new Toolbar component is introduced to the raystack UI library with CSS styling, React implementation, comprehensive tests, and documentation including demos and props reference. Additionally, Toast-related exports are refactored in the public API from ToastContainer and toast to Toast and toastManager.

Changes

Cohort / File(s) Summary
Toolbar Component Implementation
packages/raystack/components/toolbar/toolbar.tsx, packages/raystack/components/toolbar/toolbar.module.css, packages/raystack/components/toolbar/index.tsx
Core Toolbar component using forwardRef composition pattern with Button, Group, and Separator subcomponents. CSS module styles handle flexbox layout, separators, and disabled states.
Toolbar Tests
packages/raystack/components/toolbar/__tests__/toolbar.test.tsx
Comprehensive test coverage including rendering, className composition, ref forwarding, button interactions, group rendering, keyboard navigation, and disabled state verification.
Toolbar Documentation
apps/www/src/content/docs/components/toolbar/index.mdx, apps/www/src/content/docs/components/toolbar/demo.ts, apps/www/src/content/docs/components/toolbar/props.ts
MDX documentation page with API reference, multiple demo snippets (preview, grouped, composition, disabled), and TypeScript prop interface definitions for Toolbar and all subcomponents.
Toolbar Playground
apps/www/src/components/playground/toolbar-examples.tsx
Interactive playground component showcasing horizontal toolbar, grouped toolbar, and disabled state examples using Apsara UI primitives and Radix icons.
Public API Export Changes
packages/raystack/index.tsx
Added Toolbar export and refactored Toast exports: replaced ToastContainer, toast with Toast, toastManager (breaking API change).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • rohilsurana
  • paanSinghCoder
  • rsbh

Poem

🐰 A toolbar hops into the fray,
With buttons bold and groups at play,
From CSS threads to tests so tight,
The UI dance burns ever bright!
New exports dance, old ones away—
What a refactoring holiday! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Toolbar' clearly and concisely summarizes the main change—introducing a new Toolbar component. It is specific, follows conventional format, and directly reflects the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-toolbar
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohanchkrabrty rohanchkrabrty changed the title feat: add Toolbar component based on Base UI primitive feat: add Toolbar Mar 12, 2026
@rohanchkrabrty rohanchkrabrty self-assigned this Mar 12, 2026

Use the `render` prop on `Toolbar.Button` to compose with Apsara components like `Button` and `IconButton`.

<Demo data={compositionDemo} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is showing blank in the docs. Please check.

.separator {
flex-shrink: 0;
width: 0.5px;
height: 16px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use var(--rs-space-5) for the height.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: We will have to introduce 0.5px var if we plan to use it frequently. @p4suhag


<Demo data={compositionDemo} />

### Disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add an example for the vertical orientation as well.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/www/src/content/docs/components/toolbar/index.mdx`:
- Around line 57-67: The docs reference Toolbar Link and Input components that
are not exported; update toolbar.tsx to implement and export components matching
the documented API names (e.g., ToolbarLink and ToolbarInput) and ensure their
props align with ToolbarLinkProps and ToolbarInputProps from props.ts; add the
components (or re-export existing implementations) with the expected prop types,
keyboard/navigation behavior, and named exports so the MDX auto-type-table
resolves correctly.
- Around line 16-29: The docs reference Toolbar.Link and Toolbar.Input which
don't exist; update the Toolbar implementation to provide these subcomponents or
remove them from docs. Add two new exports on the Toolbar object (e.g.,
Toolbar.Link and Toolbar.Input) implemented as functional components that
forward props and refs to an anchor and input respectively, accept and pass
through className and children, mirror the existing API/prop types used by
Toolbar.Button/Toolbar.Group, and include the same styling/role semantics as
other subcomponents so the example in the docs works; alternatively, if you
prefer not to implement them now, remove the Toolbar.Link and Toolbar.Input
lines from the example in the docs to avoid referencing unimplemented
components.

In `@apps/www/src/content/docs/components/toolbar/props.ts`:
- Around line 1-95: This file uses React types (React.ReactElement and
React.HTMLAttributes<HTMLElement>) but doesn't import React; add an explicit
import for React at the top of the file (e.g., import * as React from 'react')
so the types used in ToolbarButtonProps.render, ToolbarLinkProps.render, and any
other React type references resolve correctly.

In `@packages/raystack/components/toolbar/__tests__/toolbar.test.tsx`:
- Around line 128-172: Tests fail because Toolbar.Link and Toolbar.Input are not
exported, causing "Element type is invalid"; implement and export these
subcomponents in the Toolbar component (toolbar.tsx). Add a Toolbar.Link
component that renders an anchor, accepts href and children, and forwards its
ref (use forwardRef) so createRef<HTMLAnchorElement>() works; add a
Toolbar.Input component that renders an input, accepts common input props and
data-testid, and forwards its ref (forwardRef<HTMLInputElement>) so
createRef<HTMLInputElement>() works; finally attach them to the main Toolbar
export as static properties (Toolbar.Link and Toolbar.Input) so existing tests
can import and render them.
- Around line 54-63: The test in toolbar.test.tsx incorrectly asserts that the
composed Toolbar.Button includes toolbar.module.css's styles
(expect(button.className).toContain(styles.button)); remove that assertion and
only verify the custom class is applied (or alternatively assert the Button
component's own CSS class if you prefer by referencing the Button's style
symbol), keeping the render using Toolbar and the element lookup via
screen.getByRole('button').

In `@packages/raystack/components/toolbar/toolbar.module.css`:
- Around line 25-28: The .group CSS rule uses an invalid value
"background-color: none"; update the .group declaration in toolbar.module.css
(the .group selector) to use a valid value such as "background-color:
transparent" or "background-color: unset" instead of "none" so the stylesheet is
valid and behaves as intended.

In `@packages/raystack/components/toolbar/toolbar.tsx`:
- Around line 57-61: The Toolbar export is missing the Link and Input
subcomponents referenced by docs/tests, causing "Element type is invalid:
undefined"; import or define the corresponding components (e.g., ToolbarLink,
ToolbarInput or Toolbar.Link/Toolbar.Input implementations) and add them to the
Object.assign call that builds Toolbar (alongside ToolbarButton, ToolbarGroup,
ToolbarSeparator) so the final export includes Button, Group, Separator, Link,
and Input; ensure the imported symbol names match what you add to the object
(e.g., ToolbarLink as Link, ToolbarInput as Input) and export defaults
consistently from ToolbarRoot.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f194d49-01b7-4118-9bbf-ef6e67566d6c

📥 Commits

Reviewing files that changed from the base of the PR and between f1419ff and 0384539.

📒 Files selected for processing (9)
  • apps/www/src/components/playground/toolbar-examples.tsx
  • apps/www/src/content/docs/components/toolbar/demo.ts
  • apps/www/src/content/docs/components/toolbar/index.mdx
  • apps/www/src/content/docs/components/toolbar/props.ts
  • packages/raystack/components/toolbar/__tests__/toolbar.test.tsx
  • packages/raystack/components/toolbar/index.tsx
  • packages/raystack/components/toolbar/toolbar.module.css
  • packages/raystack/components/toolbar/toolbar.tsx
  • packages/raystack/index.tsx

Comment on lines +16 to +29
```tsx
import { Toolbar } from '@raystack/apsara'

<Toolbar>
<Toolbar.Button />
<Toolbar.Group>
<Toolbar.Button />
<Toolbar.Button />
</Toolbar.Group>
<Toolbar.Separator />
<Toolbar.Link />
<Toolbar.Input />
</Toolbar>
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Documentation references unimplemented components.

The anatomy section shows Toolbar.Link and Toolbar.Input usage, but these components are not yet implemented in toolbar.tsx. Update the implementation to include these components, or remove them from the documentation until they're available.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/www/src/content/docs/components/toolbar/index.mdx` around lines 16 - 29,
The docs reference Toolbar.Link and Toolbar.Input which don't exist; update the
Toolbar implementation to provide these subcomponents or remove them from docs.
Add two new exports on the Toolbar object (e.g., Toolbar.Link and Toolbar.Input)
implemented as functional components that forward props and refs to an anchor
and input respectively, accept and pass through className and children, mirror
the existing API/prop types used by Toolbar.Button/Toolbar.Group, and include
the same styling/role semantics as other subcomponents so the example in the
docs works; alternatively, if you prefer not to implement them now, remove the
Toolbar.Link and Toolbar.Input lines from the example in the docs to avoid
referencing unimplemented components.

Comment on lines +57 to +67
### Link

An anchor element for navigation within the toolbar.

<auto-type-table path="./props.ts" name="ToolbarLinkProps" />

### Input

A native input element with integrated keyboard navigation.

<auto-type-table path="./props.ts" name="ToolbarInputProps" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

API reference documents missing Link and Input components.

The API reference sections for Link and Input document components that don't exist in the implementation. This will cause confusion when users try to use these documented features. Ensure the implementation in toolbar.tsx exports these components.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/www/src/content/docs/components/toolbar/index.mdx` around lines 57 - 67,
The docs reference Toolbar Link and Input components that are not exported;
update toolbar.tsx to implement and export components matching the documented
API names (e.g., ToolbarLink and ToolbarInput) and ensure their props align with
ToolbarLinkProps and ToolbarInputProps from props.ts; add the components (or
re-export existing implementations) with the expected prop types,
keyboard/navigation behavior, and named exports so the MDX auto-type-table
resolves correctly.

Comment on lines +1 to +95
export interface ToolbarProps {
/**
* Whether keyboard navigation loops from the last item back to the first.
* @defaultValue true
*/
loopFocus?: boolean;

/**
* The orientation of the toolbar layout.
* @defaultValue "horizontal"
*/
orientation?: 'horizontal' | 'vertical';

/**
* Whether the toolbar and all its items are disabled.
* @defaultValue false
*/
disabled?: boolean;

/** Additional CSS class names. */
className?: string;
}

export interface ToolbarButtonProps {
/**
* Whether the button remains focusable when disabled.
* @defaultValue true
*/
focusableWhenDisabled?: boolean;

/**
* Whether the button is disabled.
* @defaultValue false
*/
disabled?: boolean;

/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* @remarks `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);

/** Additional CSS class names. */
className?: string;
}

export interface ToolbarGroupProps {
/**
* Whether the group and all its items are disabled.
* @defaultValue false
*/
disabled?: boolean;

/** Additional CSS class names. */
className?: string;
}

export interface ToolbarSeparatorProps {
/** Additional CSS class names. */
className?: string;
}

export interface ToolbarLinkProps {
/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* @remarks `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);

/** Additional CSS class names. */
className?: string;
}

export interface ToolbarInputProps {
/**
* Whether the input remains focusable when disabled.
* @defaultValue true
*/
focusableWhenDisabled?: boolean;

/**
* Whether the input is disabled.
* @defaultValue false
*/
disabled?: boolean;

/** Additional CSS class names. */
className?: string;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if other props.ts files in the docs import React or rely on global types
fd -e ts 'props.ts' apps/www/src/content/docs/components --exec head -20 {}

Repository: raystack/apsara

Length of output: 27427


Add missing React type import.

The file uses React.ReactElement and React.HTMLAttributes<HTMLElement> (lines 43-44, 73-74) without importing React. Add the explicit import:

Proposed fix
+import type React from 'react';
+
 export interface ToolbarProps {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export interface ToolbarProps {
/**
* Whether keyboard navigation loops from the last item back to the first.
* @defaultValue true
*/
loopFocus?: boolean;
/**
* The orientation of the toolbar layout.
* @defaultValue "horizontal"
*/
orientation?: 'horizontal' | 'vertical';
/**
* Whether the toolbar and all its items are disabled.
* @defaultValue false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarButtonProps {
/**
* Whether the button remains focusable when disabled.
* @defaultValue true
*/
focusableWhenDisabled?: boolean;
/**
* Whether the button is disabled.
* @defaultValue false
*/
disabled?: boolean;
/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* @remarks `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarGroupProps {
/**
* Whether the group and all its items are disabled.
* @defaultValue false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarSeparatorProps {
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarLinkProps {
/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* @remarks `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarInputProps {
/**
* Whether the input remains focusable when disabled.
* @defaultValue true
*/
focusableWhenDisabled?: boolean;
/**
* Whether the input is disabled.
* @defaultValue false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
import type React from 'react';
export interface ToolbarProps {
/**
* Whether keyboard navigation loops from the last item back to the first.
* `@defaultValue` true
*/
loopFocus?: boolean;
/**
* The orientation of the toolbar layout.
* `@defaultValue` "horizontal"
*/
orientation?: 'horizontal' | 'vertical';
/**
* Whether the toolbar and all its items are disabled.
* `@defaultValue` false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarButtonProps {
/**
* Whether the button remains focusable when disabled.
* `@defaultValue` true
*/
focusableWhenDisabled?: boolean;
/**
* Whether the button is disabled.
* `@defaultValue` false
*/
disabled?: boolean;
/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* `@remarks` `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarGroupProps {
/**
* Whether the group and all its items are disabled.
* `@defaultValue` false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarSeparatorProps {
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarLinkProps {
/**
* Allows you to replace the component's HTML element with a different tag, or compose it with another component.
*
* `@remarks` `ReactElement | function`
*/
render?:
| React.ReactElement
| ((props: React.HTMLAttributes<HTMLElement>) => React.ReactElement);
/** Additional CSS class names. */
className?: string;
}
export interface ToolbarInputProps {
/**
* Whether the input remains focusable when disabled.
* `@defaultValue` true
*/
focusableWhenDisabled?: boolean;
/**
* Whether the input is disabled.
* `@defaultValue` false
*/
disabled?: boolean;
/** Additional CSS class names. */
className?: string;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/www/src/content/docs/components/toolbar/props.ts` around lines 1 - 95,
This file uses React types (React.ReactElement and
React.HTMLAttributes<HTMLElement>) but doesn't import React; add an explicit
import for React at the top of the file (e.g., import * as React from 'react')
so the types used in ToolbarButtonProps.render, ToolbarLinkProps.render, and any
other React type references resolve correctly.

Comment on lines +128 to +172
describe('Link', () => {
it('renders a link', () => {
render(
<Toolbar>
<Toolbar.Link href='https://example.com'>Example</Toolbar.Link>
</Toolbar>
);
const link = screen.getByRole('link', { name: 'Example' });
expect(link).toBeInTheDocument();
expect(link).toHaveAttribute('href', 'https://example.com');
});

it('forwards ref', () => {
const ref = createRef<HTMLAnchorElement>();
render(
<Toolbar>
<Toolbar.Link ref={ref} href='#'>
Link
</Toolbar.Link>
</Toolbar>
);
expect(ref.current).toBeInstanceOf(HTMLAnchorElement);
});
});

describe('Input', () => {
it('renders an input', () => {
render(
<Toolbar>
<Toolbar.Input data-testid='input' />
</Toolbar>
);
expect(screen.getByTestId('input')).toBeInTheDocument();
});

it('forwards ref', () => {
const ref = createRef<HTMLInputElement>();
render(
<Toolbar>
<Toolbar.Input ref={ref} data-testid='input' />
</Toolbar>
);
expect(ref.current).toBeInstanceOf(HTMLInputElement);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Tests for Link and Input will fail until components are implemented.

These test blocks reference Toolbar.Link and Toolbar.Input, which are not yet exported from the Toolbar component. The pipeline failures confirm these tests fail with "Element type is invalid: undefined".

Once the missing subcomponents are added to toolbar.tsx (as noted in that file's review), these tests should pass.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/toolbar/__tests__/toolbar.test.tsx` around lines
128 - 172, Tests fail because Toolbar.Link and Toolbar.Input are not exported,
causing "Element type is invalid"; implement and export these subcomponents in
the Toolbar component (toolbar.tsx). Add a Toolbar.Link component that renders
an anchor, accepts href and children, and forwards its ref (use forwardRef) so
createRef<HTMLAnchorElement>() works; add a Toolbar.Input component that renders
an input, accepts common input props and data-testid, and forwards its ref
(forwardRef<HTMLInputElement>) so createRef<HTMLInputElement>() works; finally
attach them to the main Toolbar export as static properties (Toolbar.Link and
Toolbar.Input) so existing tests can import and render them.

Comment on lines +25 to +28
.group {
padding: 0;
background-color: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Invalid CSS value: background-color: none.

none is not a valid value for background-color. Use transparent or unset instead.

🐛 Proposed fix
 .group {
   padding: 0;
-  background-color: none;
+  background-color: transparent;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.group {
padding: 0;
background-color: none;
}
.group {
padding: 0;
background-color: transparent;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/toolbar/toolbar.module.css` around lines 25 -
28, The .group CSS rule uses an invalid value "background-color: none"; update
the .group declaration in toolbar.module.css (the .group selector) to use a
valid value such as "background-color: transparent" or "background-color: unset"
instead of "none" so the stylesheet is valid and behaves as intended.

Comment on lines +57 to +61
export const Toolbar = Object.assign(ToolbarRoot, {
Button: ToolbarButton,
Group: ToolbarGroup,
Separator: ToolbarSeparator
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Missing Link and Input subcomponents cause test failures.

The PR description, documentation, and tests reference Toolbar.Link and Toolbar.Input subcomponents, but they are not implemented or exported here. This causes the pipeline failures where tests for these components fail with "Element type is invalid: undefined".

Add the missing subcomponents:

🔧 Proposed fix to add missing subcomponents
+const ToolbarLink = forwardRef<
+  ElementRef<typeof ToolbarPrimitive.Link>,
+  ToolbarPrimitive.Link.Props
+>(({ className, ...props }, ref) => (
+  <ToolbarPrimitive.Link
+    ref={ref}
+    className={cx(styles.link, className)}
+    {...props}
+  />
+));
+ToolbarLink.displayName = 'Toolbar.Link';
+
+const ToolbarInput = forwardRef<
+  ElementRef<typeof ToolbarPrimitive.Input>,
+  ToolbarPrimitive.Input.Props
+>(({ className, ...props }, ref) => (
+  <ToolbarPrimitive.Input
+    ref={ref}
+    className={cx(styles.input, className)}
+    {...props}
+  />
+));
+ToolbarInput.displayName = 'Toolbar.Input';
+
 export const Toolbar = Object.assign(ToolbarRoot, {
   Button: ToolbarButton,
   Group: ToolbarGroup,
-  Separator: ToolbarSeparator
+  Separator: ToolbarSeparator,
+  Link: ToolbarLink,
+  Input: ToolbarInput
 });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const Toolbar = Object.assign(ToolbarRoot, {
Button: ToolbarButton,
Group: ToolbarGroup,
Separator: ToolbarSeparator
});
const ToolbarLink = forwardRef<
ElementRef<typeof ToolbarPrimitive.Link>,
ToolbarPrimitive.Link.Props
>(({ className, ...props }, ref) => (
<ToolbarPrimitive.Link
ref={ref}
className={cx(styles.link, className)}
{...props}
/>
));
ToolbarLink.displayName = 'Toolbar.Link';
const ToolbarInput = forwardRef<
ElementRef<typeof ToolbarPrimitive.Input>,
ToolbarPrimitive.Input.Props
>(({ className, ...props }, ref) => (
<ToolbarPrimitive.Input
ref={ref}
className={cx(styles.input, className)}
{...props}
/>
));
ToolbarInput.displayName = 'Toolbar.Input';
export const Toolbar = Object.assign(ToolbarRoot, {
Button: ToolbarButton,
Group: ToolbarGroup,
Separator: ToolbarSeparator,
Link: ToolbarLink,
Input: ToolbarInput
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/toolbar/toolbar.tsx` around lines 57 - 61, The
Toolbar export is missing the Link and Input subcomponents referenced by
docs/tests, causing "Element type is invalid: undefined"; import or define the
corresponding components (e.g., ToolbarLink, ToolbarInput or
Toolbar.Link/Toolbar.Input implementations) and add them to the Object.assign
call that builds Toolbar (alongside ToolbarButton, ToolbarGroup,
ToolbarSeparator) so the final export includes Button, Group, Separator, Link,
and Input; ensure the imported symbol names match what you add to the object
(e.g., ToolbarLink as Link, ToolbarInput as Input) and export defaults
consistently from ToolbarRoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants