-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
b3f41d1
commit e9552ba
Showing
24 changed files
with
128 additions
and
130 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
4 changes: 2 additions & 2 deletions
4
docs/data/base/components/button/UnstyledButtonIntroduction/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<CustomButton>Button</CustomButton> | ||
<CustomButton disabled>Disabled</CustomButton> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> |
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
34 changes: 16 additions & 18 deletions
34
docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import * as React from 'react'; | ||
import { Button, ButtonProps } from '@mui/base/Button'; | ||
import { Button as BaseButton, ButtonProps } from '@mui/base/Button'; | ||
import Stack from '@mui/material/Stack'; | ||
import clsx from 'clsx'; | ||
|
||
export default function UnstyledButtonsIntroduction() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<CustomButton>Button</CustomButton> | ||
<CustomButton disabled>Disabled</CustomButton> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> | ||
</Stack> | ||
); | ||
} | ||
|
||
const CustomButton = React.forwardRef<HTMLButtonElement, ButtonProps>( | ||
(props, ref) => { | ||
const { className, ...other } = props; | ||
return ( | ||
<Button | ||
ref={ref} | ||
className={clsx( | ||
'cursor-pointer disabled:cursor-not-allowed text-sm font-sans bg-violet-500 hover:bg-violet-600 active:bg-violet-700 text-white rounded-lg font-semibold px-4 py-2 border-none disabled:opacity-50', | ||
className, | ||
)} | ||
{...other} | ||
/> | ||
); | ||
}, | ||
); | ||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => { | ||
const { className, ...other } = props; | ||
return ( | ||
<BaseButton | ||
ref={ref} | ||
className={clsx( | ||
'cursor-pointer disabled:cursor-not-allowed text-sm font-sans bg-violet-500 hover:bg-violet-600 active:bg-violet-700 text-white rounded-lg font-semibold px-4 py-2 border-none disabled:opacity-50', | ||
className, | ||
)} | ||
{...other} | ||
/> | ||
); | ||
}); |
4 changes: 2 additions & 2 deletions
4
docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<CustomButton>Button</CustomButton> | ||
<CustomButton disabled>Disabled</CustomButton> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> |
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
6 changes: 3 additions & 3 deletions
6
docs/data/base/components/button/UnstyledButtonsDisabledFocus.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<CustomButton disabled>focusableWhenDisabled = false</CustomButton> | ||
<CustomButton disabled focusableWhenDisabled> | ||
<Button disabled>focusableWhenDisabled = false</Button> | ||
<Button disabled focusableWhenDisabled> | ||
focusableWhenDisabled = true | ||
</CustomButton> | ||
</Button> |
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
8 changes: 4 additions & 4 deletions
8
docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<CustomButton slots={{ root: 'span' }} disabled> | ||
<Button slots={{ root: 'span' }} disabled> | ||
focusableWhenDisabled = false | ||
</CustomButton> | ||
<CustomButton slots={{ root: 'span' }} disabled focusableWhenDisabled> | ||
</Button> | ||
<Button slots={{ root: 'span' }} disabled focusableWhenDisabled> | ||
focusableWhenDisabled = true | ||
</CustomButton> | ||
</Button> |
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
4 changes: 2 additions & 2 deletions
4
docs/data/base/components/button/UnstyledButtonsSimple/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<CustomButton>Button</CustomButton> | ||
<CustomButton disabled>Disabled</CustomButton> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> |
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.