From cb2e35fc155f26403572a0e66bd7167e454c34b4 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Wed, 7 Feb 2024 14:25:48 -0800 Subject: [PATCH] added story --- .../forms/DatePicker/DatePicker.stories.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/forms/DatePicker/DatePicker.stories.tsx b/src/components/forms/DatePicker/DatePicker.stories.tsx index ec774f4854..59f67e926c 100644 --- a/src/components/forms/DatePicker/DatePicker.stories.tsx +++ b/src/components/forms/DatePicker/DatePicker.stories.tsx @@ -7,11 +7,23 @@ import { FormGroup } from '../FormGroup/FormGroup' import { Label } from '../Label/Label' import { TextInput } from '../TextInput/TextInput' import { ValidationStatus } from '../../../types/validationStatus' +import { + DEFAULT_EXTERNAL_DATE_FORMAT, + DateFormat, + INTERNAL_DATE_FORMAT, +} from './constants' export default { title: 'Components/Date picker', component: DatePicker, argTypes: { + dateFormat: { + control: 'radio', + options: [ + DEFAULT_EXTERNAL_DATE_FORMAT as DateFormat, + INTERNAL_DATE_FORMAT as DateFormat, + ], + }, onSubmit: { action: 'submitted' }, disabled: { control: { type: 'boolean' } }, validationStatus: { @@ -50,6 +62,7 @@ We may find that we want to expose props for custom event handlers or even a ref } type StorybookArguments = { + dateFormat: DateFormat onSubmit: React.FormEventHandler disabled?: boolean validationStatus?: ValidationStatus @@ -66,7 +79,7 @@ export const CompleteDatePicker = { Appointment date
- mm/dd/yyyy + {argTypes.dateFormat ?? DEFAULT_EXTERNAL_DATE_FORMAT}