Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
66f7231
feat(textarea): add default textarea styles
brandyscarney Aug 16, 2024
98bdc88
fix(textarea): add proper structure, padding and spacing
brandyscarney Aug 16, 2024
e55e4e2
style: lint
brandyscarney Aug 16, 2024
66f4adb
feat(textarea): add size property with default set to medium
brandyscarney Aug 16, 2024
25ae1a1
test(textarea): add test for sizes
brandyscarney Aug 16, 2024
ab46a02
fix(textarea): move padding and spacing to all fills
brandyscarney Aug 16, 2024
91a5823
chore(): add updated snapshots
brandyscarney Aug 16, 2024
ee00a2d
chore: build
brandyscarney Aug 16, 2024
2f7e2a7
Merge branch 'next' into ROU-10916
brandyscarney Aug 16, 2024
1db5bbc
docs(textarea): improve size description
brandyscarney Aug 19, 2024
e54fb4d
fix(textarea): separate common and native styles
brandyscarney Aug 19, 2024
74d9fb9
chore(): add updated snapshots
Ionitron Aug 19, 2024
f4b7bc3
refactor(textarea): more cleanup between common and native
brandyscarney Aug 19, 2024
4947747
style: remove escapes
brandyscarney Aug 19, 2024
9a46466
style: lint
brandyscarney Aug 19, 2024
694242b
fix(textarea): use min height to autogrow
brandyscarney Aug 19, 2024
2273735
feat(textarea): add sm and lg sizes for ionic theme
brandyscarney Aug 19, 2024
f852a85
test(textarea): update size test to include sm and lg
brandyscarney Aug 19, 2024
630c12f
chore(): add updated snapshots
brandyscarney Aug 19, 2024
f82126a
style: lint
brandyscarney Aug 19, 2024
cff97fa
test(textarea): update basic test
brandyscarney Aug 19, 2024
1b3fc07
fix(textarea): allow height to collapse to use the true min height
brandyscarney Aug 19, 2024
6df45be
Merge branch 'ROU-10916' into ROU-10917
brandyscarney Aug 19, 2024
9fe763a
chore(): add updated snapshots
brandyscarney Aug 19, 2024
ea98cf3
style(textarea): remove unused files, fix imports
brandyscarney Aug 20, 2024
9e3ff8b
test(textarea): remove round shape
brandyscarney Aug 20, 2024
559a6f3
fix(textarea): use space var for textarea margin
brandyscarney Aug 20, 2024
e6d53fb
fix(textarea): use tokens and properly position slotted content
brandyscarney Aug 20, 2024
56b58ee
style: lint
brandyscarney Aug 20, 2024
f5d0725
chore(): add updated snapshots
brandyscarney Aug 20, 2024
303c134
fix(textarea): properly grow and shrink based on auto-grow
brandyscarney Aug 20, 2024
aceb60b
Merge branch 'ROU-10916' into ROU-10917
brandyscarney Aug 21, 2024
06abd94
test(textarea): remove round shape from size test
brandyscarney Aug 21, 2024
548d51b
docs(textarea): improve size description
brandyscarney Aug 21, 2024
e9da9ba
Merge branch 'next' into ROU-10917
brandyscarney Aug 21, 2024
1e2d23b
chore(): add updated snapshots
Ionitron Aug 21, 2024
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
4 changes: 2 additions & 2 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3621,7 +3621,7 @@ export namespace Components {
*/
"shape"?: 'round';
/**
* The size of the textarea. If "large", it will have an increased height. By default the size is "medium". This property only applies to the `"ionic"` theme.
* The size of the textarea. If "large" it will increase the height of the textarea, while "small" and "medium" provide progressively smaller heights. The default size is "medium". This property only applies to the `"ionic"` theme.
*/
"size"?: 'small' | 'medium' | 'large';
/**
Expand Down Expand Up @@ -8981,7 +8981,7 @@ declare namespace LocalJSX {
*/
"shape"?: 'round';
/**
* The size of the textarea. If "large", it will have an increased height. By default the size is "medium". This property only applies to the `"ionic"` theme.
* The size of the textarea. If "large" it will increase the height of the textarea, while "small" and "medium" provide progressively smaller heights. The default size is "medium". This property only applies to the `"ionic"` theme.
*/
"size"?: 'small' | 'medium' | 'large';
/**
Expand Down
61 changes: 54 additions & 7 deletions core/src/components/textarea/test/size/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,70 @@
<ion-content id="content" class="ion-padding">
<div class="grid">
<div class="grid-item">
<h2>No Fill: No Size</h2>
<ion-textarea label="Label" label-placement="stacked" placeholder="Placeholder"></ion-textarea>
<h2>Outline: Small Size</h2>
<ion-textarea
size="small"
fill="outline"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>

<div class="grid-item">
<h2>Outline: No Size</h2>
<ion-textarea fill="outline" label="Label" label-placement="stacked"></ion-textarea>
<h2>Outline: Small Size, Round Shape</h2>
<ion-textarea
size="small"
fill="outline"
shape="round"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>

<div class="grid-item">
<h2>No Fill: No Size, Round Shape</h2>
<ion-textarea shape="round" label="Label" label-placement="stacked"></ion-textarea>
<h2>Outline: No Size</h2>
<ion-textarea
fill="outline"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>

<div class="grid-item">
<h2>Outline: No Size, Round Shape</h2>
<ion-textarea fill="outline" shape="round" label="Label" label-placement="stacked"></ion-textarea>
<ion-textarea
fill="outline"
shape="round"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>

<div class="grid-item">
<h2>Outline: Large Size</h2>
<ion-textarea
size="large"
fill="outline"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>

<div class="grid-item">
<h2>Outline: Large Size, Round Shape</h2>
<ion-textarea
size="large"
fill="outline"
shape="round"
label="Label"
label-placement="stacked"
placeholder="Placeholder"
></ion-textarea>
</div>
</div>
</ion-content>
Expand Down
102 changes: 102 additions & 0 deletions core/src/components/textarea/test/size/textarea.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,57 @@ import { configs, test } from '@utils/test/playwright';
*/
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: size'), () => {
test.describe('textarea: size small', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<ion-textarea
size="small"
label="Email"
value="hi@ionic.io"
></ion-textarea>
`,
config
);

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

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

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-size-small-outline`));
});
});

test.describe('textarea: size medium', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
Expand Down Expand Up @@ -53,5 +104,56 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
await expect(textarea).toHaveScreenshot(screenshot(`textarea-size-medium-outline`));
});
});

test.describe('textarea: size large', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<ion-textarea
size="large"
label="Email"
value="hi@ionic.io"
></ion-textarea>
`,
config
);

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

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

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-size-large-outline`));
});
});
});
});
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 23 additions & 4 deletions core/src/components/textarea/textarea.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
--placeholder-color: #{globals.$ionic-color-neutral-800};
--placeholder-opacity: 1;
--background: #{globals.$ionic-color-base-white};
--padding-top: #{globals.$ionic-space-300};
--padding-end: #{globals.$ionic-space-400};
--padding-bottom: #{globals.$ionic-space-300};
--padding-start: #{globals.$ionic-space-400};

@include globals.typography(globals.$ionic-body-md-regular);
}
Expand All @@ -30,10 +26,33 @@
height: 0;
}

:host(.textarea-size-small) .textarea-wrapper-inner {
--padding-top: #{globals.$ionic-space-200};
--padding-end: #{globals.$ionic-space-300};
--padding-bottom: #{globals.$ionic-space-200};
--padding-start: #{globals.$ionic-space-300};

min-height: globals.$ionic-scale-2800;
}

:host(.textarea-size-medium) .textarea-wrapper-inner {
--padding-top: #{globals.$ionic-space-300};
--padding-end: #{globals.$ionic-space-400};
--padding-bottom: #{globals.$ionic-space-300};
--padding-start: #{globals.$ionic-space-400};

min-height: globals.$ionic-scale-3400;
}

:host(.textarea-size-large) .textarea-wrapper-inner {
--padding-top: #{globals.$ionic-space-400};
--padding-end: #{globals.$ionic-space-500};
--padding-bottom: #{globals.$ionic-space-400};
--padding-start: #{globals.$ionic-space-500};

min-height: globals.$ionic-scale-3600;
}

// Textarea Wrapper
// ----------------------------------------------------------------

Expand Down
5 changes: 3 additions & 2 deletions core/src/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ export class Textarea implements ComponentInterface {
@Prop() shape?: 'round';

/**
* The size of the textarea. If "large", it will have an increased height. By default the
* size is "medium". This property only applies to the `"ionic"` theme.
* The size of the textarea. If "large" it will increase the height of the textarea, while
* "small" and "medium" provide progressively smaller heights. The default size is "medium".
* This property only applies to the `"ionic"` theme.
*/
@Prop() size?: 'small' | 'medium' | 'large' = 'medium';

Expand Down