From ae63d4c2b0c43fd8a7fb75a41c21bf10282d669b Mon Sep 17 00:00:00 2001 From: Giampaolo Bellavite Date: Wed, 31 Jul 2024 06:56:00 -0500 Subject: [PATCH] feat: add new data-attributes to the day cells (#2331) feat: add more data-attributes to the day cell The data-attributes such as data-selected or data-outside help targeting the css classes in Tailwind without relying to aria-attributes. E.g.: instead of `aria-selected:hawa-opacity-100` write `data-selected:hawa-opacity-100`. --- examples/__snapshots__/Range.test.tsx.snap | 26 +++++++++++++++++++ .../StylingCssModules.test.tsx.snap | 11 ++++++++ src/DayPicker.tsx | 19 +++++++++----- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/examples/__snapshots__/Range.test.tsx.snap b/examples/__snapshots__/Range.test.tsx.snap index 29b599052..f6057b79e 100644 --- a/examples/__snapshots__/Range.test.tsx.snap +++ b/examples/__snapshots__/Range.test.tsx.snap @@ -136,7 +136,9 @@ exports[`should match the snapshot 1`] = ` aria-hidden="true" class="rdp-day rdp-hidden rdp-outside" data-day="2020-05-31" + data-hidden="true" data-month="2020-05" + data-outside="true" role="gridcell" >