-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(xplat): Add button stories to StrictDomDemo (#30849)
- Loading branch information
Showing
9 changed files
with
205 additions
and
11 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
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,28 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
import { makeStyles } from '@fluentui/react-platform-adapter-preview'; | ||
|
||
const useStyles = makeStyles({ | ||
wrapper: { | ||
columnGap: '15px', | ||
display: 'flex', | ||
}, | ||
}); | ||
|
||
export const Appearance = () => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.wrapper}> | ||
<Button>Default</Button> | ||
<Button appearance="primary">Primary</Button> | ||
<Button appearance="outline">Outline</Button> | ||
<Button appearance="subtle">Subtle</Button> | ||
<Button appearance="transparent">Transparent</Button> | ||
</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,8 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
|
||
export const Default = () => <Button>Example</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
import { makeStyles } from '@fluentui/react-platform-adapter-preview'; | ||
|
||
const useStyles = makeStyles({ | ||
innerWrapper: { | ||
columnGap: '15px', | ||
display: 'flex', | ||
}, | ||
outerWrapper: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
rowGap: '15px', | ||
}, | ||
}); | ||
|
||
export const Disabled = () => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.outerWrapper}> | ||
<div className={styles.innerWrapper}> | ||
<Button>Enabled state</Button> | ||
<Button disabled>Disabled state</Button> | ||
<Button disabledFocusable>Disabled focusable state</Button> | ||
</div> | ||
<div className={styles.innerWrapper}> | ||
<Button appearance="primary">Enabled state</Button> | ||
<Button appearance="primary" disabled> | ||
Disabled state | ||
</Button> | ||
<Button appearance="primary" disabledFocusable> | ||
Disabled focusable state | ||
</Button> | ||
</div> | ||
</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,25 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
import { makeStyles } from '@fluentui/react-platform-adapter-preview'; | ||
|
||
const useStyles = makeStyles({ | ||
wrapper: { | ||
columnGap: '15px', | ||
display: 'flex', | ||
}, | ||
}); | ||
|
||
export const Shape = () => { | ||
const styles = useStyles(); | ||
return ( | ||
<div className={styles.wrapper}> | ||
<Button>Rounded</Button> | ||
<Button shape="circular">Circular</Button> | ||
<Button shape="square">Square</Button> | ||
</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,38 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
import { makeStyles } from '@fluentui/react-platform-adapter-preview'; | ||
|
||
const useStyles = makeStyles({ | ||
innerWrapper: { | ||
// alignItems: 'start', | ||
columnGap: '15px', | ||
display: 'flex', | ||
}, | ||
outerWrapper: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
rowGap: '15px', | ||
}, | ||
}); | ||
|
||
export const Size = () => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.outerWrapper}> | ||
<div className={styles.innerWrapper}> | ||
<Button size="small">Small</Button> | ||
</div> | ||
<div className={styles.innerWrapper}> | ||
<Button>Medium</Button> | ||
</div> | ||
<div className={styles.innerWrapper}> | ||
<Button size="large">Large</Button> | ||
</div> | ||
</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,28 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Default } from './ButtonDefault'; | ||
import { Shape } from './ButtonShape'; | ||
import { Appearance } from './ButtonAppearance'; | ||
import { Size } from './ButtonSize'; | ||
import { Disabled } from './ButtonDisabled'; | ||
import { WithLongText } from './ButtonWithLongText'; | ||
|
||
export const ButtonStories = () => ( | ||
<div> | ||
<h1>Default</h1> | ||
<Default /> | ||
<h1>Shape</h1> | ||
<Shape /> | ||
<h1>Appearance</h1> | ||
<Appearance /> | ||
<h1>Size</h1> | ||
<Size /> | ||
<h1>Disabled</h1> | ||
<Disabled /> | ||
<h1>With long text</h1> | ||
<WithLongText /> | ||
</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,29 @@ | ||
/** @jsxRuntime automatic */ | ||
/** @jsxImportSource @fluentui/react-jsx-runtime */ | ||
|
||
import * as React from 'react'; | ||
|
||
import { Button } from '@fluentui/react-button'; | ||
import { makeStyles } from '@fluentui/react-platform-adapter-preview'; | ||
|
||
const useStyles = makeStyles({ | ||
longText: { | ||
width: '280px', | ||
}, | ||
wrapper: { | ||
alignItems: 'center', | ||
columnGap: '15px', | ||
display: 'flex', | ||
}, | ||
}); | ||
|
||
export const WithLongText = () => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.wrapper}> | ||
<Button>Short text</Button> | ||
<Button className={styles.longText}>Long text wraps after it hits the max width of the component</Button> | ||
</div> | ||
); | ||
}; |