-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [sparkle] - feature: update @radix-ui/react-separator and add Separator component - Upgraded @radix-ui/react-separator to version 1.1.0 to include new react versions in peerDependencies - Introduced new Separator component with vertical and horizontal orientation support - Organized imports in package.json and added @radix-ui/react-separator as a dependency - Enhanced tailwind config with separator color customization for light and dark themes * [sparkle] - feature: bump package version to 0.2.257 - Increment the package version to release new updates and features - Ensure lock file matches the new version for consistency * [sparkle] - refactor: use Separator component in Page instead of divs - Replace manual divs with Separator component to maintain consistency and reuse components - Simplify the Page.Separator implementation for better readability and maintenance --------- Co-authored-by: Jules <[email protected]>
- Loading branch information
1 parent
0350086
commit f9d242e
Showing
7 changed files
with
122 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as SeparatorPrimitive from "@radix-ui/react-separator" | ||
import * as React from "react" | ||
|
||
import { classNames } from "@sparkle/lib/utils"; | ||
|
||
|
||
const Separator = React.forwardRef< | ||
React.ElementRef<typeof SeparatorPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> | ||
>( | ||
( | ||
{ className, orientation = "horizontal", decorative = true, ...props }, | ||
ref | ||
) => ( | ||
<SeparatorPrimitive.Root | ||
ref={ref} | ||
decorative={decorative} | ||
orientation={orientation} | ||
className={classNames( | ||
"s-bg-separator s-shrink-0", | ||
orientation === "horizontal" ? "s-h-[1px] s-w-full" : "s-h-full s-w-[1px]", | ||
className ?? "" | ||
)} | ||
{...props} | ||
/> | ||
) | ||
) | ||
Separator.displayName = SeparatorPrimitive.Root.displayName | ||
|
||
export { Separator } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Meta } from "@storybook/react"; | ||
import * as React from "react"; | ||
|
||
import { Separator } from "@sparkle/index_with_tw_base"; | ||
|
||
const meta = { | ||
title: "Primitives/Separator", | ||
component: Separator, | ||
} satisfies Meta<typeof Separator>; | ||
|
||
export default meta; | ||
|
||
export const SeparatorExample = () => ( | ||
<div> | ||
<div className="s-space-y-1"> | ||
<h4 className="s-text-sm s-font-medium s-leading-none">Dust Separator</h4> | ||
<p className="s-text-sm s-text-muted-foreground"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | ||
</p> | ||
</div> | ||
<Separator className="s-my-4" /> | ||
<div className="s-flex s-h-5 s-items-center s-space-x-4 s-text-sm"> | ||
<div>Dust</div> | ||
<Separator orientation="vertical" /> | ||
<div>Separator</div> | ||
<Separator orientation="vertical" /> | ||
<div>Menu</div> | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters