Skip to content

Commit

Permalink
Merge pull request #16 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
feat(ui): datepicker #2
  • Loading branch information
BQXBQX authored Feb 8, 2024
2 parents 1961ef4 + 7d1b7d8 commit 46eefb2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
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

0 comments on commit 46eefb2

Please sign in to comment.