File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ const meta: Meta<typeof Abbr> = {
6
6
component : Abbr ,
7
7
decorators : [
8
8
( Story ) => (
9
- < >
9
+ < div className = "max-w-prose text-base" >
10
10
< p > Try the following text out in a screen reader!</ p >
11
11
< Story />
12
- </ >
12
+ </ div >
13
13
) ,
14
14
] ,
15
15
} ;
@@ -25,9 +25,9 @@ export const InlinedShorthand: Story = {
25
25
} ,
26
26
decorators : [
27
27
( Story ) => (
28
- < p className = "max-w-2xl" >
28
+ < p >
29
29
The physical pain of getting bonked on the head with a cartoon mallet
30
- lasts precisely 593{ " " }
30
+ lasts precisely 593
31
31
< span className = "underline decoration-dotted" >
32
32
< Story />
33
33
</ span >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type AbbreviationData = {
8
8
} ;
9
9
10
10
describe ( Abbr . name , ( ) => {
11
- it ( "Has an aria-label that equals the title if the abbreviation is shorthand" , ( ) => {
11
+ it ( "Omits abbreviation from screen-reader output if it is shorthand" , ( ) => {
12
12
const sampleShorthands : AbbreviationData [ ] = [
13
13
{
14
14
abbreviation : "ms" ,
@@ -38,7 +38,7 @@ describe(Abbr.name, () => {
38
38
}
39
39
} ) ;
40
40
41
- it ( "Has an aria label with title and 'flattened' pronunciation if abbreviation is acronym" , ( ) => {
41
+ it ( "Adds title and 'flattened' pronunciation if abbreviation is acronym" , ( ) => {
42
42
const sampleAcronyms : AbbreviationData [ ] = [
43
43
{
44
44
abbreviation : "NASA" ,
@@ -70,7 +70,7 @@ describe(Abbr.name, () => {
70
70
}
71
71
} ) ;
72
72
73
- it ( "Has an aria label with title and initialized pronunciation if abbreviation is initialism" , ( ) => {
73
+ it ( "Adds title and initialized pronunciation if abbreviation is initialism" , ( ) => {
74
74
const sampleInitialisms : AbbreviationData [ ] = [
75
75
{
76
76
abbreviation : "FBI" ,
Original file line number Diff line number Diff line change @@ -33,10 +33,8 @@ export const Abbr: FC<AbbrProps> = ({
33
33
// to inject the actual text content inside the abbr itself
34
34
title = { title }
35
35
className = { cn (
36
- "underline-none" ,
37
- children === children . toUpperCase ( )
38
- ? "tracking-wide"
39
- : "tracking-normal" ,
36
+ "no-underline tracking-normal" ,
37
+ children === children . toUpperCase ( ) && "tracking-wide" ,
40
38
className ,
41
39
) }
42
40
{ ...delegatedProps }
You can’t perform that action at this time.
0 commit comments