@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.
- package/decorate-DFXIek-k.js +611 -0
- package/decorate-DFXIek-k.js.map +1 -0
- package/fhi-body.js +23 -32
- package/fhi-body.js.map +1 -1
- package/fhi-button.js +90 -112
- package/fhi-button.js.map +1 -1
- package/fhi-checkbox.js +53 -66
- package/fhi-checkbox.js.map +1 -1
- package/fhi-data-table-cell.js +23 -29
- package/fhi-data-table-cell.js.map +1 -1
- package/fhi-data-table-row.js +40 -65
- package/fhi-data-table-row.js.map +1 -1
- package/fhi-data-table.js +30 -36
- package/fhi-data-table.js.map +1 -1
- package/fhi-date-input.component-Bus7CeKM.js +278 -0
- package/fhi-date-input.component-Bus7CeKM.js.map +1 -0
- package/fhi-date-input.js +2 -305
- package/fhi-display.js +29 -46
- package/fhi-display.js.map +1 -1
- package/fhi-flex.js +40 -50
- package/fhi-flex.js.map +1 -1
- package/fhi-grid.js +30 -46
- package/fhi-grid.js.map +1 -1
- package/fhi-headline.js +29 -46
- package/fhi-headline.js.map +1 -1
- package/fhi-icon-arrow-down-left.js +26 -43
- package/fhi-icon-arrow-down-left.js.map +1 -1
- package/fhi-icon-arrow-down-right.js +26 -43
- package/fhi-icon-arrow-down-right.js.map +1 -1
- package/fhi-icon-arrow-down.js +26 -43
- package/fhi-icon-arrow-down.js.map +1 -1
- package/fhi-icon-arrow-left.js +26 -43
- package/fhi-icon-arrow-left.js.map +1 -1
- package/fhi-icon-arrow-right-left.js +26 -43
- package/fhi-icon-arrow-right-left.js.map +1 -1
- package/fhi-icon-arrow-right.js +26 -43
- package/fhi-icon-arrow-right.js.map +1 -1
- package/fhi-icon-arrow-up-down.js +26 -43
- package/fhi-icon-arrow-up-down.js.map +1 -1
- package/fhi-icon-arrow-up-left.js +26 -43
- package/fhi-icon-arrow-up-left.js.map +1 -1
- package/fhi-icon-arrow-up-right.js +26 -43
- package/fhi-icon-arrow-up-right.js.map +1 -1
- package/fhi-icon-arrow-up.js +26 -43
- package/fhi-icon-arrow-up.js.map +1 -1
- package/fhi-icon-bell.js +26 -43
- package/fhi-icon-bell.js.map +1 -1
- package/fhi-icon-calendar-clock.js +26 -43
- package/fhi-icon-calendar-clock.js.map +1 -1
- package/fhi-icon-calendar.js +26 -43
- package/fhi-icon-calendar.js.map +1 -1
- package/fhi-icon-chart-bar-stacked.js +26 -43
- package/fhi-icon-chart-bar-stacked.js.map +1 -1
- package/fhi-icon-chart-bar.js +26 -43
- package/fhi-icon-chart-bar.js.map +1 -1
- package/fhi-icon-chart-column-stacked.js +26 -43
- package/fhi-icon-chart-column-stacked.js.map +1 -1
- package/fhi-icon-chart-column.js +26 -43
- package/fhi-icon-chart-column.js.map +1 -1
- package/fhi-icon-chart-line.js +26 -43
- package/fhi-icon-chart-line.js.map +1 -1
- package/fhi-icon-chart-no-axes-combined.js +26 -43
- package/fhi-icon-chart-no-axes-combined.js.map +1 -1
- package/fhi-icon-chart-pie.js +26 -43
- package/fhi-icon-chart-pie.js.map +1 -1
- package/fhi-icon-check.js +26 -43
- package/fhi-icon-check.js.map +1 -1
- package/fhi-icon-chevron-down.js +26 -43
- package/fhi-icon-chevron-down.js.map +1 -1
- package/fhi-icon-chevron-left.js +26 -43
- package/fhi-icon-chevron-left.js.map +1 -1
- package/fhi-icon-chevron-right.js +26 -43
- package/fhi-icon-chevron-right.js.map +1 -1
- package/fhi-icon-chevron-up.js +26 -43
- package/fhi-icon-chevron-up.js.map +1 -1
- package/fhi-icon-chevrons-down.js +26 -43
- package/fhi-icon-chevrons-down.js.map +1 -1
- package/fhi-icon-chevrons-left.js +26 -43
- package/fhi-icon-chevrons-left.js.map +1 -1
- package/fhi-icon-chevrons-right.js +26 -43
- package/fhi-icon-chevrons-right.js.map +1 -1
- package/fhi-icon-chevrons-up.js +26 -43
- package/fhi-icon-chevrons-up.js.map +1 -1
- package/fhi-icon-circle-arrow-down.js +26 -43
- package/fhi-icon-circle-arrow-down.js.map +1 -1
- package/fhi-icon-circle-arrow-left.js +26 -43
- package/fhi-icon-circle-arrow-left.js.map +1 -1
- package/fhi-icon-circle-arrow-right.js +26 -43
- package/fhi-icon-circle-arrow-right.js.map +1 -1
- package/fhi-icon-circle-arrow-up.js +26 -43
- package/fhi-icon-circle-arrow-up.js.map +1 -1
- package/fhi-icon-circle-check-big.js +26 -43
- package/fhi-icon-circle-check-big.js.map +1 -1
- package/fhi-icon-circle-check.js +26 -43
- package/fhi-icon-circle-check.js.map +1 -1
- package/fhi-icon-circle-chevron-down.js +26 -43
- package/fhi-icon-circle-chevron-down.js.map +1 -1
- package/fhi-icon-circle-chevron-left.js +26 -43
- package/fhi-icon-circle-chevron-left.js.map +1 -1
- package/fhi-icon-circle-chevron-right.js +26 -43
- package/fhi-icon-circle-chevron-right.js.map +1 -1
- package/fhi-icon-circle-chevron-up.js +26 -43
- package/fhi-icon-circle-chevron-up.js.map +1 -1
- package/fhi-icon-circle-exclamation.js +26 -43
- package/fhi-icon-circle-exclamation.js.map +1 -1
- package/fhi-icon-circle-info.js +26 -43
- package/fhi-icon-circle-info.js.map +1 -1
- package/fhi-icon-circle-minus.js +26 -43
- package/fhi-icon-circle-minus.js.map +1 -1
- package/fhi-icon-circle-plus.js +26 -43
- package/fhi-icon-circle-plus.js.map +1 -1
- package/fhi-icon-circle-question.js +26 -43
- package/fhi-icon-circle-question.js.map +1 -1
- package/fhi-icon-circle-x.js +26 -43
- package/fhi-icon-circle-x.js.map +1 -1
- package/fhi-icon-circle.js +26 -43
- package/fhi-icon-circle.js.map +1 -1
- package/fhi-icon-clock.js +26 -43
- package/fhi-icon-clock.js.map +1 -1
- package/fhi-icon-copy.js +26 -43
- package/fhi-icon-copy.js.map +1 -1
- package/fhi-icon-download.js +26 -43
- package/fhi-icon-download.js.map +1 -1
- package/fhi-icon-ellipsis-vertical.js +26 -43
- package/fhi-icon-ellipsis-vertical.js.map +1 -1
- package/fhi-icon-ellipsis.js +26 -43
- package/fhi-icon-ellipsis.js.map +1 -1
- package/fhi-icon-exclamation.js +26 -43
- package/fhi-icon-exclamation.js.map +1 -1
- package/fhi-icon-expand.js +26 -43
- package/fhi-icon-expand.js.map +1 -1
- package/fhi-icon-external-link.js +26 -43
- package/fhi-icon-external-link.js.map +1 -1
- package/fhi-icon-eye-off.js +26 -43
- package/fhi-icon-eye-off.js.map +1 -1
- package/fhi-icon-eye.js +26 -43
- package/fhi-icon-eye.js.map +1 -1
- package/fhi-icon-file-text.js +26 -43
- package/fhi-icon-file-text.js.map +1 -1
- package/fhi-icon-file.js +26 -43
- package/fhi-icon-file.js.map +1 -1
- package/fhi-icon-filter.js +26 -43
- package/fhi-icon-filter.js.map +1 -1
- package/fhi-icon-folder.js +26 -43
- package/fhi-icon-folder.js.map +1 -1
- package/fhi-icon-gear.js +26 -43
- package/fhi-icon-gear.js.map +1 -1
- package/fhi-icon-grid-9-dots.js +26 -43
- package/fhi-icon-grid-9-dots.js.map +1 -1
- package/fhi-icon-grip-horizontal.js +26 -43
- package/fhi-icon-grip-horizontal.js.map +1 -1
- package/fhi-icon-grip-vertical.js +26 -43
- package/fhi-icon-grip-vertical.js.map +1 -1
- package/fhi-icon-history.js +26 -43
- package/fhi-icon-history.js.map +1 -1
- package/fhi-icon-info.js +26 -43
- package/fhi-icon-info.js.map +1 -1
- package/fhi-icon-link-2-off.js +26 -43
- package/fhi-icon-link-2-off.js.map +1 -1
- package/fhi-icon-link-2.js +26 -43
- package/fhi-icon-link-2.js.map +1 -1
- package/fhi-icon-link.js +26 -43
- package/fhi-icon-link.js.map +1 -1
- package/fhi-icon-lock-open.js +26 -43
- package/fhi-icon-lock-open.js.map +1 -1
- package/fhi-icon-lock.js +26 -43
- package/fhi-icon-lock.js.map +1 -1
- package/fhi-icon-log-in.js +26 -43
- package/fhi-icon-log-in.js.map +1 -1
- package/fhi-icon-log-out.js +26 -43
- package/fhi-icon-log-out.js.map +1 -1
- package/fhi-icon-mail.js +26 -43
- package/fhi-icon-mail.js.map +1 -1
- package/fhi-icon-map-pin.js +26 -43
- package/fhi-icon-map-pin.js.map +1 -1
- package/fhi-icon-menu.js +26 -43
- package/fhi-icon-menu.js.map +1 -1
- package/fhi-icon-message.js +26 -43
- package/fhi-icon-message.js.map +1 -1
- package/fhi-icon-minus.js +26 -43
- package/fhi-icon-minus.js.map +1 -1
- package/fhi-icon-octagon-alert.js +26 -43
- package/fhi-icon-octagon-alert.js.map +1 -1
- package/fhi-icon-paperclip.js +26 -43
- package/fhi-icon-paperclip.js.map +1 -1
- package/fhi-icon-pencil.js +26 -43
- package/fhi-icon-pencil.js.map +1 -1
- package/fhi-icon-phone.js +26 -43
- package/fhi-icon-phone.js.map +1 -1
- package/fhi-icon-pin-off.js +26 -43
- package/fhi-icon-pin-off.js.map +1 -1
- package/fhi-icon-pin.js +26 -43
- package/fhi-icon-pin.js.map +1 -1
- package/fhi-icon-plus.js +26 -43
- package/fhi-icon-plus.js.map +1 -1
- package/fhi-icon-printer.js +26 -43
- package/fhi-icon-printer.js.map +1 -1
- package/fhi-icon-question.js +26 -43
- package/fhi-icon-question.js.map +1 -1
- package/fhi-icon-refresh.js +26 -43
- package/fhi-icon-refresh.js.map +1 -1
- package/fhi-icon-rotate-left.js +26 -43
- package/fhi-icon-rotate-left.js.map +1 -1
- package/fhi-icon-rotate-right.js +26 -43
- package/fhi-icon-rotate-right.js.map +1 -1
- package/fhi-icon-search.js +26 -43
- package/fhi-icon-search.js.map +1 -1
- package/fhi-icon-send.js +26 -43
- package/fhi-icon-send.js.map +1 -1
- package/fhi-icon-share.js +26 -43
- package/fhi-icon-share.js.map +1 -1
- package/fhi-icon-sheet.js +26 -43
- package/fhi-icon-sheet.js.map +1 -1
- package/fhi-icon-square-check-big.js +26 -43
- package/fhi-icon-square-check-big.js.map +1 -1
- package/fhi-icon-square-check.js +26 -43
- package/fhi-icon-square-check.js.map +1 -1
- package/fhi-icon-square-pen.js +26 -43
- package/fhi-icon-square-pen.js.map +1 -1
- package/fhi-icon-square-x.js +26 -43
- package/fhi-icon-square-x.js.map +1 -1
- package/fhi-icon-square.js +26 -43
- package/fhi-icon-square.js.map +1 -1
- package/fhi-icon-trash.js +26 -43
- package/fhi-icon-trash.js.map +1 -1
- package/fhi-icon-triangle-alert.js +26 -43
- package/fhi-icon-triangle-alert.js.map +1 -1
- package/fhi-icon-upload.js +26 -43
- package/fhi-icon-upload.js.map +1 -1
- package/fhi-icon-user.js +26 -43
- package/fhi-icon-user.js.map +1 -1
- package/fhi-icon-x.js +26 -43
- package/fhi-icon-x.js.map +1 -1
- package/fhi-label.js +23 -32
- package/fhi-label.js.map +1 -1
- package/fhi-modal-dialog.js +76 -111
- package/fhi-modal-dialog.js.map +1 -1
- package/fhi-radio.js +91 -109
- package/fhi-radio.js.map +1 -1
- package/fhi-tag.js +32 -44
- package/fhi-tag.js.map +1 -1
- package/fhi-text-input.js +96 -126
- package/fhi-text-input.js.map +1 -1
- package/fhi-title.js +29 -46
- package/fhi-title.js.map +1 -1
- package/fhi-tooltip.component-DJNDfrHK.js +919 -0
- package/fhi-tooltip.component-DJNDfrHK.js.map +1 -0
- package/fhi-tooltip.js +2 -1162
- package/fonts/RobotoFlex.ttf.js.map +1 -1
- package/if-defined-Dl-W5B5_.js +7 -0
- package/if-defined-Dl-W5B5_.js.map +1 -0
- package/index.js +123 -369
- package/package.json +1 -1
- package/theme/default.css +1 -1
- package/unsafe-html-CBTN3162.js +50 -0
- package/unsafe-html-CBTN3162.js.map +1 -0
- package/web-types.json +1 -1
- package/base-D76d76ww.js +0 -10
- package/base-D76d76ww.js.map +0 -1
- package/fhi-date-input.js.map +0 -1
- package/fhi-tooltip.js.map +0 -1
- package/if-defined-B_sR6Mtk.js +0 -11
- package/if-defined-B_sR6Mtk.js.map +0 -1
- package/index.js.map +0 -1
- package/property-B2Ico5CW.js +0 -605
- package/property-B2Ico5CW.js.map +0 -1
- package/query-Ddbd72Um.js +0 -21
- package/query-Ddbd72Um.js.map +0 -1
- package/unsafe-html-DfuTUjUu.js +0 -48
- 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
|
-
|
|
6
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/fhi-display.js.map
CHANGED
|
@@ -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"],"
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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"],"
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|