Skip to content

Commit 4544049

Browse files
authored
Merge branch 'main' into chore/expose-narrow-asset-types
2 parents 5d36c1c + 25bfc23 commit 4544049

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

.changeset/chatty-terms-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clickhouse/click-ui': patch
3+
---
4+
5+
Explicitly sets box-sizing: content-box on predefined date picker lists. This prevents them for being pushed to too small a size when the app they're in uses a different box sizing model"

src/components/DatePicker/Common.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
weekdayFormatter,
2727
} from './utils';
2828
import { getMonthNames, DAYS, MONTHS, YEARS, DAYS_IN_WEEK } from '@/utils/date';
29+
import { Dropdown } from '@/components/Dropdown';
2930

3031
const explicitWidth = '250px';
3132
const TXT_ON_MONTH_SELECT = 'Month';
@@ -499,6 +500,11 @@ export const DateTableCell = styled.td<{
499500
}
500501
`;
501502

503+
export const StyledDropdownItem = styled(Dropdown.Item)`
504+
box-sizing: content-box;
505+
min-height: 24px;
506+
`;
507+
502508
export type Body = ReturnType<typeof useCalendar>['body'];
503509

504510
interface CalendarRendererProps {

src/components/DatePicker/DateRangePicker.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ import {
1212
import { isSameDate, UseCalendarOptions } from '@h6s/calendar';
1313
import { styled } from 'styled-components';
1414
import { Dropdown } from '@/components/Dropdown';
15-
import { Body, CalendarRenderer, DateRangePickerInput, DateTableCell } from './Common';
15+
import {
16+
Body,
17+
CalendarRenderer,
18+
DateRangePickerInput,
19+
DateTableCell,
20+
StyledDropdownItem,
21+
} from './Common';
1622
import { Container } from '@/components/Container';
1723
import { Panel } from '@/components/Panel';
1824
import { Icon } from '@/components/Icon';
@@ -55,10 +61,6 @@ const StyledCalendarRenderer = styled(CalendarRenderer)`
5561
min-height: 221px;
5662
`;
5763

58-
const StyledDropdownItem = styled(Dropdown.Item)`
59-
min-height: 24px;
60-
`;
61-
6264
// max-height of 210px allows the scrollable container to be a reasonble height that matches the calendar
6365
const ScrollableContainer = styled(Container)`
6466
max-height: 210px;

src/components/DatePicker/DateTimeRangePicker.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
CalendarRenderer,
1818
DateTimeRangePickerInput,
1919
DateTableCell,
20+
StyledDropdownItem,
2021
} from './Common';
2122
import { Container } from '../Container/Container';
2223
import { Panel } from '../Panel/Panel';
@@ -68,10 +69,6 @@ const StyledTriggerList = styled(Tabs.TriggersList)`
6869
justify-content: space-around;
6970
`;
7071

71-
const StyledDropdownItem = styled(Dropdown.Item)`
72-
min-height: 24px;
73-
`;
74-
7572
// max-height of 210px allows the scrollable container to be a reasonble height that matches the calendar
7673
const ScrollableContainer = styled(Container)`
7774
max-height: 210px;

0 commit comments

Comments
 (0)