Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): datepicker #2 #16

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/ui/lib/DatePicker/DatePicker.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@
transition: all 0.2s ease-in-out;
padding: 10px 15px !important;
width: 280px;
&.select {
height: 50px;
border-radius: 10px;
border: 2px solid var(--shadow-color) !important;
&.is-select-date {
border: 2px solid var(--primary-color) !important;
color: var(--primary-color) !important;
.select-date {
color: var(--black-color) !important;
}
svg {
fill: var(--primary-color) !important;
}
}
&.have-select-date {
.select-date {
color: var(--black-color) !important;
}
}
svg {
fill: var(--shadow-color);
transition: all 0.2s ease-in-out;
}
&:hover {
color: var(--primary-color) !important;
border: 2px solid var(--primary-color) !important;
svg {
fill: var(--primary-color);
}
Expand Down
11 changes: 5 additions & 6 deletions packages/ui/lib/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ export const DatePicker = React.forwardRef<HTMLDivElement, DatePickerProps>(
{...rest}
>
<Button
color="ghost"
className={`${styles['date-picker-button']} ${
styles[selectDateString ? 'select' : '']
}`}
shadow="regular"
color="border"
className={`${styles['date-picker-button']}
${styles[calendarVisible ? 'is-select-date' : '']}
${styles[selectDateString ? 'have-select-date' : '']}`}
onClick={handleCalendarVisible}
>
<svg
Expand All @@ -106,7 +105,7 @@ export const DatePicker = React.forwardRef<HTMLDivElement, DatePickerProps>(
{!selectDateString ? (
<span>Pick a date</span>
) : (
<span>{selectDate?.toDateString()}</span>
<span className={styles['select-date']}>{selectDate?.toDateString()}</span>
)}
</Button>
{calendarVisible && (
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/lib/Input/Input.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

.input {
all: unset;
padding: 23px 12px 13px 12px;
padding: 21px 12px 11px 12px;
width: -webkit-fill-available;
position: relative;
top: 0;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/lib/Select/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ const defaultProps: SelectProps = {
selectKey: 2,
};

export const DefaultButton: Story = {
export const DefaultSelect: Story = {
args: {
...defaultProps,
},
};

export const DisabledButton: Story = {
export const DisabledSelect: Story = {
args: {
...defaultProps,
},
Expand Down
Loading