-
Notifications
You must be signed in to change notification settings - Fork 13.4k
refactor(searchbar): update default styles for ionic theme #29917
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
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2f6cf04
refactor(searchbar): update default styles for ionic theme
thetaPC 37d101e
Merge branch 'next' of github.com:ionic-team/ionic-framework into ROU…
thetaPC 2f857fa
test(searchbar): update snapshots
thetaPC 8cbd786
chore(searchbar): run build
thetaPC 4579aa8
test(searchbar): add snapshots for focus ring buttons
thetaPC 8841115
test(searchbar): add snapshots for focus
thetaPC 12afd4a
test(searchbar): move disabled test to states folder
thetaPC bedac25
test(searchbar): add todo to test page
thetaPC bc30669
test(searchbar): uncomment style
thetaPC 781c533
refactor(searchbar): combine styles
thetaPC 81fde1f
Update core/src/components/searchbar/searchbar.ionic.scss
thetaPC 8eb7331
refactor(searchbar): change variable name
thetaPC 682b233
refactor(searchbar): switch token
thetaPC 127027c
refactor(searchbar): correct hover styles
thetaPC 614bf7b
Merge branch 'next' into ROU-11197
brandyscarney 739abe1
refactor(searchbar): remove vars file
thetaPC 8d25e94
Merge branch 'next' into ROU-11197
brandyscarney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => | |
| }); | ||
| }); | ||
|
|
||
| configs().forEach(({ title, screenshot, config }) => { | ||
| configs({ modes: ['md', 'ios', 'ionic-md'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('searchbar: rendering'), () => { | ||
| test('should render searchbar', async ({ page }) => { | ||
| await page.setContent( | ||
|
|
@@ -143,19 +143,6 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | |
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-color`)); | ||
| }); | ||
|
|
||
| test('should render disabled searchbar', async ({ page }) => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this to the states test folder. |
||
| await page.setContent( | ||
| ` | ||
| <ion-searchbar disabled="true"></ion-searchbar> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| const searchbar = page.locator('ion-searchbar'); | ||
|
|
||
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-disabled`)); | ||
| }); | ||
|
|
||
| test('should render custom search icon', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
|
|
@@ -199,7 +186,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c | |
| }); | ||
| }); | ||
|
|
||
| configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| configs({ modes: ['md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('searchbar: cancel button alignment'), () => { | ||
| test('should align with the back button when used in a toolbar', async ({ page }, testInfo) => { | ||
| testInfo.annotations.push({ | ||
|
|
||
Binary file added
BIN
+3.05 KB
...napshots/searchbar-back-button-align-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.97 KB
...apshots/searchbar-back-button-align-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.06 KB
...napshots/searchbar-back-button-align-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.72 KB
...r.e2e.ts-snapshots/searchbar-buttons-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.05 KB
....e2e.ts-snapshots/searchbar-buttons-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.69 KB
...r.e2e.ts-snapshots/searchbar-buttons-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.7 KB
...r.e2e.ts-snapshots/searchbar-buttons-ionic-md-rtl-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.04 KB
....e2e.ts-snapshots/searchbar-buttons-ionic-md-rtl-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.69 KB
...r.e2e.ts-snapshots/searchbar-buttons-ionic-md-rtl-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-2.11 KB
...c/searchbar.e2e.ts-snapshots/searchbar-disabled-ios-ltr-Mobile-Chrome-linux.png
Binary file not shown.
Binary file removed
BIN
-2.23 KB
.../searchbar.e2e.ts-snapshots/searchbar-disabled-ios-ltr-Mobile-Firefox-linux.png
Binary file not shown.
Binary file removed
BIN
-2 KB
...ic/searchbar.e2e.ts-snapshots/searchbar-disabled-md-ltr-Mobile-Chrome-linux.png
Binary file not shown.
Binary file removed
BIN
-2.27 KB
...c/searchbar.e2e.ts-snapshots/searchbar-disabled-md-ltr-Mobile-Firefox-linux.png
Binary file not shown.
Binary file removed
BIN
-1.81 KB
...ic/searchbar.e2e.ts-snapshots/searchbar-disabled-md-ltr-Mobile-Safari-linux.png
Binary file not shown.
Binary file added
BIN
+1.89 KB
...searchbar.e2e.ts-snapshots/searchbar-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.23 KB
...earchbar.e2e.ts-snapshots/searchbar-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.91 KB
...searchbar.e2e.ts-snapshots/searchbar-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.87 KB
...searchbar.e2e.ts-snapshots/searchbar-ionic-md-rtl-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.23 KB
...earchbar.e2e.ts-snapshots/searchbar-ionic-md-rtl-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.89 KB
...searchbar.e2e.ts-snapshots/searchbar-ionic-md-rtl-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions
86
core/src/components/searchbar/test/states/searchbar.e2e.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { configs, test } from '@utils/test/playwright'; | ||
|
|
||
| /** | ||
| * This behavior does not vary across directions. | ||
| */ | ||
| configs({ modes: ['md', 'ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('searchbar: disabled'), () => { | ||
| test('should render disabled searchbar', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
| <ion-searchbar disabled="true"></ion-searchbar> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| const searchbar = page.locator('ion-searchbar'); | ||
|
|
||
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-state-disabled`)); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| /** | ||
| * This behavior is only applicable to the `ionic-md` mode. | ||
| * This behavior does not vary across directions. | ||
| */ | ||
| configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('searchbar: focused'), () => { | ||
| test('should render focus ring on the component', async ({ page, pageUtils }) => { | ||
| await page.setContent( | ||
| ` | ||
| <style> | ||
| /* Add padding to the container to prevent the focus ring from being clipped */ | ||
| #container { | ||
| padding: 5px; | ||
| } | ||
| </style> | ||
|
|
||
| <div id="container"> | ||
| <ion-searchbar></ion-searchbar> | ||
| </div> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| await pageUtils.pressKeys('Tab'); // Focused on the input | ||
|
|
||
| const container = page.locator('#container'); | ||
|
|
||
| await expect(container).toHaveScreenshot(screenshot(`searchbar-state-focused`)); | ||
| }); | ||
|
|
||
| test('should render focus ring on the cancel button', async ({ page, pageUtils }) => { | ||
| await page.setContent( | ||
| ` | ||
| <ion-searchbar show-cancel-button="always"></ion-searchbar> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| await pageUtils.pressKeys('Tab'); // Focused on the input | ||
| await pageUtils.pressKeys('Tab'); // Focused on the cancel button | ||
|
|
||
| const searchbar = page.locator('ion-searchbar'); | ||
|
|
||
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-state-focused-cancel-button`)); | ||
| }); | ||
|
|
||
| test('should render focus ring on the clear button', async ({ page, pageUtils }) => { | ||
| await page.setContent( | ||
| ` | ||
| <ion-searchbar show-clear-button="always" value="Filled text"></ion-searchbar> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| await pageUtils.pressKeys('Tab'); // Focused on the input | ||
| await pageUtils.pressKeys('Tab'); // Focused on the clear button | ||
|
|
||
| const searchbar = page.locator('ion-searchbar'); | ||
|
|
||
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-state-focused-clear-button`)); | ||
| }); | ||
| }); | ||
| }); |
Binary file added
BIN
+1.73 KB
...s-snapshots/searchbar-state-disabled-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.07 KB
...-snapshots/searchbar-state-disabled-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.73 KB
...s-snapshots/searchbar-state-disabled-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.92 KB
...chbar.e2e.ts-snapshots/searchbar-state-disabled-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.26 KB
...hbar.e2e.ts-snapshots/searchbar-state-disabled-ios-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+1.89 KB
...rchbar.e2e.ts-snapshots/searchbar-state-disabled-md-ltr-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.26 KB
...chbar.e2e.ts-snapshots/searchbar-state-disabled-md-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+1.78 KB
...rchbar.e2e.ts-snapshots/searchbar-state-disabled-md-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.06 KB
...earchbar-state-focused-cancel-button-ionic-md-ltr-light-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.48 KB
...archbar-state-focused-cancel-button-ionic-md-ltr-light-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.03 KB
...earchbar-state-focused-cancel-button-ionic-md-ltr-light-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.27 KB
...searchbar-state-focused-clear-button-ionic-md-ltr-light-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.83 KB
...earchbar-state-focused-clear-button-ionic-md-ltr-light-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.4 KB
...searchbar-state-focused-clear-button-ionic-md-ltr-light-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.63 KB
...ts-snapshots/searchbar-state-focused-ionic-md-ltr-light-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+3.3 KB
...s-snapshots/searchbar-state-focused-ionic-md-ltr-light-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.63 KB
...ts-snapshots/searchbar-state-focused-ionic-md-ltr-light-Mobile-Safari-linux.png
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.