@helsevestikt/hviktor-angular 0.0.16 → 0.0.18

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.
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, AfterViewInit, OnChanges, OnInit, OnDestroy, TemplateRef, AfterContentInit, ElementRef, QueryList } from '@angular/core';
2
+ import { EventEmitter, OnInit, TemplateRef, AfterContentInit, ElementRef, QueryList, OnDestroy } from '@angular/core';
3
3
  import { FormGroup, ValidatorFn, ReactiveFormsModule, ControlValueAccessor } from '@angular/forms';
4
- import { Placement } from '@floating-ui/dom';
5
4
 
6
5
  /**
7
6
  * Alert provides users with information that is especially important for them to see and understand.
@@ -55,6 +54,28 @@ declare class HviAvatar {
55
54
  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
55
  }
57
56
 
57
+ /**
58
+ * @summary
59
+ * AvatarStack stabler en samling Avatar elementer
60
+ *
61
+ * @example
62
+ * ```html
63
+ * <hvi-avatar-stack></hvi-avatar-stack>
64
+ * ```
65
+ *
66
+ * @see {@link https://designsystemet.no/en/components/docs/avatar-stack/code}
67
+ */
68
+ declare class HviAvatarStack {
69
+ /** variant */
70
+ variant?: 'square' | 'circle';
71
+ /** Plassering av popover relativt til trigger */
72
+ expandable?: 'true' | 'fixed';
73
+ suffix?: string;
74
+ gap?: string;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviAvatarStack, never>;
76
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviAvatarStack, "figure[hviAvatarStack]", never, { "variant": { "alias": "variant"; "required": false; }; "expandable": { "alias": "expandable"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; }, {}, never, never, true, never>;
77
+ }
78
+
58
79
  declare class HviBadgePosition {
59
80
  /** Overlap of the badge */
60
81
  overlap: 'rectangle' | 'circle';
@@ -323,6 +344,47 @@ declare class HviDivider {
323
344
  static ɵdir: i0.ɵɵDirectiveDeclaration<HviDivider, "hr[hviDivider]", never, {}, {}, never, never, true, never>;
324
345
  }
325
346
 
347
+ /**
348
+ * @summary
349
+ * Dropdown er en generisk nedtrekksliste. Den legger grunnmuren for å bygge menyer og lister.
350
+ *
351
+ * @example
352
+ * ```html
353
+ * <button hviButton popovertarget="myDropdown">Åpne dropdown</button>
354
+ * <hvi-dropdown id="myDropdown">
355
+ * <ul>
356
+ * <li>
357
+ * <button hviButton variant="tertiary">Menylenke</button>
358
+ * </li>
359
+ * <li>
360
+ * <button hviButton variant="tertiary">Menylenke</button>
361
+ * </li>
362
+ * </ul>
363
+ * </hvi-dropdown>
364
+ * ```
365
+ *
366
+ * @see {@link https://designsystemet.no/en/components/docs/dropdown/code}
367
+ */
368
+ declare class HviDropdown {
369
+ /** ID to target the popover */
370
+ id?: string;
371
+ /** Popover type - 'auto' lukkes ved klikk utenfor, 'manual' krever manuell lukking */
372
+ type: 'auto' | 'manual';
373
+ /** Variant */
374
+ variant?: 'default' | 'tertiary';
375
+ /** Plassering av dropdown relativt til trigger */
376
+ dropdownPlacement: 'top' | 'right' | 'bottom' | 'left';
377
+ /** Aktiver automatisk repositjonering hvis det ikke er plass */
378
+ autoPlacement: boolean;
379
+ /** Event når dropdown åpnes */
380
+ opened: EventEmitter<void>;
381
+ /** Event når dropdown lukkes */
382
+ closed: EventEmitter<void>;
383
+ onToggle(event: ToggleEvent): void;
384
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDropdown, never>;
385
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviDropdown, "hvi-dropdown", never, { "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "dropdownPlacement": { "alias": "dropdownPlacement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
386
+ }
387
+
326
388
  type HviValidationMessages = Partial<Record<string, string>>;
327
389
  declare class HviValidationMessage {
328
390
  /**
@@ -422,6 +484,7 @@ type HviErrorSummaryMessages = Record<string, HviValidationMessages>;
422
484
  * Documentation: https://designsystemet.no/en/components/docs/error-summary/code
423
485
  */
424
486
  declare class HviErrorSummary {
487
+ private readonly el;
425
488
  /** Heading text shown above the list */
426
489
  heading: string;
427
490
  /** Heading level for the heading element (1-6). Defaults to 2 per DS */
@@ -449,11 +512,8 @@ declare class HviErrorSummary {
449
512
  idMap?: Record<string, string>;
450
513
  /** Auto mode: error key priority (first match wins) */
451
514
  errorPriority: readonly string[];
452
- /** Used for aria-labelledby on the container */
453
- headingId: string;
454
515
  /** When to show errors from the form controls */
455
516
  showWhen: 'submitted' | 'touched' | 'always';
456
- private container?;
457
517
  focus(): void;
458
518
  /**
459
519
  * Handles click on error links to prevent Angular Router navigation
@@ -466,14 +526,9 @@ declare class HviErrorSummary {
466
526
  get shouldShow(): boolean;
467
527
  private anyInvalidTouched;
468
528
  static ɵfac: i0.ɵɵFactoryDeclaration<HviErrorSummary, never>;
469
- 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>;
529
+ 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; }; "showWhen": { "alias": "showWhen"; "required": false; }; }, {}, never, never, true, never>;
470
530
  }
471
531
 
472
- declare function fieldObserver(fieldElement: HTMLElement | null): (() => void) | undefined;
473
- declare const isElement: (node: Node) => node is Element;
474
- declare const isLabel: (node: Node) => node is HTMLLabelElement;
475
- declare const isInputLike: (node: unknown) => node is HTMLInputElement;
476
-
477
532
  /**
478
533
  * Decorative affix container displayed alongside a text input.
479
534
  *
@@ -519,68 +574,32 @@ declare class HviFieldAffixes {
519
574
  }
520
575
 
521
576
  /**
522
- * Counter component that displays remaining/exceeded character count for a field.
577
+ * Counter that displays remaining/exceeded character count for a field.
523
578
  *
524
- * @remarks
525
- * Shows a visual counter and provides accessible announcements via aria-live.
526
579
  * Must be used inside a `hvi-field` component alongside a textarea or input.
527
- *
528
- * The component automatically finds and tracks the input/textarea in the same field,
580
+ * The ds-field web component automatically tracks the input/textarea,
529
581
  * so you only need to provide the `limit` property.
530
582
  *
531
583
  * @example
532
- * Simple usage (auto-tracking):
533
584
  * ```html
534
585
  * <hvi-field>
535
586
  * <label hviLabel for="description" weight="medium">Beskrivelse</label>
536
- * <textarea hviInput id="description" rows="3" maxlength="100"></textarea>
587
+ * <textarea hviInput id="description" rows="3"></textarea>
537
588
  * <hvi-field-counter [limit]="100" />
538
589
  * </hvi-field>
539
590
  * ```
540
591
  *
541
- * @example
542
- * Manual tracking (for custom scenarios):
543
- * ```html
544
- * <hvi-field>
545
- * <label hviLabel for="description" weight="medium">Beskrivelse</label>
546
- * <textarea hviInput id="description" rows="3" #textarea></textarea>
547
- * <hvi-field-counter [limit]="100" [count]="textarea.value.length" />
548
- * </hvi-field>
549
- * ```
550
- *
551
592
  * Documentation: https://designsystemet.no/en/components/docs/field/code
552
593
  */
553
- declare class HviFieldCounter implements AfterViewInit {
554
- private readonly el;
555
- private readonly destroyRef;
556
- /** Auto-tracked character count from the input/textarea in the same field */
557
- private readonly autoCount;
558
- /**
559
- * Current character count. If not provided, the component will
560
- * automatically track the input/textarea in the same hvi-field.
561
- */
562
- count: i0.InputSignal<number | undefined>;
594
+ declare class HviFieldCounter {
563
595
  /** Maximum allowed characters */
564
596
  limit: i0.InputSignal<number>;
565
597
  /** Label template when limit is exceeded. Use %d for the count. */
566
- over: i0.InputSignal<string>;
598
+ over: i0.InputSignal<string | undefined>;
567
599
  /** Label template for remaining characters. Use %d for the count. */
568
- under: i0.InputSignal<string>;
569
- /** Hint text for screen readers about max characters. Use %d for the limit. */
570
- hint: i0.InputSignal<string>;
571
- /** Effective count - uses manual count if provided, otherwise auto-tracked */
572
- private readonly effectiveCount;
573
- /** Computed difference between limit and current count */
574
- remaining: i0.Signal<number>;
575
- /** Whether the limit has been exceeded */
576
- isOver: i0.Signal<boolean>;
577
- /** The formatted message to display */
578
- message: i0.Signal<string>;
579
- /** The formatted hint for screen readers */
580
- formattedHint: i0.Signal<string>;
581
- ngAfterViewInit(): void;
600
+ under: i0.InputSignal<string | undefined>;
582
601
  static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldCounter, never>;
583
- static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldCounter, "hvi-field-counter", never, { "count": { "alias": "count"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": true; "isSignal": true; }; "over": { "alias": "over"; "required": false; "isSignal": true; }; "under": { "alias": "under"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
602
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldCounter, "hvi-field-counter", never, { "limit": { "alias": "limit"; "required": true; "isSignal": true; }; "over": { "alias": "over"; "required": false; "isSignal": true; }; "under": { "alias": "under"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
584
603
  }
585
604
 
586
605
  declare class HviFieldDescription {
@@ -599,7 +618,8 @@ declare class HviFieldValidation {
599
618
  }
600
619
 
601
620
  /**
602
- * Field is a helper component to automatically associate a field with hviLabel, hviFieldDescription and hviFieldValidation.
621
+ * @summary
622
+ * Field kobler automatisk sammen label, beskrivelse, validering og input via ds-field web component.
603
623
  *
604
624
  * @example
605
625
  * ```html
@@ -611,14 +631,11 @@ declare class HviFieldValidation {
611
631
  * </hvi-field>
612
632
  * ```
613
633
  *
614
- * Documentation: https://designsystemet.no/en/components/docs/field/overview
634
+ * @see {@link https://designsystemet.no/en/components/docs/field/overview}
615
635
  */
616
- declare class HviField implements AfterViewInit {
636
+ declare class HviField {
617
637
  /** Position of toggle inputs (radio, checkbox, switch) in field */
618
638
  position?: 'start' | 'end';
619
- private readonly el;
620
- private readonly destroyRef;
621
- ngAfterViewInit(): void;
622
639
  static ɵfac: i0.ɵɵFactoryDeclaration<HviField, never>;
623
640
  static ɵcmp: i0.ɵɵComponentDeclaration<HviField, "hvi-field", never, { "position": { "alias": "position"; "required": false; }; }, {}, never, ["*"], true, never>;
624
641
  }
@@ -680,21 +697,39 @@ declare class HviInput {
680
697
  static ngAcceptInputType_readonly: unknown;
681
698
  }
682
699
 
700
+ /** Resultatet av required-analysen av en FormGroup. */
701
+ type FormRequiredMode = 'all-required' | 'mixed' | 'none';
683
702
  /**
684
- * @summary
685
- * Adds submit handling for Angular reactive forms:
686
- * - Tracks submitted state
687
- * - Marks all controls as touched on submit
688
- * - Optionally focuses an ErrorSummary when invalid
703
+ * Analyserer en FormGroup og returnerer required-modus.
704
+ *
705
+ * Alle controls telles – også de uten validators (de regnes som optional).
706
+ *
707
+ * - `'all-required'` alle controls har required/requiredTrue
708
+ * - `'mixed'` – noen controls er required, noen ikke
709
+ * - `'none'` – ingen controls har required
710
+ */
711
+ declare function analyzeFormRequired(formGroup: FormGroup): FormRequiredMode;
712
+ /**
713
+ * Legges på `<form>` for å gi submit-håndtering og automatisk required-tag-analyse
714
+ * for Angular reactive forms.
715
+ *
716
+ * - Tracker submitted-state
717
+ * - Marker alle controls som touched ved submit
718
+ * - Analyserer FormGroup og eksponerer `requiredMode()` som child-komponenter
719
+ * (f.eks. `HviTextfield`) kan injisere for automatisk required/optional-tagging
720
+ * - Sett `[showRequiredTags]="false"` for å skru av automatisk tagging
689
721
  *
690
722
  * @example
691
723
  * ```html
692
- * <[hviForm]></[hviForm]>
724
+ * <form hviForm [formGroup]="myForm">
725
+ * @if (myHviForm.requiredMode() === 'all-required') {
726
+ * <hvi-required-tag mode="all-required" />
727
+ * }
728
+ * <hvi-textfield label="Navn" formControlName="name" />
729
+ * </form>
693
730
  * ```
694
- *
695
- * Documentation: https://designsystemet.no/en/components/docs/form/code
696
731
  */
697
- declare class HviForm {
732
+ declare class HviForm implements OnInit {
698
733
  /** Emits when the form has been submitted */
699
734
  hviSubmitted: EventEmitter<void>;
700
735
  /** True after first submit attempt */
@@ -703,10 +738,28 @@ declare class HviForm {
703
738
  focusOnInvalid?: {
704
739
  focus?: () => void;
705
740
  } | null;
741
+ /**
742
+ * Skru av/på automatisk required-tag-visning for child-komponenter.
743
+ * Default `true`. Sett til `false` for manuell kontroll.
744
+ */
745
+ showRequiredTags: boolean;
706
746
  private readonly formGroupDir;
747
+ /** Internal signal som oppdateres ved submit og init */
748
+ private readonly _requiredMode;
749
+ /**
750
+ * Analysert required-modus for FormGroup-en.
751
+ * - `'all-required'` – alle validerte controls er required
752
+ * - `'mixed'` – blanding av required og optional
753
+ * - `'none'` – ingen required-validering
754
+ */
755
+ readonly requiredMode: i0.Signal<FormRequiredMode>;
756
+ /** Oppdater required-analyse. Kalles automatisk ved submit, men kan kalles manuelt. */
757
+ refreshRequiredMode(): void;
707
758
  onSubmit(event: Event): void;
759
+ ngOnInit(): void;
708
760
  static ɵfac: i0.ɵɵFactoryDeclaration<HviForm, never>;
709
- static ɵdir: i0.ɵɵDirectiveDeclaration<HviForm, "form[hviForm]", never, { "focusOnInvalid": { "alias": "focusOnInvalid"; "required": false; }; }, { "hviSubmitted": "hviSubmitted"; }, never, never, true, never>;
761
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviForm, "form[hviForm]", ["hviForm"], { "focusOnInvalid": { "alias": "focusOnInvalid"; "required": false; }; "showRequiredTags": { "alias": "showRequiredTags"; "required": false; }; }, { "hviSubmitted": "hviSubmitted"; }, never, never, true, never>;
762
+ static ngAcceptInputType_showRequiredTags: unknown;
710
763
  }
711
764
 
712
765
  /**
@@ -870,9 +923,40 @@ declare function hviCustom(key: string, validator: ValidatorFn, message: string)
870
923
  */
871
924
  declare function hviNullValidator(): HviValidatorBundle;
872
925
 
873
- declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter];
926
+ /** Tilgjengelige modes for RequiredTag. */
927
+ type RequiredTagMode = 'all-required' | 'required' | 'optional';
928
+ /**
929
+ * RequiredTag brukes sammen med labels i skjema for å indikere om et felt er
930
+ * påkrevd, valgfritt, eller om alle felt må fylles ut.
931
+ *
932
+ * Komponenten wrapper `HviTag` med forhåndsdefinerte tekster og farger basert på mode.
933
+ * Bruker `display: contents` slik at den fungerer inline i `<label>` og frittstående.
934
+ *
935
+ * Kan brukes manuelt, eller automatisk via `HviForm` som analyserer FormGroup
936
+ * og lar child-komponenter som `HviTextfield` vise riktig tag.
937
+ *
938
+ * @example
939
+ * ```html
940
+ * <hvi-required-tag />
941
+ * <hvi-required-tag mode="optional" />
942
+ * <hvi-required-tag mode="all-required" />
943
+ * ```
944
+ */
945
+ declare class HviRequiredTag {
946
+ /**
947
+ * Bestemmer tekst og farge på taggen.
948
+ * - `required` (default): "Må fylles ut" (warning)
949
+ * - `optional`: "Valgfritt" (info)
950
+ * - `all-required`: "Alle felt må fylles ut" (warning)
951
+ */
952
+ mode: RequiredTagMode;
953
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviRequiredTag, never>;
954
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviRequiredTag, "hvi-required-tag", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
955
+ }
956
+
957
+ declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter, typeof HviRequiredTag];
874
958
  declare const HviValidationKit: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage];
875
- 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 HviFieldCounter, typeof HviInput, typeof HviFieldset, typeof HviErrorSummary];
959
+ 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 HviFieldCounter, typeof HviRequiredTag, typeof HviInput, typeof HviFieldset, typeof HviErrorSummary];
876
960
 
877
961
  /**
878
962
  * Heading is used to structure content and create hierarchy on a page.
@@ -891,25 +975,6 @@ declare class HviHeading {
891
975
  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>;
892
976
  }
893
977
 
894
- type IconName = 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | 'ExclamationmarkTriangle' | 'Triangle' | 'Person';
895
- type IconSize = 'sm' | 'md' | 'lg' | 'xl';
896
- type IconColor = 'currentColor' | 'danger';
897
-
898
- declare class HviIcon implements OnChanges {
899
- icon: IconName;
900
- color?: IconColor;
901
- size: IconSize;
902
- ariaHidden: boolean;
903
- private readonly http;
904
- private readonly elementRef;
905
- private readonly cdr;
906
- ngOnChanges(): void;
907
- private loadIcon;
908
- static ɵfac: i0.ɵɵFactoryDeclaration<HviIcon, never>;
909
- 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>;
910
- static ngAcceptInputType_ariaHidden: unknown;
911
- }
912
-
913
978
  /**
914
979
  * Label functions as a clear and accessible text label that tells the user what an associated form element is about.
915
980
  *
@@ -970,6 +1035,83 @@ declare class HviList {
970
1035
  static ɵdir: i0.ɵɵDirectiveDeclaration<HviList, "ol[hviList], ul[hviList]", never, {}, {}, never, never, true, never>;
971
1036
  }
972
1037
 
1038
+ /** A single SVG path with fill type */
1039
+ interface LogoPath {
1040
+ /** SVG path data string */
1041
+ d: string;
1042
+ /**
1043
+ * 'accent' = always #6CACE4 (blue dots)
1044
+ * 'themed' = switches between dark (#003087) and light (white) via currentColor
1045
+ */
1046
+ fill: 'themed' | 'accent';
1047
+ }
1048
+ /** Defines the SVG structure for a single logo */
1049
+ interface LogoDefinition {
1050
+ /** SVG viewBox attribute */
1051
+ viewBox: string;
1052
+ /** Default width */
1053
+ width: number;
1054
+ /** Default height */
1055
+ height: number;
1056
+ /** Accessible label for the logo */
1057
+ label: string;
1058
+ /** SVG path elements */
1059
+ paths: LogoPath[];
1060
+ }
1061
+ /** Available logo sizes */
1062
+ type LogoSize = 'sm' | 'md' | 'lg';
1063
+
1064
+ /** Available company identifiers for the logo component */
1065
+ type LogoCompany = keyof typeof LOGOS;
1066
+ /**
1067
+ * Path data and metadata for all logos.
1068
+ *
1069
+ * Individual logo definitions live in their own files (logo-hve.ts, logo-hvikt.ts, etc.)
1070
+ * to keep file sizes manageable. This registry assembles them.
1071
+ */
1072
+ declare const LOGOS: {
1073
+ dots: LogoDefinition;
1074
+ hvikt: LogoDefinition;
1075
+ hve: LogoDefinition;
1076
+ hbe: LogoDefinition;
1077
+ 'hbe-hus': LogoDefinition;
1078
+ hfd: LogoDefinition;
1079
+ hfo: LogoDefinition;
1080
+ hst: LogoDefinition;
1081
+ 'hst-sus': LogoDefinition;
1082
+ sav: LogoDefinition;
1083
+ };
1084
+
1085
+ /** Builds a dots-first logo: [dots] [themed dot] [HELSE] [unique company text] */
1086
+ declare function buildLogo(label: string, companyPaths: LogoPath[], viewBox?: string, width?: number, height?: number): LogoDefinition;
1087
+
1088
+ /**
1089
+ * Logo displays a Helse Vest company logo with automatic light/dark mode support.
1090
+ *
1091
+ * The themed paths (text and dark dot) use `currentColor` so they respond to the
1092
+ * CSS `color` property, while accent paths (blue dots) keep a fixed color.
1093
+ *
1094
+ * The component automatically responds to `data-color-scheme` set by the application
1095
+ * (via Designsystemet), so no manual mode switching is needed.
1096
+ *
1097
+ * @example
1098
+ * ```html
1099
+ * <hvi-logo company="hve" />
1100
+ * <hvi-logo company="hve" size="lg" />
1101
+ * ```
1102
+ */
1103
+ declare class HviLogo {
1104
+ /** Which company logo to display */
1105
+ readonly company: i0.InputSignal<"dots" | "hvikt" | "hve" | "hbe" | "hbe-hus" | "hfd" | "hfo" | "hst" | "hst-sus" | "sav">;
1106
+ /** Logo size — sm (40px), md (65px, default), lg (82px) height */
1107
+ readonly size: i0.InputSignal<LogoSize>;
1108
+ /** Override the default accessible label */
1109
+ readonly ariaLabel: i0.InputSignal<string | undefined>;
1110
+ protected readonly logo: i0.Signal<LogoDefinition>;
1111
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviLogo, never>;
1112
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviLogo, "hvi-logo", never, { "company": { "alias": "company"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1113
+ }
1114
+
973
1115
  /** Type for hvert element i pagineringslisten */
974
1116
  type PaginationItem = {
975
1117
  type: 'page';
@@ -1090,36 +1232,22 @@ declare class HviParagraph {
1090
1232
  *
1091
1233
  * @see {@link https://designsystemet.no/en/components/docs/popover/code}
1092
1234
  */
1093
- declare class HviPopover implements OnInit, OnDestroy {
1094
- private el;
1095
- private cleanupAutoUpdate?;
1096
- private boundHandleClick?;
1097
- private boundHandleKeydown?;
1098
- /** Popover type - 'manual' krever manuell lukking, 'auto' lukkes ved klikk utenfor */
1235
+ declare class HviPopover {
1236
+ /** Popover type - 'auto' lukkes ved klikk utenfor eller Escape, 'manual' krever manuell lukking */
1099
1237
  type: 'auto' | 'manual' | 'hint';
1100
1238
  /** Visuell variant */
1101
1239
  variant: 'default' | 'tinted';
1102
1240
  /** Farge-tema */
1103
1241
  color: 'neutral' | 'danger' | 'info' | 'success' | 'warning';
1104
1242
  /** Plassering av popover relativt til trigger */
1105
- placement: Placement;
1243
+ placement: 'top' | 'right' | 'bottom' | 'left';
1106
1244
  /** Aktiver automatisk repositjonering hvis det ikke er plass */
1107
1245
  autoPlacement: boolean;
1108
1246
  /** Event når popover åpnes */
1109
1247
  opened: EventEmitter<void>;
1110
1248
  /** Event når popover lukkes */
1111
1249
  closed: EventEmitter<void>;
1112
- private get popoverElement();
1113
- private get triggerElement();
1114
- ngOnInit(): void;
1115
- ngOnDestroy(): void;
1116
- private setupEventListeners;
1117
- private removeEventListeners;
1118
- private handleBeforeToggle;
1119
- private handleToggle;
1120
- private updatePosition;
1121
- private startAutoUpdate;
1122
- private stopAutoUpdate;
1250
+ onToggle(event: ToggleEvent): void;
1123
1251
  static ɵfac: i0.ɵɵFactoryDeclaration<HviPopover, never>;
1124
1252
  static ɵcmp: i0.ɵɵComponentDeclaration<HviPopover, "hvi-popover", never, { "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
1125
1253
  }
@@ -1606,6 +1734,105 @@ declare class HviTag {
1606
1734
  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>;
1607
1735
  }
1608
1736
 
1737
+ /**
1738
+ * Textfield gir brukere muligheten til å skrive fritekst eller tall.
1739
+ *
1740
+ * Dette er en sammensatt komponent som bruker Field, Input/Textarea og Label under panseret.
1741
+ * Bruk `multiline` for å bytte mellom input og textarea.
1742
+ *
1743
+ * @example
1744
+ * ```html
1745
+ * <hvi-textfield label="Navn"></hvi-textfield>
1746
+ * ```
1747
+ *
1748
+ * @example
1749
+ * ```html
1750
+ * <hvi-textfield label="Beskrivelse" [multiline]="true" [rows]="4"></hvi-textfield>
1751
+ * ```
1752
+ *
1753
+ * @example
1754
+ * ```html
1755
+ * <hvi-textfield label="Pris" prefix="NOK" suffix="pr. mnd"></hvi-textfield>
1756
+ * ```
1757
+ *
1758
+ * @see {@link https://designsystemet.no/en/components/docs/textfield/code}
1759
+ */
1760
+ declare class HviTextfield implements ControlValueAccessor {
1761
+ /** Label for the textfield */
1762
+ label: string;
1763
+ /** Description text below the label */
1764
+ description?: string;
1765
+ /** Prefix text displayed before the input */
1766
+ prefix?: string;
1767
+ /** Suffix text displayed after the input */
1768
+ suffix?: string;
1769
+ /** Error message for the field */
1770
+ error?: string;
1771
+ /** Character counter limit. Displays a counter below the field. */
1772
+ counterLimit?: number;
1773
+ /**
1774
+ * Manuell overstyring av required-tag-mode.
1775
+ * Når satt, vises taggen uavhengig av HviForm-kontekst.
1776
+ * - `'required'`: "Må fylles ut" (warning)
1777
+ * - `'optional'`: "Valgfritt" (info)
1778
+ *
1779
+ * Når IKKE satt og feltet er inne i en `<form hviForm>`, bestemmes mode automatisk:
1780
+ * - Form er `'all-required'` → ingen tag per felt (vis `all-required` øverst i form)
1781
+ * - Form er `'mixed'` → `'required'` hvis feltet er required, `'optional'` hvis ikke
1782
+ * - Form er `'none'` → ingen tag
1783
+ */
1784
+ requiredMode?: RequiredTagMode;
1785
+ /** Autocomplete attribute for the input, e.g. 'given-name', 'email'. */
1786
+ autocomplete?: string;
1787
+ /** Injisert HviForm for automatisk required-tag-beregning */
1788
+ private readonly hviForm;
1789
+ /**
1790
+ * Beregnet required-tag-mode basert på manuell overstyring eller HviForm-kontekst.
1791
+ * Returnerer `null` hvis ingen tag skal vises.
1792
+ */
1793
+ get effectiveRequiredMode(): RequiredTagMode | null;
1794
+ /** Render a textarea instead of input for multiline support */
1795
+ multiline: boolean;
1796
+ /** Supported input types */
1797
+ type: 'number' | 'hidden' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'month' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
1798
+ /** Number of rows for textarea (multiline mode) */
1799
+ rows?: number;
1800
+ /** Width of input in character count */
1801
+ size?: number;
1802
+ /** Placeholder text */
1803
+ placeholder?: string;
1804
+ /** Name attribute for the input */
1805
+ name?: string;
1806
+ /** Id attribute for the input. Auto-generated if not provided. */
1807
+ id?: string;
1808
+ /** Max length attribute for the input */
1809
+ maxLength?: number;
1810
+ /** Initial value for the input */
1811
+ set value(v: string);
1812
+ _value: string;
1813
+ _disabled: boolean;
1814
+ _readOnly: boolean;
1815
+ _required: boolean;
1816
+ set required(value: boolean);
1817
+ set disabled(value: boolean);
1818
+ set readOnly(value: boolean);
1819
+ private readonly _uniqueId;
1820
+ private _onChange;
1821
+ _onTouched: () => void;
1822
+ get inputId(): string;
1823
+ _handleInput(event: Event): void;
1824
+ writeValue(value: string): void;
1825
+ registerOnChange(fn: (value: string) => void): void;
1826
+ registerOnTouched(fn: () => void): void;
1827
+ setDisabledState(isDisabled: boolean): void;
1828
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviTextfield, never>;
1829
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviTextfield, "hvi-textfield", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "error": { "alias": "error"; "required": false; }; "counterLimit": { "alias": "counterLimit"; "required": false; }; "requiredMode": { "alias": "requiredMode"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "multiline": { "alias": "multiline"; "required": false; }; "type": { "alias": "type"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "size": { "alias": "size"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "value": { "alias": "value"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, {}, never, never, true, never>;
1830
+ static ngAcceptInputType_multiline: unknown;
1831
+ static ngAcceptInputType_required: unknown;
1832
+ static ngAcceptInputType_disabled: unknown;
1833
+ static ngAcceptInputType_readOnly: unknown;
1834
+ }
1835
+
1609
1836
  /**
1610
1837
  * @summary
1611
1838
  * ToggleGroup collects related options. The component consists of a group of
@@ -1720,51 +1947,16 @@ declare class HviToggleGroupItem implements OnInit, OnDestroy {
1720
1947
  *
1721
1948
  * @see {@link https://designsystemet.no/en/components/docs/tooltip/code}
1722
1949
  */
1723
- declare class HviTooltip implements OnInit, OnDestroy {
1724
- private el;
1725
- private renderer;
1726
- private tooltipElement;
1727
- private tooltipId;
1728
- private cleanupAutoUpdate?;
1729
- private showTimeout?;
1730
- private hideTimeout?;
1731
- private isOpen;
1732
- private listeners;
1950
+ declare class HviTooltip {
1733
1951
  /** Tooltip content */
1734
1952
  hviTooltip: string;
1735
1953
  /** Placement of the tooltip relative to the trigger */
1736
- tooltipPlacement: Placement;
1954
+ tooltipPlacement: 'top' | 'right' | 'bottom' | 'left';
1737
1955
  /** Enable auto placement when there's not enough space */
1738
1956
  tooltipAutoPlacement: boolean;
1739
- /**
1740
- * Override ARIA attribute type.
1741
- * - 'describedby': tooltip describes the element (default for elements with text)
1742
- * - 'labelledby': tooltip labels the element (default for icon-only buttons)
1743
- */
1744
- tooltipType?: 'describedby' | 'labelledby';
1745
- /** Delay before showing tooltip (ms) */
1746
- tooltipShowDelay: number;
1747
- /** Delay before hiding tooltip (ms) */
1748
- tooltipHideDelay: number;
1749
- private get hostElement();
1750
- ngOnInit(): void;
1751
- ngOnDestroy(): void;
1752
- private createTooltipElement;
1753
- private setupTriggerAttributes;
1754
- private detectAriaType;
1755
- private setupEventListeners;
1756
- private scheduleShow;
1757
- private scheduleHide;
1758
- private clearTimeouts;
1759
- private show;
1760
- private hide;
1761
- private updatePosition;
1762
- private startAutoUpdate;
1763
- private stopAutoUpdate;
1764
- private cleanup;
1765
1957
  static ɵfac: i0.ɵɵFactoryDeclaration<HviTooltip, never>;
1766
- static ɵdir: i0.ɵɵDirectiveDeclaration<HviTooltip, "[hviTooltip]", never, { "hviTooltip": { "alias": "hviTooltip"; "required": true; }; "tooltipPlacement": { "alias": "tooltipPlacement"; "required": false; }; "tooltipAutoPlacement": { "alias": "tooltipAutoPlacement"; "required": false; }; "tooltipType": { "alias": "tooltipType"; "required": false; }; "tooltipShowDelay": { "alias": "tooltipShowDelay"; "required": false; }; "tooltipHideDelay": { "alias": "tooltipHideDelay"; "required": false; }; }, {}, never, never, true, never>;
1958
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HviTooltip, "[hviTooltip]", never, { "hviTooltip": { "alias": "hviTooltip"; "required": true; }; "tooltipPlacement": { "alias": "tooltipPlacement"; "required": false; }; "tooltipAutoPlacement": { "alias": "tooltipAutoPlacement"; "required": false; }; }, {}, never, never, true, never>;
1767
1959
  }
1768
1960
 
1769
- export { HviAlert, HviAvatar, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldCounter, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading, HviIcon, HviInput, HviLabel, HviLink, HviList, HviPagination, HviParagraph, HviPopover, HviSearch, HviSearchClear, HviSelect, HviSkeleton, HviSkipLink, HviSortableColumn, HviSpinner, HviTab, HviTabPanel, HviTable, HviTabs, HviTag, HviToggleGroup, HviToggleGroupItem, HviToggleGroupItemToken, HviTooltip, HviValidationKit, HviValidationMessage, fieldObserver, hviCustom, hviEmail, hviExtractMessages, hviExtractValidators, hviMax, hviMaxLength, hviMin, hviMinLength, hviNullValidator, hviPattern, hviRequired, hviRequiredTrue, hviValidators, isElement, isInputLike, isLabel };
1770
- export type { HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, PageChangeEvent, PaginationItem, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };
1961
+ export { HviAlert, HviAvatar, HviAvatarStack, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviDropdown, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldCounter, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading, HviInput, HviLabel, HviLink, HviList, HviLogo, HviPagination, HviParagraph, HviPopover, HviRequiredTag, HviSearch, HviSearchClear, HviSelect, HviSkeleton, HviSkipLink, HviSortableColumn, HviSpinner, HviTab, HviTabPanel, HviTable, HviTabs, HviTag, HviTextfield, HviToggleGroup, HviToggleGroupItem, HviToggleGroupItemToken, HviTooltip, HviValidationKit, HviValidationMessage, LOGOS, analyzeFormRequired, buildLogo, hviCustom, hviEmail, hviExtractMessages, hviExtractValidators, hviMax, hviMaxLength, hviMin, hviMinLength, hviNullValidator, hviPattern, hviRequired, hviRequiredTrue, hviValidators };
1962
+ export type { FormRequiredMode, HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, LogoCompany, LogoDefinition, LogoPath, LogoSize, PageChangeEvent, PaginationItem, RequiredTagMode, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };