Skip to content

Commit

Permalink
fix(kit): InputDateRange fix dark mode issues and list item size (#…
Browse files Browse the repository at this point in the history
…9098)

Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
waterplea and taiga-family-bot authored Sep 19, 2024
1 parent c8c4a66 commit 6820698
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions projects/core/directives/dropdown/dropdown.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
position: absolute;
display: flex;
box-shadow: var(--tui-shadow-medium);
color: var(--tui-text-primary);
background: var(--tui-background-elevation-3);
border-radius: var(--tui-radius-m);
overflow: hidden;
Expand Down
8 changes: 4 additions & 4 deletions projects/core/styles/mixins/date-picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
}

&[data-range]::before {
background: var(--tui-background-base-alt);
background: var(--tui-background-neutral-1);
}

:host._picking &[data-range]::before {
background: var(--tui-background-neutral-1-hover);
}

&[data-range='middle'] {
border-color: var(--tui-background-base-alt);
border-color: var(--tui-background-neutral-1);

:host._picking & {
border-color: var(--tui-background-neutral-1-hover);
Expand All @@ -84,7 +84,7 @@
}

&[data-range='start'] {
border-inline-end-color: var(--tui-background-base-alt);
border-inline-end-color: var(--tui-background-neutral-1);
color: var(--tui-text-primary-on-accent-1);

:host._picking & {
Expand All @@ -101,7 +101,7 @@
}

&[data-range='end'] {
border-inline-start-color: var(--tui-background-base-alt);
border-inline-start-color: var(--tui-background-neutral-1);
color: var(--tui-text-primary-on-accent-1);

:host._picking & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
tuiPure,
} from '@taiga-ui/cdk/utils/miscellaneous';
import type {TuiMarkerHandler} from '@taiga-ui/core/components/calendar';
import {tuiAsDataListHost} from '@taiga-ui/core/components/data-list';
import {TUI_DATE_FORMAT, TUI_DEFAULT_DATE_FORMAT} from '@taiga-ui/core/tokens';
import type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';
import type {TuiDayRangePeriod} from '@taiga-ui/kit/components/calendar-range';
Expand Down Expand Up @@ -66,6 +67,7 @@ import {map} from 'rxjs';
tuiAsControl(TuiInputDateRangeComponent as any),
tuiAsLegacyControl(TuiInputDateRangeComponent),
tuiDateStreamWithTransformer(TUI_DATE_RANGE_VALUE_TRANSFORMER),
tuiAsDataListHost(TuiInputDateRangeComponent),
TUI_MOBILE_CALENDAR_PROVIDER,
],
host: {
Expand Down Expand Up @@ -162,6 +164,10 @@ export class TuiInputDateRangeComponent
: nativeValue;
}

public get size(): TuiSizeL | TuiSizeS {
return this.textfieldSize.size;
}

public onClick(): void {
if (!this.isMobile && this.interactive) {
this.toggle();
Expand Down Expand Up @@ -203,10 +209,6 @@ export class TuiInputDateRangeComponent
this.nativeValue = value ? this.computedValue : '';
}

protected get size(): TuiSizeL | TuiSizeS {
return this.textfieldSize.size;
}

protected get computedMobile(): boolean {
return this.isMobile && !!this.mobileCalendar;
}
Expand Down

0 comments on commit 6820698

Please sign in to comment.