mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
B: Fix search bar width
This commit is contained in:
parent
19bb037e68
commit
c4e829871e
|
@ -2,9 +2,6 @@ import clsx from 'clsx';
|
||||||
|
|
||||||
import { IconSearch } from '@/components/icons';
|
import { IconSearch } from '@/components/icons';
|
||||||
import { type Styling } from '@/components/props';
|
import { type Styling } from '@/components/props';
|
||||||
|
|
||||||
import { TextInput } from './text-input';
|
|
||||||
|
|
||||||
interface SearchBarProps extends Styling {
|
interface SearchBarProps extends Styling {
|
||||||
/** Id of the search bar. */
|
/** Id of the search bar. */
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -39,20 +36,23 @@ export function SearchBar({
|
||||||
...restProps
|
...restProps
|
||||||
}: SearchBarProps) {
|
}: SearchBarProps) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('relative flex items-center', className)} {...restProps}>
|
<div className={clsx('relative flex items-center grow', className)} {...restProps}>
|
||||||
{!noIcon ? (
|
{!noIcon ? (
|
||||||
<IconSearch className='absolute -top-0.5 left-2 translate-y-1/2 cc-search-icon' size='1.25rem' />
|
<IconSearch className='absolute -top-0.5 left-2 translate-y-1/2 cc-search-icon' size='1.25rem' />
|
||||||
) : null}
|
) : null}
|
||||||
<TextInput
|
<input
|
||||||
id={id}
|
id={id}
|
||||||
noOutline
|
|
||||||
transparent
|
|
||||||
placeholder={placeholder}
|
|
||||||
type='search'
|
type='search'
|
||||||
className={clsx('bg-transparent', !noIcon && 'pl-8')}
|
className={clsx(
|
||||||
noBorder={noBorder}
|
'min-w-0 py-2',
|
||||||
|
'leading-tight truncate hover:text-clip',
|
||||||
|
'bg-transparent',
|
||||||
|
!noIcon && 'pl-8',
|
||||||
|
!noBorder && 'border px-3'
|
||||||
|
)}
|
||||||
value={query}
|
value={query}
|
||||||
onChange={event => onChangeQuery?.(event.target.value)}
|
onChange={event => onChangeQuery?.(event.target.value)}
|
||||||
|
placeholder={placeholder}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
/* ========= shadcn theme ============ */
|
/* ========= shadcn theme ============ */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--radius: 0.625rem;
|
/* --radius: 0.625rem; */
|
||||||
|
|
||||||
--background: oklch(100% 0 0deg);
|
--background: oklch(100% 0 0deg);
|
||||||
--foreground: oklch(14.5% 0 0deg);
|
--foreground: oklch(14.5% 0 0deg);
|
||||||
|
@ -155,10 +155,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@theme inline {
|
@theme inline {
|
||||||
--radius-sm: calc(var(--radius) - 4px);
|
/* --radius-sm: calc(var(--radius) - 4px);
|
||||||
--radius-md: calc(var(--radius) - 2px);
|
--radius-md: calc(var(--radius) - 2px);
|
||||||
--radius-lg: var(--radius);
|
--radius-lg: var(--radius);
|
||||||
--radius-xl: calc(var(--radius) + 4px);
|
--radius-xl: calc(var(--radius) + 4px); */
|
||||||
|
|
||||||
--color-background: var(--background);
|
--color-background: var(--background);
|
||||||
--color-foreground: var(--foreground);
|
--color-foreground: var(--foreground);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user