-
Notifications
You must be signed in to change notification settings - Fork 9
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 #130 from loathers/chakra3
chakra-ui v3
- Loading branch information
Showing
105 changed files
with
2,203 additions
and
1,252 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 |
---|---|---|
|
@@ -5,11 +5,9 @@ | |
"type": "module", | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@chakra-ui/icons": "^2.1.1", | ||
"@chakra-ui/react": "^2.8.2", | ||
"@chakra-ui/react": "^3.1.2", | ||
"@chakra-ui/system": "^2.6.2", | ||
"@emotion/react": "^11.13.3", | ||
"@emotion/styled": "^11.13.0", | ||
"@eslint/compat": "^1.1.1", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"dataloader": "^2.2.2", | ||
|
@@ -18,16 +16,18 @@ | |
"eslint-plugin-libram": "^0.4.17", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"eslint-plugin-unused-imports": "^4.1.4", | ||
"framer-motion": "^11.3.29", | ||
"globals": "^15.9.0", | ||
"html-entities": "^2.5.2", | ||
"kolmafia": "npm:[email protected]", | ||
"libram": "^0.9.18", | ||
"lucide-react": "^0.460.0", | ||
"next-themes": "^0.4.3", | ||
"postcss": "^8.4.41", | ||
"prettier": "^3.3.3", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-error-boundary": "^4.0.13", | ||
"react-icons": "^5.3.0", | ||
"react-router-dom": "^6.26.1", | ||
"tome-kolmafia-lib": "^5.28118.0", | ||
"tome-kolmafia-react": "^0.2.5", | ||
|
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,23 @@ | ||
import { Box, Text, TooltipProps } from "@chakra-ui/react"; | ||
import { FC, ReactNode } from "react"; | ||
import { FC } from "react"; | ||
|
||
import AdviceTip from "./AdviceTip"; | ||
import { Tooltip, TooltipProps } from "./ui/tooltip"; | ||
|
||
interface AdviceTooltipProps extends Omit<TooltipProps, "children"> { | ||
text: string | JSX.Element; | ||
label: ReactNode; | ||
} | ||
/** | ||
* A tooltip generated on text for a quick descriptive tooltip. | ||
* @param text The text you want displayed inside this tooltip. | ||
* @param label The text you want displayed that users hover over to get the tooltip | ||
* @returns A FC Tooltip object where the label generates the tooltip on hoverover. | ||
*/ | ||
|
||
const AdviceTooltip: FC<AdviceTooltipProps> = ({ text, label, ...props }) => { | ||
const toolTip = ( | ||
<Box bg="gray.100" p={2} rounded="md" fontSize={12}> | ||
{typeof text === "string" ? <Text>{text}</Text> : text} | ||
</Box> | ||
); | ||
|
||
return ( | ||
<AdviceTip label={toolTip} {...props}> | ||
<Text | ||
as="span" | ||
fontWeight="bold" | ||
color="gray.500" | ||
decoration="underline dotted lightsteelblue" | ||
cursor="pointer" | ||
> | ||
{label} | ||
</Text> | ||
</AdviceTip> | ||
); | ||
}; | ||
const AdviceTooltip: FC<TooltipProps> = ({ content, ...props }) => ( | ||
<Tooltip | ||
showArrow | ||
openDelay={0} | ||
contentProps={{ | ||
css: { "--tooltip-bg": "bg" }, | ||
bgColor: "bg", | ||
border: "1px solid border", | ||
shadow: "xs", | ||
rounded: "md", | ||
mx: 5, | ||
p: 3, | ||
}} | ||
content={content} | ||
{...props} | ||
/> | ||
); | ||
|
||
export default AdviceTooltip; |
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,43 @@ | ||
import { Box, Text } from "@chakra-ui/react"; | ||
import { FC } from "react"; | ||
|
||
import AdviceTooltip from "./AdviceTooltip"; | ||
import { TooltipProps } from "./ui/tooltip"; | ||
|
||
interface AdviceTooltipProps extends Omit<TooltipProps, "content"> { | ||
advice: string | JSX.Element; | ||
} | ||
/** | ||
* A tooltip generated on text for a quick descriptive tooltip. | ||
* @param text The text you want displayed inside this tooltip. | ||
* @param label The text you want displayed that users hover over to get the tooltip | ||
* @returns A FC Tooltip object where the label generates the tooltip on hoverover. | ||
*/ | ||
|
||
const AdviceTooltipText: FC<AdviceTooltipProps> = ({ | ||
advice, | ||
children, | ||
...props | ||
}) => { | ||
const toolTip = ( | ||
<Box bg="bg.muted" p={2} rounded="md" fontSize="xs"> | ||
{typeof advice === "string" ? <Text>{advice}</Text> : advice} | ||
</Box> | ||
); | ||
|
||
return ( | ||
<AdviceTooltip content={toolTip} {...props}> | ||
<Text | ||
as="span" | ||
fontWeight="bold" | ||
color="fg.subtle" | ||
textDecoration="underline dotted" | ||
cursor="pointer" | ||
> | ||
{children} | ||
</Text> | ||
</AdviceTooltip> | ||
); | ||
}; | ||
|
||
export default AdviceTooltipText; |
Oops, something went wrong.