-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Showing
39 changed files
with
1,455 additions
and
3 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
docs/data/base/components/tooltip/UnstyledTooltipDelayGroup.js
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,60 @@ | ||
import * as React from 'react'; | ||
import { Tooltip, TooltipGroup } from '@mui/base/Tooltip'; | ||
import { styled } from '@mui/system'; | ||
|
||
export default function UnstyledTooltipDelayGroup() { | ||
return ( | ||
<div style={{ display: 'flex', gap: 12 }}> | ||
<TooltipGroup closeDelay={200}> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor A</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip A</TooltipContent> | ||
</Tooltip> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor B</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip B</TooltipContent> | ||
</Tooltip> | ||
</TooltipGroup> | ||
</div> | ||
); | ||
} | ||
|
||
const blue = { | ||
400: '#3399FF', | ||
600: '#0072E6', | ||
800: '#004C99', | ||
}; | ||
|
||
export const TooltipContent = styled(Tooltip.Content)` | ||
${({ theme }) => ` | ||
background: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
color: ${theme.palette.mode === 'dark' ? 'black' : 'white'}; | ||
padding: 4px 6px; | ||
border-radius: 4px; | ||
font-size: 95%; | ||
cursor: default; | ||
`} | ||
`; | ||
|
||
export const AnchorButton = styled('button')` | ||
border: none; | ||
background: ${blue[600]}; | ||
color: white; | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
&:focus-visible { | ||
outline: 2px solid ${blue[400]}; | ||
outline-offset: 2px; | ||
} | ||
&:hover, | ||
&[data-state='open'] { | ||
background: ${blue[800]}; | ||
} | ||
`; |
60 changes: 60 additions & 0 deletions
60
docs/data/base/components/tooltip/UnstyledTooltipDelayGroup.tsx
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,60 @@ | ||
import * as React from 'react'; | ||
import { Tooltip, TooltipGroup } from '@mui/base/Tooltip'; | ||
import { styled } from '@mui/system'; | ||
|
||
export default function UnstyledTooltipDelayGroup() { | ||
return ( | ||
<div style={{ display: 'flex', gap: 12 }}> | ||
<TooltipGroup closeDelay={200}> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor A</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip A</TooltipContent> | ||
</Tooltip> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor B</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip B</TooltipContent> | ||
</Tooltip> | ||
</TooltipGroup> | ||
</div> | ||
); | ||
} | ||
|
||
const blue = { | ||
400: '#3399FF', | ||
600: '#0072E6', | ||
800: '#004C99', | ||
}; | ||
|
||
export const TooltipContent = styled(Tooltip.Content)` | ||
${({ theme }) => ` | ||
background: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
color: ${theme.palette.mode === 'dark' ? 'black' : 'white'}; | ||
padding: 4px 6px; | ||
border-radius: 4px; | ||
font-size: 95%; | ||
cursor: default; | ||
`} | ||
`; | ||
|
||
export const AnchorButton = styled('button')` | ||
border: none; | ||
background: ${blue[600]}; | ||
color: white; | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
&:focus-visible { | ||
outline: 2px solid ${blue[400]}; | ||
outline-offset: 2px; | ||
} | ||
&:hover, | ||
&[data-state='open'] { | ||
background: ${blue[800]}; | ||
} | ||
`; |
14 changes: 14 additions & 0 deletions
14
docs/data/base/components/tooltip/UnstyledTooltipDelayGroup.tsx.preview
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,14 @@ | ||
<TooltipGroup closeDelay={200}> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor A</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip A</TooltipContent> | ||
</Tooltip> | ||
<Tooltip anchorGap={5}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton>Anchor B</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent>Tooltip B</TooltipContent> | ||
</Tooltip> | ||
</TooltipGroup> |
59 changes: 59 additions & 0 deletions
59
docs/data/base/components/tooltip/UnstyledTooltipIntroduction/system/index.js
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,59 @@ | ||
import * as React from 'react'; | ||
import { Tooltip } from '@mui/base/Tooltip'; | ||
import { styled } from '@mui/system'; | ||
|
||
export default function UnstyledTooltipIntroduction() { | ||
return ( | ||
<Tooltip anchorGap={7}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton type="button">Anchor</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent> | ||
Tooltip | ||
<TooltipArrow /> | ||
</TooltipContent> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
const blue = { | ||
400: '#3399FF', | ||
600: '#0072E6', | ||
800: '#004C99', | ||
}; | ||
|
||
export const TooltipContent = styled(Tooltip.Content)` | ||
${({ theme }) => ` | ||
background: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
color: ${theme.palette.mode === 'dark' ? 'black' : 'white'}; | ||
padding: 4px 6px; | ||
border-radius: 4px; | ||
font-size: 95%; | ||
cursor: default; | ||
`} | ||
`; | ||
|
||
export const AnchorButton = styled('button')` | ||
border: none; | ||
background: ${blue[600]}; | ||
color: white; | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
&:focus-visible { | ||
outline: 2px solid ${blue[400]}; | ||
outline-offset: 2px; | ||
} | ||
&:hover, | ||
&[data-state='open'] { | ||
background: ${blue[800]}; | ||
} | ||
`; | ||
|
||
export const TooltipArrow = styled(Tooltip.Arrow)` | ||
${({ theme }) => ` | ||
fill: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
`} | ||
`; |
59 changes: 59 additions & 0 deletions
59
docs/data/base/components/tooltip/UnstyledTooltipIntroduction/system/index.tsx
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,59 @@ | ||
import * as React from 'react'; | ||
import { Tooltip } from '@mui/base/Tooltip'; | ||
import { styled } from '@mui/system'; | ||
|
||
export default function UnstyledTooltipIntroduction() { | ||
return ( | ||
<Tooltip anchorGap={7}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton type="button">Anchor</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent> | ||
Tooltip | ||
<TooltipArrow /> | ||
</TooltipContent> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
const blue = { | ||
400: '#3399FF', | ||
600: '#0072E6', | ||
800: '#004C99', | ||
}; | ||
|
||
export const TooltipContent = styled(Tooltip.Content)` | ||
${({ theme }) => ` | ||
background: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
color: ${theme.palette.mode === 'dark' ? 'black' : 'white'}; | ||
padding: 4px 6px; | ||
border-radius: 4px; | ||
font-size: 95%; | ||
cursor: default; | ||
`} | ||
`; | ||
|
||
export const AnchorButton = styled('button')` | ||
border: none; | ||
background: ${blue[600]}; | ||
color: white; | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
&:focus-visible { | ||
outline: 2px solid ${blue[400]}; | ||
outline-offset: 2px; | ||
} | ||
&:hover, | ||
&[data-state='open'] { | ||
background: ${blue[800]}; | ||
} | ||
`; | ||
|
||
export const TooltipArrow = styled(Tooltip.Arrow)` | ||
${({ theme }) => ` | ||
fill: ${theme.palette.mode === 'dark' ? 'white' : 'black'}; | ||
`} | ||
`; |
9 changes: 9 additions & 0 deletions
9
docs/data/base/components/tooltip/UnstyledTooltipIntroduction/system/index.tsx.preview
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 @@ | ||
<Tooltip anchorGap={7}> | ||
<Tooltip.AnchorFragment> | ||
<AnchorButton type="button">Anchor</AnchorButton> | ||
</Tooltip.AnchorFragment> | ||
<TooltipContent> | ||
Tooltip | ||
<TooltipArrow /> | ||
</TooltipContent> | ||
</Tooltip> |
Oops, something went wrong.