Skip to content
Open
12 changes: 6 additions & 6 deletions semcore/date-picker/__tests__/date-picker.browser-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ test.describe(`${TAG.VISUAL}`, () => {
await test.step('Verify disabled date styles', async () => {
await checkStyle(locators.cells(page, 0), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

await test.step('Verify style of available date', async () => {
await checkStyle(locators.cells(page, 2), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

Expand All @@ -165,7 +165,7 @@ test.describe(`${TAG.VISUAL}`, () => {
await test.step('Verify style of selected date', async () => {
await checkStyle(selectedCell, {
...selectedCellStyles,
margin: '4px 0px 0px',
margin: '0px',
width: '32px',
height: '32px',
});
Expand Down Expand Up @@ -206,14 +206,14 @@ test.describe(`${TAG.VISUAL}`, () => {
await test.step('Verify hover disabled date', async () => {
await checkStyle(locators.cells(page, 0), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

await test.step('Verify style of available date', async () => {
await checkStyle(locators.cells(page, 10), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

Expand All @@ -229,7 +229,7 @@ test.describe(`${TAG.VISUAL}`, () => {
await test.step('Verify style of selected date', async () => {
await checkStyle(selectedCell, {
...selectedCellStyles,
margin: '4px 0px 0px',
margin: '0px',
width: '32px',
});
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test.describe(`${TAG.VISUAL}`, () => {
await test.step('Verify style of available date', async () => {
await checkStyle(locators.cells(page, 2), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

Expand All @@ -98,7 +98,7 @@ test.describe(`${TAG.VISUAL}`, () => {

await test.step('Verify style of selected date', async () => {
await checkStyle(selectedCell.nth(0), {
margin: '4px 0px 0px',
margin: '0px',
width: '32px',
height: '32px',
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ test.describe(`${TAG.VISUAL}`, () => {
locator: locators.cells(page, 0),
expectedStyles: {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
},
},
{
locator: locators.cells(page, 10),
expectedStyles: {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
},
},
];
Expand All @@ -208,7 +208,7 @@ test.describe(`${TAG.VISUAL}`, () => {
await locators.button(page, 'Apply').waitFor({ state: 'visible' });

const cell = page.locator('[data-ui-name="CalendarDays.Unit"][class*="Selected"]');
await checkStyle(cell.nth(1), { margin: '4px 0px 0px', width: '32px', height: '32px' });
await checkStyle(cell.nth(1), { margin: '0px', width: '32px', height: '32px' });
});

await test.step('Verify style for Apply picker button', async () => {
Expand Down
4 changes: 2 additions & 2 deletions semcore/date-picker/__tests__/month-picker.browser-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ test.describe(`${TAG.VISUAL}`, () => {
const nonSelectedCell = page.locator('[data-ui-name="CalendarMonths.Unit"]:not([class*="Selected"])').first();
await checkStyle(nonSelectedCell, {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

await test.step('Verify style of selected date', async () => {
await checkStyle(selectedCell, {
...selectedCellStyles,
margin: '4px 0px 0px',
margin: '0px',
width: '60px',
height: '32px',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test.describe(`${TAG.VISUAL}`, () => {
const cell = locators.cells(page, 2);
await checkStyle(cell, {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

Expand All @@ -110,7 +110,7 @@ test.describe(`${TAG.VISUAL}`, () => {
.locator('[data-ui-name="CalendarMonths.Unit"][class*="Selected"]')
.nth(0);
await checkStyle(selectedCell, {
margin: '4px 0px 0px',
margin: '0px',
width: '60px',
height: '32px',
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ test.describe(`${TAG.VISUAL}`, () => {

await checkStyle(locators.cells(page, 0), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

await test.step('Verify available date style', async () => {
await checkStyle(locators.cells(page, 2), {
...defaultCellStyles,
margin: '4px 0px 0px',
margin: '0px',
});
});

Expand All @@ -175,7 +175,7 @@ test.describe(`${TAG.VISUAL}`, () => {

await test.step('Verify selected date style', async () => {
await checkStyle(selectedCells.nth(0), {
margin: '4px 0px 0px',
margin: '0px',
width: '60px',
height: '32px',
});
Expand Down
61 changes: 31 additions & 30 deletions semcore/date-picker/src/style/calendar.shadow.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
SCalendar {
display: flex;
flex-direction: column;
border-radius: var(--intergalactic-surface-rounded, 8px);
border-radius: var(--intergalactic-rounded-small, 4px);
Comment thread
ilyabrower marked this conversation as resolved.
gap: var(--intergalactic-spacing-content-gap-small, 4px);
Comment thread
ilyabrower marked this conversation as resolved.

SCalendarUnit:focus-visible {
outline: none;
Expand All @@ -12,11 +13,12 @@ SGridDays {
display: grid;
grid-template-columns: repeat(7, minmax(32px, auto));
grid-template-rows: repeat(auto-fit, minmax(32px, auto));
grid-row-gap: var(--intergalactic-spacing-content-gap-small, 4px);
}

SGridMonths {
display: grid;
grid-row-gap: var(--intergalactic-spacing-2x, 8px);
grid-row-gap: var(--intergalactic-spacing-content-gap-large, 8px);
grid-template-columns: repeat(3, minmax(60px, auto));
grid-template-rows: repeat(4, minmax(32px, auto));
}
Expand Down Expand Up @@ -55,7 +57,7 @@ SCalendarUnit {
background-color: var(--intergalactic-date-picker-cell, oklch(1 0 0));

align-items: center;
border-radius: var(--intergalactic-control-rounded, 6px);
border-radius: var(--intergalactic-rounded-small, 4px);
box-sizing: border-box;
cursor: pointer;
display: flex;
Expand All @@ -67,7 +69,6 @@ SCalendarUnit {
transition: border-radius 0.15s 0.15s;
outline: none;
margin: 0;
margin-top: 4px;
Comment thread
ilyabrower marked this conversation as resolved.

&:hover {
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
Expand All @@ -82,7 +83,7 @@ SCalendarUnit[today] {
display: block;
top: 1px;
left: 1px;
border-radius: var(--intergalactic-control-rounded, 6px);
border-radius: var(--intergalactic-rounded-small, 4px);
width: calc(100% - 2px);
height: calc(100% - 2px);
box-sizing: border-box;
Expand Down Expand Up @@ -124,9 +125,9 @@ SCalendarUnit[startSelected] {
background-color: var(--intergalactic-date-picker-cell-active, oklch(0.23 0.01 140));

&:not([highlighted]) {
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: 0;
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-top-right-radius: 0;
}

Expand All @@ -142,9 +143,9 @@ SCalendarUnit[endSelected] {

&:not([highlighted]) {
border-bottom-left-radius: 0;
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
border-top-left-radius: 0;
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
}

&:hover {
Expand All @@ -154,31 +155,31 @@ SCalendarUnit[endSelected] {
}

SCalendarUnit[startHighlighted]:not([selected]) {
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: 0;
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-top-right-radius: 0;
}

SCalendarUnit[endHighlighted]:not([selected]) {
border-bottom-left-radius: 0;
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
border-top-left-radius: 0;
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[startHighlighted]SCalendarUnit[endHighlighted] {
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[startSelected]SCalendarUnit[endSelected] {
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[compareHighlighted] {
Expand Down Expand Up @@ -208,23 +209,23 @@ SCalendarUnit[compareEnd] {
}

SCalendarUnit[compareStartHighlighted] {
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[compareEndHighlighted] {
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[compareStart]:not([compareHighlighted]) {
border-top-left-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
border-top-left-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-left-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[compareEnd]:not([compareHighlighted]) {
border-top-right-radius: var(--intergalactic-control-rounded, 6px);
border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
border-top-right-radius: var(--intergalactic-rounded-small, 4px);
border-bottom-right-radius: var(--intergalactic-rounded-small, 4px);
}

SCalendarUnit[outdated] {
Expand All @@ -243,7 +244,7 @@ SCalendar:focus {
}

&:not(&:has(SCalendarUnit[highlighted])) {
border-radius: var(--intergalactic-surface-rounded, 8px);
border-radius: var(--intergalactic-rounded-small, 4px);
}
}

Expand Down
6 changes: 3 additions & 3 deletions stories/components/date-picker/docs/date-picker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import CustomDayExample from './examples/custom_day';
import CustomHeaderExample from './examples/custom_header';
import DateRangeComparatorExample from './examples/date_range_comparator';
import DateRangeComparatorAdvanceUseExample from './examples/date_range_comparator_advanced_use';
import DatepickerExample from './examples/datepicker';
import DatePickerExample from './examples/datepicker';
import DisabledDatesExample from './examples/disabled_dates';
import MonthRangeComparatorAdvanceUseExample from './examples/month_range_comparator_advanced_use';
import MonthRangePickerExample from './examples/monthrangepicker';
Expand Down Expand Up @@ -66,8 +66,8 @@ export const DateRangeComparatorAdvanceUse: StoryObj = {

};

export const Datepicker: StoryObj = {
render: DatepickerExample,
export const DatePicker: StoryObj = {
render: DatePickerExample,
play: playWrapper(DatePickerTest),
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import WarningIcon from '@semcore/icon/Warning/m';
import { Flex } from '@semcore/ui/base-components';
import { DateRangeComparator } from '@semcore/ui/date-picker';
import Notice from '@semcore/ui/notice';
import Dropdown from '@semcore/ui/dropdown';
import React from 'react';

const Demo = () => {
Expand Down Expand Up @@ -46,24 +46,24 @@ const Demo = () => {
<DateRangeComparator.Footer>
Place for a hint, useful message or controls.
</DateRangeComparator.Footer>
<Notice
<Dropdown.Notice
aria-labelledby='comparator-notice-title'
theme='warning'
style={{ borderTopLeftRadius: 0, borderTopRightRadius: 0 }}
>
<Notice.Content>
<Dropdown.Notice.Content>
<Flex mb={1}>
<Notice.Label>
<Dropdown.Notice.Label>
<WarningIcon />
</Notice.Label>
<Notice.Title>
</Dropdown.Notice.Label>
<Dropdown.Notice.Title>
Warning
</Notice.Title>
</Dropdown.Notice.Title>
</Flex>
If you change your location, all previously collected data for this article will be
lost.
</Notice.Content>
</Notice>
</Dropdown.Notice.Content>
</Dropdown.Notice>
</DateRangeComparator.Popper>
</DateRangeComparator>
</Flex>
Expand Down
Loading
Loading