From c16be96913e51702794b78540d657610ae49dbf8 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Mon, 11 Dec 2023 16:57:54 +1000 Subject: [PATCH 01/16] Add tooltip to iconbutton --- src/Button/IconButton.features.stories.tsx | 15 ++++- src/Button/IconButton.tsx | 66 ++++++++++++++++++---- src/Button/types.ts | 10 +++- 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/Button/IconButton.features.stories.tsx b/src/Button/IconButton.features.stories.tsx index 2f8b979aac3..b0d5286b2eb 100644 --- a/src/Button/IconButton.features.stories.tsx +++ b/src/Button/IconButton.features.stories.tsx @@ -1,12 +1,23 @@ -import {HeartIcon} from '@primer/octicons-react' +import {InboxIcon, HeartIcon} from '@primer/octicons-react' import React from 'react' import {IconButton} from '.' +import {Tooltip} from '../drafts/Tooltip' export default { title: 'Components/IconButton/Features', } -export const Primary = () => +export const Primary = () => + +export const WithDescription = () => ( + +) + +export const ExternalTooltip = () => ( + + + +) export const Danger = () => diff --git a/src/Button/IconButton.tsx b/src/Button/IconButton.tsx index e313aa1a4e7..1cc2a6e4348 100644 --- a/src/Button/IconButton.tsx +++ b/src/Button/IconButton.tsx @@ -4,20 +4,62 @@ import {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/po import {ButtonBase} from './ButtonBase' import {defaultSxProp} from '../utils/defaultSxProp' import {generateCustomSxProp} from './Button' +import {Tooltip, TooltipContext} from '../drafts/Tooltip' -const IconButton = forwardRef(({sx: sxProp = defaultSxProp, icon: Icon, ...props}, forwardedRef): JSX.Element => { - let sxStyles = sxProp - // grap the button props that have associated data attributes in the styles - const {size} = props +const IconButton = forwardRef( + ( + {sx: sxProp = defaultSxProp, icon: Icon, 'aria-label': ariaLabel, label, description, ...props}, + forwardedRef, + ): JSX.Element => { + let sxStyles = sxProp + // grap the button props that have associated data attributes in the styles + const {size} = props - if (sxProp !== null && Object.keys(sxProp).length > 0) { - sxStyles = generateCustomSxProp({size}, sxProp) - } + if (sxProp !== null && Object.keys(sxProp).length > 0) { + sxStyles = generateCustomSxProp({size}, sxProp) + } - return ( - // @ts-expect-error StyledButton wants both Anchor and Button refs - - ) -}) as PolymorphicForwardRefComponent<'button' | 'a', IconButtonProps> + // If the icon button is already wrapped in a tooltip, do not add one. + const {tooltipId} = React.useContext(TooltipContext) + + // aria-label is going to be deprecated in favor of label but for now we are supporting both. + const iconButtonLabel = label ?? ariaLabel + + if (!tooltipId) { + return ( + // if description exists, we use tooltip for adding description to the icon button. Otherwise, we use tooltip for labelling the icon button. + // @ts-ignore for now + + + + ) + } else { + return ( + // If icon button is already wrapped in a tooltip, we do not need to add another tooltip. + + ) + } + }, +) as PolymorphicForwardRefComponent<'button' | 'a', IconButtonProps> export {IconButton} diff --git a/src/Button/types.ts b/src/Button/types.ts index 49ad7969eb9..9a81b0a2eae 100644 --- a/src/Button/types.ts +++ b/src/Button/types.ts @@ -14,9 +14,13 @@ export type Size = 'small' | 'medium' | 'large' export type AlignContent = 'start' | 'center' -type ButtonA11yProps = - | {'aria-label': string; 'aria-labelledby'?: undefined} - | {'aria-label'?: undefined; 'aria-labelledby': string} +type ButtonA11yProps = ( + | {'aria-label': string; label?: string; 'aria-labelledby'?: undefined} + | {'aria-label'?: string; label: string; 'aria-labelledby'?: undefined} + | {'aria-label'?: undefined; label?: string; 'aria-labelledby': string} +) & { + description?: string +} export type ButtonBaseProps = { /** From 47af0572ae5863795ee005d35ab20f3e441007e5 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Tue, 12 Dec 2023 16:13:27 +1000 Subject: [PATCH 02/16] do not add tooltip for disabled icon button and update button group styles to encounter icon buttons wrapped with a div for tooltip --- src/Button/IconButton.tsx | 5 +++-- src/ButtonGroup/ButtonGroup.tsx | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/Button/IconButton.tsx b/src/Button/IconButton.tsx index 1cc2a6e4348..55c3734eb1b 100644 --- a/src/Button/IconButton.tsx +++ b/src/Button/IconButton.tsx @@ -8,7 +8,7 @@ import {Tooltip, TooltipContext} from '../drafts/Tooltip' const IconButton = forwardRef( ( - {sx: sxProp = defaultSxProp, icon: Icon, 'aria-label': ariaLabel, label, description, ...props}, + {sx: sxProp = defaultSxProp, icon: Icon, disabled, 'aria-label': ariaLabel, label, description, ...props}, forwardedRef, ): JSX.Element => { let sxStyles = sxProp @@ -25,7 +25,7 @@ const IconButton = forwardRef( // aria-label is going to be deprecated in favor of label but for now we are supporting both. const iconButtonLabel = label ?? ariaLabel - if (!tooltipId) { + if (!tooltipId && !disabled) { return ( // if description exists, we use tooltip for adding description to the icon button. Otherwise, we use tooltip for labelling the icon button. // @ts-ignore for now @@ -50,6 +50,7 @@ const IconButton = forwardRef( icon={Icon} data-component="IconButton" sx={sxStyles} + disabled={disabled} type="button" {...props} // @ts-expect-error StyledButton wants both Anchor and Button refs diff --git a/src/ButtonGroup/ButtonGroup.tsx b/src/ButtonGroup/ButtonGroup.tsx index 9e49b669aca..9e3cbb3413d 100644 --- a/src/ButtonGroup/ButtonGroup.tsx +++ b/src/ButtonGroup/ButtonGroup.tsx @@ -9,25 +9,26 @@ const ButtonGroup = styled.div` isolation: isolate; && > * { - margin-inline-end: -1px; - position: relative; - border-radius: 0; + & > button { + margin-inline-end: -1px; + position: relative; + border-radius: 0; - :first-child { + :focus, + :active, + :hover { + z-index: 1; + } + } + + &:first-child > button { border-top-left-radius: ${get('radii.2')}; border-bottom-left-radius: ${get('radii.2')}; } - - :last-child { + &:last-child > button { border-top-right-radius: ${get('radii.2')}; border-bottom-right-radius: ${get('radii.2')}; } - - :focus, - :active, - :hover { - z-index: 1; - } } ${sx}; From 5e873307683ab061318aa9de6d25be22ffd6f9d2 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Wed, 13 Dec 2023 15:43:07 +1000 Subject: [PATCH 03/16] move the ref up and add tooltip v1 context and update snapshots --- src/Button/IconButton.tsx | 13 +- src/Dialog/__snapshots__/Dialog.test.tsx.snap | 209 +++++++++--- src/Tooltip/Tooltip.tsx | 11 +- .../__snapshots__/TextInput.test.tsx.snap | 316 +++++++++--------- .../__snapshots__/Button.test.tsx.snap | 18 +- 5 files changed, 351 insertions(+), 216 deletions(-) diff --git a/src/Button/IconButton.tsx b/src/Button/IconButton.tsx index 55c3734eb1b..9902e101cd0 100644 --- a/src/Button/IconButton.tsx +++ b/src/Button/IconButton.tsx @@ -4,7 +4,8 @@ import {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/po import {ButtonBase} from './ButtonBase' import {defaultSxProp} from '../utils/defaultSxProp' import {generateCustomSxProp} from './Button' -import {Tooltip, TooltipContext} from '../drafts/Tooltip' +import {Tooltip, TooltipContext} from '../drafts/Tooltip/Tooltip' +import {TooltipContext as TooltipV1Context} from '../Tooltip/Tooltip' const IconButton = forwardRef( ( @@ -18,26 +19,24 @@ const IconButton = forwardRef( if (sxProp !== null && Object.keys(sxProp).length > 0) { sxStyles = generateCustomSxProp({size}, sxProp) } - // If the icon button is already wrapped in a tooltip, do not add one. - const {tooltipId} = React.useContext(TooltipContext) + const {tooltipId} = React.useContext(TooltipContext) // Tooltip v2 + const {container} = React.useContext(TooltipV1Context) // Tooltip v1 // aria-label is going to be deprecated in favor of label but for now we are supporting both. const iconButtonLabel = label ?? ariaLabel - if (!tooltipId && !disabled) { + if (!tooltipId && container !== 'Tooltip' && !disabled) { return ( // if description exists, we use tooltip for adding description to the icon button. Otherwise, we use tooltip for labelling the icon button. // @ts-ignore for now - + diff --git a/src/Dialog/__snapshots__/Dialog.test.tsx.snap b/src/Dialog/__snapshots__/Dialog.test.tsx.snap index f3aaf3ab027..c1a4297dbac 100644 --- a/src/Dialog/__snapshots__/Dialog.test.tsx.snap +++ b/src/Dialog/__snapshots__/Dialog.test.tsx.snap @@ -61,6 +61,10 @@ exports[`Dialog renders consistently 1`] = ` } +@media (forced-colors:active) { + +} + @media screen and (max-width:750px) { } @@ -72,12 +76,12 @@ exports[`Dialog renders consistently 1`] = ` , - .c2 { + .c3 { padding: 16px; background-color: #f6f8fa; } -.c5 { +.c6 { padding: 16px; } @@ -320,14 +324,119 @@ exports[`Dialog renders consistently 1`] = ` color: inherit; } -.c4 { +.c2 { + display: none; +} + +.c2[popover] { + padding: 0.5em 0.75em; + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + margin: auto; + -webkit-clip: auto; + clip: auto; + white-space: normal; + font: normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; + -webkit-font-smoothing: subpixel-antialiased; + color: #ffffff; + text-align: center; + word-wrap: break-word; + background: #24292f; + border-radius: 6px; + border: 0; + opacity: 0; + max-width: 250px; + inset: auto; + overflow: visible; +} + +.c2[popover]:popover-open { + display: block; +} + +.c2[popover].\\:popover-open { + display: block; +} + +.c2::after { + position: absolute; + display: block; + right: 0; + left: 0; + height: 8px; + content: ''; +} + +.c2[data-direction='n']::after, +.c2[data-direction='ne']::after, +.c2[data-direction='nw']::after { + top: 100%; +} + +.c2[data-direction='s']::after, +.c2[data-direction='se']::after, +.c2[data-direction='sw']::after { + bottom: 100%; +} + +.c2[data-direction='w']::after { + position: absolute; + display: block; + height: 100%; + width: 8px; + content: ''; + bottom: 0; + left: 100%; +} + +.c2[data-direction='e']::after { + position: absolute; + display: block; + height: 100%; + width: 8px; + content: ''; + bottom: 0; + right: 100%; + margin-left: -8px; +} + +.c2:popover-open, +.c2:popover-open::before { + -webkit-animation-name: tooltip-appear; + animation-name: tooltip-appear; + -webkit-animation-duration: 0.1s; + animation-duration: 0.1s; + -webkit-animation-fill-mode: forwards; + animation-fill-mode: forwards; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + -webkit-animation-delay: 0s; + animation-delay: 0s; +} + +.c2.\\:popover-open, +.c2.\\:popover-open::before { + -webkit-animation-name: tooltip-appear; + animation-name: tooltip-appear; + -webkit-animation-duration: 0.1s; + animation-duration: 0.1s; + -webkit-animation-fill-mode: forwards; + animation-fill-mode: forwards; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + -webkit-animation-delay: 0s; + animation-delay: 0s; +} + +.c5 { font-size: 14px; font-weight: 600; font-family: sans-serif; color: #1F2328; } -.c6 { +.c7 { font-family: sans-serif; } @@ -348,7 +457,7 @@ exports[`Dialog renders consistently 1`] = ` outline: none; } -.c3 { +.c4 { border-radius: 6px 6px 0px 0px; border-bottom: 1px solid #d0d7de; display: -webkit-box; @@ -363,6 +472,12 @@ exports[`Dialog renders consistently 1`] = ` } } +@media (forced-colors:active) { + .c2 { + outline: 1px solid transparent; + } +} + @media screen and (max-width:750px) { .c0 { width: 100vw; @@ -373,7 +488,7 @@ exports[`Dialog renders consistently 1`] = ` } @media screen and (max-width:750px) { - .c3 { + .c4 { border-radius: 0px; } } @@ -386,44 +501,60 @@ exports[`Dialog renders consistently 1`] = ` role="dialog" tabIndex={-1} > - +
- - - + Close +
+
Some content diff --git a/src/Tooltip/Tooltip.tsx b/src/Tooltip/Tooltip.tsx index a2b1de01bde..9e0301fb668 100644 --- a/src/Tooltip/Tooltip.tsx +++ b/src/Tooltip/Tooltip.tsx @@ -247,6 +247,8 @@ export type TooltipProps = { wrap?: boolean } & ComponentProps +export const TooltipContext = React.createContext<{container?: string}>({}) + function Tooltip({direction = 'n', children, className, text, noDelay, align, wrap, ...rest}: TooltipProps) { const classes = clsx( className, @@ -256,9 +258,12 @@ function Tooltip({direction = 'n', children, className, text, noDelay, align, wr wrap && 'tooltipped-multiline', ) return ( - - {children} - + // This provider is used to check if an icon button is wrapped with tooltip or not. + + + {children} + + ) } diff --git a/src/__tests__/__snapshots__/TextInput.test.tsx.snap b/src/__tests__/__snapshots__/TextInput.test.tsx.snap index 63eaeab5e13..a36657bbb5e 100644 --- a/src/__tests__/__snapshots__/TextInput.test.tsx.snap +++ b/src/__tests__/__snapshots__/TextInput.test.tsx.snap @@ -1958,85 +1958,6 @@ exports[`TextInput renders trailingAction icon button 1`] = ` height: var(--inner-action-size); } -.c0 { - font-size: 14px; - line-height: 20px; - color: #1F2328; - vertical-align: middle; - background-color: #ffffff; - border: 1px solid var(--control-borderColor-rest,#d0d7de); - border-radius: 6px; - outline: none; - box-shadow: inset 0 1px 0 rgba(208,215,222,0.2); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - min-height: 32px; - overflow: hidden; -} - -.c0 input, -.c0 textarea { - cursor: text; -} - -.c0 select { - cursor: pointer; -} - -.c0::-webkit-input-placeholder { - color: #6e7781; -} - -.c0::-moz-placeholder { - color: #6e7781; -} - -.c0:-ms-input-placeholder { - color: #6e7781; -} - -.c0::placeholder { - color: #6e7781; -} - -.c0 > textarea { - padding: 12px; -} - -.c1 { - background-repeat: no-repeat; - background-position: right 8px center; - padding-left: 0; - padding-right: 0; -} - -.c1 > :not(:last-child) { - margin-right: 8px; -} - -.c1 .TextInput-icon, -.c1 .TextInput-action { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; - color: #656d76; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c1 > input, -.c1 > select { - padding-left: 12px; - padding-right: 0; -} - .c4 { position: relative; display: inline-block; @@ -2262,6 +2183,85 @@ exports[`TextInput renders trailingAction icon button 1`] = ` left: 10px; } +.c0 { + font-size: 14px; + line-height: 20px; + color: #1F2328; + vertical-align: middle; + background-color: #ffffff; + border: 1px solid var(--control-borderColor-rest,#d0d7de); + border-radius: 6px; + outline: none; + box-shadow: inset 0 1px 0 rgba(208,215,222,0.2); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: #6e7781; +} + +.c0::-moz-placeholder { + color: #6e7781; +} + +.c0:-ms-input-placeholder { + color: #6e7781; +} + +.c0::placeholder { + color: #6e7781; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: #656d76; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + .c2 { border: 0; font-size: inherit; @@ -3043,85 +3043,6 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = ` color: inherit; } -.c0 { - font-size: 14px; - line-height: 20px; - color: #1F2328; - vertical-align: middle; - background-color: #ffffff; - border: 1px solid var(--control-borderColor-rest,#d0d7de); - border-radius: 6px; - outline: none; - box-shadow: inset 0 1px 0 rgba(208,215,222,0.2); - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - min-height: 32px; - overflow: hidden; -} - -.c0 input, -.c0 textarea { - cursor: text; -} - -.c0 select { - cursor: pointer; -} - -.c0::-webkit-input-placeholder { - color: #6e7781; -} - -.c0::-moz-placeholder { - color: #6e7781; -} - -.c0:-ms-input-placeholder { - color: #6e7781; -} - -.c0::placeholder { - color: #6e7781; -} - -.c0 > textarea { - padding: 12px; -} - -.c1 { - background-repeat: no-repeat; - background-position: right 8px center; - padding-left: 0; - padding-right: 0; -} - -.c1 > :not(:last-child) { - margin-right: 8px; -} - -.c1 .TextInput-icon, -.c1 .TextInput-action { - -webkit-align-self: center; - -ms-flex-item-align: center; - align-self: center; - color: #656d76; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c1 > input, -.c1 > select { - padding-left: 12px; - padding-right: 0; -} - .c4 { position: relative; display: inline-block; @@ -3348,6 +3269,85 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = ` left: 10px; } +.c0 { + font-size: 14px; + line-height: 20px; + color: #1F2328; + vertical-align: middle; + background-color: #ffffff; + border: 1px solid var(--control-borderColor-rest,#d0d7de); + border-radius: 6px; + outline: none; + box-shadow: inset 0 1px 0 rgba(208,215,222,0.2); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: #6e7781; +} + +.c0::-moz-placeholder { + color: #6e7781; +} + +.c0:-ms-input-placeholder { + color: #6e7781; +} + +.c0::placeholder { + color: #6e7781; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: #656d76; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + .c2 { border: 0; font-size: inherit; diff --git a/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap b/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap index 412399621ca..614309fa5f9 100644 --- a/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap +++ b/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap @@ -304,28 +304,28 @@ exports[`ButtonGroup renders consistently 1`] = ` isolation: isolate; } -.c0.c0 > * { +.c0.c0 > * > button { margin-inline-end: -1px; position: relative; border-radius: 0; } -.c0.c0 > *:first-child { +.c0.c0 > * > button:focus, +.c0.c0 > * > button:active, +.c0.c0 > * > button:hover { + z-index: 1; +} + +.c0.c0 > *:first-child > button { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } -.c0.c0 > *:last-child { +.c0.c0 > *:last-child > button { border-top-right-radius: 6px; border-bottom-right-radius: 6px; } -.c0.c0 > *:focus, -.c0.c0 > *:active, -.c0.c0 > *:hover { - z-index: 1; -} -
From df7f98fb28c1c0ba96b79a2464fed976f4a727a0 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Thu, 14 Dec 2023 11:41:51 +1000 Subject: [PATCH 04/16] update types --- src/Button/types.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Button/types.ts b/src/Button/types.ts index 9a81b0a2eae..bfa8be2fe8f 100644 --- a/src/Button/types.ts +++ b/src/Button/types.ts @@ -15,9 +15,9 @@ export type Size = 'small' | 'medium' | 'large' export type AlignContent = 'start' | 'center' type ButtonA11yProps = ( - | {'aria-label': string; label?: string; 'aria-labelledby'?: undefined} - | {'aria-label'?: string; label: string; 'aria-labelledby'?: undefined} - | {'aria-label'?: undefined; label?: string; 'aria-labelledby': string} + | {'aria-label': string; label?: undefined; 'aria-labelledby'?: undefined} + | {'aria-label'?: undefined; label: string; 'aria-labelledby'?: undefined} + | {'aria-label'?: undefined; label?: undefined; 'aria-labelledby': string} ) & { description?: string } From 5d48aa6222a39a3e16da21b046cec893b7082455 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Wed, 13 Dec 2023 15:33:13 +1000 Subject: [PATCH 05/16] Do not wrap the tooltip and the trigger in a div --- src/drafts/Tooltip/Tooltip.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/drafts/Tooltip/Tooltip.tsx b/src/drafts/Tooltip/Tooltip.tsx index 6570e939bf0..969e9f6a195 100644 --- a/src/drafts/Tooltip/Tooltip.tsx +++ b/src/drafts/Tooltip/Tooltip.tsx @@ -1,5 +1,4 @@ import React, {Children, useEffect, useRef, useState} from 'react' -import Box from '../../Box' import sx, {SxProp} from '../../sx' import {useId, useProvidedRefOrCreate} from '../../hooks' import {invariant} from '../../utils/invariant' @@ -139,6 +138,7 @@ export type TriggerPropsType = { onBlur?: React.FocusEventHandler onFocus?: React.FocusEventHandler onMouseEnter?: React.MouseEventHandler + onMouseLeave?: React.MouseEventHandler ref?: React.RefObject } @@ -268,7 +268,7 @@ export const Tooltip = React.forwardRef( return ( - closeTooltip()}> + <> {React.isValidElement(child) && React.cloneElement(child as React.ReactElement, { ref: triggerRef, @@ -288,6 +288,10 @@ export const Tooltip = React.forwardRef( openTooltip() child.props.onMouseEnter?.(event) }, + onMouseLeave: (event: React.MouseEvent) => { + closeTooltip() + child.props.onMouseLeave?.(event) + }, })} {text} - + ) }, From 651b36806b1991a71d5a9f0862acdf0ab9199af7 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Mon, 15 Jan 2024 15:40:39 +1000 Subject: [PATCH 06/16] tests --- src/Button/types.ts | 21 ++++- .../__snapshots__/Dialog.test.tsx.snap | 84 +++++++++---------- src/drafts/Tooltip/Tooltip.tsx | 17 ++-- src/drafts/Tooltip/__tests__/Tooltip.test.tsx | 33 +++++++- 4 files changed, 98 insertions(+), 57 deletions(-) diff --git a/src/Button/types.ts b/src/Button/types.ts index bfa8be2fe8f..0aff474f5d4 100644 --- a/src/Button/types.ts +++ b/src/Button/types.ts @@ -15,9 +15,24 @@ export type Size = 'small' | 'medium' | 'large' export type AlignContent = 'start' | 'center' type ButtonA11yProps = ( - | {'aria-label': string; label?: undefined; 'aria-labelledby'?: undefined} - | {'aria-label'?: undefined; label: string; 'aria-labelledby'?: undefined} - | {'aria-label'?: undefined; label?: undefined; 'aria-labelledby': string} + | { + // @deprecated use label prop instead + 'aria-label': string + label?: undefined + 'aria-labelledby'?: undefined + } + | { + // @deprecated use label prop instead + 'aria-label'?: undefined + label: string + 'aria-labelledby'?: undefined + } + | { + // @deprecated use label prop instead + 'aria-label'?: undefined + label?: undefined + 'aria-labelledby': string + } ) & { description?: string } diff --git a/src/__tests__/__snapshots__/Dialog.test.tsx.snap b/src/__tests__/__snapshots__/Dialog.test.tsx.snap index c1a4297dbac..9bdc0582b52 100644 --- a/src/__tests__/__snapshots__/Dialog.test.tsx.snap +++ b/src/__tests__/__snapshots__/Dialog.test.tsx.snap @@ -501,53 +501,51 @@ exports[`Dialog renders consistently 1`] = ` role="dialog" tabIndex={-1} > -
- -
- Close -
+ + + +
+ Close
= { } // The list is from GitHub's custom-axe-rules https://github.com/github/github/blob/master/app/assets/modules/github/axe-custom-rules.ts#L3 -const interactiveElements = [ - 'a[href]', - 'button:not(:disabled)', - 'summary', - 'select', - 'input:not([type=hidden])', - 'textarea', -] +const interactiveElements = ['a[href]', 'button', 'summary', 'select', 'input:not([type=hidden])', 'textarea'] const isInteractive = (element: HTMLElement) => { return ( - interactiveElements.some(selector => element.matches(selector)) || - (element.hasAttribute('role') && element.getAttribute('role') === 'button') + interactiveElements.some(selector => { + if (element.tagName === 'BUTTON') { + return !element.hasAttribute('disabled') + } else return element.matches(selector) + }) || + (element.hasAttribute('role') && element.getAttribute('role') === 'button' && !element.hasAttribute('disabled')) ) } export const TooltipContext = React.createContext<{tooltipId?: string}>({}) diff --git a/src/drafts/Tooltip/__tests__/Tooltip.test.tsx b/src/drafts/Tooltip/__tests__/Tooltip.test.tsx index e8fbea212f3..d7811844d54 100644 --- a/src/drafts/Tooltip/__tests__/Tooltip.test.tsx +++ b/src/drafts/Tooltip/__tests__/Tooltip.test.tsx @@ -3,7 +3,8 @@ import {Tooltip, TooltipProps} from '../Tooltip' import {checkStoriesForAxeViolations} from '../../../utils/testing' import {render as HTMLRender} from '@testing-library/react' import theme from '../../../theme' -import {Button, ActionMenu, ActionList, ThemeProvider, SSRProvider, BaseStyles} from '../../../' +import {Button, ActionMenu, ActionList, ThemeProvider, SSRProvider, BaseStyles, IconButton} from '../../../' +import {HeartIcon} from '@primer/octicons-react' const TooltipComponent = (props: Omit & {text?: string}) => ( @@ -91,4 +92,34 @@ describe('Tooltip', () => { expect(menuButton).toHaveAttribute('aria-describedby', tooltip.id) expect(menuButton).toHaveAttribute('aria-haspopup', 'true') }) + it('should throw an error when the tooltip is used on a disabled button', () => { + const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}) + expect(() => { + HTMLRender( + + + , + ) + }).toThrow( + 'The `Tooltip` component expects a single React element that contains interactive content. Consider using a ` + + + +`; + +exports[`TextInput renders trailingAction text button 1`] = ` +.c3 { + margin-left: 4px; + margin-right: 4px; + line-height: 0; +} + +.c5 { + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.c4 { + border-radius: 6px; + border: 1px solid; + border-color: transparent; + font-family: inherit; + font-weight: 500; + font-size: 14px; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-text-decoration: none; + text-decoration: none; + text-align: center; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + height: 32px; + padding: 0 12px; + gap: 8px; + min-width: -webkit-max-content; + min-width: -moz-max-content; + min-width: max-content; + -webkit-transition: 80ms cubic-bezier(0.65,0,0.35,1); + transition: 80ms cubic-bezier(0.65,0,0.35,1); + -webkit-transition-property: color,fill,background-color,border-color; + transition-property: color,fill,background-color,border-color; + color: var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)); + background-color: transparent; + box-shadow: none; +} + +.c4:focus:not(:disabled) { + box-shadow: none; + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -2px; +} + +.c4:focus:not(:disabled):not(:focus-visible) { + outline: solid 1px transparent; +} + +.c4:focus-visible:not(:disabled) { + box-shadow: none; + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -2px; +} + +.c4[href] { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; +} + +.c4[href]:hover { + -webkit-text-decoration: none; + text-decoration: none; +} + +.c4:hover { + -webkit-transition-duration: 80ms; + transition-duration: 80ms; +} + +.c4:active { + -webkit-transition: none; + transition: none; +} + +.c4[data-inactive] { + cursor: auto; +} + +.c4:disabled { + cursor: not-allowed; + box-shadow: none; + color: var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f)); +} + +.c4:disabled [data-component=ButtonCounter], +.c4:disabled [data-component="leadingVisual"], +.c4:disabled [data-component="trailingAction"] { + color: inherit; +} + +.c4 [data-component=ButtonCounter] { + font-size: 12px; +} + +.c4[data-component=IconButton] { + display: inline-grid; + padding: unset; + place-content: center; + width: 32px; + min-width: unset; +} + +.c4[data-size="small"] { + padding: 0 8px; + height: 28px; + gap: 4px; + font-size: 12px; +} + +.c4[data-size="small"] [data-component="text"] { + line-height: calc(20 / 12); +} + +.c4[data-size="small"] [data-component=ButtonCounter] { + font-size: 12px; +} + +.c4[data-size="small"] [data-component="buttonContent"] > :not(:last-child) { + margin-right: 4px; +} + +.c4[data-size="small"][data-component=IconButton] { + width: 28px; + padding: unset; +} + +.c4[data-size="large"] { + padding: 0 16px; + height: 40px; + gap: 8px; +} + +.c4[data-size="large"] [data-component="buttonContent"] > :not(:last-child) { + margin-right: 8px; +} + +.c4[data-size="large"][data-component=IconButton] { + width: 40px; + padding: unset; +} + +.c4[data-block="block"] { + width: 100%; +} + +.c4[data-inactive]:not([disabled]) { + background-color: var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2))); + border-color: var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2))); + color: var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a))); +} + +.c4[data-inactive]:not([disabled]):focus-visible { + box-shadow: none; +} + +.c4 [data-component="leadingVisual"] { + grid-area: leadingVisual; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c4 [data-component="text"] { + grid-area: text; + line-height: calc(20/14); + white-space: nowrap; +} + +.c4 [data-component="trailingVisual"] { + grid-area: trailingVisual; +} + +.c4 [data-component="trailingAction"] { + margin-right: -4px; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c4 [data-component="buttonContent"] { + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; + display: grid; + grid-template-areas: "leadingVisual text trailingVisual"; + grid-template-columns: min-content minmax(0,auto) min-content; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-content: center; + -ms-flex-line-pack: center; + align-content: center; +} + +.c4 [data-component="buttonContent"] > :not(:last-child) { + margin-right: 8px; +} + +.c4:hover:not([disabled]) { + background-color: var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32))); +} + +.c4:active:not([disabled]) { + background-color: var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48))); +} + +.c4[aria-expanded=true] { + background-color: var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24))); +} + +.c4[data-component="IconButton"][data-no-visuals] { + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c4[data-no-visuals] { + color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + padding-top: 2px; + padding-right: 4px; + padding-bottom: 2px; + padding-left: 4px; + position: relative; +} + +.c4[data-no-visuals][data-component="IconButton"] { + width: var(--inner-action-size); + height: var(--inner-action-size); +} + +.c4:has([data-component="ButtonCounter"]) { + color: var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)); +} + +.c4:disabled[data-no-visuals] { + color: var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f)); +} + +.c4:disabled[data-no-visuals] [data-component=ButtonCounter] { + color: inherit; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (forced-colors:active) { + .c4:focus { + outline: solid 1px transparent; + } +} + +@media (pointer:coarse) { + .c4[data-no-visuals]:after { + content: ""; + position: absolute; + left: 0; + right: 0; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + top: 50%; + min-height: 44px; + } +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + + + + +`; + +exports[`TextInput renders trailingAction text button with a tooltip 1`] = ` +.c3 { + margin-left: 4px; + margin-right: 4px; + line-height: 0; +} + +.c6 { + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.c5 { + border-radius: 6px; + border: 1px solid; + border-color: transparent; + font-family: inherit; + font-weight: 500; + font-size: 14px; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-text-decoration: none; + text-decoration: none; + text-align: center; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + height: 32px; + padding: 0 12px; + gap: 8px; + min-width: -webkit-max-content; + min-width: -moz-max-content; + min-width: max-content; + -webkit-transition: 80ms cubic-bezier(0.65,0,0.35,1); + transition: 80ms cubic-bezier(0.65,0,0.35,1); + -webkit-transition-property: color,fill,background-color,border-color; + transition-property: color,fill,background-color,border-color; + color: var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)); + background-color: transparent; + box-shadow: none; +} + +.c5:focus:not(:disabled) { + box-shadow: none; + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -2px; +} + +.c5:focus:not(:disabled):not(:focus-visible) { + outline: solid 1px transparent; +} + +.c5:focus-visible:not(:disabled) { + box-shadow: none; + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -2px; +} + +.c5[href] { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; +} + +.c5[href]:hover { + -webkit-text-decoration: none; + text-decoration: none; +} + +.c5:hover { + -webkit-transition-duration: 80ms; + transition-duration: 80ms; +} + +.c5:active { + -webkit-transition: none; + transition: none; +} + +.c5[data-inactive] { + cursor: auto; +} + +.c5:disabled { + cursor: not-allowed; + box-shadow: none; + color: var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f)); +} + +.c5:disabled [data-component=ButtonCounter], +.c5:disabled [data-component="leadingVisual"], +.c5:disabled [data-component="trailingAction"] { + color: inherit; +} + +.c5 [data-component=ButtonCounter] { + font-size: 12px; +} + +.c5[data-component=IconButton] { + display: inline-grid; + padding: unset; + place-content: center; + width: 32px; + min-width: unset; +} + +.c5[data-size="small"] { + padding: 0 8px; + height: 28px; + gap: 4px; + font-size: 12px; +} + +.c5[data-size="small"] [data-component="text"] { + line-height: calc(20 / 12); +} + +.c5[data-size="small"] [data-component=ButtonCounter] { + font-size: 12px; +} + +.c5[data-size="small"] [data-component="buttonContent"] > :not(:last-child) { + margin-right: 4px; +} + +.c5[data-size="small"][data-component=IconButton] { + width: 28px; + padding: unset; +} + +.c5[data-size="large"] { + padding: 0 16px; + height: 40px; + gap: 8px; +} + +.c5[data-size="large"] [data-component="buttonContent"] > :not(:last-child) { + margin-right: 8px; +} + +.c5[data-size="large"][data-component=IconButton] { + width: 40px; + padding: unset; +} + +.c5[data-block="block"] { + width: 100%; +} + +.c5[data-inactive]:not([disabled]) { + background-color: var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2))); + border-color: var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2))); + color: var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a))); +} + +.c5[data-inactive]:not([disabled]):focus-visible { + box-shadow: none; +} + +.c5 [data-component="leadingVisual"] { + grid-area: leadingVisual; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c5 [data-component="text"] { + grid-area: text; + line-height: calc(20/14); + white-space: nowrap; +} + +.c5 [data-component="trailingVisual"] { + grid-area: trailingVisual; +} + +.c5 [data-component="trailingAction"] { + margin-right: -4px; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c5 [data-component="buttonContent"] { + -webkit-flex: 1 0 auto; + -ms-flex: 1 0 auto; + flex: 1 0 auto; + display: grid; + grid-template-areas: "leadingVisual text trailingVisual"; + grid-template-columns: min-content minmax(0,auto) min-content; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-content: center; + -ms-flex-line-pack: center; + align-content: center; +} + +.c5 [data-component="buttonContent"] > :not(:last-child) { + margin-right: 8px; +} + +.c5:hover:not([disabled]) { + background-color: var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32))); +} + +.c5:active:not([disabled]) { + background-color: var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48))); +} + +.c5[aria-expanded=true] { + background-color: var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24))); +} + +.c5[data-component="IconButton"][data-no-visuals] { + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); +} + +.c5[data-no-visuals] { + color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + padding-top: 2px; + padding-right: 4px; + padding-bottom: 2px; + padding-left: 4px; + position: relative; +} + +.c5[data-no-visuals][data-component="IconButton"] { + width: var(--inner-action-size); + height: var(--inner-action-size); +} + +.c5:has([data-component="ButtonCounter"]) { + color: var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)); +} + +.c5:disabled[data-no-visuals] { + color: var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f)); +} + +.c5:disabled[data-no-visuals] [data-component=ButtonCounter] { + color: inherit; +} + +.c4 { + position: relative; + display: inline-block; + display: inline-block; +} + +.c4::before { + position: absolute; + z-index: 1000001; + display: none; + width: 0px; + height: 0px; + color: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); + pointer-events: none; + content: ''; + border: 6px solid transparent; + opacity: 0; +} + +.c4::after { + position: absolute; + z-index: 1000000; + display: none; + padding: 0.5em 0.75em; + font: normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; + -webkit-font-smoothing: subpixel-antialiased; + color: var(--fgColor-onEmphasis,var(--color-fg-on-emphasis,#ffffff)); + text-align: center; + -webkit-text-decoration: none; + text-decoration: none; + text-shadow: none; + text-transform: none; + -webkit-letter-spacing: normal; + -moz-letter-spacing: normal; + -ms-letter-spacing: normal; + letter-spacing: normal; + word-wrap: break-word; + white-space: pre; + pointer-events: none; + content: attr(aria-label); + background: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); + border-radius: 3px; + opacity: 0; +} + +.c4:hover::before, +.c4:active::before, +.c4:focus::before, +.c4:focus-within::before, +.c4:hover::after, +.c4:active::after, +.c4:focus::after, +.c4:focus-within::after { + display: inline-block; + -webkit-text-decoration: none; + text-decoration: none; + -webkit-animation-name: tooltip-appear; + animation-name: tooltip-appear; + -webkit-animation-duration: 0.1s; + animation-duration: 0.1s; + -webkit-animation-fill-mode: forwards; + animation-fill-mode: forwards; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + -webkit-animation-delay: 0.4s; + animation-delay: 0.4s; +} + +.c4.tooltipped-no-delay:hover::before, +.c4.tooltipped-no-delay:active::before, +.c4.tooltipped-no-delay:focus::before, +.c4.tooltipped-no-delay:focus-within::before, +.c4.tooltipped-no-delay:hover::after, +.c4.tooltipped-no-delay:active::after, +.c4.tooltipped-no-delay:focus::after, +.c4.tooltipped-no-delay:focus-within::after { + -webkit-animation-delay: 0s; + animation-delay: 0s; +} + +.c4.tooltipped-multiline:hover::after, +.c4.tooltipped-multiline:active::after, +.c4.tooltipped-multiline:focus::after, +.c4.tooltipped-multiline:focus-within::after { + display: table-cell; +} + +.c4.tooltipped-s::after, +.c4.tooltipped-se::after, +.c4.tooltipped-sw::after { + top: 100%; + right: 50%; + margin-top: 6px; +} + +.c4.tooltipped-s::before, +.c4.tooltipped-se::before, +.c4.tooltipped-sw::before { + top: auto; + right: 50%; + bottom: -7px; + margin-right: -6px; + border-bottom-color: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); +} + +.c4.tooltipped-se::after { + right: auto; + left: 50%; + margin-left: -16px; +} + +.c4.tooltipped-sw::after { + margin-right: -16px; +} + +.c4.tooltipped-n::after, +.c4.tooltipped-ne::after, +.c4.tooltipped-nw::after { + right: 50%; + bottom: 100%; + margin-bottom: 6px; +} + +.c4.tooltipped-n::before, +.c4.tooltipped-ne::before, +.c4.tooltipped-nw::before { + top: -7px; + right: 50%; + bottom: auto; + margin-right: -6px; + border-top-color: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); +} + +.c4.tooltipped-ne::after { + right: auto; + left: 50%; + margin-left: -16px; +} + +.c4.tooltipped-nw::after { + margin-right: -16px; +} + +.c4.tooltipped-s::after, +.c4.tooltipped-n::after { + -webkit-transform: translateX(50%); + -ms-transform: translateX(50%); + transform: translateX(50%); +} + +.c4.tooltipped-w::after { + right: 100%; + bottom: 50%; + margin-right: 6px; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} + +.c4.tooltipped-w::before { + top: 50%; + bottom: 50%; + left: -7px; + margin-top: -6px; + border-left-color: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); +} + +.c4.tooltipped-e::after { + bottom: 50%; + left: 100%; + margin-left: 6px; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} + +.c4.tooltipped-e::before { + top: 50%; + right: -7px; + bottom: 50%; + margin-top: -6px; + border-right-color: var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)); +} + +.c4.tooltipped-multiline::after { + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + max-width: 250px; + word-wrap: break-word; + white-space: pre-line; + border-collapse: separate; +} + +.c4.tooltipped-multiline.tooltipped-s::after, +.c4.tooltipped-multiline.tooltipped-n::after { + right: auto; + left: 50%; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); +} + +.c4.tooltipped-multiline.tooltipped-w::after, +.c4.tooltipped-multiline.tooltipped-e::after { + right: 100%; +} + +.c4.tooltipped-align-right-2::after { + right: 0; + margin-right: 0; +} + +.c4.tooltipped-align-right-2::before { + right: 15px; +} + +.c4.tooltipped-align-left-2::after { + left: 0; + margin-left: 0; +} + +.c4.tooltipped-align-left-2::before { + left: 10px; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (forced-colors:active) { + .c5:focus { + outline: solid 1px transparent; + } +} + +@media (pointer:coarse) { + .c5[data-no-visuals]:after { + content: ""; + position: absolute; + left: 0; + right: 0; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + top: 50%; + min-height: 44px; + } +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + + + + + + +`; + +exports[`TextInput renders trailingVisual 1`] = ` +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + + + + +`; + +exports[`TextInput renders trailingVisual 2`] = ` +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + + + + +`; + +exports[`TextInput renders trailingVisual 3`] = ` +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + +
+ Trailing +
+
+
+`; + +exports[`TextInput renders trailingVisual 4`] = ` +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + +
+ Trailing +
+
+
+`; + +exports[`TextInput renders with a loading indicator 1`] = ` +[ + .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: visible; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + + +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: visible; +} + +.c5 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: hidden; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 12px; +} + +.c4 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c4:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+ + + + +
+
+ + +
+ + + + +
+
+
, + .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: visible; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + + +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + visibility: hidden; +} + +.c6 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: hidden; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + left: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 12px; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+
+ +
+ + + + +
+
+ + +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + visibility: hidden; +} + +.c6 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: hidden; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + left: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 12px; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+
+ +
+ + + + +
+
+ + +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + visibility: visible; +} + +.c6 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: visible; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: hidden; + left: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 0; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+
+ +
+ + + + +
+
+ + +
+ + + + +
+
+
, + .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c4 { + visibility: hidden; +} + +.c5 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + + +
+
+ +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c5 { + visibility: visible; +} + +.c3 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + visibility: visible; +} + +.c6 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: hidden; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 0; +} + +.c4 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c4:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+ + + + +
+
+ + +
+
+ +
+ + + + +
+
+
, + .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c4 { + visibility: hidden; +} + +.c5 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 0; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + + +
+
+ +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + visibility: hidden; +} + +.c6 { + visibility: visible; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + left: 0; +} + +.c7 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: hidden; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; + --inner-action-size: 20px; + min-height: 28px; + padding-left: 8px; + padding-right: 8px; + padding-top: 3px; + padding-bottom: 3px; + font-size: 12px; + line-height: 20px; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 0; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + + + +
+
+ +
+ + + + +
+
+ + +
+
+ +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c3 { + visibility: hidden; +} + +.c6 { + visibility: visible; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + left: 0; +} + +.c7 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: hidden; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 0; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + + + +
+
+ +
+ + + + +
+
+ + +
+
+ +
+ + + + +
+
+
, + .c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.c6 { + visibility: hidden; +} + +.c3 { + visibility: visible; +} + +.c4 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: hidden; + left: 0; +} + +.c7 { + -webkit-animation: rotate-keyframes 1s linear infinite; + animation: rotate-keyframes 1s linear infinite; + position: absolute; + top: 0; + height: 100%; + max-width: 100%; + visibility: visible; + right: 0; +} + +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; + --inner-action-size: 28px; + padding-left: 8px; + padding-right: 8px; + padding-top: 10px; + padding-bottom: 10px; + height: 40px; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 12px; + padding-right: 12px; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 0; + padding-right: 0; +} + +.c5 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c5:focus { + outline: 0; +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + +
+
+ +
+ + + + +
+
+ + +
+
+ +
+ + + + +
+
+
, +] +`; + +exports[`TextInput should render a password input 1`] = ` +.c0 { + font-size: 14px; + line-height: 20px; + color: var(--fgColor-default,var(--color-fg-default,#1F2328)); + vertical-align: middle; + background-color: var(--bgColor-default,var(--color-canvas-default,#ffffff)); + border: 1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de))); + border-radius: 6px; + outline: none; + box-shadow: var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2))); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; + min-height: 32px; + overflow: hidden; +} + +.c0 input, +.c0 textarea { + cursor: text; +} + +.c0 select { + cursor: pointer; +} + +.c0::-webkit-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::-moz-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:-ms-input-placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0::placeholder { + color: var(--fgColor-muted,var(--color-fg-subtle,#6e7781)); +} + +.c0:focus-within { + border-color: var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline: 2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da)); + outline-offset: -1px; +} + +.c0 > textarea { + padding: 12px; +} + +.c1 { + background-repeat: no-repeat; + background-position: right 8px center; + padding-left: 0; + padding-right: 0; +} + +.c1 > :not(:last-child) { + margin-right: 8px; +} + +.c1 .TextInput-icon, +.c1 .TextInput-action { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + color: var(--fgColor-muted,var(--color-fg-muted,#656d76)); + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.c1 > input, +.c1 > select { + padding-left: 12px; + padding-right: 12px; +} + +.c2 { + border: 0; + font-size: inherit; + font-family: inherit; + background-color: transparent; + -webkit-appearance: none; + color: inherit; + width: 100%; +} + +.c2:focus { + outline: 0; +} + +@media (min-width:768px) { + .c0 { + font-size: 14px; + } +} + + + + +`; diff --git a/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap b/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap new file mode 100644 index 00000000000..2ea3e7334e6 --- /dev/null +++ b/src/__tests__/deprecated/__snapshots__/Button.test.tsx.snap @@ -0,0 +1,367 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Button respects the "disabled" prop 1`] = ` +.c0 { + position: relative; + display: inline-block; + padding: 6px 16px; + font-family: inherit; + font-weight: 600; + line-height: 20px; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-radius: 6px; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + -webkit-text-decoration: none; + text-decoration: none; + text-align: center; + font-size: 14px; +} + +.c0:hover { + -webkit-text-decoration: none; + text-decoration: none; +} + +.c0:focus { + outline: none; +} + +.c0:disabled { + cursor: default; +} + +.c0:disabled svg { + opacity: 0.6; +} + +.c1 { + color: var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)); + background-color: var(--button-default-bgColor-rest,var(--color-btn-bg,#f6f8fa)); + border: 1px solid var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))); + box-shadow: var(--button-default-shadow-resting,var(--color-btn-shadow,0 1px 0 rgba(31,35,40,0.04))),var(--button-default-shadow-inset,var(--color-btn-inset-shadow,inset 0 1px 0 rgba(255,255,255,0.25))); +} + +.c1:hover { + background-color: var(--button-default-bgColor-hover,var(--color-btn-hover-bg,#f3f4f6)); + border-color: var(--button-default-borderColor-hover,var(--color-btn-hover-border,rgba(31,35,40,0.15))); +} + +.c1:focus { + outline: solid 2px var(--fgColor-accent,var(--color-accent-fg,#0969da)); +} + +.c1:active { + background-color: var(--button-default-bgColor-selected,var(--color-btn-selected-bg,hsla(220,14%,94%,1))); +} + +.c1:disabled { + color: var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f)); + background-color: var(--button-default-bgColor-rest,var(--color-btn-bg,#f6f8fa)); + border-color: var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))); +} + +