diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e1169bf56..9c2cffa225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Features - Split action handlers with "OR" condition in accessibility behaviors @sophieH29 ([#1622](https://github.com/stardust-ui/react/pull/1622)) +- Add `headerAction` slot to the `Dialog` component @mnajdova ([#1617](https://github.com/stardust-ui/react/pull/1617)) ## [v0.34.1](https://github.com/stardust-ui/react/tree/v0.34.1) (2019-07-11) diff --git a/docs/src/examples/components/Dialog/Content/DialogExampleContent.shorthand.steps.ts b/docs/src/examples/components/Dialog/Content/DialogExampleContent.shorthand.steps.ts new file mode 100644 index 0000000000..5262188359 --- /dev/null +++ b/docs/src/examples/components/Dialog/Content/DialogExampleContent.shorthand.steps.ts @@ -0,0 +1,8 @@ +import getScreenerSteps from '../commonScreenerSteps' + +const config: ScreenerTestsConfig = { + themes: ['teams', 'teamsDark', 'teamsHighContrast'], + steps: getScreenerSteps(), +} + +export default config diff --git a/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.steps.ts b/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.steps.ts new file mode 100644 index 0000000000..5262188359 --- /dev/null +++ b/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.steps.ts @@ -0,0 +1,8 @@ +import getScreenerSteps from '../commonScreenerSteps' + +const config: ScreenerTestsConfig = { + themes: ['teams', 'teamsDark', 'teamsHighContrast'], + steps: getScreenerSteps(), +} + +export default config diff --git a/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.tsx b/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.tsx new file mode 100644 index 0000000000..06b3fd1e5e --- /dev/null +++ b/docs/src/examples/components/Dialog/Content/DialogExampleHeaderAction.shorthand.tsx @@ -0,0 +1,21 @@ +import * as React from 'react' +import { Button, Dialog } from '@stardust-ui/react' +import { useBooleanKnob } from '@stardust-ui/docs-components' + +const DialogExampleHeaderAction: React.FC = () => { + const [open, setOpen] = useBooleanKnob({ name: 'open' }) + return ( + setOpen(open)} + cancelButton="Cancel" + confirmButton="Confirm" + content="Are you sure you want to confirm this action?" + header="Action confirmation" + headerAction={{ icon: 'close', title: 'Close', onClick: () => setOpen(false) }} + trigger={