-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[redesign] implement new design for tabs (#2592)
* implement new design for tabs * add back `tab` role
- Loading branch information
1 parent
e11ba9a
commit 220cf8d
Showing
17 changed files
with
310 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'graphiql': major | ||
--- | ||
|
||
BREAKING: Tabs are now always enabled. The `tabs` prop has therefore been replaced with a prop `onTabChange`. If you used the `tabs` prop before to pass this function you can change your implementation like so: | ||
```diff | ||
<GraphiQL | ||
- tabs={{ onTabChange: (tabState) => {/* do something */} }} | ||
+ onTabChange={(tabState) => {/* do something */}} | ||
/> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.graphiql-tabs { | ||
display: flex; | ||
overflow-y: auto; | ||
padding: var(--px-12); | ||
|
||
& > :not(:first-child) { | ||
margin-left: var(--px-12); | ||
} | ||
} | ||
|
||
.graphiql-tab { | ||
align-items: stretch; | ||
border-radius: var(--border-radius-8); | ||
color: var(--color-neutral-60); | ||
display: flex; | ||
|
||
& > button.graphiql-tab-close { | ||
visibility: hidden; | ||
} | ||
&.graphiql-tab-active > button.graphiql-tab-close, | ||
&:hover > button.graphiql-tab-close, | ||
&:focus-within > button.graphiql-tab-close { | ||
visibility: unset; | ||
} | ||
|
||
&.graphiql-tab-active { | ||
background-color: var(--color-neutral-15); | ||
color: var(--color-neutral-100); | ||
} | ||
} | ||
|
||
button.graphiql-tab-button { | ||
padding: var(--px-4) 0 var(--px-4) var(--px-8); | ||
} | ||
|
||
button.graphiql-tab-close { | ||
align-items: center; | ||
display: flex; | ||
padding: var(--px-4) var(--px-8); | ||
|
||
& > svg { | ||
height: var(--px-8); | ||
width: var(--px-8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function compose(...classes: (string | null | undefined)[]) { | ||
let result = ''; | ||
for (const c of classes) { | ||
if (c) { | ||
result += (result ? ' ' : '') + c; | ||
} | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.