@vaadin/text-area 25.0.0-alpha1 → 25.0.0-alpha11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/text-area",
3
- "version": "25.0.0-alpha1",
3
+ "version": "25.0.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,7 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "theme",
25
24
  "vaadin-*.d.ts",
26
25
  "vaadin-*.js",
27
26
  "web-types.json",
@@ -35,23 +34,23 @@
35
34
  ],
36
35
  "dependencies": {
37
36
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.0.0-alpha1",
39
- "@vaadin/component-base": "25.0.0-alpha1",
40
- "@vaadin/field-base": "25.0.0-alpha1",
41
- "@vaadin/input-container": "25.0.0-alpha1",
42
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
43
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
37
+ "@vaadin/a11y-base": "25.0.0-alpha11",
38
+ "@vaadin/component-base": "25.0.0-alpha11",
39
+ "@vaadin/field-base": "25.0.0-alpha11",
40
+ "@vaadin/input-container": "25.0.0-alpha11",
41
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha11",
44
42
  "lit": "^3.0.0"
45
43
  },
46
44
  "devDependencies": {
47
- "@vaadin/chai-plugins": "25.0.0-alpha1",
48
- "@vaadin/test-runner-commands": "25.0.0-alpha1",
49
- "@vaadin/testing-helpers": "^1.1.0",
45
+ "@vaadin/chai-plugins": "25.0.0-alpha11",
46
+ "@vaadin/test-runner-commands": "25.0.0-alpha11",
47
+ "@vaadin/testing-helpers": "^2.0.0",
48
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha11",
50
49
  "sinon": "^18.0.0"
51
50
  },
52
51
  "web-types": [
53
52
  "web-types.json",
54
53
  "web-types.lit.json"
55
54
  ],
56
- "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
55
+ "gitHead": "abfd315ba5a7484a613e0768635a4e8fe945a44b"
57
56
  }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const textAreaStyles = css`
10
+ [part='input-field'] {
11
+ overflow: auto;
12
+ scroll-padding: var(--vaadin-input-field-padding, var(--vaadin-padding-container));
13
+ }
14
+
15
+ ::slotted(textarea) {
16
+ resize: none;
17
+ white-space: pre-wrap;
18
+ }
19
+
20
+ [part='input-field'] ::slotted(:not(textarea)),
21
+ [part='clear-button'] {
22
+ align-self: flex-start;
23
+ position: sticky;
24
+ top: 0;
25
+ }
26
+
27
+ /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
28
+ :host([disabled]) ::slotted(textarea) {
29
+ user-select: none;
30
+ }
31
+ `;
@@ -11,9 +11,10 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
13
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
14
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
14
15
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
16
+ import { textAreaStyles } from './styles/vaadin-text-area-base-styles.js';
15
17
  import { TextAreaMixin } from './vaadin-text-area-mixin.js';
16
- import { textAreaStyles } from './vaadin-text-area-styles.js';
17
18
 
18
19
  /**
19
20
  * `<vaadin-text-area>` is a web component for multi-line text input.
@@ -61,7 +62,7 @@ import { textAreaStyles } from './vaadin-text-area-styles.js';
61
62
  * @mixes TextAreaMixin
62
63
  * @mixes ThemableMixin
63
64
  */
64
- export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
65
+ export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
65
66
  static get is() {
66
67
  return 'vaadin-text-area';
67
68
  }
@@ -1,3 +1,3 @@
1
- import './theme/lumo/vaadin-text-area.js';
1
+ import './src/vaadin-text-area.js';
2
2
 
3
3
  export * from './src/vaadin-text-area.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/text-area",
4
- "version": "25.0.0-alpha1",
4
+ "version": "25.0.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-text-area",
11
- "description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha11/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/text-area",
4
- "version": "25.0.0-alpha1",
4
+ "version": "25.0.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-text-area",
19
- "description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-text-area>` is a web component for multi-line text input.\n\n```html\n<vaadin-text-area label=\"Comment\"></vaadin-text-area>\n```\n\n### Prefixes and suffixes\n\nThese are child elements of a `<vaadin-text-area>` that are displayed\ninline with the input, before or after.\nIn order for an element to be considered as a prefix, it must have the slot\nattribute set to `prefix` (and similarly for `suffix`).\n\n```html\n<vaadin-text-area label=\"Description\">\n <div slot=\"prefix\">Details:</div>\n <div slot=\"suffix\">The end!</div>\n</vaadin-text-area>\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-text-area>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha11/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -1,64 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const textAreaStyles = css`
9
- .vaadin-text-area-container {
10
- flex: auto;
11
- }
12
-
13
- /* The label, helper text and the error message should neither grow nor shrink. */
14
- [part='label'],
15
- [part='helper-text'],
16
- [part='error-message'] {
17
- flex: none;
18
- }
19
-
20
- [part='input-field'] {
21
- flex: auto;
22
- overflow: auto;
23
- -webkit-overflow-scrolling: touch;
24
- }
25
-
26
- ::slotted(textarea) {
27
- -webkit-appearance: none;
28
- -moz-appearance: none;
29
- flex: auto;
30
- overflow: hidden;
31
- width: 100%;
32
- height: 100%;
33
- outline: none;
34
- resize: none;
35
- margin: 0;
36
- padding: 0 0.25em;
37
- border: 0;
38
- border-radius: 0;
39
- min-width: 0;
40
- font: inherit;
41
- font-size: 1em;
42
- line-height: normal;
43
- color: inherit;
44
- background-color: transparent;
45
- /* Disable default invalid style in Firefox */
46
- box-shadow: none;
47
- }
48
-
49
- /* Override styles from <vaadin-input-container> */
50
- [part='input-field'] ::slotted(textarea) {
51
- align-self: stretch;
52
- white-space: pre-wrap;
53
- box-sizing: border-box;
54
- }
55
-
56
- [part='input-field'] ::slotted(:not(textarea)) {
57
- align-self: flex-start;
58
- }
59
-
60
- /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
61
- :host([disabled]) ::slotted(textarea) {
62
- user-select: none;
63
- }
64
- `;
@@ -1,9 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/color.js';
8
- import '@vaadin/vaadin-lumo-styles/sizing.js';
9
- import '@vaadin/vaadin-lumo-styles/typography.js';
@@ -1,80 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/color.js';
8
- import '@vaadin/vaadin-lumo-styles/sizing.js';
9
- import '@vaadin/vaadin-lumo-styles/typography.js';
10
- import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
11
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
-
13
- const textArea = css`
14
- [part='input-field'],
15
- [part='input-field'] ::slotted(textarea) {
16
- height: auto;
17
- box-sizing: border-box;
18
- min-height: 0;
19
- }
20
-
21
- [part='input-field'] {
22
- /* Equal to the implicit padding in vaadin-text-field */
23
- padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
24
- padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
25
- transition: background-color 0.1s;
26
- line-height: var(--lumo-line-height-s);
27
- }
28
-
29
- :host(:not([readonly])) [part='input-field']::after {
30
- display: none;
31
- }
32
-
33
- :host([readonly]) [part='input-field'] {
34
- border: var(--vaadin-input-field-readonly-border, 1px dashed var(--lumo-contrast-30pct));
35
- }
36
-
37
- :host([readonly]) [part='input-field']::after {
38
- border: none;
39
- }
40
-
41
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {
42
- background-color: var(--lumo-contrast-20pct);
43
- }
44
-
45
- @media (pointer: coarse) {
46
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part='input-field'] {
47
- background-color: var(--lumo-contrast-10pct);
48
- }
49
-
50
- :host(:active:not([readonly]):not([focused])) [part='input-field'] {
51
- background-color: var(--lumo-contrast-20pct);
52
- }
53
- }
54
-
55
- [part='input-field'] ::slotted(textarea) {
56
- line-height: inherit;
57
- --_lumo-text-field-overflow-mask-image: none;
58
- }
59
-
60
- /* Use sticky positioning to keep prefix/suffix/clear button visible when scrolling textarea container */
61
- [part='input-field'] ::slotted([slot$='fix']),
62
- [part='clear-button'] {
63
- position: sticky;
64
- top: 0;
65
- align-self: flex-start;
66
- }
67
-
68
- [part='input-field'] ::slotted(vaadin-icon[slot$='fix']),
69
- [part='clear-button'] {
70
- /* Vertically align icon prefix/suffix/clear button with the first line of text */
71
- top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
72
- margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
73
- /* Reduce effective height to match line height of native textarea, so icons don't increase component size when using single row */
74
- margin-bottom: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
75
- }
76
- `;
77
-
78
- registerStyles('vaadin-text-area', [inputFieldShared, textArea], {
79
- moduleId: 'lumo-text-area',
80
- });
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-text-area-styles.js';
7
- import '../../src/vaadin-text-area.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-text-area-styles.js';
7
- import '../../src/vaadin-text-area.js';