@helsevestikt/hviktor-angular 0.0.16 → 0.0.17

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,14 +1,14 @@
1
1
  {
2
2
  "name": "@helsevestikt/hviktor-angular",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=17.0.0 <22.0.0",
7
7
  "@angular/core": ">=17.0.0 <22.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@digdir/designsystemet-css": "^1.11.1",
11
- "@floating-ui/dom": "^1.7.5",
10
+ "@digdir/designsystemet-css": "^1.12.1",
11
+ "@floating-ui/dom": "^1.7.6",
12
12
  "@u-elements/u-details": "^0.1.5",
13
13
  "@u-elements/u-tabs": "^0.1.2",
14
14
  "tslib": "^2.3.0"
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, AfterViewInit, OnChanges, OnInit, OnDestroy, TemplateRef, AfterContentInit, ElementRef, QueryList } from '@angular/core';
3
- import { FormGroup, ValidatorFn, ReactiveFormsModule, ControlValueAccessor } from '@angular/forms';
2
+ import { EventEmitter, OnInit, OnDestroy, AfterViewInit, OnChanges, TemplateRef, AfterContentInit, ElementRef, QueryList } from '@angular/core';
4
3
  import { Placement } from '@floating-ui/dom';
4
+ import { FormGroup, ValidatorFn, ReactiveFormsModule, ControlValueAccessor } from '@angular/forms';
5
5
 
6
6
  /**
7
7
  * Alert provides users with information that is especially important for them to see and understand.
@@ -55,6 +55,28 @@ declare class HviAvatar {
55
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
56
  }
57
57
 
58
+ /**
59
+ * @summary
60
+ * AvatarStack stabler en samling Avatar elementer
61
+ *
62
+ * @example
63
+ * ```html
64
+ * <hvi-avatar-stack></hvi-avatar-stack>
65
+ * ```
66
+ *
67
+ * @see {@link https://designsystemet.no/en/components/docs/avatar-stack/code}
68
+ */
69
+ declare class HviAvatarStack {
70
+ /** variant */
71
+ variant?: 'square' | 'circle';
72
+ /** Plassering av popover relativt til trigger */
73
+ expandable?: 'true' | 'fixed';
74
+ suffix?: string;
75
+ gap?: string;
76
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviAvatarStack, never>;
77
+ 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>;
78
+ }
79
+
58
80
  declare class HviBadgePosition {
59
81
  /** Overlap of the badge */
60
82
  overlap: 'rectangle' | 'circle';
@@ -323,6 +345,59 @@ declare class HviDivider {
323
345
  static ɵdir: i0.ɵɵDirectiveDeclaration<HviDivider, "hr[hviDivider]", never, {}, {}, never, never, true, never>;
324
346
  }
325
347
 
348
+ /**
349
+ * @summary
350
+ * Dropdown er en generisk nedtrekksliste. Den legger grunnmuren for å bygge menyer og lister..
351
+ *
352
+ * @example
353
+ * ```html
354
+ * <button hviButton popovertarget="myDropdown">Åpne dropdown</button
355
+ * <hvi-dropdown id="myDropdown" popover>
356
+ * <ul>
357
+ * <li>
358
+ * <button hviButton variant="tertiary">Menylenke</button>
359
+ * </li>
360
+ * <li>
361
+ * <button hviButton variant="tertiary">Menylenke</button>
362
+ * </li>
363
+ * </ul>
364
+ * </hvi-dropdown>
365
+ * ```
366
+ *
367
+ * @see {@link https://designsystemet.no/en/components/docs/dropdown/code}
368
+ */
369
+ declare class HviDropdown implements OnInit, OnDestroy {
370
+ private el;
371
+ private cleanupAutoUpdate?;
372
+ private boundHandleClick?;
373
+ private boundHandleKeydown?;
374
+ /**ID to target the popover */
375
+ id?: string;
376
+ /** variant */
377
+ variant?: 'default' | 'tertiary';
378
+ /** Plassering av popover relativt til trigger */
379
+ dropdownPlacement: Placement;
380
+ /** Aktiver automatisk repositjonering hvis det ikke er plass */
381
+ autoPlacement: boolean;
382
+ /** Event når popover åpnes */
383
+ opened: EventEmitter<void>;
384
+ /** Event når popover lukkes */
385
+ closed: EventEmitter<void>;
386
+ private get dropdownElement();
387
+ private get triggerElement();
388
+ ngOnInit(): void;
389
+ ngOnDestroy(): void;
390
+ private setupEventListeners;
391
+ private removeEventListeners;
392
+ private handleBeforeToggle;
393
+ private handleToggle;
394
+ private updatePosition;
395
+ private startAutoUpdate;
396
+ private stopAutoUpdate;
397
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviDropdown, never>;
398
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviDropdown, "hvi-dropdown", never, { "id": { "alias": "id"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "dropdownPlacement": { "alias": "dropdownPlacement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
399
+ }
400
+
326
401
  type HviValidationMessages = Partial<Record<string, string>>;
327
402
  declare class HviValidationMessage {
328
403
  /**
@@ -970,6 +1045,83 @@ declare class HviList {
970
1045
  static ɵdir: i0.ɵɵDirectiveDeclaration<HviList, "ol[hviList], ul[hviList]", never, {}, {}, never, never, true, never>;
971
1046
  }
972
1047
 
1048
+ /** A single SVG path with fill type */
1049
+ interface LogoPath {
1050
+ /** SVG path data string */
1051
+ d: string;
1052
+ /**
1053
+ * 'accent' = always #6CACE4 (blue dots)
1054
+ * 'themed' = switches between dark (#003087) and light (white) via currentColor
1055
+ */
1056
+ fill: 'themed' | 'accent';
1057
+ }
1058
+ /** Defines the SVG structure for a single logo */
1059
+ interface LogoDefinition {
1060
+ /** SVG viewBox attribute */
1061
+ viewBox: string;
1062
+ /** Default width */
1063
+ width: number;
1064
+ /** Default height */
1065
+ height: number;
1066
+ /** Accessible label for the logo */
1067
+ label: string;
1068
+ /** SVG path elements */
1069
+ paths: LogoPath[];
1070
+ }
1071
+ /** Available logo sizes */
1072
+ type LogoSize = 'sm' | 'md' | 'lg';
1073
+
1074
+ /** Available company identifiers for the logo component */
1075
+ type LogoCompany = keyof typeof LOGOS;
1076
+ /**
1077
+ * Path data and metadata for all logos.
1078
+ *
1079
+ * Individual logo definitions live in their own files (logo-hve.ts, logo-hvikt.ts, etc.)
1080
+ * to keep file sizes manageable. This registry assembles them.
1081
+ */
1082
+ declare const LOGOS: {
1083
+ dots: LogoDefinition;
1084
+ hvikt: LogoDefinition;
1085
+ hve: LogoDefinition;
1086
+ hbe: LogoDefinition;
1087
+ 'hbe-hus': LogoDefinition;
1088
+ hfd: LogoDefinition;
1089
+ hfo: LogoDefinition;
1090
+ hst: LogoDefinition;
1091
+ 'hst-sus': LogoDefinition;
1092
+ sav: LogoDefinition;
1093
+ };
1094
+
1095
+ /** Builds a dots-first logo: [dots] [themed dot] [HELSE] [unique company text] */
1096
+ declare function buildLogo(label: string, companyPaths: LogoPath[], viewBox?: string, width?: number, height?: number): LogoDefinition;
1097
+
1098
+ /**
1099
+ * Logo displays a Helse Vest company logo with automatic light/dark mode support.
1100
+ *
1101
+ * The themed paths (text and dark dot) use `currentColor` so they respond to the
1102
+ * CSS `color` property, while accent paths (blue dots) keep a fixed color.
1103
+ *
1104
+ * The component automatically responds to `data-color-scheme` set by the application
1105
+ * (via Designsystemet), so no manual mode switching is needed.
1106
+ *
1107
+ * @example
1108
+ * ```html
1109
+ * <hvi-logo company="hve" />
1110
+ * <hvi-logo company="hve" size="lg" />
1111
+ * ```
1112
+ */
1113
+ declare class HviLogo {
1114
+ /** Which company logo to display */
1115
+ readonly company: i0.InputSignal<"dots" | "hvikt" | "hve" | "hbe" | "hbe-hus" | "hfd" | "hfo" | "hst" | "hst-sus" | "sav">;
1116
+ /** Logo size — sm (40px), md (65px, default), lg (82px) height */
1117
+ readonly size: i0.InputSignal<LogoSize>;
1118
+ /** Override the default accessible label */
1119
+ readonly ariaLabel: i0.InputSignal<string | undefined>;
1120
+ protected readonly logo: i0.Signal<LogoDefinition>;
1121
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviLogo, never>;
1122
+ 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>;
1123
+ }
1124
+
973
1125
  /** Type for hvert element i pagineringslisten */
974
1126
  type PaginationItem = {
975
1127
  type: 'page';
@@ -1124,6 +1276,31 @@ declare class HviPopover implements OnInit, OnDestroy {
1124
1276
  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
1277
  }
1126
1278
 
1279
+ /**
1280
+ * RequiredTag brukes sammen med labels i skjema for å indikere om et felt er
1281
+ * påkrevd, valgfritt, eller om alle felt må fylles ut.
1282
+ *
1283
+ * Komponenten wrapper `HviTag` med forhåndsdefinerte tekster og farger basert på mode.
1284
+ *
1285
+ * @example
1286
+ * ```html
1287
+ * <hvi-required-tag />
1288
+ * <hvi-required-tag mode="optional" />
1289
+ * <hvi-required-tag mode="all-required" />
1290
+ * ```
1291
+ */
1292
+ declare class HviRequiredTag {
1293
+ /**
1294
+ * Bestemmer tekst og farge på taggen.
1295
+ * - `required` (default): "Må fylles ut" (warning)
1296
+ * - `optional`: "Valgfritt" (info)
1297
+ * - `all-required`: "Alle felt må fylles ut" (warning)
1298
+ */
1299
+ mode: 'all-required' | 'required' | 'optional';
1300
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviRequiredTag, never>;
1301
+ static ɵcmp: i0.ɵɵComponentDeclaration<HviRequiredTag, "hvi-required-tag", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
1302
+ }
1303
+
1127
1304
  /**
1128
1305
  * @summary
1129
1306
  * SearchClear is a button directive for clearing the search input.
@@ -1606,6 +1783,91 @@ declare class HviTag {
1606
1783
  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
1784
  }
1608
1785
 
1786
+ /**
1787
+ * Textfield gir brukere muligheten til å skrive fritekst eller tall.
1788
+ *
1789
+ * Dette er en sammensatt komponent som bruker Field, Input/Textarea og Label under panseret.
1790
+ * Bruk `multiline` for å bytte mellom input og textarea.
1791
+ *
1792
+ * @example
1793
+ * ```html
1794
+ * <hvi-textfield label="Navn"></hvi-textfield>
1795
+ * ```
1796
+ *
1797
+ * @example
1798
+ * ```html
1799
+ * <hvi-textfield label="Beskrivelse" [multiline]="true" [rows]="4"></hvi-textfield>
1800
+ * ```
1801
+ *
1802
+ * @example
1803
+ * ```html
1804
+ * <hvi-textfield label="Pris" prefix="NOK" suffix="pr. mnd"></hvi-textfield>
1805
+ * ```
1806
+ *
1807
+ * @see {@link https://designsystemet.no/en/components/docs/textfield/code}
1808
+ */
1809
+ declare class HviTextfield implements ControlValueAccessor {
1810
+ /** Label for the textfield */
1811
+ label: string;
1812
+ /** Description text below the label */
1813
+ description?: string;
1814
+ /** Prefix text displayed before the input */
1815
+ prefix?: string;
1816
+ /** Suffix text displayed after the input */
1817
+ suffix?: string;
1818
+ /** Error message for the field */
1819
+ error?: string;
1820
+ /** Character counter limit. Displays a counter below the field. */
1821
+ counterLimit?: number;
1822
+ /**
1823
+ * Label text shown in a warning Tag next to the label when the field is required.
1824
+ * E.g. "Må fylles ut". Also sets the `required` attribute on the input.
1825
+ */
1826
+ requiredLabel?: string;
1827
+ /** Autocomplete attribute for the input, e.g. 'given-name', 'email'. */
1828
+ autocomplete?: string;
1829
+ /** Render a textarea instead of input for multiline support */
1830
+ multiline: boolean;
1831
+ /** Supported input types */
1832
+ type: 'number' | 'hidden' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'month' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
1833
+ /** Number of rows for textarea (multiline mode) */
1834
+ rows?: number;
1835
+ /** Width of input in character count */
1836
+ size?: number;
1837
+ /** Placeholder text */
1838
+ placeholder?: string;
1839
+ /** Name attribute for the input */
1840
+ name?: string;
1841
+ /** Id attribute for the input. Auto-generated if not provided. */
1842
+ id?: string;
1843
+ /** Max length attribute for the input */
1844
+ maxLength?: number;
1845
+ /** Initial value for the input */
1846
+ set value(v: string);
1847
+ _value: string;
1848
+ _disabled: boolean;
1849
+ _readOnly: boolean;
1850
+ _required: boolean;
1851
+ set required(value: boolean);
1852
+ set disabled(value: boolean);
1853
+ set readOnly(value: boolean);
1854
+ private readonly _uniqueId;
1855
+ private _onChange;
1856
+ _onTouched: () => void;
1857
+ get inputId(): string;
1858
+ _handleInput(event: Event): void;
1859
+ writeValue(value: string): void;
1860
+ registerOnChange(fn: (value: string) => void): void;
1861
+ registerOnTouched(fn: () => void): void;
1862
+ setDisabledState(isDisabled: boolean): void;
1863
+ static ɵfac: i0.ɵɵFactoryDeclaration<HviTextfield, never>;
1864
+ 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; }; "requiredLabel": { "alias": "requiredLabel"; "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>;
1865
+ static ngAcceptInputType_multiline: unknown;
1866
+ static ngAcceptInputType_required: unknown;
1867
+ static ngAcceptInputType_disabled: unknown;
1868
+ static ngAcceptInputType_readOnly: unknown;
1869
+ }
1870
+
1609
1871
  /**
1610
1872
  * @summary
1611
1873
  * ToggleGroup collects related options. The component consists of a group of
@@ -1766,5 +2028,5 @@ declare class HviTooltip implements OnInit, OnDestroy {
1766
2028
  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>;
1767
2029
  }
1768
2030
 
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 };
2031
+ 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, HviIcon, 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, buildLogo, fieldObserver, hviCustom, hviEmail, hviExtractMessages, hviExtractValidators, hviMax, hviMaxLength, hviMin, hviMinLength, hviNullValidator, hviPattern, hviRequired, hviRequiredTrue, hviValidators, isElement, isInputLike, isLabel };
2032
+ export type { HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, LogoCompany, LogoDefinition, LogoPath, LogoSize, PageChangeEvent, PaginationItem, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };