Skip to content

Commit

Permalink
fix!: Label is mandatory for TimePicker component (#2629)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: TimePicker implementations must specify a label prop
  • Loading branch information
m7adeel authored Oct 27, 2023
1 parent 59dffd1 commit c7f00d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/components/forms/TimePicker/TimePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const completeTimePicker = (
<TimePicker
id="appointment-time"
name="appointment-time"
label="Appointment Time"
label="Appointment time"
hint="hh:mm"
onChange={noop}
disabled={argTypes.disabled}
Expand All @@ -54,6 +54,7 @@ export const defaultTimePicker = (
<TimePicker
id="appointment-time"
name="appointment-time"
label="Appointment time"
onChange={noop}
disabled={argTypes.disabled}
/>
Expand All @@ -67,7 +68,7 @@ export const withMinAndMaxTimes = (
<TimePicker
id="appointment-time"
name="appointment-time"
label="Appointment Time"
label="Appointment time"
hint="hh:mm (9:00am - 5:00pm)"
minTime="9:00"
maxTime="17:00"
Expand All @@ -84,7 +85,7 @@ export const withDefaultValue = (
<TimePicker
id="appointment-time"
name="appointment-time"
label="Appointment Time"
label="Appointment time"
hint="hh:mm"
defaultValue="12:00"
onChange={noop}
Expand Down
1 change: 1 addition & 0 deletions src/components/forms/TimePicker/TimePicker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('TimePicker Component', () => {
const testProps = {
id: 'appointment-time',
name: 'appointment-time',
label: 'Appointment time',
onChange: jest.fn(),
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/TimePicker/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type BaseTimePickerProps = {
id: string
name: string
onChange: (val?: string) => void
label?: string
label: string
defaultValue?: string
disabled?: boolean
minTime?: string
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==

0 comments on commit c7f00d3

Please sign in to comment.