-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(IconButton): update public documentation + prop API [F36-1540] (#…
…2940) * docs(IconButton): update public documentation + prop API * chore: add changelog * docs: adjust path to prevent broken link-check * docs(IconButton): adjust the tooltip section * chore: update changelog
- Loading branch information
1 parent
8e984ea
commit 96c125c
Showing
8 changed files
with
110 additions
and
86 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,6 @@ | ||
--- | ||
"@contentful/f36-website": patch | ||
"@contentful/f36-button": patch | ||
--- | ||
|
||
docs(IconButton): update public documentation + prop API |
30 changes: 30 additions & 0 deletions
30
packages/components/button/examples/IconButtonSizesExample.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,30 @@ | ||
import React from 'react'; | ||
import { IconButton, Stack } from '@contentful/f36-components'; | ||
import { CalendarIcon } from '@contentful/f36-icons'; | ||
|
||
export default function IconButtonExample() { | ||
return ( | ||
<Stack flexDirection="column"> | ||
<Stack> | ||
<IconButton | ||
size="small" | ||
variant="secondary" | ||
aria-label="Select the date" | ||
icon={<CalendarIcon size="tiny" />} | ||
/> | ||
<IconButton | ||
size="medium" | ||
variant="secondary" | ||
aria-label="Select the date" | ||
icon={<CalendarIcon size="tiny" />} | ||
/> | ||
<IconButton | ||
size="large" | ||
variant="secondary" | ||
aria-label="Select the date" | ||
icon={<CalendarIcon size="tiny" />} | ||
/> | ||
</Stack> | ||
</Stack> | ||
); | ||
} |
47 changes: 0 additions & 47 deletions
47
packages/components/button/examples/IconButtonToolbarExample.tsx
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/components/button/examples/IconButtonTooltipExample.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,41 @@ | ||
import React from 'react'; | ||
import { IconButton, Flex, Stack } from '@contentful/f36-components'; | ||
import { css } from 'emotion'; | ||
import tokens from '@contentful/f36-tokens'; | ||
import { FormatBoldIcon, FormatItalicIcon } from '@contentful/f36-icons'; | ||
|
||
export default function IconButtonTooltipExample() { | ||
const styles = { | ||
editorToolbarContainer: css({ | ||
backgroundColor: tokens.gray200, | ||
borderRadius: tokens.borderRadiusMedium, | ||
}), | ||
}; | ||
return ( | ||
<Flex | ||
justifyContent="space-between" | ||
className={styles.editorToolbarContainer} | ||
padding="spacingXs" | ||
> | ||
<Stack spacing="spacingXs"> | ||
<IconButton | ||
aria-label="Toggle bold" | ||
icon={<FormatBoldIcon />} | ||
variant="transparent" | ||
size="small" | ||
withTooltip | ||
tooltipProps={{ content: 'Bold' }} | ||
/> | ||
|
||
<IconButton | ||
aria-label="Toggle italic" | ||
icon={<FormatItalicIcon />} | ||
variant="transparent" | ||
size="small" | ||
withTooltip | ||
tooltipProps={{ content: 'Italic' }} | ||
/> | ||
</Stack> | ||
</Flex> | ||
); | ||
} |
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