-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite): Add cursor: not-allowed to some components when disabled (…
- Loading branch information
Showing
12 changed files
with
292 additions
and
80 deletions.
There are no files selected for viewing
72 changes: 30 additions & 42 deletions
72
packages/components/src/components/AutoScalingInput/AutoScalingInput.stories.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,49 +1,37 @@ | ||
import styled from 'styled-components'; | ||
import { AutoScalingInput as Input } from './AutoScalingInput'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex: 1; | ||
flex-direction: column; | ||
`; | ||
|
||
const BorderAutoScalingInput = styled(Input)` | ||
padding: 1px 5px; | ||
border-radius: 3px; | ||
border-style: solid; | ||
border-width: 1px; | ||
`; | ||
|
||
const BorderlessAutoScalingInput = styled(Input)` | ||
padding: 1px 5px; | ||
border-style: solid; | ||
border-width: 0; | ||
background-color: #ccc; | ||
`; | ||
import { ForwardRefExoticComponent, RefAttributes } from 'react'; | ||
import { AutoScalingInput as AutoScalingInputComponent, Props } from './AutoScalingInput'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
const meta: Meta = { | ||
title: 'Form/AutoScalingInput', | ||
component: AutoScalingInputComponent, | ||
}; | ||
export default meta; | ||
|
||
export const AutoScalingInput = { | ||
render: () => ( | ||
<> | ||
<Wrapper> | ||
<div>Border</div> | ||
<BorderAutoScalingInput minWidth={130} /> | ||
<BorderAutoScalingInput | ||
minWidth={120} | ||
placeholder="Chancellor on the Brink of Second Bailout for Banks" | ||
/> | ||
<div>Borderless</div> | ||
<BorderlessAutoScalingInput minWidth={130} /> | ||
<BorderlessAutoScalingInput | ||
minWidth={120} | ||
placeholder="Chancellor on the Brink of Second Bailout for Banks" | ||
/> | ||
</Wrapper> | ||
</> | ||
), | ||
export const AutoScalingInput: StoryObj< | ||
ForwardRefExoticComponent<Omit<Props, 'ref'> & RefAttributes<HTMLInputElement>> | ||
> = { | ||
render: props => <AutoScalingInputComponent {...props} />, | ||
args: { | ||
value: undefined, | ||
minWidth: 120, | ||
placeholder: 'Chancellor on the Brink of Second Bailout for Banks', | ||
disabled: false, | ||
}, | ||
argTypes: { | ||
value: { | ||
control: { type: 'text' }, | ||
}, | ||
minWidth: { | ||
control: { type: 'number' }, | ||
}, | ||
placeholder: { | ||
control: { type: 'text' }, | ||
}, | ||
disabled: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
}, | ||
}; |
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
49 changes: 49 additions & 0 deletions
49
packages/components/src/components/AutoScalingInput/AutoScalingInputExamples.stories.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,49 @@ | ||
import styled from 'styled-components'; | ||
import { AutoScalingInput as Input } from './AutoScalingInput'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex: 1; | ||
flex-direction: column; | ||
`; | ||
|
||
const BorderAutoScalingInput = styled(Input)` | ||
padding: 1px 5px; | ||
border-radius: 3px; | ||
border-style: solid; | ||
border-width: 1px; | ||
`; | ||
|
||
const BorderlessAutoScalingInput = styled(Input)` | ||
padding: 1px 5px; | ||
border-style: solid; | ||
border-width: 0; | ||
background-color: #ccc; | ||
`; | ||
|
||
const meta: Meta = { | ||
title: 'Form/AutoScalingInput', | ||
}; | ||
export default meta; | ||
|
||
export const AutoScalingInputExamples = { | ||
render: () => ( | ||
<> | ||
<Wrapper> | ||
<div>Border</div> | ||
<BorderAutoScalingInput minWidth={130} /> | ||
<BorderAutoScalingInput | ||
minWidth={120} | ||
placeholder="Chancellor on the Brink of Second Bailout for Banks" | ||
/> | ||
<div>Borderless</div> | ||
<BorderlessAutoScalingInput minWidth={130} /> | ||
<BorderlessAutoScalingInput | ||
minWidth={120} | ||
placeholder="Chancellor on the Brink of Second Bailout for Banks" | ||
/> | ||
</Wrapper> | ||
</> | ||
), | ||
}; |
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
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.