Skip to content

Commit 30b0ce5

Browse files
committed
Initial DateRangeInput
1 parent 2a891c1 commit 30b0ce5

File tree

5 files changed

+536
-14
lines changed

5 files changed

+536
-14
lines changed

packages/circuit-ui/components/DateInput/DateInput.module.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@
8585
line-height: var(--cui-body-m-line-height);
8686
}
8787

88-
.readonly .literal {
88+
.divider {
89+
padding: var(--cui-spacings-bit);
90+
font-size: var(--cui-body-m-font-size);
91+
line-height: var(--cui-body-m-line-height);
92+
}
93+
94+
.readonly .literal,
95+
.readonly .divider {
8996
color: var(--cui-fg-subtle);
9097
}
9198

@@ -168,10 +175,6 @@
168175
}
169176

170177
@media (min-width: 480px) {
171-
.apply {
172-
display: none;
173-
}
174-
175178
.presets {
176179
position: sticky;
177180
bottom: 0;

packages/circuit-ui/components/DateInput/DateInput.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { useState } from 'react';
1818
import { Stack } from '../../../../.storybook/components/index.js';
1919

2020
import { DateInput, type DateInputProps } from './DateInput.js';
21+
import { DateRangeInput, type DateRangeInputProps } from './DateRangeInput.js';
2122

2223
export default {
2324
title: 'Forms/DateInput',
@@ -127,3 +128,12 @@ export const Locales = (args: DateInputProps) => (
127128
);
128129

129130
Locales.args = baseArgs;
131+
132+
export const Range = (args: DateRangeInputProps) => (
133+
<DateRangeInput {...args} />
134+
);
135+
136+
Range.args = {
137+
...baseArgs,
138+
label: 'Trip dates',
139+
};

packages/circuit-ui/components/DateInput/DateInput.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,16 @@ export const DateInput = forwardRef<HTMLInputElement, DateInputProps>(
459459
{clearDateButtonLabel}
460460
</Button>
461461
)}
462-
<Button
463-
type="button"
464-
variant="primary"
465-
onClick={handleApply}
466-
className={classes.apply}
467-
>
468-
{applyDateButtonLabel}
469-
</Button>
462+
{isMobile && (
463+
<Button
464+
type="button"
465+
variant="primary"
466+
onClick={handleApply}
467+
className={classes.apply}
468+
>
469+
{applyDateButtonLabel}
470+
</Button>
471+
)}
470472
</div>
471473
)}
472474
</div>

0 commit comments

Comments
 (0)