-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca117c0
commit b2733db
Showing
19 changed files
with
1,827 additions
and
215 deletions.
There are no files selected for viewing
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
Empty file.
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,19 @@ | ||
import React, { AllHTMLAttributes, ElementType, forwardRef } from 'react' | ||
|
||
import { Sprinkles, rainbowSprinkles } from '../../../css/rainbow-spinkles.css' | ||
|
||
type HTMLProperties = Omit<AllHTMLAttributes<HTMLElement>, 'as'> | ||
|
||
export type BoxProps = Sprinkles & HTMLProperties & { as?: ElementType } | ||
|
||
export const Box = forwardRef<HTMLElement, BoxProps>( | ||
({ as, children, ...props }, ref) => { | ||
const Component = as || 'div' | ||
const { className, style, otherProps } = rainbowSprinkles(props) | ||
return ( | ||
<Component className={className} ref={ref} style={style} {...otherProps}> | ||
{children} | ||
</Component> | ||
) | ||
}, | ||
) |
Oops, something went wrong.