@folkehelseinstituttet/designsystem 0.40.0 → 0.40.1

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 (270) hide show
  1. package/decorate-DFXIek-k.js +611 -0
  2. package/decorate-DFXIek-k.js.map +1 -0
  3. package/fhi-body.js +23 -32
  4. package/fhi-body.js.map +1 -1
  5. package/fhi-button.js +90 -112
  6. package/fhi-button.js.map +1 -1
  7. package/fhi-checkbox.js +53 -66
  8. package/fhi-checkbox.js.map +1 -1
  9. package/fhi-data-table-cell.js +23 -29
  10. package/fhi-data-table-cell.js.map +1 -1
  11. package/fhi-data-table-row.js +40 -65
  12. package/fhi-data-table-row.js.map +1 -1
  13. package/fhi-data-table.js +30 -36
  14. package/fhi-data-table.js.map +1 -1
  15. package/fhi-date-input.component-Bus7CeKM.js +278 -0
  16. package/fhi-date-input.component-Bus7CeKM.js.map +1 -0
  17. package/fhi-date-input.js +2 -305
  18. package/fhi-display.js +29 -46
  19. package/fhi-display.js.map +1 -1
  20. package/fhi-flex.js +40 -50
  21. package/fhi-flex.js.map +1 -1
  22. package/fhi-grid.js +30 -46
  23. package/fhi-grid.js.map +1 -1
  24. package/fhi-headline.js +29 -46
  25. package/fhi-headline.js.map +1 -1
  26. package/fhi-icon-arrow-down-left.js +26 -43
  27. package/fhi-icon-arrow-down-left.js.map +1 -1
  28. package/fhi-icon-arrow-down-right.js +26 -43
  29. package/fhi-icon-arrow-down-right.js.map +1 -1
  30. package/fhi-icon-arrow-down.js +26 -43
  31. package/fhi-icon-arrow-down.js.map +1 -1
  32. package/fhi-icon-arrow-left.js +26 -43
  33. package/fhi-icon-arrow-left.js.map +1 -1
  34. package/fhi-icon-arrow-right-left.js +26 -43
  35. package/fhi-icon-arrow-right-left.js.map +1 -1
  36. package/fhi-icon-arrow-right.js +26 -43
  37. package/fhi-icon-arrow-right.js.map +1 -1
  38. package/fhi-icon-arrow-up-down.js +26 -43
  39. package/fhi-icon-arrow-up-down.js.map +1 -1
  40. package/fhi-icon-arrow-up-left.js +26 -43
  41. package/fhi-icon-arrow-up-left.js.map +1 -1
  42. package/fhi-icon-arrow-up-right.js +26 -43
  43. package/fhi-icon-arrow-up-right.js.map +1 -1
  44. package/fhi-icon-arrow-up.js +26 -43
  45. package/fhi-icon-arrow-up.js.map +1 -1
  46. package/fhi-icon-bell.js +26 -43
  47. package/fhi-icon-bell.js.map +1 -1
  48. package/fhi-icon-calendar-clock.js +26 -43
  49. package/fhi-icon-calendar-clock.js.map +1 -1
  50. package/fhi-icon-calendar.js +26 -43
  51. package/fhi-icon-calendar.js.map +1 -1
  52. package/fhi-icon-chart-bar-stacked.js +26 -43
  53. package/fhi-icon-chart-bar-stacked.js.map +1 -1
  54. package/fhi-icon-chart-bar.js +26 -43
  55. package/fhi-icon-chart-bar.js.map +1 -1
  56. package/fhi-icon-chart-column-stacked.js +26 -43
  57. package/fhi-icon-chart-column-stacked.js.map +1 -1
  58. package/fhi-icon-chart-column.js +26 -43
  59. package/fhi-icon-chart-column.js.map +1 -1
  60. package/fhi-icon-chart-line.js +26 -43
  61. package/fhi-icon-chart-line.js.map +1 -1
  62. package/fhi-icon-chart-no-axes-combined.js +26 -43
  63. package/fhi-icon-chart-no-axes-combined.js.map +1 -1
  64. package/fhi-icon-chart-pie.js +26 -43
  65. package/fhi-icon-chart-pie.js.map +1 -1
  66. package/fhi-icon-check.js +26 -43
  67. package/fhi-icon-check.js.map +1 -1
  68. package/fhi-icon-chevron-down.js +26 -43
  69. package/fhi-icon-chevron-down.js.map +1 -1
  70. package/fhi-icon-chevron-left.js +26 -43
  71. package/fhi-icon-chevron-left.js.map +1 -1
  72. package/fhi-icon-chevron-right.js +26 -43
  73. package/fhi-icon-chevron-right.js.map +1 -1
  74. package/fhi-icon-chevron-up.js +26 -43
  75. package/fhi-icon-chevron-up.js.map +1 -1
  76. package/fhi-icon-chevrons-down.js +26 -43
  77. package/fhi-icon-chevrons-down.js.map +1 -1
  78. package/fhi-icon-chevrons-left.js +26 -43
  79. package/fhi-icon-chevrons-left.js.map +1 -1
  80. package/fhi-icon-chevrons-right.js +26 -43
  81. package/fhi-icon-chevrons-right.js.map +1 -1
  82. package/fhi-icon-chevrons-up.js +26 -43
  83. package/fhi-icon-chevrons-up.js.map +1 -1
  84. package/fhi-icon-circle-arrow-down.js +26 -43
  85. package/fhi-icon-circle-arrow-down.js.map +1 -1
  86. package/fhi-icon-circle-arrow-left.js +26 -43
  87. package/fhi-icon-circle-arrow-left.js.map +1 -1
  88. package/fhi-icon-circle-arrow-right.js +26 -43
  89. package/fhi-icon-circle-arrow-right.js.map +1 -1
  90. package/fhi-icon-circle-arrow-up.js +26 -43
  91. package/fhi-icon-circle-arrow-up.js.map +1 -1
  92. package/fhi-icon-circle-check-big.js +26 -43
  93. package/fhi-icon-circle-check-big.js.map +1 -1
  94. package/fhi-icon-circle-check.js +26 -43
  95. package/fhi-icon-circle-check.js.map +1 -1
  96. package/fhi-icon-circle-chevron-down.js +26 -43
  97. package/fhi-icon-circle-chevron-down.js.map +1 -1
  98. package/fhi-icon-circle-chevron-left.js +26 -43
  99. package/fhi-icon-circle-chevron-left.js.map +1 -1
  100. package/fhi-icon-circle-chevron-right.js +26 -43
  101. package/fhi-icon-circle-chevron-right.js.map +1 -1
  102. package/fhi-icon-circle-chevron-up.js +26 -43
  103. package/fhi-icon-circle-chevron-up.js.map +1 -1
  104. package/fhi-icon-circle-exclamation.js +26 -43
  105. package/fhi-icon-circle-exclamation.js.map +1 -1
  106. package/fhi-icon-circle-info.js +26 -43
  107. package/fhi-icon-circle-info.js.map +1 -1
  108. package/fhi-icon-circle-minus.js +26 -43
  109. package/fhi-icon-circle-minus.js.map +1 -1
  110. package/fhi-icon-circle-plus.js +26 -43
  111. package/fhi-icon-circle-plus.js.map +1 -1
  112. package/fhi-icon-circle-question.js +26 -43
  113. package/fhi-icon-circle-question.js.map +1 -1
  114. package/fhi-icon-circle-x.js +26 -43
  115. package/fhi-icon-circle-x.js.map +1 -1
  116. package/fhi-icon-circle.js +26 -43
  117. package/fhi-icon-circle.js.map +1 -1
  118. package/fhi-icon-clock.js +26 -43
  119. package/fhi-icon-clock.js.map +1 -1
  120. package/fhi-icon-copy.js +26 -43
  121. package/fhi-icon-copy.js.map +1 -1
  122. package/fhi-icon-download.js +26 -43
  123. package/fhi-icon-download.js.map +1 -1
  124. package/fhi-icon-ellipsis-vertical.js +26 -43
  125. package/fhi-icon-ellipsis-vertical.js.map +1 -1
  126. package/fhi-icon-ellipsis.js +26 -43
  127. package/fhi-icon-ellipsis.js.map +1 -1
  128. package/fhi-icon-exclamation.js +26 -43
  129. package/fhi-icon-exclamation.js.map +1 -1
  130. package/fhi-icon-expand.js +26 -43
  131. package/fhi-icon-expand.js.map +1 -1
  132. package/fhi-icon-external-link.js +26 -43
  133. package/fhi-icon-external-link.js.map +1 -1
  134. package/fhi-icon-eye-off.js +26 -43
  135. package/fhi-icon-eye-off.js.map +1 -1
  136. package/fhi-icon-eye.js +26 -43
  137. package/fhi-icon-eye.js.map +1 -1
  138. package/fhi-icon-file-text.js +26 -43
  139. package/fhi-icon-file-text.js.map +1 -1
  140. package/fhi-icon-file.js +26 -43
  141. package/fhi-icon-file.js.map +1 -1
  142. package/fhi-icon-filter.js +26 -43
  143. package/fhi-icon-filter.js.map +1 -1
  144. package/fhi-icon-folder.js +26 -43
  145. package/fhi-icon-folder.js.map +1 -1
  146. package/fhi-icon-gear.js +26 -43
  147. package/fhi-icon-gear.js.map +1 -1
  148. package/fhi-icon-grid-9-dots.js +26 -43
  149. package/fhi-icon-grid-9-dots.js.map +1 -1
  150. package/fhi-icon-grip-horizontal.js +26 -43
  151. package/fhi-icon-grip-horizontal.js.map +1 -1
  152. package/fhi-icon-grip-vertical.js +26 -43
  153. package/fhi-icon-grip-vertical.js.map +1 -1
  154. package/fhi-icon-history.js +26 -43
  155. package/fhi-icon-history.js.map +1 -1
  156. package/fhi-icon-info.js +26 -43
  157. package/fhi-icon-info.js.map +1 -1
  158. package/fhi-icon-link-2-off.js +26 -43
  159. package/fhi-icon-link-2-off.js.map +1 -1
  160. package/fhi-icon-link-2.js +26 -43
  161. package/fhi-icon-link-2.js.map +1 -1
  162. package/fhi-icon-link.js +26 -43
  163. package/fhi-icon-link.js.map +1 -1
  164. package/fhi-icon-lock-open.js +26 -43
  165. package/fhi-icon-lock-open.js.map +1 -1
  166. package/fhi-icon-lock.js +26 -43
  167. package/fhi-icon-lock.js.map +1 -1
  168. package/fhi-icon-log-in.js +26 -43
  169. package/fhi-icon-log-in.js.map +1 -1
  170. package/fhi-icon-log-out.js +26 -43
  171. package/fhi-icon-log-out.js.map +1 -1
  172. package/fhi-icon-mail.js +26 -43
  173. package/fhi-icon-mail.js.map +1 -1
  174. package/fhi-icon-map-pin.js +26 -43
  175. package/fhi-icon-map-pin.js.map +1 -1
  176. package/fhi-icon-menu.js +26 -43
  177. package/fhi-icon-menu.js.map +1 -1
  178. package/fhi-icon-message.js +26 -43
  179. package/fhi-icon-message.js.map +1 -1
  180. package/fhi-icon-minus.js +26 -43
  181. package/fhi-icon-minus.js.map +1 -1
  182. package/fhi-icon-octagon-alert.js +26 -43
  183. package/fhi-icon-octagon-alert.js.map +1 -1
  184. package/fhi-icon-paperclip.js +26 -43
  185. package/fhi-icon-paperclip.js.map +1 -1
  186. package/fhi-icon-pencil.js +26 -43
  187. package/fhi-icon-pencil.js.map +1 -1
  188. package/fhi-icon-phone.js +26 -43
  189. package/fhi-icon-phone.js.map +1 -1
  190. package/fhi-icon-pin-off.js +26 -43
  191. package/fhi-icon-pin-off.js.map +1 -1
  192. package/fhi-icon-pin.js +26 -43
  193. package/fhi-icon-pin.js.map +1 -1
  194. package/fhi-icon-plus.js +26 -43
  195. package/fhi-icon-plus.js.map +1 -1
  196. package/fhi-icon-printer.js +26 -43
  197. package/fhi-icon-printer.js.map +1 -1
  198. package/fhi-icon-question.js +26 -43
  199. package/fhi-icon-question.js.map +1 -1
  200. package/fhi-icon-refresh.js +26 -43
  201. package/fhi-icon-refresh.js.map +1 -1
  202. package/fhi-icon-rotate-left.js +26 -43
  203. package/fhi-icon-rotate-left.js.map +1 -1
  204. package/fhi-icon-rotate-right.js +26 -43
  205. package/fhi-icon-rotate-right.js.map +1 -1
  206. package/fhi-icon-search.js +26 -43
  207. package/fhi-icon-search.js.map +1 -1
  208. package/fhi-icon-send.js +26 -43
  209. package/fhi-icon-send.js.map +1 -1
  210. package/fhi-icon-share.js +26 -43
  211. package/fhi-icon-share.js.map +1 -1
  212. package/fhi-icon-sheet.js +26 -43
  213. package/fhi-icon-sheet.js.map +1 -1
  214. package/fhi-icon-square-check-big.js +26 -43
  215. package/fhi-icon-square-check-big.js.map +1 -1
  216. package/fhi-icon-square-check.js +26 -43
  217. package/fhi-icon-square-check.js.map +1 -1
  218. package/fhi-icon-square-pen.js +26 -43
  219. package/fhi-icon-square-pen.js.map +1 -1
  220. package/fhi-icon-square-x.js +26 -43
  221. package/fhi-icon-square-x.js.map +1 -1
  222. package/fhi-icon-square.js +26 -43
  223. package/fhi-icon-square.js.map +1 -1
  224. package/fhi-icon-trash.js +26 -43
  225. package/fhi-icon-trash.js.map +1 -1
  226. package/fhi-icon-triangle-alert.js +26 -43
  227. package/fhi-icon-triangle-alert.js.map +1 -1
  228. package/fhi-icon-upload.js +26 -43
  229. package/fhi-icon-upload.js.map +1 -1
  230. package/fhi-icon-user.js +26 -43
  231. package/fhi-icon-user.js.map +1 -1
  232. package/fhi-icon-x.js +26 -43
  233. package/fhi-icon-x.js.map +1 -1
  234. package/fhi-label.js +23 -32
  235. package/fhi-label.js.map +1 -1
  236. package/fhi-modal-dialog.js +76 -111
  237. package/fhi-modal-dialog.js.map +1 -1
  238. package/fhi-radio.js +91 -109
  239. package/fhi-radio.js.map +1 -1
  240. package/fhi-tag.js +32 -44
  241. package/fhi-tag.js.map +1 -1
  242. package/fhi-text-input.js +96 -126
  243. package/fhi-text-input.js.map +1 -1
  244. package/fhi-title.js +29 -46
  245. package/fhi-title.js.map +1 -1
  246. package/fhi-tooltip.component-DJNDfrHK.js +919 -0
  247. package/fhi-tooltip.component-DJNDfrHK.js.map +1 -0
  248. package/fhi-tooltip.js +2 -1162
  249. package/fonts/RobotoFlex.ttf.js.map +1 -1
  250. package/if-defined-Dl-W5B5_.js +7 -0
  251. package/if-defined-Dl-W5B5_.js.map +1 -0
  252. package/index.js +123 -369
  253. package/package.json +1 -1
  254. package/theme/default.css +1 -1
  255. package/unsafe-html-CBTN3162.js +50 -0
  256. package/unsafe-html-CBTN3162.js.map +1 -0
  257. package/web-types.json +1 -1
  258. package/base-D76d76ww.js +0 -10
  259. package/base-D76d76ww.js.map +0 -1
  260. package/fhi-date-input.js.map +0 -1
  261. package/fhi-tooltip.js.map +0 -1
  262. package/if-defined-B_sR6Mtk.js +0 -11
  263. package/if-defined-B_sR6Mtk.js.map +0 -1
  264. package/index.js.map +0 -1
  265. package/property-B2Ico5CW.js +0 -605
  266. package/property-B2Ico5CW.js.map +0 -1
  267. package/query-Ddbd72Um.js +0 -21
  268. package/query-Ddbd72Um.js.map +0 -1
  269. package/unsafe-html-DfuTUjUu.js +0 -48
  270. package/unsafe-html-DfuTUjUu.js.map +0 -1
package/fhi-date-input.js CHANGED
@@ -1,306 +1,3 @@
1
- import { i as c, n as r, a as u, b as l, t as f } from "./property-B2Ico5CW.js";
2
- import { e as g } from "./query-Ddbd72Um.js";
3
- import { o as p } from "./if-defined-B_sR6Mtk.js";
4
1
  import "./fhi-icon-calendar.js";
5
- const v = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
6
- var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (e, i, s, n) => {
7
- for (var o = n > 1 ? void 0 : n ? y(i, s) : i, h = e.length - 1, d; h >= 0; h--)
8
- (d = e[h]) && (o = (n ? d(i, s, o) : d(o)) || o);
9
- return n && o && b(i, s, o), o;
10
- };
11
- const m = "fhi-date-input";
12
- let t = class extends u {
13
- constructor() {
14
- super(), this.label = void 0, this.message = void 0, this.helpText = void 0, this.min = void 0, this.max = void 0, this.status = void 0, this.readonly = !1, this.disabled = !1, this._name = void 0, this._value = "", this._internals = this.attachInternals();
15
- }
16
- get name() {
17
- return this._name;
18
- }
19
- set name(e) {
20
- const i = this._name;
21
- this._name = e, this.requestUpdate("name", i), this._internals.setFormValue(this.value ?? null);
22
- }
23
- get value() {
24
- return this._value;
25
- }
26
- set value(e) {
27
- const i = this._value;
28
- this._value = e, this.requestUpdate("value", i), this._internals.setFormValue(this._value ?? null);
29
- }
30
- connectedCallback() {
31
- super.connectedCallback(), this._internals.setFormValue(this.value ?? null);
32
- }
33
- _handleChange() {
34
- this._dispatchChangeEvent();
35
- }
36
- _dispatchChangeEvent() {
37
- this.dispatchEvent(
38
- new Event("change", {
39
- bubbles: !0,
40
- composed: !0
41
- })
42
- );
43
- }
44
- _handleInput(e) {
45
- this.value = this._input.value, this._internals.setFormValue(this.value ?? null), e.stopPropagation(), this._dispatchInputEvent();
46
- }
47
- _dispatchInputEvent() {
48
- this.dispatchEvent(
49
- new Event("input", {
50
- bubbles: !0,
51
- composed: !0
52
- })
53
- );
54
- }
55
- _handleKeyDown(e) {
56
- e.key === "Enter" && this._internals.form && this._internals.form.requestSubmit();
57
- }
58
- formResetCallback() {
59
- this.value = this.getAttribute("value"), this._internals.setFormValue(this.value ?? null);
60
- }
61
- _showDate(e) {
62
- e && e.type == "keydown" && e.key !== "Enter" && e.code !== "Space" || this._input.showPicker();
63
- }
64
- render() {
65
- return l`
66
- ${this.label && l`<label for="input-element">${this.label}</label>`}
67
- ${this.helpText && l`<p class="help-text">${this.helpText}</p>`}
68
- <div class="input-container">
69
- <input
70
- type="date"
71
- id="input-element"
72
- name=${p(this.name)}
73
- min=${p(this.min)}
74
- max=${p(this.max)}
75
- .value=${this.value ?? ""}
76
- ?readonly=${this.readonly}
77
- ?disabled=${this.disabled}
78
- @change=${this._handleChange}
79
- @input=${this._handleInput}
80
- @keydown=${this._handleKeyDown}
81
- />
82
- <span
83
- class="date-icon"
84
- @click=${this._showDate}
85
- @keydown=${this._showDate}
86
- tabindex=${v() ? "-1" : "0"}
87
- role="button"
88
- aria-label="Vis datovelger"
89
- aria-haspopup="true"
90
- ><fhi-icon-calendar></fhi-icon-calendar
91
- ></span>
92
- </div>
93
- ${this.message && l`<p class="message">${this.message}</p>`}
94
- `;
95
- }
96
- };
97
- t.formAssociated = !0;
98
- t.styles = c`
99
- :host {
100
- display: flex;
101
- flex-direction: column;
102
- font-family: var(--fhi-font-family-default);
103
- -webkit-font-smoothing: antialiased;
104
- width: calc(var(--fhi-spacing-1000) * 2);
105
-
106
- label {
107
- font-weight: var(--fhi-typography-label-small-font-weight);
108
- font-size: var(--fhi-typography-label-small-font-size);
109
- line-height: var(--fhi-typography-label-small-line-height);
110
- letter-spacing: var(--fhi-typography-label-small-letter-spacing);
111
- color: var(--fhi-color-neutral-text-default);
112
- margin: 0 0 var(--fhi-spacing-050) 0;
113
- }
114
- label:has(+ p) {
115
- margin: 0 0 0 0;
116
- }
117
-
118
- input[type='date'] {
119
- font-family: var(--fhi-font-family-default);
120
- font-weight: var(--fhi-typography-body-medium-font-weight);
121
- font-size: var(--fhi-typography-body-medium-font-size);
122
- line-height: var(--fhi-typography-body-medium-line-height);
123
- letter-spacing: var(--fhi-typography-body-medium-letter-spacing);
124
- box-sizing: border-box;
125
- height: var(--fhi-spacing-500);
126
- border: var(--fhi-dimension-border-width) solid
127
- var(--fhi-color-neutral-border-default);
128
- border-radius: var(--fhi-border-radius-050);
129
- padding: 0 var(--fhi-spacing-150) 0 var(--fhi-spacing-150);
130
-
131
- color: var(--fhi-color-neutral-text-default);
132
- background-color: var(--fhi-color-neutral-background-default);
133
- transition: all var(--fhi-motion-ease-default)
134
- var(--fhi-motion-duration-quick);
135
- appearance: none;
136
- -moz-appearance: none;
137
- -webkit-appearance: none;
138
- width: 100%;
139
- &:hover {
140
- border-color: var(--fhi-color-accent-border-default);
141
- background-color: var(--fhi-color-accent-background-subtle);
142
- }
143
- &:focus {
144
- border-color: var(--fhi-color-accent-border-strong);
145
- background-color: var(--fhi-color-accent-background-default);
146
- }
147
- }
148
- .message {
149
- margin: var(--fhi-spacing-050) 0 0 0;
150
- color: var(--fhi-color-neutral-text-default);
151
- font-weight: var(--fhi-typography-body-small-font-weight);
152
- font-size: var(--fhi-typography-body-small-font-size);
153
- line-height: var(--fhi-typography-body-small-line-height);
154
- letter-spacing: var(--fhi-typography-body-small-letter-spacing);
155
- }
156
-
157
- .help-text {
158
- color: var(--fhi-color-neutral-text-subtle);
159
- font-weight: var(--fhi-typography-body-small-font-weight);
160
- font-size: var(--fhi-typography-body-small-font-size);
161
- line-height: var(--fhi-typography-body-small-line-height);
162
- letter-spacing: var(--fhi-typography-body-small-letter-spacing);
163
- margin: 0 0 var(--fhi-spacing-050) 0;
164
- }
165
- [type='date']::-webkit-inner-spin-button {
166
- opacity: 0;
167
- }
168
- [type='date']::-webkit-calendar-picker-indicator {
169
- opacity: 0;
170
- -webkit-appearance: none;
171
- display: none;
172
- visibility: hidden;
173
-
174
- &:target {
175
- outline: solid;
176
- font-size: 5rem;
177
- }
178
- }
179
- .input-container {
180
- height: var(--fhi-spacing-500);
181
- position: relative;
182
- }
183
- .date-icon {
184
- position: absolute;
185
- right: 0;
186
- top: 50%;
187
- transform: translateY(-50%);
188
- margin-right: var(--fhi-spacing-100);
189
- height: fit-content;
190
- transition: all var(--fhi-motion-ease-default)
191
- var(--fhi-motion-duration-quick);
192
- border-radius: var(--fhi-border-radius-050);
193
- &:focus {
194
- outline: solid var(--fhi-color-accent-border-default);
195
- }
196
- }
197
- }
198
-
199
- :host([disabled]) {
200
- opacity: var(--fhi-opacity-disabled);
201
- cursor: not-allowed;
202
- * {
203
- cursor: not-allowed;
204
- }
205
- input[type='date'] {
206
- &:hover {
207
- border-color: var(--fhi-color-neutral-border-default);
208
- background-color: var(--fhi-color-neutral-background-default);
209
- }
210
- }
211
- .date-icon {
212
- background-color: unset;
213
- &:focus {
214
- outline: none;
215
- }
216
- }
217
- }
218
-
219
- :host([readonly]:not([disabled])) {
220
- input[type='date'] {
221
- border: unset;
222
- border-radius: unset;
223
- background-color: unset;
224
- border-left: var(--fhi-dimension-border-width) solid
225
- var(--fhi-color-neutral-border-default);
226
- &:hover + .date-icon {
227
- background-color: unset;
228
- }
229
- }
230
- .date-icon {
231
- background-color: unset;
232
- display: none;
233
- }
234
- }
235
-
236
- :host([status='error']:not([disabled]):not([readonly])) {
237
- label {
238
- color: var(--fhi-color-danger-text-default);
239
- }
240
- input[type='date'] {
241
- border-color: var(--fhi-color-danger-border-strong);
242
- background-color: var(--fhi-color-danger-background-default);
243
- color: var(--fhi-color-danger-text-default);
244
- }
245
- .message {
246
- color: var(--fhi-color-danger-text-subtle);
247
- }
248
- .help-text {
249
- color: var(--fhi-color-danger-text-default);
250
- }
251
- .date-icon {
252
- background-color: var(--fhi-color-danger-background-default);
253
- color: var(--fhi-color-danger-text-default);
254
- }
255
- }
256
-
257
- @-moz-document url-prefix() {
258
- :host {
259
- .date-icon {
260
- display: none;
261
- visibility: hidden;
262
- }
263
- }
264
- }
265
- `;
266
- a([
267
- r({ type: String })
268
- ], t.prototype, "label", 2);
269
- a([
270
- r({ type: String })
271
- ], t.prototype, "message", 2);
272
- a([
273
- r({ type: String, attribute: "help-text" })
274
- ], t.prototype, "helpText", 2);
275
- a([
276
- r({ type: String })
277
- ], t.prototype, "min", 2);
278
- a([
279
- r({ type: String })
280
- ], t.prototype, "max", 2);
281
- a([
282
- r({ type: String, reflect: !0 })
283
- ], t.prototype, "status", 2);
284
- a([
285
- r({ type: Boolean, reflect: !0 })
286
- ], t.prototype, "readonly", 2);
287
- a([
288
- r({ type: Boolean, reflect: !0 })
289
- ], t.prototype, "disabled", 2);
290
- a([
291
- g("#input-element")
292
- ], t.prototype, "_input", 2);
293
- a([
294
- r({ type: String, reflect: !0 })
295
- ], t.prototype, "name", 1);
296
- a([
297
- r({ type: String })
298
- ], t.prototype, "value", 1);
299
- t = a([
300
- f(m)
301
- ], t);
302
- export {
303
- t as FhiDateInput,
304
- m as FhiDateInputSelector
305
- };
306
- //# sourceMappingURL=fhi-date-input.js.map
2
+ import { n as e, t } from "./fhi-date-input.component-Bus7CeKM.js";
3
+ export { t as FhiDateInput, e as FhiDateInputSelector };
package/fhi-display.js CHANGED
@@ -1,36 +1,26 @@
1
- import { i as y, n as h, a as n, b as f, t as g } from "./property-B2Ico5CW.js";
2
- import { o as m } from "./unsafe-html-DfuTUjUu.js";
3
- var d = Object.defineProperty, c = Object.getOwnPropertyDescriptor, s = (e, t, a, r) => {
4
- for (var i = r > 1 ? void 0 : r ? c(t, a) : t, o = e.length - 1, p; o >= 0; o--)
5
- (p = e[o]) && (i = (r ? p(t, a, i) : p(i)) || i);
6
- return r && i && d(t, a, i), i;
7
- };
8
- const v = "fhi-display";
9
- let l = class extends n {
10
- constructor() {
11
- super(...arguments), this.size = "medium", this.color = "currentcolor";
12
- }
13
- updated(e) {
14
- if (super.updated(e), e.has("level")) {
15
- const t = Number(this.level);
16
- (isNaN(t) || t < 1 || t > 6) && console.error(
17
- new TypeError(
18
- `The level property must be set to a number between 1 and 6. Current value: ${this.level}`
19
- )
20
- );
21
- }
22
- e.has("color") && (this.style.color = typeof this.color == "string" ? this.color : "currentcolor");
23
- }
24
- render() {
25
- const e = `
1
+ import { a as e, d as t, o as n, s as r, t as i, u as a } from "./decorate-DFXIek-k.js";
2
+ import { t as o } from "./unsafe-html-CBTN3162.js";
3
+ //#region src/components/typography/fhi-display/fhi-display.component.ts
4
+ var s = "fhi-display", c = class extends r {
5
+ constructor(...e) {
6
+ super(...e), this.size = "medium", this.color = "currentcolor";
7
+ }
8
+ updated(e) {
9
+ if (super.updated(e), e.has("level")) {
10
+ let e = Number(this.level);
11
+ (isNaN(e) || e < 1 || e > 6) && console.error(/* @__PURE__ */ TypeError(`The level property must be set to a number between 1 and 6. Current value: ${this.level}`));
12
+ }
13
+ e.has("color") && (this.style.color = typeof this.color == "string" ? this.color : "currentcolor");
14
+ }
15
+ render() {
16
+ return a`${o(`
26
17
  <h${this.level} class="display">
27
18
  <slot></slot>
28
19
  </h${this.level}>
29
- `;
30
- return f`${m(e)}`;
31
- }
32
- };
33
- l.styles = y`
20
+ `)}`;
21
+ }
22
+ static {
23
+ this.styles = t`
34
24
  :host {
35
25
  display: block;
36
26
  contain: layout;
@@ -68,20 +58,13 @@ l.styles = y`
68
58
  }
69
59
  }
70
60
  `;
71
- s([
72
- h({ type: String, reflect: !0 })
73
- ], l.prototype, "size", 2);
74
- s([
75
- h({ type: String })
76
- ], l.prototype, "color", 2);
77
- s([
78
- h({ type: Number })
79
- ], l.prototype, "level", 2);
80
- l = s([
81
- g(v)
82
- ], l);
83
- export {
84
- l as FhiDisplay,
85
- v as FhiDisplaySelector
61
+ }
86
62
  };
87
- //# sourceMappingURL=fhi-display.js.map
63
+ i([e({
64
+ type: String,
65
+ reflect: !0
66
+ })], c.prototype, "size", void 0), i([e({ type: String })], c.prototype, "color", void 0), i([e({ type: Number })], c.prototype, "level", void 0), c = i([n(s)], c);
67
+ //#endregion
68
+ export { c as FhiDisplay, s as FhiDisplaySelector };
69
+
70
+ //# sourceMappingURL=fhi-display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fhi-display.js","sources":["../../src/components/typography/fhi-display/fhi-display.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport const FhiDisplaySelector = 'fhi-display';\n\nexport type DisplayLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/**\n * ## FHI Display\n *\n * {@link https://designsystem.fhi.no/?path=/story/komponenter-typography-display--preview}\n *\n * The `<fhi-display>` component is used to display large, eye-catching headline text in accordance with the FHI Design System guidelines.\n *\n * For smaller, less prominent title text, use the `<fhi-title>` component instead.\n *\n * For standard headline text, use the `<fhi-headline>` component instead.\n *\n * Use this component instead of the standard HTML heading elements, `<h1>` - `<h6>`, to ensure consistent styling across your application.\n *\n * @tag fhi-display\n * @element fhi-display\n *\n * @slot - The content of the fhi-display component. This should be pure text.\n */\n@customElement(FhiDisplaySelector)\nexport class FhiDisplay extends LitElement {\n /**\n * Sets the font size of the given text.\n * @reflect\n * @type {'large' | 'medium' | 'small'}\n */\n @property({ type: String, reflect: true }) size:\n | 'large'\n | 'medium'\n | 'small' = 'medium';\n\n /**\n * Sets color of the given text. It supports any valid CSS color value (e.g. hex, rgb, rgba, hsl, hsla, color names).\n *\n * It is recommended to use Design Tokens for colors defined in the FHI Design System.\n * See: {@link https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs}\n *\n * Example:\n * ```html\n * <fhi-display color=\"var(--fhi-color-primary-text-default)\">\n * This text will be in the primary text color.\n * </fhi-display>\n * ```\n *\n * @type {string}\n */\n @property({ type: String }) color?: string = 'currentcolor';\n\n /**\n * Sets the heading level for the text, corresponding to HTML heading elements `<h1>` to `<h6>`.\n * @type {1 | 2 | 3 | 4 | 5 | 6}\n */\n @property({ type: Number }) level!: DisplayLevel;\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('level')) {\n const levelAsNumber = Number(this.level);\n if (isNaN(levelAsNumber) || levelAsNumber < 1 || levelAsNumber > 6) {\n console.error(\n new TypeError(\n `The level property must be set to a number between 1 and 6. Current value: ${this.level}`,\n ),\n );\n }\n }\n\n if (changedProperties.has('color')) {\n this.style.color =\n typeof this.color === 'string' ? this.color : 'currentcolor';\n }\n }\n\n render() {\n const template = `\n <h${this.level} class=\"display\">\n <slot></slot>\n </h${this.level}>\n `;\n return html`${unsafeHTML(template)}`;\n }\n\n static styles = css`\n :host {\n display: block;\n contain: layout;\n .display {\n font-family: var(--fhi-font-family-default);\n -webkit-font-smoothing: antialiased;\n margin: 0;\n }\n }\n\n :host([size='large']) {\n .display {\n font-size: var(--fhi-typography-display-large-font-size);\n font-weight: var(--fhi-typography-display-large-font-weight);\n line-height: var(--fhi-typography-display-large-line-height);\n letter-spacing: var(--fhi-typography-display-large-letter-spacing);\n }\n }\n\n :host([size='medium']) {\n .display {\n font-size: var(--fhi-typography-display-medium-font-size);\n font-weight: var(--fhi-typography-display-medium-font-weight);\n line-height: var(--fhi-typography-display-medium-line-height);\n letter-spacing: var(--fhi-typography-display-medium-letter-spacing);\n }\n }\n\n :host([size='small']) {\n .display {\n font-size: var(--fhi-typography-display-small-font-size);\n font-weight: var(--fhi-typography-display-small-font-weight);\n line-height: var(--fhi-typography-display-small-line-height);\n letter-spacing: var(--fhi-typography-display-small-letter-spacing);\n }\n }\n `;\n}\n"],"names":["FhiDisplaySelector","FhiDisplay","LitElement","changedProperties","levelAsNumber","template","html","unsafeHTML","css","__decorateClass","property","customElement"],"mappings":";;;;;;;AAIO,MAAMA,IAAqB;AAuB3B,IAAMC,IAAN,cAAyBC,EAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA,GAMsC,KAAA,OAG7B,UAiBc,KAAA,QAAiB;AAAA,EAAA;AAAA,EAQ7C,QAAQC,GAAyC;AAG/C,QAFA,MAAM,QAAQA,CAAiB,GAE3BA,EAAkB,IAAI,OAAO,GAAG;AAClC,YAAMC,IAAgB,OAAO,KAAK,KAAK;AACvC,OAAI,MAAMA,CAAa,KAAKA,IAAgB,KAAKA,IAAgB,MAC/D,QAAQ;AAAA,QACN,IAAI;AAAA,UACF,8EAA8E,KAAK,KAAK;AAAA,QAAA;AAAA,MAC1F;AAAA,IAGN;AAEA,IAAID,EAAkB,IAAI,OAAO,MAC/B,KAAK,MAAM,QACT,OAAO,KAAK,SAAU,WAAW,KAAK,QAAQ;AAAA,EAEpD;AAAA,EAEA,SAAS;AACP,UAAME,IAAW;AAAA,UACX,KAAK,KAAK;AAAA;AAAA,WAET,KAAK,KAAK;AAAA;AAEjB,WAAOC,IAAOC,EAAWF,CAAQ,CAAC;AAAA,EACpC;AAwCF;AArGaJ,EA+DJ,SAASO;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAzD2BC,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAN9BT,EAMgC,WAAA,QAAA,CAAA;AAoBfQ,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA1BfT,EA0BiB,WAAA,SAAA,CAAA;AAMAQ,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhCfT,EAgCiB,WAAA,SAAA,CAAA;AAhCjBA,IAANQ,EAAA;AAAA,EADNE,EAAcX,CAAkB;AAAA,GACpBC,CAAA;"}
1
+ {"version":3,"file":"fhi-display.js","names":[],"sources":["../../src/components/typography/fhi-display/fhi-display.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport const FhiDisplaySelector = 'fhi-display';\n\nexport type DisplayLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/**\n * ## FHI Display\n *\n * {@link https://designsystem.fhi.no/?path=/story/komponenter-typography-display--preview}\n *\n * The `<fhi-display>` component is used to display large, eye-catching headline text in accordance with the FHI Design System guidelines.\n *\n * For smaller, less prominent title text, use the `<fhi-title>` component instead.\n *\n * For standard headline text, use the `<fhi-headline>` component instead.\n *\n * Use this component instead of the standard HTML heading elements, `<h1>` - `<h6>`, to ensure consistent styling across your application.\n *\n * @tag fhi-display\n * @element fhi-display\n *\n * @slot - The content of the fhi-display component. This should be pure text.\n */\n@customElement(FhiDisplaySelector)\nexport class FhiDisplay extends LitElement {\n /**\n * Sets the font size of the given text.\n * @reflect\n * @type {'large' | 'medium' | 'small'}\n */\n @property({ type: String, reflect: true }) size:\n | 'large'\n | 'medium'\n | 'small' = 'medium';\n\n /**\n * Sets color of the given text. It supports any valid CSS color value (e.g. hex, rgb, rgba, hsl, hsla, color names).\n *\n * It is recommended to use Design Tokens for colors defined in the FHI Design System.\n * See: {@link https://designsystem.fhi.no/?path=/docs/design-tokens-farger--docs}\n *\n * Example:\n * ```html\n * <fhi-display color=\"var(--fhi-color-primary-text-default)\">\n * This text will be in the primary text color.\n * </fhi-display>\n * ```\n *\n * @type {string}\n */\n @property({ type: String }) color?: string = 'currentcolor';\n\n /**\n * Sets the heading level for the text, corresponding to HTML heading elements `<h1>` to `<h6>`.\n * @type {1 | 2 | 3 | 4 | 5 | 6}\n */\n @property({ type: Number }) level!: DisplayLevel;\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('level')) {\n const levelAsNumber = Number(this.level);\n if (isNaN(levelAsNumber) || levelAsNumber < 1 || levelAsNumber > 6) {\n console.error(\n new TypeError(\n `The level property must be set to a number between 1 and 6. Current value: ${this.level}`,\n ),\n );\n }\n }\n\n if (changedProperties.has('color')) {\n this.style.color =\n typeof this.color === 'string' ? this.color : 'currentcolor';\n }\n }\n\n render() {\n const template = `\n <h${this.level} class=\"display\">\n <slot></slot>\n </h${this.level}>\n `;\n return html`${unsafeHTML(template)}`;\n }\n\n static styles = css`\n :host {\n display: block;\n contain: layout;\n .display {\n font-family: var(--fhi-font-family-default);\n -webkit-font-smoothing: antialiased;\n margin: 0;\n }\n }\n\n :host([size='large']) {\n .display {\n font-size: var(--fhi-typography-display-large-font-size);\n font-weight: var(--fhi-typography-display-large-font-weight);\n line-height: var(--fhi-typography-display-large-line-height);\n letter-spacing: var(--fhi-typography-display-large-letter-spacing);\n }\n }\n\n :host([size='medium']) {\n .display {\n font-size: var(--fhi-typography-display-medium-font-size);\n font-weight: var(--fhi-typography-display-medium-font-weight);\n line-height: var(--fhi-typography-display-medium-line-height);\n letter-spacing: var(--fhi-typography-display-medium-letter-spacing);\n }\n }\n\n :host([size='small']) {\n .display {\n font-size: var(--fhi-typography-display-small-font-size);\n font-weight: var(--fhi-typography-display-small-font-weight);\n line-height: var(--fhi-typography-display-small-line-height);\n letter-spacing: var(--fhi-typography-display-small-letter-spacing);\n }\n }\n `;\n}\n"],"mappings":";;;AAIA,IAAa,IAAqB,eAuB3B,IAAA,cAAyB,EAAW;;2BAS3B,uBAiB+B;;CAQ7C,QAAQ,GAAyC;EAG/C,IAFA,MAAM,QAAQ,CAAiB,GAE3B,EAAkB,IAAI,OAAO,GAAG;GAClC,IAAM,IAAgB,OAAO,KAAK,KAAK;GACvC,CAAI,MAAM,CAAa,KAAK,IAAgB,KAAK,IAAgB,MAC/D,QAAQ,MACN,gBAAI,UACF,8EAA8E,KAAK,OACrF,CACF;EAEJ;EAEA,AAAI,EAAkB,IAAI,OAAO,MAC/B,KAAK,MAAM,QACT,OAAO,KAAK,SAAU,WAAW,KAAK,QAAQ;CAEpD;CAEA,SAAS;EAMP,OAAO,CAAI,GAAG,EAAW;UAJnB,KAAK,MAAM;;WAEV,KAAK,MAAM;KAEe;CACnC;;gBAEgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCrB;GA/FG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAoBxC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,MAMzB,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,UAjC3B,EAAc,CAAkB,CAAA,GAAA,CAAA"}
package/fhi-flex.js CHANGED
@@ -1,31 +1,28 @@
1
- import { i as g, n, a as h, b as m, t as c } from "./property-B2Ico5CW.js";
2
- var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, i = (s, a, r, o) => {
3
- for (var e = o > 1 ? void 0 : o ? f(a, r) : a, p = s.length - 1, l; p >= 0; p--)
4
- (l = s[p]) && (e = (o ? l(a, r, e) : l(e)) || e);
5
- return o && e && u(a, r, e), e;
6
- };
7
- const d = "fhi-flex";
8
- let t = class extends h {
9
- constructor() {
10
- super(...arguments), this.direction = "row", this.gap = "medium", this.wrap = !1, this.justify = "start", this.align = "stretch";
11
- }
12
- updated(s) {
13
- if (super.updated(s), s.has("gap")) {
14
- if (["small", "medium", "large"].includes(
15
- String(this.gap)
16
- )) {
17
- this.style.gap = "";
18
- return;
19
- }
20
- const r = Number(this.gap) ? `${this.gap}px` : this.gap;
21
- this.style.gap = r;
22
- }
23
- }
24
- render() {
25
- return m`<slot></slot>`;
26
- }
27
- };
28
- t.styles = g`
1
+ import { a as e, d as t, o as n, s as r, t as i, u as a } from "./decorate-DFXIek-k.js";
2
+ //#region src/components/fhi-flex/fhi-flex.component.ts
3
+ var o = "fhi-flex", s = class extends r {
4
+ constructor(...e) {
5
+ super(...e), this.direction = "row", this.gap = "medium", this.wrap = !1, this.justify = "start", this.align = "stretch";
6
+ }
7
+ updated(e) {
8
+ if (super.updated(e), e.has("gap")) {
9
+ if ([
10
+ "small",
11
+ "medium",
12
+ "large"
13
+ ].includes(String(this.gap))) {
14
+ this.style.gap = "";
15
+ return;
16
+ }
17
+ let e = Number(this.gap) ? `${this.gap}px` : this.gap;
18
+ this.style.gap = e;
19
+ }
20
+ }
21
+ render() {
22
+ return a`<slot></slot>`;
23
+ }
24
+ static {
25
+ this.styles = t`
29
26
  :host {
30
27
  --dimension-gap-small: var(--fhi-spacing-100);
31
28
  --dimension-gap-medium: var(--fhi-spacing-200);
@@ -93,26 +90,19 @@ t.styles = g`
93
90
  align-items: baseline;
94
91
  }
95
92
  `;
96
- i([
97
- n({ type: String, reflect: !0 })
98
- ], t.prototype, "direction", 2);
99
- i([
100
- n({ type: String, reflect: !0 })
101
- ], t.prototype, "gap", 2);
102
- i([
103
- n({ type: Boolean, reflect: !0 })
104
- ], t.prototype, "wrap", 2);
105
- i([
106
- n({ type: String })
107
- ], t.prototype, "justify", 2);
108
- i([
109
- n({ type: String })
110
- ], t.prototype, "align", 2);
111
- t = i([
112
- c(d)
113
- ], t);
114
- export {
115
- t as FhiFlex,
116
- d as FhiFlexSelector
93
+ }
117
94
  };
118
- //# sourceMappingURL=fhi-flex.js.map
95
+ i([e({
96
+ type: String,
97
+ reflect: !0
98
+ })], s.prototype, "direction", void 0), i([e({
99
+ type: String,
100
+ reflect: !0
101
+ })], s.prototype, "gap", void 0), i([e({
102
+ type: Boolean,
103
+ reflect: !0
104
+ })], s.prototype, "wrap", void 0), i([e({ type: String })], s.prototype, "justify", void 0), i([e({ type: String })], s.prototype, "align", void 0), s = i([n(o)], s);
105
+ //#endregion
106
+ export { s as FhiFlex, o as FhiFlexSelector };
107
+
108
+ //# sourceMappingURL=fhi-flex.js.map
package/fhi-flex.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"fhi-flex.js","sources":["../../src/components/fhi-flex/fhi-flex.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nexport const FhiFlexSelector = 'fhi-flex';\ntype FhiUnitType = 'px' | 'rem';\ntype FhiGapWidthUnit = `${number}${FhiUnitType}` | number;\n\n/**\n * ## FHI Flex\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-flex--docs}\n *\n * The `<fhi-flex>` component is a flexible container that utilizes CSS Flexbox to arrange its child elements in a responsive layout.\n * It allows for easy alignment, spacing, and direction control of its items.\n *\n * @tag fhi-flex\n * @element fhi-flex\n *\n * @slot - The content of the flex container. This can include any elements or text.\n *\n */\n@customElement(FhiFlexSelector)\nexport class FhiFlex extends LitElement {\n /**\n * Sets the flex direction to either row or column.\n * This determines the main axis along which the flex items are laid out.\n * @reflect\n * @type {'row' | 'column'}\n */\n @property({ type: String, reflect: true }) direction: 'row' | 'column' =\n 'row';\n\n /**\n * Sets the gap between items within the flex container.\n * It can be one of the preset values, a rem or px value, or a number.\n * If you give a number, it will be treated as pixels.\n * @reflect\n * @type {'small' | 'medium' | 'large' | number | string}\n */\n @property({ type: String, reflect: true }) gap:\n | 'small'\n | 'medium'\n | 'large'\n | FhiGapWidthUnit = 'medium';\n\n /**\n * Enables wrapping of flex items onto multiple lines if they exceed the container's width.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) wrap = false;\n\n /**\n * Justifies flex items along the main axis.\n * @type {'start' | 'center' | 'end'}\n */\n @property({ type: String }) justify: 'start' | 'center' | 'end' = 'start';\n\n /**\n * Aligns flex items along the cross axis.\n * @type {'stretch' | 'start' | 'center' | 'end' | 'baseline'}\n */\n @property({ type: String }) align:\n | 'stretch'\n | 'start'\n | 'center'\n | 'end'\n | 'baseline' = 'stretch';\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('gap')) {\n const isPresetGap = ['small', 'medium', 'large'].includes(\n String(this.gap),\n );\n\n if (isPresetGap) {\n this.style.gap = '';\n return;\n }\n const gapValue = Number(this.gap) ? `${this.gap}px` : this.gap;\n this.style.gap = gapValue as string;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static styles = css`\n :host {\n --dimension-gap-small: var(--fhi-spacing-100);\n --dimension-gap-medium: var(--fhi-spacing-200);\n --dimension-gap-large: var(--fhi-spacing-300);\n }\n\n :host {\n display: flex;\n gap: var(--dimension-gap-medium);\n }\n\n :host([wrap]) {\n flex-wrap: wrap;\n }\n\n :host([direction='row']) {\n flex-direction: row;\n }\n\n :host([direction='column']) {\n flex-direction: column;\n }\n\n :host([gap='small']) {\n gap: var(--dimension-gap-small);\n }\n\n :host([gap='medium']) {\n gap: var(--dimension-gap-medium);\n }\n\n :host([gap='large']) {\n gap: var(--dimension-gap-large);\n }\n\n :host([justify='center']) {\n justify-content: center;\n }\n\n :host([justify='start']) {\n justify-content: start;\n }\n\n :host([justify='end']) {\n justify-content: end;\n }\n\n :host([align='stretch']) {\n align-items: stretch;\n }\n\n :host([align='center']) {\n align-items: center;\n }\n\n :host([align='start']) {\n align-items: start;\n }\n\n :host([align='end']) {\n align-items: end;\n }\n\n :host([align='baseline']) {\n align-items: baseline;\n }\n `;\n}\n"],"names":["FhiFlexSelector","FhiFlex","LitElement","changedProperties","gapValue","html","css","__decorateClass","property","customElement"],"mappings":";;;;;;AAGO,MAAMA,IAAkB;AAmBxB,IAAMC,IAAN,cAAsBC,EAAW;AAAA,EAAjC,cAAA;AAAA,UAAA,GAAA,SAAA,GAOsC,KAAA,YACzC,OASyC,KAAA,MAIrB,UAOsB,KAAA,OAAO,IAMvB,KAAA,UAAsC,SAMtC,KAAA,QAKX;AAAA,EAAA;AAAA,EAEjB,QAAQC,GAAyC;AAG/C,QAFA,MAAM,QAAQA,CAAiB,GAE3BA,EAAkB,IAAI,KAAK,GAAG;AAKhC,UAJoB,CAAC,SAAS,UAAU,OAAO,EAAE;AAAA,QAC/C,OAAO,KAAK,GAAG;AAAA,MAAA,GAGA;AACf,aAAK,MAAM,MAAM;AACjB;AAAA,MACF;AACA,YAAMC,IAAW,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,KAAK;AAC3D,WAAK,MAAM,MAAMA;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAOC;AAAAA,EACT;AAsEF;AAxIaJ,EAoEJ,SAASK;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AA7D2BC,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAP9BP,EAOgC,WAAA,aAAA,CAAA;AAUAM,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAjB9BP,EAiBgC,WAAA,OAAA,CAAA;AAWCM,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA5B/BP,EA4BiC,WAAA,QAAA,CAAA;AAMhBM,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAlCfP,EAkCiB,WAAA,WAAA,CAAA;AAMAM,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxCfP,EAwCiB,WAAA,SAAA,CAAA;AAxCjBA,IAANM,EAAA;AAAA,EADNE,EAAcT,CAAe;AAAA,GACjBC,CAAA;"}
1
+ {"version":3,"file":"fhi-flex.js","names":[],"sources":["../../src/components/fhi-flex/fhi-flex.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nexport const FhiFlexSelector = 'fhi-flex';\ntype FhiUnitType = 'px' | 'rem';\ntype FhiGapWidthUnit = `${number}${FhiUnitType}` | number;\n\n/**\n * ## FHI Flex\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-flex--docs}\n *\n * The `<fhi-flex>` component is a flexible container that utilizes CSS Flexbox to arrange its child elements in a responsive layout.\n * It allows for easy alignment, spacing, and direction control of its items.\n *\n * @tag fhi-flex\n * @element fhi-flex\n *\n * @slot - The content of the flex container. This can include any elements or text.\n *\n */\n@customElement(FhiFlexSelector)\nexport class FhiFlex extends LitElement {\n /**\n * Sets the flex direction to either row or column.\n * This determines the main axis along which the flex items are laid out.\n * @reflect\n * @type {'row' | 'column'}\n */\n @property({ type: String, reflect: true }) direction: 'row' | 'column' =\n 'row';\n\n /**\n * Sets the gap between items within the flex container.\n * It can be one of the preset values, a rem or px value, or a number.\n * If you give a number, it will be treated as pixels.\n * @reflect\n * @type {'small' | 'medium' | 'large' | number | string}\n */\n @property({ type: String, reflect: true }) gap:\n | 'small'\n | 'medium'\n | 'large'\n | FhiGapWidthUnit = 'medium';\n\n /**\n * Enables wrapping of flex items onto multiple lines if they exceed the container's width.\n * @reflect\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true }) wrap = false;\n\n /**\n * Justifies flex items along the main axis.\n * @type {'start' | 'center' | 'end'}\n */\n @property({ type: String }) justify: 'start' | 'center' | 'end' = 'start';\n\n /**\n * Aligns flex items along the cross axis.\n * @type {'stretch' | 'start' | 'center' | 'end' | 'baseline'}\n */\n @property({ type: String }) align:\n | 'stretch'\n | 'start'\n | 'center'\n | 'end'\n | 'baseline' = 'stretch';\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('gap')) {\n const isPresetGap = ['small', 'medium', 'large'].includes(\n String(this.gap),\n );\n\n if (isPresetGap) {\n this.style.gap = '';\n return;\n }\n const gapValue = Number(this.gap) ? `${this.gap}px` : this.gap;\n this.style.gap = gapValue as string;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n static styles = css`\n :host {\n --dimension-gap-small: var(--fhi-spacing-100);\n --dimension-gap-medium: var(--fhi-spacing-200);\n --dimension-gap-large: var(--fhi-spacing-300);\n }\n\n :host {\n display: flex;\n gap: var(--dimension-gap-medium);\n }\n\n :host([wrap]) {\n flex-wrap: wrap;\n }\n\n :host([direction='row']) {\n flex-direction: row;\n }\n\n :host([direction='column']) {\n flex-direction: column;\n }\n\n :host([gap='small']) {\n gap: var(--dimension-gap-small);\n }\n\n :host([gap='medium']) {\n gap: var(--dimension-gap-medium);\n }\n\n :host([gap='large']) {\n gap: var(--dimension-gap-large);\n }\n\n :host([justify='center']) {\n justify-content: center;\n }\n\n :host([justify='start']) {\n justify-content: start;\n }\n\n :host([justify='end']) {\n justify-content: end;\n }\n\n :host([align='stretch']) {\n align-items: stretch;\n }\n\n :host([align='center']) {\n align-items: center;\n }\n\n :host([align='start']) {\n align-items: start;\n }\n\n :host([align='end']) {\n align-items: end;\n }\n\n :host([align='baseline']) {\n align-items: baseline;\n }\n `;\n}\n"],"mappings":";;AAGA,IAAa,IAAkB,YAmBxB,IAAA,cAAsB,EAAW;;gCAQpC,kBAaoB,sBAO6B,mBAMe,sBAWjD;;CAEjB,QAAQ,GAAyC;EAG/C,IAFA,MAAM,QAAQ,CAAiB,GAE3B,EAAkB,IAAI,KAAK,GAAG;GAKhC,IAJoB;IAAC;IAAS;IAAU;GAAO,EAAE,SAC/C,OAAO,KAAK,GAAG,CAGb,GAAa;IACf,KAAK,MAAM,MAAM;IACjB;GACF;GACA,IAAM,IAAW,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK;GAC3D,KAAK,MAAM,MAAM;EACnB;CACF;CAEA,SAAS;EACP,OAAO,CAAI;CACb;;gBAEgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoErB;GAjIG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,MAUxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,OAAA,KAAA,CAAA,MAWxC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAMzC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MAMzB,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,UAzC3B,EAAc,CAAe,CAAA,GAAA,CAAA"}
package/fhi-grid.js CHANGED
@@ -1,33 +1,27 @@
1
- import { i as l, n as m, a as n, b as d, t as u } from "./property-B2Ico5CW.js";
2
- var h = Object.defineProperty, c = Object.getOwnPropertyDescriptor, t = (s, a, p, r) => {
3
- for (var i = r > 1 ? void 0 : r ? c(a, p) : a, g = s.length - 1, o; g >= 0; g--)
4
- (o = s[g]) && (i = (r ? o(a, p, i) : o(i)) || i);
5
- return r && i && h(a, p, i), i;
6
- };
7
- const f = "fhi-grid";
8
- let e = class extends n {
9
- constructor() {
10
- super(...arguments), this.gap = "medium", this.columns = 12, this.rows = 1;
11
- }
12
- updated(s) {
13
- if (super.updated(s), s.has("columns") && (this.style.gridTemplateColumns = `repeat( ${this.columns}, 1fr )`), s.has("rows") && (this.style.gridTemplateRows = `repeat( ${this.rows}, 1fr )`), s.has("gap"))
14
- switch (this.gap) {
15
- case "large":
16
- case "medium":
17
- case "small":
18
- this.style.gap = "";
19
- return;
20
- default:
21
- const a = Number(this.gap) ? `${this.gap}px` : this.gap;
22
- this.style.gap = a;
23
- return;
24
- }
25
- }
26
- render() {
27
- return d`<slot></slot>`;
28
- }
29
- };
30
- e.styles = l`
1
+ import { a as e, d as t, o as n, s as r, t as i, u as a } from "./decorate-DFXIek-k.js";
2
+ //#region src/components/fhi-grid/fhi-grid.component.ts
3
+ var o = "fhi-grid", s = class extends r {
4
+ constructor(...e) {
5
+ super(...e), this.gap = "medium", this.columns = 12, this.rows = 1;
6
+ }
7
+ updated(e) {
8
+ if (super.updated(e), e.has("columns") && (this.style.gridTemplateColumns = `repeat( ${this.columns}, 1fr )`), e.has("rows") && (this.style.gridTemplateRows = `repeat( ${this.rows}, 1fr )`), e.has("gap")) switch (this.gap) {
9
+ case "large":
10
+ case "medium":
11
+ case "small":
12
+ this.style.gap = "";
13
+ return;
14
+ default:
15
+ let e = Number(this.gap) ? `${this.gap}px` : this.gap;
16
+ this.style.gap = e;
17
+ return;
18
+ }
19
+ }
20
+ render() {
21
+ return a`<slot></slot>`;
22
+ }
23
+ static {
24
+ this.styles = t`
31
25
  :host {
32
26
  --dimension-grid-gap-small: var(--fhi-spacing-100);
33
27
  --dimension-grid-gap-medium: var(--fhi-spacing-200);
@@ -49,20 +43,10 @@ e.styles = l`
49
43
  gap: var(--dimension-grid-gap-large);
50
44
  }
51
45
  `;
52
- t([
53
- m({ type: String })
54
- ], e.prototype, "gap", 2);
55
- t([
56
- m({ type: Number })
57
- ], e.prototype, "columns", 2);
58
- t([
59
- m({ type: Number })
60
- ], e.prototype, "rows", 2);
61
- e = t([
62
- u(f)
63
- ], e);
64
- export {
65
- e as FhiGrid,
66
- f as FhiGridSelector
46
+ }
67
47
  };
68
- //# sourceMappingURL=fhi-grid.js.map
48
+ i([e({ type: String })], s.prototype, "gap", void 0), i([e({ type: Number })], s.prototype, "columns", void 0), i([e({ type: Number })], s.prototype, "rows", void 0), s = i([n(o)], s);
49
+ //#endregion
50
+ export { s as FhiGrid, o as FhiGridSelector };
51
+
52
+ //# sourceMappingURL=fhi-grid.js.map