From 7d63e83f7781e5de213294418b74ea763d936b59 Mon Sep 17 00:00:00 2001 From: Arlindo Pereira Date: Fri, 13 Dec 2024 16:11:24 +0100 Subject: [PATCH] Code Review: refactor CSS classes to kebab-case --- .../forms/controls/DatePicker/DatePicker.module.scss | 8 ++++---- src/components/forms/controls/DatePicker/DatePicker.tsx | 6 +++--- .../forms/controls/DatePicker/DatePickerRange.tsx | 2 +- .../controls/DateTimePicker/DateTimePicker.module.scss | 6 +++--- .../forms/controls/DateTimePicker/DateTimePicker.tsx | 8 ++++---- .../forms/controls/TimePicker/TimePicker.module.scss | 8 ++++---- src/components/forms/controls/TimePicker/TimePicker.tsx | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/components/forms/controls/DatePicker/DatePicker.module.scss b/src/components/forms/controls/DatePicker/DatePicker.module.scss index 7cedf3a..e59c74f 100644 --- a/src/components/forms/controls/DatePicker/DatePicker.module.scss +++ b/src/components/forms/controls/DatePicker/DatePicker.module.scss @@ -184,20 +184,20 @@ $navigation-distance: 1rem; @layer baklava.components { $caret-width: 18px; - .bk-datepicker { - @include bk.component-base(bk-datepicker); + .bk-date-picker { + @include bk.component-base(bk-date-picker); display: flex; flex-direction: row; align-items: center; margin-right: -$caret-width; } - .bk-datepicker--input { + .bk-date-picker--input { width: 121px; color: bk.$theme-form-text-default; } - .bk-datepicker--caret { + .bk-date-picker--caret { width: $caret-width; height: $caret-width; position: relative; diff --git a/src/components/forms/controls/DatePicker/DatePicker.tsx b/src/components/forms/controls/DatePicker/DatePicker.tsx index 4839e12..90602ff 100644 --- a/src/components/forms/controls/DatePicker/DatePicker.tsx +++ b/src/components/forms/controls/DatePicker/DatePicker.tsx @@ -44,7 +44,7 @@ export const DatePicker = (props: DatePickerProps) => { return (
{ icon={} customInput={ } onCalendarClose={() => setIsOpen(false)} onCalendarOpen={() => setIsOpen(true)} {...propsRest} /> - +
); }; diff --git a/src/components/forms/controls/DatePicker/DatePickerRange.tsx b/src/components/forms/controls/DatePicker/DatePickerRange.tsx index 500402c..c611c50 100644 --- a/src/components/forms/controls/DatePicker/DatePickerRange.tsx +++ b/src/components/forms/controls/DatePicker/DatePickerRange.tsx @@ -41,7 +41,7 @@ export const DatePickerRange = (props: DatePickerRangeProps) => { return (
{ - // time from date object + // Time from date object. const time = { hours: date?.getHours() || 0, minutes: date?.getMinutes() || 0 }; - // manually update upstream date object when time is updated + // Manually update upstream Date object when time is updated. const onTimeUpdate = (time: Time) => { if (date) { const newDate = new Date(date); @@ -45,7 +45,7 @@ export const DateTimePicker = ({ unstyled = false, className, date, onChange, .. return (
diff --git a/src/components/forms/controls/TimePicker/TimePicker.module.scss b/src/components/forms/controls/TimePicker/TimePicker.module.scss index 466265f..d0e0400 100644 --- a/src/components/forms/controls/TimePicker/TimePicker.module.scss +++ b/src/components/forms/controls/TimePicker/TimePicker.module.scss @@ -5,14 +5,14 @@ @use '../../../../styling/defs.scss' as bk; @layer baklava.components { - .bk-timepicker { - @include bk.component-base(bk-timepicker); + .bk-time-picker { + @include bk.component-base(bk-time-picker); line-height: 1.8; } - .bk-timepicker--input { + .bk-time-picker--input { color: bk.$theme-form-text-default; - // a manual size increase to accomodate the clock icon without clipping the text + // A manual size increase to accommodate the clock icon without clipping the text. width: 92px; } } diff --git a/src/components/forms/controls/TimePicker/TimePicker.tsx b/src/components/forms/controls/TimePicker/TimePicker.tsx index f611e9e..a6dbd23 100644 --- a/src/components/forms/controls/TimePicker/TimePicker.tsx +++ b/src/components/forms/controls/TimePicker/TimePicker.tsx @@ -14,7 +14,7 @@ import cl from './TimePicker.module.scss'; export type Time = { hours: number, minutes: number, -} +}; export type TimePickerProps = ComponentProps<'input'> & { /** Whether this component should be unstyled. */ @@ -42,7 +42,7 @@ export const TimePicker = ({ unstyled = false, className, time, onUpdate, ...pro return (