From c7f00d35175d4dd0b59288eb34685edc9525cb0f Mon Sep 17 00:00:00 2001 From: Muhammad Adeel <87698014+m7adeel@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:25:21 -0700 Subject: [PATCH] fix!: Label is mandatory for TimePicker component (#2629) BREAKING CHANGE: TimePicker implementations must specify a label prop --- src/components/forms/TimePicker/TimePicker.stories.tsx | 7 ++++--- src/components/forms/TimePicker/TimePicker.test.tsx | 1 + src/components/forms/TimePicker/TimePicker.tsx | 2 +- yarn.lock | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/forms/TimePicker/TimePicker.stories.tsx b/src/components/forms/TimePicker/TimePicker.stories.tsx index 33bb7c6cf4..657723d756 100644 --- a/src/components/forms/TimePicker/TimePicker.stories.tsx +++ b/src/components/forms/TimePicker/TimePicker.stories.tsx @@ -39,7 +39,7 @@ export const completeTimePicker = ( @@ -67,7 +68,7 @@ export const withMinAndMaxTimes = ( { const testProps = { id: 'appointment-time', name: 'appointment-time', + label: 'Appointment time', onChange: jest.fn(), } diff --git a/src/components/forms/TimePicker/TimePicker.tsx b/src/components/forms/TimePicker/TimePicker.tsx index cd6140423a..802c687e08 100644 --- a/src/components/forms/TimePicker/TimePicker.tsx +++ b/src/components/forms/TimePicker/TimePicker.tsx @@ -18,7 +18,7 @@ type BaseTimePickerProps = { id: string name: string onChange: (val?: string) => void - label?: string + label: string defaultValue?: string disabled?: boolean minTime?: string diff --git a/yarn.lock b/yarn.lock index fe0f81dce3..b5ea1e7bd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16237,4 +16237,4 @@ zip-stream@^4.1.0: zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== + integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== \ No newline at end of file