Skip to content

Commit

Permalink
chore: some minor cleanup in the datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Mar 28, 2024
1 parent 30e7864 commit 88e7e6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion core/src/components/cat-date/cat-date.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,18 @@
display: flex;
gap: 1rem;
align-items: center;
justify-content: space-between;
}

.cursor-help {
flex: 1;
margin: 0;
@include cat-body('s');
color: cat-token('color.ui.font.muted') !important;
text-align: center;

&.cursor-right {
text-align: right;
}
}

.cursor-aria {
Expand Down
20 changes: 12 additions & 8 deletions core/src/components/cat-date/cat-date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,19 @@ export class CatDate {
</div>
</div>
<div class="picker-foot">
<cat-button
size="s"
disabled={!this.canClick(this.now)}
data-dropdown-no-close
onClick={() => this.select(this.now)}
{this.canClick(this.now) && (
<cat-button size="s" data-dropdown-no-close onClick={() => this.select(this.now)}>
{this.locale.today}
</cat-button>
)}
<p
class={{
'cursor-help': true,
'cursor-right': this.canClick(this.now)
}}
>
{this.locale.today}
</cat-button>
<p class="cursor-help">{this.locale.arrowKeys}</p>
{this.locale.arrowKeys}
</p>
<p class="cursor-aria" aria-live="polite"></p>
</div>
</div>
Expand Down

0 comments on commit 88e7e6e

Please sign in to comment.