-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/filter-bar-dialog-search
- Loading branch information
Showing
13 changed files
with
1,248 additions
and
2,892 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
packages/main/src/components/ActionSheet/ActionSheet.stories.mdx
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,67 @@ | ||
import { Meta, Title, Description, Story, Preview, Props } from '@storybook/addon-docs/blocks'; | ||
import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes'; | ||
import { ActionSheet } from '@ui5/webcomponents-react/lib/ActionSheet'; | ||
import { Button } from '@ui5/webcomponents-react/lib/Button'; | ||
import { PlacementType } from '@ui5/webcomponents-react/lib/PlacementType'; | ||
import { PopoverHorizontalAlign } from '@ui5/webcomponents-react/lib/PopoverHorizontalAlign'; | ||
import { PopoverVerticalAlign } from '@ui5/webcomponents-react/lib/PopoverVerticalAlign'; | ||
import { useCallback, useRef } from 'react'; | ||
|
||
<Meta | ||
title="Components / ActionSheet" | ||
component={ActionSheet} | ||
argTypes={{ | ||
...createSelectArgTypes({ | ||
placementType: PlacementType, | ||
horizontalAlign: PopoverHorizontalAlign, | ||
verticalAlign: PopoverVerticalAlign | ||
}), | ||
children: { | ||
type: null | ||
}, | ||
footer: { | ||
type: null | ||
}, | ||
header: { | ||
type: null | ||
}, | ||
ref: { | ||
type: null | ||
} | ||
}} | ||
args={{ | ||
horizontalAlign: PopoverHorizontalAlign.Center, | ||
placementType: PlacementType.Right, | ||
verticalAlign: PopoverVerticalAlign.Center | ||
}} | ||
/> | ||
|
||
<Title /> | ||
<Subtitle /> | ||
<Description /> | ||
|
||
<Preview> | ||
<Story name="Default"> | ||
{(args) => { | ||
const actionSheetRef = useRef(); | ||
const onButtonClick = useCallback( | ||
(e) => { | ||
actionSheetRef.current.open(e.target); | ||
}, | ||
[actionSheetRef] | ||
); | ||
return ( | ||
<> | ||
<Button onClick={onButtonClick}>Open ActionSheet</Button> | ||
<ActionSheet ref={actionSheetRef} {...args}> | ||
<Button icon="add">Accept</Button> | ||
<Button>Reject</Button> | ||
<Button>This is my super long text!</Button> | ||
</ActionSheet> | ||
</> | ||
); | ||
}} | ||
</Story> | ||
</Preview> | ||
|
||
<Props story="Default" components={{ ActionSheet }} /> |
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
79 changes: 42 additions & 37 deletions
79
packages/main/src/components/ActionSheet/__snapshots__/ActionSheet.test.tsx.snap
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,46 +1,51 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ActionSheet Render without Crashing 1`] = ` | ||
<ui5-responsive-popover | ||
class="ActionSheet-actionSheet-0 myCustomClass" | ||
horizontal-align="Center" | ||
placement-type="Right" | ||
vertical-align="Center" | ||
> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
icon="add" | ||
<body> | ||
<div /> | ||
<ui5-responsive-popover | ||
class="ActionSheet-actionSheet myCustomClass" | ||
horizontal-align="Center" | ||
placement-type="Right" | ||
vertical-align="Center" | ||
> | ||
Accept | ||
</ui5-button> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
Reject | ||
</ui5-button> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
This is my super long text! | ||
</ui5-button> | ||
</ui5-responsive-popover> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
Accept | ||
</ui5-button> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
Reject | ||
</ui5-button> | ||
<ui5-button | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
This is my super long text! | ||
</ui5-button> | ||
</ui5-responsive-popover> | ||
</body> | ||
`; | ||
|
||
exports[`ActionSheet does not crash with other component 1`] = ` | ||
<ui5-responsive-popover | ||
class="ActionSheet-actionSheet-0" | ||
horizontal-align="Center" | ||
placement-type="Right" | ||
vertical-align="Center" | ||
> | ||
<ui5-label | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
<body> | ||
<div /> | ||
<ui5-responsive-popover | ||
class="ActionSheet-actionSheet" | ||
horizontal-align="Center" | ||
placement-type="Right" | ||
vertical-align="Center" | ||
> | ||
I should not crash | ||
</ui5-label> | ||
</ui5-responsive-popover> | ||
<ui5-label | ||
data-is-action-sheet-button="" | ||
design="Transparent" | ||
> | ||
I should not crash | ||
</ui5-label> | ||
</ui5-responsive-popover> | ||
</body> | ||
`; |
This file was deleted.
Oops, something went wrong.
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.