-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(input): add the large size for the ionic theme (#29249)
Issue number: internal --------- ## What is the current behavior? Input does not have a size property. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Adds the `size` property with support for the `"large"` size on the `"ionic"` theme only - Adds tests for the size property - Note: the screenshots will not look right until the fill styles are added ## Does this introduce a breaking change? - [ ] Yes - [x] No
- Loading branch information
1 parent
4fc3bbb
commit e965443
Showing
20 changed files
with
192 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,74 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Input - Size</title> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" | ||
/> | ||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" /> | ||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" /> | ||
<script src="../../../../../scripts/testing/scripts.js"></script> | ||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script> | ||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
<style> | ||
.grid { | ||
display: grid; | ||
grid-template-columns: repeat(2, minmax(250px, 1fr)); | ||
grid-row-gap: 20px; | ||
grid-column-gap: 20px; | ||
} | ||
|
||
h2 { | ||
font-size: 12px; | ||
font-weight: normal; | ||
|
||
color: #6f7378; | ||
|
||
margin-top: 10px; | ||
} | ||
|
||
@media screen and (max-width: 800px) { | ||
.grid { | ||
grid-template-columns: 1fr; | ||
padding: 0; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Input - Size</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content id="content" class="ion-padding"> | ||
<div class="grid"> | ||
<div class="grid-item"> | ||
<h2>No Fill: No Size</h2> | ||
<ion-input label="Email"></ion-input> | ||
</div> | ||
|
||
<div class="grid-item"> | ||
<h2>Outline: No Size</h2> | ||
<ion-input fill="outline" label="Email"></ion-input> | ||
</div> | ||
|
||
<div class="grid-item"> | ||
<h2>No Fill: Large Size</h2> | ||
<ion-input size="large" label="Email"></ion-input> | ||
</div> | ||
|
||
<div class="grid-item"> | ||
<h2>Outline: Large Size</h2> | ||
<ion-input size="large" fill="outline" label="Email"></ion-input> | ||
</div> | ||
</div> | ||
</ion-content> | ||
</ion-app> | ||
</body> | ||
</html> |
This file contains 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,78 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
/** | ||
* Size is only available in the Ionic theme | ||
*/ | ||
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
test.describe(title('input: size'), () => { | ||
test.describe('input: size large', () => { | ||
test('should not have visual regressions', async ({ page }) => { | ||
await page.setContent( | ||
` | ||
<ion-input | ||
size="large" | ||
label="Email" | ||
value="hi@ionic.io" | ||
></ion-input> | ||
`, | ||
config | ||
); | ||
|
||
const input = page.locator('ion-input'); | ||
await expect(input).toHaveScreenshot(screenshot(`input-size-large`)); | ||
}); | ||
test('should render correctly with floating label', async ({ page }) => { | ||
await page.setContent( | ||
` | ||
<ion-input | ||
size="large" | ||
label="Email" | ||
label-placement="floating" | ||
value="hi@ionic.io" | ||
></ion-input> | ||
`, | ||
config | ||
); | ||
|
||
const input = page.locator('ion-input'); | ||
await expect(input).toHaveScreenshot(screenshot(`input-size-large-label-floating`)); | ||
}); | ||
test('should not have visual regressions with fill outline', async ({ page }) => { | ||
await page.setContent( | ||
` | ||
<ion-input | ||
fill="outline" | ||
size="large" | ||
label="Email" | ||
label-placement="floating" | ||
value="hi@ionic.io" | ||
></ion-input> | ||
`, | ||
config | ||
); | ||
|
||
const input = page.locator('ion-input'); | ||
await expect(input).toHaveScreenshot(screenshot(`input-size-large-outline`)); | ||
}); | ||
test('should not have visual regressions with fill outline and round shape', async ({ page }) => { | ||
await page.setContent( | ||
` | ||
<ion-input | ||
fill="outline" | ||
shape="round" | ||
size="large" | ||
label="Email" | ||
label-placement="floating" | ||
value="hi@ionic.io" | ||
></ion-input> | ||
`, | ||
config | ||
); | ||
|
||
const input = page.locator('ion-input'); | ||
await expect(input).toHaveScreenshot(screenshot(`input-size-large-outline-round`)); | ||
}); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+2.23 KB
...ut.e2e.ts-snapshots/input-size-large-ionic-md-ltr-light-Mobile-Chrome-linux.png
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.54 KB
...t.e2e.ts-snapshots/input-size-large-ionic-md-ltr-light-Mobile-Firefox-linux.png
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.84 KB
...ut.e2e.ts-snapshots/input-size-large-ionic-md-ltr-light-Mobile-Safari-linux.png
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.14 KB
...hots/input-size-large-label-floating-ionic-md-ltr-light-Mobile-Chrome-linux.png
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.47 KB
...ots/input-size-large-label-floating-ionic-md-ltr-light-Mobile-Firefox-linux.png
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.75 KB
...hots/input-size-large-label-floating-ionic-md-ltr-light-Mobile-Safari-linux.png
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.14 KB
...s-snapshots/input-size-large-outline-ionic-md-ltr-light-Mobile-Chrome-linux.png
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.47 KB
...-snapshots/input-size-large-outline-ionic-md-ltr-light-Mobile-Firefox-linux.png
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.75 KB
...s-snapshots/input-size-large-outline-ionic-md-ltr-light-Mobile-Safari-linux.png
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.14 KB
...shots/input-size-large-outline-round-ionic-md-ltr-light-Mobile-Chrome-linux.png
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.47 KB
...hots/input-size-large-outline-round-ionic-md-ltr-light-Mobile-Firefox-linux.png
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.75 KB
...shots/input-size-large-outline-round-ionic-md-ltr-light-Mobile-Safari-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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