@folkehelseinstituttet/designsystem 0.41.1 → 0.41.3
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/fhi-flex.js +16 -16
- package/fhi-flex.js.map +1 -1
- package/{fhi-tooltip.component-DJNDfrHK.js → fhi-tooltip.component-Bs2jmkyC.js} +291 -329
- package/fhi-tooltip.component-Bs2jmkyC.js.map +1 -0
- package/fhi-tooltip.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
- package/fhi-tooltip.component-DJNDfrHK.js.map +0 -1
package/fhi-flex.js
CHANGED
|
@@ -24,38 +24,38 @@ var o = "fhi-flex", s = class extends r {
|
|
|
24
24
|
static {
|
|
25
25
|
this.styles = t`
|
|
26
26
|
:host {
|
|
27
|
-
--
|
|
28
|
-
--dimension-gap-medium: var(--fhi-spacing-200);
|
|
29
|
-
--dimension-gap-large: var(--fhi-spacing-300);
|
|
27
|
+
--fhi-flex-gap: unset;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
:host {
|
|
31
|
+
--fhi-flex-gap: var(--fhi-spacing-200);
|
|
32
|
+
|
|
33
33
|
display: flex;
|
|
34
|
-
gap: var(--
|
|
34
|
+
gap: var(--fhi-flex-gap);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
:host([
|
|
38
|
-
flex-
|
|
37
|
+
:host([gap='small']) {
|
|
38
|
+
--fhi-flex-gap: var(--fhi-spacing-100);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
:host([
|
|
42
|
-
flex-
|
|
41
|
+
:host([gap='medium']) {
|
|
42
|
+
--fhi-flex-gap: var(--fhi-spacing-200);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
:host([
|
|
46
|
-
flex-
|
|
45
|
+
:host([gap='large']) {
|
|
46
|
+
--fhi-flex-gap: var(--fhi-spacing-300);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
:host([
|
|
50
|
-
|
|
49
|
+
:host([wrap]) {
|
|
50
|
+
flex-wrap: wrap;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
:host([
|
|
54
|
-
|
|
53
|
+
:host([direction='row']) {
|
|
54
|
+
flex-direction: row;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
:host([
|
|
58
|
-
|
|
57
|
+
:host([direction='column']) {
|
|
58
|
+
flex-direction: column;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
:host([justify='center']) {
|
package/fhi-flex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 --
|
|
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 --fhi-flex-gap: unset;\n }\n\n :host {\n --fhi-flex-gap: var(--fhi-spacing-200);\n\n display: flex;\n gap: var(--fhi-flex-gap);\n }\n\n :host([gap='small']) {\n --fhi-flex-gap: var(--fhi-spacing-100);\n }\n\n :host([gap='medium']) {\n --fhi-flex-gap: var(--fhi-spacing-200);\n }\n\n :host([gap='large']) {\n --fhi-flex-gap: var(--fhi-spacing-300);\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([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"}
|