on master help sign in
feat: update indigo with transparency and include button/input disabled states
099a69aMatt Condon (shrugs)
src/indigo-react/components/Button.js+16−3
@@ -3,6 +3,7 @@ import cn from 'classnames';
3
3
4export default function Button({
4export default function Button({
5 solid = false,
5 solid = false,
6+ disabled = false,
6 className,
7 className,
7 icon,
8 icon,
8 children,
9 children,
@@ -13,14 +14,26 @@ export default function Button({
13 className={cn(
14 className={cn(
14 'pointer pv3 pl4 pr0 truncate flex-row justify-between',
15 'pointer pv3 pl4 pr0 truncate flex-row justify-between',
15 {
16 {
16− 'white bg-black bg-gray6-hover': solid,
17+ 'white bg-black bg-gray6-hover': solid && !disabled,
18+ 'white bg-gray3': solid && disabled,
17− 'black bg-gray1-hover': !solid,
19+ 'black bg-transparent bg-gray1-hover': !solid && !disabled,
20+ 'gray4 bg-transparent': !solid && disabled,
18 },
21 },
19 className
22 className
20 )}
23 )}
24+ style={{
25+ ...(disabled && { pointerEvents: 'none', cursor: 'not-allowed' }),
26+ }}
21 {...rest}>
27 {...rest}>
22 {children}
28 {children}
29+ <div
23− <div className="ph4">{icon}</div>
30+ className={cn('ph4', {
31+ white: solid,
32+ black: !solid && !disabled,
33+ gray4: !solid && disabled,
34+ })}>
35+ {icon}
36+ </div>
24 </a>
37 </a>
25 );
38 );
26}
39}
src/indigo-react/components/Input.js+4−1
@@ -171,7 +171,7 @@ export default function Input({
171 { mono },
171 { mono },
172 {
172 {
173 'bg-white': !disabled,
173 'bg-white': !disabled,
174− 'bg-gray1': disabled,
174+ 'bg-gray3': disabled,
175 },
175 },
176 {
176 {
177 gray4: !focused,
177 gray4: !focused,
@@ -185,6 +185,9 @@ export default function Input({
185 },
185 },
186 className
186 className
187 )}
187 )}
188+ style={{
189+ ...(disabled && { pointerEvents: 'none', cursor: 'not-allowed' }),
190+ }}
188 id={name}
191 id={name}
189 name={name}
192 name={name}
190 autoFocus={autoFocus}
193 autoFocus={autoFocus}
src/indigo-react/indigo.css+25−1
@@ -13,7 +13,7 @@
13 * git+https://github.com/urbit/Indigo.git
13 * git+https://github.com/urbit/Indigo.git
14 * Bugs: https://github.com/urbit/Indigo/issues
14 * Bugs: https://github.com/urbit/Indigo/issues
15 * License: MIT
15 * License: MIT
16− * Timestamp: Tue Jun 18 2019 18:39:16 GMT-0700 (Pacific Daylight Time)
16+ * Timestamp: Wed Jun 19 2019 12:58:16 GMT-0700 (Pacific Daylight Time)
17 *******************************************************************************/
17 *******************************************************************************/
18/**********************
18/**********************
19Color variables
19Color variables
@@ -934,6 +934,9 @@ caption,
934.b-yellow1 {
934.b-yellow1 {
935 border-color: #ffefc5; }
935 border-color: #ffefc5; }
936
936
937+.b-transparent {
938+ border-color: rgba(0, 0, 0, 0); }
939+
937.b-black {
940.b-black {
938 border-color: #000000; }
941 border-color: #000000; }
939
942
@@ -1006,6 +1009,9 @@ caption,
1006.bg-yellow1 {
1009.bg-yellow1 {
1007 background-color: #ffefc5; }
1010 background-color: #ffefc5; }
1008
1011
1012+.bg-transparent {
1013+ background-color: rgba(0, 0, 0, 0); }
1014+
1009.bg-black {
1015.bg-black {
1010 background-color: #000000; }
1016 background-color: #000000; }
1011
1017
@@ -1078,6 +1084,9 @@ caption,
1078.yellow1 {
1084.yellow1 {
1079 color: #ffefc5; }
1085 color: #ffefc5; }
1080
1086
1087+.transparent {
1088+ color: rgba(0, 0, 0, 0); }
1089+
1081.black {
1090.black {
1082 color: #000000; }
1091 color: #000000; }
1083
1092
@@ -6472,6 +6481,21 @@ caption,
6472/*******************************************************************************
6481/*******************************************************************************
6473 Size classes
6482 Size classes
6474*******************************************************************************/
6483*******************************************************************************/
6484+.w-full {
6485+ width: 100%; }
6486+
6487+@media only screen and (min-width: 550px) {
6488+ .w-full-ns {
6489+ width: 100%; } }
6490+
6491+@media only screen and (min-width: 750px) and (max-width: 960px) {
6492+ .w-full-md {
6493+ width: 100%; } }
6494+
6495+@media only screen and (min-width: 960px) {
6496+ .w-full-lg {
6497+ width: 100%; } }
6498+
6475.w0 {
6499.w0 {
6476 width: 0px; }
6500 width: 0px; }
6477
6501
src/views/ViewPoint.js+3−2
@@ -48,12 +48,13 @@ export default function ViewPoint() {
48 />
48 />
49
49
50 <ForwardButton
50 <ForwardButton
51− disabled={error}
51+ disabled={!pass}
52 onClick={() => {
52 onClick={() => {
53 setPointCursor(Maybe.Just(parseInt(ob.patp2dec(pointName), 10)));
53 setPointCursor(Maybe.Just(parseInt(ob.patp2dec(pointName), 10)));
54 // ^ pointCursor expects native number type, not string
54 // ^ pointCursor expects native number type, not string
55 history.popAndPush(ROUTE_NAMES.SHIP);
55 history.popAndPush(ROUTE_NAMES.SHIP);
56− }}>
56+ }}
57+ solid>
57 Continue
58 Continue
58 </ForwardButton>
59 </ForwardButton>
59 </View>
60 </View>