@kadconsulting/dry
Version:
KAD Reusable Component Library
53 lines • 1.78 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { ThemeProvider } from '~components/ThemeProvider';
import ConfirmationDialog from './ConfirmationDialog';
import darkTheme from '~themes/default/palette/dark';
import lightTheme from '~themes/default/palette/light';
import { ThemeTypes } from '~components/ThemeProvider/types';
export default {
title: 'Components/ConfirmationDialog',
tags: ['autodocs'],
component: ConfirmationDialog,
argTypes: {
message: {
control: 'text',
description: 'The message displayed in the dialog',
},
onConfirm: {
action: 'Confirmed',
description: 'Action when Confirm button is clicked',
},
onCancel: {
action: 'Canceled',
description: 'Action when Cancel button is clicked',
},
},
};
const ThemeAwareStory = (args, context) => {
const themeType = context.globals.themeType ?? ThemeTypes.LIGHT;
return (_jsx(ThemeProvider, { overrides: { themeType }, themes: { light: lightTheme, dark: darkTheme }, children: _jsx(ConfirmationDialog, { ...args }) }));
};
export const Default = {
render: (args, context) => ThemeAwareStory(args, context),
args: {
message: 'Are you sure?',
},
};
export const WithCustomMessage = {
render: (args, context) => ThemeAwareStory(args, context),
args: {
message: 'Do you want to proceed?',
},
};
export const WithThemeSwitch = {
render: (args, context) => ThemeAwareStory(args, context),
parameters: {
controls: {
disable: true,
},
},
};
export const Playground = {
render: (args, context) => ThemeAwareStory(args, context),
};
//# sourceMappingURL=ConfirmationDialog.stories.js.map