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(input): add ionic theme styles and size property #29380

Open
wants to merge 39 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4fc3bbb
feat(input): add ionic theme (#29247)
brandyscarney Apr 1, 2024
e965443
feat(input): add the large size for the ionic theme (#29249)
brandyscarney Apr 3, 2024
3a1e70d
fix(input): update helper text color for ionic theme (#29269)
thetaPC Apr 4, 2024
5b62a1e
fix(input): update error text color for ionic theme (#29270)
thetaPC Apr 4, 2024
ca59d6c
chore(): sync with next branch (#29299)
amandaejohnston Apr 8, 2024
bb516f0
feat(input): add outline appearance for stacked label to ionic theme …
amandaejohnston Apr 9, 2024
c6b7dfe
Merge remote-tracking branch 'origin/next' into sp/ROU-4848-sync
sean-perkins Apr 10, 2024
3d7b669
Merge branch 'sp/ROU-4848-sync' into ROU-4848
sean-perkins Apr 10, 2024
96e5b2b
fix(input) match invalid state to ionic design (#29291)
thetaPC Apr 11, 2024
c30d685
feat(input): add hover state to the ionic theme (#29313)
brandyscarney Apr 11, 2024
67ec745
fix(input): match valid state to ionic design (#29277)
thetaPC Apr 11, 2024
6e45fef
test(input): change size tests to use stacked label placements (#29334)
amandaejohnston Apr 15, 2024
3b0f3af
fix(input): add disabled state to the ionic theme (#29323)
thetaPC Apr 15, 2024
cb71258
feat(input): add styles for round shape to ionic theme (#29329)
amandaejohnston Apr 16, 2024
ac102cf
feat(input): add styles for clear action to ionic theme (#29337)
amandaejohnston Apr 16, 2024
930f275
fix(input): add focused state for ionic theme (#29342)
thetaPC Apr 17, 2024
d7eb539
Merge branch 'next' into ROU-4848
brandyscarney Apr 23, 2024
c6127e9
chore(input): lint styles and add TODO for future work
brandyscarney Apr 23, 2024
c855add
Merge branch 'next' into ROU-4848
brandyscarney Apr 24, 2024
e0dfb61
feat(input): add item highlight for ionic theme (#29395)
sean-perkins Apr 29, 2024
4a4d447
fix(input): match medium size for ionic theme (#29403)
thetaPC Apr 30, 2024
09a0e6e
Merge branch 'next' into chore-sync-ROU-4848-next
brandyscarney May 3, 2024
5c7a782
chore(git): sync with next (#29454)
brandyscarney May 3, 2024
2eb1dbd
fix(input): add focus ring to the clear input button for ionic theme …
thetaPC May 3, 2024
0e792e6
fix(input): use correct padding for large (#29447)
thetaPC May 3, 2024
fd14ddf
fix(input): match design for xlarge size (#29446)
thetaPC May 3, 2024
7333376
fix(input): implement default shape for ionic theme (#29469)
thetaPC May 8, 2024
e17db2c
test(input): remove the .only within fill (#29478)
thetaPC May 9, 2024
75333c0
feat(input): add rectangular shape for the ionic theme (#29476)
brandyscarney May 9, 2024
c1bba3b
feat(input): add soft shape for ionic theme (#29477)
thetaPC May 9, 2024
8515c4e
fix(input): only apply the shape to the outline fill in ionic theme (…
brandyscarney May 10, 2024
09935fd
feat(input): add the readonly styles for the ionic theme (#29483)
brandyscarney May 10, 2024
ef7a454
chore(): add updated snapshots (#29492)
brandyscarney May 13, 2024
24c0bc3
Merge branch 'next' into chore-rou-4848-next
brandyscarney May 13, 2024
7a7a688
chore(git): update from next (#29495)
brandyscarney May 13, 2024
310bde6
Merge remote-tracking branch 'origin/next' into chore-sync-rou-4848-w…
thetaPC May 15, 2024
916d8a4
chore(git): sync next (#29511)
thetaPC May 16, 2024
bf8dfdb
feat(input): add styles for counter text on ionic theme (#29516)
brandyscarney May 17, 2024
7a4843b
fix(input): adjust colors, padding, fonts & heights for ionic theme (…
brandyscarney May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/api.txt
Expand Up @@ -629,7 +629,7 @@ ion-input,prop,placeholder,string | undefined,undefined,false,false
ion-input,prop,readonly,boolean,false,false,true
ion-input,prop,required,boolean,false,false,false
ion-input,prop,shape,"round" | undefined,undefined,false,false
ion-input,prop,size,"large" | undefined,undefined,false,false
ion-input,prop,size,"large" | "medium" | undefined,'medium',false,false
ion-input,prop,spellcheck,boolean,false,false,false
ion-input,prop,step,string | undefined,undefined,false,false
ion-input,prop,theme,"ios" | "md" | "ionic",undefined,false,false
Expand Down
8 changes: 4 additions & 4 deletions core/src/components.d.ts
Expand Up @@ -1475,9 +1475,9 @@ export namespace Components {
*/
"shape"?: 'round';
/**
* The size of the input. If "large", it will have an increased height. By default the size is unset. This property only applies to the `"ionic"` theme.
* The size of the input. If "large", it will have an increased height. By default the size is medium. This property only applies to the `"ionic"` theme.
*/
"size"?: 'large';
"size"?: 'medium' | 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
Expand Down Expand Up @@ -6747,9 +6747,9 @@ declare namespace LocalJSX {
*/
"shape"?: 'round';
/**
* The size of the input. If "large", it will have an increased height. By default the size is unset. This property only applies to the `"ionic"` theme.
* The size of the input. If "large", it will have an increased height. By default the size is medium. This property only applies to the `"ionic"` theme.
*/
"size"?: 'large';
"size"?: 'medium' | 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
Expand Down
36 changes: 36 additions & 0 deletions core/src/components/input/input.ionic.scss
Expand Up @@ -19,10 +19,46 @@
// Ionic Input Sizes
// --------------------------------------------------

:host(.input-size-medium) .native-wrapper {
min-height: 40px;
}

:host(.input-size-large) .native-wrapper {
min-height: 48px;
}

// Target area
// --------------------------------------------------
:host .native-wrapper::after {
@include position(50%, 0, null, 0);

position: absolute;

height: 100%;
min-height: 48px;

transform: translateY(-50%);

content: "";

// Cursor should match the native input when hovering over the target area.
cursor: text;

z-index: 1;
}

::slotted([slot="start"]),
::slotted([slot="end"]),
.input-clear-icon {
/**
* The target area has a z-index of 1, so the slotted elements
* should be higher. Otherwise, the slotted elements will not
* be interactable. This is especially important for the clear
* button, which should be clickable.
*/
z-index: 2;
}

// Input Clear Button
// ----------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions core/src/components/input/input.tsx
Expand Up @@ -263,9 +263,9 @@ export class Input implements ComponentInterface {

/**
* The size of the input. If "large", it will have an increased height. By default the
* size is unset. This property only applies to the `"ionic"` theme.
* size is medium. This property only applies to the `"ionic"` theme.
*/
@Prop() size?: 'large';
@Prop() size?: 'medium' | 'large' = 'medium';
brandyscarney marked this conversation as resolved.
Show resolved Hide resolved

/**
* The type of control to display. The default type is text.
Expand Down
12 changes: 12 additions & 0 deletions core/src/components/input/test/size/index.html
Expand Up @@ -58,6 +58,18 @@ <h2>Outline: No Size</h2>
<ion-input fill="outline" label="Email"></ion-input>
</div>

<div class="grid-item">
<h2>No Fill: No Size, Round Shape</h2>
<ion-input shape="round" label="Email"></ion-input>
</div>

<div class="grid-item">
<h2>Outline: No Size, Round Shape</h2>
<ion-input fill="outline" shape="round" label="Email"></ion-input>
</div>
</div>

<div class="grid">
<div class="grid-item">
<h2>No Fill: Large Size</h2>
<ion-input size="large" label="Email"></ion-input>
Expand Down
65 changes: 65 additions & 0 deletions core/src/components/input/test/size/input.e2e.ts
Expand Up @@ -6,6 +6,71 @@ import { configs, test } from '@utils/test/playwright';
*/
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('input: size'), () => {
test.describe('input: size medium', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<ion-input
label="Email"
value="hi@ionic.io"
></ion-input>
`,
config
);

const input = page.locator('ion-input');
await expect(input).toHaveScreenshot(screenshot(`input-size-medium`));
});
test('should render correctly with stacked label', async ({ page }) => {
await page.setContent(
`
<ion-input
label="Email"
label-placement="stacked"
value="hi@ionic.io"
></ion-input>
`,
config
);

const input = page.locator('ion-input');
await expect(input).toHaveScreenshot(screenshot(`input-size-medium-label-stacked`));
});
test('should not have visual regressions with fill outline', async ({ page }) => {
await page.setContent(
`
<ion-input
fill="outline"
label="Email"
label-placement="stacked"
value="hi@ionic.io"
></ion-input>
`,
config
);

const input = page.locator('ion-input');
await expect(input).toHaveScreenshot(screenshot(`input-size-medium-outline`));
});
test('should not have visual regressions with fill outline and round shape', async ({ page }) => {
await page.setContent(
`
<ion-input
fill="outline"
shape="round"
label="Email"
label-placement="stacked"
value="hi@ionic.io"
></ion-input>
`,
config
);

const input = page.locator('ion-input');
await expect(input).toHaveScreenshot(screenshot(`input-size-medium-outline-round`));
});
});

test.describe('input: size large', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.