Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import React from 'react'
import {Meta} from '@storybook/react'
import {ThemeProvider} from 'styled-components'

import {
BaseStyles,
Expand All @@ -11,7 +12,8 @@ import {
ButtonInvisible,
ButtonOutline,
ButtonPrimary,
ButtonTableList
ButtonTableList,
theme
} from '..'
import {ButtonStyleProps} from 'styled-system'
import {ButtonBaseProps} from '../Button/ButtonBase'
Expand All @@ -23,9 +25,11 @@ export default {
decorators: [
Story => {
return (
<BaseStyles>
<Story />
</BaseStyles>
<ThemeProvider theme={theme}>
<BaseStyles>
<Story />
</BaseStyles>
</ThemeProvider>
)
}
],
Expand Down
11 changes: 7 additions & 4 deletions src/stories/Portal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import React from 'react'
import {Meta} from '@storybook/react'
import {ThemeProvider} from 'styled-components'

import {BaseStyles, Box} from '..'
import {BaseStyles, Box, theme} from '..'
import Portal, {registerPortalRoot} from '../Portal'

export default {
Expand All @@ -14,9 +15,11 @@ export default {
// story works in isolation.
registerPortalRoot(undefined)
return (
<BaseStyles>
<Story />
</BaseStyles>
<ThemeProvider theme={theme}>
<BaseStyles>
<Story />
</BaseStyles>
</ThemeProvider>
)
}
]
Expand Down
16 changes: 11 additions & 5 deletions src/stories/useAnchoredPosition.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import React from 'react'
import {Meta} from '@storybook/react'

import {BaseStyles, Box, ButtonPrimary, Position} from '..'
import {BaseStyles, Box, ButtonPrimary, Position, theme} from '..'
import {useAnchoredPosition} from '../hooks/useAnchoredPosition'
import styled from 'styled-components'
import styled, {ThemeProvider} from 'styled-components'
import {get} from '../constants'
import {AnchorSide} from '../behaviors/anchoredPosition'
import Portal, {registerPortalRoot} from '../Portal'
Expand All @@ -15,7 +15,11 @@ export default {
// Note: For some reason, if you use <BaseStyles><Story /></BaseStyles>,
// the component gets unmounted from the root every time a control changes!
Story => {
return <BaseStyles>{Story()}</BaseStyles>
return (
<ThemeProvider theme={theme}>
<BaseStyles>{Story()}</BaseStyles>
</ThemeProvider>
)
}
],
argTypes: {
Expand Down Expand Up @@ -229,7 +233,7 @@ export const WithPortal = () => {
left={position?.left ?? 0}
width={250}
height={400}
sx={{visibility: position ? "visible" : "hidden"}}
sx={{visibility: position ? 'visible' : 'hidden'}}
>
An un-constrained overlay!
</Float>
Expand All @@ -239,7 +243,9 @@ export const WithPortal = () => {
</Nav>
<Box sx={{flexGrow: 1}} p={3}>
<h1>The body!</h1>
<p><em>Note: The controls below have no effect in this story.</em></p>
<p>
<em>Note: The controls below have no effect in this story.</em>
</p>
</Box>
</Main>
)
Expand Down