@ngu-no/ngu-designsystem 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,107 @@
1
+ /* Imported with layer(ngu) from styles/index.css. Based on .ds-card. */
2
+ ngu-map-card {
3
+ display: block;
4
+ --ngu-map-card-heading-size: var(--ds-font-size-4);
5
+ --dsc-card-padding: var(--ds-size-4);
6
+ --dsc-card-block-border-width: 0;
7
+ --dsc-card-content-margin-block: var(--ds-size-2) 0;
8
+ cursor: pointer;
9
+ }
10
+
11
+ /* Same hover as a clickable ds-card; applies to both default and tinted variants. */
12
+ @media (hover: hover) and (pointer: fine) {
13
+ ngu-map-card:hover {
14
+ background: var(--ds-color-surface-hover);
15
+ }
16
+
17
+ ngu-map-card:hover:active {
18
+ background: var(--ds-color-surface-active);
19
+ }
20
+ }
21
+
22
+ ngu-map-card a {
23
+ cursor: pointer;
24
+ }
25
+
26
+ ngu-map-card[data-size='sm'] {
27
+ --ngu-map-card-heading-size: var(--ds-font-size-3);
28
+ }
29
+
30
+ .ngu-map-card__media {
31
+ padding: 0;
32
+ }
33
+
34
+ .ngu-map-card__media img {
35
+ display: block;
36
+ width: 100%;
37
+ aspect-ratio: 16 / 9;
38
+ object-fit: cover;
39
+ }
40
+
41
+ .ngu-map-card__header {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: space-between;
45
+ gap: var(--ds-size-2);
46
+ padding-block: var(--ds-size-3);
47
+ /* ds-card adds margin to sibling children via this variable; flex alignment needs none. */
48
+ --dsc-card-content-margin-block: 0;
49
+ }
50
+
51
+ .ngu-map-card__content {
52
+ padding-block-start: 0;
53
+ }
54
+
55
+ .ngu-map-card__content > * + * {
56
+ margin-block-start: var(--ds-size-3);
57
+ }
58
+
59
+ .ngu-map-card__title {
60
+ margin: 0;
61
+ font-size: var(--ngu-map-card-heading-size);
62
+ }
63
+
64
+ /* ds-link defaults to the subtle text colour; Figma uses text-default. */
65
+ .ngu-map-card__title .ds-link {
66
+ --dsc-link-color: var(--ds-color-text-default);
67
+ }
68
+
69
+ .ngu-map-card__toggle {
70
+ display: inline-flex;
71
+ align-items: center;
72
+ justify-content: center;
73
+ flex-shrink: 0;
74
+ min-width: var(--ds-size-8);
75
+ min-height: var(--ds-size-8);
76
+ padding: 0;
77
+ border: 0;
78
+ border-radius: var(--ds-border-radius-md);
79
+ background: transparent;
80
+ color: inherit;
81
+ cursor: pointer;
82
+ }
83
+
84
+ .ngu-map-card__toggle svg {
85
+ pointer-events: none;
86
+ }
87
+
88
+ .ngu-map-card__toggle:focus-visible {
89
+ outline: var(--ds-border-width-focus) solid var(--ds-color-focus-outer);
90
+ outline-offset: var(--ds-border-width-focus);
91
+ }
92
+
93
+ .ngu-map-card__toggle svg {
94
+ width: var(--ds-size-6);
95
+ height: var(--ds-size-6);
96
+ transition: transform 150ms ease;
97
+ }
98
+
99
+ ngu-map-card[open] .ngu-map-card__toggle svg {
100
+ transform: rotate(180deg);
101
+ }
102
+
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .ngu-map-card__toggle svg {
105
+ transition: none;
106
+ }
107
+ }
@@ -0,0 +1,9 @@
1
+ export declare class NguMapCard extends HTMLElement {
2
+ #private;
3
+ static observedAttributes: string[];
4
+ connectedCallback(): void;
5
+ disconnectedCallback(): void;
6
+ attributeChangedCallback(): void;
7
+ get open(): boolean;
8
+ set open(value: boolean);
9
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * <ngu-map-card> — a card that behaves like a disclosure.
3
+ * The heading link navigates; clicking anywhere else on the card toggles the description.
4
+ * Light DOM; expected markup is documented in the docs page and stories.
5
+ */
6
+ let uid = 0;
7
+ export class NguMapCard extends HTMLElement {
8
+ static observedAttributes = ['open'];
9
+ #toggle = null;
10
+ #content = null;
11
+ connectedCallback() {
12
+ this.#toggle = this.querySelector('.ngu-map-card__toggle');
13
+ this.#content = this.querySelector('.ngu-map-card__content');
14
+ if (!this.hasAttribute('data-color'))
15
+ this.setAttribute('data-color', 'dark-blue');
16
+ if (!this.#toggle || !this.#content)
17
+ return;
18
+ if (!this.#content.id)
19
+ this.#content.id = `ngu-map-card-${++uid}`;
20
+ this.#toggle.setAttribute('aria-controls', this.#content.id);
21
+ this.addEventListener('click', this.#onClick);
22
+ this.#sync();
23
+ }
24
+ disconnectedCallback() {
25
+ this.removeEventListener('click', this.#onClick);
26
+ }
27
+ attributeChangedCallback() {
28
+ this.#sync();
29
+ }
30
+ get open() {
31
+ return this.hasAttribute('open');
32
+ }
33
+ set open(value) {
34
+ this.toggleAttribute('open', value);
35
+ }
36
+ #onClick = (event) => {
37
+ const target = event.target;
38
+ if (target.closest('a'))
39
+ return;
40
+ // Don't collapse the card when the user is selecting text in the description.
41
+ if (window.getSelection()?.toString())
42
+ return;
43
+ this.open = !this.open;
44
+ this.dispatchEvent(new CustomEvent('ngu-map-card-toggle', { detail: { open: this.open }, bubbles: true }));
45
+ };
46
+ #sync() {
47
+ if (!this.#toggle || !this.#content)
48
+ return;
49
+ this.#toggle.setAttribute('aria-expanded', String(this.open));
50
+ this.#content.hidden = !this.open;
51
+ }
52
+ }
53
+ if (!customElements.get('ngu-map-card')) {
54
+ customElements.define('ngu-map-card', NguMapCard);
55
+ }
@@ -0,0 +1,38 @@
1
+ /* Imported with layer(ngu) from styles/index.css. Based on .ds-details. */
2
+ /*
3
+ * The button is a sibling of <details>, not a child of <summary>: interactive content inside
4
+ * <summary> is nested-interactive (WCAG 4.1.2). It is positioned over the right end of the first row.
5
+ */
6
+ ngu-map-details {
7
+ display: block;
8
+ position: relative;
9
+ }
10
+
11
+ /* Reserve room for the button so the title never runs underneath it. */
12
+ ngu-map-details>.ds-details>summary {
13
+ padding-inline-end: calc(var(--ds-size-30) + var(--ds-size-4) * 2);
14
+ overflow-wrap: anywhere;
15
+ }
16
+
17
+ .ngu-map-details__action {
18
+ position: absolute;
19
+ inset-block-start: var(--ds-size-3);
20
+ inset-inline-end: var(--ds-size-4);
21
+ z-index: 1;
22
+ }
23
+
24
+ /* Bordered variant: border around the whole item instead of only above and below. */
25
+ ngu-map-details[data-border='true']>.ds-details {
26
+ border: var(--ds-border-width-default) solid var(--ds-color-border-subtle);
27
+ border-radius: var(--ds-border-radius-md);
28
+ overflow: hidden;
29
+ }
30
+
31
+ ngu-map-details[data-border='true']+ngu-map-details {
32
+ margin-block-start: var(--ds-size-2);
33
+ }
34
+
35
+ /* Stacked items share borders, like an accordion. */
36
+ ngu-map-details:not([data-border='true'])+ngu-map-details>.ds-details {
37
+ border-block-start: 0;
38
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * <ngu-map-details> — a details/accordion item with a navigation button in the summary.
3
+ * Clicking the summary toggles the content; the button inside it links to the map.
4
+ * Light DOM; wraps a native <details class="ds-details">. Markup is documented in the stories.
5
+ */
6
+ export declare class NguMapDetails extends HTMLElement {
7
+ connectedCallback(): void;
8
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * <ngu-map-details> — a details/accordion item with a navigation button in the summary.
3
+ * Clicking the summary toggles the content; the button inside it links to the map.
4
+ * Light DOM; wraps a native <details class="ds-details">. Markup is documented in the stories.
5
+ */
6
+ export class NguMapDetails extends HTMLElement {
7
+ connectedCallback() {
8
+ if (!this.hasAttribute('data-color'))
9
+ this.setAttribute('data-color', 'dark-blue');
10
+ }
11
+ }
12
+ if (!customElements.get('ngu-map-details')) {
13
+ customElements.define('ngu-map-details', NguMapDetails);
14
+ }
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.36719 8.63947C5.64477 8.51056 5.95597 8.46976 6.25586 8.5213C6.43016 8.55128 6.60062 8.61289 6.75879 8.70587C6.83457 8.7504 6.90615 8.80151 6.97266 8.85822L20.5049 20.2391L41.3652 10.6375C41.5876 10.5352 41.8219 10.4917 42.0508 10.5008C42.8555 10.5278 43.4999 11.1886 43.5 11.9998V37.9998C43.5 38.8282 42.8284 39.4998 42 39.4998H6C5.17163 39.4998 4.5 38.8282 4.5 37.9998V10.0096L4.70508 9.24298C4.75611 9.15587 4.81585 9.07456 4.88281 8.99982C5.02235 8.84381 5.1879 8.7228 5.36719 8.63947ZM20.9404 32.244C20.4186 32.5057 19.7922 32.4409 19.335 32.0779L14.7148 28.41L7.5 32.8397V36.4998H40.5V22.4305L20.9404 32.244ZM7.5 29.3192L14.04 25.3035C14.5773 24.9738 15.2631 25.0151 15.7568 25.407L20.4502 29.1336L40.5 19.074V14.3377L20.8945 23.3621C20.3669 23.605 19.7463 23.5222 19.3018 23.1483L7.5 13.2215V29.3192ZM4.5 10.0096V9.99982C4.5 9.98577 4.50059 9.97178 4.50098 9.95782C4.5005 9.97501 4.49988 9.9924 4.5 10.0096ZM4.50586 9.87286C4.5035 9.90098 4.50177 9.92929 4.50098 9.95782C4.5017 9.93145 4.50277 9.90506 4.50488 9.87872L4.50586 9.87286Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M24 4.5C34.7696 4.5 43.5 13.2304 43.5 24C43.5 34.7696 34.7696 43.5 24 43.5C13.2304 43.5 4.5 34.7696 4.5 24C4.5 13.2304 13.2304 4.5 24 4.5ZM24 7.5C22.7425 7.5 21.5178 7.64074 20.3408 7.90723C19.9225 9.67234 19.2464 10.8762 18.4307 11.8262C17.9945 12.3342 17.5396 12.7438 17.1377 13.0938C17.0533 13.1673 16.9724 13.2374 16.8945 13.3047C16.5835 13.5734 16.3196 13.8015 16.0605 14.0605C15.3969 14.7242 14.8193 15.4708 14.4375 16.1465C14.2472 16.4834 14.1214 16.7753 14.0518 17.0078C14.0176 17.1221 14.0004 17.2109 13.9932 17.2744C13.9869 17.3297 13.9889 17.3567 13.9893 17.3604C14.008 17.4904 14.0377 17.5505 14.0479 17.5684C14.0549 17.5806 14.0606 17.5852 14.0615 17.5859C14.0709 17.5927 14.1261 17.6263 14.2529 17.6455C14.291 17.6022 14.329 17.5535 14.3809 17.4883C14.4492 17.4022 14.541 17.2861 14.6865 17.1133C14.9548 16.7947 15.3449 16.3746 15.9053 16.0449C16.487 15.7026 17.1785 15.5 18 15.5C18.9059 15.5 19.5149 16.0276 19.8535 16.4219C19.981 16.1416 20.141 15.8422 20.3438 15.5742C20.6846 15.1238 21.3057 14.5635 22.248 14.5635C22.9099 14.5635 23.6908 14.8148 24.3545 15.0889C25.074 15.3859 25.8681 15.7999 26.6123 16.29C27.3494 16.7755 28.0927 17.3709 28.6689 18.0459C29.223 18.695 29.7714 19.5939 29.7715 20.6572C29.7715 21.7985 29.4208 23.0794 28.8174 24.1064C28.2464 25.0781 27.1832 26.2354 25.5996 26.2354C24.4653 26.2353 23.3517 25.8978 22.4355 25.6201L22.2061 25.5508C21.1729 25.2405 20.2596 24.9932 19.2715 24.9932C17.7476 24.9932 16.1907 25.4981 15.0459 26.3496C13.9163 27.1898 13.2716 28.2906 13.2715 29.54C13.2715 30.614 13.5428 31.1563 13.8369 31.4443C14.1373 31.7383 14.7237 32.0244 15.8965 32.0244C20.258 32.0244 23.7244 35.2002 23.7246 39.5244V40.498C23.8162 40.4995 23.908 40.5 24 40.5C26.4371 40.5 28.751 39.9719 30.833 39.0234C30.9208 38.8602 30.9358 38.7982 30.9482 38.7266C30.9774 38.5587 30.9884 38.2531 30.9297 37.4658L30.9287 37.4531C30.9248 37.3943 30.9187 37.317 30.9111 37.2275C30.8882 36.958 30.8555 36.5743 30.8555 36.2285C30.8556 34.7195 31.6488 33.6267 32.6387 32.5156C32.8563 32.2685 33.0082 32.0829 33.1143 31.9424C32.9635 31.8466 32.7907 31.742 32.5908 31.6201L32.583 31.6152C32.3114 31.4496 32.0003 31.2591 31.6855 31.0527C31.0684 30.6481 30.3499 30.1251 29.7773 29.4727C29.1972 28.8114 28.6758 27.9103 28.6758 26.7832C28.6759 25.5364 29.2373 24.3518 29.9961 23.4951C30.7479 22.6464 31.8878 21.9082 33.2227 21.9082C34.9127 21.9082 36.015 22.838 36.6035 23.334C36.6128 23.3418 36.6228 23.3498 36.6318 23.3574C36.6951 23.4107 36.7519 23.4587 36.8027 23.499L36.8184 23.5107L37.1562 23.7861C37.5697 24.1229 37.8857 24.3804 38.1348 24.5752C38.5541 24.297 39.2565 23.9004 40.1836 23.9004H40.5C40.4464 14.8335 33.0795 7.5 24 7.5ZM16.6221 9.2373C11.2133 11.9457 7.5 17.5392 7.5 24C7.5 31.9912 13.181 38.6555 20.7246 40.1748V39.5244C20.7244 37.0054 18.7535 35.0244 15.8965 35.0244C14.2803 35.0244 12.8041 34.6308 11.7393 33.5889C10.6683 32.5409 10.2715 31.0906 10.2715 29.54C10.2716 27.1336 11.5489 25.2114 13.2549 23.9424C14.946 22.6845 17.1392 21.9932 19.2715 21.9932C20.7442 21.9932 22.0343 22.3669 23.0693 22.6777L23.1514 22.7031C24.2172 23.0233 24.9256 23.2353 25.5996 23.2354C25.6056 23.2354 25.6169 23.235 25.6396 23.2266C25.6647 23.2172 25.7092 23.1961 25.7705 23.1494C25.9001 23.0507 26.0657 22.869 26.2314 22.5869C26.5712 22.0085 26.7715 21.2502 26.7715 20.6572C26.7713 20.6295 26.741 20.4092 26.3867 19.9941C26.0533 19.6036 25.5547 19.1863 24.9619 18.7959C24.3761 18.4101 23.7516 18.085 23.21 17.8613C22.9751 17.7644 22.7676 17.6918 22.5957 17.6416C22.5551 17.7298 22.508 17.841 22.4551 17.9795C22.4018 18.1191 22.35 18.2645 22.2939 18.4238C22.286 18.4465 22.2777 18.4699 22.2695 18.4932L22.2686 18.4961C22.2054 18.6758 22.1334 18.8792 22.0586 19.0723C21.935 19.391 21.7056 19.9604 21.292 20.374C20.9708 20.6951 20.3799 21.041 19.6357 20.8564C19.0593 20.7133 18.7234 20.3154 18.5967 20.1543C18.358 19.8508 18.1469 19.4197 18.0195 19.1592L17.9746 19.0674C17.8563 18.8288 17.7646 18.6554 17.6865 18.5303C17.5698 18.5557 17.4885 18.5936 17.4268 18.6299C17.2991 18.705 17.1677 18.8247 16.9814 19.0459C16.9554 19.0768 16.9185 19.1223 16.874 19.1777C16.7163 19.3741 16.4611 19.6927 16.2363 19.9072C15.8669 20.2597 15.284 20.6592 14.459 20.6592C13.7787 20.6591 12.9899 20.5115 12.3076 20.0195C11.5868 19.4997 11.1532 18.7166 11.0195 17.7871C10.8621 16.6915 11.3301 15.5479 11.8262 14.6699C12.362 13.7216 13.1159 12.763 13.9395 11.9395C14.2836 11.5953 14.6493 11.2789 14.9668 11.0049C15.0363 10.9449 15.1038 10.8869 15.168 10.8311C15.5449 10.5028 15.8649 10.2091 16.1543 9.87207C16.3136 9.68649 16.4713 9.47898 16.6221 9.2373ZM33.2227 24.9082C33.0105 24.9083 32.627 25.05 32.2422 25.4844C31.8645 25.9107 31.6759 26.4131 31.6758 26.7832C31.6758 26.9334 31.7378 27.1585 32.0322 27.4941C32.3342 27.8382 32.7815 28.1842 33.3301 28.5439C33.5983 28.7198 33.8706 28.886 34.1455 29.0537L34.1807 29.0752C34.4351 29.2304 34.7045 29.3944 34.9414 29.5518C35.1788 29.7094 35.4618 29.9105 35.6973 30.1445C35.8815 30.3276 36.3397 30.8199 36.3398 31.5645C36.3398 32.7083 35.7669 33.5039 34.8877 34.502L34.8818 34.5078C33.9516 35.5515 33.8555 35.9114 33.8555 36.2285C33.8555 36.4427 33.8701 36.6114 33.8887 36.8262C33.8978 36.9317 33.9081 37.0484 33.918 37.1875C37.1814 34.7292 39.5035 31.0876 40.2461 26.9004H40.1836C40.1265 26.9004 40.0204 26.9199 39.7568 27.0986C39.7031 27.1351 39.6514 27.1726 39.5898 27.2168C39.581 27.2231 39.5708 27.2297 39.5615 27.2363L39.5508 27.2451C39.4802 27.2958 39.3825 27.3653 39.2852 27.4287C39.1891 27.4913 39.0476 27.5784 38.8799 27.6514C38.7154 27.7229 38.45 27.8145 38.1211 27.8145C37.6347 27.8144 37.2527 27.5997 37.1094 27.5176C36.9111 27.4039 36.7071 27.2594 36.5146 27.1143C36.1922 26.8711 35.7685 26.5254 35.2461 26.0996L34.9316 25.8438C34.8277 25.7613 34.7321 25.6839 34.6445 25.6133C34.028 25.1165 33.7696 24.9082 33.2227 24.9082Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.0405 9.04024C19.0937 2.98711 28.9073 2.98711 34.9604 9.04024C41.076 15.156 40.5588 24.4903 35.0347 30.8801C34.1035 31.9572 31.6464 34.9607 29.4019 37.7199C28.284 39.0941 27.225 40.4003 26.4458 41.3625C26.0564 41.8434 25.7364 42.2381 25.5142 42.5129L25.1675 42.9426C24.8827 43.2951 24.4536 43.5002 24.0005 43.5002C23.5473 43.5002 23.1183 43.2951 22.8335 42.9426L22.8325 42.9406L22.4868 42.5139C22.2646 42.2391 21.9447 41.8435 21.5552 41.3625C20.7759 40.4003 19.7169 39.0941 18.5991 37.7199C16.3546 34.9607 13.8976 31.9572 12.9663 30.8801C7.442 24.4902 6.92474 15.1561 13.0405 9.04024ZM32.8394 11.1613C27.9578 6.27978 20.0432 6.27978 15.1616 11.1613C10.3428 15.9801 10.5594 23.5091 15.2358 28.9182C16.2041 30.0381 18.696 33.0856 20.9263 35.8273C22.0458 37.2035 23.1061 38.5105 23.8862 39.4738C23.9249 39.5216 23.9632 39.5694 24.0005 39.6154C24.0378 39.5694 24.0761 39.5216 24.1147 39.4738C24.8948 38.5106 25.9544 37.2034 27.0737 35.8273C29.304 33.0856 31.7969 30.0381 32.7651 28.9182C37.4415 23.5091 37.6579 15.9801 32.8394 11.1613ZM23.9995 12.5002C28.1416 12.5002 31.4995 15.8581 31.4995 20.0002C31.4994 24.1422 28.1416 27.5002 23.9995 27.5002C19.8577 27.4999 16.4996 24.1421 16.4995 20.0002C16.4995 15.8582 19.8576 12.5005 23.9995 12.5002ZM23.9995 15.5002C21.5145 15.5005 19.4995 17.5151 19.4995 20.0002C19.4996 22.4852 21.5145 24.4999 23.9995 24.5002C26.4847 24.5002 28.4994 22.4854 28.4995 20.0002C28.4995 17.5149 26.4848 15.5002 23.9995 15.5002Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M22.5254 3.57684C23.641 3.20497 24.7233 3.29253 25.6758 3.73212C26.5934 4.1557 27.314 4.86723 27.8545 5.63934C28.9223 7.16478 29.5 9.22178 29.5 10.9997C29.5 12.0284 29.1707 13.173 28.7773 14.2057C28.5008 14.9318 28.1652 15.6703 27.8164 16.3737C28.7442 15.9513 29.7333 15.5369 30.6797 15.2077C31.7876 14.8224 32.9859 14.4997 34 14.4997C35.7947 14.4997 37.6673 15.0899 38.9883 16.2458C40.3812 17.4646 41.1387 19.3269 40.4229 21.4743C39.7523 23.4857 38.2825 24.7085 36.5498 25.3317C34.8706 25.9357 32.9329 25.9902 31.1016 25.7712C29.2531 25.5501 27.3969 25.0363 25.8135 24.3932C24.7969 23.9804 23.831 23.4895 23.0352 22.9489C22.6835 23.323 22.2426 23.8711 21.793 24.6354C20.7963 26.3298 19.722 29.1449 19.5303 33.5798C24.4174 34.1035 27.0836 37.0873 28.3643 39.2311C28.789 39.9423 28.5569 40.863 27.8457 41.2878C27.1345 41.7123 26.2138 41.4803 25.7891 40.7692C24.7259 38.9894 22.4821 36.4997 18 36.4997C13.5179 36.4997 11.2741 38.9894 10.2109 40.7692C9.7861 41.4804 8.86452 41.7126 8.15332 41.2878C7.4425 40.863 7.21037 39.9422 7.63477 39.2311C8.92048 37.0788 11.604 34.0801 16.5283 33.5739C16.7242 28.6313 17.9259 25.293 19.207 23.1149C19.7917 22.121 20.3855 21.38 20.8926 20.8474C19.4125 18.9034 17.929 15.988 17.4014 13.0895C17.0709 11.2743 17.0876 9.31487 17.8643 7.56415C18.6659 5.75733 20.1979 4.35279 22.5254 3.57684ZM34 17.4997C33.5143 17.4997 32.7129 17.6772 31.665 18.0417C30.6555 18.3928 29.5511 18.8689 28.5137 19.3571C27.4804 19.8434 26.5348 20.3309 25.8467 20.6979C25.7029 20.7746 25.5704 20.8461 25.4512 20.9108C25.8784 21.1457 26.3783 21.3843 26.9414 21.613C28.3026 22.1658 29.9003 22.6064 31.458 22.7927C33.0328 22.981 34.455 22.8966 35.5342 22.5085C36.5599 22.1395 37.2467 21.5164 37.5771 20.5251C37.8611 19.6728 37.6196 19.0347 37.0127 18.5036C36.3337 17.9095 35.2053 17.4997 34 17.4997ZM24.4189 6.45575C24.1527 6.33285 23.8589 6.29447 23.4746 6.42255C21.8583 6.96134 21.0298 7.82689 20.6064 8.78094C20.1584 9.79107 20.0854 11.0851 20.3525 12.5524C20.7654 14.8202 21.9227 17.1426 23.0449 18.7136C23.1309 18.5779 23.2334 18.4148 23.3477 18.2292C23.7116 17.6377 24.1953 16.8214 24.6768 15.9186C25.1604 15.0117 25.6293 14.0411 25.9736 13.1374C26.3301 12.2016 26.5 11.4709 26.5 10.9997C26.5 9.77771 26.0786 8.33451 25.3965 7.36005C25.0622 6.88247 24.7198 6.59475 24.4189 6.45575Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M24.0049 4.5C24.9077 4.50022 25.4484 5.12878 25.6846 5.54004L25.7041 5.57324L32.4189 18.7959L32.4199 18.7979C32.475 18.9055 32.5307 19.0131 32.5859 19.1211C34.5008 22.8638 36.5 26.7727 36.5 30.873C36.5 37.9255 30.9315 43.5 23.9814 43.5C17.0249 43.4999 11.5 37.9189 11.5 30.873C11.5 26.7741 13.4636 22.8655 15.3477 19.1152C15.3995 19.012 15.4512 18.9087 15.5029 18.8057L15.5107 18.79L22.3125 5.6123C22.5396 5.15539 23.0764 4.5 24.0049 4.5ZM18.1807 20.1592C16.1583 24.1882 14.5 27.5166 14.5 30.873C14.5 36.2925 18.7121 40.4999 23.9814 40.5C29.2574 40.5 33.5 36.286 33.5 30.873C33.5 27.522 31.8108 24.1967 29.748 20.1611L29.7461 20.1572L24.0107 8.86328L18.1807 20.1592Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,98 @@
1
+ /*
2
+ * MenuCard NGU (Figma: ShortcutCard): a link-shaped .ds-card with a round icon and a short title.
3
+ * Ladder step 4 (new NGU component built from .ds-card + .ds-paragraph). CSS only, no <ngu-*> element.
4
+ * The card itself is the <a>, so the whole card is clickable, keyboard focusable and needs no JavaScript.
5
+ * Tokens only. Light/dark and colour follow --ds-* (set data-color on the card for other colours).
6
+ * Figma states: default, hover (surface-hover), active/visited (surface-active).
7
+ * Variants (data-variant): default = white card + tinted circle, tinted = tinted card + white circle.
8
+ * Sizes (data-size): md = desktop (circle 72, icon 48), sm = mobile.
9
+ * Title: desktop uses heading md tokens, mobile heading xs.
10
+ * Card size (border-box): md 470x165, sm 374x88; width shrinks to the container (max-inline-size 100%).
11
+ */
12
+ .ngu-menu-card {
13
+ --dsc-card-padding: var(--ds-size-6);
14
+ --dsc-card-border-color: var(--ds-color-border-subtle);
15
+ --dsc-card-background: var(--ds-color-surface-default);
16
+ --ngu-menu-card-icon-background: var(--ds-color-surface-tinted);
17
+ --ngu-menu-card-gap: var(--ds-size-5);
18
+ /* 72 and 48 have no --ds-size token that holds in both size modes, so they stay component properties. */
19
+ --ngu-menu-card-circle-size: 72px;
20
+ --ngu-menu-card-icon-size: 48px;
21
+ --ngu-menu-card-inline-size: 470px;
22
+ --ngu-menu-card-block-size: 165px;
23
+ display: flex;
24
+ align-items: center;
25
+ gap: var(--ngu-menu-card-gap);
26
+ /* Figma border-box sizes (no --ds-size token matches). Height is a minimum so long titles grow the card instead of clipping. */
27
+ inline-size: var(--ngu-menu-card-inline-size);
28
+ min-block-size: var(--ngu-menu-card-block-size);
29
+ max-inline-size: 100%;
30
+ box-sizing: border-box;
31
+ text-decoration: none;
32
+ color: var(--ds-color-text-default);
33
+ }
34
+
35
+ .ngu-menu-card[data-variant='tinted'] {
36
+ --dsc-card-background: var(--ds-color-background-tinted);
37
+ --ngu-menu-card-icon-background: var(--ds-color-surface-default);
38
+ }
39
+
40
+ .ngu-menu-card[data-size='sm'] {
41
+ --dsc-card-padding: var(--ds-size-4);
42
+ --ngu-menu-card-gap: var(--ds-size-3);
43
+ --ngu-menu-card-circle-size: 40px;
44
+ --ngu-menu-card-icon-size: 24px;
45
+ --ngu-menu-card-inline-size: 374px;
46
+ --ngu-menu-card-block-size: 88px;
47
+ }
48
+
49
+ /* Real :hover/:active come from .ds-card (a). [data-state] forces them for Storybook, docs and visual tests. */
50
+ .ngu-menu-card[data-state='hover'] {
51
+ background: var(--dsc-card-background--hover);
52
+ }
53
+
54
+ .ngu-menu-card:active,
55
+ .ngu-menu-card[data-state='active'] {
56
+ background: var(--dsc-card-background--active);
57
+ }
58
+
59
+ .ngu-menu-card__icon {
60
+ display: inline-flex;
61
+ flex-shrink: 0;
62
+ align-items: center;
63
+ justify-content: center;
64
+ box-sizing: border-box;
65
+ inline-size: var(--ngu-menu-card-circle-size);
66
+ block-size: var(--ngu-menu-card-circle-size);
67
+ border: var(--ds-border-width-default) solid var(--ds-color-border-subtle);
68
+ border-radius: 50%;
69
+ background: var(--ngu-menu-card-icon-background);
70
+ color: var(--ds-color-text-default);
71
+ }
72
+
73
+ .ngu-menu-card__icon svg {
74
+ inline-size: var(--ngu-menu-card-icon-size);
75
+ block-size: var(--ngu-menu-card-icon-size);
76
+ }
77
+
78
+ .ngu-menu-card__title {
79
+ margin: 0;
80
+ min-inline-size: 0;
81
+ overflow-wrap: anywhere;
82
+ }
83
+
84
+ /* Desktop (md): Figma typography/heading/md (30px, 500, 130%, -0.0025em). */
85
+ .ngu-menu-card:not([data-size='sm']) .ngu-menu-card__title {
86
+ font-size: var(--ds-heading-md-font-size);
87
+ font-weight: var(--ds-heading-md-font-weight);
88
+ line-height: var(--ds-heading-md-line-height);
89
+ letter-spacing: var(--ds-heading-md-letter-spacing);
90
+ }
91
+
92
+ /* Mobile (sm): Figma typography/heading/xs (21px, 500, 130%). */
93
+ .ngu-menu-card[data-size='sm'] .ngu-menu-card__title {
94
+ font-size: var(--ds-heading-xs-font-size);
95
+ font-weight: var(--ds-heading-xs-font-weight);
96
+ line-height: var(--ds-heading-xs-line-height);
97
+ letter-spacing: var(--ds-heading-xs-letter-spacing);
98
+ }
@@ -0,0 +1,3 @@
1
+ export * from './components/map-card/map-card.js';
2
+ export * from './components/anchor-nav/anchor-nav.js';
3
+ export * from './components/map-details/map-details.js';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // Register NGU custom elements here.
2
+ export * from './components/map-card/map-card.js';
3
+ export * from './components/anchor-nav/anchor-nav.js';
4
+ export * from './components/map-details/map-details.js';
@@ -0,0 +1,12 @@
1
+ /*
2
+ * NGU component styles. Load after @digdir/designsystemet-css and @ngu-no/ngu-designsystem/tokens.css.
3
+ * Layer order guarantees NGU styles win over Designsystemet without !important.
4
+ */
5
+ @layer ds, ngu;
6
+
7
+ @import '../components/employee-card/employee-card.css' layer(ngu);
8
+ @import '../components/map-card/map-card.css' layer(ngu);
9
+ @import '../components/anchor-nav/anchor-nav.css' layer(ngu);
10
+ @import '../components/map-details/map-details.css' layer(ngu);
11
+ @import '../components/hero/hero.css' layer(ngu);
12
+ @import '../components/menu-card/menu-card.css' layer(ngu);
@@ -0,0 +1,11 @@
1
+ /*
2
+ * NGU-specific tokens that do not exist in Designsystemet.
3
+ * Always prefix with --ngu-. Prefer referencing --ds-* tokens over raw values.
4
+ * Theme tokens consumed by Designsystemet components are built into dist/theme (--ds-*).
5
+ */
6
+ :root {
7
+ /* Avatar placeholder (no image): same light grey in light and dark mode, per Figma. */
8
+ --ngu-color-avatar-placeholder: #d9d9d9;
9
+ /* Text on the placeholder; fixed dark so it stays readable in dark mode. */
10
+ --ngu-color-avatar-placeholder-text: #262626;
11
+ }
@@ -0,0 +1,2 @@
1
+ @import './theme/theme.css';
2
+ @import './extensions.css';
@@ -0,0 +1,20 @@
1
+ /* @deprecated: This file will be removed in a future release. Use types.d.ts instead */
2
+ /* build: v1.24.1 */
3
+ import type {} from '@digdir/designsystemet-types';
4
+
5
+ // Augment types based on theme
6
+ declare module '@digdir/designsystemet-types' {
7
+ export interface ColorDefinitions {
8
+ green: never;
9
+ 'dark-green': never;
10
+ 'dark-blue': never;
11
+ blue: never;
12
+ neutral: never;
13
+ }
14
+ export interface SeverityColorDefinitions {
15
+ info: never;
16
+ success: never;
17
+ warning: never;
18
+ danger: never;
19
+ }
20
+ }