@limetech/lime-elements 36.3.1-next.1 → 36.3.1-next.2

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.
Files changed (56) hide show
  1. package/dist/cjs/{checkbox.template-ac867c17.js → checkbox.template-60ed3ee2.js} +1 -2
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
  4. package/dist/cjs/limel-chip-set.cjs.entry.js +6 -16
  5. package/dist/cjs/limel-helper-line.cjs.entry.js +48 -0
  6. package/dist/cjs/limel-input-field.cjs.entry.js +4 -20
  7. package/dist/cjs/limel-list_2.cjs.entry.js +2 -2
  8. package/dist/cjs/limel-menu-list.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-select.cjs.entry.js +3 -4
  10. package/dist/cjs/limel-slider.cjs.entry.js +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +1 -0
  13. package/dist/collection/components/checkbox/checkbox.css +8 -92
  14. package/dist/collection/components/checkbox/checkbox.template.js +1 -1
  15. package/dist/collection/components/chip-set/chip-set.css +4 -18
  16. package/dist/collection/components/chip-set/chip-set.js +5 -15
  17. package/dist/collection/components/helper-line/helper-line.css +30 -0
  18. package/dist/collection/components/helper-line/helper-line.js +167 -0
  19. package/dist/collection/components/input-field/input-field.css +3 -15
  20. package/dist/collection/components/input-field/input-field.js +3 -19
  21. package/dist/collection/components/list/list.css +16 -184
  22. package/dist/collection/components/menu-list/menu-list.css +16 -185
  23. package/dist/collection/components/select/select.css +10 -40
  24. package/dist/collection/components/select/select.template.js +2 -2
  25. package/dist/collection/components/slider/slider.css +6 -33
  26. package/dist/collection/components/slider/slider.js +1 -1
  27. package/dist/esm/{checkbox.template-fc7fcd06.js → checkbox.template-4ce8d92f.js} +1 -2
  28. package/dist/esm/lime-elements.js +1 -1
  29. package/dist/esm/limel-checkbox.entry.js +2 -2
  30. package/dist/esm/limel-chip-set.entry.js +6 -16
  31. package/dist/esm/limel-helper-line.entry.js +44 -0
  32. package/dist/esm/limel-input-field.entry.js +4 -20
  33. package/dist/esm/limel-list_2.entry.js +2 -2
  34. package/dist/esm/limel-menu-list.entry.js +1 -1
  35. package/dist/esm/limel-select.entry.js +3 -4
  36. package/dist/esm/limel-slider.entry.js +2 -2
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/lime-elements/lime-elements.esm.js +1 -1
  39. package/dist/lime-elements/p-094dd76a.entry.js +126 -0
  40. package/dist/lime-elements/p-20059fcf.entry.js +82 -0
  41. package/dist/lime-elements/p-2600928f.entry.js +1 -0
  42. package/dist/lime-elements/{p-157e0417.entry.js → p-4c9ce3d7.entry.js} +2 -2
  43. package/dist/lime-elements/{p-eed2a202.entry.js → p-6b8142ba.entry.js} +5 -5
  44. package/dist/lime-elements/p-803cc4b7.entry.js +1 -0
  45. package/dist/lime-elements/{p-d955c169.entry.js → p-8acabe02.entry.js} +1 -1
  46. package/dist/lime-elements/p-ba7661f6.entry.js +1 -0
  47. package/dist/lime-elements/{p-1af8258b.js → p-d2a3d50b.js} +1 -1
  48. package/dist/types/components/chip-set/chip-set.d.ts +1 -2
  49. package/dist/types/components/helper-line/helper-line.d.ts +58 -0
  50. package/dist/types/components/input-field/input-field.d.ts +0 -2
  51. package/dist/types/components.d.ts +53 -0
  52. package/package.json +5 -5
  53. package/dist/lime-elements/p-142910d8.entry.js +0 -126
  54. package/dist/lime-elements/p-73613abb.entry.js +0 -82
  55. package/dist/lime-elements/p-d0084a70.entry.js +0 -1
  56. package/dist/lime-elements/p-ff0e407a.entry.js +0 -1
@@ -34,24 +34,14 @@ export class ChipSet {
34
34
  this.dropZoneTip = () => {
35
35
  return translate.get('file.drag-and-drop-tips', this.language);
36
36
  };
37
- this.renderHelperLine = () => {
38
- if (!this.hasHelperText()) {
39
- return;
40
- }
41
- return (h("div", { tabIndex: -1, class: "mdc-text-field-helper-line" }, this.renderHelperText()));
37
+ this.hasHelperText = () => {
38
+ return this.helperText !== null && this.helperText !== undefined;
42
39
  };
43
- this.renderHelperText = () => {
44
- if (!this.hasHelperText()) {
40
+ this.renderHelperLine = () => {
41
+ if (!this.maxItems && !this.hasHelperText()) {
45
42
  return;
46
43
  }
47
- const classList = {
48
- 'mdc-text-field-helper-text': true,
49
- 'mdc-text-field-helper-text--validation-msg': this.isInvalid(),
50
- };
51
- return h("p", { class: classList }, this.helperText);
52
- };
53
- this.hasHelperText = () => {
54
- return this.helperText !== null && this.helperText !== undefined;
44
+ return (h("limel-helper-line", { length: this.value.length, maxLength: this.maxItems, helperText: this.helperText, invalid: this.isInvalid() }));
55
45
  };
56
46
  this.clearAllChipsLabel = () => {
57
47
  return translate.get('chip-set.clear-all', this.language);
@@ -0,0 +1,30 @@
1
+ :host(limel-helper-line) {
2
+ transition: opacity 0.2s ease;
3
+ box-sizing: border-box;
4
+ display: none;
5
+ justify-content: space-between;
6
+ gap: 0.75rem;
7
+ padding: 0.125rem 1rem 0 1rem;
8
+ min-width: 0;
9
+ font-family: Roboto, sans-serif;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ -webkit-font-smoothing: antialiased;
12
+ font-size: 0.6875rem;
13
+ font-weight: 400;
14
+ letter-spacing: 0.0333333333em;
15
+ line-height: normal;
16
+ color: rgb(var(--contrast-1200));
17
+ }
18
+
19
+ :host(limel-helper-line.show) {
20
+ display: flex;
21
+ }
22
+
23
+ :host(limel-helper-line.invalid) .helper-text {
24
+ color: var(--mdc-theme-error);
25
+ }
26
+
27
+ .counter {
28
+ flex-shrink: 0;
29
+ margin-left: auto;
30
+ }
@@ -0,0 +1,167 @@
1
+ import { Host, h } from '@stencil/core';
2
+ /**
3
+ * This is an internal and private component that many input fields
4
+ * use to display a helper text, along with a character counter below the
5
+ * input field.
6
+ *
7
+ * We created this to keep the visual styles the same everywhere
8
+ * and to avoid importing styles separately.
9
+ *
10
+ * Also this enables us to open the helper line in limel-portal,
11
+ * more easily without having to send the styles to the portal.
12
+ *
13
+ * :::note
14
+ * When the component has no content, it will get a `display: none`
15
+ * as styles to avoid creating empty holes in the UI of the parent component.
16
+ * For example, in a `flex` or `grid` component that has a `gap`,
17
+ * we don't want the empty `limel-helper-line` to render and cause unnecessary
18
+ * gaps in the UI.
19
+ * However, to be more resourceful, the parent component can choose not
20
+ * to render the helper-line as well.
21
+ * :::
22
+ *
23
+ * @exampleComponent limel-example-helper-line
24
+ * @exampleComponent limel-example-helper-line-invalid
25
+ * @exampleComponent limel-example-helper-line-long-text
26
+ * @exampleComponent limel-example-helper-line-long-text-no-counter
27
+ * @exampleComponent limel-example-helper-line-character-counter
28
+ * @private
29
+ */
30
+ export class HelperLine {
31
+ constructor() {
32
+ this.hasContent = () => {
33
+ if (this.maxLength ||
34
+ this.helperText.length > 0 ||
35
+ this.helperText !== null ||
36
+ this.helperText !== undefined) {
37
+ return true;
38
+ }
39
+ };
40
+ this.renderHelperText = () => {
41
+ if (!this.helperText) {
42
+ return;
43
+ }
44
+ return (h("span", { class: "helper-text", id: this.helperTextId }, this.helperText));
45
+ };
46
+ this.renderCharacterCounter = () => {
47
+ const counter = `${this.length} / ${this.maxLength}`;
48
+ if (!this.maxLength) {
49
+ return;
50
+ }
51
+ return h("span", { class: "counter" }, counter);
52
+ };
53
+ this.helperText = undefined;
54
+ this.length = undefined;
55
+ this.maxLength = undefined;
56
+ this.invalid = false;
57
+ this.helperTextId = undefined;
58
+ }
59
+ render() {
60
+ return (h(Host, { tabIndex: -1, class: {
61
+ invalid: this.invalid,
62
+ show: this.hasContent(),
63
+ }, "aria-hidden": !this.hasContent() }, this.renderHelperText(), this.renderCharacterCounter()));
64
+ }
65
+ static get is() { return "limel-helper-line"; }
66
+ static get encapsulation() { return "shadow"; }
67
+ static get originalStyleUrls() {
68
+ return {
69
+ "$": ["helper-line.scss"]
70
+ };
71
+ }
72
+ static get styleUrls() {
73
+ return {
74
+ "$": ["helper-line.css"]
75
+ };
76
+ }
77
+ static get properties() {
78
+ return {
79
+ "helperText": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "string",
84
+ "resolved": "string",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": true,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": "The helper text that is displayed on the left side."
92
+ },
93
+ "attribute": "helper-text",
94
+ "reflect": true
95
+ },
96
+ "length": {
97
+ "type": "number",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "number",
101
+ "resolved": "number",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": true,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": "Length of the current input value, coming from the parent component.\nUsed in the character counter section on the right side."
109
+ },
110
+ "attribute": "length",
111
+ "reflect": true
112
+ },
113
+ "maxLength": {
114
+ "type": "number",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "number",
118
+ "resolved": "number",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": true,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Maximum length of the characters, defined on the parent component.\nUsed in the character counter section on the right side."
126
+ },
127
+ "attribute": "max-length",
128
+ "reflect": true
129
+ },
130
+ "invalid": {
131
+ "type": "boolean",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "boolean",
135
+ "resolved": "boolean",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": "Turns `true`, when the parent component is invalid.\nFor example, when the parent component is `required` but is left empty.\nOr when the input format is invalid."
143
+ },
144
+ "attribute": "invalid",
145
+ "reflect": true,
146
+ "defaultValue": "false"
147
+ },
148
+ "helperTextId": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": false,
157
+ "optional": true,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": "Used by `aria-controls` and `aria-describedby` in the parent component."
161
+ },
162
+ "attribute": "helper-text-id",
163
+ "reflect": true
164
+ }
165
+ };
166
+ }
167
+ }
@@ -2016,6 +2016,9 @@
2016
2016
  z-index: 2;
2017
2017
  }
2018
2018
 
2019
+ :not(.mdc-text-field--focused):not(.mdc-text-field--invalid) + limel-helper-line {
2020
+ opacity: 0;
2021
+ }
2019
2022
  :not(.mdc-text-field--focused):not(.mdc-text-field--invalid) .mdc-text-field__input[type=number] {
2020
2023
  color: transparent;
2021
2024
  -webkit-text-fill-color: transparent;
@@ -2078,21 +2081,6 @@ input.mdc-text-field__input::-webkit-search-cancel-button:active {
2078
2081
  transform: none;
2079
2082
  }
2080
2083
 
2081
- .mdc-text-field-character-counter {
2082
- transition: opacity 0.2s ease;
2083
- opacity: 0;
2084
- }
2085
- .mdc-text-field--focused + .mdc-text-field-helper-line .mdc-text-field-character-counter {
2086
- opacity: 1;
2087
- }
2088
- .mdc-text-field-character-counter:before {
2089
- height: 0.75rem;
2090
- }
2091
-
2092
- .mdc-text-field-helper-text:before {
2093
- height: 0.75rem;
2094
- }
2095
-
2096
2084
  /*
2097
2085
  * This file is imported into every component!
2098
2086
  *
@@ -111,26 +111,18 @@ export class InputField {
111
111
  this.isModified = true;
112
112
  };
113
113
  this.renderHelperLine = () => {
114
+ const text = this.value || '';
115
+ const length = text.length;
114
116
  if (!this.maxlength && !this.hasHelperText()) {
115
117
  return;
116
118
  }
117
- return (h("div", { tabIndex: -1, class: "mdc-text-field-helper-line" }, this.renderHelperText(), this.renderCharacterCounter()));
119
+ return (h("limel-helper-line", { helperTextId: helperTextId, helperText: this.helperText, length: length, maxLength: this.maxlength, invalid: this.isInvalid() }));
118
120
  };
119
121
  this.renderEmptyValueForReadonly = () => {
120
122
  if (this.readonly && !this.value) {
121
123
  return (h("span", { class: "lime-empty-value-for-readonly lime-looks-like-input-value" }, "\u2013"));
122
124
  }
123
125
  };
124
- this.renderHelperText = () => {
125
- if (!this.hasHelperText()) {
126
- return;
127
- }
128
- const classList = {
129
- 'mdc-text-field-helper-text': true,
130
- 'mdc-text-field-helper-text--validation-msg': this.isInvalid(),
131
- };
132
- return (h("p", { class: classList, id: helperTextId }, this.helperText));
133
- };
134
126
  this.hasHelperText = () => {
135
127
  return this.helperText !== null && this.helperText !== undefined;
136
128
  };
@@ -160,14 +152,6 @@ export class InputField {
160
152
  this.hasPrefix = () => {
161
153
  return this.prefix !== null && this.prefix !== undefined;
162
154
  };
163
- this.renderCharacterCounter = () => {
164
- if (!this.maxlength || this.type === 'number') {
165
- return;
166
- }
167
- const text = this.value || '';
168
- const label = `${text.length} / ${this.maxlength}`;
169
- return h("div", { class: "mdc-text-field-character-counter" }, label);
170
- };
171
155
  this.isInvalid = () => {
172
156
  if (this.readonly) {
173
157
  // A readonly field can never be invalid.
@@ -823,105 +823,21 @@
823
823
  color: var(--lime-error-text-color);
824
824
  }
825
825
 
826
- /*
827
- * This file is imported into every component!
828
- *
829
- * Nothing in this file may output any CSS
830
- * without being explicitly called by outside code.
831
- */
832
- /*
833
- * This file is imported into every component that uses MDC!
834
- *
835
- * Anything in this file that generates CSS output on its own,
836
- * without being explicitly used, will output that CSS in every
837
- * single component, increasing the size of the production build.
838
- * Avoid that unless there's very good reason for it!
839
- */
840
- /*
841
- * This file is imported into every component that uses MDC!
842
- *
843
- * Anything in this file that generates CSS output on its own,
844
- * without being explicitly used, will output that CSS in every
845
- * single component, increasing the size of the production build.
846
- * Avoid that unless there's very good reason for it!
847
- */
848
- :host {
849
- --mdc-theme-primary: var(
850
- --lime-primary-color,
851
- rgb(var(--color-teal-default))
852
- );
853
- --mdc-theme-secondary: var(
854
- --lime-secondary-color,
855
- rgb(var(--contrast-1100))
856
- );
857
- --mdc-theme-on-primary: var(
858
- --lime-on-primary-color,
859
- rgb(var(--contrast-100))
860
- );
861
- --mdc-theme-on-secondary: var(
862
- --lime-on-secondary-color,
863
- rgb(var(--contrast-100))
864
- );
865
- --mdc-theme-text-disabled-on-background: var(
866
- --lime-text-disabled-on-background-color,
867
- rgba(var(--contrast-1700), 0.38)
868
- );
869
- --mdc-theme-text-primary-on-background: var(
870
- --lime-text-primary-on-background-color,
871
- rgba(var(--contrast-1700), 0.87)
872
- );
873
- --mdc-theme-text-secondary-on-background: var(
874
- --lime-text-secondary-on-background-color,
875
- rgba(var(--contrast-1700), 0.54)
876
- );
877
- --mdc-theme-error: var(
878
- --lime-error-background-color,
879
- rgb(var(--color-red-dark))
880
- );
881
- --lime-error-text-color: rgb(var(--color-red-darker));
882
- --mdc-theme-surface: var(
883
- --lime-surface-background-color,
884
- rgb(var(--contrast-100))
885
- );
886
- --mdc-theme-on-surface: var(
887
- --lime-on-surface-color,
888
- rgb(var(--contrast-1500))
889
- );
890
- }
891
-
892
- .limel-checkbox-helper-line {
893
- padding-right: 1rem;
894
- padding-left: 1rem;
895
- flex-basis: 100%;
896
- width: 100%;
897
- }
898
-
899
- .limel-checkbox-helper-text {
900
- font-family: Roboto, sans-serif;
901
- -moz-osx-font-smoothing: grayscale;
902
- -webkit-font-smoothing: antialiased;
903
- font-size: 0.6875rem;
904
- font-weight: 400;
905
- letter-spacing: 0.0333333333em;
906
- text-decoration: inherit;
907
- text-transform: inherit;
908
- display: block;
909
- margin-top: 0;
910
- line-height: normal;
911
- margin: 0;
912
- transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
826
+ limel-helper-line {
913
827
  opacity: 0;
914
- color: rgba(var(--contrast-1200), 1);
915
- }
916
- :host(:hover) .limel-checkbox-helper-text, :host(:focus) .limel-checkbox-helper-text, :host(:focus-within) .limel-checkbox-helper-text {
917
- opacity: 1;
918
828
  }
919
829
 
920
830
  @media (pointer: coarse) {
921
- .limel-checkbox-helper-text {
831
+ limel-helper-line {
922
832
  opacity: 1;
923
833
  }
924
834
  }
835
+ :host(:focus) limel-helper-line,
836
+ :host(:focus-visible) limel-helper-line,
837
+ :host(:focus-within) limel-helper-line {
838
+ opacity: 1;
839
+ }
840
+
925
841
  .lime-checkbox--readonly.mdc-checkbox--disabled {
926
842
  opacity: 1;
927
843
  --mdc-ripple-press-opacity: 1;
@@ -5289,105 +5205,21 @@ a.mdc-list-item {
5289
5205
  color: var(--lime-error-text-color);
5290
5206
  }
5291
5207
 
5292
- /*
5293
- * This file is imported into every component!
5294
- *
5295
- * Nothing in this file may output any CSS
5296
- * without being explicitly called by outside code.
5297
- */
5298
- /*
5299
- * This file is imported into every component that uses MDC!
5300
- *
5301
- * Anything in this file that generates CSS output on its own,
5302
- * without being explicitly used, will output that CSS in every
5303
- * single component, increasing the size of the production build.
5304
- * Avoid that unless there's very good reason for it!
5305
- */
5306
- /*
5307
- * This file is imported into every component that uses MDC!
5308
- *
5309
- * Anything in this file that generates CSS output on its own,
5310
- * without being explicitly used, will output that CSS in every
5311
- * single component, increasing the size of the production build.
5312
- * Avoid that unless there's very good reason for it!
5313
- */
5314
- :host {
5315
- --mdc-theme-primary: var(
5316
- --lime-primary-color,
5317
- rgb(var(--color-teal-default))
5318
- );
5319
- --mdc-theme-secondary: var(
5320
- --lime-secondary-color,
5321
- rgb(var(--contrast-1100))
5322
- );
5323
- --mdc-theme-on-primary: var(
5324
- --lime-on-primary-color,
5325
- rgb(var(--contrast-100))
5326
- );
5327
- --mdc-theme-on-secondary: var(
5328
- --lime-on-secondary-color,
5329
- rgb(var(--contrast-100))
5330
- );
5331
- --mdc-theme-text-disabled-on-background: var(
5332
- --lime-text-disabled-on-background-color,
5333
- rgba(var(--contrast-1700), 0.38)
5334
- );
5335
- --mdc-theme-text-primary-on-background: var(
5336
- --lime-text-primary-on-background-color,
5337
- rgba(var(--contrast-1700), 0.87)
5338
- );
5339
- --mdc-theme-text-secondary-on-background: var(
5340
- --lime-text-secondary-on-background-color,
5341
- rgba(var(--contrast-1700), 0.54)
5342
- );
5343
- --mdc-theme-error: var(
5344
- --lime-error-background-color,
5345
- rgb(var(--color-red-dark))
5346
- );
5347
- --lime-error-text-color: rgb(var(--color-red-darker));
5348
- --mdc-theme-surface: var(
5349
- --lime-surface-background-color,
5350
- rgb(var(--contrast-100))
5351
- );
5352
- --mdc-theme-on-surface: var(
5353
- --lime-on-surface-color,
5354
- rgb(var(--contrast-1500))
5355
- );
5356
- }
5357
-
5358
- .limel-checkbox-helper-line {
5359
- padding-right: 1rem;
5360
- padding-left: 1rem;
5361
- flex-basis: 100%;
5362
- width: 100%;
5363
- }
5364
-
5365
- .limel-checkbox-helper-text {
5366
- font-family: Roboto, sans-serif;
5367
- -moz-osx-font-smoothing: grayscale;
5368
- -webkit-font-smoothing: antialiased;
5369
- font-size: 0.6875rem;
5370
- font-weight: 400;
5371
- letter-spacing: 0.0333333333em;
5372
- text-decoration: inherit;
5373
- text-transform: inherit;
5374
- display: block;
5375
- margin-top: 0;
5376
- line-height: normal;
5377
- margin: 0;
5378
- transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
5208
+ limel-helper-line {
5379
5209
  opacity: 0;
5380
- color: rgba(var(--contrast-1200), 1);
5381
- }
5382
- :host(:hover) .limel-checkbox-helper-text, :host(:focus) .limel-checkbox-helper-text, :host(:focus-within) .limel-checkbox-helper-text {
5383
- opacity: 1;
5384
5210
  }
5385
5211
 
5386
5212
  @media (pointer: coarse) {
5387
- .limel-checkbox-helper-text {
5213
+ limel-helper-line {
5388
5214
  opacity: 1;
5389
5215
  }
5390
5216
  }
5217
+ :host(:focus) limel-helper-line,
5218
+ :host(:focus-visible) limel-helper-line,
5219
+ :host(:focus-within) limel-helper-line {
5220
+ opacity: 1;
5221
+ }
5222
+
5391
5223
  .lime-checkbox--readonly.mdc-checkbox--disabled {
5392
5224
  opacity: 1;
5393
5225
  --mdc-ripple-press-opacity: 1;