Skip to content

Commit 57ba42e

Browse files
jhardyLuke Bowerman
andauthored
Update spacing between summary and clear button for InputSearch (#1193)
Co-authored-by: Luke Bowerman <[email protected]>
1 parent ce1565c commit 57ba42e

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Changed
2121

22+
- `InputSearch` clear button is larger and now focusable, divider and summary text spacing refined
2223
- `Icon` no longer outputs a `<title />` by default and Icon is marked with `aria-hide` unless a title is explicitly specified
2324
- `Calendar`, `FieldDate`, `FieldDateRange`, `InputDate` & `InputDateRange` now require "deep" imports
2425
- E.g.: `Calendar` imports from `@looker/components/lib/Calendar`)

packages/components/src/Form/Inputs/InputSearch/InputSearchControls.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import omit from 'lodash/omit'
2828
import React, { forwardRef, MouseEvent, Ref } from 'react'
2929
import styled from 'styled-components'
30-
import { Box } from '../../../Layout'
30+
import { Box, Space } from '../../../Layout'
3131
import { IconButton } from '../../../Button'
3232
import { Text } from '../../../Text'
3333

@@ -54,11 +54,10 @@ export const InputSearchControlsInternal = forwardRef(
5454

5555
const clear = (
5656
<IconButton
57-
size="xxsmall"
57+
size="xsmall"
5858
icon="Close"
5959
label="Clear Field"
6060
onClick={onClear}
61-
tabIndex={-1}
6261
disabled={disabled}
6362
/>
6463
)
@@ -67,36 +66,38 @@ export const InputSearchControlsInternal = forwardRef(
6766
<Box
6867
borderRight="1px solid"
6968
borderColor="ui2"
70-
height="1.5rem"
69+
height="1rem"
7170
style={{
7271
pointerEvents: 'none',
7372
}}
7473
/>
7574
)
7675

7776
return (
78-
<div {...omit(props, 'height')} ref={ref}>
77+
<Space
78+
{...omit(props, 'height')}
79+
ref={ref}
80+
gap="xsmall"
81+
flex="0"
82+
mr="xxsmall"
83+
>
7984
{summary && (
8085
<Text
81-
pr="xsmall"
82-
variant="subdued"
86+
color="text5"
8387
fontSize="small"
8488
style={{ whiteSpace: 'nowrap' }}
89+
pr="xsmall"
8590
>
8691
{summary}
8792
</Text>
8893
)}
8994
{summary && showClear && separator}
9095
{showClear && clear}
91-
</div>
96+
</Space>
9297
)
9398
}
9499
)
95100

96101
InputSearchControlsInternal.displayName = 'InputSearchControlsInternal'
97102

98-
export const InputSearchControls = styled(InputSearchControlsInternal)`
99-
align-items: center;
100-
display: flex;
101-
height: ${(props) => props.height};
102-
`
103+
export const InputSearchControls = styled(InputSearchControlsInternal)``

0 commit comments

Comments
 (0)