UNPKG

@graphiql/react

Version:

[Changelog](https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/CHANGELOG.md) | [API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql_react.html) | [NPM](https://www.npmjs.com/package/@graphiql/react)

643 lines (549 loc) 16.4 kB
.auto-inserted-leaf { border-radius: var(--border-radius-4); padding: var(--px-2); animation-name: insertionFade; animation-duration: 6s; } @keyframes insertionFade { from, to { background-color: #0000; } 15%, 85% { background-color: hsla(var(--color-warning), var(--alpha-background-light)); } } .graphiql-editor { width: 100%; height: 100%; } .graphiql-editor.hidden { display: none; } .monaco-editor { outline-width: 0 !important; position: absolute !important; } .monaco-editor .highlight { color: hsl(var(--color-primary)) !important; } .monaco-editor input:focus-visible { outline-color: hsl(var(--color-primary)); } .monaco-editor .overflow-guard { overflow: unset !important; } .monaco-editor .quick-input-widget { --vscode-widget-border: var(--vscode-editorHoverWidget-border); min-width: min(500px, 70vw) !important; box-shadow: none !important; } .monaco-hover, .monaco-hover-content { width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; } .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left { flex-grow: 0; } .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right { flex-grow: 1; margin-right: auto; } .graphiql-container * { box-sizing: border-box; font-variant-ligatures: none; } .graphiql-container, .graphiql-dialog, .graphiql-dialog-overlay, .graphiql-tooltip, [data-radix-popper-content-wrapper] { --color-primary: 320, 95%, 43%; --color-secondary: 242, 51%, 61%; --color-tertiary: 188, 100%, 36%; --color-info: 208, 100%, 46%; --color-success: 158, 60%, 42%; --color-warning: 36, 100%, 41%; --color-error: 13, 93%, 58%; --color-neutral: 219, 28%, 32%; --color-base: 219, 28%, 100%; --alpha-secondary: .76; --alpha-tertiary: .5; --alpha-background-heavy: .15; --alpha-background-medium: .1; --alpha-background-light: .07; --font-family: "Roboto", sans-serif; --font-family-mono: "Fira Code", monospace; --font-size-hint: calc(12rem / 16); --font-size-inline-code: calc(13rem / 16); --font-size-body: calc(15rem / 16); --font-size-h4: calc(18rem / 16); --font-size-h3: calc(22rem / 16); --font-size-h2: calc(29rem / 16); --font-weight-regular: 400; --font-weight-medium: 500; --line-height: 1.5; --px-2: 2px; --px-4: 4px; --px-6: 6px; --px-8: 8px; --px-10: 10px; --px-12: 12px; --px-16: 16px; --px-20: 20px; --px-24: 24px; --border-radius-2: 2px; --border-radius-4: 4px; --border-radius-8: 8px; --border-radius-12: 12px; --popover-box-shadow: 0px 6px 20px #3b4c6a21, 0px 1.34018px 4.46726px #3b4c6a14, 0px .399006px 1.33002px #3b4c6a0d; --popover-border: none; --sidebar-width: 60px; --toolbar-width: 40px; --session-header-height: 38.5px; } @media (prefers-color-scheme: dark) { body:not(.graphiql-light) .graphiql-container, body:not(.graphiql-light) .graphiql-dialog, body:not(.graphiql-light) .graphiql-dialog-overlay, body:not(.graphiql-light) .graphiql-tooltip, body:not(.graphiql-light) [data-radix-popper-content-wrapper] { --color-primary: 338, 100%, 67%; --color-secondary: 243, 100%, 77%; --color-tertiary: 188, 100%, 44%; --color-info: 208, 100%, 72%; --color-success: 158, 100%, 42%; --color-warning: 30, 100%, 80%; --color-error: 13, 100%, 58%; --color-neutral: 219, 29%, 78%; --color-base: 219, 29%, 18%; --popover-box-shadow: none; --popover-border: 1px solid hsl(var(--color-neutral)); } } body.graphiql-dark .graphiql-container, body.graphiql-dark .graphiql-dialog, body.graphiql-dark .graphiql-dialog-overlay, body.graphiql-dark .graphiql-tooltip, body.graphiql-dark [data-radix-popper-content-wrapper] { --color-primary: 338, 100%, 67%; --color-secondary: 243, 100%, 77%; --color-tertiary: 188, 100%, 44%; --color-info: 208, 100%, 72%; --color-success: 158, 100%, 42%; --color-warning: 30, 100%, 80%; --color-error: 13, 100%, 58%; --color-neutral: 219, 29%, 78%; --color-base: 219, 29%, 18%; --popover-box-shadow: none; --popover-border: 1px solid hsl(var(--color-neutral)); } :is(.graphiql-container, .graphiql-dialog) { color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-body); font-weight: var(--font-weight-regular); line-height: var(--line-height); } :is(.graphiql-container, .graphiql-dialog):-webkit-any(button) { color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-body); font-weight: var(--font-weight-regular); line-height: var(--line-height); } :is(.graphiql-container, .graphiql-dialog):-moz-any(button) { color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-body); font-weight: var(--font-weight-regular); line-height: var(--line-height); } :is(.graphiql-container, .graphiql-dialog):is(button) { color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-body); font-weight: var(--font-weight-regular); line-height: var(--line-height); } :is(.graphiql-container, .graphiql-dialog) input { color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-caption); } :is(.graphiql-container, .graphiql-dialog) input::placeholder { color: hsla(var(--color-neutral), var(--alpha-secondary)); } :is(.graphiql-container, .graphiql-dialog) a { color: hsl(var(--color-primary)); } :is(.graphiql-container, .graphiql-dialog) a:focus { outline: hsl(var(--color-primary)) auto 1px; } .graphiql-dropdown-content { background-color: hsl(var(--color-base)); border: var(--popover-border); border-radius: var(--border-radius-8); box-shadow: var(--popover-box-shadow); font-size: inherit; max-width: 250px; padding: var(--px-4); font-family: var(--font-family); color: hsl(var(--color-neutral)); max-height: min(calc(var(--radix-dropdown-menu-content-available-height) - 10px), 400px); overflow-y: auto; } .graphiql-dropdown-item { border-radius: var(--border-radius-4); font-size: inherit; margin: var(--px-4); padding: var(--px-6) var(--px-8); text-overflow: ellipsis; white-space: nowrap; cursor: pointer; line-height: var(--line-height); outline: none; overflow: hidden; } .graphiql-dropdown-item[data-selected] { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); color: inherit; } .graphiql-dropdown-item[data-current-nav] { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); color: inherit; } .graphiql-dropdown-item:hover { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); color: inherit; } .graphiql-dropdown-item:not(:first-child) { margin-top: 0; } .graphiql-tooltip { background: hsl(var(--color-base)); border: var(--popover-border); border-radius: var(--border-radius-4); box-shadow: var(--popover-box-shadow); color: hsl(var(--color-neutral)); font-size: inherit; padding: var(--px-4) var(--px-6); font-family: var(--font-family); } button.graphiql-execute-button { background-color: hsl(var(--color-primary)); border-radius: var(--border-radius-8); cursor: pointer; height: var(--toolbar-width); width: var(--toolbar-width); border: none; padding: 0; } button.graphiql-execute-button:hover { background-color: hsla(var(--color-primary), .9); } button.graphiql-execute-button:active { background-color: hsla(var(--color-primary), .8); } button.graphiql-execute-button:focus { outline: hsla(var(--color-primary), .8) auto 1px; } button.graphiql-execute-button > svg { color: #fff; height: var(--px-16); width: var(--px-16); margin: auto; display: block; } .graphiql-un-styled { all: unset; border-radius: var(--border-radius-4); cursor: pointer; } .graphiql-un-styled:hover { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); } .graphiql-un-styled:active { background-color: hsla(var(--color-neutral), var(--alpha-background-medium)); } .graphiql-un-styled:focus { outline: hsla(var(--color-neutral), var(--alpha-background-heavy)) auto 1px; } .graphiql-button, button.graphiql-button { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); border-radius: var(--border-radius-4); color: hsl(var(--color-neutral)); cursor: pointer; font-size: var(--font-size-body); padding: var(--px-8) var(--px-12); border: none; } :is(.graphiql-button, button.graphiql-button):hover { background-color: hsla(var(--color-neutral), var(--alpha-background-medium)); } :is(.graphiql-button, button.graphiql-button):active { background-color: hsla(var(--color-neutral), var(--alpha-background-medium)); } :is(.graphiql-button, button.graphiql-button):focus { outline: hsla(var(--color-neutral), var(--alpha-background-heavy)) auto 1px; } :is(.graphiql-button, button.graphiql-button).graphiql-button-success { background-color: hsla(var(--color-success), var(--alpha-background-heavy)); } :is(.graphiql-button, button.graphiql-button).graphiql-button-error { background-color: hsla(var(--color-error), var(--alpha-background-heavy)); } button.graphiql-toolbar-button { height: var(--toolbar-width); width: var(--toolbar-width); justify-content: center; align-items: center; display: flex; } button.graphiql-toolbar-button.error { background: hsla(var(--color-error), var(--alpha-background-heavy)); } .graphiql-button-group { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); border-radius: calc(var(--border-radius-4) + var(--px-4)); padding: var(--px-4); display: flex; } .graphiql-button-group > button.graphiql-button { background-color: #0000; } .graphiql-button-group > button.graphiql-button:hover { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); } .graphiql-button-group > button.graphiql-button.active { background-color: hsl(var(--color-base)); cursor: default; } .graphiql-button-group > * + * { margin-left: var(--px-8); } .graphiql-dialog-overlay { background-color: hsla(var(--color-neutral), var(--alpha-background-heavy)); z-index: 10; position: fixed; top: 0; bottom: 0; left: 0; right: 0; } .graphiql-dialog { background-color: hsl(var(--color-base)); border: var(--popover-border); border-radius: var(--border-radius-12); box-shadow: var(--popover-box-shadow); max-width: 80vw; max-height: 80vh; width: unset; z-index: 10; margin: 0; padding: 0; position: fixed; top: 50%; left: 50%; overflow: auto; transform: translate(-50%, -50%); } .graphiql-dialog-close > svg { color: hsla(var(--color-neutral), var(--alpha-secondary)); height: var(--px-12); padding: var(--px-12); width: var(--px-12); display: block; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) blockquote { padding-left: var(--px-8); margin-left: 0; margin-right: 0; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) code { border-radius: var(--border-radius-4); font-family: var(--font-family-mono); font-size: var(--font-size-inline-code); } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) pre { border-radius: var(--border-radius-4); font-family: var(--font-family-mono); font-size: var(--font-size-inline-code); } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) code { padding: var(--px-2); } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) pre { padding: var(--px-6) var(--px-8); overflow: auto; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) pre code { background-color: initial; border-radius: 0; padding: 0; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) ol { padding-left: var(--px-16); } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) ul { padding-left: var(--px-16); } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) ol { list-style-type: decimal; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) ul { list-style-type: disc; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) img { border-radius: var(--border-radius-4); max-width: 100%; max-height: 120px; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) > :first-child { margin-top: 0; } :is(.graphiql-markdown-description, .graphiql-markdown-deprecation) > :last-child { margin-bottom: 0; } .graphiql-markdown-description a { color: hsl(var(--color-primary)); text-decoration: none; } .graphiql-markdown-description a:hover { text-decoration: underline; } .graphiql-markdown-description blockquote { border-left: 1.5px solid hsla(var(--color-neutral), var(--alpha-tertiary)); } .graphiql-markdown-description code { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); color: hsl(var(--color-neutral)); } .graphiql-markdown-description pre { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); color: hsl(var(--color-neutral)); } .graphiql-markdown-description > * { margin: var(--px-12) 0; } .graphiql-markdown-deprecation a { color: hsl(var(--color-warning)); text-decoration: underline; } .graphiql-markdown-deprecation blockquote { border-left: 1.5px solid hsl(var(--color-warning)); } .graphiql-markdown-deprecation code { background-color: hsla(var(--color-warning), var(--alpha-background-heavy)); } .graphiql-markdown-deprecation pre { background-color: hsla(var(--color-warning), var(--alpha-background-heavy)); } .graphiql-markdown-deprecation > * { margin: var(--px-8) 0; } .graphiql-markdown-preview > :not(:first-child) { display: none; } .graphiql-spinner { height: 56px; margin: auto; margin-top: var(--px-16); width: 56px; } .graphiql-spinner:after { border: 4px solid #0000; border-top: 4px solid hsla(var(--color-neutral), var(--alpha-tertiary)); content: ""; vertical-align: middle; border-radius: 100%; width: 46px; height: 46px; animation: .8s linear infinite rotation; display: inline-block; } @keyframes rotation { from { transform: rotate(0); } to { transform: rotate(360deg); } } .graphiql-tabs { --bg: hsl(var(--color-base)); align-items: center; gap: var(--px-8); border-top-left-radius: var(--border-radius-8); margin: 0; padding: 2px 0; list-style: none; display: flex; overflow: auto; } .no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; } .no-scrollbar::-webkit-scrollbar { display: none; } .graphiql-tabs, .graphiql-tab { min-width: 0; } .graphiql-tab { border-radius: var(--border-radius-8) var(--border-radius-8) 0 0; background: hsla(var(--color-neutral), var(--alpha-background-light)); flex-shrink: 0; display: flex; position: relative; } .graphiql-tab:not(:focus-within) { transform: none !important; } .graphiql-tab:hover { background: var(--bg); color: hsl(var(--color-neutral)); } .graphiql-tab:hover .graphiql-tab-close { display: block; } .graphiql-tab:focus-within { background: var(--bg); color: hsl(var(--color-neutral)); } .graphiql-tab:focus-within .graphiql-tab-close { display: block; } .graphiql-tab.graphiql-tab-active { background: var(--bg); color: hsl(var(--color-neutral)); } .graphiql-tab.graphiql-tab-active .graphiql-tab-close { display: block; } .graphiql-tab .graphiql-tab-button { border-radius: var(--border-radius-12) var(--border-radius-12) 0 0; padding: var(--px-4) 28px var(--px-4) var(--px-8); } .graphiql-tab .graphiql-tab-button:hover { background: none; } .graphiql-tab .graphiql-tab-close { right: min(var(--px-4), 5%); background: var(--bg); padding: var(--px-6); line-height: 0; display: none; position: absolute; top: 50%; transform: translateY(-50%); } .graphiql-tab .graphiql-tab-close > svg { height: var(--px-8); width: var(--px-8); } .graphiql-tab .graphiql-tab-close:hover { background: var(--bg); color: hsl(var(--color-neutral)); overflow: hidden; } .graphiql-tab .graphiql-tab-close:hover:before { content: ""; z-index: -1; background: hsla(var(--color-neutral), .3); position: absolute; top: 0; bottom: 0; left: 0; right: 0; }