-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from SySagar/dev
Dev
- Loading branch information
Showing
27 changed files
with
828 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@groovy-box/ui': patch | ||
--- | ||
|
||
color revamp with theming for light adn dark mode |
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import { cn } from '../utils/utils'; | ||
|
||
interface ComponentWrapperProps extends React.HTMLAttributes<HTMLDivElement> { | ||
children: React.ReactNode; | ||
height?: string; | ||
} | ||
|
||
export default function ComponenentWrapper({ | ||
children, | ||
height = '300px', | ||
}: { | ||
children: React.ReactNode; | ||
height?: string; | ||
}) { | ||
return ( | ||
<div | ||
className={`ui flex flex-row items-center justify-center h-[${height}] gap-20`} | ||
> | ||
{children} | ||
</div> | ||
...props | ||
}: ComponentWrapperProps) { | ||
console.log('hetight', height); | ||
const mergedClassNames = cn( | ||
`ui flex flex-row items-center justify-center h-[${height}] gap-20`, | ||
props.className, | ||
); | ||
return <div className={mergedClassNames}>{children}</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type ClassValue, clsx } from 'clsx'; | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
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,57 @@ | ||
import React from 'react'; | ||
import { useEffect } from 'react'; | ||
|
||
export function withGlobalStyles(Story, context) { | ||
let { scheme } = context.globals; | ||
|
||
useEffect(() => { | ||
if (scheme === 'dark') { | ||
document.documentElement.classList.add('dark'); | ||
} else { | ||
document.documentElement.classList.remove('dark'); | ||
} | ||
}, [scheme]); | ||
|
||
function Flex({ children, ...props }) { | ||
return ( | ||
<div | ||
{...props} | ||
style={{ | ||
display: 'flex', | ||
padding: '3rem', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
if (scheme === 'light') { | ||
return ( | ||
<Flex className="color-scheme--light"> | ||
<Story /> | ||
</Flex> | ||
); | ||
} | ||
|
||
if (scheme === 'dark') { | ||
return ( | ||
<Flex className="color-scheme--dark"> | ||
<Story /> | ||
</Flex> | ||
); | ||
} | ||
|
||
return ( | ||
<div> | ||
<Flex className="color-scheme--dark"> | ||
<Story /> | ||
</Flex> | ||
<Flex className="color-scheme--light"> | ||
<Story /> | ||
</Flex> | ||
</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
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,9 @@ | ||
.color-scheme--dark { | ||
background-color: #0a0a0a; | ||
--text-color: #ffffff; | ||
} | ||
|
||
.color-scheme--light { | ||
background-color: #ffffff; | ||
--text-color: #000000; | ||
} |
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,6 @@ | ||
declare const styles: { | ||
readonly "color-scheme--dark": string; | ||
readonly "color-scheme--light": string; | ||
}; | ||
export = styles; | ||
|
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
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
declare const styles: { | ||
readonly "dark": string; | ||
readonly "ui": string; | ||
}; | ||
export = styles; | ||
|
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
Oops, something went wrong.