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(search): "medium-sized" search input height #4237

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion packages/components/src/components/search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Use these modifiers with `.bx--search` class.
| Name | Description |
| -------------------- | -------------------------------------------- |
| `.bx--search--sm` | Selector for applying small search styles |
| `.bx--search--lg` | Selector for applying standard search styles |
| `.bx--search--lg` | Selector for applying medium search styles |
| `.bx--search--xl` | Selector for applying standard search styles |
| `.bx--search--light` | Selector for applying light search styles |

### JavaScript
Expand Down
14 changes: 14 additions & 0 deletions packages/components/src/components/search/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
height: rem(32px);
}

.#{$prefix}--search--lg .#{$prefix}--search-input {
@include type-style('body-short-02');
height: rem(40px);
}

.#{$prefix}--search--xl .#{$prefix}--search-input {
@include type-style('body-short-02');
height: rem(48px);
Expand Down Expand Up @@ -203,6 +208,14 @@
}
}

.#{$prefix}--search--lg {
.#{$prefix}--search-close,
~ .#{$prefix}--search-button {
height: rem(40px);
width: rem(40px);
}
}

.#{$prefix}--search--xl {
.#{$prefix}--search-close,
~ .#{$prefix}--search-button {
Expand All @@ -216,6 +229,7 @@
opacity: 0;
}

.#{$prefix}--search--xl.#{$prefix}--skeleton .#{$prefix}--search-input,
.#{$prefix}--search--lg.#{$prefix}--skeleton .#{$prefix}--search-input,
.#{$prefix}--search--sm.#{$prefix}--skeleton .#{$prefix}--search-input {
@include skeleton;
Expand Down
27 changes: 27 additions & 0 deletions packages/components/src/components/search/search.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ module.exports = {
suffix: 'xl',
},
},
{
name: 'large',
label: 'Medium search',
notes: `
Search enables users to specify a word or a phrase to find particular relevant pieces of content
without the use of navigation. Search can be used as the primary means of discovering content,
or as a filter to aid the user in finding content. With the medium version, the search field will be
slightly smaller.
`,
context: {
suffix: 'lg',
},
},
{
name: 'small',
label: 'Small search',
Expand All @@ -53,6 +66,20 @@ module.exports = {
light: true,
},
},
{
name: 'large-light',
label: 'Medium search (Light)',
notes: `
Search enables users to specify a word or a phrase to find particular relevant pieces of content
without the use of navigation. Search can be used as the primary means of discovering content,
or as a filter to aid the user in finding content. With the medium version, the search field will be
slightly smaller.
`,
context: {
suffix: 'lg',
light: true,
},
},
{
name: 'small-light',
label: 'Small search (Light)',
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/components/search/search.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<button class="{{@root.prefix}}--search-close {{@root.prefix}}--search-close--hidden" title="Clear search
input" aria-label="Clear search input">
{{#is suffix "sm"}}{{ carbon-icon 'Close16' class=(add @root.prefix '--search-clear') }}{{/is}}
{{#is suffix "lg"}}{{ carbon-icon 'Close16' class=(add @root.prefix '--search-clear') }}{{/is}}
{{#is suffix "xl"}}{{ carbon-icon 'Close20' class=(add @root.prefix '--search-clear') }}{{/is}}
</button>
</div>
Expand Down