@helsevestikt/hviktor-angular 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helsevestikt/hviktor-angular",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=17.0.0 <22.0.0",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "files": [
25
25
  "fesm2022/",
26
+ "types/",
26
27
  "index.d.ts",
27
28
  "styles.css",
28
29
  "README.md",
@@ -0,0 +1,776 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, AfterViewInit, OnChanges, ElementRef, ChangeDetectorRef } from '@angular/core';
3
+ import { FormGroup, ReactiveFormsModule } from '@angular/forms';
4
+ import { HttpClient } from '@angular/common/http';
5
+
6
+ /**
7
+ * Alert provides users with information that is especially important for them to see and understand.
8
+ * The component is designed to capture users' attention.
9
+ * The text in the alert should be short and clear.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <hvi-alert color="warning">
14
+ * Dette er et advarselsvarsel!
15
+ * </hvi-alert>
16
+ * ```
17
+ *
18
+ * Documentation: https://designsystemet.no/en/components/docs/alert/code/
19
+ */
20
+ declare class HviAlert {
21
+ /** Sets the type of alert by changing the color and */
22
+ color?: 'info' | 'success' | 'warning' | 'danger';
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviAlert, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviAlert, "hvi-alert", never, { "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
25
+ }
26
+
27
+ /**
28
+ * Avatar displays an image, initials, or icon for a person, entity, or profile.
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <hvi-avatar
33
+ * ariaLabel="Ola Nordmann"
34
+ * variant="circle"
35
+ * initials="ON"
36
+ * size="md"
37
+ * color="brand1">
38
+ * </hvi-avatar>
39
+ * ```
40
+ *
41
+ * Documentation: https://designsystemet.no/en/components/docs/avatar/code/
42
+ */
43
+ declare class HviAvatar {
44
+ /** The name of the person the avatar represents */
45
+ ariaLabel?: string;
46
+ /** The shape of the avatar */
47
+ variant?: 'circle' | 'square';
48
+ /** Initials displayed inside the avatar */
49
+ initials?: string;
50
+ /** The size of the avatar */
51
+ size?: 'xs' | 'sm' | 'md' | 'lg';
52
+ /** The color theme of the avatar */
53
+ color?: 'accent' | 'brand1' | 'brand2' | 'brand3' | 'neutral' | 'danger';
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviAvatar, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviAvatar, "hvi-avatar", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "initials": { "alias": "initials"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
56
+ }
57
+
58
+ declare class HviBadgePosition {
59
+ /** Overlap of the badge */
60
+ overlap: 'rectangle' | 'circle';
61
+ /** Placement of the badge */
62
+ placement: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviBadgePosition, never>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviBadgePosition, "hvi-badge-position", never, { "overlap": { "alias": "overlap"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; }, {}, never, ["*"], true, never>;
65
+ }
66
+
67
+ declare class HviBadge {
68
+ /** The variants of the badge */
69
+ variant?: 'base' | 'tinted';
70
+ /** count text of the badge*/
71
+ count?: string;
72
+ /** The color theme of the badge */
73
+ color?: 'neutral' | 'danger' | 'warning' | 'info' | 'success' | 'accent' | 'brand1' | 'brand2' | 'brand3';
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviBadge, never>;
75
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviBadge, "hvi-badge", never, { "variant": { "alias": "variant"; "required": false; }; "count": { "alias": "count"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
76
+ }
77
+
78
+ interface BreadcrumbItem {
79
+ label: string;
80
+ href: string;
81
+ ariaLabel?: string;
82
+ }
83
+ /**
84
+ * Info
85
+ *
86
+ * Eksempel på bruk:
87
+ * ```html
88
+ * <nav hviBreadcrumbs
89
+ * ariaLabel="Du er her:"
90
+ * [backLink]="{
91
+ * label: 'Nivå 3',
92
+ * href: '#',
93
+ * ariaLabel: 'Tilbake til Nivå 3'
94
+ * }"
95
+ * [items]="[
96
+ * { label: 'Nivå 1', href: '#' },
97
+ * { label: 'Nivå 2', href: '#' },
98
+ * { label: 'Nivå 3', href: '#' },
99
+ * { label: 'Nivå 4', href: '#' }
100
+ * ]"
101
+ * ></nav>
102
+ * ```
103
+ *
104
+ * Dokumentasjon: https://designsystemet.no/no/components/docs/breadcrumbs/overview
105
+ */
106
+ declare class HviBreadcrumbs {
107
+ /** Accessible label for the breadcrumb navigation */
108
+ ariaLabel: string;
109
+ /** Optional back link object */
110
+ backLink?: {
111
+ label: string;
112
+ href: string;
113
+ ariaLabel?: string;
114
+ };
115
+ /** Array of breadcrumb items */
116
+ items: BreadcrumbItem[];
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviBreadcrumbs, never>;
118
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviBreadcrumbs, "nav[hviBreadcrumbs]", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "backLink": { "alias": "backLink"; "required": false; }; "items": { "alias": "items"; "required": false; }; }, {}, never, never, true, never>;
119
+ }
120
+
121
+ /**
122
+ * @summary
123
+ * Button allows users to perform actions.
124
+ *
125
+ * @example
126
+ * ```html
127
+ * <button hviButton color="brand1" variant="primary" size="md">
128
+ * Click me
129
+ * </button>
130
+ * ```
131
+ *
132
+ * Documentation: https://designsystemet.no/en/components/docs/button/code/
133
+ */
134
+ declare class HviButton {
135
+ /** The size of the button */
136
+ size?: 'sm' | 'md' | 'lg';
137
+ /** Used to change the appearance of the button. */
138
+ variant?: 'primary' | 'secondary' | 'tertiary';
139
+ /** The type of button */
140
+ type?: 'button' | 'submit' | 'reset';
141
+ /** The color of the button */
142
+ color?: 'accent' | 'brand1' | 'brand2' | 'brand3' | 'neutral' | 'danger';
143
+ /** If you have only an icon in the button, you can set icon="true" to make it square.
144
+ * If you have other content, such as text, the button will automatically have space around the icon.
145
+ */
146
+ icon: boolean;
147
+ /** Sets the button in a loading state.
148
+ * Loading indicators such as spinners must be added manually, e.g., with hvi-spinner
149
+ */
150
+ loading: boolean;
151
+ /** Makes the button full width */
152
+ fullWidth: boolean;
153
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviButton, never>;
154
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviButton, "button[hviButton], a[hviButton]", never, { "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "type": { "alias": "type"; "required": false; }; "color": { "alias": "color"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; }, {}, never, never, true, never>;
155
+ static ngAcceptInputType_icon: unknown;
156
+ static ngAcceptInputType_loading: unknown;
157
+ static ngAcceptInputType_fullWidth: unknown;
158
+ }
159
+
160
+ /**
161
+ * Use multiple <div hviCardBlock> elements if you want to divide the card with separators or add images or video that extend to the edge.
162
+ * Note that when you use <div hviCardBlock>, all content must be placed inside a <div hviCardBlock> and not directly in the Card.
163
+ *
164
+ * @example
165
+ * ```html
166
+ * <hvi-card variant="tinted" color="brand1" maxWidth="400px">
167
+ * <div hviCardBlock>
168
+ * <h2>This is a card</h2>
169
+ * <p>The content of the card goes here.</p>
170
+ * </div>
171
+ * </hvi-card>
172
+ * ```
173
+ *
174
+ * Documentation: https://designsystemet.no/en/components/docs/card/code#with-sections
175
+ */
176
+ declare class HviCardBlock {
177
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviCardBlock, never>;
178
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviCardBlock, "[hviCardBlock]", never, {}, {}, never, never, true, never>;
179
+ }
180
+
181
+ /**
182
+ * Card highlight information or tasks that are related.
183
+ * The component comes in two variants and can contain text, images, text fields, buttons, and links.
184
+ *
185
+ * @example
186
+ * ```html
187
+ * <hvi-card variant="tinted" color="brand1" maxWidth="400px">
188
+ * <h2>This is a card</h2>
189
+ * <p>The content of the card goes here.</p>
190
+ * </hvi-card>
191
+ * ```
192
+ *
193
+ * Documentation: https://designsystemet.no/en/components/docs/card/overview
194
+ */
195
+ declare class HviCard {
196
+ /** Sets the background of the card */
197
+ variant?: 'default' | 'tinted';
198
+ /** The color theme of the card */
199
+ color?: 'accent' | 'brand1' | 'brand2' | 'brand3' | 'neutral';
200
+ /** Maximum width of the card, for example '320px' or '20rem' */
201
+ maxWidth?: string;
202
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviCard, never>;
203
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviCard, "hvi-card", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "maxWidth": { "alias": "maxWidth"; "required": false; }; }, {}, never, ["*"], true, never>;
204
+ }
205
+
206
+ declare class HviChipButton {
207
+ /** Whether the chip is removable*/
208
+ removable: boolean;
209
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviChipButton, never>;
210
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviChipButton, "button[hviChip]", never, { "removable": { "alias": "removable"; "required": false; }; }, {}, never, never, true, never>;
211
+ static ngAcceptInputType_removable: unknown;
212
+ }
213
+
214
+ declare class HviChipLabel {
215
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviChipLabel, never>;
216
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviChipLabel, "label[hviChip]", never, {}, {}, never, never, true, never>;
217
+ }
218
+
219
+ declare class HviDetailsContent {
220
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDetailsContent, never>;
221
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviDetailsContent, "hvi-details-content", never, {}, {}, never, ["*"], true, never>;
222
+ }
223
+
224
+ declare class HviDetailsSummary {
225
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDetailsSummary, never>;
226
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviDetailsSummary, "hvi-details-summary", never, {}, {}, never, ["*"], true, never>;
227
+ }
228
+
229
+ /**
230
+ * Info
231
+ *
232
+ * Eksempel på bruk:
233
+ * ```html
234
+ * <hvi-details>
235
+ * <hvi-details-summary>
236
+ * <p size="md">Detaljer</p>
237
+ * </hvi-details-summary>
238
+ * <hvi-details-content>
239
+ * <p>Her er innholdet i detaljene.</p>
240
+ * </hvi-details-content>
241
+ * </hvi-details>
242
+ * ```
243
+ *
244
+ * Dokumentasjon: https://designsystemet.no/no/components/docs/details/overview
245
+ */
246
+ declare class HviDetails {
247
+ /** Variant of the details component */
248
+ variant: 'default' | 'tinted';
249
+ /** Control open state of the details component */
250
+ open: true | false;
251
+ /** Set default open state of the details component */
252
+ defaultOpen: true | false;
253
+ /** Event handler for toggle event */
254
+ onToggle: (event: Event) => void;
255
+ handleToggle(event: Event): void;
256
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDetails, never>;
257
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviDetails, "hvi-details", never, { "variant": { "alias": "variant"; "required": false; }; "open": { "alias": "open"; "required": false; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; }; "onToggle": { "alias": "onToggle"; "required": false; }; }, {}, never, ["hvi-details-summary", "hvi-details-content"], true, never>;
258
+ }
259
+
260
+ declare class HviDialogBlock {
261
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDialogBlock, never>;
262
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviDialogBlock, "[hviDialogBlock]", never, {}, {}, never, never, true, never>;
263
+ }
264
+
265
+ /**
266
+ * @summary
267
+ * Dialog allows you to create both modal and non-modal dialogs based on the HTML dialog element.
268
+ * You have to connect the <dialog> element to a trigger yourself, and handle opening and closing the dialog with JavaScript.
269
+ *
270
+ * @example
271
+ * HTML:
272
+ * ```html
273
+ * <dialog hviDialog [id]="exampleDialog" [open]="dialogOpen()" (openChange)="toggleDialog($event)">
274
+ * <h3 hviHeading size="md">Example dialog</h3>
275
+ * <p hviParagraph>This is an example of a dialog component.</p>
276
+ * <button hviButton variant="primary" (click)="closeDialog()">Close dialog</button>
277
+ * </dialog>
278
+ * ```
279
+ *
280
+ * TypeScript:
281
+ * ```ts
282
+ * export class DialogExampleComponent {
283
+ * readonly dialogOpen = signal(false);
284
+ * toggleDialog(nextState?: boolean): void {
285
+ * if (typeof nextState === 'boolean') {
286
+ * this.dialogOpen.set(nextState);
287
+ * return;
288
+ * }
289
+ * this.dialogOpen.update((current) => !current);
290
+ * }
291
+ * }
292
+ *
293
+ * Documentation: https://designsystemet.no/en/components/docs/dialog/code/
294
+ */
295
+ declare class HviDialog {
296
+ id?: string;
297
+ set open(value: boolean);
298
+ get open(): boolean;
299
+ modal: boolean;
300
+ readonly openChange: EventEmitter<boolean>;
301
+ private readonly element;
302
+ openModal(): void;
303
+ close(): void;
304
+ handleClose(): void;
305
+ handleCancel(event: Event): void;
306
+ private setOpen;
307
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDialog, never>;
308
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviDialog, "dialog[hviDialog]", never, { "id": { "alias": "id"; "required": false; }; "open": { "alias": "open"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; }, { "openChange": "openChange"; }, never, never, true, never>;
309
+ }
310
+
311
+ /**
312
+ * Info
313
+ *
314
+ * Eksempel på bruk:
315
+ * ```html
316
+ * <hr hviDivider />
317
+ * ```
318
+ *
319
+ * Dokumentasjon: https://designsystemet.no/no/components/docs/divider/overview
320
+ */
321
+ declare class HviDivider {
322
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDivider, never>;
323
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviDivider, "hr[hviDivider]", never, {}, {}, never, never, true, never>;
324
+ }
325
+
326
+ type HviValidationMessages = Partial<Record<string, string>>;
327
+ declare class HviValidationMessage {
328
+ /**
329
+ * Control name in the nearest parent FormGroup (matches formControlName).
330
+ * Example: hviValidationMessage="firstName"
331
+ */
332
+ controlName: string;
333
+ /**
334
+ * Map errorKey -> message, e.g. { required: 'Påkrevd', minlength: 'Minst 2 tegn' }
335
+ */
336
+ messages: HviValidationMessages;
337
+ /**
338
+ * Optional error priority order. Defaults to a sensible order.
339
+ */
340
+ errorPriority: readonly string[];
341
+ private readonly container;
342
+ private readonly hviForm;
343
+ private get control();
344
+ get message(): string;
345
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviValidationMessage, never>;
346
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviValidationMessage, "[hviValidationMessage]", never, { "controlName": { "alias": "hviValidationMessage"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "errorPriority": { "alias": "errorPriority"; "required": false; }; }, {}, never, never, true, never>;
347
+ }
348
+
349
+ /**
350
+ * Item model used by manual error summaries. Provide `message` and `href` for each invalid field.
351
+ */
352
+ type HviErrorSummaryItem = {
353
+ /** Text shown in the list */
354
+ message: string;
355
+ /** Link target (should be "#<field-id>") */
356
+ href: string;
357
+ };
358
+ type HviErrorSummaryMessages = Record<string, HviValidationMessages>;
359
+ /**
360
+ * @summary
361
+ * ErrorSummary lists blocking validation errors so users can quickly find and fix them.
362
+ *
363
+ * @remarks
364
+ * Modes:
365
+ * - Manual: provide `[errors]` as `{ message, href }[]`.
366
+ * - Auto (recommended): provide `[form]` + `[messages]` (and optionally `[idMap]`) to derive errors from invalid
367
+ * controls in a reactive form.
368
+ *
369
+ * Auto mode should be rendered inside `<form hviForm ...>` so it can follow submit visibility (`showWhen`) and
370
+ * be focused automatically via `[focusOnInvalid]`.
371
+ *
372
+ * Each item link must point to a field id (e.g. `href="#firstName"`). Prefer `id === formControlName`.
373
+ *
374
+ * @example
375
+ * Manual mode:
376
+ * ```html
377
+ * <hvi-error-summary
378
+ * [errors]="[
379
+ * { message: 'Fornavn må være minst 2 tegn', href: '#firstName' },
380
+ * { message: 'Telefonnummer kan kun inneholde siffer', href: '#phone' }
381
+ * ]"
382
+ * />
383
+ * ```
384
+ *
385
+ * @example
386
+ * Auto mode (HTML + TS):
387
+ *
388
+ * ```html
389
+ * HTML:
390
+ * <form hviForm [formGroup]="form" [focusOnInvalid]="summary">
391
+ * <hvi-error-summary #summary [form]="form" [messages]="messages" showWhen="submitted" />
392
+ *
393
+ * <hvi-field>
394
+ * <label hviLabel for="firstName" weight="medium">Fornavn</label>
395
+ * <input hviInput id="firstName" formControlName="firstName" hviControlInvalid />
396
+ * <p hviFieldValidation hviValidationMessage="firstName" [messages]="messages.firstName"></p>
397
+ * </hvi-field>
398
+ *
399
+ * <hvi-field>
400
+ * <label hviLabel for="phone" weight="medium">Telefon</label>
401
+ * <input hviInput id="phone" type="tel" formControlName="phone" hviControlInvalid />
402
+ * <p hviFieldValidation hviValidationMessage="phone" [messages]="messages.phone"></p>
403
+ * </hvi-field>
404
+ *
405
+ * <button hviButton type="submit" variant="primary">Send inn</button>
406
+ * </form>
407
+ * ```
408
+ *
409
+ * ```ts
410
+ * TS:
411
+ * form = new FormGroup({
412
+ * firstName: new FormControl('', [Validators.required, Validators.minLength(2)]),
413
+ * phone: new FormControl('', [Validators.required, Validators.pattern(/^\d+$/)]),
414
+ * });
415
+ *
416
+ * messages = {
417
+ * firstName: { required: 'Fornavn er påkrevd', minlength: 'Fornavn må være minst 2 tegn' },
418
+ * phone: { required: 'Telefon er påkrevd', pattern: 'Telefonnummer kan kun inneholde siffer' },
419
+ * } as const;
420
+ * ```
421
+ *
422
+ * Documentation: https://designsystemet.no/en/components/docs/error-summary/code
423
+ */
424
+ declare class HviErrorSummary {
425
+ /** Heading text shown above the list */
426
+ heading: string;
427
+ /** Heading level for the heading element (1-6). Defaults to 2 per DS */
428
+ headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
429
+ /**
430
+ * Manual mode: items displayed in the summary.
431
+ * If non-empty, manual mode takes precedence over auto mode.
432
+ */
433
+ errors: HviErrorSummaryItem[];
434
+ /** Auto mode: reactive form to derive errors from */
435
+ form?: FormGroup;
436
+ /**
437
+ * Auto mode: messages per controlName.
438
+ * Example:
439
+ * {
440
+ * firstName: { required: 'Fornavn er påkrevd', minlength: 'Fornavn må være minst 2 tegn' },
441
+ * phone: { required: 'Telefon er påkrevd', pattern: 'Telefonnummer kan kun inneholde siffer' }
442
+ * }
443
+ */
444
+ messages?: HviErrorSummaryMessages;
445
+ /**
446
+ * Auto mode: map controlName -> element id.
447
+ * Default is `id === controlName`.
448
+ */
449
+ idMap?: Record<string, string>;
450
+ /** Auto mode: error key priority (first match wins) */
451
+ errorPriority: readonly string[];
452
+ /** Used for aria-labelledby on the container */
453
+ headingId: string;
454
+ /** When to show errors from the form controls */
455
+ showWhen: 'submitted' | 'touched' | 'always';
456
+ private container?;
457
+ focus(): void;
458
+ get computedErrors(): HviErrorSummaryItem[];
459
+ private pickMessage;
460
+ private readonly hviForm;
461
+ get shouldShow(): boolean;
462
+ private anyInvalidTouched;
463
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviErrorSummary, never>;
464
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviErrorSummary, "hvi-error-summary", never, { "heading": { "alias": "heading"; "required": false; }; "headingLevel": { "alias": "headingLevel"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "form": { "alias": "form"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "idMap": { "alias": "idMap"; "required": false; }; "errorPriority": { "alias": "errorPriority"; "required": false; }; "headingId": { "alias": "headingId"; "required": false; }; "showWhen": { "alias": "showWhen"; "required": false; }; }, {}, never, never, true, never>;
465
+ }
466
+
467
+ /**
468
+ * Decorative affix container displayed alongside a text input.
469
+ *
470
+ * @remarks
471
+ * Used together with the `hvi-field-affixes` component to wrap leading and trailing adornments.
472
+ *
473
+ * @example
474
+ * ```html
475
+ * <hvi-field-affixes>
476
+ * <hvi-field-affix>NOK</hvi-field-affix>
477
+ * <input hviInput type="text" placeholder="Amount" />
478
+ * <hvi-field-affix>per month</hvi-field-affix>
479
+ * </hvi-field-affixes>
480
+ * ```
481
+ *
482
+ * Documentation: https://designsystemet.no/en/components/docs/field/code#prefixsuffix
483
+ */
484
+ declare class HviFieldAffix {
485
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldAffix, never>;
486
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldAffix, "hvi-field-affix", never, {}, {}, never, ["*"], true, never>;
487
+ }
488
+
489
+ /**
490
+ * Container for decorative affixes displayed alongside a text input.
491
+ *
492
+ * @remarks
493
+ * Wraps leading and trailing adornments provided by `hvi-field-affix` components.
494
+ *
495
+ * @example
496
+ * ```html
497
+ * <hvi-field-affixes>
498
+ * <hvi-field-affix>NOK</hvi-field-affix>
499
+ * <input hviInput type="text" placeholder="Amount" />
500
+ * <hvi-field-affix>per month</hvi-field-affix>
501
+ * </hvi-field-affixes>
502
+ * ```
503
+ *
504
+ * Documentation: https://designsystemet.no/en/components/docs/field/code#prefixsuffix
505
+ */
506
+ declare class HviFieldAffixes {
507
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldAffixes, never>;
508
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldAffixes, "hvi-field-affixes", never, {}, {}, never, ["*"], true, never>;
509
+ }
510
+
511
+ declare class HviFieldDescription {
512
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldDescription, never>;
513
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviFieldDescription, "[hviFieldDescription]", never, {}, {}, never, never, true, never>;
514
+ }
515
+
516
+ declare class HviFieldOptional {
517
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldOptional, never>;
518
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviFieldOptional, "[hviFieldOptional]", never, {}, {}, never, never, true, never>;
519
+ }
520
+
521
+ declare class HviFieldValidation {
522
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldValidation, never>;
523
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviFieldValidation, "[hviFieldValidation]", never, {}, {}, never, never, true, never>;
524
+ }
525
+
526
+ /**
527
+ * Field is a helper component to automatically associate a field with hviLabel, hviFieldDescription and hviFieldValidation.
528
+ *
529
+ * @example
530
+ * ```html
531
+ * <hvi-field>
532
+ * <label hviLabel>Name</label>
533
+ * <span hviFieldDescription>Fill in your full name.</span>
534
+ * <input type="text" />
535
+ * <span hviFieldValidation>This field is required.</span>
536
+ * </hvi-field>
537
+ * ```
538
+ *
539
+ * Documentation: https://designsystemet.no/en/components/docs/field/overview
540
+ */
541
+ declare class HviField implements AfterViewInit {
542
+ /** Position of toggle inputs (radio, checkbox, switch) in field */
543
+ position?: 'start' | 'end';
544
+ private readonly el;
545
+ private readonly destroyRef;
546
+ ngAfterViewInit(): void;
547
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviField, never>;
548
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviField, "hvi-field", never, { "position": { "alias": "position"; "required": false; }; }, {}, never, ["*"], true, never>;
549
+ }
550
+
551
+ declare function fieldObserver(fieldElement: HTMLElement | null): (() => void) | undefined;
552
+ declare const isElement: (node: Node) => node is Element;
553
+ declare const isLabel: (node: Node) => node is HTMLLabelElement;
554
+ declare const isInputLike: (node: unknown) => node is HTMLInputElement;
555
+
556
+ /**
557
+ * Fieldset is used to group and label fields that naturally belong together, such as date fields or address fields.
558
+ * The component helps organize information, make forms more manageable, and improve accessibility for screen readers.
559
+ *
560
+ * @example
561
+ * ```html
562
+ * <fieldset hviFieldset>
563
+ * <legend hviLabel>Which framework do you like best?</legend>
564
+ * <p hviParagraph>Your choice will help us improve the service.</p>
565
+ * <hvi-field>
566
+ * <input type="radio" id="angular" name="framework" value="angular" />
567
+ * <label hviLabel for="angular">Angular</label>
568
+ * </hvi-field>
569
+ * <hvi-field>
570
+ * <input type="radio" id="react" name="framework" value="react" />
571
+ * <label hviLabel for="react">React</label>
572
+ * </hvi-field>
573
+ * <hvi-field>
574
+ * <input type="radio" id="vue" name="framework" value="vue" />
575
+ * <label hviLabel for="vue">Vue</label>
576
+ * </hvi-field>
577
+ * </fieldset>
578
+ * ```
579
+ *
580
+ * Documentation: https://designsystemet.no/en/components/docs/fieldset/overview
581
+ */
582
+ declare class HviFieldset {
583
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldset, never>;
584
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviFieldset, "fieldset[hviFieldset]", never, {}, {}, never, never, true, never>;
585
+ }
586
+
587
+ type HviAriaRole = 'switch' | 'button' | 'checkbox' | 'radio' | 'textbox' | 'searchbox' | string;
588
+ declare class HviInput {
589
+ type?: 'number' | 'hidden' | 'color' | 'checkbox' | 'date' | 'datetime-local' | 'email' | 'file' | 'month' | 'password' | 'radio' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
590
+ size?: number;
591
+ /** Set role, e.g. `switch` when `checkbox` or `radio` */
592
+ role?: HviAriaRole;
593
+ protected _disabled: boolean;
594
+ protected _readOnly: boolean;
595
+ set disabled(value: boolean);
596
+ get disabled(): boolean;
597
+ set readOnly(value: boolean);
598
+ get readOnly(): boolean;
599
+ set readonly(value: boolean);
600
+ private get isToggle();
601
+ onClick(event: MouseEvent): void;
602
+ onChange(event: Event): void;
603
+ onKeydown(event: KeyboardEvent): void;
604
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviInput, never>;
605
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviInput, "input[hviInput]", never, { "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; }; "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, never, true, never>;
606
+ static ngAcceptInputType_disabled: unknown;
607
+ static ngAcceptInputType_readOnly: unknown;
608
+ static ngAcceptInputType_readonly: unknown;
609
+ }
610
+
611
+ /**
612
+ * @summary
613
+ * Adds submit handling for Angular reactive forms:
614
+ * - Tracks submitted state
615
+ * - Marks all controls as touched on submit
616
+ * - Optionally focuses an ErrorSummary when invalid
617
+ *
618
+ * @example
619
+ * ```html
620
+ * <[hviForm]></[hviForm]>
621
+ * ```
622
+ *
623
+ * Documentation: https://designsystemet.no/en/components/docs/form/code
624
+ */
625
+ declare class HviForm {
626
+ /** Emits when the form has been submitted */
627
+ hviSubmitted: EventEmitter<void>;
628
+ /** True after first submit attempt */
629
+ submitted: boolean;
630
+ /** Optional focus target (e.g. HviErrorSummaryComponent) */
631
+ focusOnInvalid?: {
632
+ focus?: () => void;
633
+ } | null;
634
+ private readonly formGroupDir;
635
+ onSubmit(event: Event): void;
636
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviForm, never>;
637
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviForm, "form[hviForm]", never, { "focusOnInvalid": { "alias": "focusOnInvalid"; "required": false; }; }, { "hviSubmitted": "hviSubmitted"; }, never, never, true, never>;
638
+ }
639
+
640
+ /**
641
+ * @summary
642
+ * Directive to set `aria-invalid` on form controls based on their validation state.
643
+ *
644
+ * Usage:
645
+ * ```html
646
+ * <input hviControlInvalid formControlName="email" />
647
+ * ```
648
+ */
649
+ declare class HviControlInvalid {
650
+ private readonly ngControl;
651
+ private readonly hviForm;
652
+ get ariaInvalid(): string | null;
653
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviControlInvalid, never>;
654
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviControlInvalid, "[hviControlInvalid]", never, {}, {}, never, never, true, never>;
655
+ }
656
+
657
+ declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes];
658
+ declare const HviValidationKit: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage];
659
+ declare const HviForms: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage, typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviInput, typeof HviFieldset, typeof HviErrorSummary];
660
+
661
+ /**
662
+ * Heading is used to structure content and create hierarchy on a page.
663
+ *
664
+ * @example
665
+ * ```html
666
+ * <h1 hviHeading size="xl">This is a heading</h1>
667
+ * ```
668
+ *
669
+ * Documentation: https://designsystemet.no/en/components/docs/heading/overview
670
+ */
671
+ declare class HviHeading {
672
+ /** The size of the heading */
673
+ size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
674
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviHeading, never>;
675
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviHeading, "h1[hviHeading], h2[hviHeading], h3[hviHeading], h4[hviHeading], h5[hviHeading], h6[hviHeading]", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
676
+ }
677
+
678
+ type IconName = 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | 'ExclamationmarkTriangle' | 'Triangle' | 'Person';
679
+ type IconSize = 'sm' | 'md' | 'lg' | 'xl';
680
+ type IconColor = 'currentColor' | 'danger';
681
+
682
+ declare class HviIcon implements OnChanges {
683
+ private http;
684
+ private elementRef;
685
+ private cdr;
686
+ icon: IconName;
687
+ color?: IconColor;
688
+ size: IconSize;
689
+ ariaHidden: boolean;
690
+ constructor(http: HttpClient, elementRef: ElementRef, cdr: ChangeDetectorRef);
691
+ ngOnChanges(): void;
692
+ private loadIcon;
693
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviIcon, never>;
694
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviIcon, "hvi-icon", never, { "icon": { "alias": "icon"; "required": true; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "ariaHidden": { "alias": "ariaHidden"; "required": false; }; }, {}, never, never, true, never>;
695
+ static ngAcceptInputType_ariaHidden: unknown;
696
+ }
697
+
698
+ /**
699
+ * Label functions as a clear and accessible text label that tells the user what an associated form element is about.
700
+ *
701
+ * @example
702
+ * ```html
703
+ * <label hviLabel weight="semibold">Name</label>
704
+ * ```
705
+ *
706
+ * Documentation: https://designsystemet.no/en/components/docs/label/overview
707
+ */
708
+ declare class HviLabel {
709
+ /** The font weight of the label */
710
+ weight?: 'regular' | 'medium' | 'semibold';
711
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviLabel, never>;
712
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviLabel, "label[hviLabel], legend[hviLabel]", never, { "weight": { "alias": "weight"; "required": false; }; }, {}, never, never, true, never>;
713
+ }
714
+
715
+ /**
716
+ * Info
717
+ *
718
+ * Eksempel på bruk:
719
+ * ```html
720
+ * <a hviLink />
721
+ * ```
722
+ *
723
+ * Dokumentasjon: https://designsystemet.no/no/components/docs/input/overview
724
+ */
725
+ declare class HviLink {
726
+ /** Used to change the appearance of the link. */
727
+ color?: 'default' | 'neutral';
728
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviLink, never>;
729
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviLink, "a[hviLink]", never, { "color": { "alias": "color"; "required": false; }; }, {}, never, never, true, never>;
730
+ }
731
+
732
+ /**
733
+ * Paragraph is used for continuous text and is typically applied in articles, components, help text, and similar content.
734
+ *
735
+ * @example
736
+ * ```html
737
+ * <p hviParagraph variant="long" size="md">
738
+ * This is a paragraph with body text that can be adjusted in size and variant.
739
+ * </p>
740
+ * ```
741
+ *
742
+ * Documentation: https://designsystemet.no/en/components/docs/paragraph/overview
743
+ */
744
+ declare class HviParagraph {
745
+ /** Adjusts the style for the length of the paragraph */
746
+ variant?: 'long' | 'default' | 'short';
747
+ /** Paragraph is available in several text sizes to suit different needs */
748
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
749
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviParagraph, never>;
750
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviParagraph, "p[hviParagraph]", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
751
+ }
752
+
753
+ /**
754
+ * @summary
755
+ * Tag is a label that can be used to categorize items or communicate progress, status, or process. Tags can provide users with a quicker overview of content.
756
+ *
757
+ * @example
758
+ * ```html
759
+ * <hvi-tag variant="outline" size="sm" color="info">Small info tag</hvi-tag>
760
+ * ```
761
+ *
762
+ * Documentation: https://designsystemet.no/en/components/docs/tag/code
763
+ */
764
+ declare class HviTag {
765
+ /** The variants of the tag */
766
+ variant?: 'default' | 'outline';
767
+ /** The sizes of the tag */
768
+ size?: 'sm' | 'md' | 'lg';
769
+ /** The color theme of the tag */
770
+ color?: 'neutral' | 'danger' | 'warning' | 'info' | 'success' | 'accent' | 'brand1' | 'brand2' | 'brand3';
771
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviTag, never>;
772
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviTag, "hvi-tag", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
773
+ }
774
+
775
+ export { HviAlert, HviAvatar, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading, HviIcon, HviInput, HviLabel, HviLink, HviParagraph, HviTag, HviValidationKit, HviValidationMessage, fieldObserver, isElement, isInputLike, isLabel };
776
+ export type { HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages };