Skip to content

Commit

Permalink
Merge pull request #41 from reedsy/a11y
Browse files Browse the repository at this point in the history
A11y
  • Loading branch information
ricardoferrolho authored May 30, 2024
2 parents 9950890 + 2f28ad6 commit 41965cb
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 71 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/publish.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
if: ${{ github.actor != 'dependabot[bot]' }}

timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -33,6 +36,6 @@ jobs:
run: npm rebuild && npm run prepare --if-present
- name: Test
run: npm test
- name: Tag
- name: Release
if: ${{ github.ref == 'refs/heads/main' }}
run: ./scripts/tag.sh
run: ./scripts/release.sh
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reedsy/vuejs-datepicker",
"version": "1.6.2-reedsy-2.1.3",
"version": "1.6.2-reedsy-2.1.4",
"description": "A simple Vue.js datepicker component. Supports disabling of dates, inline mode, translations",
"keywords": [
"vue",
Expand Down Expand Up @@ -65,7 +65,7 @@
"parse5": "^7.1.2",
"postcss": "^8.4.21",
"pre-commit": "^1.2.2",
"stylus": "^0.59.0",
"stylus": "^0.63.0",
"vite": "^5.2.12",
"vue": "^3.4.27"
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/tag.sh → scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ git add --all lib/
git commit --message "Release version $VERSION"
git tag $VERSION
git push origin refs/tags/$VERSION

npm publish
1 change: 1 addition & 0 deletions src/components/DateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
:placeholder="placeholder"
:clear-button="clearButton"
:disabled="disabled || null"
:aria-disabled="disabled || null"
:required="required"
:readonly="!typeable"
autocomplete="off"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default {
emits: [
'changedMonth',
'changedYear',
'cleared',
'cleared',
'closed',
'highlight-date',
'selected',
Expand Down
4 changes: 2 additions & 2 deletions src/components/DaysGrid.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<div
role="grid"
aria-labelledby="month-button"
>
<span
Expand All @@ -19,10 +18,11 @@
<span
v-for="day in days"
:key="day.timestamp"
:aria-selected="day.isSelected"
class="cell day"
:class="dayClasses(day)"
role="button"
:tabindex="isFocused(day) ? 0 : -1"
:aria-selected="day.isSelected"
@mouseover="mouseOver(day)"
@focus="mouseOver(day)"
@keydown.left.prevent="$emit('focus-previous-day')"
Expand Down
2 changes: 2 additions & 0 deletions src/components/PickerDay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class="prev"
:aria-label="isRtl ? 'Next Month' : 'Previous Month'"
:disabled="isLeftNavDisabled || null"
:aria-disabled="isLeftNavDisabled || null"
@click="isRtl ? nextMonth() : previousMonth()"
@keydown.space.enter.prevent="isRtl ? nextMonth() : previousMonth()"
@keydown="$emit('keydown', $event)"
Expand Down Expand Up @@ -56,6 +57,7 @@
class="next"
:aria-label="isRtl ? 'Previous Month' : 'Next Month'"
:disabled="isRightNavDisabled || null"
:aria-disabled="isRightNavDisabled || null"
@click="isRtl ? previousMonth() : nextMonth()"
@keydown.space.enter.prevent="isRtl ? previousMonth() : nextMonth()"
@keydown="$emit('keydown', $event)"
Expand Down
10 changes: 6 additions & 4 deletions src/components/PickerMonth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
type="button"
class="prev"
:disabled="isLeftNavDisabled || null"
:aria-disabled="isLeftNavDisabled || null"
:aria-label="isRtl ? 'Next Year' : 'Previous Year'"
@click="isRtl ? nextYear() : previousYear()"
@keydown.space.enter.prevent="isRtl ? nextYear() : previousYear()"
Expand All @@ -44,6 +45,7 @@
class="next"
:aria-label="isRtl ? 'Previous Year' : 'Next Year'"
:disabled="isRightNavDisabled || null"
:aria-disabled="isRightNavDisabled || null"
@click="isRtl ? previousYear() : nextYear()"
@keydown.space.enter.prevent="isRtl ? previousYear() : nextYear()"
@keydown="$emit('keydown', $event)"
Expand All @@ -52,17 +54,17 @@
</button>
</header>
<div
role="grid"
aria-labelledby="year-button"
>
<button
v-for="month in months"
:key="month.timestamp"
type="button"
:aria-selected="month.isSelected"
:class="{'selected': month.isSelected, 'disabled': month.isDisabled}"
class="cell month"
role="button"
:tabindex="month.isFocused ? 0 : -1"
:class="{'selected': month.isSelected, 'disabled': month.isDisabled}"
:aria-selected="month.isSelected"
type="button"
@keydown.right.prevent="focusNextMonth"
@keydown.left.prevent="focusPreviousMonth"
@keydown.down.prevent="focusNextQuarter"
Expand Down
10 changes: 6 additions & 4 deletions src/components/PickerYear.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
type="button"
class="prev"
:disabled="isLeftNavDisabled || null"
:aria-disabled="isLeftNavDisabled || null"
:aria-label="isRtl ? 'Next Decade' : 'Previous Decade'"
@click="isRtl ? nextDecade() : previousDecade()"
@keydown.space.enter.prevent="isRtl ? nextDecade() : previousDecade()"
Expand All @@ -39,24 +40,25 @@
class="next"
:aria-label="isRtl ? 'Previous Decade' : 'Next Decade'"
:disabled="isRightNavDisabled || null"
:aria-disabled="isRightNavDisabled || null"
@click="isRtl ? previousDecade() : nextDecade()"
@keydown="$emit('keydown', $event)"
>
&gt;
</button>
</header>
<div
role="grid"
aria-labelledby="decade-button"
>
<button
v-for="year in years"
:key="year.timestamp"
type="button"
:aria-selected="year.isSelected"
class="cell year"
:tabindex="year.isFocused ? 0 : -1"
:class="{ 'selected': year.isSelected, 'disabled': year.isDisabled }"
:aria-selected="year.isSelected"
role="button"
:tabindex="year.isFocused ? 0 : -1"
type="button"
@click.stop="selectYear(year)"
@keydown.right.prevent="focusNextYear"
@keydown.left.prevent="focusPreviousYear"
Expand Down
2 changes: 1 addition & 1 deletion src/styles/style.styl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
.prev
.next
width (100 / 7) %
text-indent -10000px
color transparent
flex: 0 0 auto
position relative

Expand Down

0 comments on commit 41965cb

Please sign in to comment.