Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SearchBox): Add Search Box #863

Merged
merged 138 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
95cb070
Base search box
gretanausedaite Dec 19, 2022
8929ed4
Merge branch 'main' into greta/search-box
gretanausedaite Dec 19, 2022
882f11d
Merge branch 'main' into greta/search-box
gretanausedaite Dec 20, 2022
8a49012
Testing new class
gretanausedaite Dec 20, 2022
c07b993
testing flex container
gretanausedaite Dec 21, 2022
6b283fa
add message - will delete later
gretanausedaite Dec 21, 2022
7f745b5
moving around to pass build
gretanausedaite Dec 21, 2022
c9af329
add disabled
gretanausedaite Dec 21, 2022
7c69749
Move utils mixins to utils
gretanausedaite Dec 21, 2022
2be98ef
testing components
gretanausedaite Dec 22, 2022
ffcf724
Merge remote-tracking branch 'origin/main' into greta/search-box
gretanausedaite Dec 30, 2022
1231d61
Add react component
gretanausedaite Dec 30, 2022
df4353c
testing
gretanausedaite Jan 2, 2023
9961fae
Merge branch 'main' into greta/search-box
gretanausedaite Jan 4, 2023
26d761a
Added props to start and end adornments
gretanausedaite Jan 5, 2023
568eca4
testing sized and status
gretanausedaite Jan 5, 2023
d3f3290
Merge branch 'main' into greta/search-box
gretanausedaite Jan 6, 2023
82a12cf
Merge branch 'main' into greta/search-box
gretanausedaite Jan 12, 2023
c7f88e2
Merge branch 'main' into greta/search-box
gretanausedaite Jan 12, 2023
d8970f5
Merge branch 'main' into greta/search-box
gretanausedaite Jan 16, 2023
b1ac9aa
Added Icon support.
gretanausedaite Jan 16, 2023
78ff398
CSS tests
gretanausedaite Jan 17, 2023
be20c44
Basic searchbox tests
gretanausedaite Jan 17, 2023
3851578
Merge branch 'main' into greta/search-box
gretanausedaite Jan 18, 2023
a40919a
some adjustments
gretanausedaite Jan 18, 2023
d9473d1
Update ids
gretanausedaite Jan 18, 2023
47e1587
Merge branch 'main' into greta/search-box
gretanausedaite Jan 23, 2023
bb69962
Add changeset files
gretanausedaite Jan 24, 2023
0ddd014
Trying animations
gretanausedaite Jan 26, 2023
57e3d3f
Searchbox styles
gretanausedaite Jan 30, 2023
ed60055
Testing expandable
gretanausedaite Jan 30, 2023
fa4d346
Merge branch 'main' into greta/search-box
gretanausedaite Jan 30, 2023
861efb1
Merge branch 'main' into greta/search-box
gretanausedaite Jan 30, 2023
7dd3b01
Merge branch 'main' into greta/search-box
gretanausedaite Feb 1, 2023
a75587c
Merge branch 'main' into greta/search-box
gretanausedaite Feb 2, 2023
76f502e
Animation added
gretanausedaite Feb 2, 2023
3e988f7
Merge branch 'main' into greta/search-box
gretanausedaite Feb 3, 2023
686d32d
Merge branch 'main' into greta/search-box
gretanausedaite Feb 6, 2023
5c8bad7
Add some storybook tests
gretanausedaite Feb 6, 2023
9ba39b6
Vertical divider and tests
gretanausedaite Feb 6, 2023
d5c4d71
Merge branch 'main' into greta/search-box
gretanausedaite Feb 6, 2023
31ee322
Not export flex container
gretanausedaite Feb 6, 2023
4e77b47
lost image
gretanausedaite Feb 6, 2023
cf19cd7
Merge branch 'main' into greta/search-box
gretanausedaite Feb 13, 2023
3e4e7ee
Trying to fix css
gretanausedaite Feb 13, 2023
883e8a4
hiding buttons
gretanausedaite Feb 13, 2023
89ae98d
Merge branch 'main' into greta/search-box
gretanausedaite Feb 15, 2023
23b1451
Reorder stories and playing with toggle
gretanausedaite Feb 15, 2023
4e15305
Merge branch 'main' into greta/search-box
gretanausedaite Feb 20, 2023
45468bb
Merge branch 'main' into greta/search-box
gretanausedaite Mar 1, 2023
ea9f14b
Merge branch 'main' into greta/search-box
gretanausedaite Mar 7, 2023
14ac6a8
Merge branch 'main' into greta/search-box
gretanausedaite Mar 22, 2023
811bee0
rework
gretanausedaite Mar 24, 2023
3dbc629
Merge branch 'main' into greta/search-box
gretanausedaite Mar 27, 2023
eebf884
focus styles
gretanausedaite Mar 27, 2023
ecc74d0
Merge branch 'main' into greta/search-box
gretanausedaite Mar 30, 2023
9c9547d
Add status and disabled state
gretanausedaite Mar 30, 2023
3e4dd33
Merge branch 'main' into greta/search-box
gretanausedaite Apr 4, 2023
d781be5
Trying to make it work
gretanausedaite Apr 4, 2023
16b0f10
Merge branch 'main' into greta/search-box
gretanausedaite Apr 5, 2023
7d7f8cf
Trying to make expandable search more intuitive
gretanausedaite Apr 5, 2023
5950b20
Merge branch 'main' into greta/search-box
gretanausedaite Apr 11, 2023
af21292
Trying to make it work
gretanausedaite Apr 12, 2023
59baa9d
Seachbox component
gretanausedaite Apr 12, 2023
0acb3a9
CSS and poly fix
gretanausedaite Apr 12, 2023
e8eb10f
Merge branch 'main' into greta/search-box
gretanausedaite Apr 13, 2023
bd95812
searchbox-comment solve
gretanausedaite Apr 17, 2023
cb2fc4e
Cleanup playground
gretanausedaite Apr 18, 2023
fb608a9
Almost working - need ux input
gretanausedaite Apr 18, 2023
ef5e0db
Visual test updates
gretanausedaite Apr 19, 2023
440d683
Merge branch 'main' into greta/search-box
gretanausedaite Apr 21, 2023
7aef676
Removing type search and status classnames
gretanausedaite Apr 21, 2023
2560879
Merge branch 'main' into greta/search-box
gretanausedaite Apr 24, 2023
9d66121
Manage disabled state
gretanausedaite Apr 24, 2023
e81b1b3
Removing focus within functionality
gretanausedaite Apr 26, 2023
977628a
Remove focus at all
gretanausedaite Apr 26, 2023
fce7c08
Merge branch 'main' into greta/search-box
gretanausedaite Apr 26, 2023
df23f24
more fluid animation
gretanausedaite Apr 27, 2023
6f46336
images update
gretanausedaite Apr 28, 2023
11bb937
Adding bit of tests
gretanausedaite Apr 28, 2023
43dd40b
Merge branch 'main' into greta/search-box
gretanausedaite Apr 28, 2023
b37235a
Update changesets
gretanausedaite Apr 28, 2023
e46b7b6
clean images
gretanausedaite Apr 28, 2023
2ef1f84
Merge branch 'main' into greta/search-box
gretanausedaite May 2, 2023
d2026a2
Collapsed state focus fix?
gretanausedaite May 2, 2023
1708bfd
image update
gretanausedaite May 2, 2023
03947c5
css disabled fix
gretanausedaite May 2, 2023
09469a0
Undo disabled tests
gretanausedaite May 2, 2023
fa5276d
update react images
gretanausedaite May 2, 2023
79d2c6a
Merge branch 'main' into greta/search-box
gretanausedaite May 2, 2023
4ec1b39
Rename disabled to isDisabled
gretanausedaite May 3, 2023
7dbd3f4
Status border fix
gretanausedaite May 3, 2023
8dce1dc
Add docs page
gretanausedaite May 3, 2023
ea019a4
Some comments solving
gretanausedaite May 3, 2023
529a120
Stories update
gretanausedaite May 3, 2023
1627c28
Merge branch 'main' into greta/search-box
gretanausedaite May 3, 2023
7447493
Tests fix
gretanausedaite May 4, 2023
d5f43b5
Merge branch 'main' into greta/search-box
gretanausedaite May 4, 2023
59288c5
Expand/collapse rename
gretanausedaite May 4, 2023
5daa300
Merge branch 'main' into greta/search-box
gretanausedaite May 4, 2023
4ec3f85
Removed size prop extract and comments
gretanausedaite May 4, 2023
b943575
Merge branch 'main' into greta/search-box
gretanausedaite May 5, 2023
35bbdae
UID to useEffect
gretanausedaite May 5, 2023
ac90702
Update animation speed
gretanausedaite May 5, 2023
fc54211
Linter fix
gretanausedaite May 5, 2023
aee70e3
Merge branch 'main' into greta/search-box
gretanausedaite May 5, 2023
e8b6fa2
Co-authored-by: Mayank <[email protected]>
gretanausedaite May 5, 2023
dfec34a
Added comments
gretanausedaite May 5, 2023
ce247e9
Remove docs page - will work on that next time
gretanausedaite May 5, 2023
c9fcca8
React unit tests
gretanausedaite May 8, 2023
bf04c98
Storybook update
gretanausedaite May 8, 2023
c909192
Css update
gretanausedaite May 8, 2023
64aab6f
Storybook update
gretanausedaite May 8, 2023
1814968
Add aria-label to searchbox container?
gretanausedaite May 8, 2023
9454fb2
Fix changeset
gretanausedaite May 8, 2023
dc84257
css changeset update
gretanausedaite May 8, 2023
13d7d15
Remove type from args
gretanausedaite May 8, 2023
f25aa62
Added code comments in css
gretanausedaite May 8, 2023
465734c
Update conditions
gretanausedaite May 8, 2023
f6dee6d
Undo aria-label
gretanausedaite May 8, 2023
672d524
Removed comments that was unuseful
gretanausedaite May 8, 2023
7af9688
Merge branch 'main' into greta/search-box
gretanausedaite May 9, 2023
7fa02ac
Moving files around after merge
gretanausedaite May 9, 2023
0e76826
update icon css a bit
gretanausedaite May 9, 2023
e5a17fe
change icon margin and switch position
gretanausedaite May 9, 2023
8be14a9
Merge branch 'main' into greta/search-box
gretanausedaite May 9, 2023
dda7e13
Fixed import and modified previous changeset
gretanausedaite May 9, 2023
1890bbf
Merge branch 'main' into greta/search-box
gretanausedaite May 9, 2023
27a5eee
Icon margin update
gretanausedaite May 9, 2023
aa166d7
aesthetic changes
mayank99 May 9, 2023
147b049
non-aesthetic changes
mayank99 May 9, 2023
955dd6f
oopsie
mayank99 May 9, 2023
18e7ddc
update images
mayank99 May 9, 2023
987fe64
setInputId comment
gretanausedaite May 10, 2023
6fcb109
Rename var to margin
gretanausedaite May 10, 2023
4e9c5e1
Add new class and fix margin
gretanausedaite May 10, 2023
35d819c
Merge branch 'main' into greta/search-box
gretanausedaite May 10, 2023
af08a63
Merge branch 'main' into greta/search-box
gretanausedaite May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@
.iui-input-flex-container {
mayank99 marked this conversation as resolved.
Show resolved Hide resolved
@include iui-input-flex-container;
mayank99 marked this conversation as resolved.
Show resolved Hide resolved
@include iui-input-flex-size();
// To match borderless button left padding + border
--_iui-flex-input-icon-padding: 10px;

&[data-iui-size='small'] {
@include iui-input-flex-size(small);
// To match small borderless button left padding + border
--_iui-flex-input-icon-padding: 5px;
}

&[data-iui-size='large'] {
@include iui-input-flex-size(large);
// To match large borderless button left padding + border
--_iui-flex-input-icon-padding: 16px;
mayank99 marked this conversation as resolved.
Show resolved Hide resolved
}

@each $status in positive, warning, negative {
Expand Down
6 changes: 1 addition & 5 deletions packages/itwinui-css/src/searchbox/searchbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
margin: 0 var(--iui-size-s);

&:is(:first-child) {
margin: 0 var(--iui-size-xs) 0 var(--iui-size-s);
}

&[data-iui-icon-size='s'] {
margin: 0 var(--iui-size-2xs) 0 var(--iui-size-xs);
margin: 0 var(--_iui-flex-input-icon-padding, 10px); // To match borderless button left padding + border
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ it.each(['small', 'large'] as const)(
'should render SearchBox with %s size',
(size) => {
const { container } = render(<SearchBox size={size} />);
const iconSize = size === 'small' ? 's' : 'l';

// Base flex container
const searchbox = container.querySelector('.iui-input-flex-container');
Expand All @@ -74,7 +73,6 @@ it.each(['small', 'large'] as const)(
// Search icon
const searchIcon = searchbox?.querySelector('.iui-svg-icon');
expect(searchIcon).toBeTruthy();
expect(searchIcon).toHaveAttribute('data-iui-icon-size', iconSize);
},
);

Expand Down
2 changes: 0 additions & 2 deletions packages/itwinui-react/src/core/SearchBox/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,11 @@ SearchBoxExpandedState.displayName = 'SearchBox.ExpandedState';

const SearchBoxIcon = React.forwardRef((props, ref) => {
const { className, children, ...rest } = props;
const { size: sizeContext } = useSafeContext(SearchBoxContext);

return (
<Icon
aria-hidden
className={cx('iui-search-icon', className)}
size={sizeContext}
Copy link
Contributor

@mayank99 mayank99 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Before Now
small icon medium icon

edit: Greta said it is to match borderless button which uses 16x16 icon even with small size

ref={ref}
{...rest}
>
Expand Down