From 161a931f897edc38b1eb6aff22f36e5eb75c4388 Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Tue, 23 May 2023 09:01:48 -0700 Subject: [PATCH] fix: Adds validation styles to datepicker (#2398) Co-authored-by: Brandon Lenz --- .../forms/DatePicker/DatePicker.stories.tsx | 17 +- .../forms/DatePicker/DatePicker.test.tsx | 207 +++++++----------- .../forms/DatePicker/DatePicker.tsx | 15 +- 3 files changed, 112 insertions(+), 127 deletions(-) diff --git a/src/components/forms/DatePicker/DatePicker.stories.tsx b/src/components/forms/DatePicker/DatePicker.stories.tsx index 5643418de8..96f15e908f 100644 --- a/src/components/forms/DatePicker/DatePicker.stories.tsx +++ b/src/components/forms/DatePicker/DatePicker.stories.tsx @@ -13,6 +13,13 @@ export default { argTypes: { onSubmit: { action: 'submitted' }, disabled: { control: { type: 'boolean' } }, + validationStatus: { + control: { + type: 'select', + options: [undefined, 'success', 'error'], + }, + defaultValue: undefined, + } }, parameters: { docs: { @@ -45,14 +52,15 @@ We may find that we want to expose props for custom event handlers or even a ref type StorybookArguments = { onSubmit: React.FormEventHandler disabled?: boolean + validationStatus: 'success' | 'error' | undefined } export const completeDatePicker = ( argTypes: StorybookArguments ): React.ReactElement => (
- -