-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Support for as in Sidebar.Item
#386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
as in Sidebar.Item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for a custom element via the "as" prop on SidebarItem, enabling developers to override the default anchor element. Key changes include introducing the "as" prop with a default value of , updating the SidebarItem implementation to use cloneElement for prop forwarding, and reflecting this new prop in the documentation.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/raystack/v1/components/sidebar/sidebar.tsx | Updated SidebarItem to support a custom "as" element and adjusted arrow function formatting. |
| apps/www/src/content/docs/components/sidebar/props.ts | Updated prop definitions and documentation for SidebarItem to include the "as" prop. |
Comments suppressed due to low confidence (1)
packages/raystack/v1/components/sidebar/sidebar.tsx:170
- The default element for the 'as' prop is set to an anchor () while the forwarded ref is typed as HTMLAnchorElement. This could cause type inconsistencies if a different element is provided. Consider using generics or a more flexible ref type to accommodate other element types.
({ classNames, icon, children, active, disabled, as = <a />, ...props }, ref) => {
* Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev>
* Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment * chore: IconButton icon take size from parent (#411) * fix: HTML sub element coming on top of thead during table content scroll (#413) * fix (Sidebar): Item and container css fixes (#414) fix: minor css fixes * Fix/sidebar toggle position (#417) * fix (sidebar): toggle on border click position * chore: remove -2 padding * chore: change resize cursor type * feat: tooltip `followCursor` mode (#418) * wip: tooltip follow * feat: tooltip follow mode * fix: clean up tooltip code * fix: missing tooltip arrow changes * chore: remove duplicate id prop --------- Co-authored-by: Rohan Chakraborty <irohan1999@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev>
* Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment * chore: IconButton icon take size from parent (#411) * fix: HTML sub element coming on top of thead during table content scroll (#413) * fix (Sidebar): Item and container css fixes (#414) fix: minor css fixes * Fix/sidebar toggle position (#417) * fix (sidebar): toggle on border click position * chore: remove -2 padding * chore: change resize cursor type * feat: tooltip `followCursor` mode (#418) * wip: tooltip follow * feat: tooltip follow mode * fix: clean up tooltip code * fix: missing tooltip arrow changes --------- Co-authored-by: Rohan Chakraborty <irohan1999@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev>
* feat: Dropdown 2.0 (#367) * wip: dropdown changes * feat: migrate to ariakit dropdown menu * fix: update dropdown doc * feat: dropdown autocomplete support * fix: dropdown focus loop * feat: dropdown examples * fix: remove redundant prop * feat: update dropdown docs * feat: update dropdown docs * feat: update linear demo * chore: update pnpm lock * chore: update lockfile * fix: ci breaking as checkout position incorrect (#391) (#400) * fix: ci breaking as checkout position incorrect (#391) * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * ci: create release file for rc tags (#401) * fix: update tag regex in github action (#403) * ci: add npm dist tags to the package (#405) * feat: add `autocomplete` support for Select (#395) * feat: autocomplete functionality in select * feat: select autocomplete qol changes * feat: update select docs * feat: update select doc tag * feat: add support for htmlAutocomplete * feat: select improvements (#397) * feat: autocomplete functionality in select * feat: select autocomplete qol changes * feat: update select docs * feat: update select doc tag * feat: add support for htmlAutocomplete * feat: select updates * feat: update docs * fix: use rs space tokens * chore: merge main into develop (#408) * Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev> * fix: dropdown in breadcrumb and table (#409) * feat: breadcrumb `as` support (#410) * feat: breadcrumb as support * feat: update docs * fix: Tooltip.Arrow style (#412) * feat: tooltip arrow style changes * feat: update doc * feat: multi select support (#415) * wip: select * wip: multiselect * feat: multi select * feat: update doc * chore: update types * chore: revert types * feat: auto chip logic * fix: double click on keyboard use * fix: avatar circular dependency * fix: aria tags * fix: multi select aria tag * feat: children render prop * feat: style changes * chore: sync main into develop (#419) * Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment * chore: IconButton icon take size from parent (#411) * fix: HTML sub element coming on top of thead during table content scroll (#413) * fix (Sidebar): Item and container css fixes (#414) fix: minor css fixes * Fix/sidebar toggle position (#417) * fix (sidebar): toggle on border click position * chore: remove -2 padding * chore: change resize cursor type * feat: tooltip `followCursor` mode (#418) * wip: tooltip follow * feat: tooltip follow mode * fix: clean up tooltip code * fix: missing tooltip arrow changes * chore: remove duplicate id prop --------- Co-authored-by: Rohan Chakraborty <irohan1999@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev> * Chore/sync main into develop (#420) * Feat: Add Skeleton component (#381) * feat(calendar): handle loading state (#382) * feat(calendar): handle loading state * chore: minor refactor * fix: ci breaking as checkout position incorrect (#391) * Revert/workflow 4573 (#392) * fix (CI): Workflow breaking (#393) fix: update release workflow to enforce branch and tag rules * fix: update version in package.json (#394) * fix: update version in package.json * fix: add ref * feat: Support for `as` in Sidebar.Item (#386) * feat: as support for sidebar item * feat: update props in doc * Feat: Setup Code formatting, linting and import sorter (#384) * feat: grid component (#383) * feat: grid component * feat: grid doc * fix: Error prop not overriding for date-picker (#398) * Fix release files tag main (#404) * ci: create release file for rc tags * fix: update tag regex in github action * fix: Error prop not overriding for date-picker (#402) * fix: Error prop not overriding for date-picker * fix: Error prop not overriding for date-picker --------- Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> * chore (Box): Deprecate old Box component (#406) * fix: update version in package.json * chore: deprecate old box * chore: update package version * chore: update comment * chore: IconButton icon take size from parent (#411) * fix: HTML sub element coming on top of thead during table content scroll (#413) * fix (Sidebar): Item and container css fixes (#414) fix: minor css fixes * Fix/sidebar toggle position (#417) * fix (sidebar): toggle on border click position * chore: remove -2 padding * chore: change resize cursor type * feat: tooltip `followCursor` mode (#418) * wip: tooltip follow * feat: tooltip follow mode * fix: clean up tooltip code * fix: missing tooltip arrow changes --------- Co-authored-by: Rohan Chakraborty <irohan1999@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev> --------- Co-authored-by: Rohan Chakraborty <irohan1999@gmail.com> Co-authored-by: Rishabh Mishra <me@rsbh.dev> Co-authored-by: Gaurav Singh <gaurav3017@gmail.com> Co-authored-by: Pratik Kumar Singh <56654568+singh-pk@users.noreply.github.com>
Description
This PR introduces as support for sidebar items
Type of Change
How Has This Been Tested?
Manual