@@ -4,51 +4,51 @@ import {StyleSheet} from "aphrodite";
4
4
import Clickable from "@khanacademy/wonder-blocks-clickable" ;
5
5
import { View } from "@khanacademy/wonder-blocks-core" ;
6
6
import { PhosphorIcon } from "@khanacademy/wonder-blocks-icon" ;
7
- import { color , spacing } from "@khanacademy/wonder-blocks-tokens" ;
7
+ import { color , semanticColor , spacing } from "@khanacademy/wonder-blocks-tokens" ;
8
8
import { Body } from "@khanacademy/wonder-blocks-typography" ;
9
9
10
10
import { IconMappings } from "../wonder-blocks-icon/phosphor-icon.argtypes" ;
11
11
12
+ const actionCategory = semanticColor . action . outlined . progressive ;
13
+
12
14
const styles = StyleSheet . create ( {
13
- resting : {
14
- boxShadow : `inset 0px 0px 1px 1px ${ color . purple } ` ,
15
+ rest : {
16
+ border : `1px solid ${ actionCategory . default . border } ` ,
15
17
padding : spacing . xSmall_8 ,
16
18
} ,
17
- hovered : {
19
+ hover : {
18
20
textDecoration : "underline" ,
19
- backgroundColor : color . blue ,
20
- color : color . white ,
21
+ borderColor : actionCategory . hover . border ,
22
+ backgroundColor : actionCategory . hover . background ,
23
+ color : actionCategory . hover . foreground ,
21
24
} ,
22
- pressed : {
23
- color : color . darkBlue ,
25
+ press : {
26
+ background : actionCategory . press . background ,
27
+ borderColor : actionCategory . press . border ,
28
+ color : actionCategory . press . foreground ,
24
29
} ,
25
- focused : {
26
- outline : `solid 4px ${ color . purple } ` ,
30
+ focus : {
31
+ outline : `solid 1px ${ semanticColor . border . focus } ` ,
32
+ outlineOffset : spacing . xxxxSmall_2 ,
27
33
} ,
28
34
panel : {
29
35
padding : spacing . medium_16 ,
30
- boxShadow : `inset 0px 0px 0 1px ${ color . offBlack8 } ` ,
36
+ // TODO(WB-1878): Use elevation token.
37
+ boxShadow : `0 ${ spacing . xSmall_8 } px ${ spacing . xSmall_8 } px 0 ${ color . offBlack8 } ` ,
31
38
} ,
32
39
} ) ;
33
40
34
41
export default {
35
42
title : "Packages / Clickable / Clickable / Accessibility" ,
36
43
component : Clickable ,
37
-
38
- // Disables chromatic testing for these stories.
39
44
parameters : {
40
- previewTabs : {
41
- canvas : {
42
- hidden : true ,
43
- } ,
44
- } ,
45
-
46
- viewMode : "docs" ,
47
-
45
+ // Disables chromatic testing for these stories.
48
46
chromatic : {
49
47
disableSnapshot : true ,
50
48
} ,
51
49
} ,
50
+ // Include these stories in the Docs tab, but hide them from the sidebar.
51
+ tags : [ "autodocs" , "!dev" ] ,
52
52
} ;
53
53
54
54
export const Labeling = {
@@ -58,9 +58,7 @@ export const Labeling = {
58
58
onClick = { ( ) => { } }
59
59
aria-label = "More information about this subject"
60
60
>
61
- { ( { hovered, focused, pressed} ) => (
62
- < PhosphorIcon icon = { IconMappings . info } />
63
- ) }
61
+ { ( ) => < PhosphorIcon icon = { IconMappings . info } /> }
64
62
</ Clickable >
65
63
</ View >
66
64
) ,
@@ -73,9 +71,7 @@ export const DisabledState = {
73
71
onClick = { ( e ) => console . log ( "Hello, world!" ) }
74
72
disabled = { true }
75
73
>
76
- { ( { hovered, focused, pressed} ) =>
77
- "This is a disabled clickable element"
78
- }
74
+ { ( ) => "This is a disabled clickable element" }
79
75
</ Clickable >
80
76
) ,
81
77
@@ -89,10 +85,10 @@ export const KeyboardNavigation = {
89
85
{ ( { hovered, focused, pressed} ) => (
90
86
< View
91
87
style = { [
92
- styles . resting ,
93
- hovered && styles . hovered ,
94
- focused && styles . focused ,
95
- pressed && styles . pressed ,
88
+ styles . rest ,
89
+ hovered && styles . hover ,
90
+ focused && styles . focus ,
91
+ pressed && styles . press ,
96
92
] }
97
93
>
98
94
< Body > Open School Info</ Body >
0 commit comments