44 Interactive ,
55 createInteractive ,
66 eventFrom ,
7- InteractiveExtendableProps ,
87 InteractiveState ,
98 InteractiveStateChange ,
109} from 'react-interactive' ;
@@ -14,25 +13,8 @@ import { CheckIcon } from '@radix-ui/react-icons';
1413import { DemoContainer , DemoHeading } from '../ui/DemoContainer' ;
1514import { styled } from '../stitches.config' ;
1615
17- const StateLogContainer = styled ( 'div' , {
18- height : '200px' ,
19- padding : '0 5px' ,
20- border : '1px solid $highContrast' ,
21- overflowY : 'scroll' ,
22- fontFamily : 'monospace' ,
23- outline : 'none' ,
24- '&.focusFromKey' : {
25- outline : '3px solid $colors$purple' ,
26- outlineOffset : '1px' ,
27- } ,
28- } ) ;
29-
30- const InteractiveButton : React . VFC < InteractiveExtendableProps < 'button' > > = (
31- props ,
32- ) => < Interactive { ...props } as = "button" /> ;
33-
34- const DemoButton = styled ( InteractiveButton , {
35- fontFamily : 'monospace' ,
16+ const DemoButton = styled ( Interactive . Button , {
17+ fontFamily : '$mono' ,
3618 fontSize : '20px' ,
3719 textAlign : 'center' ,
3820 width : '100%' ,
@@ -65,6 +47,21 @@ const DemoButton = styled(InteractiveButton, {
6547 } ,
6648} ) ;
6749
50+ const StateLogContainer = styled ( 'div' , {
51+ height : '200px' ,
52+ padding : '0 5px' ,
53+ border : '1px solid $highContrast' ,
54+ overflowY : 'scroll' ,
55+ fontFamily : '$mono' ,
56+ // outline: 'none' required because this is a div (with tabIndex)
57+ // which doesn't have "unset: all" in css reset applied
58+ outline : 'none' ,
59+ '&.focusFromKey' : {
60+ outline : '3px solid $colors$purple' ,
61+ outlineOffset : '1px' ,
62+ } ,
63+ } ) ;
64+
6865const variantLookup : Record < string , any > = {
6966 'hover: true' : 'green' ,
7067 'hover: false' : 'normal' ,
@@ -136,11 +133,10 @@ const ExtendedTouchActiveOptionCheckbox = styled(
136133 width : '32px' ,
137134 height : '32px' ,
138135 borderRadius : '2px' ,
139- // hover and active are styled in LabelBase so styles are applied when label is hovered/active
136+ // hover and active are styled in label so styles are applied when label is hovered/active
140137 // '&.hover, &.active': {...},
141138 '&.focusFromKey' : {
142- outline : 'none' ,
143- // !important required so hover and active styles from Label are not applied
139+ // !important required so hover and active styles from label are not applied
144140 // to border and boxShadow when in the focusFromKey state
145141 borderColor : '$purple !important' ,
146142 boxShadow : '0 0 0 1px $colors$purple !important' ,
0 commit comments