diff --git a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/Button.tsx b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/Button.tsx index 8db50581cc..fdb95ba1bf 100644 --- a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/Button.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/Button.tsx @@ -74,9 +74,11 @@ export const BUTTON_STYLES = twv.tv({ 'group', // we need to set the height to max-content to prevent the button from growing in flex containers 'h-[max-content]', + // basic outline + 'outline-offset-[1px] outline-transparent', // buttons always have borders // so keep them in mind when setting paddings - 'border border-transparent', + 'border-0.5 border-transparent', // button reset styles 'whitespace-nowrap cursor-pointer select-none appearance-none', // Align the content by the center @@ -87,7 +89,7 @@ export const BUTTON_STYLES = twv.tv({ variants: { isDisabled: { true: 'disabled:opacity-50 disabled:cursor-not-allowed' }, isFocused: { - true: 'focus:outline-none focus-visible:outline focus-visible:outline-primary focus-visible:outline-offset-2', + true: 'focus:outline-none focus-visible:outline-2 focus-visible:outline-black focus-visible:outline-offset-[-2px]', }, isActive: { none: '', @@ -107,10 +109,10 @@ export const BUTTON_STYLES = twv.tv({ variant: 'body', color: 'custom', weight: 'semibold', - className: 'flex px-[11px] py-[5px]', + className: 'flex px-[11px] py-[5.5px]', }), content: 'gap-2', - icon: 'mb-[-0.3cap]', + icon: 'mb-[-0.1cap] h-4.5 w-4.5', extraClickZone: 'after:inset-[-6px]', }, medium: { @@ -118,9 +120,9 @@ export const BUTTON_STYLES = twv.tv({ variant: 'body', color: 'custom', weight: 'semibold', - className: 'flex px-[9px] py-[3px]', + className: 'flex px-[9px] py-[3.5px]', }), - icon: 'mb-[-0.3cap]', + icon: 'mb-[-0.1cap] h-4 w-4', content: 'gap-2', extraClickZone: 'after:inset-[-8px]', }, @@ -129,9 +131,9 @@ export const BUTTON_STYLES = twv.tv({ variant: 'body', color: 'custom', weight: 'medium', - className: 'flex px-[7px] py-[1px]', + className: 'flex px-[7px] py-[1.5px]', }), - icon: 'mb-[-0.3cap]', + icon: 'mb-[-0.1cap] h-3.5 w-3.5', content: 'gap-1', extraClickZone: 'after:inset-[-10px]', }, @@ -140,9 +142,10 @@ export const BUTTON_STYLES = twv.tv({ variant: 'body', color: 'custom', weight: 'medium', - className: 'flex px-[5px] py-[1px]', + disableLineHeightCompensation: true, + className: 'flex px-[5px] pt-[0.5px] pb-[2.5px]', }), - icon: 'mb-[-0.3cap]', + icon: 'mb-[-0.2cap] h-3 w-3', content: 'gap-1', extraClickZone: 'after:inset-[-12px]', }, @@ -150,17 +153,24 @@ export const BUTTON_STYLES = twv.tv({ base: text.TEXT_STYLE({ variant: 'body', color: 'custom', - className: 'flex px-[3px] py-[0px]', + className: 'flex px-[3px] pt-[0.5px] pb-[2.5px] leading-[16px]', // we need to disable line height compensation for this size // because otherwise the text will be too high in the button disableLineHeightCompensation: true, }), content: 'gap-0.5', + icon: 'mb-[-0.1cap]', extraClickZone: 'after:inset-[-12px]', }, }, iconOnly: { - true: { base: text.TEXT_STYLE({ disableLineHeightCompensation: true }), icon: 'mb-[unset]' }, + true: { + base: text.TEXT_STYLE({ + disableLineHeightCompensation: true, + className: 'border-0 outline-offset-[5px]', + }), + icon: 'mb-[unset]', + }, }, rounded: { full: 'rounded-full', @@ -173,10 +183,11 @@ export const BUTTON_STYLES = twv.tv({ xxxlarge: 'rounded-3xl', }, variant: { - custom: 'focus-visible:outline-offset-2', + custom: '', link: { - base: 'inline-block px-0 py-0 rounded-sm text-primary/50 underline hover:text-primary border-none', - icon: 'h-[1.25cap] mt-[0.25cap]', + base: 'inline-block px-0 py-0 rounded-sm text-primary/50 underline hover:text-primary border-0', + content: 'gap-1.5', + icon: 'h-[1.25cap] w-[1.25cap] mt-[0.25cap]', }, primary: 'bg-primary text-white hover:bg-primary/70', tertiary: 'bg-accent text-white hover:bg-accent-dark', @@ -184,17 +195,16 @@ export const BUTTON_STYLES = twv.tv({ delete: 'bg-danger/80 hover:bg-danger text-white focus-visible:outline-danger focus-visible:bg-danger', icon: { - base: 'border-0 opacity-80 hover:opacity-100 focus-visible:opacity-100 text-primary', + base: 'opacity-80 hover:opacity-100 focus-visible:opacity-100', wrapper: 'w-full h-full', content: 'w-full h-full', extraClickZone: 'w-full h-full', }, ghost: 'text-primary hover:text-primary/80 hover:bg-white focus-visible:text-primary/80 focus-visible:bg-white', - submit: 'bg-invite text-white opacity-80 hover:opacity-100 focus-visible:outline-offset-2', - outline: - 'border-primary/40 text-primary hover:border-primary focus-visible:outline-offset-2 hover:bg-primary/10', - bar: 'rounded-full border-0.5 border-primary/20 transition-colors hover:bg-primary/10', + submit: 'bg-invite text-white opacity-80 hover:opacity-100', + outline: 'border-primary/40 text-primary hover:border-primary hover:bg-primary/5', + bar: 'border-primary/20 hover:bg-primary/5', }, iconPosition: { start: { content: '' }, @@ -230,7 +240,7 @@ export const BUTTON_STYLES = twv.tv({ loader: 'absolute inset-0 flex items-center justify-center', content: 'flex items-center gap-[0.5em]', text: 'inline-flex items-center justify-center gap-1', - icon: 'h-[2cap] flex-none aspect-square', + icon: 'h-[1.906cap] w-[1.906cap] flex-none aspect-square flex items-center justify-center', }, defaultVariants: { isActive: 'none', @@ -243,42 +253,16 @@ export const BUTTON_STYLES = twv.tv({ showIconOnHover: false, }, compoundVariants: [ - { isFocused: true, iconOnly: true, class: 'focus-visible:outline-offset-3' }, - { - variant: 'link', - isFocused: true, - class: 'focus-visible:outline-offset-1', - }, - { - size: 'xxsmall', - iconOnly: true, - class: { base: 'p-0 rounded-full', icon: 'h-[1.25cap] -mt-[0.1cap]' }, - }, - { - size: 'xsmall', - iconOnly: true, - class: { base: 'p-0 rounded-full', icon: 'h-[1.45cap] -mt-[0.1cap]' }, - }, - { - size: 'small', - iconOnly: true, - class: { base: 'p-0 rounded-full', icon: 'h-[1.65cap] -mt-[0.1cap]' }, - }, - { - size: 'medium', - iconOnly: true, - class: { base: 'p-0 rounded-full', icon: 'h-[2cap] -mt-[0.1cap]' }, - }, - { - size: 'large', - iconOnly: true, - class: { base: 'p-0 rounded-full', icon: 'h-[3.65cap]' }, - }, - { - size: 'hero', - class: { base: 'p-0 rounded-full', icon: 'h-[5.5cap]' }, - iconOnly: true, - }, + { isFocused: true, iconOnly: true, class: 'focus-visible:outline-offset-[3px]' }, + { size: 'custom', iconOnly: true, class: { icon: 'w-full h-full' } }, + { size: 'xxsmall', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-2.5 h-2.5' } }, + { size: 'xsmall', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-3 h-3' } }, + { size: 'small', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-3.5 h-3.5' } }, + { size: 'medium', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-4 h-4' } }, + { size: 'large', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-4.5 h-4.5' } }, + { size: 'hero', iconOnly: true, class: { base: 'p-0 rounded-full', icon: 'w-12 h-12' } }, + + { variant: 'link', isFocused: true, class: 'focus-visible:outline-offset-1' }, { variant: 'link', size: 'xxsmall', class: 'font-medium' }, { variant: 'link', size: 'xsmall', class: 'font-medium' }, { variant: 'link', size: 'small', class: 'font-medium' }, diff --git a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/CloseButton.tsx b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/CloseButton.tsx index bf8e26bff3..5c8286e8a9 100644 --- a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/CloseButton.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Button/CloseButton.tsx @@ -36,7 +36,7 @@ export function CloseButton(props: CloseButtonProps) { variant="icon" className={values => tailwindMerge.twMerge( - 'h-3 w-3 bg-primary/30 hover:bg-red-500/80 focus-visible:bg-red-500/80 focus-visible:outline-offset-1', + 'bg-primary/30 hover:bg-red-500/80 focus-visible:bg-red-500/80 focus-visible:outline-offset-1', // eslint-disable-next-line @typescript-eslint/no-unsafe-argument // @ts-expect-error ts fails to infer the type of the className prop typeof className === 'function' ? className(values) : className @@ -44,7 +44,7 @@ export function CloseButton(props: CloseButtonProps) { } tooltip={tooltip} showIconOnHover - size="custom" + size="xsmall" rounded="full" extraClickZone="medium" icon={icon} diff --git a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Text/Text.tsx b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Text/Text.tsx index 402e17128a..32b2dcd29b 100644 --- a/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Text/Text.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/AriaComponents/Text/Text.tsx @@ -27,11 +27,12 @@ export const TEXT_STYLE = twv.tv({ variants: { color: { custom: '', - primary: 'text-primary/90', + primary: 'text-primary', danger: 'text-danger', success: 'text-share', disabled: 'text-primary/30', - invert: 'text-white/80', + invert: 'text-white', + inherit: 'text-inherit', }, font: { default: '', diff --git a/app/ide-desktop/lib/dashboard/src/components/SvgMask.tsx b/app/ide-desktop/lib/dashboard/src/components/SvgMask.tsx index 1bb0004a76..9c6eacf0f1 100644 --- a/app/ide-desktop/lib/dashboard/src/components/SvgMask.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/SvgMask.tsx @@ -44,7 +44,7 @@ export default function SvgMask(props: SvgMaskProps) { ...(invert ? { WebkitMaskComposite: 'exclude, exclude' } : {}), /* eslint-enable @typescript-eslint/naming-convention */ }} - className={tailwindMerge.twMerge('inline-block size-max', className)} + className={tailwindMerge.twMerge('inline-block h-max w-max', className)} > {/* This is required for this component to have the right size. */} {alt} diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/Label.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/Label.tsx index 51f393b1e7..3770bea20d 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/Label.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/Label.tsx @@ -53,7 +53,7 @@ export default function Label(props: InternalLabelProps) { typeof childrenRaw !== 'string' ? ( childrenRaw ) : ( - + {childrenRaw} ) @@ -75,7 +75,7 @@ export default function Label(props: InternalLabelProps) { title={title} disabled={isDisabled} className={tailwindMerge.twMerge( - 'focus-child relative flex h-text items-center whitespace-nowrap rounded-inherit px-label-x transition-all selectable after:pointer-events-none after:absolute after:inset after:rounded-full', + 'focus-child relative flex items-center whitespace-nowrap rounded-inherit px-[7px] opacity-75 transition-all after:pointer-events-none after:absolute after:inset after:rounded-full hover:opacity-100 focus:opacity-100', active && 'active', negated && 'after:border-2 after:border-delete', className, diff --git a/app/ide-desktop/lib/dashboard/src/layouts/AssetSearchBar.tsx b/app/ide-desktop/lib/dashboard/src/layouts/AssetSearchBar.tsx index 697b0063a7..e2e6bf0d21 100644 --- a/app/ide-desktop/lib/dashboard/src/layouts/AssetSearchBar.tsx +++ b/app/ide-desktop/lib/dashboard/src/layouts/AssetSearchBar.tsx @@ -10,6 +10,7 @@ import * as modalProvider from '#/providers/ModalProvider' import * as textProvider from '#/providers/TextProvider' import * as aria from '#/components/aria' +import * as ariaComponents from '#/components/AriaComponents' import Label from '#/components/dashboard/Label' import FocusArea from '#/components/styled/FocusArea' import FocusRing from '#/components/styled/FocusRing' @@ -82,7 +83,7 @@ function Tags(props: InternalTagsProps) { return (
{(isCloud ? AssetQuery.tagNames : AssetQuery.localTagNames).flatMap(entry => { const [key, tag] = entry @@ -90,15 +91,17 @@ function Tags(props: InternalTagsProps) { ? [] : [ - { querySource.current = QuerySource.internal setQuery(query.add({ [key]: [[]] })) }} > {tag + ':'} - + , ] })} @@ -280,7 +283,7 @@ export default function AssetSearchBar(props: AssetSearchBarProps) { data-testid="asset-search-bar" {...aria.mergeProps()(innerProps, { className: - 'z-1 group relative flex h-row grow max-w-[60em] items-center gap-asset-search-bar rounded-full px-3 text-primary', + 'z-1 group relative flex grow max-w-[60em] items-center gap-asset-search-bar rounded-full px-1.5 py-1 text-primary', ref: rootRef, onFocus: () => { setAreSuggestionsVisible(true) @@ -297,14 +300,17 @@ export default function AssetSearchBar(props: AssetSearchBarProps) { >
-
+
+ {areSuggestionsVisible && ( -
+
{/* Tags (`name:`, `modified:`, etc.) */} {[...labels] .sort((a, b) => string.compareCaseInsensitive(a.value, b.value)) @@ -354,7 +360,7 @@ export default function AssetSearchBar(props: AssetSearchBarProps) {
)} {/* Suggestions */} -
+
{suggestions.map((suggestion, index) => ( // This should not be a `
)}
- + { if (querySource.current !== QuerySource.internal) { querySource.current = QuerySource.typing diff --git a/app/ide-desktop/lib/dashboard/src/layouts/Labels.tsx b/app/ide-desktop/lib/dashboard/src/layouts/Labels.tsx index 44a61af2a2..bc9eb981af 100644 --- a/app/ide-desktop/lib/dashboard/src/layouts/Labels.tsx +++ b/app/ide-desktop/lib/dashboard/src/layouts/Labels.tsx @@ -9,7 +9,6 @@ import * as backendHooks from '#/hooks/backendHooks' import * as modalProvider from '#/providers/ModalProvider' import * as textProvider from '#/providers/TextProvider' -import * as aria from '#/components/aria' import * as ariaComponents from '#/components/AriaComponents' import Label from '#/components/dashboard/Label' import Button from '#/components/styled/Button' @@ -132,20 +131,18 @@ export default function Labels(props: LabelsProps) { ) })} } onPress={event => { if (event.target instanceof HTMLElement) { setModal() } }} > - {/* This is a non-standard-sized icon. */} - {/* eslint-disable-next-line no-restricted-syntax */} - - {getText('newLabelButtonLabel')} + {getText('newLabelButtonLabel')}