diff --git a/browser/CHANGELOG.md b/browser/CHANGELOG.md index 8675963dc..d536275f0 100644 --- a/browser/CHANGELOG.md +++ b/browser/CHANGELOG.md @@ -8,6 +8,7 @@ This changelog covers all five packages, as they are (for now) updated as a whol - [#981](https://github.com/atomicdata-dev/atomic-server/issues/981) Fix bug where the service worker would not update cache with updated code. - [#989](https://github.com/atomicdata-dev/atomic-server/issues/989) Added an edit button to the resource selector inputs. +- [#992](https://github.com/atomicdata-dev/atomic-server/issues/992) Fix Searchbox overflowing when displaying long names. ### @tomic/cli diff --git a/browser/data-browser/src/components/Collapse.tsx b/browser/data-browser/src/components/Collapse.tsx index e261e61c3..43d4b6aab 100644 --- a/browser/data-browser/src/components/Collapse.tsx +++ b/browser/data-browser/src/components/Collapse.tsx @@ -52,7 +52,10 @@ const GridCollapser = styled.div` display: grid; grid-template-rows: ${({ open }) => (open ? '1fr' : '0fr')}; grid-template-columns: 100%; - transition: grid-template-rows ${() => ANIMATION_DURATION()}ms ease-in-out; + transition: + grid-template-rows ${() => ANIMATION_DURATION()}ms ease-in-out, + // In some cases, a margin is added. This needs to animate as well. + margin-top ${() => ANIMATION_DURATION()}ms ease-in-out; @media (prefers-reduced-motion) { transition: unset; diff --git a/browser/data-browser/src/components/Containers.tsx b/browser/data-browser/src/components/Containers.tsx index 117a3f37d..673276ae9 100644 --- a/browser/data-browser/src/components/Containers.tsx +++ b/browser/data-browser/src/components/Containers.tsx @@ -1,24 +1,27 @@ -import { styled } from 'styled-components'; +import { css, styled } from 'styled-components'; +import { LAYOUT_CONTAINER } from '../helpers/containers'; -/** Centered column */ -export const ContainerNarrow = styled.div` - width: min(100%, ${props => props.theme.containerWidth}rem); +const common = css` margin: auto; - padding: ${props => props.theme.margin}rem; - // Extra space for the navbar below + padding: ${p => p.theme.size()}; + container: ${LAYOUT_CONTAINER} / inline-size; padding-bottom: 10rem; `; +/** Centered column */ +export const ContainerNarrow = styled.div` + width: min(100%, ${p => p.theme.containerWidth}rem); + ${common} +`; + export const ContainerWide = styled.div` - width: min(100%, ${props => props.theme.containerWidthWide}); - margin: auto; - padding: ${props => props.theme.margin}rem; - // Extra space for the navbar below - padding-bottom: 10rem; + width: min(100%, ${p => p.theme.containerWidthWide}); + ${common} `; /** Full-page wrapper */ export const ContainerFull = styled.div` - padding: ${props => props.theme.margin}rem; + container: ${LAYOUT_CONTAINER} / inline-size; + padding: ${p => p.theme.size()}; padding-bottom: 10rem; `; diff --git a/browser/data-browser/src/components/Dialog/index.tsx b/browser/data-browser/src/components/Dialog/index.tsx index abd95948c..9e70549b3 100644 --- a/browser/data-browser/src/components/Dialog/index.tsx +++ b/browser/data-browser/src/components/Dialog/index.tsx @@ -16,6 +16,7 @@ import { import { useDialog } from './useDialog'; import { useControlLock } from '../../hooks/useControlLock'; import { useDialogGlobalContext } from './DialogGlobalContextProvider'; +import { DIALOG_CONTENT_CONTAINER } from '../../helpers/containers'; export interface InternalDialogProps { show: boolean; @@ -216,16 +217,19 @@ const DialogContentSlot = styled(Slot)` overflow-y: visible; /* The main section should leave room for the footer */ max-height: calc(80vh - 8rem); - padding-bottom: ${({ theme }) => theme.margin}rem; + padding-bottom: ${p => p.theme.size()}; // Position the scrollbar against the side of the dialog without any spacing inbetween. // This also fixes ugly horizontal shadow cutoff. - margin-inline: -${p => p.theme.margin}rem; - padding-inline: ${p => p.theme.margin}rem; + margin-inline: -${p => p.theme.size()}; + padding-inline: ${p => p.theme.size()}; + + container: ${DIALOG_CONTENT_CONTAINER} / inline-size; + scrollbar-gutter: stable; `; const DialogActionsSlot = styled(Slot)` display: flex; - gap: ${p => p.theme.margin}rem; + gap: ${p => p.theme.size()}; align-items: center; justify-content: flex-end; border-top: 1px solid ${props => props.theme.colors.bg2}; @@ -238,7 +242,7 @@ const StyledInnerDialog = styled.div` grid-template-rows: 1fr auto auto; gap: 1rem; grid-template-areas: 'title close' 'content content' 'actions actions'; - max-block-size: calc(100vh - ${p => p.theme.margin}rem * 2); + max-block-size: calc(100vh - ${p => p.theme.size()} * 2); `; const fadeInForground = keyframes` @@ -264,18 +268,17 @@ const fadeInBackground = keyframes` `; const StyledDialog = styled.dialog<{ $width?: CSS.Property.Width }>` - --animation-speed: 500ms; --dialog-width: min(90vw, ${p => p.$width ?? '60ch'}); ${VAR_DIALOG_INNER_WIDTH}: calc( - var(--dialog-width) - 2 * ${p => p.theme.margin}rem + var(--dialog-width) - 2 * ${p => p.theme.size()} ); box-sizing: border-box; inset: 0px; position: relative; z-index: ${p => p.theme.zIndex.dialog}; - padding: ${props => props.theme.margin}rem; + padding: ${p => p.theme.size()}; color: ${props => props.theme.colors.text}; background-color: ${props => props.theme.colors.bg}; border-radius: ${props => props.theme.radius}; diff --git a/browser/data-browser/src/components/forms/FilePicker/SelectedFileLayout.tsx b/browser/data-browser/src/components/forms/FilePicker/SelectedFileLayout.tsx index 3179afd84..45117bb4f 100644 --- a/browser/data-browser/src/components/forms/FilePicker/SelectedFileLayout.tsx +++ b/browser/data-browser/src/components/forms/FilePicker/SelectedFileLayout.tsx @@ -20,7 +20,7 @@ export function SelectedFileLayout({ }: PropsWithChildren): React.JSX.Element { return ( - + {title} {!disabled && ( @@ -35,7 +35,8 @@ export function SelectedFileLayout({ } const Title = styled.span` - flex: 1; + overflow: hidden; + text-overflow: ellipsis; `; const Wrapper = styled.div` diff --git a/browser/data-browser/src/components/forms/InputStyles.tsx b/browser/data-browser/src/components/forms/InputStyles.tsx index 8f4a6c2c7..c4d5ec39e 100644 --- a/browser/data-browser/src/components/forms/InputStyles.tsx +++ b/browser/data-browser/src/components/forms/InputStyles.tsx @@ -5,6 +5,11 @@ export const FieldStyled = styled.div` margin-bottom: ${props => props.theme.size()}; border: none; background-color: none; + + // Removes default 1px margin on fieldset. + &:is(fieldset) { + margin-inline: 0; + } `; export const LabelWrapper = styled.div` diff --git a/browser/data-browser/src/components/forms/ResourceForm.tsx b/browser/data-browser/src/components/forms/ResourceForm.tsx index 78ea28dc7..ebeb47dcd 100644 --- a/browser/data-browser/src/components/forms/ResourceForm.tsx +++ b/browser/data-browser/src/components/forms/ResourceForm.tsx @@ -240,11 +240,6 @@ export function ResourceForm({