Rework workspace header

This commit is contained in:
Gregory Schier
2023-11-06 10:42:59 -08:00
parent 0a5d71ecc2
commit cd06a72d6f
10 changed files with 160 additions and 137 deletions

View File

@@ -51,6 +51,7 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
() =>
classNames(
className,
'max-w-full min-w-0', // Help with truncation
'whitespace-nowrap outline-none',
'flex-shrink-0 flex items-center',
'focus-visible-or-class:ring rounded-md',

View File

@@ -115,7 +115,7 @@ export const Dropdown = forwardRef<DropdownRef, DropdownProps>(function Dropdown
const windowSize = useWindowSize();
const triggerRect = useMemo(() => {
windowSize; // Make TS happy with this dep
if (!windowSize) return null; // No-op to TS happy with this dep
if (!open) return null;
return buttonRef.current?.getBoundingClientRect();
}, [open, windowSize]);
@@ -368,6 +368,7 @@ function MenuItem({ className, focused, onFocus, item, onSelect, ...props }: Men
tabIndex={-1}
onMouseEnter={(e) => e.currentTarget.focus()}
onMouseLeave={(e) => e.currentTarget.blur()}
disabled={item.disabled}
onFocus={handleFocus}
onClick={handleClick}
justify="start"

View File

@@ -6,6 +6,11 @@
* {
@apply cursor-text;
@apply caret-transparent !important;
}
.cm-cursor {
@apply border-gray-800 !important;
}
&.cm-focused {
@@ -17,7 +22,7 @@
}
.cm-line {
@apply text-gray-800 caret-gray-800 pl-1 pr-1.5;
@apply text-gray-800 pl-1 pr-1.5;
}
.cm-placeholder {
@@ -159,7 +164,7 @@
@apply h-full flex items-center;
/* Break characters on line wrapping mode, useful for URL field.
* We can make this dynamic if we need it to be configurable later
* We can make this dynamic if we need it to be configurable later
*/
&.cm-lineWrapping {
@apply break-all;