-
Notifications
You must be signed in to change notification settings - Fork 22
Use details/summary to display keyboard hints in calendar modal #105
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for taking the time to do this PR!
There are a few issues that need to be fixed (the build is currently failing). See my suggestions in the review.
@@ -46,6 +46,31 @@ export type InclusiveDatesCalendarLabels = { | |||
todayButton: string; | |||
yearSelect: string; | |||
keyboardHint: string; | |||
keyboardKeyTab: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a missing type here for keyboardKeyShift
@@ -62,6 +87,31 @@ const defaultLab 10000 els: InclusiveDatesCalendarLabels = { | |||
todayButton: "Show today", | |||
yearSelect: "Select year", | |||
keyboardHint: "Keyboard commands", | |||
keyboardKeyTab: "Tab", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing translation here for keyboardKeyShift
</svg> | ||
{this.labels.keyboardHint} | ||
</button> | ||
<details class="{this.getClassName("keyboard-shortcuts")}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A syntax error here, it should be
<details class={this.getClassName("keyboard-shortcuts")}>
(without the quotes)
</button> | ||
<details class="{this.getClassName("keyboard-shortcuts")}"> | ||
<summary> | ||
<span class="{this.getClassName("keyboard-hint")}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here:
<span class={this.getClassName("keyboard-hint")}>
{this.labels.keyboardHint} | ||
</span> | ||
</summary> | ||
<table class="{this.getClassName("keyboard-shortcuts-table")}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here:
<table class={this.getClassName("keyboard-shortcuts-table")}>
<td> | ||
<kbd>{this.labels.keyboardKeyArrowright}</kbd> | ||
</td> | ||
<td>{this.labels.keyboardShortcutArrowRight}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not match the translation key which uses lower key, causes a Typescript error:
keyboardShortcutArrowright
@@ -322,12 +322,9 @@ inclusive-dates *:focus-visible { | |||
} | |||
|
|||
.inclusive-dates-calendar__keyboard-hint { | |||
color: var(--secondary-color); | |||
display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds the keyboard shortcuts table as shown in the documentation to the calendar modal in a details element, using the original button as the summary toggle.
Includes new strings for every key, keyboard shortcut description, and the "Key, Action" table headers.