-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
116ec45
commit 94d970d
Showing
21 changed files
with
330 additions
and
111 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 @@ | ||
--- | ||
'@saas-ui/file-upload': minor | ||
--- | ||
|
||
Add getRootNode prop to support shadowdom and frames |
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 @@ | ||
--- | ||
'@saas-ui/theme-glass': patch | ||
--- | ||
|
||
Added neutral color scheme support for buttons |
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 @@ | ||
--- | ||
'@saas-ui/core': patch | ||
--- | ||
|
||
Export SaasProviderProps |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React, { useState } from 'react' | ||
import { | ||
Button, | ||
Menu, | ||
MenuButton, | ||
MenuList, | ||
MenuItemOption, | ||
MenuOptionGroup, | ||
} from '@chakra-ui/react' | ||
|
||
import { LuPaintbrush } from 'react-icons/lu' | ||
|
||
interface ColorControlProps { | ||
onChange(color: string): void | ||
value: string | ||
} | ||
|
||
const themes: Record<string, string> = { | ||
'saas-ui': 'Saas UI', | ||
glass: 'Glass', | ||
} | ||
|
||
export function ThemeControl({ onChange, value }: ColorControlProps) { | ||
// @todo remove this hack to prevent hydration errors | ||
const initializedRef = React.useRef(false) | ||
React.useEffect(() => { | ||
if (!initializedRef.current) { | ||
initializedRef.current = true | ||
} | ||
}, []) | ||
|
||
if (!initializedRef.current) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Menu> | ||
<MenuButton as={Button} leftIcon={<LuPaintbrush />} variant="tertiary"> | ||
{themes[value]} | ||
</MenuButton> | ||
<MenuList> | ||
<MenuOptionGroup value={value} onChange={onChange} type="radio"> | ||
<MenuItemOption value="saas-ui">Saas UI (default)</MenuItemOption> | ||
<MenuItemOption value="glass">Glass</MenuItemOption> | ||
</MenuOptionGroup> | ||
</MenuList> | ||
</Menu> | ||
) | ||
} |
Oops, something went wrong.