diff --git a/epam-assets/theme/theme_6px.scss b/epam-assets/theme/theme_6px.scss index ad65b234d4..35d2cb251a 100644 --- a/epam-assets/theme/theme_6px.scss +++ b/epam-assets/theme/theme_6px.scss @@ -1,4 +1,5 @@ @mixin uui-6px-grid { + --uui-grid-unit: 6px; --uui-focus-outline-width: 2px; --uui-focus-outline-offset: 2px; --uui-focus-radius: 2px; diff --git a/epam-assets/theme/theme_vanilla_thunder.scss b/epam-assets/theme/theme_vanilla_thunder.scss index 12d370a09f..2420097a44 100644 --- a/epam-assets/theme/theme_vanilla_thunder.scss +++ b/epam-assets/theme/theme_vanilla_thunder.scss @@ -326,6 +326,7 @@ .uui-main_menu { --uui-main_menu-text: var(--chromatic-500); + --uui-main_menu-text-hover: var(--chromatic-500); --uui-main_menu-text-active: var(--uui-info-50); --uui-main_menu-bg: var(--uui-info-5); --uui-main_menu-hover: var(--uui-neutral-0); diff --git a/uui-components/src/inputs/DatePicker/Calendar.tsx b/uui-components/src/inputs/DatePicker/Calendar.tsx index 7d606a9048..5239745f87 100644 --- a/uui-components/src/inputs/DatePicker/Calendar.tsx +++ b/uui-components/src/inputs/DatePicker/Calendar.tsx @@ -95,7 +95,7 @@ export function Calendar(props: CalendarProps) { return (
); diff --git a/uui-components/src/inputs/DatePicker/MonthSelection.module.scss b/uui-components/src/inputs/DatePicker/MonthSelection.module.scss index fc2ed24b37..f45ad1fe46 100644 --- a/uui-components/src/inputs/DatePicker/MonthSelection.module.scss +++ b/uui-components/src/inputs/DatePicker/MonthSelection.module.scss @@ -1,12 +1,12 @@ .container { - &:global(.uui-monthselection-container) { - :global(.uui-monthselection-content) { + &:global(.uui-month_selection-container) { + :global(.uui-month_selection-content) { display: flex; flex-direction: column; font-size: 14px; } - :global(.uui-monthselection-month-container) { + :global(.uui-month_selection-month-container) { display: flex; flex-direction: column; @@ -15,7 +15,7 @@ } } - :global(.uui-monthselection-month) { + :global(.uui-month_selection-month) { display: flex; justify-content: center; align-items: center; diff --git a/uui-components/src/inputs/DatePicker/MonthSelection.tsx b/uui-components/src/inputs/DatePicker/MonthSelection.tsx index 55e88f124d..08d1fc912d 100644 --- a/uui-components/src/inputs/DatePicker/MonthSelection.tsx +++ b/uui-components/src/inputs/DatePicker/MonthSelection.tsx @@ -7,12 +7,12 @@ import css from './MonthSelection.module.scss'; const MONTH_ROW_LENGTH = 3; export const uuiMonthSelection = { - container: 'uui-monthselection-container', - content: 'uui-monthselection-content', - monthContainer: 'uui-monthselection-month-container', - monthsRow: 'uui-monthselection-months-row', - month: 'uui-monthselection-month', - currentMonth: 'uui-monthselection-current-month', + container: 'uui-month_selection-container', + content: 'uui-month_selection-content', + monthContainer: 'uui-month_selection-month-container', + monthsRow: 'uui-month_selection-months-row', + month: 'uui-month_selection-month', + currentMonth: 'uui-month_selection-current-month', } as const; interface MonthSelectionProps extends IEditable, IHasCX, IHasRawProps>, IHasForwardedRef { diff --git a/uui-components/src/inputs/DatePicker/YearSelection.module.scss b/uui-components/src/inputs/DatePicker/YearSelection.module.scss index d94d324256..94073e2c44 100644 --- a/uui-components/src/inputs/DatePicker/YearSelection.module.scss +++ b/uui-components/src/inputs/DatePicker/YearSelection.module.scss @@ -1,12 +1,12 @@ .container { - &:global(.uui-yearselection-container) { - :global(.uui-yearselection-content) { + &:global(.uui-year_selection-container) { + :global(.uui-year_selection-content) { display: flex; flex-direction: column; font-size: 14px; } - :global(.uui-yearselection-year-container) { + :global(.uui-year_selection-years-container) { display: flex; flex-direction: column; @@ -15,7 +15,7 @@ } } - :global(.uui-yearselection-year) { + :global(.uui-year_selection-year) { display: flex; justify-content: center; align-items: center; diff --git a/uui-components/src/inputs/DatePicker/YearSelection.tsx b/uui-components/src/inputs/DatePicker/YearSelection.tsx index aedd946a6a..778c2773ef 100644 --- a/uui-components/src/inputs/DatePicker/YearSelection.tsx +++ b/uui-components/src/inputs/DatePicker/YearSelection.tsx @@ -1,19 +1,17 @@ import * as React from 'react'; import { Dayjs } from '../../helpers/dayJsHelper'; -import { - IEditable, IHasCX, arrayToMatrix, cx, IHasRawProps, IHasForwardedRef, -} from '@epam/uui-core'; +import { IEditable, IHasCX, arrayToMatrix, cx, IHasRawProps, IHasForwardedRef } from '@epam/uui-core'; import css from './YearSelection.module.scss'; const MONTH_ROW_LENGTH = 4; export const uuiYearSelection = { - container: 'uui-yearselection-container', - content: 'uui-yearselection-content', - yearContainer: 'uui-yearselection-year-container', - yearRow: 'uui-yearselection-year-row', - year: 'uui-yearselection-year', - currentYear: 'uui-yearselection-current-year', + container: 'uui-year_selection-container', + content: 'uui-year_selection-content', + yearsContainer: 'uui-year_selection-years-container', + yearsRow: 'uui-year_selection-years-row', + year: 'uui-year_selection-year', + currentYear: 'uui-year_selection-current-year', } as const; export interface YearSelectionProps extends IEditable, IHasCX, IHasRawProps>, IHasForwardedRef { @@ -28,10 +26,10 @@ export function YearSelection(props: YearSelectionProps) { return (
-
- {arrayToMatrix(getYears(props.value.year()), MONTH_ROW_LENGTH).map((yearRow, index) => ( -
- {yearRow.map((year) => ( +
+ {arrayToMatrix(getYears(props.value.year()), MONTH_ROW_LENGTH).map((yearsRow, index) => ( +
+ {yearsRow.map((year) => (
, CalendarProps>(uuiCalendar, applyDateSelectionMods); diff --git a/uui/components/datePickers/CalendarPresets.module.scss b/uui/components/datePickers/CalendarPresets.module.scss index e878247272..9843aecc80 100644 --- a/uui/components/datePickers/CalendarPresets.module.scss +++ b/uui/components/datePickers/CalendarPresets.module.scss @@ -1,26 +1,39 @@ @use '../../assets/styles/index' as *; .root { + --uui-calendar-presets-header: var(--uui-text-primary); + --uui-calendar-presets-item: var(--uui-link); + + --uui-calendar-presets-container-padding: 24px 24px 12px; + --uui-calendar-presets-header-font-size: 14px; + --uui-calendar-presets-header-line-height: 24px; + --uui-calendar-presets-header-font-weight: 600; + --uui-calendar-presets-header-padding-bottom: 12px; + --uui-calendar-presets-item-font-size: 12px; + --uui-calendar-presets-item-line-height: 18px; + --uui-calendar-presets-item-font-weight: 600; + --uui-calendar-presets-item-padding-bottom: 6px; + &:global(.uui-presets-container) { - padding: 24px 24px 12px; + padding: var(--uui-calendar-presets-container-padding); } :global(.uui-presets-header) { + color: var(--uui-calendar-presets-header); font-family: var(--uui-font); - font-weight: 600; - font-size: 14px; - line-height: 24px; - padding-bottom: 12px; - color: var(--uui-text-primary); + font-weight: var(--uui-calendar-presets-header-font-weight); + font-size: var(--uui-calendar-presets-header-font-size); + line-height: var(--uui-calendar-presets-header-line-height); + padding-bottom: var(--uui-calendar-presets-header-padding-bottom); } :global(.uui-presets-item) { + color: var(--uui-calendar-presets-item); font-family: var(--uui-font); - font-weight: 600; - font-size: 12px; - line-height: 18px; - color: var(--uui-link); - padding-bottom: 6px; + font-weight: var(--uui-calendar-presets-item-font-weight); + font-size: var(--uui-calendar-presets-item-font-size); + line-height: var(--uui-calendar-presets-item-line-height); + padding-bottom: var(--uui-calendar-presets-item-padding-bottom); &:hover { color: var(--uui-link-hover); diff --git a/uui/components/datePickers/DatePickerBody.module.scss b/uui/components/datePickers/DatePickerBody.module.scss index 9f267d6b9d..647277e4d5 100644 --- a/uui/components/datePickers/DatePickerBody.module.scss +++ b/uui/components/datePickers/DatePickerBody.module.scss @@ -9,31 +9,40 @@ --uui-dtp_body-content-font: var(--uui-font); --uui-dtp_body-content-font-weight: 400; + + --uui-dtp_body-min-height: 282px; + --uui-dtp_body-padding: 12px; + + --uui-dtp-cell-height: var(--uui-size); + --uui-dtp-cell-hover-height: calc(var(--uui-dtp-cell-height) - var(--uui-dtp-cell-border-width) * 2); + --uui-dtp-cell-border-width: var(--uui-border-width); + --uui-dtp-cell-border-radius: calc(var(--uui-dtp-cell-height) / 2); + + --uui-dtp-month-width: 72px; + --uui-dtp-month-hover-width: calc(var(--uui-dtp-month-width) - var(--uui-dtp-cell-border-width) * 2); + --uui-dtp-month-margin: 6px; + + --uui-dtp-year-width: 63px; + --uui-dtp-year-hover-width: calc(var(--uui-dtp-year-width) - var(--uui-dtp-cell-border-width) * 2); + --uui-dtp-year-margin: 6px 0; } -:global(.uui-datepickerBody-wrapper) { - min-height: 300px; - padding: 0 18px 12px; +:global(.uui-datepicker-body-wrapper) { + min-height: var(--uui-dtp_body-min-height); + padding: var(--uui-dtp_body-padding); // DatePickerBase style :global(.uui-datepicker-container) { background-color: var(--uui-dtp_body-title-bg); } - // Header styles - :global(.uui-datepickerheader-header) { - padding-top: 18px; - padding-bottom: 6px; - } - // Month and Year selection styles - :global(.uui-monthselection-content), :global(.uui-yearselection-content) { + :global(.uui-month_selection-content), :global(.uui-year_selection-content) { font-family: var(--uui-dtp_body-content-font); font-weight: var(--uui-dtp_body-content-font-weight, normal); } - :global(.uui-monthselection-month-container) { - margin: 0 0 12px; + :global(.uui-month_selection-month-container) { display: flex; flex-direction: column; @@ -42,64 +51,62 @@ } } - :global(.uui-yearselection-year-container) { + :global(.uui-year_selection-years-container) { display: flex; flex-direction: column; - margin: 0 0 12px; & > * { display: flex; } } - :global(.uui-yearselection-year-row) { + :global(.uui-year_selection-years-row) { display: flex; justify-content: space-between; - width: 252px; } - :global(.uui-monthselection-month) { - width: 72px; - height: 36px; - border-radius: 20px; - margin: 6px; + :global(.uui-month_selection-month) { + width: var(--uui-dtp-month-width); + height: var(--uui-dtp-cell-height); + border-radius: var(--uui-dtp-cell-border-radius); + margin: var(--uui-dtp-month-margin); color: var(--uui-dtp_body-text); &:hover { - width: 70px; - height: 34px; - border: 1px solid var(--uui-dtp_body-item-border-hover); + width: var(--uui-dtp-month-hover-width); + height: var(--uui-dtp-cell-hover-height); + border: var(--uui-dtp-cell-border-width) solid var(--uui-dtp_body-item-border-hover); cursor: pointer; } } - :global(.uui-yearselection-year) { - width: 63px; - height: 36px; + :global(.uui-year_selection-year) { + width: var(--uui-dtp-year-width); + height: var(--uui-dtp-cell-height); display: flex; justify-content: center; align-items: center; - border-radius: 20px; - margin: 6px 0; + border-radius: var(--uui-dtp-cell-border-radius); + margin: var(--uui-dtp-year-margin); color: var(--uui-dtp_body-text); &:hover { - width: 61px; - height: 34px; - border: 1px solid var(--uui-dtp_body-item-border-hover); + width: var(--uui-dtp-year-hover-width); + height: var(--uui-dtp-cell-hover-height); + border: var(--uui-dtp-cell-border-width) solid var(--uui-dtp_body-item-border-hover); cursor: pointer; } } - :global(.uui-monthselection-current-month) { - &:global(.uui-monthselection-month) { + :global(.uui-month_selection-current-month) { + &:global(.uui-month_selection-month) { background-color: var(--uui-dtp_body-item-bg-selected); color: var(--uui-dtp_body-text-selected); } } - :global(.uui-yearselection-current-year) { - &:global(.uui-yearselection-year) { + :global(.uui-year_selection-current-year) { + &:global(.uui-year_selection-year) { background-color: var(--uui-dtp_body-item-bg-selected); color: var(--uui-dtp_body-text-selected); } diff --git a/uui/components/datePickers/DatePickerBody.tsx b/uui/components/datePickers/DatePickerBody.tsx index c28b228616..fbf0eff705 100644 --- a/uui/components/datePickers/DatePickerBody.tsx +++ b/uui/components/datePickers/DatePickerBody.tsx @@ -6,12 +6,13 @@ import { import { MonthSelection, YearSelection } from '@epam/uui-components'; import { DatePickerHeader } from './DatePickerHeader'; import { Calendar } from './Calendar'; -import css from './DatePickerBody.module.scss'; import { CommonDatePickerBodyProps, ViewType } from './types'; import { getNewMonth, uuiDatePickerBodyBase, valueFormat, } from './helpers'; import { Dayjs, uuiDayjs } from '../../helpers/dayJsHelper'; +import { settings } from '../../settings'; +import css from './DatePickerBody.module.scss'; export interface DatePickerBodyProps extends CommonDatePickerBodyProps, IControlled { /** @@ -21,7 +22,7 @@ export interface DatePickerBodyProps extends CommonDatePickerBodyProps, IControl } export const uuiDatePickerBody = { - wrapper: 'uui-datepickerBody-wrapper', + wrapper: 'uui-datepicker-body-wrapper', separator: 'uui-datepickerBody-separator', } as const; @@ -132,7 +133,7 @@ function StatelessDatePickerBodyComp({ return (
diff --git a/uui/components/datePickers/DatePickerHeader.module.scss b/uui/components/datePickers/DatePickerHeader.module.scss index db9ddc74f5..c00570b71d 100644 --- a/uui/components/datePickers/DatePickerHeader.module.scss +++ b/uui/components/datePickers/DatePickerHeader.module.scss @@ -1,24 +1,27 @@ -.container { - &:global(.uui-datepickerheader-container) { - :global(.uui-datepickerheader-header) { +.root { + --uui-dtp_header-padding-bottom: 6px; + + &:global(.uui-datepicker-header-container) { + :global(.uui-datepicker-header-nav) { display: flex; justify-content: space-between; + padding-bottom: var(--uui-dtp_header-padding-bottom); } - :global(.uui-datepickerheader-nav-title) { + :global(.uui-datepicker-header-nav-title) { display: flex; align-items: center; } } } -*[dir='rtl'] .container :global(.uui-datepickerheader-nav-icon-left), .container[dir='rtl'] :global(.uui-datepickerheader-nav-icon-left) { +*[dir='rtl'] .container :global(.uui-datepicker-header-nav-icon-left), .container[dir='rtl'] :global(.uui-datepicker-header-nav-icon-left) { svg { transform: rotate(180deg); } } -*[dir='rtl'] .container :global(.uui-datepickerheader-nav-icon-right), .container[dir='rtl'] :global(.uui-datepickerheader-nav-icon-right) { +*[dir='rtl'] .container :global(.uui-datepicker-header-nav-icon-right), .container[dir='rtl'] :global(.uui-datepicker-header-nav-icon-right) { svg { transform: rotate(180deg); } diff --git a/uui/components/datePickers/DatePickerHeader.tsx b/uui/components/datePickers/DatePickerHeader.tsx index d87f547054..cb75f7c4e2 100644 --- a/uui/components/datePickers/DatePickerHeader.tsx +++ b/uui/components/datePickers/DatePickerHeader.tsx @@ -12,11 +12,11 @@ import { } from './helpers'; export const uuiHeader = { - container: 'uui-datepickerheader-container', - header: 'uui-datepickerheader-header', - navTitle: 'uui-datepickerheader-nav-title', - navIconRight: 'uui-datepickerheader-nav-icon-right', - navIconLeft: 'uui-datepickerheader-nav-icon-left', + container: 'uui-datepicker-header-container', + headerNav: 'uui-datepicker-header-nav', + navTitle: 'uui-datepicker-header-nav-title', + navIconRight: 'uui-datepicker-header-nav-icon-right', + navIconLeft: 'uui-datepicker-header-nav-icon-left', }; interface DatePickerHeaderValue { @@ -123,8 +123,8 @@ export function DatePickerHeader({ const disableNext = view === 'YEAR_SELECTION' && !isYearWithinSoberRange(getNextYearsList(month)); return ( -
-
+
+