nve-designsystem 3.2.0 → 3.3.0

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 (197) hide show
  1. package/chunks/chunk.2PCBEMQZ.js +163 -226
  2. package/chunks/chunk.36O46B5H.js +15 -15
  3. package/chunks/chunk.4TUIT776.js +78 -96
  4. package/chunks/chunk.5JY5FUCG.js +965 -1245
  5. package/chunks/chunk.5P45LHIX.js +668 -96
  6. package/chunks/chunk.6CTB5ZDJ.js +107 -100
  7. package/chunks/chunk.B4BZKR24.js +29 -39
  8. package/chunks/chunk.D5YQDJ7X.js +122 -166
  9. package/chunks/chunk.EA437WHD.js +5 -5
  10. package/chunks/chunk.GI7VDIWX.js +14 -15
  11. package/chunks/chunk.GMYPQTFK.js +18 -20
  12. package/chunks/chunk.HVTXQL7M.js +191 -215
  13. package/chunks/chunk.IKV4VH3T.js +18 -16
  14. package/chunks/chunk.IVVHNXMC.js +26 -27
  15. package/chunks/chunk.JHOXTQXA.js +65 -74
  16. package/chunks/chunk.JXOKFADN.js +63 -90
  17. package/chunks/chunk.K7JGTRV7.js +24 -23
  18. package/chunks/chunk.KPLQLAWP.js +132 -147
  19. package/chunks/chunk.LD4M4QGE.js +61 -74
  20. package/chunks/chunk.MSKEYBDI.js +53 -71
  21. package/chunks/chunk.NYIIDP5N.js +39 -45
  22. package/chunks/chunk.RWUUFNUL.js +91 -114
  23. package/chunks/chunk.SAPQLUO4.js +249 -228
  24. package/chunks/chunk.SI4ACBFK.js +139 -5
  25. package/chunks/chunk.TP2GB2HO.js +361 -460
  26. package/chunks/chunk.UDWRA64J.js +185 -223
  27. package/chunks/chunk.URTPIBTY.js +119 -151
  28. package/chunks/chunk.VESXC477.js +63 -66
  29. package/chunks/chunk.XA43ZQPC.js +198 -313
  30. package/chunks/chunk.XQ2OKYYA.js +25 -26
  31. package/chunks/chunk.XZNBUGX7.js +6 -6
  32. package/chunks/chunk.YHLNUJ7P.js +93 -116
  33. package/chunks/chunk.ZH2AND3P.js +340 -399
  34. package/chunks/chunk.ZL53POKZ.js +61 -156
  35. package/chunks/chunk.js +20 -0
  36. package/chunks/class-map.js +49 -45
  37. package/chunks/decorate.js +105 -0
  38. package/chunks/directive-helpers.js +5 -7
  39. package/chunks/if-defined.js +5 -5
  40. package/chunks/lit.js +525 -0
  41. package/chunks/live.js +24 -24
  42. package/chunks/nve-alert.component.js +163 -0
  43. package/chunks/nve-carousel-item.component.js +36 -0
  44. package/chunks/nve-carousel.component.js +41 -0
  45. package/chunks/nve-checkbox-group.component.js +114 -0
  46. package/chunks/nve-checkbox.component.js +28 -0
  47. package/chunks/nve-dialog.component.js +39 -0
  48. package/chunks/nve-divider.component.js +23 -0
  49. package/chunks/nve-drawer.component.js +40 -0
  50. package/chunks/nve-dropdown.component.js +83 -0
  51. package/chunks/nve-input.component.js +80 -0
  52. package/chunks/nve-label.component.js +89 -0
  53. package/chunks/nve-menu-item.component.js +35 -0
  54. package/chunks/nve-menu.component.js +17 -0
  55. package/chunks/nve-option.component.js +27 -0
  56. package/chunks/nve-popup.component.js +15 -0
  57. package/chunks/nve-radio-button.component.js +20 -0
  58. package/chunks/nve-radio-group.component.js +78 -0
  59. package/chunks/nve-radio.component.js +18 -0
  60. package/chunks/nve-select.component.js +58 -0
  61. package/chunks/nve-skeleton.component.js +20 -0
  62. package/chunks/nve-spinner.component.js +23 -0
  63. package/chunks/nve-tooltip.component.js +20 -0
  64. package/chunks/nve-warning-level.component.js +57 -0
  65. package/chunks/ref.js +75 -84
  66. package/chunks/shoelace.js +10006 -0
  67. package/chunks/static-html.js +27 -0
  68. package/chunks/unsafe-html.js +24 -20
  69. package/chunks/updateInvalidProperty.js +7 -7
  70. package/chunks/watch.js +20 -20
  71. package/components/nve-accordion/nve-accordion.component.js +24 -30
  72. package/components/nve-accordion-item/nve-accordion-item.component.js +30 -64
  73. package/components/nve-accordion-item/nve-accordion-item.styles.js +5 -5
  74. package/components/nve-alert/nve-alert.component.js +2 -227
  75. package/components/nve-alert/nve-alert.styles.js +45 -27
  76. package/components/nve-badge/nve-badge.component.js +41 -45
  77. package/components/nve-badge/nve-badge.styles.js +33 -31
  78. package/components/nve-button/nve-button.component.d.ts +110 -10
  79. package/components/nve-button/nve-button.component.js +146 -39
  80. package/components/nve-button/nve-button.styles.js +214 -157
  81. package/components/nve-carousel/nve-carousel.component.js +2 -47
  82. package/components/nve-carousel/nve-carousel.styles.js +6 -6
  83. package/components/nve-carousel-item/nve-carousel-item.component.js +2 -40
  84. package/components/nve-carousel-item/nve-carousel-item.styles.js +5 -5
  85. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.js +44 -54
  86. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.js +5 -5
  87. package/components/nve-checkbox/nve-checkbox.component.js +2 -34
  88. package/components/nve-checkbox/nve-checkbox.styles.js +7 -7
  89. package/components/nve-checkbox-group/nve-checkbox-group.component.js +2 -152
  90. package/components/nve-checkbox-group/nve-checkbox-group.styles.js +5 -5
  91. package/components/nve-combobox/nve-combobox.component.js +222 -440
  92. package/components/nve-combobox/nve-combobox.styles.js +6 -6
  93. package/components/nve-darkmode-switch/nve-darkmode-switch.component.js +32 -38
  94. package/components/nve-dialog/nve-dialog-styles.js +6 -6
  95. package/components/nve-dialog/nve-dialog.component.js +2 -54
  96. package/components/nve-divider/nve-divider.component.js +2 -30
  97. package/components/nve-drawer/nve-drawer.component.js +2 -44
  98. package/components/nve-drawer/nve-drawer.styles.js +6 -6
  99. package/components/nve-dropdown/nve-dropdown.component.js +2 -79
  100. package/components/nve-dropdown/nve-dropdown.styles.js +5 -5
  101. package/components/nve-heading/nve-heading.component.d.ts +29 -0
  102. package/components/nve-heading/nve-heading.component.js +45 -0
  103. package/components/nve-heading/nve-heading.styles.d.ts +2 -0
  104. package/components/nve-heading/nve-heading.styles.js +41 -0
  105. package/components/nve-icon/nve-icon.component.js +145 -164
  106. package/components/nve-icon/nve-icon.styles.js +11 -6
  107. package/components/nve-icon/offline-icons.js +16 -13
  108. package/components/nve-input/nve-input.component.js +2 -100
  109. package/components/nve-input/nve-input.styles.js +5 -5
  110. package/components/nve-label/nve-label.component.js +2 -115
  111. package/components/nve-label/nve-label.styles.js +5 -5
  112. package/components/nve-link-card/nve-link-card.component.d.ts +5 -2
  113. package/components/nve-link-card/nve-link-card.component.js +44 -80
  114. package/components/nve-link-card/nve-link-card.styles.js +71 -66
  115. package/components/nve-menu/nve-menu.component.js +2 -22
  116. package/components/nve-menu/nve-menu.styles.js +5 -5
  117. package/components/nve-menu-item/nve-menu-item.component.js +2 -43
  118. package/components/nve-menu-item/nve-menu-item.styles.js +7 -7
  119. package/components/nve-message-card/nve-message-card.component.js +61 -91
  120. package/components/nve-message-card/nve-message-card.styles.js +24 -27
  121. package/components/nve-navigation-card/nve-navigation-card.component.d.ts +52 -0
  122. package/components/nve-navigation-card/nve-navigation-card.component.js +60 -0
  123. package/components/nve-navigation-card/nve-navigation-card.styles.d.ts +2 -0
  124. package/components/nve-navigation-card/nve-navigation-card.styles.js +112 -0
  125. package/components/nve-option/nve-option.component.js +2 -41
  126. package/components/nve-option/nve-option.styles.js +5 -5
  127. package/components/nve-paragraph/nve-paragraph.component.d.ts +26 -0
  128. package/components/nve-paragraph/nve-paragraph.component.js +26 -0
  129. package/components/nve-paragraph/nve-paragraph.styles.d.ts +2 -0
  130. package/components/nve-paragraph/nve-paragraph.styles.js +105 -0
  131. package/components/nve-popup/nve-popup.component.js +2 -22
  132. package/components/nve-radio/nve-radio.component.js +2 -23
  133. package/components/nve-radio/nve-radio.styles.js +5 -5
  134. package/components/nve-radio-button/nve-radio-button.component.js +2 -25
  135. package/components/nve-radio-button/nve-radio-button.styles.js +5 -5
  136. package/components/nve-radio-group/nve-radio-group.component.js +2 -119
  137. package/components/nve-radio-group/nve-radio-group.styles.js +5 -5
  138. package/components/nve-relative-time/nve-relative-time.component.js +21 -56
  139. package/components/nve-relative-time/nve-relative-time.styles.js +5 -5
  140. package/components/nve-select/nve-select.component.js +2 -80
  141. package/components/nve-select/nve-select.styles.js +5 -5
  142. package/components/nve-skeleton/nve-skeleton.component.js +2 -27
  143. package/components/nve-skeleton/nve-skeleton.styles.js +5 -5
  144. package/components/nve-spinner/nve-spinner.component.js +2 -31
  145. package/components/nve-stepper/nve-step/nve-step.component.js +113 -173
  146. package/components/nve-stepper/nve-step/nve-step.styles.js +12 -12
  147. package/components/nve-stepper/nve-stepper-mobile.component.js +37 -49
  148. package/components/nve-stepper/nve-stepper-mobile.styles.js +7 -7
  149. package/components/nve-stepper/nve-stepper.component.js +94 -139
  150. package/components/nve-stepper/nve-stepper.styles.js +5 -5
  151. package/components/nve-switch/nve-switch.component.js +75 -107
  152. package/components/nve-switch/nve-switch.styles.js +7 -7
  153. package/components/nve-tab/nve-tab.component.js +30 -42
  154. package/components/nve-tab/nve-tab.styles.js +7 -7
  155. package/components/nve-tab-group/nve-tab-group.component.js +180 -260
  156. package/components/nve-tab-group/nve-tab-group.styles.js +5 -5
  157. package/components/nve-tab-panel/nve-tab-panel.component.js +21 -31
  158. package/components/nve-tab-panel/nve-tab-panel.styles.js +5 -5
  159. package/components/nve-tag/nve-tag.component.d.ts +3 -3
  160. package/components/nve-tag/nve-tag.component.js +71 -72
  161. package/components/nve-tag/nve-tag.styles.js +23 -22
  162. package/components/nve-textarea/nve-textarea.component.d.ts +3 -1
  163. package/components/nve-textarea/nve-textarea.component.js +112 -173
  164. package/components/nve-textarea/nve-textarea.styles.js +10 -5
  165. package/components/nve-tooltip/nve-tooltip.component.js +2 -30
  166. package/components/nve-tooltip/nve-tooltip.styles.js +5 -5
  167. package/components/nve-warning-level/nve-warning-level.component.js +2 -78
  168. package/components/nve-warning-level/nve-warning-level.styles.js +7 -7
  169. package/css/global.css +13 -55
  170. package/css/nve.css +1048 -393
  171. package/css/nve_dark.css +406 -305
  172. package/css/rme.css +1050 -395
  173. package/css/rme_dark.css +408 -307
  174. package/css/shoelace-styles.css +539 -0
  175. package/css/varsom.css +1046 -391
  176. package/css/varsom_dark.css +404 -303
  177. package/custom-elements.json +2905 -12389
  178. package/fonts/LICENSE.txt +37 -0
  179. package/fonts/SourceSans3-VariableFont_wght.woff2 +0 -0
  180. package/interfaces/NveComponent.interface.js +0 -1
  181. package/nve-designsystem.d.ts +5 -0
  182. package/nve-designsystem.js +46 -86
  183. package/package.json +26 -8
  184. package/registerIcons/systemLibraryCustomization.js +23 -91
  185. package/vite-env.d.js +0 -1
  186. package/chunks/chunk.3RPBFEDE.js +0 -162
  187. package/chunks/chunk.JCXLDPQF.js +0 -225
  188. package/chunks/chunk.JQBT7BOV.js +0 -8446
  189. package/chunks/chunk.MAQXLKQ7.js +0 -598
  190. package/chunks/lit-element.js +0 -508
  191. package/chunks/property.js +0 -37
  192. package/chunks/query.js +0 -13
  193. package/chunks/state.js +0 -7
  194. package/chunks/static.js +0 -26
  195. package/nve-designsystem.css +0 -1
  196. package/vscode.css-custom-data.json +0 -621
  197. package/vscode.html-custom-data.json +0 -2354
@@ -1,87 +1,86 @@
1
- import { n as s, t as f } from "../../chunks/property.js";
2
- import { a as h, E as u, x as p } from "../../chunks/lit-element.js";
3
- import { e as g } from "../../chunks/class-map.js";
4
- import m from "./nve-tag.styles.js";
5
- var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, e = (r, l, o, i) => {
6
- for (var a = i > 1 ? void 0 : i ? b(l, o) : l, n = r.length - 1, c; n >= 0; n--)
7
- (c = r[n]) && (a = (i ? c(l, o, a) : c(a)) || a);
8
- return i && a && v(l, o, a), a;
9
- };
10
- let t = class extends h {
11
- constructor() {
12
- super(...arguments), this.variant = "neutral", this.saturation = "default", this.size = "medium", this["extra-text"] = "", this.dot = !1, this.closeable = !1, this["close-aria-label"] = "Lukk";
13
- }
14
- closeButtonClick() {
15
- const r = new CustomEvent("nve-close", {
16
- bubbles: !0,
17
- cancelable: !1,
18
- composed: !0,
19
- detail: {}
20
- });
21
- this.dispatchEvent(r);
22
- }
23
- render() {
24
- return p`
1
+ import { a as e, n as t, t as n } from "../../chunks/lit.js";
2
+ import { o as r, s as i, t as a } from "../../chunks/decorate.js";
3
+ import { t as o } from "../../chunks/class-map.js";
4
+ import s from "./nve-tag.styles.js";
5
+ //#region src/components/nve-tag/nve-tag.component.ts
6
+ var c = class extends n {
7
+ constructor(...e) {
8
+ super(...e), this.variant = "neutral", this.saturation = "default", this.size = "medium", this.extraText = "", this.dot = !1, this.closeable = !1, this.closeAriaLabel = "Lukk";
9
+ }
10
+ static {
11
+ this.styles = [s];
12
+ }
13
+ closeButtonClick() {
14
+ let e = new CustomEvent("nve-close", {
15
+ bubbles: !0,
16
+ cancelable: !1,
17
+ composed: !0,
18
+ detail: {}
19
+ });
20
+ this.dispatchEvent(e);
21
+ }
22
+ render() {
23
+ return e`
25
24
  <span
26
25
  part="base"
27
- class=${g({
28
- tag: !0,
29
- "tag--neutral": this.variant === "neutral",
30
- "tag--info": this.variant === "info",
31
- "tag--success": this.variant === "success",
32
- "tag--warning": this.variant === "warning",
33
- "tag--error": this.variant === "error",
34
- "tag--small": this.size === "small",
35
- "tag--medium": this.size === "medium",
36
- "tag--saturation-emphasized": this.saturation === "emphasized",
37
- "tag--saturation-subtle": this.saturation === "subtle",
38
- "tag--saturation-default": this.saturation === "default"
39
- })}
26
+ class=${o({
27
+ tag: !0,
28
+ "tag--neutral": this.variant === "neutral",
29
+ "tag--info": this.variant === "info",
30
+ "tag--success": this.variant === "success",
31
+ "tag--warning": this.variant === "warning",
32
+ "tag--error": this.variant === "error",
33
+ "tag--small": this.size === "small",
34
+ "tag--medium": this.size === "medium",
35
+ "tag--saturation-emphasized": this.saturation === "emphasized",
36
+ "tag--saturation-subtle": this.saturation === "subtle",
37
+ "tag--saturation-default": this.saturation === "default"
38
+ })}
40
39
  >
41
40
  <slot name="prefix"
42
- >${this.dot ? p`<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
41
+ >${this.dot ? e`<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
43
42
  <circle cx="5.5" cy="5" r="5" fill="currentcolor" />
44
- </svg> ` : u}</slot
43
+ </svg> ` : t}</slot
45
44
  >
46
45
  <slot part="text"></slot>
47
- <slot name="extra" part="extra">${this["extra-text"]}</slot>
48
- ${this.closeable ? p`<button
46
+ <slot name="extra" part="extra">${this.extraText}</slot>
47
+ ${this.closeable ? e`<button
49
48
  part="close"
50
49
  class="tag-close"
51
- aria-label="${this["close-aria-label"]}"
50
+ aria-label="${this.closeAriaLabel}"
52
51
  @click=${this.closeButtonClick}
53
52
  >
54
53
  <nve-icon name="close"></nve-icon>
55
- </button>` : u}
54
+ </button>` : t}
56
55
  </span>
57
56
  `;
58
- }
59
- };
60
- t.styles = [m];
61
- e([
62
- s({ type: String, reflect: !0 })
63
- ], t.prototype, "variant", 2);
64
- e([
65
- s({ type: String, reflect: !0 })
66
- ], t.prototype, "saturation", 2);
67
- e([
68
- s({ type: String, reflect: !0 })
69
- ], t.prototype, "size", 2);
70
- e([
71
- s({ type: String, reflect: !1, attribute: !0 })
72
- ], t.prototype, "extra-text", 2);
73
- e([
74
- s({ type: Boolean, reflect: !1 })
75
- ], t.prototype, "dot", 2);
76
- e([
77
- s({ type: Boolean, reflect: !1 })
78
- ], t.prototype, "closeable", 2);
79
- e([
80
- s({ type: String, reflect: !1 })
81
- ], t.prototype, "close-aria-label", 2);
82
- t = e([
83
- f("nve-tag")
84
- ], t);
85
- export {
86
- t as default
57
+ }
87
58
  };
59
+ a([r({
60
+ type: String,
61
+ reflect: !0
62
+ })], c.prototype, "variant", void 0), a([r({
63
+ type: String,
64
+ reflect: !0
65
+ })], c.prototype, "saturation", void 0), a([r({
66
+ type: String,
67
+ reflect: !0
68
+ })], c.prototype, "size", void 0), a([r({
69
+ type: String,
70
+ reflect: !1,
71
+ attribute: "extra-text"
72
+ })], c.prototype, "extraText", void 0), a([r({
73
+ type: Boolean,
74
+ reflect: !1
75
+ })], c.prototype, "dot", void 0), a([r({
76
+ type: Boolean,
77
+ reflect: !1,
78
+ attribute: "closeable"
79
+ })], c.prototype, "closeable", void 0), a([r({
80
+ type: String,
81
+ reflect: !1,
82
+ attribute: "close-aria-label"
83
+ })], c.prototype, "closeAriaLabel", void 0), c = a([i("nve-tag")], c);
84
+ var l = c;
85
+ //#endregion
86
+ export { l as default };
@@ -1,5 +1,6 @@
1
- import { i as o } from "../../chunks/lit-element.js";
2
- const e = o`
1
+ import { u as e } from "../../chunks/lit.js";
2
+ //#region src/components/nve-tag/nve-tag.styles.ts
3
+ var t = e`
3
4
  .tag {
4
5
  display: flex;
5
6
  gap: var(--spacing-2x-small);
@@ -15,104 +16,105 @@ const e = o`
15
16
 
16
17
  :host([variant='neutral'][saturation='emphasized']) {
17
18
  --_bg-color: var(--color-feedback-background-emphasized-neutral);
18
- --_text-color: var(--color-feedback-foreground-emphasized-neutral);
19
+ --_text-color: var(--color-feedback-foreground-on-bg-emphasized-neutral,);
19
20
  --_hover-bg-color: var(--color-feedback-background-default-neutral);
20
21
  --_hover-text-color: var(--color-feedback-foreground-default-neutral);
21
22
  }
22
23
 
23
24
  :host([variant='neutral'][saturation='default']) {
24
25
  --_bg-color: var(--color-feedback-background-default-neutral);
25
- --_text-color: var(--color-feedback-foreground-default-neutral);
26
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-neutral);
26
27
  --_hover-bg-color: var(--color-feedback-background-subtle-neutral);
27
28
  --_hover-text-color: var(--color-feedback-foreground-subtle-neutral);
28
29
  }
29
- color- :host([variant='neutral'][saturation='subtle']) {
30
+
31
+ :host([variant='neutral'][saturation='subtle']) {
30
32
  --_bg-color: var(--color-feedback-background-subtle-neutral);
31
- --_text-color: var(--color-feedback-foreground-subtle-neutral);
33
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-neutral);
32
34
  --_hover-bg-color: var(--color-feedback-background-default-neutral);
33
35
  --_hover-text-color: var(--color-feedback-foreground-default-neutral);
34
36
  }
35
37
 
36
38
  :host([variant='success'][saturation='emphasized']) {
37
39
  --_bg-color: var(--color-feedback-background-emphasized-success);
38
- --_text-color: var(--color-feedback-foreground-emphasized-success);
40
+ --_text-color: var(--color-feedback-foreground-on-bg-emphasized-success);
39
41
  --_hover-bg-color: var(--color-feedback-background-default-success);
40
42
  --_hover-text-color: var(--color-feedback-foreground-default-success);
41
43
  }
42
44
 
43
45
  :host([variant='success'][saturation='default']) {
44
46
  --_bg-color: var(--color-feedback-background-default-success);
45
- --_text-color: var(--color-feedback-foreground-default-success);
47
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-success);
46
48
  --_hover-bg-color: var(--color-feedback-background-subtle-success);
47
49
  --_hover-text-color: var(--color-feedback-foreground-subtle-success);
48
50
  }
49
51
 
50
52
  :host([variant='success'][saturation='subtle']) {
51
53
  --_bg-color: var(--color-feedback-background-subtle-success);
52
- --_text-color: var(--color-feedback-foreground-subtle-success);
54
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-success);
53
55
  --_hover-bg-color: var(--color-feedback-background-default-success);
54
56
  --_hover-text-color: var(--color-feedback-foreground-default-success);
55
57
  }
56
58
 
57
59
  :host([variant='info'][saturation='emphasized']) {
58
60
  --_bg-color: var(--color-feedback-background-emphasized-info);
59
- --_text-color: var(--color-feedback-foreground-emphasized-info);
61
+ --_text-color: var(--color-feedback-foreground-on-bg-emphasized-info);
60
62
  --_hover-bg-color: var(--color-feedback-background-default-info);
61
63
  --_hover-text-color: var(--color-feedback-foreground-default-info);
62
64
  }
63
65
 
64
66
  :host([variant='info'][saturation='default']) {
65
67
  --_bg-color: var(--color-feedback-background-default-info);
66
- --_text-color: var(--color-feedback-foreground-default-info);
68
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-info);
67
69
  --_hover-bg-color: var(--color-feedback-background-subtle-info);
68
70
  --_hover-text-color: var(--color-feedback-foreground-subtle-info);
69
71
  }
70
72
 
71
73
  :host([variant='info'][saturation='subtle']) {
72
74
  --_bg-color: var(--color-feedback-background-subtle-info);
73
- --_text-color: var(--color-feedback-foreground-subtle-info);
75
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-info);
74
76
  --_hover-bg-color: var(--color-feedback-background-default-info);
75
77
  --_hover-text-color: var(--color-feedback-foreground-default-info);
76
78
  }
77
79
 
78
80
  :host([variant='warning'][saturation='emphasized']) {
79
81
  --_bg-color: var(--color-feedback-background-emphasized-warning);
80
- --_text-color: var(--color-feedback-foreground-emphasized-warning);
82
+ --_text-color: var(--color-feedback-foreground-on-bg-emphasized-warning);
81
83
  --_hover-bg-color: var(--color-feedback-background-default-warning);
82
84
  --_hover-text-color: var(--color-feedback-foreground-default-warning);
83
85
  }
84
86
 
85
87
  :host([variant='warning'][saturation='default']) {
86
88
  --_bg-color: var(--color-feedback-background-default-warning);
87
- --_text-color: var(--color-feedback-foreground-default-warning);
89
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-warning);
88
90
  --_hover-bg-color: var(--color-feedback-background-subtle-warning);
89
91
  --_hover-text-color: var(--color-feedback-foreground-subtle-warning);
90
92
  }
91
93
 
92
94
  :host([variant='warning'][saturation='subtle']) {
93
95
  --_bg-color: var(--color-feedback-background-subtle-warning);
94
- --_text-color: var(--color-feedback-foreground-subtle-warning);
96
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-warning);
95
97
  --_hover-bg-color: var(--color-feedback-background-default-warning);
96
98
  --_hover-text-color: var(--color-feedback-foreground-default-warning);
97
99
  }
98
100
 
99
101
  :host([variant='error'][saturation='emphasized']) {
100
102
  --_bg-color: var(--color-feedback-background-emphasized-error);
101
- --_text-color: var(--color-feedback-foreground-emphasized-error);
103
+ --_text-color: var(--color-feedback-foreground-on-bg-emphasized-error);
102
104
  --_hover-bg-color: var(--color-feedback-background-default-error);
103
105
  --_hover-text-color: var(--color-feedback-foreground-default-error);
104
106
  }
105
107
 
106
108
  :host([variant='error'][saturation='default']) {
107
109
  --_bg-color: var(--color-feedback-background-default-error);
108
- --_text-color: var(--color-feedback-foreground-default-error);
110
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-error);
109
111
  --_hover-bg-color: var(--color-feedback-background-subtle-error);
110
112
  --_hover-text-color: var(--color-feedback-foreground-subtle-error);
111
113
  }
112
114
 
113
115
  :host([variant='error'][saturation='subtle']) {
114
116
  --_bg-color: var(--color-feedback-background-subtle-error);
115
- --_text-color: var(--color-feedback-foreground-subtle-error);
117
+ --_text-color: var(--color-feedback-foreground-on-bg-subtle-error);
116
118
  --_hover-bg-color: var(--color-feedback-background-default-error);
117
119
  --_hover-text-color: var(--color-feedback-foreground-default-error);
118
120
  }
@@ -170,9 +172,8 @@ const e = o`
170
172
  }
171
173
 
172
174
  .tag.tag--saturation-emphasized.tag--neutral:has(.tag-close:focus-visible) {
173
- outline-color: var(--color-interactive-primary-foreground-border-focus);
175
+ outline-color: var(--color-interactive-border-accessibility-focus);
174
176
  }
175
177
  `;
176
- export {
177
- e as default
178
- };
178
+ //#endregion
179
+ export { t as default };
@@ -40,6 +40,8 @@ export default class NveTextarea extends LitElement implements INveComponent {
40
40
  label: string;
41
41
  /** Hjelpetekst under textarea */
42
42
  helpText: string;
43
+ /** Hint - tekst under inndatafelt */
44
+ hint: string;
43
45
  /** Om textarea er deaktivert */
44
46
  disabled: boolean;
45
47
  /** Om textarea er skrivebeskyttet */
@@ -57,7 +59,7 @@ export default class NveTextarea extends LitElement implements INveComponent {
57
59
  /** Kontrollerer om og hvordan tekstinnput automatisk blir gjort stor som det blir skrevet inn av brukeren. */
58
60
  autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
59
61
  /** Indikerer om nettleserens autokorrekturfunksjon er på eller av. */
60
- autocorrect?: string;
62
+ autocorrect: 'on' | 'off';
61
63
  /** Indikerer om nettleserens autokorrekturfunksjon er på eller av. */
62
64
  tooltip?: string;
63
65
  /**
@@ -1,103 +1,101 @@
1
- import { a as m, E as p, x as o } from "../../chunks/lit-element.js";
2
- import { n as s, t as b } from "../../chunks/property.js";
3
- import { r as u } from "../../chunks/state.js";
4
- import { e as v } from "../../chunks/query.js";
5
- import f from "./nve-textarea.styles.js";
6
- import { o as r } from "../../chunks/if-defined.js";
7
- import { l as y } from "../../chunks/live.js";
8
- import { e as g } from "../../chunks/class-map.js";
1
+ import { a as e, n as t, t as n } from "../../chunks/lit.js";
2
+ import { a as r, o as i, r as a, s as o, t as s } from "../../chunks/decorate.js";
3
+ import { t as c } from "../../chunks/class-map.js";
4
+ import { t as l } from "../../chunks/if-defined.js";
5
+ import { t as u } from "../../chunks/live.js";
9
6
  import "../nve-icon/nve-icon.component.js";
10
- import "../nve-label/nve-label.component.js";
11
- var x = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, t = (i, l, a, h) => {
12
- for (var n = h > 1 ? void 0 : h ? _(l, a) : l, d = i.length - 1, c; d >= 0; d--)
13
- (c = i[d]) && (n = (h ? c(l, a, n) : c(n)) || n);
14
- return h && n && x(l, a, n), n;
15
- };
16
- let e = class extends m {
17
- constructor() {
18
- super(), this.name = "", this.value = "", this.title = "", this.filled = !1, this.label = "", this.helpText = "", this.disabled = !1, this.readonly = !1, this.placeholder = "", this.required = !1, this.requiredLabel = "*Obligatorisk", this.autocapitalize = "off", this.testId = "", this.showErrorMessage = !1, this.touched = !1, this.resizeObserver = null;
19
- }
20
- firstUpdated() {
21
- if (this.requiredLabel && this.style.setProperty("--textarea-required-content", `"${this.requiredLabel}"`), this.required) {
22
- const a = this.input.checkValidity();
23
- this.toggleAttribute("data-valid", a), this.toggleAttribute("data-invalid", !a);
24
- }
25
- const i = this.shadowRoot?.querySelector(".textarea__control"), l = this.shadowRoot?.querySelector(".textarea__label");
26
- i && l && (this.resizeObserver = new ResizeObserver((a) => {
27
- for (const h of a)
28
- l.style.width = `${h.contentRect.width + 32}px`;
29
- }), this.resizeObserver.observe(i));
30
- }
31
- connectedCallback() {
32
- super.connectedCallback(), this.closest("form")?.addEventListener("submit", this.handleSubmit.bind(this));
33
- }
34
- disconnectedCallback() {
35
- super.disconnectedCallback(), this.closest("form")?.removeEventListener("submit", this.handleSubmit.bind(this)), this.resizeObserver?.disconnect();
36
- }
37
- // kan senere flyttes til utils hvis blir brukt flere steder
38
- emit(i) {
39
- this.dispatchEvent(new CustomEvent(i));
40
- }
41
- handleSubmit(i) {
42
- i.preventDefault(), this.checkValidity();
43
- }
44
- // validerer ikke hvis bruker ikke har tatt på input feltet
45
- handleBlur() {
46
- this.touched && this.checkValidity(), this.emit("sl-blur");
47
- }
48
- handleChange() {
49
- this.value = this.input.value, this.emit("sl-change");
50
- }
51
- handleInput() {
52
- this.touched = !0, this.value = this.input.value, this.emit("sl-input");
53
- }
54
- /** Sjekker constraint validation og hvis man kjørte setCustomValidity med en melding, checkValidity blir falsk og. Hvis man ikke bruker errorMessage property vil den vise default engelsk tekst istedenfor */
55
- checkValidity() {
56
- this.input.checkValidity() ? this.resetValidation() : this.makeInvalid();
57
- }
58
- setCustomValidity(i = "") {
59
- this.input.setCustomValidity(i), this.checkValidity();
60
- }
61
- makeInvalid() {
62
- this.errorMessage = this.errorMessage || this.input.validationMessage, this.showErrorMessage = !0, this.emit("sl-invalid"), this.toggleValidationAttributes(!1);
63
- }
64
- resetValidation() {
65
- this.showErrorMessage = !1, this.toggleValidationAttributes(!0);
66
- }
67
- /** Toggler riktig validering attribute for å vise riktig style */
68
- toggleValidationAttributes(i) {
69
- this.toggleAttribute("data-valid", i), this.toggleAttribute("data-user-valid", i), this.toggleAttribute("data-invalid", !i), this.toggleAttribute("data-user-invalid", !i);
70
- }
71
- // eslint-disable-next-line max-lines-per-function
72
- render() {
73
- const i = !!this.querySelector('[slot="label"]');
74
- return o`
75
- <div part="form-control" class=${g({ "form-control": !0, "form-control--has-label": this.label })}>
76
- ${i ? o`<slot name="label"></slot>` : this.label ? o`<nve-label
7
+ import "../../chunks/nve-label.component.js";
8
+ import d from "./nve-textarea.styles.js";
9
+ //#region src/components/nve-textarea/nve-textarea.component.ts
10
+ var f = class extends n {
11
+ static {
12
+ this.styles = [d];
13
+ }
14
+ constructor() {
15
+ super(), this.name = "", this.value = "", this.title = "", this.filled = !1, this.label = "", this.helpText = "", this.hint = "", this.disabled = !1, this.readonly = !1, this.placeholder = "", this.required = !1, this.requiredLabel = "*Obligatorisk", this.autocapitalize = "off", this.autocorrect = "off", this.testId = "", this.showErrorMessage = !1, this.touched = !1, this.resizeObserver = null;
16
+ }
17
+ firstUpdated() {
18
+ if (this.requiredLabel && this.style.setProperty("--textarea-required-content", `"${this.requiredLabel}"`), this.required) {
19
+ let e = this.input.checkValidity();
20
+ this.toggleAttribute("data-valid", e), this.toggleAttribute("data-invalid", !e);
21
+ }
22
+ let e = this.shadowRoot?.querySelector(".textarea__control"), t = this.shadowRoot?.querySelector(".textarea__label");
23
+ e && t && (this.resizeObserver = new ResizeObserver((e) => {
24
+ for (let n of e) t.style.width = `${n.contentRect.width + 32}px`;
25
+ }), this.resizeObserver.observe(e));
26
+ }
27
+ connectedCallback() {
28
+ super.connectedCallback(), this.closest("form")?.addEventListener("submit", this.handleSubmit.bind(this));
29
+ }
30
+ disconnectedCallback() {
31
+ super.disconnectedCallback(), this.closest("form")?.removeEventListener("submit", this.handleSubmit.bind(this)), this.resizeObserver?.disconnect();
32
+ }
33
+ emit(e) {
34
+ this.dispatchEvent(new CustomEvent(e));
35
+ }
36
+ handleSubmit(e) {
37
+ e.preventDefault(), this.checkValidity();
38
+ }
39
+ handleBlur() {
40
+ this.touched && this.checkValidity(), this.emit("sl-blur");
41
+ }
42
+ handleChange() {
43
+ this.value = this.input.value, this.emit("sl-change");
44
+ }
45
+ handleInput() {
46
+ this.touched = !0, this.value = this.input.value, this.emit("sl-input");
47
+ }
48
+ checkValidity() {
49
+ this.input.checkValidity() ? this.resetValidation() : this.makeInvalid();
50
+ }
51
+ setCustomValidity(e = "") {
52
+ this.input.setCustomValidity(e), this.checkValidity();
53
+ }
54
+ makeInvalid() {
55
+ this.errorMessage = this.errorMessage || this.input.validationMessage, this.showErrorMessage = !0, this.emit("sl-invalid"), this.toggleValidationAttributes(!1);
56
+ }
57
+ resetValidation() {
58
+ this.showErrorMessage = !1, this.toggleValidationAttributes(!0);
59
+ }
60
+ toggleValidationAttributes(e) {
61
+ this.toggleAttribute("data-valid", e), this.toggleAttribute("data-user-valid", e), this.toggleAttribute("data-invalid", !e), this.toggleAttribute("data-user-invalid", !e);
62
+ }
63
+ render() {
64
+ let n = !!this.querySelector("[slot=\"label\"]");
65
+ return e`
66
+ <div part="form-control" class=${c({
67
+ "form-control": !0,
68
+ "form-control--has-label": this.label
69
+ })}>
70
+ ${n ? e`<slot name="label"></slot>` : this.label ? e`<nve-label
77
71
  id="label"
78
72
  value=${this.label}
79
73
  size="small"
80
- tooltip=${r(this.tooltip)}
81
- ></nve-label>` : p}
74
+ tooltip=${l(this.tooltip)}
75
+ ></nve-label>` : t}
76
+ ${this.helpText ? e` <div part="help-text-container" class="textarea__help-text__container">
77
+ <span class="textarea__help-text" aria-hidden=${this.helpText ? "false" : "true"}>${this.helpText}</span>
78
+ </div>` : t}
79
+
82
80
  <div part="base" class="textarea__base">
83
81
  <textarea
84
82
  part="textarea"
85
83
  class="textarea__control"
86
84
  title=${this.title}
87
- name=${r(this.name)}
88
- .value=${y(this.value)}
85
+ name=${l(this.name)}
86
+ .value=${u(this.value)}
89
87
  ?disabled=${this.disabled}
90
88
  ?readonly=${this.readonly}
91
89
  ?required=${this.required}
92
- placeholder=${r(this.placeholder)}
93
- minlength=${r(this.minlength)}
94
- maxlength=${r(this.maxlength)}
95
- autocapitalize=${r(this.autocapitalize)}
96
- autocorrect=${r(this.autocorrect)}
90
+ placeholder=${l(this.placeholder)}
91
+ minlength=${l(this.minlength)}
92
+ maxlength=${l(this.maxlength)}
93
+ autocapitalize=${l(this.autocapitalize)}
94
+ autocorrect=${l(this.autocorrect)}
97
95
  ?autofocus=${this.autofocus}
98
- inputmode=${r(this.inputmode)}
96
+ inputmode=${l(this.inputmode)}
99
97
  aria-describedby="help-text"
100
- rows=${r(this.rows && this.rows >= 3 ? this.rows : 3)}
98
+ rows=${l(this.rows && this.rows >= 3 ? this.rows : 3)}
101
99
  @change=${this.handleChange}
102
100
  @input=${this.handleInput}
103
101
  @blur=${this.handleBlur}
@@ -107,95 +105,36 @@ let e = class extends m {
107
105
  Må gjøres sånn fordi vi vil ikke begrense textarea__base brede til fit-content (da textarea kan aldri ta så mye plass som er
108
106
  tilgjengelig i nettleseren og man må alltid sette brede på den manuelt. Nei takk.) -->
109
107
  <!-- Foreløpig kan man ha enten 'lock' eller 'error' ikone -->
110
- ${this.disabled || this.showErrorMessage ? o`<div class="textarea__icon__container">
111
- ${this.disabled ? o`<nve-icon name="lock"></nve-icon>` : null}
112
- ${this.showErrorMessage ? o`<nve-icon class="textarea__icon--error" name="error"></nve-icon>` : null}
113
- </div>` : p}
108
+ ${this.disabled || this.showErrorMessage ? e`<div class="textarea__icon__container">
109
+ ${this.disabled ? e`<nve-icon name="lock"></nve-icon>` : null}
110
+ ${this.showErrorMessage ? e`<nve-icon class="textarea__icon--error" name="error"></nve-icon>` : null}
111
+ </div>` : t}
114
112
  </div>
115
- <div part="help-text-container" class="textarea__help-text__container">
116
- <!-- Ikke vis hjelpe tekst mens feil -->
117
- ${!this.showErrorMessage && this.helpText ? o`<span class="textarea__help-text" aria-hidden=${this.helpText ? "false" : "true"}
118
- >${this.helpText}</span
119
- >` : p}
120
- ${this.showErrorMessage ? o`<span class="textarea__help-text textarea__help-text--error">${this.errorMessage}</span>` : p}
113
+ <div part="hint-text-container" class="textarea__hint-text__container">
114
+ <!-- Ikke vis hint dersom feil -->
115
+ ${!this.showErrorMessage && this.hint ? e`<span class="textarea__hint" aria-hidden=${this.hint ? "false" : "true"}>${this.hint}</span>` : t}
116
+ ${this.showErrorMessage ? e`<span class="textarea__help-text textarea__help-text--error">${this.errorMessage}</span>` : t}
121
117
  </div>
122
118
  </div>
123
119
  `;
124
- }
125
- };
126
- e.styles = [f];
127
- t([
128
- s()
129
- ], e.prototype, "name", 2);
130
- t([
131
- s()
132
- ], e.prototype, "value", 2);
133
- t([
134
- s()
135
- ], e.prototype, "errorMessage", 2);
136
- t([
137
- s()
138
- ], e.prototype, "title", 2);
139
- t([
140
- s({ type: Boolean, reflect: !0 })
141
- ], e.prototype, "filled", 2);
142
- t([
143
- s()
144
- ], e.prototype, "label", 2);
145
- t([
146
- s()
147
- ], e.prototype, "helpText", 2);
148
- t([
149
- s({ type: Boolean, reflect: !0 })
150
- ], e.prototype, "disabled", 2);
151
- t([
152
- s({ type: Boolean, reflect: !0 })
153
- ], e.prototype, "readonly", 2);
154
- t([
155
- s()
156
- ], e.prototype, "placeholder", 2);
157
- t([
158
- s({ type: Boolean, reflect: !0 })
159
- ], e.prototype, "required", 2);
160
- t([
161
- s()
162
- ], e.prototype, "requiredLabel", 2);
163
- t([
164
- s({ type: Number })
165
- ], e.prototype, "minlength", 2);
166
- t([
167
- s({ type: Number })
168
- ], e.prototype, "maxlength", 2);
169
- t([
170
- s()
171
- ], e.prototype, "autocapitalize", 2);
172
- t([
173
- s()
174
- ], e.prototype, "autocorrect", 2);
175
- t([
176
- s()
177
- ], e.prototype, "tooltip", 2);
178
- t([
179
- s({ reflect: !0, type: String })
180
- ], e.prototype, "testId", 2);
181
- t([
182
- s()
183
- ], e.prototype, "inputmode", 2);
184
- t([
185
- s()
186
- ], e.prototype, "rows", 2);
187
- t([
188
- u()
189
- ], e.prototype, "showErrorMessage", 2);
190
- t([
191
- u()
192
- ], e.prototype, "touched", 2);
193
- t([
194
- v(".textarea__control")
195
- ], e.prototype, "input", 2);
196
- e = t([
197
- b("nve-textarea")
198
- ], e);
199
- export {
200
- e as default
120
+ }
201
121
  };
122
+ s([i()], f.prototype, "name", void 0), s([i()], f.prototype, "value", void 0), s([i()], f.prototype, "errorMessage", void 0), s([i()], f.prototype, "title", void 0), s([i({
123
+ type: Boolean,
124
+ reflect: !0
125
+ })], f.prototype, "filled", void 0), s([i()], f.prototype, "label", void 0), s([i()], f.prototype, "helpText", void 0), s([i()], f.prototype, "hint", void 0), s([i({
126
+ type: Boolean,
127
+ reflect: !0
128
+ })], f.prototype, "disabled", void 0), s([i({
129
+ type: Boolean,
130
+ reflect: !0
131
+ })], f.prototype, "readonly", void 0), s([i()], f.prototype, "placeholder", void 0), s([i({
132
+ type: Boolean,
133
+ reflect: !0
134
+ })], f.prototype, "required", void 0), s([i()], f.prototype, "requiredLabel", void 0), s([i({ type: Number })], f.prototype, "minlength", void 0), s([i({ type: Number })], f.prototype, "maxlength", void 0), s([i()], f.prototype, "autocapitalize", void 0), s([i()], f.prototype, "autocorrect", void 0), s([i()], f.prototype, "tooltip", void 0), s([i({
135
+ reflect: !0,
136
+ type: String
137
+ })], f.prototype, "testId", void 0), s([i()], f.prototype, "inputmode", void 0), s([i()], f.prototype, "rows", void 0), s([r()], f.prototype, "showErrorMessage", void 0), s([r()], f.prototype, "touched", void 0), s([a(".textarea__control")], f.prototype, "input", void 0), f = s([o("nve-textarea")], f);
138
+ var p = f;
139
+ //#endregion
140
+ export { p as default };